#35920 net_processing: Ignore MSG_WITNESS_TX entries from INV messages

ReviewabilityReviewsAgreementSize
#35920 ajtowns net_processing: Ignore MSG_WITNESS_TX entries from INV messagesWaiting on author2Strong14 + 14 tests
  • Disconnect peers that send transaction announcements when transaction relay is disabled
  • Ignore invalid witness transaction announcements on wtxid-relay connections to adhere to BIP 144
  • Ready to review
  • Substantive support with no open objections
  • Verified through mutation testing on functional test scripts (fametrano)
  • Code approvals with minor nonblocking suggestions for tests (fjahr, instagibbs)
  • Early compatibility objections regarding Neutrino peers in the wild were addressed (darosior, 0xB10C)
  • 14 lines added or modified outside tests
  • 14 lines added or modified in tests
  • 25 lines removed in total
  • 3 files, 3 commits
P2P#32 of 71
P3 · bug fix
  • P3 because it fixes an edge case where peers announcing txs avoided disconnects on relay-disabled links
  • Brings announcement handling in line with BIP 144 without breaking compatibility for older nodes
  • Ranking pass: Protocol-conformance plus a missed-disconnect path ranks above the test and refactor work that scored near it.
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

In `net_processing`, ignore `MSG_WITNESS_TX` entries in `INV` messages on `wtxidrelay` connections and consolidate the per-message deduplication sets into one. Move the tx-announcement protocol violation check before the announcement-type filtering so sending any transaction `INV` on a connection where transaction relay is disabled triggers a disconnect. Extend functional tests to verify block-relay-only connections disconnect on all tx `INV` variants.

Problem: BIP 144 specifies that `MSG_WITNESS_TX` is only valid for `getdata` messages, but Bitcoin Core continued treating it as a valid announcement by txid on `wtxidrelay` connections. Additionally, peers on connections with tx relay disabled (such as block-relay-only connections) were not disconnected for sending tx announcements if those announcements used the wrong inv type for the connection, because type-mismatch checks were evaluated before the disconnect check.

Evidence of importance:

  • Commit 2eefc296d4 notes that 'BIP 144 specifies that MSG_WITNESS_TX is "only for use in getdata", so if we receive it anyway, ignore it, rather than treating it as a by-txid announcement.'
  • PR description points out that attempting to announce transactions on `fRelay=false` was not triggering disconnects if the peer used an unexpected inv type due to check ordering.

Reviewability

Paused · Waiting on author

Open objections from instagibbs, mzumsande with no author reply for 26 days; review would repeat what has been asked.

Waiting on (from the thread read):

  • author: respond to test suggestions from instagibbs and question about future plans from mzumsande 2026-10-06

Agreement

Strong

substantive support, no open objection (l0rinc, fjahr, fametrano)

Thread notes: Added reviews from instagibbs (support with test suggestion) and mzumsande (Concept ACK with a question on future plans). Updated instagibbs's stance to support.

Objections, suggestions, and questions:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
darosior (member)objection, approachdropping support for MSG_WITNESS_TX on txid relay peers could break unmaintained codebases in the wildfixed · fix pushed · author allowed witness-tx in invs for non-wtxidrelay peerschangedyes2026-08-07: 'i think we should have some evidence this isn't being used in the wild before dropping support'
Status from: 2026-08-12: ajtowns: 'Changed to allow witness-tx in invs for non-wtxidrelay peers.'
0xB10C (member)objection, correctnessNeutrino nodes in the wild announce transactions with InvTypeWitnessTxfixed · fix pushed · author allowed witness-tx in invs for non-wtxidrelay peerschangedyes2026-08-12: '/btcwire:0.5.0/neutrino:0.12.0-beta/ seems to be announcing transactions with InvTypeWitnessTx'
Status from: 2026-08-12: ajtowns: 'Changed to allow witness-tx in invs for non-wtxidrelay peers.'
fjahr (member)suggestion, maintenancekeep the deleted comment below the new code block or include its information in the new commentsanswered · author explained why an extra comment is not neededansweredyes2026-09-26: 'I would keep it around below the new code block or maybe include the information somewhere the new comments.'
Status from: 2026-10-01: ajtowns: 'I don't think this needs an extra comment'
fjahr (member)suggestion, maintenancesimplify the test loop in p2p_tx_download.py since only the first run is still relevantaccepted · reviewer acknowledged the suggestion is not a blockeransweredyes2026-09-26: 'now only the first of the loop runs seems still relevant. I think I would find it confusing why the test is written this way without the historic background.'
Status from: 2026-10-02: fjahr: 'But not a blocker either.'
fjahr (member)suggestion, maintenanceclarify the code comment regarding mixing txids and wtxids in seen_tx_hashesaccepted · reviewer acknowledged the suggestion is not a blockeransweredyes2026-09-26: 'This would be a bit easier to understand for me'
Status from: 2026-10-02: fjahr: 'But it's not a blocker for me.'
instagibbs (member)suggestion, maintenanceuse product from itertools to simplify test loops over wtxidrelay and msg_type in p2p_blocksonly.pyopenansweredno2026-10-05: 'for wtxidrelay, msg_type in product([True, False], [MSG_WTX, MSG_TX, MSG_WITNESS_TX]):'
instagibbs (member)suggestion, maintenanceadd a test ensuring we GETDATA the neutrino exceptionopenansweredno2026-10-06: 'Could we get a test that ensures we GETDATA the neutrino exception, if we don't have one?'
mzumsande (member)question, approachasks what the plan is regarding ignoring MSG_WITNESS_TX for non-wtxidrelay peers in future releasesopenansweredno2026-10-06: 'What is the plan to deal with this? Merge as is and revisit in a few releases to then ignore `MSG_WITNESS_TX` also for for non-wtxidrelay peers?'

