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:
carllin
2020-12-12 17:22:34 -08:00
committed by GitHub
parent 549a3107cb
commit 55fc963595
11 changed files with 297 additions and 67 deletions

View File

@ -2732,7 +2732,9 @@ pub mod tests {
blockstore_processor::fill_blockstore_slot_with_ticks,
genesis_utils::{create_genesis_config, GenesisConfigInfo},
};
use solana_runtime::commitment::BlockCommitment;
use solana_runtime::{
accounts_background_service::ABSRequestSender, commitment::BlockCommitment,
};
use solana_sdk::{
clock::MAX_RECENT_BLOCKHASHES,
fee_calculator::DEFAULT_BURN_PERCENT,
@ -2833,7 +2835,10 @@ pub mod tests {
bank_forks.write().unwrap().insert(new_bank);
for root in roots.iter() {
bank_forks.write().unwrap().set_root(*root, &None, Some(0));
bank_forks
.write()
.unwrap()
.set_root(*root, &ABSRequestSender::default(), Some(0));
let mut stakes = HashMap::new();
stakes.insert(leader_vote_keypair.pubkey(), (1, Account::default()));
let block_time = bank_forks