From 9d3b17c635e72c5530f3b05f3c7266480eaff87c Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Thu, 24 Mar 2022 10:06:32 -0500 Subject: [PATCH] HashCalc uses self.accounts_index (#23888) --- runtime/src/accounts_db.rs | 8 +++++--- runtime/src/accounts_hash.rs | 10 ++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 1a33f5c4f2..45ccecca32 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -981,7 +981,7 @@ struct RemoveUnrootedSlotsSynchronization { signal: Condvar, } -pub type AccountInfoAccountsIndex = AccountsIndex; +type AccountInfoAccountsIndex = AccountsIndex; // This structure handles the load/store of the accounts #[derive(Debug)] @@ -5488,7 +5488,7 @@ impl AccountsDb { ) -> Result<(Hash, u64), BankHashVerificationError> { if !use_index { let accounts_cache_and_ancestors = if can_cached_slot_be_unflushed { - Some((&self.accounts_cache, ancestors, &self.accounts_index)) + Some((&self.accounts_cache, ancestors)) } else { None }; @@ -5748,7 +5748,9 @@ impl AccountsDb { PUBKEY_BINS_FOR_CALCULATING_HASHES, &bounds, config.check_hash, - config.accounts_cache_and_ancestors, + config + .accounts_cache_and_ancestors + .map(|(a, b)| (a, b, &self.accounts_index)), hash.filler_account_suffix.as_ref(), )?; diff --git a/runtime/src/accounts_hash.rs b/runtime/src/accounts_hash.rs index aad6e170f8..71c02a628c 100644 --- a/runtime/src/accounts_hash.rs +++ b/runtime/src/accounts_hash.rs @@ -1,8 +1,6 @@ use { crate::{ - accounts_cache::AccountsCache, - accounts_db::{AccountInfoAccountsIndex, SnapshotStorages}, - ancestors::Ancestors, + accounts_cache::AccountsCache, accounts_db::SnapshotStorages, ancestors::Ancestors, sorted_storages::SortedStorages, }, log::*, @@ -30,11 +28,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, - &'a AccountInfoAccountsIndex, - )>, + pub accounts_cache_and_ancestors: Option<(&'a AccountsCache, &'a Ancestors)>, // to come soon /* pub rent_collector: RentCollector,