From 6efc7ec61dbee1608b2fd142ceea34f939ab5bb8 Mon Sep 17 00:00:00 2001 From: Greg Cusack Date: Tue, 17 Oct 2023 10:34:12 -0700 Subject: [PATCH] remove redundant pubkey update record (#33722) * remove redundant pubkey update record * from became unused, so removed from all process_pull_response() calls --- gossip/src/cluster_info.rs | 1 - gossip/src/crds_gossip.rs | 2 -- gossip/src/crds_gossip_pull.rs | 19 ++----------------- gossip/tests/crds_gossip.rs | 1 - 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index 8bfe628da8c441..0e72efd8a5cde2 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -2184,7 +2184,6 @@ impl ClusterInfo { { let _st = ScopedTimer::from(&self.stats.process_pull_response); self.gossip.process_pull_responses( - from, filtered_pulls, filtered_pulls_expired_timeout, failed_inserts, diff --git a/gossip/src/crds_gossip.rs b/gossip/src/crds_gossip.rs index 41a0e4c9ab4a7f..015deed1d2a472 100644 --- a/gossip/src/crds_gossip.rs +++ b/gossip/src/crds_gossip.rs @@ -274,7 +274,6 @@ impl CrdsGossip { /// Process a pull response. pub fn process_pull_responses( &self, - from: &Pubkey, responses: Vec, responses_expired_timeout: Vec, failed_inserts: Vec, @@ -283,7 +282,6 @@ impl CrdsGossip { ) { self.pull.process_pull_responses( &self.crds, - from, responses, responses_expired_timeout, failed_inserts, diff --git a/gossip/src/crds_gossip_pull.rs b/gossip/src/crds_gossip_pull.rs index 3e69192f2ac7e9..dae1eb3d79a7d3 100644 --- a/gossip/src/crds_gossip_pull.rs +++ b/gossip/src/crds_gossip_pull.rs @@ -360,7 +360,6 @@ impl CrdsGossipPull { pub(crate) fn process_pull_responses( &self, crds: &RwLock, - from: &Pubkey, responses: Vec, responses_expired_timeout: Vec, failed_inserts: Vec, @@ -382,7 +381,6 @@ impl CrdsGossipPull { } stats.success += num_inserts; self.num_pulls.fetch_add(num_inserts, Ordering::Relaxed); - owners.insert(*from); for owner in owners { crds.update_record_timestamp(&owner, now); } @@ -543,7 +541,6 @@ impl CrdsGossipPull { fn process_pull_response( &self, crds: &RwLock, - from: &Pubkey, timeouts: &CrdsTimeouts, response: Vec, now: u64, @@ -553,7 +550,6 @@ impl CrdsGossipPull { self.filter_pull_responses(crds, timeouts, response, now, &mut stats); self.process_pull_responses( crds, - from, versioned, versioned_expired_timeout, failed_inserts, @@ -1196,7 +1192,6 @@ pub(crate) mod tests { let failed = node .process_pull_response( &node_crds, - &node_pubkey, &node.make_timeouts(node_pubkey, &HashMap::new(), Duration::default()), rsp.into_iter().flatten().collect(), 1, @@ -1375,14 +1370,8 @@ pub(crate) mod tests { ); // inserting a fresh value should be fine. assert_eq!( - node.process_pull_response( - &node_crds, - &peer_pubkey, - &timeouts, - vec![peer_entry.clone()], - 1, - ) - .0, + node.process_pull_response(&node_crds, &timeouts, vec![peer_entry.clone()], 1,) + .0, 0 ); @@ -1394,7 +1383,6 @@ pub(crate) mod tests { assert_eq!( node.process_pull_response( &node_crds, - &peer_pubkey, &timeouts, vec![peer_entry.clone(), unstaked_peer_entry], node.crds_timeout + 100, @@ -1408,7 +1396,6 @@ pub(crate) mod tests { assert_eq!( node.process_pull_response( &node_crds, - &peer_pubkey, &timeouts, vec![peer_entry], node.crds_timeout + 1, @@ -1425,7 +1412,6 @@ pub(crate) mod tests { assert_eq!( node.process_pull_response( &node_crds, - &peer_pubkey, &timeouts, vec![peer_vote.clone()], node.crds_timeout + 1, @@ -1439,7 +1425,6 @@ pub(crate) mod tests { assert_eq!( node.process_pull_response( &node_crds, - &peer_pubkey, &timeouts, vec![peer_vote], node.crds_timeout + 2, diff --git a/gossip/tests/crds_gossip.rs b/gossip/tests/crds_gossip.rs index 827da50390c305..74415ec3c8ff33 100644 --- a/gossip/tests/crds_gossip.rs +++ b/gossip/tests/crds_gossip.rs @@ -575,7 +575,6 @@ fn network_run_pull( .gossip .filter_pull_responses(&timeouts, rsp, now, &mut stats); node.gossip.process_pull_responses( - &from, vers, vers_expired_timeout, failed_inserts,