refactor(forks/lstar): make the genesis anchor slot explicit#808
Merged
tcoratger merged 1 commit intoMay 31, 2026
Merged
Conversation
Anchoring the genesis block as justified and finalized swapped in the parent root but kept the pre-state checkpoint slot. That was correct only because both checkpoint slots are still zero when the first post-genesis block is processed, a hidden dependency a reader had to reconstruct. Write the slot as zero directly at both the header-processing anchor and its mirror in the block builder, so the genesis anchor reads as a fixed slot-zero checkpoint. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the first post-genesis block is processed, the genesis block is forced to be justified and finalized. The code swapped in the parent root but kept the pre-state checkpoint slot:
This is correct only because both checkpoint slots are still
0at that point (genesis initializes them toSlot(0), and slot processing never touches checkpoints). A reader had to reconstruct that invariant to convince themselves the slot was right.This writes the slot as
Slot(0)directly, at both the header-processing anchor and its mirror in the block builder, so the genesis anchor reads as a fixed slot-zero checkpoint with no hidden dependency on the pre-state.No behavior change —
state.latest_justified.slotandstate.latest_finalized.slotare provably0on both paths (each builds on the genesis state).Testing
just lint(ruff) — passedjust typecheck(ty) — passedtests/.../lstar/state/+test_block_production_justification_gap) — 17 passed🤖 Generated with Claude Code