Skip to content

framework: advance sync verify_checkpoint past genesis + advanced-state vectors#672

Merged
tcoratger merged 1 commit intoleanEthereum:mainfrom
tcoratger:framework/sync-post-genesis
Apr 22, 2026
Merged

framework: advance sync verify_checkpoint past genesis + advanced-state vectors#672
tcoratger merged 1 commit intoleanEthereum:mainfrom
tcoratger:framework/sync-post-genesis

Conversation

@tcoratger
Copy link
Copy Markdown
Collaborator

🗒️ Description

Extends the `sync` fixture so `verify_checkpoint` can exercise states produced by walking an empty-block chain past genesis.

Framework change

  • `_make_verify_checkpoint` accepts an optional `anchorSlot` input. Zero (default) keeps genesis behaviour; positive values call `build_anchor` to walk through the slot and emit the advanced state.
  • Output grows an `anchorSlot` field echoing the input so consumers see exactly which state was verified.

Vectors landed

  • Advanced anchor at slot 3, four validators → accepted
  • Advanced anchor at slot 10, four validators → accepted
  • Advanced anchor at slot 5, eight validators → accepted

Why client-relevant

Real checkpoint-sync downloads fetch advanced (non-genesis) states. The existing `verify_checkpoint` vectors only exercise fresh genesis states, so deserialization bugs that only surface when `historical_block_hashes` is non-empty were not pinned.

🔗 Related Issues or PRs

Closes round-2 audit gap SY-1.

✅ Checklist

  • Ran `tox` checks to avoid unnecessary CI fails:
    ```console
    uvx tox -e all-checks
    ```
  • Considered adding appropriate tests for the changes.
  • N/A for docs — test-vector and fixture-extension PR.

🤖 Generated with Claude Code

…ing vectors

Extends the sync fixture so verify_checkpoint can exercise states
produced by walking an empty-block chain past genesis:

- _make_verify_checkpoint accepts an optional anchorSlot input. Zero
  (default) keeps genesis behaviour; positive values call build_anchor
  to walk through the slot and emit the advanced state.
- Output grows an anchorSlot field echoing the input so consumers see
  exactly which state was verified.

Adds three vectors:

- Advanced anchor at slot 3 with four validators (accepted)
- Advanced anchor at slot 10 with four validators (accepted)
- Advanced anchor at slot 5 with eight validators (accepted)

Closes the round-2 audit gap SY-1 that could not be pinned while the
sync fixture was locked to genesis states.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger merged commit d778f09 into leanEthereum:main Apr 22, 2026
13 checks passed
tcoratger added a commit to tcoratger/leanSpec that referenced this pull request Apr 27, 2026
Absorbs 14 commits from main and resolves two textual conflicts in
genesis/config.py and the matching test (PR leanEthereum#683 deleted the dead
GenesisConfig.create_state helper that this branch had refactored to
take a fork argument; production code goes through fork.generate_genesis
directly, so the wrapper is genuinely dead).

Reroutes two stale subspecs.containers imports left behind by the
auto-merge: a new test file from PR leanEthereum#684 (Checkpoint __lt__) and a
sync test fixture from PR leanEthereum#672. Both now resolve through
forks.devnet4.containers.

Tightens the docstring and inline comment introduced for
update_safe_target by PR leanEthereum#680 to follow the project's documentation
rules (short sentences, bullets over paragraphs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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