records hash of values purged by expired pull-responses (#16800)

process_pull_responses should record hash of values purged by expired
responses (as well as unexpired ones):
https://github.com/solana-labs/solana/blob/c1829dd00/core/src/crds_gossip_pull.rs#L385-L387

otherwise, these values are not excluded from following pull-requests
(from likely different nodes):
https://github.com/solana-labs/solana/blob/c1829dd00/core/src/crds_gossip_pull.rs#L447-L452

and would waste bandwidth should they be included in subsequent
pull-responses.
This commit is contained in:
behzad nouri 2021-04-27 12:06:49 +00:00 committed by GitHub
parent 0f3ac51cf1
commit 3b8d6b59fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -382,8 +382,10 @@ impl CrdsGossipPull {
let mut owners = HashSet::new();
for r in responses_expired_timeout {
let value_hash = r.value_hash;
if crds.insert_versioned(r).is_err() {
failed_inserts.push(value_hash);
match crds.insert_versioned(r) {
Ok(None) => (),
Ok(Some(old)) => self.purged_values.push_back((old.value_hash, now)),
Err(_) => failed_inserts.push(value_hash),
}
}
for r in responses {