#35920 net_processing: Ignore MSG_WITNESS_TX entries from INV messages

full analysis

https://github.com/bitcoin/bitcoin/pull/35920 · ajtowns · +28/-25 in 3 files, 3 commits · labels: none

Goal

  • Ignore MSG_WITNESS_TX announcements from wtxid-relay peers to adhere to BIP 144
  • Disconnect block-relay-only peers that announce transactions regardless of the INV type used

This PR updates P2P message processing in `src/net_processing.cpp` to ignore `MSG_WITNESS_TX` announcements from peers with `wtxidrelay` enabled, conforming to BIP 144. It also moves the protocol violation check earlier so that sending any transaction INV type over a connection where transaction relay is disabled triggers a disconnect. Additionally, it unifies the separate `seen_txids` and `seen_wtxids` deduplication sets into one.

Problem: BIP 144 specifies that `MSG_WITNESS_TX` is only for `getdata` requests, but Bitcoin Core continued to accept them as txid announcements even after wtxid relay was introduced. Furthermore, peers attempting to announce transactions over block-relay-only connections could bypass disconnection if the announcement type was filtered out before the violation check.

Category: P2P (#19 of 65)

P3 · protocol fix

  • P3 because it aligns wtxid-relay behavior with BIP 144 and fixes disconnect logic for block-relay peers
  • Enforces protocol rules consistently while preserving compatibility for existing clients like Neutrino

P3 because this is a worthwhile protocol conformance fix and minor bug correction. It ensures nodes disconnect misbehaving block-relay-only peers regardless of the INV type used, adheres to BIP 144 for wtxid peers, and simplifies internal hash deduplication without disrupting production clients.

Membership: Modifies INV handling and block-relay connection disconnect logic in src/net_processing.cpp and functional p2p tests.

Factors: security/stability 1, bug 1, performance 0, user value 0, leverage 0

Reviewability: Ready

  • Ready to review
  • All substantive ecosystem compatibility feedback has been addressed in code

The code is clean, CI passes, and all substantive comments regarding ecosystem compatibility have been addressed.

Author status: active; last pushed updates accommodating compatibility feedback

Resolved concerns:

  • darosior cautioned against dropping support for MSG_WITNESS_TX without verifying wild implementations; 0xB10C noted that neutrino announces transactions with InvTypeWitnessTx. The author updated the PR to keep allowing it for non-wtxidrelay peers.

Agreement: Strong

  • Strong support for protocol conformance and cleanup
  • Concept approval without stated reasons (l0rinc, fjahr)
  • Compatibility concern about Neutrino resolved by keeping support for non-wtxid peers (darosior, 0xB10C)

Strong: concept supported and the only compatibility objection regarding Neutrino was resolved in code

Reviewers supported the cleanup and protocol conformance. When real-world client quirks (Neutrino) were identified, the author modified the approach to retain backwards compatibility for non-wtxid connections, resolving all open concerns.

  • l0rinc gave Concept ACK (2026-08-06)
  • fjahr gave Concept ACK (2026-08-11)
  • darosior raised caution about dropping support for existing clients (2026-08-07)
  • 0xB10C pointed out Neutrino uses InvTypeWitnessTx (2026-08-12)
  • ajtowns updated the PR to allow MSG_WITNESS_TX on non-wtxid connections (2026-08-12)

Review verdicts (DrahtBot): 0

Files

25 lines under test/bench/ci.

  • src/net_processing.cpp +14/-14
  • test/functional/p2p_blocksonly.py +12/-9
  • test/functional/p2p_tx_download.py +2/-2

Card

This PR updates P2P INV processing to ignore MSG_WITNESS_TX announcements on wtxidrelay connections per BIP 144, while retaining support for legacy non-wtxidrelay peers to maintain compatibility with Neutrino. It also ensures that sending transaction INVs over block-relay-only connections triggers an immediate protocol violation disconnect regardless of INV type, allowing the internal hash deduplication sets to be combined into one. Reviewers support the change, and previous compatibility concerns have been resolved. The PR is ready for review with no open blockers.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T16:21, confidence high, input hash 2b3d3f0794001097