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.