libp2p / go-libp2p-pubsub

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

Query: GossipSub publish doesn't return failure even if node is not connected to any peers for a topic #539

Closed chaitanyaprem closed 3 months ago

chaitanyaprem commented 1 year ago

If we are using GossipSub to publish a message for a topic, the API doesn't return any error/failure in case there are no peers available for that topic. If there are no fan-out peers identified/discovered for that topic, shouldn't an error be returned to the caller indicating that not enough peers are available to publish the message?

Especially since a node is not required to subscribe to a topic to which it wants to publish messages, I am thinking this would be a good to have.

vyzo commented 1 year ago

There is a publish option to wait until there are enough peers.

chaitanyaprem commented 1 year ago

Ok, but shouldn't it be the default option. I am wondering as to why would a node want to publish if there are no peers to publish. Is there some use-case i am missing?

vyzo commented 1 year ago

The library can't guess the user's requirements.