Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35874. ReviewsSee the guideline and AI policy for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
c83a7c7 to
6726904
Compare
6726904 to
dd1af38
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
| if (auto tx_relay = peer.GetTxRelay(); tx_relay != nullptr) { | ||
| if (pfrom.IsInboundConn() && !pfrom.m_relays_txs) { | ||
| // BIP35 consumes tx-relay capacity while fRelay=false still disables ongoing announcements. | ||
| pfrom.m_relays_txs = true; |
There was a problem hiding this comment.
I think that's a protocol change? 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.
There was a problem hiding this comment.
Valid question. If I understood your objection correctly, it applies to TxRelay::m_relay_txs, while we're changing CNode::m_relays_txs. 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. Could you please check whether it satisfies your criterion? Thanks for the hint.
c7460a2 to
760da86
Compare
|
Should fRelay=false be able to request inventory at all? Do any existing pieces of software do this (outside of surveillance software, of course)? I think it probably shouldn't be allowed. Historically fRelay=false peers have been treated as a reduced bandwidth and surveillance privacy risk, but I think that's mooted if they're doing mempool requests. |
|
Thanks @gmaxwell.
I'm not sure about the details, my goal was to close a potential DoS angle. This suggests ignoring non-permissioned |
Historically, bitcoinj has walked the tx dependency chain for its risk analysis. It uses
In the SPV case (which I assume is what you care about in this context), bitcoinj sets the filter first via (Afaicr, we never used the ability to set a new filter for a connection, or add data to one. Rather, we drop the connection and build a new one.) |
760da86 to
fc657d8
Compare
|
Rebased and reworked this based on the review feedback. The PR now ignores non-permissioned |
fc657d8 to
14eee1f
Compare
An inbound peer with `fRelay=false` currently receives BIP35 inventory before enabling transaction relay, with or without the `mempool` permission. The BIP37 test covers bitcoinj's SPV sequence by sending `filterload` before `mempool`.
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. A BIP37 `filterload` message enables relay and applies the existing inbound capacity limit before bitcoinj's SPV flow sends `mempool`. Targeted `getdata` requests remain unchanged.
14eee1f to
038e3c1
Compare
Problem: When a node offers
NODE_BLOOM, an inbound peer can advertisefRelay=falseand request BIP35 mempool inventory while remaining outside the inbound transaction-relay capacity introduced in #28463.Fix: Ignore
mempoolrequests while the peer has transaction relay disabled, unless the connection has themempoolpermission.A BIP37
filterloadmessage enables transaction relay and applies the existing capacity limit, preserving bitcoinj's SPVfilterload-then-mempoolsequence.Targeted
getdatarequests remain unchanged.