pub trait BlockVerification<Block>: Send + Syncwhere
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§
Sourcefn 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>> + Sendwhere
BCI: DeriveConsensusParametersChainInfo + ShardMembershipEntropySourceChainInfo,
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>> + Sendwhere
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:
Block::is_internally_consistent()BlockHeader::is_internally_consistent()BlockBody::is_internally_consistent()
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.
Sourcefn 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
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.