diff --git a/core/src/accounts_hash_verifier.rs b/core/src/accounts_hash_verifier.rs index 85a7210978..4010002ec6 100644 --- a/core/src/accounts_hash_verifier.rs +++ b/core/src/accounts_hash_verifier.rs @@ -119,7 +119,7 @@ impl AccountsHashVerifier { use_bg_thread_pool: true, stats: HashStats::default(), check_hash: false, - accounts_cache_and_ancestors: None, + ancestors: None, }) .unwrap(); diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 6f0d2b5fb5..b51e327ec2 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -5492,14 +5492,14 @@ impl AccountsDb { is_startup: bool, ) -> Result<(Hash, u64), BankHashVerificationError> { if !use_index { - let accounts_cache_and_ancestors = if can_cached_slot_be_unflushed { - Some((&self.accounts_cache, ancestors)) + let ancestors = if can_cached_slot_be_unflushed { + Some(ancestors) } else { None }; let mut collect_time = Measure::start("collect"); - let (combined_maps, slots) = self.get_snapshot_storages(slot, None, Some(ancestors)); + let (combined_maps, slots) = self.get_snapshot_storages(slot, None, ancestors); collect_time.stop(); let mut sort_time = Measure::start("sort_storages"); @@ -5525,7 +5525,7 @@ impl AccountsDb { use_bg_thread_pool: !is_startup, stats: timings, check_hash, - accounts_cache_and_ancestors, + ancestors, }) } else { self.calculate_accounts_hash(slot, ancestors, check_hash) @@ -5754,8 +5754,8 @@ impl AccountsDb { &bounds, config.check_hash, config - .accounts_cache_and_ancestors - .map(|(a, b)| (a, b, &self.accounts_index)), + .ancestors + .map(|a| (&self.accounts_cache, a, &self.accounts_index)), hash.filler_account_suffix.as_ref(), )?; @@ -7929,7 +7929,7 @@ pub mod tests { use_bg_thread_pool: false, stats: HashStats::default(), check_hash: false, - accounts_cache_and_ancestors: None, + ancestors: None, }) .unwrap(); let expected_hash = Hash::from_str("GKot5hBsd81kMupNCXHaqbhv3huEbxAFMLnpcX2hniwn").unwrap(); @@ -7953,7 +7953,7 @@ pub mod tests { use_bg_thread_pool: false, stats: HashStats::default(), check_hash: false, - accounts_cache_and_ancestors: None, + ancestors: None, }) .unwrap(); diff --git a/runtime/src/accounts_hash.rs b/runtime/src/accounts_hash.rs index 71c02a628c..68b1a0f4e7 100644 --- a/runtime/src/accounts_hash.rs +++ b/runtime/src/accounts_hash.rs @@ -1,8 +1,5 @@ use { - crate::{ - accounts_cache::AccountsCache, accounts_db::SnapshotStorages, ancestors::Ancestors, - sorted_storages::SortedStorages, - }, + crate::{accounts_db::SnapshotStorages, ancestors::Ancestors, sorted_storages::SortedStorages}, log::*, rayon::prelude::*, solana_measure::measure::Measure, @@ -28,7 +25,7 @@ pub struct CalcAccountsHashConfig<'a> { pub use_bg_thread_pool: bool, pub stats: HashStats, pub check_hash: bool, - pub accounts_cache_and_ancestors: Option<(&'a AccountsCache, &'a Ancestors)>, + pub ancestors: Option<&'a Ancestors>, // to come soon /* pub rent_collector: RentCollector,