Files
consensus/engine
zeekayandHanzo Dev 6fd4f3d858 fix(engine/chain): RED round — verify-before-slash (H1), fetch deferred valid cert (M1), roll-discipline doc (M2)
H1 (HIGH, false-slash): HandleIncomingCert recorded slashing DoubleVote evidence on
the height-gate branch BEFORE any signature verification. A forged cert (junk
signatures naming honest validators, a random different canonical, height <=
finalized) jailed honest validators below quorum -> re-halt. FIX: a conflicting cert
is fork EVIDENCE only after it passes the FULL predicate. Extracted Transitive.verifyCert
(the single signature+active-set+quorum gate, stake-weighted when wired) and run it
BEFORE reportCertEquivocation; the finalize path reuses the same helper. A forged cert
now slashes NOBODY and finalizes nothing. Regression:
TestE2E_ForgedConflictingCertSlashesNobody (zero records, nobody jailed); the genuine
canonical fork still records evidence (TestE2E_GenuineForkCertStillSlashes).

M1 (liveness/eclipse): a VERIFIED finality proof for a block we do not track was
silently dropped, so a targeted-eclipsed follower (adopted a losing sibling envelope)
stalled on finalization forever. FIX: on a verified-but-untracked cert, trigger a
throttled best-effort catch-up fetch for the certified block (requestCatchup,
claimCatchupLocked rate-limited). The fetch is gated on verification, so a forged cert
cannot amplify fetches. Regression: TestE2E_DeferredValidCertTriggersFetch (valid cert
fetches the winning block; forged cert triggers no fetch).

M2 (roll discipline, doc): documented on QuorumCertVersion that the version is
fail-SAFE (cross-version certs fail closed, no fork) but NOT fail-live across the
skew — cut >= alpha validators to v3 atomically per net, and the v2 baseline must
already carry the converge-on-A recovery so the mixed window is not halt-prone.

Full proof suite re-run green: 6-row matrix + invariant + inversions + H1/M1
regressions (337 tests), go vet clean, staticcheck adds zero findings, -race clean,
both fuzzers clean (codec 461k execs, finalize-decision 81k execs, 0 crashes).

No deploy/push/merge/tag — back to RED for re-review.

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-30 14:28:53 -07:00
..
2025-12-19 08:49:11 -08:00