Skip to content

Restore canonical Beacon state without stale history - #87

Draft
0x00101010 wants to merge 7 commits into
feat/beacon-state-identityfrom
feat/beacon-state-restore
Draft

0x00101010 wants to merge 7 commits into
feat/beacon-state-identityfrom
feat/beacon-state-restore

Conversation

@0x00101010

Copy link
Copy Markdown

Why

Merging a checkpoint into live history leaves stale blocks and accounts, while restoring only RPC history gives the EVM incorrect block hashes and fees. Validate the complete local chain and replace Beacon state coherently.

What

  • Validate contiguous headers, parent hashes, slot timestamps, and the canonical tip before mutation.
  • Replace accounts, history, and snapshots, preserving exact saved nonces.
  • Restore pinned and local EVM block hashes and canonical time.
  • Restore successor fees even at the unmined fork boundary with an explicit base fee.

Notes

  • Ordinary legacy state loading keeps its merge semantics.
  • Implementation, tests, and review assisted by Amp.

0x00101010 and others added 5 commits October 5, 2026 20:41
Clearing the fork database drops cached block hashes, so BLOCKHASH(F) was refetched from the upstream's current canonical chain instead of the dump's fork identity.

Co-authored-by: Amp <amp@ampcode.com>

Amp-Thread-ID: https://ampcode.com/threads/T-01a10d69-00b6-7378-855f-af2b1a148692
Co-authored-by: Amp <amp@ampcode.com>
A Beacon load replaces state, so taking the maximum with the upstream nonce resurrected nonces deliberately set below it. Legacy loads keep merging.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a10d69-00b6-7378-855f-af2b1a148692
Loading a dump taken at the fork block derived fees from the upstream fork header, ignoring an explicit base fee the uninterrupted chain used. Fork setup now records the successor fee inputs, which boundary loads restore without an upstream request.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a10d69-00b6-7378-855f-af2b1a148692
Amp-Thread-ID: T-01a10d69-00b6-7378-855f-af2b1a148692
Amp-Thread-ID: T-01a10d69-00b6-7378-855f-af2b1a148692
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