You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(forkchoice): correct LMD-GHOST orphan-skip, tighten checkpoint advance, assert start_root
Three correctness fixes surfaced by the consensus-researcher review.
Behavior on the hot path is preserved; an inconsistency between on_block
and build_block tie semantics is resolved in favor of the documented
"store-authoritative on tie" rule.
1. _compute_lmd_ghost_head orphan-skip was dead code.
`if not block.parent_root: continue` was always False because
`block.parent_root` is `Bytes32` (always 32 bytes, never empty).
Genesis blocks landed under children_map[Bytes32.zero()] instead of
being skipped. The bucket was never consulted because the walk
anchors at the justified root and only descends. The misleading
filter is removed; a comment now explains why genesis cannot
pollute the walk.
2. Checkpoint advance semantics centralized in Checkpoint.advance_to.
Two `max(...)` call sites in lstar/spec.py had opposite argument
orders, which silently produced opposite tie behavior. The comment
at on_block explicitly documents "store wins on tie"; build_block
contradicted that. Both sites now use store.latest_*.advance_to(...)
which encodes the documented intent in the type itself.
3. _compute_lmd_ghost_head now asserts start_root is a known block.
Previously a bad anchor produced a cryptic KeyError deep in the
weight loop. The assert states the invariant up front. An existing
test that constructed a malformed store is updated to expect the
clearer AssertionError.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* style(checkpoint): split module docstring sentences per doc rules
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments