libp2p / go-libp2p-pubsub

The PubSub implementation for go-libp2p
https://github.com/libp2p/specs/tree/master/pubsub
Other
321 stars 185 forks source link

Protect direct and mesh peers in the connection manager #348

Closed vyzo closed 4 years ago

vyzo commented 4 years ago

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 commented 4 years ago

cc @raulk

vyzo commented 4 years ago

Implementation of protection status queries in https://github.com/libp2p/go-libp2p-core/pull/158 and https://github.com/libp2p/go-libp2p-connmgr/pull/76

Stebalien commented 4 years ago

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

vyzo commented 4 years ago

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 commented 4 years ago

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

vyzo commented 4 years ago

reinstated the tests, using the new connection manager interface.