From 686e7a42e8c285593a82d347b2a05b78d290636e Mon Sep 17 00:00:00 2001 From: boqiu <82121246@qq.com> Date: Wed, 4 Dec 2024 18:15:37 +0800 Subject: [PATCH] aaa --- node/network/src/types/topics.rs | 10 +++++----- node/router/src/service.rs | 21 ++++++++++----------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/node/network/src/types/topics.rs b/node/network/src/types/topics.rs index 772d387..a4fc80b 100644 --- a/node/network/src/types/topics.rs +++ b/node/network/src/types/topics.rs @@ -15,12 +15,12 @@ pub const ANNOUNCE_FILE_TOPIC: &str = "announce_file"; pub const ANNOUNCE_CHUNKS_TOPIC: &str = "announce_chunks"; pub const ANNOUNCE_SHARD_CONFIG_TOPIC: &str = "announce_shard_config"; -pub const CORE_TOPICS: [GossipKind; 1] = [ +pub const CORE_TOPICS: [GossipKind; 5] = [ GossipKind::NewFile, - // GossipKind::FindFile, - // GossipKind::FindChunks, - // GossipKind::AnnounceFile, - // GossipKind::AnnounceChunks, + GossipKind::FindFile, + GossipKind::FindChunks, + GossipKind::AnnounceFile, + GossipKind::AnnounceChunks, ]; /// A gossipsub topic which encapsulates the type of messages that should be sent and received over diff --git a/node/router/src/service.rs b/node/router/src/service.rs index 847bcce..228ae58 100644 --- a/node/router/src/service.rs +++ b/node/router/src/service.rs @@ -237,22 +237,21 @@ impl RouterService { .. } => { if matches!(message, PubsubMessage::AnnounceFile(..)) { - let maybe_peer = self + let source_version = self .network_globals .peers .read() .peer_info(&source) - .cloned(); + .map(|i| i.client().version.clone()); - if let Some(peer) = maybe_peer { - let ip = peer.seen_ip_addresses().collect::>(); - let agent = peer.client().agent_string.clone(); - let connection = peer.connection_status().clone(); - let conn_dir = peer.connection_direction().cloned(); - debug!(%source, ?ip, ?agent, ?connection, ?conn_dir, "Received AnnounceFile pubsub message"); - } else { - debug!(%source, "Received AnnounceFile pubsub message, but not found in peer db"); - } + let prop_source_version = self + .network_globals + .peers + .read() + .peer_info(&propagation_source) + .map(|i| i.client().version.clone()); + + debug!(%source, ?source_version, %propagation_source, ?prop_source_version, "Received AnnounceFile pubsub message"); } let result = self