Struct solana_runtime::epoch_accounts_hash::manager::Manager
source · pub struct Manager {
state: Mutex<State>,
cvar: Condvar,
}
Expand description
Manage the epoch accounts hash
Handles setting when an EAH calculation is requested and when it completes. Also handles waiting for in-flight calculations to complete when the “stop” Bank must include it.
Fields§
§state: Mutex<State>
Current state of the epoch accounts hash
cvar: Condvar
This condition variable is used to wait for an in-flight EAH calculation to complete
Implementations§
source§impl Manager
impl Manager
fn _new(state: State) -> Self
sourcepub fn new_invalid() -> Self
pub fn new_invalid() -> Self
Create a new epoch accounts hash manager, with the initial state set to Invalid
sourcepub fn new_valid(epoch_accounts_hash: EpochAccountsHash, slot: Slot) -> Self
pub fn new_valid(epoch_accounts_hash: EpochAccountsHash, slot: Slot) -> Self
Create a new epoch accounts hash manager, with the initial state set to Valid
sourcepub fn set_in_flight(&self, slot: Slot)
pub fn set_in_flight(&self, slot: Slot)
An epoch accounts hash calculation has been requested; update our state
sourcepub fn set_valid(&self, epoch_accounts_hash: EpochAccountsHash, slot: Slot)
pub fn set_valid(&self, epoch_accounts_hash: EpochAccountsHash, slot: Slot)
An epoch accounts hash calculation has completed; update our state
sourcepub fn wait_get_epoch_accounts_hash(&self) -> EpochAccountsHash
pub fn wait_get_epoch_accounts_hash(&self) -> EpochAccountsHash
Get the epoch accounts hash
If an EAH calculation is in-flight, then this call will block until it completes.
sourcepub fn try_get_epoch_accounts_hash(&self) -> Option<EpochAccountsHash>
pub fn try_get_epoch_accounts_hash(&self) -> Option<EpochAccountsHash>
Get the epoch accounts hash
This fn does not block, and will only yield an EAH if the state is Valid