You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Had a few questions regarding the Gossip part of the spec and Go implementation in Gossipsub heartbeat.
It says:
Gossip is emitted by selecting peers for each topic that are not already part of the mesh:
for each topic in mesh+fanout:
let mids be mcache.window[topic]
if mids is not empty:
select D peers from peers.gossipsub[topic]
for each peer not in mesh[topic] or fanout[topic]
emit IHAVE(mids)
shift the mcache
Q1: You're not able to have mesh and fanout peers for the same topic simultaneously. fanout is for when we're not subscribed, mesh is for when we are subscribed.
Q2: Yes, that was a relatively recent change in the Go implementation. There is a spec PR to update the spec at #219. @vyzo is that PR ready to merge now?
Had a few questions regarding the
Gossip
part of the spec and Go implementation in Gossipsub heartbeat.It says:
Q1:
The pseudo code is a bit confusing to me. I interpret it as: for each
topic
in bothmesh
andfanout
, get gossipssub peers from thattopic
excluding peers already inmesh
andfanout
.But in Go implementation, it's separated into two loops:
mesh
andfanout
.In
mesh
loop, for eachtopic
, we get gossipssub peers from thattopic
excluding peers already inmesh
(but they could be infanout
) and vice versa forfanout
loop.https://github.com/libp2p/go-libp2p-pubsub/blob/01b9825fbee1848751d90a8469e3f5f43bac8466/gossipsub.go#L482-L484
https://github.com/libp2p/go-libp2p-pubsub/blob/01b9825fbee1848751d90a8469e3f5f43bac8466/gossipsub.go#L520-L522
Q2:
In the pseudo code, we first choose
D
gossipsub peers from thetopic
then filter our peers that's not already inmesh
andfanout
but in Go implementation peers are filtered before returning the firstcount
number of peers.https://github.com/libp2p/go-libp2p-pubsub/blob/01b9825fbee1848751d90a8469e3f5f43bac8466/gossipsub.go#L674-L694
The text was updated successfully, but these errors were encountered: