From b22165ad6948abfac6d54d3d4cd2af4c5b2b3feb Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Thu, 24 Mar 2022 09:58:06 -0500 Subject: [PATCH] hash calc uses self.filler_account_suffix (#23887) --- core/src/accounts_hash_verifier.rs | 1 - runtime/src/accounts_db.rs | 20 +++++++++----------- runtime/src/accounts_hash.rs | 2 -- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/core/src/accounts_hash_verifier.rs b/core/src/accounts_hash_verifier.rs index ec446a9a2e..85a7210978 100644 --- a/core/src/accounts_hash_verifier.rs +++ b/core/src/accounts_hash_verifier.rs @@ -120,7 +120,6 @@ impl AccountsHashVerifier { stats: HashStats::default(), check_hash: false, accounts_cache_and_ancestors: None, - filler_account_suffix: None, // this will fail with filler accounts }) .unwrap(); diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 14bae5498d..1a33f5c4f2 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -5521,11 +5521,6 @@ impl AccountsDb { stats: timings, check_hash, accounts_cache_and_ancestors, - filler_account_suffix: if self.filler_account_count > 0 { - self.filler_account_suffix.as_ref() - } else { - None - }, }) } else { self.calculate_accounts_hash(slot, ancestors, check_hash) @@ -5738,6 +5733,14 @@ impl AccountsDb { end: (pass + 1) * bins_per_pass, }; + let hash = AccountsHash { + filler_account_suffix: if self.filler_account_count > 0 { + self.filler_account_suffix + } else { + None + }, + }; + let result = Self::scan_snapshot_stores_with_cache( &cache_hash_data, config.storages, @@ -5746,12 +5749,9 @@ impl AccountsDb { &bounds, config.check_hash, config.accounts_cache_and_ancestors, - config.filler_account_suffix, + hash.filler_account_suffix.as_ref(), )?; - let hash = AccountsHash { - filler_account_suffix: config.filler_account_suffix.cloned(), - }; let (hash, lamports, for_next_pass) = hash.rest_of_hash_calculation( result, &mut config.stats, @@ -7923,7 +7923,6 @@ pub mod tests { stats: HashStats::default(), check_hash: false, accounts_cache_and_ancestors: None, - filler_account_suffix: None, }) .unwrap(); let expected_hash = Hash::from_str("GKot5hBsd81kMupNCXHaqbhv3huEbxAFMLnpcX2hniwn").unwrap(); @@ -7948,7 +7947,6 @@ pub mod tests { stats: HashStats::default(), check_hash: false, accounts_cache_and_ancestors: None, - filler_account_suffix: None, }) .unwrap(); diff --git a/runtime/src/accounts_hash.rs b/runtime/src/accounts_hash.rs index f165f0eb41..aad6e170f8 100644 --- a/runtime/src/accounts_hash.rs +++ b/runtime/src/accounts_hash.rs @@ -35,8 +35,6 @@ pub struct CalcAccountsHashConfig<'a> { &'a Ancestors, &'a AccountInfoAccountsIndex, )>, - // these should be gone soon as we get an AccountsDb '&self' - pub filler_account_suffix: Option<&'a Pubkey>, // to come soon /* pub rent_collector: RentCollector,