-
Notifications
You must be signed in to change notification settings - Fork 115
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: Limit how many addresses we use from each peer address message #7952
Conversation
Is this PR linked to #1869 ? |
Yes, I've updated the ticket. |
88c1d82
to
72a6bf9
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.
I am happy to deal with #7960 separately. (Since it is an optional suggestion, this PR does not need to be blocked by it.) |
Motivation
We want to limit how many addresses we use from each peer, so that our outbound connections are based on peers shared by most of our peers.
Close #1869
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.
We might want to have an overall changelog entry for the tracking issue, but it doesn't need to be added here.
Complex Code or Requirements
We need to limit in two places: existing cached peers, and responses based on a request. These limits operate slightly differently, because only a new response can cause an overflow.
Solution
Testing
Add a new proptest for the cache update method.
The remaining parts of the PR are simple and can be checked by manual review, or by existing tests (including integration tests).
Review
This is a routine fix.
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.