Support:

  • l0rinc (member) (Concept ACK, 2026-08-06) [read]: thanks for pushing a fix for https://github.com/bitcoin/bitcoin/pull/35878#discussion_r3724297158
  • fjahr (member) (Concept ACK, 2026-08-11): Concept ACK [not substantive]
  • fjahr (member) (ACK, 2026-09-26) [read]: good to merge as is, with suggestions to improve comments and tests
  • fametrano (contributor) (Tested ACK, 2026-10-02) [tested: test/functional/p2p_blocksonly.py, test/functional/p2p_tx_download.py]: built and ran p2p_blocksonly.py and p2p_tx_download.py, verifying failures against base and five small breakages
  • instagibbs (member) (2026-10-06) [read]: LGTM [not substantive]
  • mzumsande (member) (Concept ACK, 2026-10-06): Concept ACK [not substantive]

Participants:

  • l0rinc (member, support, 1 statements 2026-08-06 to 2026-08-06): Concept ACK; thanks for pushing a fix
  • darosior (member, objection, 1 statements 2026-08-07 to 2026-08-07): objected to dropping MSG_WITNESS_TX for txid relay peers without evidence it is unused in the wild
  • fjahr (member, support, 9 statements 2026-08-11 to 2026-10-02): Concept ACK and ACK with suggestions on comments and tests
  • 0xB10C (member, objection, 1 statements 2026-08-12 to 2026-08-12): pointed out Neutrino nodes announce transactions with InvTypeWitnessTx
  • Amrrty (none, neutral, 1 statements 2026-10-02 to 2026-10-02): asked how it can be fixed
  • fametrano (contributor, support, 1 statements 2026-10-02 to 2026-10-02): Tested ACK with mutation testing of net_processing and functional tests
  • instagibbs (member, support, 3 statements 2026-10-02 to 2026-10-06): reviewed with LGTM, suggested test cleanup and a test for neutrino exception
  • mzumsande (member, support, 1 statements 2026-10-06 to 2026-10-06): Concept ACK; asked about future plans for ignoring MSG_WITNESS_TX on non-wtxidrelay peers

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

The short text the ranking pass compares across PRs.

Ignores invalid MSG_WITNESS_TX announcements in INV messages on wtxidrelay connections and ensures any tx INV received on a block-relay-only connection disconnects the peer. Previously, BIP 144 protocol violations could be treated as valid txid announcements, and sending misformatted tx INVs bypassed disconnection on connections where tx relay was disabled. The PR also simplifies net_processing by deduplicating INV hashes in a single set.

Data

dossier JSON · extract JSON · model ledger, generated 2026-10-07T01:13, confidence high, input hash 80b9e3b678952fa3
thread read through 2026-10-06 (28 statements), head 0f9bffe6e1
labels: none

Categories

P2P

P3 · bug fix (ranking pass: Protocol-conformance plus a missed-disconnect path ranks above the test and refactor work that scored near it.)

Aligns INV message processing with BIP 144 specifications and fixes a check ordering bug when disconnecting peers that violate transaction relay restrictions. Commit 2eefc296d4 notes that 'BIP 144 specifies that MSG_WITNESS_TX is "only for use in getdata", so if we receive it anyway, ignore it', while the PR description notes that unexpected inv types previously bypassed disconnects on connections with relay disabled.

Membership: Modifies net_processing.cpp to change INV message handling, wtxidrelay filtering, and disconnect behavior for block-relay-only peers.

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