From fff54fa23c0412b59e79158f4cef2dc445e7ae94 Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni <7008900+sinkingsugar@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:42:59 +0900 Subject: [PATCH] add more diagnostics when gossip publish fails --- libp2p/protocols/pubsub/gossipsub.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libp2p/protocols/pubsub/gossipsub.nim b/libp2p/protocols/pubsub/gossipsub.nim index 17fd3ccb9..b609c9a85 100644 --- a/libp2p/protocols/pubsub/gossipsub.nim +++ b/libp2p/protocols/pubsub/gossipsub.nim @@ -520,7 +520,10 @@ method publish*(g: GossipSub, g.lastFanoutPubSub[topic] = Moment.fromNow(g.parameters.fanoutTTL) if peers.len == 0: - notice "No peers for topic, skipping publish" + let topicPeers = g.gossipsub.getOrDefault(topic).toSeq() + notice "No peers for topic, skipping publish", peersOnTopic = topicPeers.len, + connectedPeers = topicPeers.filterIt(it.connected).len, + topic # skipping topic as our metrics finds that heavy libp2p_gossipsub_failed_publish.inc() return 0