Actively manage dead slots in AncestorHashesService (#18912)

This commit is contained in:
carllin
2021-08-02 14:33:28 -07:00
committed by GitHub
parent c16bf02448
commit 03353d500f
10 changed files with 1171 additions and 104 deletions

View File

@@ -1469,7 +1469,7 @@ pub mod test {
let mut cluster_votes = HashMap::new();
let votes = vec![0, 1, 2, 3, 4, 5];
cluster_votes.insert(node_pubkey, votes.clone());
vote_simulator.fill_bank_forks(forks, &cluster_votes);
vote_simulator.fill_bank_forks(forks, &cluster_votes, true);
// Simulate the votes
for vote in votes {
@@ -1526,7 +1526,7 @@ pub mod test {
/ tr(112))));
// Fill the BankForks according to the above fork structure
vote_simulator.fill_bank_forks(forks, &HashMap::new());
vote_simulator.fill_bank_forks(forks, &HashMap::new(), true);
for (_, fork_progress) in vote_simulator.progress.iter_mut() {
fork_progress.fork_stats.computed = true;
}
@@ -1947,7 +1947,7 @@ pub mod test {
let mut cluster_votes: HashMap<Pubkey, Vec<Slot>> = HashMap::new();
cluster_votes.insert(vote_simulator.node_pubkeys[1], vec![46]);
cluster_votes.insert(vote_simulator.node_pubkeys[2], vec![47]);
vote_simulator.fill_bank_forks(forks, &cluster_votes);
vote_simulator.fill_bank_forks(forks, &cluster_votes, true);
// Vote on the first minor fork at slot 14, should succeed
assert!(vote_simulator
@@ -2023,7 +2023,7 @@ pub mod test {
// Make the other validator vote fork to pass the threshold checks
let other_votes = my_votes.clone();
cluster_votes.insert(vote_simulator.node_pubkeys[1], other_votes);
vote_simulator.fill_bank_forks(forks, &cluster_votes);
vote_simulator.fill_bank_forks(forks, &cluster_votes, true);
// Simulate the votes.
for vote in &my_votes {
@@ -2567,7 +2567,7 @@ pub mod test {
/ (tr(110) / tr(111))))));
// Fill the BankForks according to the above fork structure
vote_simulator.fill_bank_forks(forks, &HashMap::new());
vote_simulator.fill_bank_forks(forks, &HashMap::new(), true);
for (_, fork_progress) in vote_simulator.progress.iter_mut() {
fork_progress.fork_stats.computed = true;
}
@@ -2667,7 +2667,7 @@ pub mod test {
let replayed_root_slot = 44;
// Fill the BankForks according to the above fork structure
vote_simulator.fill_bank_forks(forks, &HashMap::new());
vote_simulator.fill_bank_forks(forks, &HashMap::new(), true);
for (_, fork_progress) in vote_simulator.progress.iter_mut() {
fork_progress.fork_stats.computed = true;
}