Backport verdict: Incomplete
The one upstream commit for #35878 (1278a5970d → 1bb5289d48) is backported faithfully, and its functional test comes along unchanged. All code differences are expected target-branch adaptations. The #36672 CI backports were already in the base, and the release-prep commits are routine. There is one gap: the v30.5 release notes list three of the four upstream CI PRs that #36672 brought in after v30.4. #35447 (base commit 17fe6566) is missing. The code is correct as it stands; the release notes need that one line added.
Evidence:
- #35878 accounting: the source lists only commit 1278a5970d5ada0979052a5bad899e896b8ab40b, with no missing commits. It maps to 1bb5289d48, which has the correct Github-Pull: #35878 and Rebased-From trailers. Nothing in the source PR is left out.
- Code fidelity: the INV handler at the head (src/net_processing.cpp:3944-3989) matches the upstream code at 1278a597 (lines 4343-4388) statement for statement. Both create seen_txids and seen_wtxids from m_txhash_hasher before LOCK2. Deduplication happens after the wtxidrelay mismatch filter and after the reject_tx_invs disconnect check, and before ToGenTxid, AddKnownTx and AddTxAnnouncement. The only differences are the ones the range-diff shows:
AddKnownTx(*peer, ...)instead ofAddKnownTx(peer, ...)(30.x uses a PeerRef), the 30.x ProcessMessage signature, and include context (no util/tokenbucket.h on 30.x). - Target compatibility: SaltedUint256Hasher exists on 30.x (src/util/hasher.h:18) with a random-salt default constructor (hasher.cpp:10-12). It has only const members, so it can be copied into the per-message sets. The new const member m_txhash_hasher sits after m_rng (net_processing.cpp:750), as it does upstream.
- Semantics on the target: IsGenTxMsg() includes MSG_WITNESS_TX (protocol.h:523-526), and ToGenTxid() maps everything except MSG_WTX to a Txid (protocol.cpp:121-125). Sending MSG_WITNESS_TX to the txid set therefore matches how it is already interpreted. The base's wtxidrelay filter (base lines 3953-3957) is unchanged, so which INV types are accepted stays the same, including MSG_WITNESS_TX from wtxidrelay peers. Upstream at 1278a597 behaves the same way.
- Test fidelity: test_duplicate_tx_inv and its call in run_test match upstream line for line. It depends on helpers that exist on 30.x: TestNode.debug_log_size(**kwargs) and debug_log_path (test_node.py:530,549), CInv::GetMessageType producing 'witness-tx'/'wtx'/'tx' (protocol.cpp:58-75), and MSG_WITNESS_TX in test_framework/messages.py:67. 30.x logs 'got inv: %s %s' with two spaces, while upstream uses one. The asserted substring stops before that gap, so the difference does not affect the test.
- #36672 accounting: the source marks all four commits as already in the base. The base history confirms each one: 322f0389 (Github-Pull #35348), 17fe6566 (Github-Pull #35447), 4eaccf2d (Github-Pull #35441) and 95e321c1 (Github-Pull #35571). All were committed on Oct 26 21:16-21:17, after 'build: bump version to v30.4' (897b2c0b, Oct 26 16:18), and none appears in the v30.4 release notes. No commits are needed for them in this PR.
- Release-notes gap: the new doc/release-notes.md CI section lists #35348, #35441 and #35571 but not #35447, even though base commit 17fe6566 ('ci: use Warp cache for Docker layers', Github-Pull: #35447, Rebased-From 82901981) arrived with the same #36672 backport after v30.4. The omission matches the #36672 PR body, which also lists only three PRs.
- Release prep: CMakeLists.txt changes CLIENT_VERSION_MINOR from 4 to 5. All seven man pages in doc/man/ are updated with only version and date changes, which fits a release with no CLI or option changes. The release notes add #35878 under Net and credit Greg Sanders and willcl-ark. Overwriting the v30.4 text without archiving it under doc/release-notes/ follows the branch's existing practice: there are no release-notes-30.x.md files in the base.
- Historical context: #35920 (ignoring MSG_WITNESS_TX INVs for wtxidrelay peers, partly in response to a #35878 review thread) is a separate behavior change that is not declared here. It is not a dependency of #35878. Leaving it out keeps 30.x behavior the same and is consistent with the upstream commit being backported.
Required fixes:
- doc/release-notes.md: add '- #35447 ci: use Warp cache for Docker layers' to the CI section, because commit 17fe6566 (Github-Pull: #35447) has been on the branch since v30.4. Alternatively, explain why it is deliberately left out.
Limitations:
- No build, functional-test or CI execution records were supplied for this PR or its commits, so this review does not claim the code compiles or that p2p_tx_download.py passes on 30.x.
- Base history lookups ran out before the exact v30.4 tag commit could be found. I placed the #36672 commits after v30.4 using commit timestamps (version bump at Oct 26 16:18, CI commits at Oct 26 21:16-21:17), their absence from the v30.4 release notes, and the PR description.
- Upstream metadata for #35447 (original commit 82901981) could not be retrieved because it is not a resolved evidence SHA. Its PR number comes only from the Github-Pull trailer on base commit 17fe6566.
- Whether #35920 was merged upstream, and whether any later upstream change to test_duplicate_tx_inv (for example, the wtxidrelay/witness-tx assertions) should eventually follow it to 30.x, was not determined. The test as backported asserts the existing behavior that MSG_WITNESS_TX is accepted from wtxidrelay peers.
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
Acceptance of MSG_WITNESS_TX announcements was described as an oversight, not an intentional extension of the protocol. The author of #35920 stated that these announcements had never been valid under BIP144 and that introducing wtxidrelay had added wrong-hash announcement filtering without similarly excluding MSG_WITNESS_TX.
The pinned base already accepts this noncanonical announcement type. Its continued acceptance should therefore be understood as preservation of existing behavior, not as a protocol requirement that deduplication introduces or validates.
A concrete interoperability concern led the later proposal to retain witness-tx announcements for non-wtxidrelay peers: the discussion reported that /btcwire:0.5.0/neutrino:0.12.0-beta/ announced transactions using InvTypeWitnessTx, linked a Neutrino issue, and subsequently recorded that the proposal had been changed to allow those announcements for non-wtxidrelay peers.
This supplies the compatibility rationale for avoiding an incidental tightening of accepted INV types during deduplication. A noncanonical announcement could originate from deployed client software rather than merely from an adversarial peer. The record supports preserving compatibility for legacy relay, not an unconditional requirement to accept this type under every negotiated mode.
The wtxidrelay filtering was introduced to skip announcements using the wrong transaction identifier for the negotiated relay mode. The later compatibility adjustment distinguished non-wtxidrelay peers from wtxidrelay peers rather than abandoning that distinction.
In both pinned trees, ordinary MSG_TX announcements are skipped for wtxidrelay peers and MSG_WTX announcements are skipped for other peers before transaction-announcement processing. Compatibility with witness-tx announcements and enforcement of negotiated identifier semantics are separate concerns.
Ralph's inferences
For this narrowly scoped change, deduplication needs to follow the identifier interpretation of an accepted announcement without silently changing which announcements are accepted. MSG_WITNESS_TX belongs with txid announcements, while MSG_WTX belongs in a separate wtxid namespace; negotiated-mode filtering should remain distinct from duplicate detection.
The head leaves the base acceptance and relay-mode checks in place, then groups MSG_WITNESS_TX with MSG_TX in the per-message txid set and uses a separate set for MSG_WTX. This preserves the existing compatibility boundary while avoiding repeated processing. Notably, the pinned base accepts MSG_WITNESS_TX even on wtxidrelay connections; the inspected later discussion does not establish a compatibility need for that broader acceptance.
Unresolved disagreements
The inspected record does not establish that accepting MSG_WITNESS_TX from wtxidrelay peers is necessary for interoperability. The concrete compatibility response in #35920 was limited to non-wtxidrelay peers.
Retaining the broader pinned-base behavior can be explained as avoiding an unrelated behavior change in a deduplication backport. It should not be attributed to a documented protocol or client-compatibility requirement.