-
Notifications
You must be signed in to change notification settings - Fork 106
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
security: Rate limit GetAddr responses #7955
Conversation
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.
This looks good, I think it would be enough to just test that we get peers when we send an address message.
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 think we might be over-complicating this change a bit. Just change the constant?
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.
Nothing here is blocking, so we're good to go when you're happy with the remaining test and module changes.
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.
From the CI test results, it looks like some more test or production updates are needed.
Yeah, that I think this needs another test too. |
The docker CI failure is #7898 |
Co-authored-by: teor <teor@riseup.net>
Co-authored-by: teor <teor@riseup.net>
…after the refresh time
…rs request before the refresh interval
3daf106
to
7c84398
Compare
8769129
to
5327d17
Compare
459dbfa
to
b4dd424
Compare
I used up the Github actions limit with frequent commits. 😞 |
b4dd424
to
48f419e
Compare
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.
Thanks for all the changes, this looks good for now
Motivation
We want to avoid giving out Zebra's entire address book over a short duration.
Closes #7823.
PR Author Checklist
Check before marking the PR as ready for review:
For significant changes:
If a checkbox isn't relevant to the PR, mark it as done.
Solution
ADDR_RESPONSE_LIMIT_DENOMINATOR
to 4INBOUND_CACHED_ADDRS_REFRESH_INTERVAL
constantCachedPeerAddrs
struct with a reference to the address bookaddress_book
field inSetup::Initialized
with an instance ofCachedPeerAddrs
poll_ready()
method if they are stalecached_addrs
in response toinbound::Peers
requests instead of reading from the address bookRelated cleanups:
GetAddr
response to asanitized_window()
method onAddressBook
.Testing
TODO: This PR still needs tests.
Review
Anyone can review.
Reviewer Checklist
Check before approving the PR:
PR blockers can be dealt with in new tickets or PRs.
And check the PR Author checklist is complete.