add more diagnostics when gossip publish fails

This commit is contained in:
Giovanni Petrantoni 2021-02-09 18:42:59 +09:00
parent d9563d65ae
commit fff54fa23c
1 changed files with 4 additions and 1 deletions

View File

@ -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