p2p: mildly discourage peers that violate feefilter #20895
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I found it surprising that we don't care if a peer sends us a transaction with fee lower than the fee filter we send them. This is in the spec for BIP 133 so it's not a bug. But it seems like we send fee filters to limit resource usage and if we don't care when peers violate it, it's kind of ineffective. I can see why we wouldn't want to severely punish - particularly because it's possible that they're responding to a
GETDATA
we sent before theFEEFILTER
.This PR adds
Misbehaving(1)
when peers send us transactions that get rejected for fee-related mempool policy and the fee is lower than the feefilter we sent them. This means they get disconnected after 100 of these transactions. Hopefully this seems reasonable.(Note that the first commit is from a refactor from #20833... I needed it to check the fee after calling ATMP).