Problem
Reth’s defaulteth_getProof implementation works by reverting in-memory state diffs backward from the current tip. For blocks older than ~7 days, this causes unbounded memory growth and out-of-memory (OOM) crashes — a critical issue for infrastructure serving rollup fault proofs and indexers that query historical state.
Solution
The proofs-history ExEx implements a Versioned State Store that tracks intermediate Merkle Patricia Trie nodes tagged by block number. This enables direct O(1) lookups of proofs at any historical block within a configurable retention window, without reverting state. The ExEx processes blocks asynchronously, so it adds zero overhead to sync speed and negligible tip latency.Architecture
| Table | Contents |
|---|---|
AccountTrieHistory | Branch nodes of the account trie, versioned by block |
StorageTrieHistory | Branch nodes of per-account storage tries, versioned by block |
HashedAccountHistory | Account leaf data (balance, nonce, etc.), versioned by block |
HashedStorageHistory | Storage slot values, versioned by block |
BlockChangeSet reverse index enables efficient pruning: given a block number, the pruner knows exactly which keys were modified and can delete only those entries.
Prerequisites
- op-reth v1.11.4-rc.2 or above, fully synced to chain tip.
- Basic understanding of execution client configuration.
- Sufficient disk: estimate
chain_size + 20% bufferfor the proofs database (e.g., ~1 TB for 4 weeks on Base at 2s block time). - NVMe SSD recommended.
Installation
First, clone and build theop-reth binary from the op-rs fork.
./target/release/op-reth.
Initialization Steps
Runningop-reth with historical proofs requires a two-step initialization process:
- Initialize the standard
op-rethdatabase. - Initialize the specific
proofsstorage.
1. Initialize op-reth
Initialize the core database with the genesis file for your chosen chain (e.g.,optimism).
Option: Start from a Snapshot
If you prefer to start from a pre-synchronized database snapshot instead of syncing from genesis:- Download and extract the
op-rethsnapshot into yourdatadir. - Skip the
op-reth initcommand (step 1 above). - Proceed to Initialize Proofs Storage (step 2 below). The
proofs initcommand will initialize the proofs storage based on the state present in the snapshot.
2. Initialize Proofs Storage
Initialize the separate storage used by the ExEx to store historical proofs.Running op-reth
Once initialized, you can start the execution client with the--proofs-history flag enabled.
Make sure to include all other standard flags required for your network (e.g., specific bootnodes). See the configuration reference for details.
Running Consensus Node
Start the consensus client to drive the execution client. You can use eitherop-node or kona-node.
- op-node
- kona-node
op-node is the reference implementation of the OP Stack consensus client, written in Go.Verification
After starting both clients, query the sync status of the proofs store:latest tracks the chain tip, eth_getProof calls for every block within [earliest, latest] will be served from the versioned store.
You can also check the op-reth logs for initialization messages:
op-node/kona-node and op-reth are connected and syncing. op-reth should start importing blocks and the proofs storage should begin populating.
Operational Commands
Manual prune (if the node fails startup due to a gap > 1000 blocks):You can only unwind to a block after the earliest block number in the database. Unwinding to a block before the earliest will fail.
Performance
Benchmarked on Base Sepolia (~700k block window, WETH contract):| Metric | Value |
|---|---|
| Avg latency | ~15 ms per eth_getProof |
| Throughput | ~5,000 req/s (10 concurrent workers) |
| Sync overhead | Zero (ExEx processes asynchronously) |
| Memory | Bounded by window size — no OOM risk |