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

feat: add direct connect ticks option #345

Closed alanshaw closed 4 years ago

alanshaw commented 4 years ago

In drand we have a gossipsub relay to allow users to subscribe to getting random values over pubsub. We want to support pure gossip relays who relay from a relay. For this we need direct peering agreements and want to mitigate the possibility of "missing" randomness messages by ensuring the direct connect ticks period is less than the period between randomness messages.

This PR simply adds a new functional option allowing us to set the direct connect ticks value without modifying the global variable.

vyzo commented 4 years ago

There is already a variable that you can set: GossipSubDirectConnectTicks. Do you really need a functional option?

vyzo commented 4 years ago

Mind rebasing on master?

alanshaw commented 4 years ago

@vyzo done :)