Trait BlockVerification

Source
pub trait BlockVerification<Block>: Send + Sync
where Block: GenericOwnedBlock,
{ // Required method fn verify( &self, parent_header: &<<Block as GenericOwnedBlock>::Header as GenericOwnedBlockHeader>::Header<'_>, parent_block_mmr_root: &Blake3Hash, header: &<<Block as GenericOwnedBlock>::Header as GenericOwnedBlockHeader>::Header<'_>, body: &<<Block as GenericOwnedBlock>::Body as GenericOwnedBlockBody>::Body<'_>, origin: BlockOrigin, ) -> impl Future<Output = Result<(), BlockVerificationError>> + Send; }
Expand description

Block verification interface

Required Methods§

Source

fn verify( &self, parent_header: &<<Block as GenericOwnedBlock>::Header as GenericOwnedBlockHeader>::Header<'_>, parent_block_mmr_root: &Blake3Hash, header: &<<Block as GenericOwnedBlock>::Header as GenericOwnedBlockHeader>::Header<'_>, body: &<<Block as GenericOwnedBlock>::Body as GenericOwnedBlockBody>::Body<'_>, origin: BlockOrigin, ) -> impl Future<Output = Result<(), BlockVerificationError>> + Send

Verify provided block header/body, typically as part of the block import, without executing the block.

Expects (and doesn’t check) that parent_header correspond to header’s parent root, header corresponds to body and is internally consistent, see:

These invariants are not checked during verification.

Since verification doesn’t execute the block, state root is ignored and needs to be checked separately after/if block is re-executed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<PosTable, CI, CSS> BlockVerification<OwnedBeaconChainBlock> for BeaconChainBlockVerification<PosTable, CI, CSS>
where PosTable: Table, CI: ChainInfo<OwnedBeaconChainBlock>, CSS: ChainSyncStatus,