Skip to content

Commit 3545463

Browse files
tcoratgerclaude
andauthored
refactor(forks/lstar): make the genesis anchor slot explicit (leanEthereum#808)
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>
1 parent 787b768 commit 3545463

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • src/lean_spec/spec/forks/lstar

src/lean_spec/spec/forks/lstar/spec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ def process_block_header(self, state: State, block: Block) -> State:
243243
# updates rely entirely on validator attestations which are processed
244244
# later in the block body.
245245
if is_genesis_parent:
246-
state.latest_justified = Checkpoint(slot=state.latest_justified.slot, root=parent_root)
247-
state.latest_finalized = Checkpoint(slot=state.latest_finalized.slot, root=parent_root)
246+
state.latest_justified = Checkpoint(slot=Slot(0), root=parent_root)
247+
state.latest_finalized = Checkpoint(slot=Slot(0), root=parent_root)
248248

249249
# Historical Data Management
250250

@@ -644,7 +644,7 @@ def build_block(
644644
# updates the justified root to parent_root. Apply the same
645645
# derivation here so attestation sources match.
646646
if state.latest_block_header.slot == Slot(0):
647-
current_justified = Checkpoint(slot=state.latest_justified.slot, root=parent_root)
647+
current_justified = Checkpoint(slot=Slot(0), root=parent_root)
648648
else:
649649
current_justified = state.latest_justified
650650

0 commit comments

Comments
 (0)