pub struct LoadedProgramsForTxBatch {
pub environments: ProgramRuntimeEnvironments,
pub upcoming_environments: Option<ProgramRuntimeEnvironments>,
pub latest_root_epoch: Epoch,
pub hit_max_limit: bool,
/* private fields */
}
Fields§
§environments: ProgramRuntimeEnvironments
§upcoming_environments: Option<ProgramRuntimeEnvironments>
Anticipated replacement for environments
at the next epoch.
This is None
during most of an epoch, and only Some
around the boundaries (at the end and beginning of an epoch).
More precisely, it starts with the recompilation phase a few hundred slots before the epoch boundary,
and it ends with the first rerooting after the epoch boundary.
Needed when a program is deployed at the last slot of an epoch, becomes effective in the next epoch.
So needs to be compiled with the environment for the next epoch.
latest_root_epoch: Epoch
The epoch of the last rerooting
hit_max_limit: bool
Implementations§
source§impl LoadedProgramsForTxBatch
impl LoadedProgramsForTxBatch
pub fn new( slot: Slot, environments: ProgramRuntimeEnvironments, upcoming_environments: Option<ProgramRuntimeEnvironments>, latest_root_epoch: Epoch ) -> Self
pub fn new_from_cache<FG: ForkGraph>( slot: Slot, epoch: Epoch, cache: &LoadedPrograms<FG> ) -> Self
sourcepub fn get_environments_for_epoch(
&self,
epoch: Epoch
) -> &ProgramRuntimeEnvironments
pub fn get_environments_for_epoch( &self, epoch: Epoch ) -> &ProgramRuntimeEnvironments
Returns the current environments depending on the given epoch
sourcepub fn replenish(
&mut self,
key: Pubkey,
entry: Arc<LoadedProgram>
) -> (bool, Arc<LoadedProgram>)
pub fn replenish( &mut self, key: Pubkey, entry: Arc<LoadedProgram> ) -> (bool, Arc<LoadedProgram>)
Refill the cache with a single entry. It’s typically called during transaction loading, and
transaction processing (for program management instructions).
It replaces the existing entry (if any) with the provided entry. The return value contains
true
if an entry existed.
The function also returns the newly inserted value.
pub fn find(&self, key: &Pubkey) -> Option<Arc<LoadedProgram>>
pub fn slot(&self) -> Slot
pub fn set_slot_for_tests(&mut self, slot: Slot)
pub fn merge(&mut self, other: &Self)
Trait Implementations§
source§impl Clone for LoadedProgramsForTxBatch
impl Clone for LoadedProgramsForTxBatch
source§fn clone(&self) -> LoadedProgramsForTxBatch
fn clone(&self) -> LoadedProgramsForTxBatch
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more