Move slot cleanup to AccountsBackgroundService (#13911)
* Move bank drop to AccountsBackgroundService * Send to ABS on drop instead, protects against other places banks are dropped * Fix Abi * test Co-authored-by: Carl Lin <carl@solana.com>
This commit is contained in:
@ -249,6 +249,7 @@ mod tests {
|
||||
use super::*;
|
||||
use solana_ledger::genesis_utils::{create_genesis_config, GenesisConfigInfo};
|
||||
use solana_runtime::{
|
||||
accounts_background_service::ABSRequestSender,
|
||||
bank_forks::BankForks,
|
||||
genesis_utils::{create_genesis_config_with_vote_accounts, ValidatorVoteKeypairs},
|
||||
};
|
||||
@ -539,7 +540,7 @@ mod tests {
|
||||
&working_bank,
|
||||
);
|
||||
for x in 0..root {
|
||||
bank_forks.set_root(x, &None, None);
|
||||
bank_forks.set_root(x, &ABSRequestSender::default(), None);
|
||||
}
|
||||
|
||||
// Add an additional bank/vote that will root slot 2
|
||||
@ -576,7 +577,11 @@ mod tests {
|
||||
.read()
|
||||
.unwrap()
|
||||
.highest_confirmed_root();
|
||||
bank_forks.set_root(root, &None, Some(highest_confirmed_root));
|
||||
bank_forks.set_root(
|
||||
root,
|
||||
&ABSRequestSender::default(),
|
||||
Some(highest_confirmed_root),
|
||||
);
|
||||
let highest_confirmed_root_bank = bank_forks.get(highest_confirmed_root);
|
||||
assert!(highest_confirmed_root_bank.is_some());
|
||||
|
||||
@ -641,7 +646,11 @@ mod tests {
|
||||
.read()
|
||||
.unwrap()
|
||||
.highest_confirmed_root();
|
||||
bank_forks.set_root(root, &None, Some(highest_confirmed_root));
|
||||
bank_forks.set_root(
|
||||
root,
|
||||
&ABSRequestSender::default(),
|
||||
Some(highest_confirmed_root),
|
||||
);
|
||||
let highest_confirmed_root_bank = bank_forks.get(highest_confirmed_root);
|
||||
assert!(highest_confirmed_root_bank.is_some());
|
||||
}
|
||||
|
Reference in New Issue
Block a user