-
Notifications
You must be signed in to change notification settings - Fork 120
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
Collect and send more accurate peer addresses #2123
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 tasks
3494e9b
to
32616ec
Compare
3 tasks
32616ec
to
315a32b
Compare
Marking as draft until #2121 merges |
315a32b
to
66abfbe
Compare
Add canonical addresses from inbound connections to the address book, so that Zebra can use them for reconnection attempts. Use the newly added `NeverAttemptedAlternate` state for these addresses, so we try gossiped addresses first, then canonical addresses. This avoids duplicate connections to inbound peers.
When peers ask for peer addresses, add our local listener address to the set of addresses, sanitize, then truncate. Sanitize shuffles addresses, so if there are lots of addresses in the address book, our address will only be sent to some peers.
dconnolly
reviewed
May 17, 2021
dconnolly
reviewed
May 17, 2021
One small q before approval |
teor2345
commented
May 17, 2021
Co-authored-by: teor <teor@riseup.net>
dconnolly
approved these changes
May 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-network
Area: Network protocol updates or fixes
A-rust
Area: Updates to Rust code
C-enhancement
Category: This is an improvement
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This PR improves integration test coverage for #2120.
To improve the quality of its address book, Zebra can collect canonical addresses from inbound peers.
To get inbound connections, Zebra can send its own address to its peers when they ask for addresses.
Solution
The code in this pull request has:
Review
Anyone can review this peer address book quality improvement. It is a routine enhahcement.
Related Issues
This fix is based on #2121. GitHub will automatically rebase it to main once #2121 merges.
These address quality improvements are part of the follow-up to #2120. They implement part of #1892.