-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
address_store: Improve address tracking and add eviction algorithm (#250
) This PR improves the transport manager's address tracking to keep a healthier view of addresses. General changes: - Fixes a bug where `listener` addresses were tracked instead of `dialing` addresses (incoming connections may be established with ephemeral ports and there's no guarantee the remote is listening on them) - `PeerIdMismatch` error coming from the noise handshake redirects the address to the appropriate peer for healthier addresses - Addresses are tracked first, regardless of the peer state to ensure we update our view of the addresses (reachable or not) Address Store changes: - The store is bounded to a maximum of 64 tracked addresses - Removing and reinsertion of addresses into the store is prone to error and instead the address store updates addresses in place - Introduces an eviction algorithm for tracking addresses with higher score ### Testing Done - added extra tests to the address store - tested with subp2p-explorer for discovering kusama This PR is part of a bigger refactor to keep track of healthier addresses. It is essentially a breakdown of #248 for an easier review process. --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Dmitry Markin <[email protected]>
- Loading branch information
1 parent
e378e76
commit 2ef3751
Showing
4 changed files
with
338 additions
and
160 deletions.
There are no files selected for viewing
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
Oops, something went wrong.