-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Disconnect on mempool requests from peers when over the upload limit. #7166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Mempool requests use a fair amount of bandwidth when the mempool is large, disconnecting peers using them follows the same logic as disconnecting peers fetching historical blocks.
utACK. |
Nice, Concept ACK. |
ACK Would be nice if #6589 was merged so we could quantify how much is actually used by this on average 👍 |
utACK. |
utACK |
6aadc75 Disconnect on mempool requests from peers when over the upload limit. (Gregory Maxwell)
Cherry-picked to 0.12 as 6ba25d2 |
if (CNode::OutboundTargetReached(false) && !pfrom->fWhitelisted) | ||
{ | ||
LogPrint("net", "mempool request with bandwidth limit reached, disconnect peer=%d\n", pfrom->GetId()); | ||
pfrom->fDisconnect = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how much this achieves, just disconnecting. Is this considered misbehavior? Should it be considered misbehavior if the node reconnects and continues this behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not misbehavior - the peer cannot know that you're close to exceeding your bandwidth limit.
If the node reconnects and keeps bombarding with mempool commands it is absolutely misbehavior (with or without this pull), but this change is not meant as mitigation for attacks.
For better or worse, at the moment we don't have any framework to ban peers based on P2P-level behavior.
6aadc75 Disconnect on mempool requests from peers when over the upload limit. (Gregory Maxwell)
6aadc75 Disconnect on mempool requests from peers when over the upload limit. (Gregory Maxwell)
Bitcoin 0.12 misc P2P/Net PRs Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#5288 - Only the reorg, option was removed in bitcoin/bitcoin#6374 which we merged in #1258 - bitcoin/bitcoin#6561 - bitcoin/bitcoin#6728 - bitcoin/bitcoin#6829 - bitcoin/bitcoin#6974 - bitcoin/bitcoin#7075 - bitcoin/bitcoin#7166 Part of #2074.
Mempool requests use a fair amount of bandwidth when the mempool is large,
disconnecting peers using them follows the same logic as disconnecting
peers fetching historical blocks.