Skip to content

fix: preserve historical anvil state across suspends - #89

Merged
naps62 merged 1 commit into
mainfrom
fix/preserve-historical-states
Aug 11, 2026
Merged

fix: preserve historical anvil state across suspends#89
naps62 merged 1 commit into
mainfrom
fix/preserve-historical-states

Conversation

@naps62

@naps62 naps62 commented Aug 11, 2026

Copy link
Copy Markdown
Member

Adds --preserve-historical-states to the anvil args.

The idle suspend kills anvil and resumes it from --state state.json, which restores blocks and logs but not historical state — after any resume, eth_call at a pre-restart block fails with BlockOutOfRangeError. Any indexer replaying chain history breaks (the bullish staging Ponder indexer hit this today: it backfills events from block 0 and pins reads to each event's block).

Verified locally with anvil v1.7: mine + transact, kill, resume with the flag → eth_getBalance at pre-restart blocks returns correct historical values; without the flag the same query fails.

Note for existing stacks: state dropped by past suspends is unrecoverable — the flag only protects history written after it's in effect. Chains that need queryable history from genesis have to be reset once.

🤖 Generated with Claude Code

Suspend/resume kept blocks and logs but dropped historical state, so
eth_call at any pre-restart block failed with BlockOutOfRangeError —
breaking indexers that replay chain history (bit the bullish staging
indexer today).

Verified locally: with the flag, a killed-and-resumed anvil answers
eth_getBalance at pre-restart blocks; without it, the same query fails.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stacks Ready Ready Preview Aug 11, 2026 10:00am

Request Review

@naps62
naps62 merged commit 9796a36 into main Aug 11, 2026
3 of 4 checks passed
@naps62
naps62 deleted the fix/preserve-historical-states branch August 11, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant