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

@@ -167,7 +167,9 @@ impl OptimisticallyConfirmedBankTracker {
mod tests {
use super::*;
use solana_ledger::genesis_utils::{create_genesis_config, GenesisConfigInfo};
use solana_runtime::commitment::BlockCommitmentCache;
use solana_runtime::{
accounts_background_service::ABSRequestSender, commitment::BlockCommitmentCache,
};
use solana_sdk::pubkey::Pubkey;
#[test]
@@ -279,7 +281,10 @@ mod tests {
let bank5 = bank_forks.read().unwrap().get(5).unwrap().clone();
let bank7 = Bank::new_from_parent(&bank5, &Pubkey::default(), 7);
bank_forks.write().unwrap().insert(bank7);
bank_forks.write().unwrap().set_root(7, &None, None);
bank_forks
.write()
.unwrap()
.set_root(7, &ABSRequestSender::default(), None);
OptimisticallyConfirmedBankTracker::process_notification(
BankNotification::OptimisticallyConfirmed(6),
&bank_forks,