Skip to content
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

Disconnect on mempool requests from peers when over the upload limit. #7166

Merged
merged 1 commit into from Dec 4, 2015

Conversation

@gmaxwell
Copy link
Contributor

gmaxwell commented Dec 3, 2015

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.

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.
@gmaxwell gmaxwell added the P2P label Dec 3, 2015
@jonasschnelli
Copy link
Member

jonasschnelli commented Dec 3, 2015

utACK.

@MarcoFalke
Copy link
Member

MarcoFalke commented Dec 3, 2015

Nice, Concept ACK.

@dcousens
Copy link
Contributor

dcousens commented Dec 3, 2015

ACK

Would be nice if #6589 was merged so we could quantify how much is actually used by this on average 👍

@GIJensen
Copy link

GIJensen commented Dec 4, 2015

utACK.

@petertodd
Copy link
Contributor

petertodd commented Dec 4, 2015

utACK

@laanwj laanwj merged commit 6aadc75 into bitcoin:master Dec 4, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
laanwj added a commit that referenced this pull request Dec 4, 2015
6aadc75 Disconnect on mempool requests from peers when over the upload limit. (Gregory Maxwell)
gmaxwell added a commit that referenced this pull request Dec 4, 2015
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.

Rebased-From: 6aadc75
Github-Pull: #7166
@laanwj
Copy link
Member

laanwj commented Dec 4, 2015

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;

This comment has been minimized.

Copy link
@rebroad

rebroad Feb 1, 2016

Contributor

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?

This comment has been minimized.

Copy link
@laanwj

laanwj Feb 1, 2016

Member

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.

codablock added a commit to codablock/dash that referenced this pull request Feb 7, 2018
6aadc75 Disconnect on mempool requests from peers when over the upload limit. (Gregory Maxwell)
andvgal added a commit to energicryptocurrency/energi that referenced this pull request Jan 6, 2019
6aadc75 Disconnect on mempool requests from peers when over the upload limit. (Gregory Maxwell)
CryptoCentric added a commit to absolute-community/absolute that referenced this pull request Feb 28, 2019
CryptoCentric added a commit to absolute-community/absolute that referenced this pull request Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
You can’t perform that action at this time.