libp2p / js-libp2p-pubsub-peer-discovery

A js-libp2p module that uses pubsub for mdns like peer discovery
Other
11 stars 6 forks source link

Broadcast PeerInfo message on new Subscription to Topic #105

Open justin0mcateer opened 1 year ago

justin0mcateer commented 1 year ago

GossipSub provides an event when a new peer subscribes to a topic. It seems that peer discovery time would be reduced significantly if peers broadcast their PeerInfo immediately (perhaps with a short backoff) when they see new peers joining the peer discovery topic.

I was thinking to implement a small patch that would add this behavior. Can anyone see any reason why this wouldn't be beneficial or any other reason to not do this?