libp2p / go-libp2p-pubsub

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

Switch to the new peer notify mechanism #564

Closed Stebalien closed 1 month ago

Stebalien commented 1 month ago
  1. Only listen for peers added and identify events.
  2. Remove the old "Limited" check. Peers only show up as "Connected" if they have non-limited connections.
  3. Don't bother listening for new connections directly and/or connectivity changes. We'll get a new identify event per new connection regardless.

fixes #546

Stebalien commented 1 month ago

Apparently pubsub uses the "blank" host in tests, which doesn't support identify.

Stebalien commented 1 month ago

Tests should be fixed by https://github.com/libp2p/go-libp2p-pubsub/pull/565.

Stebalien commented 1 month ago

This conflicts with https://github.com/libp2p/go-libp2p-pubsub/pull/440. I'd prefer to just remove that feature because it doesn't work reliably with identify.

vyzo commented 1 month ago

I agree, but we should check with users of the feature. If there is none, no problem.

If it is in use, we might have to make some changes; maybe have a user function to test instead of directly comparing with the router protocols?

Stebalien commented 1 month ago

Hm. You're right, we have the function and can just use that.

Stebalien commented 1 month ago

Ok, it should all work correctly-ish now. Or, well, correct enough.