BlockVerification

Trait BlockVerification 

Source
pub trait BlockVerification<Block>: Send + Sync
where Block: GenericOwnedBlock,
{ // Required methods fn verify_concurrent<BCI>( &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, beacon_chain_info: &BCI, ) -> impl Future<Output = Result<(), BlockVerificationError>> + Send where BCI: DeriveConsensusParametersChainInfo + ShardMembershipEntropySourceChainInfo; fn verify_sequential( &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_concurrent<BCI>( &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, beacon_chain_info: &BCI, ) -> impl Future<Output = Result<(), BlockVerificationError>> + Send
where BCI: DeriveConsensusParametersChainInfo + ShardMembershipEntropySourceChainInfo,

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

This method can be called concurrently even for interdependent blocks.

Expects (and doesn’t check) that parent_header corresponds 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, the state root is ignored and needs to be checked separately after/if the block is re-executed.

Source

fn verify_sequential( &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

Complementary to Self::verify_concurrent() that expects the parent block to be already successfully imported.

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,