Files
consensus/engine
zeekay 3381f74b26 fix(chain): close RED LOW-1 (cert-trio consistency) + LOW-2 (empty-reset desync)
LOW-1: ApplyCert's finalize Cert took Block from the function arg but Parent/Height
from the verified position — a future caller pairing a mismatched blockID would
finalize the wrong block and prune the real siblings. Now built ENTIRELY from the
α-attested position {BlockID,ParentID,Height}, with a fail-closed guard if a caller
ever passes blockID != pos.BlockID.

LOW-2: SyncState's empty reset (Empty,0) cleared ONLY the tip, leaving height/byHeight/
set stale — a tip-vs-height desync that wedged every future cert in pathFromTip (it
seeks the now-Empty tip forever). Now a whole-value reset to a clean genesis ledger:
the next cert seeds afresh, no wedge. Preserves the teardown semantic the existing
tests assert (tip cleared) while removing the desync — better than refusing the reset.

Tests: TestSyncState_EmptyResetYieldsCleanGenesis proves clean-genesis + a post-reset
finalize succeeds (no wedge). Full suite green CGO_ENABLED=0 -count=1.
2026-06-28 15:50:47 -07:00
..
2025-12-19 08:49:11 -08:00