-
Notifications
You must be signed in to change notification settings - Fork 22
address_store: Improve address tracking and add eviction algorithm #250
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
59dbbf8
address: Add score constants to the address store
lexnv ae7799a
address: Convert DialError to appropriate score
lexnv ac5d731
address: Implement eviction algorithm for the AddressStore
lexnv a2356ec
manager: Keep track of the address for future dials
lexnv 5355e85
manager: Make add_known_address more robust to track multiple peer addrs
lexnv ecb436b
manager: Track addresses better for dial and open failure
lexnv bf066d1
manager: Update addresses on connection established
lexnv b052c5d
manager/handle: Keep lock for shorter time
lexnv da52056
address/tests: Adjust testing
lexnv 6c7f399
address/tests: Add tests for eviction and insertion
lexnv 5b88ea4
manager/tests: Adjust testing to new address store interface
lexnv c97ffaa
address/tests: Use >= for random ranges of scores
lexnv 126f93d
manager: Evit addresses only on adress capacity reached
lexnv 3583ea3
manager: Fix dialError timeout score
lexnv 7cddf2e
manager: Simplify error to score method
lexnv 0e707b6
manager: Warn about different PeerID address tracking
lexnv ba3757a
manager: Refactor continue with if else
lexnv db095f4
manager: Replace trace with warning
lexnv 815d543
manager: Adjust unfinished comment
lexnv d98b9b6
manager: Remove PeerIdMissmatch logic
lexnv 42ce6cc
manager: Evict lower score addresses
lexnv 97fd413
manager/tests: Adjust testing
lexnv 4ec27d2
Merge remote-tracking branch 'origin/master' into lexnv/enhanve-addre…
lexnv a6af7b3
Merge branch 'master' into lexnv/enhanve-address-store
lexnv 3d52019
Update src/transport/manager/address.rs
lexnv 2bd8621
manager: Only track the addresses corresponding to the provided peer
lexnv 8be6a1e
address: Replace num_addr with addresses.len() for clarity
lexnv 23c33dc
Merge remote-tracking branch 'origin/lexnv/enhanve-address-store' int…
lexnv c779ded
Update src/transport/manager/handle.rs
lexnv f2c5e8f
manager: Rewrite with expect
lexnv f124b79
manager: Avoid downcasting multiaddr
lexnv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Oops, something went wrong.
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.
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.
What I actually liked in the original implementation, is that popping and putting elements in a binary heap is super fast. Unfortunately, that required taking the address out before the dial attempt and putting it back after.
Ideally, we would use something like
BiMap
over addresses and scores. As scores can be identical, more strictly we needBiMultiBTreeHashMap
, which is too peculiar to have a decent existing implementation.Mostly thinking out loud. We can keep this for a follow-up.