{"id":"XE-7898","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":1790,"title":"core: multisig_update winner against unfinalized multisig_open can never promote - cascade deletes the keyset the winner needs, stalling the position forever","area":"consensus","claimed_tier":"high","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":true,"internal_ref":"#954","internal_url":"https://github.com/xeprotocol/core/issues/954","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-11T19:14:42.298113+00:00","updated_at":"2026-11-17T09:38:15.176154+00:00","source_created_at":null,"told_at":"2026-11-17T09:38:15.193748+00:00","status_changed_at":"2026-11-17T09:38:15.181455+00:00","url":"https://bounty.xe.network/XE-7898","body":"## Summary\r\n\r\nA `multisig_update` block with `Previous=\"0\"`, signed by a member of the loser's keyset, passes staged validation and can win a quorum vote (nodes vote the lowest hash). But promotion always fails: unwinding the `multisig_open` loser deletes the keyset the winner's full validation needs, so `validateAndAddMultisigUpdate` returns `multisig_update: account is not multisig`. The failure is deterministic, so the 30s quarantine re-attempts it forever: the loser never finalizes, the position never resolves, and the node's finality watermark stalls until `/ready` reports not-ready. The winner is content-valid — its failure is created by the promotion machinery itself, not by the block's content.\r\n\r\n## Impact\r\n\r\n- A single conflicting pair (one `multisig_open`, one `multisig_update` with `Previous=\"0\"` for the same account) permanently stalls one chain position on every node that sees the conflict.\r\n- Finality stops advancing for that position; `/ready` reports not-ready (`finality_advancing` fails). In the reproduction run the conflict was still open after more than three minutes of 30s retries, with the finality watermark stalled past its 90s limit.\r\n- No funds move and no state is corrupted — the damage is liveness (a stuck position plus a node that reports not-ready), not safety. Triggering it needs only a valid signature from a member of the loser's keyset, i.e. a legitimate participant of that multisig.\r\n\r\n## Reproduction (live, local 2-node network)\r\n\r\nNetwork: `testnet-local-audit`, commit 89a542e, two nodes peered over loopback (node1 holds 100% vote weight). No public testnet nodes were involved.\r\n\r\n1. Create multisig account `f7d0c63f3bf1...` via a `multisig_open` block O1 (`8146b2b2558b...`).\r\n2. Before O1 finalizes, submit a conflicting `multisig_update` block U (`07d0f6a83b3e...`) with `Previous=\"0\"`, signed by a member of O1's keyset. U's hash is lower than O1's, so U wins the vote.\r\n3. Observe node1: conflict detected 2026-11-11T18:56:25Z; promotion fails at 18:56:28Z and identically on every 30s retry (18:57:10Z, 18:57:55Z, 18:58:40Z, 18:59:25Z, 19:00:10Z); O1 never finalizes; the conflict is still open minutes later.\r\n\r\nLog (node1, excerpt — full log attached, screenshot attached):\r\n\r\n```\r\ntime=2026-11-11T18:56:28.516Z level=INFO msg=\"confirmConflict: winner 07d0f6a83b3e... for f7d0c63f3bf1...|0 failed full validation deterministically: quarantining for 30s, the position withholds until then: SwapBlock: winner failed full validation 07d0f6a83b3e..., loser kept: multisig_update: account is not multisig\"\r\n```\r\n\r\nThe same line repeats at every 30s retry (see screenshot).\r\n\r\n## Reproduction (in-process test)\r\n\r\n`store/zz_audit_test.go`, `TestZZMultisigUpdateWinnerSwap`: stages the same winner/loser pair and calls `SwapBlock` directly. Result: `SwapBlock` fails with `multisig_update: account is not multisig`, `IsRetryableError` is false, and the loser chain plus keyset remain intact after the failure. The live-network log above is the primary evidence; the test file is available on request.\r\n\r\n## Root cause (code)\r\n\r\n- `core/rollback.go`: unwinding a `BlockMultisigOpen` sets `deleteKeysetAccount = b.Account` — the cascade deletes the keyset.\r\n- `core/cascade_commit.go:143-148`: `getKeysetOverlay` returns nil for the account once the keyset is deleted by the unwind.\r\n- `core/ledger.go:1316-1318`: `validateAndAddMultisigUpdate` reads the keyset through the overlay, gets nil, and returns `multisig_update: account is not multisig`.\r\n- By contrast, `core/ledger.go:1426,1447`: `verifyBlockCredential` reads the live keyset map, so the winner passes staged validation.\r\n- `core/ledger.go:2977-2981`: `SwapBlock` surfaces the failure as `ErrWinnerFullValidation`.\r\n- `core/quorum.go:39,321-328`: `failedPromotionTTL` is 30s; the error is non-retryable per `core/retryable.go`, yet the quarantine loop re-attempts it on that timer forever.\r\n\r\n## Relationship to XE-4145 (disclosed explicitly)\r\n\r\nXE-4145 (\"Quorum withhold on a staged-valid / full-invalid winner stalls a chain position permanently\") is the closest known ticket: the observable symptom is the same (stall loop, same log lines, 30s quarantine). This report is a different trigger and a different root cause. XE-4145's trigger is a content-invalid block (the XE-0028 decoy class, e.g. a `BlockLease` with asset XE and no certificate, which fails full validation because of its content), and its claimed root cause is the design of `pickWinner`/`promotable()` without substitution. My winner is content-valid and passes staged validation — and would pass full validation standing alone. Its failure appears only from the cascade interaction (unwinding the loser deletes the keyset the winner needs). The fix proposed for XE-4145 (substitution / age-based escape / full validation in `promotable()`) does not touch this root cause. I am filing this as a distinct variant and leaving the duplicate decision to triage.\r\n\r\n## Suggested fix\r\n\r\nEither (a) preserve the loser's keyset through the cascade when the winner is a `multisig_update` for the same account (validate the winner against the pre-unwind keyset), or (b) reject a `multisig_update` with `Previous=\"0\"` at staging when its account has no finalized keyset yet. Option (b) is the smaller change; option (a) preserves the legitimate update.\r\n\r\n## Environment\r\n\r\n- Commit: 89a542e (\"release: testnet-0005 quorum withhold fix\", 2026-11-10)\r\n- Reproduction network: local `testnet-local-audit` (2 nodes, loopback, genesis generated locally)\r\n- Attachments: screenshot of the repeating quarantine log lines; full node1 log excerpt.","patch_refs":[],"thread":[{"id":9681,"source":"desk","source_ref":"reply:8119","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-7898 and says what differs; it is read like any other.","created_at":"2026-11-17T09:38:15.176154+00:00"}]}