Expand description
Provides types and functions for stateless execution and validation of Ethereum blocks.
This crate enables the verification of block execution without requiring access to a full node’s persistent database. Instead, it relies on pre-generated “witness” data that proves the specific state accessed during the block’s execution.
§Key Components
WitnessDatabase
: An implementation of [reth_revm::Database
] that uses a [reth_trie_sparse::SparseStateTrie
] populated from witness data, along with provided bytecode and ancestor block hashes, to serve state reads during execution.stateless_validation
: The core function that orchestrates the stateless validation process. It takes a block, its execution witness, ancestor headers, and chain specification, then performs:- Witness verification against the parent block’s state root.
- Block execution using the
WitnessDatabase
. - Post-execution consensus checks.
- Post-state root calculation and comparison against the block header.
§Usage
The primary entry point is typically the validation::stateless_validation
function. Callers
need to provide the block to be validated along with accurately generated ExecutionWitness
data corresponding to that block’s execution trace and the necessary Headers of ancestor
blocks.
Modules§
- validation
- Implementation of stateless validation
Structs§
- Execution
Witness - Represents the execution witness of a block. Contains an optional map of state preimages.
- Stateless
Input - StatelessInput is a convenience structure for serializing the input needed for the stateless validation function.