Skip to content
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

WIP: manager: Improve address handling and refactor PeerState #248

Closed
wants to merge 66 commits into from

Conversation

lexnv
Copy link
Collaborator

@lexnv lexnv commented Sep 20, 2024

No description provided.

Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
@lexnv
Copy link
Collaborator Author

lexnv commented Oct 2, 2024

This PR was refactored to make the review process a bit more friendly:

@lexnv lexnv closed this Oct 2, 2024
lexnv added a commit that referenced this pull request Oct 25, 2024
)

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant