mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
RED found a fail-OPEN in ReconcilePhantomFloor: it derived the intrinsic-guard
localVM via localLastAccepted, which returns (id,0,nil) when VM.GetBlock fails —
so a transiently-unreadable VM (exactly the recovery regime: a corrupt/half-
written store) was treated as height 0, degrading the guard to max(target,0)=
target. A node whose VM is actually AHEAD would then abandon its own committed
range (a self-inflicted fork).
Fix: read the VM directly and distinguish three cases —
- VM.LastAccepted errors -> refuse (fail-closed, floor unchanged)
- LastAccepted is a real id, unreadable -> refuse (present-but-corrupt; never 0)
- LastAccepted is ids.Empty -> genuinely empty (fresh/wiped): 0 is
correct, reconcile proceeds/no-ops
Tests: unreadable head -> refuse + floor unchanged; empty VM -> proceeds (target
governs). v1.35.10.
Co-authored-by: Hanzo Dev <[email protected]>