pub trait BlockProducerDatabase: Send + Sync {
// Required methods
fn latest_height(&self) -> Option<BlockHeight>;
fn get_block(
&self,
height: &BlockHeight,
) -> StorageResult<Cow<'_, CompressedBlock>>;
fn block_header_merkle_root(
&self,
height: &BlockHeight,
) -> StorageResult<Bytes32>;
fn latest_consensus_parameters_version(
&self,
) -> StorageResult<ConsensusParametersVersion>;
fn latest_state_transition_bytecode_version(
&self,
) -> StorageResult<StateTransitionBytecodeVersion>;
}
Required Methods§
Sourcefn latest_height(&self) -> Option<BlockHeight>
fn latest_height(&self) -> Option<BlockHeight>
Returns the latest block height.
Sourcefn get_block(
&self,
height: &BlockHeight,
) -> StorageResult<Cow<'_, CompressedBlock>>
fn get_block( &self, height: &BlockHeight, ) -> StorageResult<Cow<'_, CompressedBlock>>
Gets the committed block at the height
.
Sourcefn block_header_merkle_root(
&self,
height: &BlockHeight,
) -> StorageResult<Bytes32>
fn block_header_merkle_root( &self, height: &BlockHeight, ) -> StorageResult<Bytes32>
Gets the block header BMT MMR root at height
.
Sourcefn latest_consensus_parameters_version(
&self,
) -> StorageResult<ConsensusParametersVersion>
fn latest_consensus_parameters_version( &self, ) -> StorageResult<ConsensusParametersVersion>
Returns the latest consensus parameters version.
Sourcefn latest_state_transition_bytecode_version(
&self,
) -> StorageResult<StateTransitionBytecodeVersion>
fn latest_state_transition_bytecode_version( &self, ) -> StorageResult<StateTransitionBytecodeVersion>
Returns the latest state transition bytecode version.