pub trait FullConsensus<N: NodePrimitives>: Consensus<N::Block> {
// Required method
fn validate_block_post_execution(
&self,
block: &RecoveredBlock<N::Block>,
result: &BlockExecutionResult<N::Receipt>,
receipt_root_bloom: Option<ReceiptRootBloom>,
block_access_list_hash: Option<B256>,
) -> Result<(), ConsensusError>;
}Expand description
Consensus implementation which knows full node primitives and is able to validation block’s
execution outcome.
Required Methods§
Sourcefn validate_block_post_execution(
&self,
block: &RecoveredBlock<N::Block>,
result: &BlockExecutionResult<N::Receipt>,
receipt_root_bloom: Option<ReceiptRootBloom>,
block_access_list_hash: Option<B256>,
) -> Result<(), ConsensusError>
fn validate_block_post_execution( &self, block: &RecoveredBlock<N::Block>, result: &BlockExecutionResult<N::Receipt>, receipt_root_bloom: Option<ReceiptRootBloom>, block_access_list_hash: Option<B256>, ) -> 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: NodePrimitives, T: 'a + FullConsensus<N> + ?Sized> FullConsensus<N> for &'a T
impl<'a, N: NodePrimitives, T: 'a + FullConsensus<N> + ?Sized> FullConsensus<N> for &'a T
fn validate_block_post_execution( &self, block: &RecoveredBlock<N::Block>, result: &BlockExecutionResult<N::Receipt>, receipt_root_bloom: Option<ReceiptRootBloom>, block_access_list_hash: Option<B256>, ) -> Result<(), ConsensusError>
Source§impl<N: NodePrimitives, T: FullConsensus<N> + ?Sized> FullConsensus<N> for Arc<T>
impl<N: NodePrimitives, T: FullConsensus<N> + ?Sized> FullConsensus<N> for Arc<T>
fn validate_block_post_execution( &self, block: &RecoveredBlock<N::Block>, result: &BlockExecutionResult<N::Receipt>, receipt_root_bloom: Option<ReceiptRootBloom>, block_access_list_hash: Option<B256>, ) -> Result<(), ConsensusError>
Implementors§
impl<N: NodePrimitives> FullConsensus<N> for NoopConsensus
impl<N: NodePrimitives> FullConsensus<N> for TestConsensus
Available on crate features
test-utils only.