mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
Extends the durable vote-guard to v3: persists the view-change LOCK ROUND per height (round+1 sentinel in the record's reserved field, 0=none, byte-length identical to v1/v2). A restarted view-change node seeds its roundView lock (round+value) from disk and re-converges LOCALLY at a recovered height under the unlock rule, instead of the conservative hard-lock a round-less recovery forces. Legacy v1/v2 bindings (no lock round) still hard-lock (fail-safe). decode accepts v1/v2/v3 (upgrade window; fail-closed on corrupt). Persist/Snapshot interface gains lockRounds + LockRoundsSnapshot. Tests: FileRoundTrip (lock rounds round-trip), V3LockRound_SeedsRoundViewLock (v3 seed vs legacy hard-lock), RecoveredLock (direct binding hard-locks), LegacyMultiEpochFold (v2->v3 window). Full suite green. Co-authored-by: Hanzo Dev <[email protected]>