Skip to main content

FullConsensus

Trait FullConsensus 

Source
pub trait FullConsensus<N>: Consensus<<N as NodePrimitives>::Block>
where N: NodePrimitives,
{ // Required method fn validate_block_post_execution( &self, block: &RecoveredBlock<<N as NodePrimitives>::Block>, result: &BlockExecutionResult<<N as NodePrimitives>::Receipt>, receipt_root_bloom: Option<(FixedBytes<32>, Bloom)>, block_access_list_hash: Option<FixedBytes<32>>, ) -> Result<(), ConsensusError>; }
Available on crate feature consensus only.
Expand description

Consensus implementation which knows full node primitives and is able to validation block’s execution outcome.

Required Methods§

Source

fn validate_block_post_execution( &self, block: &RecoveredBlock<<N as NodePrimitives>::Block>, result: &BlockExecutionResult<<N as NodePrimitives>::Receipt>, receipt_root_bloom: Option<(FixedBytes<32>, Bloom)>, block_access_list_hash: Option<FixedBytes<32>>, ) -> Result<(), ConsensusError>

Validate a block considering world state, i.e. things that can not be checked before execution.

See the Yellow Paper sections 4.3.2 “Holistic Validity”.

If receipt_root_bloom is provided, the implementation should use the pre-computed receipt root and logs bloom instead of computing them from the receipts.

Note: validating blocks does not include other validations of the Consensus

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, N, T> FullConsensus<N> for &'a T

Source§

fn validate_block_post_execution( &self, block: &RecoveredBlock<<N as NodePrimitives>::Block>, result: &BlockExecutionResult<<N as NodePrimitives>::Receipt>, receipt_root_bloom: Option<(FixedBytes<32>, Bloom)>, block_access_list_hash: Option<FixedBytes<32>>, ) -> Result<(), ConsensusError>

Source§

impl<N, T> FullConsensus<N> for Arc<T>

Source§

fn validate_block_post_execution( &self, block: &RecoveredBlock<<N as NodePrimitives>::Block>, result: &BlockExecutionResult<<N as NodePrimitives>::Receipt>, receipt_root_bloom: Option<(FixedBytes<32>, Bloom)>, block_access_list_hash: Option<FixedBytes<32>>, ) -> Result<(), ConsensusError>

Implementors§

Source§

impl<ChainSpec, N> FullConsensus<N> for EthBeaconConsensus<ChainSpec>
where ChainSpec: Send + Sync + EthChainSpec<Header = <N as NodePrimitives>::BlockHeader> + EthereumHardforks + Debug, N: NodePrimitives,

Source§

impl<N> FullConsensus<N> for NoopConsensus
where N: NodePrimitives,

Source§

impl<N> FullConsensus<N> for TestConsensus
where N: NodePrimitives,