How bnb-chain/reth works
Reth is a modular Ethereum execution-layer client. Its principal workflow is to configure and launch a node, receive consensus-layer Engine API payloads, validate and execute them, and maintain chain state for synchronization and queries. The map also includes networking, staged storage maintenance, pruning, and execution extensions. Relationships are limited to those shown in the README or sampled source/index; dashed links mark important runtime connections not verified by the excerpts.
Main entry points: engine.rs Engine tree · manager.rs Network manager · storage.rs Storage interfaces · node.rs CLI commands
Components 22
Node and API
- CLI commands
crates/cli/commands/src/node.rs - Engine options
crates/node/core/src/args/engine.rs - Node configuration
crates/node/core/src/node_config.rs - Node launch
crates/node/builder/src/launch/engine.rs - Engine API RPC
crates/rpc/rpc/src/engine.rs
Execution and payloads
- Ethereum payload validation
crates/ethereum/node/src/engine.rs - Engine tree
crates/engine/tree/src/engine.rs - Payload execution
crates/evm/evm/src/engine.rs - Transaction execution
crates/evm/evm/src/execute.rs - Payload building
crates/payload/builder/src/service.rs
Peer networking
- Network manager
crates/net/network/src/manager.rs - Peer and chain state
crates/net/network/src/state.rs - Peer data requests
crates/net/network/src/eth_requests.rs
Chain data
- Storage interfaces
crates/storage/storage-api/src/storage.rs - Storage hashing stage
crates/stages/stages/src/stages/hashing_storage.rs - Storage history index
crates/stages/stages/src/stages/index_storage_history.rs - Storage history pruning
crates/prune/prune/src/segments/user/storage_history.rs - Trie storage roots
crates/trie/db/src/storage.rs
Extensions
- Execution extensions
crates/exex/exex/src/manager.rs - Extension event log
crates/exex/exex/src/wal/storage.rs
Other components
- Node operator
- Consensus client
Connections 18
- Node operator → CLI commands: runs
README.md - CLI commands → Node launch: launches
- Engine options → Node configuration: configures
crates/node/core/src/args/engine.rs - Node configuration → Node launch: configures
- Consensus client → Engine API RPC: sends payloads
README.md - Engine API RPC → Engine tree: dispatches to
- Engine tree → Ethereum payload validation: validates payloads
- Engine tree → Payload execution: executes payloads
- Payload execution → Transaction execution: uses
crates/evm/evm/src/engine.rs - Engine tree → Payload building: requests builds
- Network manager → Peer and chain state: updates
crates/net/network/src/manager.rs - Network manager → Peer data requests: uses
crates/net/network/src/manager.rs - Network manager → Network manager: configures via builder
crates/net/network/src/manager.rs - Storage interfaces → Trie storage roots: provides reads
- Storage hashing stage → Storage interfaces: reads changesets
- Storage history index → Storage interfaces: indexes history
- Storage history pruning → Storage interfaces: prunes history
- Execution extensions → Extension event log: persists notifications