Catalog
fauziyasin-s2m4qw/erigon-exec-from-0

fauziyasin-s2m4qw

erigon-exec-from-0

Re-execute all Ethereum blocks from block 0 to reproduce bugs, validate state, or test correctness after code changes. Use this skill whenever the user wants to re-run execution from scratch, reset execution stage, reproduce a state mismatch, validate a fix by re-exec, or run blocks from the beginning on a specific chain/datadir.

v1.0LATEST
NewUpdated Aug 20, 2026

Re-execute all blocks from 0

Use this workflow to wipe execution state and re-run all blocks from block 0. Common reasons: reproducing a state root mismatch, validating a bug fix, testing new execution logic end-to-end.

Prerequisites

You need:

  • --datadir — path to the Erigon data directory (block snapshots must be present)
  • --chain — chain name (e.g. chiado, mainnet, gnosis, sepolia)

Step 1: Remove state snapshots (keep block snapshots)

go run ./cmd/erigon snapshots rm-all-state-snapshots --datadir <datadir>

This removes .kv state snapshot files but leaves .seg block snapshot files intact, so you don't need to re-download block data.

Step 2: Reset the execution stage

go run ./cmd/integration stage_exec --datadir <datadir> --chain=<chain> --reset

This clears the execution-stage progress in the database so the next run starts from block 0.

Step 3: Run execution

go run ./cmd/integration stage_exec --datadir <datadir> --chain=<chain> --batchSize=8m

Adjust --batchSize to control how frequently state is flushed to disk. Larger = faster but more RAM; 8m is a reasonable default.

Useful optional flags

Profiling (add when you want pprof):

--pprof --pprof.port=6160

Correctness assertions (add when hunting state bugs — slows execution):

ERIGON_ASSERT=true

Stop at a specific block (useful to reproduce a bug at block N):

--block=<N>

Verifying snapshot integrity

If you suspect corrupted snapshot files before running:

go run ./cmd/erigon seg integrity --datadir <datadir> --sample=0.001

Overall Score

82/100

Grade

B

Good

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

85

Quality

80

Clarity

85

Completeness

76

Summary

This skill guides users to re-execute all Ethereum blocks from genesis (block 0) in Erigon, a blockchain client. It provides a three-step workflow: remove state snapshots, reset execution stage, and re-run execution with configurable batch sizes. Includes optional profiling and correctness assertion flags for debugging.

Detected Capabilities

shell executionstate data deletiondatabase resetgo binary invocationprofiling enableblock snapshot integrity verification

Trigger Keywords

Phrases that agents use to match this skill to user intent.

re-execute blocks from 0reset erigon statereproduce state mismatchvalidate bug fix blockchainerigon full syncblock execution test

Risk Signals

INFO

Deletion of state snapshot files (kv files)

Step 1: Remove state snapshots
INFO

Database stage reset via --reset flag

Step 2: Reset the execution stage
INFO

No credential access or external network requests

All steps

Use Cases

  • Reproduce state root mismatches or consensus bugs
  • Validate bug fixes by re-executing the entire chain
  • Test new execution logic end-to-end on a local chain
  • Reset execution state after corrupting the database
  • Debug execution layer issues with profiling data
  • Run full block execution on non-mainnet chains (Gnosis, Chiado, Sepolia)

Quality Notes

  • Clear, step-by-step instructions well-suited to the task
  • Good prerequisite documentation (datadir, chain requirements)
  • Helpful context for each step explaining the purpose and side effects
  • Optional flags clearly documented with use cases (profiling, assertions, block limit)
  • Integrity check command provided for validating snapshot health before execution
  • Reasonable default value provided (--batchSize=8m) with explanation of trade-offs
  • Minor: could benefit from estimated execution time or RAM requirements for reference
Model: claude-haiku-4-5-20251001Analyzed: Aug 20, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use fauziyasin-s2m4qw/erigon-exec-from-0 in your dev environment

Command Palette

Search for a command to run...