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

Protect direct and mesh peers in the connection manager #348

Merged
merged 5 commits into from
Jun 3, 2020

Conversation

vyzo
Copy link
Collaborator

@vyzo vyzo commented Jun 3, 2020

Almost all the services are now starting to protect essential peers, so we should do the same.
This adds protection for direct and mesh peers.

An unfortunate side effect of this change is that we have to (temporarily I hope) disable the tests for the tags, as the connection manager doesn't offer an interface to query protected peers.
edit: resolved! the tests are back.

@vyzo
Copy link
Collaborator Author

vyzo commented Jun 3, 2020

cc @raulk

@vyzo
Copy link
Collaborator Author

vyzo commented Jun 3, 2020

Implementation of protection status queries in libp2p/go-libp2p-core#158 and libp2p/go-libp2p-connmgr#76

@Stebalien
Copy link
Member

What are the limits on mesh peers? That is, can I keep grafting to keep getting my connection protected?

@vyzo
Copy link
Collaborator Author

vyzo commented Jun 3, 2020

We only accept outbound connections for grafting when over the Dhi limit, and that fixes itself within the next heartbeat.
So at best excess peers would get protection for up to 1s.

@vyzo
Copy link
Collaborator Author

vyzo commented Jun 3, 2020

Note that once pruned you can't get regrafted unless the backoff elapses, which is 1minute by default.

@vyzo
Copy link
Collaborator Author

vyzo commented Jun 3, 2020

reinstated the tests, using the new connection manager interface.

Copy link
Contributor

@yusefnapora yusefnapora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good - nice job getting the test issue sorted

@vyzo vyzo merged commit 9a5528b into master Jun 3, 2020
@vyzo vyzo deleted the feat/protect-peers branch June 3, 2020 20:31
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.

3 participants