#35874 p2p: prevent BIP35 requesters from bypassing inbound tx-relay capacity
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #35874 p2p: prevent BIP35 requesters from bypassing inbound tx-relay capacity | Needs rebase | 0 | Neutral | 12 + 28 tests | |||
|
|
|
|
| |||
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
Ignore BIP35 mempool messages from peers that have transaction relay disabled (fRelay=false), unless the connection has the mempool net permission. Peers can still obtain mempool inventory after enabling transaction relay, such as by sending a BIP37 filterload message, which subjects them to existing inbound transaction-relay connection limits.
Problem: When a node runs with bloom filtering enabled, an inbound peer can connect with fRelay=false to evade the inbound transaction-relay connection capacity limits introduced in PR 28463, while still requesting and receiving full mempool inventory via BIP35 mempool messages.
Evidence of importance:
- PR description: 'When a node offers NODE_BLOOM, an inbound peer can advertise fRelay=false and request BIP35 mempool inventory while remaining outside the inbound transaction-relay capacity introduced in #28463.'
- Commit 3e64b65359: 'An inbound peer with fRelay=false stays outside transaction-relay capacity accounting, yet BIP35 requests give it full mempool inventory. Ignore these requests until transaction relay is enabled, except when the operator grants the mempool permission.'
Risk of a mistake: high (p2p). A flaw in P2P message processing could inadvertently disconnect or drop valid inventory requests from legitimate SPV clients or peers with custom permissions.
Changed since the previous assessment: The implementation remains the same; release notes and an entry in doc/bips.md documenting the behavior for v33.0 were added.
Reviewability
Ready · Needs rebase
Conflicts with master; review the logic now, the rebase is mechanical.
Agreement
Neutral
objections settled, nobody has spoken for the PR
Thread notes: Initial record. darosior raised a concern about unintended inv flooding which l0rinc addressed with test verification, and gmaxwell suggested disallowing mempool requests from fRelay=false peers, prompting l0rinc to rebase and rework the implementation after checking SPV sequencing with bitcoinj maintainer schildbach.
Objections, suggestions, and questions:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| darosior (member) | objection, correctness | Floods fRelay=false peers with unfiltered transaction invs after a mempool request, constituting an unintended protocol change. | fixed · fix pushed · v1, not yet re-checked | answered | yes | 2026-08-04: 'Prior to this we would not flood a peer that set BIP 37 `fRelay` to `false` with INV's until they set a filter. After this change, we would flood them with non-filtered INV's provided they previously sent a MEMPOOL message.' Status from: 2026-08-04: l0rinc: 'To make sure, I added a test that requests a BIP35 snapshot and verifies that a transaction added afterward is announced to a regular relay peer but not to the requester. It passes before and after the production change.' |
| gmaxwell (contributor) | objection, approach | Allowing fRelay=false peers to request mempool inventory moots bandwidth reduction and surveillance privacy assumptions. | fixed · fix pushed · v1, not yet re-checked | answered | yes | 2026-08-12: 'Should fRelay=false be able to request inventory at all? ... I think it probably shouldn't be allowed.' Status from: 2026-08-15: l0rinc: 'The PR now ignores non-permissioned `mempool` requests while tx relay is disabled, preserving existing BIP37 and targeted `getdata` behavior.' |
Participants:
- darosior (member, objection, 1 statements 2026-08-04 to 2026-08-04): worried earlier revision altered protocol behavior by flooding fRelay=false peers with non-filtered invs
- gmaxwell (contributor, objection, 1 statements 2026-08-12 to 2026-08-12): argued fRelay=false peers should not be allowed to request mempool inventory
- schildbach (contributor, neutral, 1 statements 2026-08-13 to 2026-08-13): confirmed bitcoinj SPV behavior sends filterload before mempool
Files
30 lines under test/bench/ci.
- test/functional/p2p_connection_limits.py +22/-1
- doc/release-notes-35874.md +8/-0
- test/functional/p2p_filter.py +6/-1
- src/net_processing.cpp +3/-0
- doc/bips.md +1/-1
Card
The short text the ranking pass compares across PRs.
Bitcoin Core now ignores BIP35 mempool requests from peers that have transaction relay disabled, unless they are granted the mempool network permission. Currently, inbound peers can connect with fRelay=false to avoid counting toward the inbound transaction-relay capacity limit added in PR 28463, yet still consume bandwidth by requesting full mempool inventory. Requiring active transaction relay closes this loophole while preserving SPV clients like bitcoinj that send a BIP37 filterload message before requesting the mempool.
Data
thread read through 2026-08-15 (6 statements), head 14eee1fc57
Discussion read under schema 1 rules: suggestions and questions may be missing, and an objection may combine several harms (schema history).
labels: P2P, Needs rebase
Categories
P2P
P2 · DoS protection
Fixes an evasion of inbound transaction-relay capacity limits where inbound peers could bypass resource limits via BIP35 mempool messages. Inbound peers with fRelay=false can bypass inbound tx-relay connection accounting while still receiving full mempool inventory, undermining DoS protections introduced in #28463.
Membership: Labeled P2P and changes net_processing.cpp to enforce connection limits during BIP35 mempool message handling.
Factors: security/stability 2, bug 1, performance 0, user value 0, leverage 0