Skip to content

Commit

Permalink
remove redundant pubkey update record (solana-labs#33722)
Browse files Browse the repository at this point in the history
* remove redundant pubkey update record

* from became unused, so removed from all process_pull_response() calls
  • Loading branch information
Greg Cusack authored Oct 17, 2023
1 parent 5de9163 commit 6efc7ec
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
1 change: 0 additions & 1 deletion gossip/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions gossip/src/crds_gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ impl CrdsGossip {
/// Process a pull response.
pub fn process_pull_responses(
&self,
from: &Pubkey,
responses: Vec<CrdsValue>,
responses_expired_timeout: Vec<CrdsValue>,
failed_inserts: Vec<Hash>,
Expand All @@ -283,7 +282,6 @@ impl CrdsGossip {
) {
self.pull.process_pull_responses(
&self.crds,
from,
responses,
responses_expired_timeout,
failed_inserts,
Expand Down
19 changes: 2 additions & 17 deletions gossip/src/crds_gossip_pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ impl CrdsGossipPull {
pub(crate) fn process_pull_responses(
&self,
crds: &RwLock<Crds>,
from: &Pubkey,
responses: Vec<CrdsValue>,
responses_expired_timeout: Vec<CrdsValue>,
failed_inserts: Vec<Hash>,
Expand All @@ -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);
}
Expand Down Expand Up @@ -543,7 +541,6 @@ impl CrdsGossipPull {
fn process_pull_response(
&self,
crds: &RwLock<Crds>,
from: &Pubkey,
timeouts: &CrdsTimeouts,
response: Vec<CrdsValue>,
now: u64,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
);

Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
1 change: 0 additions & 1 deletion gossip/tests/crds_gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6efc7ec

Please sign in to comment.