From d3480784fb40d26680d076edf637c486927e3716 Mon Sep 17 00:00:00 2001 From: boqiu <82121246@qq.com> Date: Wed, 4 Dec 2024 11:15:50 +0800 Subject: [PATCH] Some debug log for file announcement --- node/router/src/libp2p_event_handler.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/node/router/src/libp2p_event_handler.rs b/node/router/src/libp2p_event_handler.rs index 146d1fe..3540c7e 100644 --- a/node/router/src/libp2p_event_handler.rs +++ b/node/router/src/libp2p_event_handler.rs @@ -365,6 +365,14 @@ impl Libp2pEventHandler { self.on_find_chunks(msg).await } PubsubMessage::AnnounceFile(msgs) => { + let maybe_peer = self.network_globals.peers.read().peer_info(&source).cloned(); + let ip = maybe_peer.clone().map(|info| info.seen_ip_addresses().collect::>()); + let agent = maybe_peer.clone().map(|info| info.client().agent_string.clone()); + let connection = maybe_peer.map(|info| info.connection_status().clone()); + + debug!(batch = %msgs.len(), %source, ?ip, ?agent, ?connection, "Received AnnounceFile pubsub message"); + + metrics::LIBP2P_HANDLE_PUBSUB_ANNOUNCE_FILE.mark(1); for msg in msgs {