What problem does it solve?
When debugging state root mismatches or validating execution-layer code changes in Erigon, developers need a reliable way to wipe execution state and re-run every block from genesis without re-downloading block data.
Core Features & Use Cases
- State snapshot cleanup: Removes
.kv state snapshots while preserving .seg block snapshots so block data does not need to be re-downloaded.
- Execution stage reset: Clears execution-stage progress in the database so the next run starts from block 0.
- Controlled re-execution: Runs
stage_exec with tunable batch size, optional pprof profiling, correctness assertions via ERIGON_ASSERT, and a --block flag to stop at a specific height.
- Use Case: After fixing a state root mismatch at block 5,000,000 on the chiado chain, reset the execution stage and re-run blocks up to that height with assertions enabled to confirm the fix.
Quick Start
Ask the assistant to reset the execution stage and re-run all blocks from block 0 on your Erigon datadir for a given chain.