libp2p / specs

Technical specifications for the libp2p networking stack
https://libp2p.io
1.55k stars 273 forks source link

The current Gossipsub spec does not correspond to the current implementation of `GossipSubRouter` in `go-floodsub` #83

Closed mhchia closed 6 years ago

mhchia commented 6 years ago

We have two versions of pubsub router now, FloodSubRouter and GossipSubRouter respectively. It is clear that FloodSubRouter just floods messages. However, the current GossipSubRouter does not perform the same way as the Gossipsub spec described. It is more like performing normal gossiping on each topic. Its algorithm is quite the same as the protocol in gerbil-simsub. For me, it is quite confusing that the implementation is a lot different from the spec.

IMO the name "gossipsub" is suitable for the current implementation of GossipSubRouter in the repo go-floodsub, i.e. the gerbil-simsub's protocol. And the one described in the Gossipsub spec should be the spec for "Proximity Aware Epidemic PubSub". So it will be clearer if we have specs for "gossipsub" and "Proximity Aware Epidemic PubSub" respectively.

Is there a plan already that the current gossipsub implementation will be used, or it will be changed to "Proximity Aware Epidemic PubSub" soon? It is actually discussed in https://github.com/libp2p/libp2p/issues/33#issuecomment-399171178 and I really appreciate the answer from @whyrusleeping. Just want to confirm again, since "Proximity Aware Epidemic PubSub" seems to be more experimental, for its broadcast tree, random walks for joining, and passive view exchange. In contrast, the current "gossipsub" in go-floodsub seems more safe.

Thank you for reading!

whyrusleeping commented 6 years ago

@mhchia (also responded in the other issue)

Sorry for the delay, was at the decentralized web summit all last week.

The gossipsub spec draft is still a draft (review welcome!) and should probably renamed something other than gossipsub (because its much more than a simple gossip).

The gossipsub implemented in go and gerbil is version 1 (where floodsub is version 0) of the libp2p base pubsub. The change from floodsub to gossipsub introduces some new features at the wire protocol level, allowing us to have better control over peer set selection. The randomized peer selection gossipsub implementation exercises these new features. More sophisticated protocols that we want to build (namely, proximity aware epidemic pubsub type things) should be able to be built using this wire protocol.

That said, the gossipsub (random peers) implementation should be pretty robust and work quite well. We're going to get it turned on in go-ipfs soon, and run some 'real world' test simulations (hopefully) soon.

vyzo commented 6 years ago

Yes, this is indeed the case!

The gossipsub document in the specs repo is not actually gossipsub! It's an earlier proposal for episub, which is still on the roadmap as a custom gossipsub router.

ghost commented 6 years ago

It sounds like a reasonable fix here is just to rename the current spec, including changing the directory name and maybe putting an "WIP" or "Draft" label on the spec README.md.

If no one objects, I'll open a PR to do this.

vyzo commented 6 years ago

already done in #84 -- renamed the current spec to episub, which is the protocol it describes.

ghost commented 6 years ago

Awesome - hadn't seen that. Shall we close this issue?

mhchia commented 6 years ago

@whyrusleeping Thanks a lot for the explanation. I think it makes sense that "the gossipsub (random peers) implementation" serves as the baseline of the pubsub. @vyzo Thank you for the correction. I think it also makes sense if the description of the protocol in https://github.com/vyzo/gerbil-simsub#the-gossipsub-protocol is added to https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/README.md

mhchia commented 6 years ago

Closed by https://github.com/libp2p/specs/pull/87 Thanks a lot for the work!