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

Track number of connections per address in peering strategy #1412

Merged
merged 3 commits into from
Nov 26, 2023

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Nov 26, 2023

In the situation where the discovery system discovers the same address for two different peers (Alice and Bob), the code will try to connect to both.
Inevitably, one of them will redirect to the wrong peer, for example connecting to Alice will actually connect to Bob.
Later, when we disconnect a second time from Bob, a state mismatch is found and a panic happens.

This PR does things properly and tracks the number of connections per peer.

We also handle weird situations properly, such as connecting to the same address multiple times leading to multiple different peer ids, by removing the remove_address function entirely.

@tomaka tomaka added this pull request to the merge queue Nov 26, 2023
Merged via the queue into smol-dot:main with commit dacf9a6 Nov 26, 2023
22 checks passed
@tomaka tomaka deleted the track-num-addresses-in-bps branch November 26, 2023 12:38
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