Skip to content

Commit

Permalink
Removes invariant is_serialized_with_abs param (solana-labs#33154)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Sep 6, 2023
1 parent d921b9a commit 9e156f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions runtime/src/accounts_background_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ pub struct PrunedBanksRequestHandler {
}

impl PrunedBanksRequestHandler {
pub fn handle_request(&self, bank: &Bank, is_serialized_with_abs: bool) -> usize {
pub fn handle_request(&self, bank: &Bank) -> usize {
let mut banks_to_purge: Vec<_> = self.pruned_banks_receiver.try_iter().collect();
// We need a stable sort to ensure we purge banks—with the same slot—in the same order
// they were sent into the channel.
Expand Down Expand Up @@ -530,7 +530,7 @@ impl PrunedBanksRequestHandler {
accounts_db.thread_pool_clean.install(|| {
grouped_banks_to_purge.into_par_iter().for_each(|group| {
group.iter().for_each(|(slot, bank_id)| {
accounts_db.purge_slot(*slot, *bank_id, is_serialized_with_abs);
accounts_db.purge_slot(*slot, *bank_id, true);
})
});
});
Expand All @@ -545,7 +545,7 @@ impl PrunedBanksRequestHandler {
total_remove_slots_time: &mut u64,
) {
let mut remove_slots_time = Measure::start("remove_slots_time");
*removed_slots_count += self.handle_request(bank, true);
*removed_slots_count += self.handle_request(bank);
remove_slots_time.stop();
*total_remove_slots_time += remove_slots_time.as_us();

Expand Down Expand Up @@ -1166,7 +1166,7 @@ mod test {
drop(fork2_bank1);
drop(fork0_bank1);
drop(fork0_bank0);
let num_banks_purged = pruned_banks_request_handler.handle_request(&fork0_bank3, true);
let num_banks_purged = pruned_banks_request_handler.handle_request(&fork0_bank3);
assert_eq!(num_banks_purged, 7);
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/src/bank/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8562,7 +8562,7 @@ fn test_store_scan_consistency_unrooted() {
current_major_fork_bank.clean_accounts_for_tests();
// Move purge here so that Bank::drop()->purge_slots() doesn't race
// with clean. Simulates the call from AccountsBackgroundService
pruned_banks_request_handler.handle_request(&current_major_fork_bank, true);
pruned_banks_request_handler.handle_request(&current_major_fork_bank);
}
},
Some(Box::new(SendDroppedBankCallback::new(pruned_banks_sender))),
Expand Down

0 comments on commit 9e156f8

Please sign in to comment.