mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
pathFromTip resolved every intermediate ancestor by its OUTER proposervm-wrapper id with no canonical fallback — the one finality path the mainnet-644 canonicalization missed (vote placement, cert's-own-block, and the equivocation key were all canonicalized; this walk was not). Under sustained saturation the fleet tracks distinct wrappers of the same inner block (aliases, not forks); a verified cert threading a peer's wrapper could not be applied by a node holding the identical inner execution under its own wrapper, so finality livelocked on an unservable outer id (~1174 finality-guard refusals/min, tip frozen ~2h, safety held — no fork). Carry the signature-covered ParentCanonical through the fold Cert (it was dropped at the engine.go seam); on an outer-id miss, collapse to a locally-held sibling wrapper of the same inner commitment (WrapperByCanonical) before the fail-closed defer, rebasing the child's parent link so sibling-pruning keys on the held envelope. A genuinely unheld inner block still returns ErrAncestorNotTracked (behind-node defer preserved). Bare chains and the normal tracked-outer path are byte-for-byte unchanged (empty ParentCanonical ⇒ outer-id-only walk; the miss branch is additive). Alias-collapse is sound because canonicalRep = CanonicalID() is a collision-resistant hash of the inner execution (binds inner parent + payload + state root) that no unverified block can spoof — every tracked block is Verify()'d before AddBlock, and the matched parent commitment is signature-covered in the cert. It can therefore only ever stand in a byte-identical execution, never a divergent state: no fork risk HEAD lacked, livelock closed. RED-verified SHIP: 0 critical / 0 high / 0 medium (2 optional-cleanup LOWs), 12 adversarial tests + the 107-test finality suite green, go build + vet clean. Regression guards: intermediate_sibling_livelock_test.go (repro FAIL->PASS), intermediate_sibling_adversarial_test.go, wrapper_bycanonical_adversarial_test.go. Co-authored-by: Hanzo Dev <[email protected]>