{"id":"XE-10242","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":730,"title":"Consensus Vote Stalling: enqueueVote updates dedup cache before channel push dropping retransmissions of full-buffer votes","area":"p2p-sync","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":"XE-0024","tracked":true,"internal_ref":"#1057","internal_url":"https://github.com/xeprotocol/core/issues/1057","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-12T11:10:35.476066+00:00","updated_at":"2026-11-20T00:33:17.331476+00:00","source_created_at":null,"told_at":"2026-11-20T00:33:17.354668+00:00","status_changed_at":"2026-11-20T00:33:17.340698+00:00","url":"https://bounty.xe.network/XE-10242","body":"## Vulnerability Summary\n\nIn `net/gossip.go:244-280`, `enqueueVote` receives validated consensus votes from the P2P gossipsub topic and enqueues them into the vote channel `ch`:\n\n```go\nfunc enqueueVote(ctx context.Context, ch chan<- *core.Vote, seen map[string]int64, v *core.Vote, now int64) bool {\n\tfinalByte := \"c\"\n\tif v.Final {\n\t\tfinalByte = \"f\"\n\t}\n\tkey := v.RepPubKey + \"|\" + v.ConflictAccount + \"|\" + v.ConflictPrev + \"|\" + v.BlockHash + \"|\" + finalByte\n\tif ts, ok := seen[key]; ok && now-ts < voteDedupTTL {\n\t\treturn false\n\t}\n\tseen[key] = now\n\n\tif len(seen) > 4096 {\n\t\tfor k, ts := range seen {\n\t\t\tif now-ts >= voteDedupTTL {\n\t\t\t\tdelete(seen, k)\n\t\t\t}\n\t\t}\n\t}\n\n\tif v.Final {\n\t\tselect {\n\t\tcase ch <- v:\n\t\t\treturn true\n\t\tcase <-ctx.Done():\n\t\t\treturn false\n\t\t}\n\t}\n\n\tselect {\n\tcase ch <- v:\n\t\treturn true\n\tdefault:\n\t\tlogging.Warnf(\"gossip: vote channel full, dropping CONVERGE vote from %s\", shortHash(v.RepPubKey))\n\t\treturn false\n\t}\n}\n```\n\nCritical ordering bug in deduplication logic:\n1. Premature Cache Mutation: `seen[key] = now` is updated *before* verifying that the vote can actually be delivered to the channel `ch`.\n2. Drop on Channel Congestion: For non-final `CONVERGE` votes, if `ch` is temporarily full (capacity 1024 saturated by high-volume elections), execution falls into `default:`. The vote is dropped and never processed by `VoteManager`.\n3. Retransmission Suppression: Because `seen[key]` was already marked with timestamp `now`, any subsequent retransmission of the same vote received from another P2P peer within `voteDedupTTL = 200ms` hits:\n   `if ts, ok := seen[key]; ok && now-ts < voteDedupTTL { return false }`\n   The retransmitted vote is falsely rejected as a duplicate, even though the original was never enqueued or processed.\n\n## Impact & Severity\n\n1. Consensus Retally Stall: Converge votes from major representatives are dropped and blocked from retransmission, preventing quorum elections from reaching threshold tallies.\n2. Artificial Conflict Prolongation: Elections remain open until representative revote timers elapse, increasing transaction settlement latency across active conflicts.\n\n## Proposed Remediation\n\nIn `enqueueVote`, only update `seen[key]` after confirming that the vote was successfully sent to `ch`:\n```go\n\tselect {\n\tcase ch <- v:\n\t\tseen[key] = now\n\t\treturn true\n\tdefault:\n\t\tlogging.Warnf(\"gossip: vote channel full, dropping CONVERGE vote from %s\", shortHash(v.RepPubKey))\n\t\treturn false\n\t}\n```","patch_refs":[],"thread":[{"id":13193,"source":"desk","source_ref":"reply:11215","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as https://bounty.xe.network/XE-0024, 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-10242 and says what differs; it is read like any other.","created_at":"2026-11-20T00:33:17.331476+00:00"}]}