Expand description
Consensus protocol functions
§Trait hierarchy
Consensus validation is split across three traits, each adding a layer:
-
HeaderValidator— validates a header in isolation and against its parent. Used early in the validation pipeline before block execution. -
Consensus— extendsHeaderValidatorwith block body validation. Checks that the body matches the header (tx root, ommer hash, withdrawals) and runs pre-execution checks. Used before a block is executed. -
FullConsensus— extendsConsensuswith post-execution validation. Checks execution results against the header (gas used, receipt root, logs bloom). Used after block execution to verify the outcome.
In the engine, these are applied in order during payload validation (engine_newPayload).
Payload attribute validation for block building (engine_forkchoiceUpdated) is handled
separately at the engine API layer and does not use these traits.
Modules§
- noop
- A consensus implementation that does nothing. A consensus implementation that does nothing.
- test_
utils test-utils - test helpers for mocking consensus
Structs§
- Header
Consensus Error HeaderConsensusErrorcombines aConsensusErrorwith theSealedHeaderit relates to.- TxGas
Limit TooHigh Err - EIP-7825: Transaction gas limit exceeds maximum allowed
Enums§
- Consensus
Error - Consensus Errors
Traits§
- Consensus
- Consensus is a protocol that chooses canonical chain.
- Full
Consensus Consensusimplementation which knows full node primitives and is able to validation block’s execution outcome.- Header
Validator HeaderValidatoris a protocol that validates headers and their relationships.
Type Aliases§
- Receipt
Root Bloom - Pre-computed receipt root and logs bloom.
- Transaction
Root - Pre-computed transaction root.