libp2p / go-libp2p-pubsub

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

Question regarding Gossipsub messages propagation #487

Closed roaminro closed 2 years ago

roaminro commented 2 years ago

Hello!

Quick question regarding Gossipsub messages propagation. Let's say I have the following p2p network:

A <-> B <-> C

where:

If A or C were to publish messages on topic 1, would B propagate these messages to C and A respectively even though it's not subsribed to topic 1?

My initial tests show that, no, C doesn't gossip messages that don't belong to topics C is subscribed to. (that's why I'd like to make sure what is the expected behavior)

Thank you in advance for the help!

vyzo commented 2 years ago

no, unless you enable relay for the topic.

In general, nodes only propagate messages for topics they have joined (as suscribers or relays).

roaminro commented 2 years ago

got it, thanks for the quick response and the explanation @vyzo !