-
Notifications
You must be signed in to change notification settings - Fork 725
[P2P] Rate limiting rumored address processing #2824
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
[P2P] Rate limiting rumored address processing #2824
Conversation
98bf8ce to
fb8f511
Compare
fea7667 to
a6d69d8
Compare
a6d69d8 to
3c6280b
Compare
3c6280b to
0c2deb2
Compare
Fuzzbawls
left a comment
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.
Functional ACK, one minor clang-tidy cleanup.
0c2deb2 to
01e2e26
Compare
Fuzzbawls
left a comment
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.
ACK 01e2e26f905850a878e438c124b7a00cb6011ed2
panleone
left a comment
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.
Left a couple of comments
611cd77 to
3717978
Compare
panleone
left a comment
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.
another comment on the latest commit
panleone
left a comment
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.
a couple more comments
test/functional/p2p_addrv2_relay.py
Outdated
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.
Wrote yesterday on discord, but rewriting here so we don't forget:
Imo the assert here should not be changed because we are functional testing a specific expected behaviour. If this change is due to the fact that m_addr_token_bucket is empty then it is better if you change the node time to refill it, if it's not that then the PR introduced a bug
test/functional/p2p_addr_relay.py
Outdated
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.
same comment here, an assert that tested an expected result has been changed. If this was due to the fact that the bucket is empty then ok change the node's time to refill it and the unchanged assert should pass. If it does not a bug was introduced
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.
In this regard, I have restored the old logs but have changed the addr_token_bucket from 1.0 to 10.0 to reflect the logging more accurately rather than accounting for a stricter rate limit.
Take a look let me know, ima try to get this last test working...again
Set for every instance and fix test peer, remove var Refactor debug logs Adjust p2p invalid msgs
0e7eb41 to
c5fd91e
Compare
panleone
left a comment
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.
tACK c5fd91e
All my feedbacks have been implemented, tested on mainnet: the bucket is filled quick enough in such a way that in normal condition no requests are limited
Fuzzbawls
left a comment
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.
ACK c5fd91e
As of recent there was a release on https://www.halborn.com/blog/post/halborn-discovers-zero-day-impacting-dogecoin-and-280-networks
We want to address potential situation that can cause network instability and node attacks.
This PR back ports
bitcoin#22387
bitcoin#15617
This implements a token bucket for rate limiting addresses, allowing up to 1000 in one request. Getaddr requests are exempt from this rate limiting. Then we are also no longer going to relay to other nodes peers we have banned. Functional tests included.