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§

source

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.

source

fn get_slot(&self) -> Slot

Get the slot at the end of which the final state is attached

source

fn get_execution_trail_hash(&self) -> Hash

Gets the hash of the execution trail

source

fn reset(&mut self)

Reset the final state to the initial state.

USED ONLY FOR BOOTSTRAP

source

fn compute_initial_draws(&mut self) -> Result<(), FinalStateError>

Performs the initial draws.

source

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.

source

fn recompute_caches(&mut self)

After bootstrap or load from disk, recompute all the caches.

source

fn is_db_valid(&self) -> bool

Deserialize the entire DB and check the data. Useful to check after bootstrap.

source

fn init_execution_trail_hash_to_batch(&mut self, batch: &mut DBBatch)

Initialize the execution trail hash to zero.

source

fn get_ledger(&self) -> &Box<dyn LedgerController>

Get ledger

source

fn get_ledger_mut(&mut self) -> &mut Box<dyn LedgerController>

Get ledger mut

source

fn get_async_pool(&self) -> &AsyncPool

Get async pool

source

fn get_pos_state(&self) -> &PoSFinalState

Get pos state

source

fn get_pos_state_mut(&mut self) -> &mut PoSFinalState

Get pos state mut

source

fn executed_ops_contains(&self, op_id: &OperationId) -> bool

check if an operation is in the executed ops

source

fn get_ops_exec_status(&self, batch: &[OperationId]) -> Vec<Option<bool>>

Get the executed status ops

source

fn get_executed_denunciations(&self) -> &ExecutedDenunciations

Get executed denunciations

source

fn get_database(&self) -> &ShareableMassaDBController

Get the database

source

fn get_last_start_period(&self) -> u64

Get last start period

source

fn set_last_start_period(&mut self, last_start_period: u64)

Set last start period

source

fn get_last_slot_before_downtime(&self) -> &Option<Slot>

Get last slot before downtime

source

fn set_last_slot_before_downtime( &mut self, last_slot_before_downtime: Option<Slot>, )

Set last slot before downtime

source

fn get_mip_store(&self) -> &MipStore

Get MIP Store

source

fn get_mip_store_mut(&mut self) -> &mut MipStore

Get mutable reference to MIP Store

Implementors§