pub trait BlockVerification<Block>: Send + Syncwhere
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§
Sourcefn 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
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:
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, 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.