<!-- XE-13226 · net,core: PullVotes/PullBlocks lack coordinate and hash pre-checks and ReceiveVote resets revoteBackoff on duplicate non-final votes · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13226>. The page is the record; this is the same page for reading.*

XE-13226 · Bounty

# net,core: PullVotes/PullBlocks lack coordinate and hash pre-checks and ReceiveVote resets revoteBackoff on duplicate non-final votes

Closed · duplicate
—
[xe#350](https://github.com/xeprotocol/xe/issues/350)
filed 2026-11-11 04:57 UTC
by Khanhtnq

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   P2P / sync

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:07 UTC

Told
:   2026-11-20 00:05 UTC

### Patches

- [xe#351](https://github.com/xeprotocol/xe/pull/351) open by Khanhtnq
  fix(net,core): verify pulled vote coordinates and block hashes before ingest

### History

- [543821](https://bounty.xe.network/log/543821) 2026-11-20 00:06 UTC github.state\_pushed
- [543820](https://bounty.xe.network/log/543820) 2026-11-20 00:06 UTC github.labels
- [543764](https://bounty.xe.network/log/543764) 2026-11-20 00:05 UTC reply.mirrored
- [543520](https://bounty.xe.network/log/543520) 2026-11-20 00:04 UTC proposal.adopted
- [543519](https://bounty.xe.network/log/543519) 2026-11-20 00:04 UTC reply.sent
- [543518](https://bounty.xe.network/log/543518) 2026-11-20 00:04 UTC ticket.status new → closed
- [542071](https://bounty.xe.network/log/542071) 2026-11-20 00:04 UTC proposal.adopted
- [542070](https://bounty.xe.network/log/542070) 2026-11-20 00:04 UTC ticket.facts area
- [542069](https://bounty.xe.network/log/542069) 2026-11-20 00:04 UTC proposal.adopted
- [542068](https://bounty.xe.network/log/542068) 2026-11-20 00:04 UTC ticket.facts
- [542067](https://bounty.xe.network/log/542067) 2026-11-20 00:04 UTC proposal.adopted
- [542066](https://bounty.xe.network/log/542066) 2026-11-20 00:04 UTC ticket.facts

[Full history](https://bounty.xe.network/log?ref=XE-13226) · [JSON](https://bounty.xe.network/v1/tickets/XE-13226) · [markdown](https://bounty.xe.network/XE-13226.md)

### Report

### Summary

Peer-pulled conflict votes and block bodies in `net/votesync.go` and `net/blocksync.go` pass unverified or duplicate records into `ingest`, and `core.VoteManager.receiveVoteInner` treats replayed non-final votes as state changes:

1. **`net.PullVotes` (`net/votesync.go:40-70`) accepts cross-position votes and repeats duplicate ingests across peers**:

   - `PullVotes` requests votes for `(account, previous)` but never checks `v.ConflictAccount == account && v.ConflictPrev == previous` before calling `ingest(v)`. A peer responding to a pull for conflict `(A, P1)` can return votes belonging to unrelated conflicts `(B, P2)`.
   - `PullVotes` has no `ctx.Err()` check between peer requests and no deduplication across peers, re-verifying Ed25519 signatures for identical `(RepPubKey, BlockHash, Final)` votes returned by every connected peer (while any dedup set must only record a vote *after* `ingest(v)` succeeds so a peer serving an invalid signature cannot suppress a subsequent honest peer's valid vote).
   - `SetupVoteSync` (`net/votesync.go:29-38`) also invokes `provide` even when `req.Account == ""`.
2. **`net.PullBlocks` (`net/blocksync.go:50-96`) does not cap response scan length or verify `core.HashBlock(b) == b.Hash` before `ingest(b)`**:

   - `PullBlocks` requests at most `MaxBlockRequestHashes` (`64`) hashes, but scans an unbounded `resp.Blocks` slice and does not check `ctx.Err()` between peers.
   - `PullBlocks` checks `want[b.Hash]` using the peer-supplied `b.Hash` field without computing `core.HashBlock(b)`. A response carrying a modified body under a requested `b.Hash` reaches `ingest(b)` directly instead of being rejected at the response boundary.
3. **`core.VoteManager.receiveVoteInner` (`core/vote.go:134-165`) overwrites identical non-final votes and resets `revoteBackoff`**:

   - `ReceiveVote` / `receiveVoteInner` (`core/vote.go:107-165`) returns early when `existing != nil && existing.Final`, but when `existing != nil && !existing.Final && !v.Final && existing.BlockHash == v.BlockHash`, it rewrites `PutVote(v)`, deletes `vm.lastRevoteNanos[account+"|"+prev]` (allowing any peer replaying an existing converge vote to clear the local representative's 15s `revoteBackoff` and trigger immediate `Sync()` \+ vote re-emission in `castVoteLocked`), and re-triggers `quorumMgr.OnVote(v)`.

### Locations (`origin/master` @ `89a542ea`)

- `net/votesync.go:29-70`
- `net/blocksync.go:50-96`
- `core/vote.go:107-165`

### Thread

**Joseph Denne**team2026-11-20 00:05 UTCgithub

Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the
first verifiable submission, so this one closes as a duplicate. If you believe it is a different
bug, file a new report that links https://bounty.xe.network/XE-13226 and says what differs; it is read like any other.
