libp2p / go-libp2p-pubsub

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

Topic relay #317

Closed lukasz-zimnoch closed 4 years ago

lukasz-zimnoch commented 4 years ago

Refs #28 #292

This pull request ships an implementation of the topic Relay operation. That opens the possibility to take part in voluntary topic dissemination by all interested nodes without the need for subscribing.

Implementation details

This implementation tries to follow @vyzo comment thus it uses a relay reference counter and try to not conflate with subscriptions. However, regarding peer discovery, we probably must follow the same logic as subscriptions which is reflected in the implementation. Also, relays canceling logic has probably a place for improvements so I'd appreciate suggestions on how I can do it better to satisfy all possible use cases.

vyzo commented 4 years ago

Do you mind rebasing on master? The branch is currently out of date, which would prevent us from merging.

lukasz-zimnoch commented 4 years ago

Thanks for review @vyzo! All comments addressed.