diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index 59f86aa48421a9..68b68cf395b44c 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -2473,7 +2473,7 @@ impl ClusterInfo { let mut rng = rand::thread_rng(); let keypair: Arc = self.keypair().clone(); let mut verify_gossip_addr = |value: &CrdsValue| { - verify_gossip_addr( + if verify_gossip_addr( &mut rng, &keypair, value, @@ -2481,7 +2481,12 @@ impl ClusterInfo { &self.socket_addr_space, &self.ping_cache, &mut pings, - ) + ) { + true + } else { + self.stats.num_unverifed_gossip_addrs.add_relaxed(1); + false + } }; // Split packets based on their types. let mut pull_requests = vec![]; diff --git a/gossip/src/cluster_info_metrics.rs b/gossip/src/cluster_info_metrics.rs index eed11f8313c195..56a6b0ab2c663c 100644 --- a/gossip/src/cluster_info_metrics.rs +++ b/gossip/src/cluster_info_metrics.rs @@ -129,6 +129,7 @@ pub struct GossipStats { pub(crate) new_push_requests2: Counter, pub(crate) new_push_requests: Counter, pub(crate) new_push_requests_num: Counter, + pub(crate) num_unverifed_gossip_addrs: Counter, pub(crate) packets_received_count: Counter, pub(crate) packets_received_ping_messages_count: Counter, pub(crate) packets_received_pong_messages_count: Counter, @@ -494,6 +495,11 @@ pub(crate) fn submit_gossip_stats( stats.pull_requests_count.clear(), i64 ), + ( + "num_unverifed_gossip_addrs", + stats.num_unverifed_gossip_addrs.clear(), + i64 + ), ( "packets_received_count", stats.packets_received_count.clear(),