libp2p / go-libp2p-pubsub

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

Add preconnected nodes to pubsub #393

Closed aschmahmann closed 3 years ago

aschmahmann commented 3 years ago

PubSub only tries to add peers to the set of pubsub nodes when they connect. This meant that peers that were already connected to the host (e.g. tests, multiple nodes on the same machine, an application waiting a while to start up pubsub, etc.) would not get treated as pubsub nodes.

This resolves that by simply adding the list of already connected peers to pubsub.

Note: PubSub still does not utilize Identify events to figure out if a peer supports one of the valid pubsub protocols or not, that other implementations of PubSub need to run a similar script instead of just toggling on and off support for a protocol like FloodSub.

aschmahmann commented 3 years ago

Note: CI on this branch seems to be failing sometimes - I think the TestTagTracerDeliveryTags test is flaky and that it's unrelated to this PR. lmk what you think @vyzo

vyzo commented 3 years ago

yeah, that test is flaky and it's getting on my nerves.