pub trait FinalStateController: Send + Sync {
Show 24 methods
// Required methods
fn get_fingerprint(&self) -> Hash;
fn get_slot(&self) -> Slot;
fn get_execution_trail_hash(&self) -> Hash;
fn reset(&mut self);
fn compute_initial_draws(&mut self) -> Result<(), FinalStateError>;
fn finalize(&mut self, slot: Slot, changes: StateChanges);
fn recompute_caches(&mut self);
fn is_db_valid(&self) -> bool;
fn init_execution_trail_hash_to_batch(&mut self, batch: &mut DBBatch);
fn get_ledger(&self) -> &Box<dyn LedgerController>;
fn get_ledger_mut(&mut self) -> &mut Box<dyn LedgerController>;
fn get_async_pool(&self) -> &AsyncPool;
fn get_pos_state(&self) -> &PoSFinalState;
fn get_pos_state_mut(&mut self) -> &mut PoSFinalState;
fn executed_ops_contains(&self, op_id: &OperationId) -> bool;
fn get_ops_exec_status(&self, batch: &[OperationId]) -> Vec<Option<bool>>;
fn get_executed_denunciations(&self) -> &ExecutedDenunciations;
fn get_database(&self) -> &ShareableMassaDBController;
fn get_last_start_period(&self) -> u64;
fn set_last_start_period(&mut self, last_start_period: u64);
fn get_last_slot_before_downtime(&self) -> &Option<Slot>;
fn set_last_slot_before_downtime(
&mut self,
last_slot_before_downtime: Option<Slot>,
);
fn get_mip_store(&self) -> &MipStore;
fn get_mip_store_mut(&mut self) -> &mut MipStore;
}
Expand description
Trait for final state controller.
Required Methods§
sourcefn get_fingerprint(&self) -> Hash
fn get_fingerprint(&self) -> Hash
Get the fingerprint (hash) of the final state. Note that only one atomic write per final slot occurs, so this can be safely queried at any time.
sourcefn get_execution_trail_hash(&self) -> Hash
fn get_execution_trail_hash(&self) -> Hash
Gets the hash of the execution trail
sourcefn compute_initial_draws(&mut self) -> Result<(), FinalStateError>
fn compute_initial_draws(&mut self) -> Result<(), FinalStateError>
Performs the initial draws.
sourcefn finalize(&mut self, slot: Slot, changes: StateChanges)
fn finalize(&mut self, slot: Slot, changes: StateChanges)
Applies changes to the execution state at a given slot, and settles that slot forever. Once this is called, the state is attached at the output of the provided slot.
Panics if the new slot is not the one coming just after the current one.
sourcefn recompute_caches(&mut self)
fn recompute_caches(&mut self)
After bootstrap or load from disk, recompute all the caches.
sourcefn is_db_valid(&self) -> bool
fn is_db_valid(&self) -> bool
Deserialize the entire DB and check the data. Useful to check after bootstrap.
sourcefn init_execution_trail_hash_to_batch(&mut self, batch: &mut DBBatch)
fn init_execution_trail_hash_to_batch(&mut self, batch: &mut DBBatch)
Initialize the execution trail hash to zero.
sourcefn get_ledger(&self) -> &Box<dyn LedgerController>
fn get_ledger(&self) -> &Box<dyn LedgerController>
Get ledger
sourcefn get_ledger_mut(&mut self) -> &mut Box<dyn LedgerController>
fn get_ledger_mut(&mut self) -> &mut Box<dyn LedgerController>
Get ledger mut
sourcefn get_async_pool(&self) -> &AsyncPool
fn get_async_pool(&self) -> &AsyncPool
Get async pool
sourcefn get_pos_state(&self) -> &PoSFinalState
fn get_pos_state(&self) -> &PoSFinalState
Get pos state
sourcefn get_pos_state_mut(&mut self) -> &mut PoSFinalState
fn get_pos_state_mut(&mut self) -> &mut PoSFinalState
Get pos state mut
sourcefn executed_ops_contains(&self, op_id: &OperationId) -> bool
fn executed_ops_contains(&self, op_id: &OperationId) -> bool
check if an operation is in the executed ops
sourcefn get_ops_exec_status(&self, batch: &[OperationId]) -> Vec<Option<bool>>
fn get_ops_exec_status(&self, batch: &[OperationId]) -> Vec<Option<bool>>
Get the executed status ops
sourcefn get_executed_denunciations(&self) -> &ExecutedDenunciations
fn get_executed_denunciations(&self) -> &ExecutedDenunciations
Get executed denunciations
sourcefn get_database(&self) -> &ShareableMassaDBController
fn get_database(&self) -> &ShareableMassaDBController
Get the database
sourcefn get_last_start_period(&self) -> u64
fn get_last_start_period(&self) -> u64
Get last start period
sourcefn set_last_start_period(&mut self, last_start_period: u64)
fn set_last_start_period(&mut self, last_start_period: u64)
Set last start period
sourcefn get_last_slot_before_downtime(&self) -> &Option<Slot>
fn get_last_slot_before_downtime(&self) -> &Option<Slot>
Get last slot before downtime
sourcefn set_last_slot_before_downtime(
&mut self,
last_slot_before_downtime: Option<Slot>,
)
fn set_last_slot_before_downtime( &mut self, last_slot_before_downtime: Option<Slot>, )
Set last slot before downtime
sourcefn get_mip_store(&self) -> &MipStore
fn get_mip_store(&self) -> &MipStore
Get MIP Store
sourcefn get_mip_store_mut(&mut self) -> &mut MipStore
fn get_mip_store_mut(&mut self) -> &mut MipStore
Get mutable reference to MIP Store