Skip to main content

Crate reth_consensus

Crate reth_consensus 

Source
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 — extends HeaderValidator with 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 — extends Consensus with 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_utilstest-utils
test helpers for mocking consensus

Structs§

HeaderConsensusError
HeaderConsensusError combines a ConsensusError with the SealedHeader it relates to.
TxGasLimitTooHighErr
EIP-7825: Transaction gas limit exceeds maximum allowed

Enums§

ConsensusError
Consensus Errors

Traits§

Consensus
Consensus is a protocol that chooses canonical chain.
FullConsensus
Consensus implementation which knows full node primitives and is able to validation block’s execution outcome.
HeaderValidator
HeaderValidator is a protocol that validates headers and their relationships.

Type Aliases§

ReceiptRootBloom
Pre-computed receipt root and logs bloom.
TransactionRoot
Pre-computed transaction root.