Skip to content

Commit ff5b7a3

Browse files
remove test_hash_calculation from some structs (#6940)
* remove test_hash_calculation from some structs * bench
1 parent e0bd922 commit ff5b7a3

File tree

4 files changed

+2
-14
lines changed

4 files changed

+2
-14
lines changed

accounts-db/benches/accounts.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ fn bench_accounts_hash_bank_hash(bencher: &mut Bencher) {
6666
total_lamports,
6767
VerifyAccountsHashAndLamportsConfig {
6868
ancestors: &ancestors,
69-
test_hash_calculation: false,
7069
epoch_schedule: &EpochSchedule::default(),
7170
epoch: Epoch::default(),
7271
ignore_mismatch: false,

accounts-db/src/accounts_db.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ pub(crate) struct ShrinkCollectAliveSeparatedByRefs<'a> {
180180
pub struct VerifyAccountsHashAndLamportsConfig<'a> {
181181
/// bank ancestors
182182
pub ancestors: &'a Ancestors,
183-
/// true to verify hash calculation
184-
pub test_hash_calculation: bool,
185183
/// epoch_schedule
186184
pub epoch_schedule: &'a EpochSchedule,
187185
/// epoch
@@ -8860,7 +8858,6 @@ impl<'a> VerifyAccountsHashAndLamportsConfig<'a> {
88608858
) -> Self {
88618859
Self {
88628860
ancestors,
8863-
test_hash_calculation: true,
88648861
epoch_schedule,
88658862
epoch,
88668863
ignore_mismatch: false,

runtime/src/bank.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ pub use {partitioned_epoch_rewards::KeyedRewardsAndNumPartitions, solana_reward_
199199

200200
/// params to `verify_accounts_hash`
201201
struct VerifyAccountsHashConfig {
202-
test_hash_calculation: bool,
203202
ignore_mismatch: bool,
204203
require_rooted_bank: bool,
205204
run_in_background: bool,
@@ -4732,7 +4731,6 @@ impl Bank {
47324731
_ = self.verify_accounts_hash(
47334732
None,
47344733
VerifyAccountsHashConfig {
4735-
test_hash_calculation: false,
47364734
ignore_mismatch: true,
47374735
require_rooted_bank: false,
47384736
run_in_background: false,
@@ -4815,7 +4813,6 @@ impl Bank {
48154813
ancestors: &self.ancestors,
48164814
epoch_schedule: self.epoch_schedule(),
48174815
epoch: self.epoch(),
4818-
test_hash_calculation: config.test_hash_calculation,
48194816
ignore_mismatch: config.ignore_mismatch,
48204817
store_detailed_debug_info: config.store_hash_raw_data_for_debug,
48214818
use_bg_thread_pool: config.run_in_background,
@@ -5258,7 +5255,7 @@ impl Bank {
52585255
/// calculation and could shield other real accounts.
52595256
pub fn verify_snapshot_bank(
52605257
&self,
5261-
test_hash_calculation: bool,
5258+
_test_hash_calculation: bool,
52625259
skip_shrink: bool,
52635260
force_clean: bool,
52645261
latest_full_snapshot_slot: Slot,
@@ -5279,7 +5276,6 @@ impl Bank {
52795276
let verified = self.verify_accounts_hash(
52805277
base,
52815278
VerifyAccountsHashConfig {
5282-
test_hash_calculation,
52835279
ignore_mismatch: false,
52845280
require_rooted_bank: false,
52855281
run_in_background: true,

runtime/src/bank/tests.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,6 @@ fn test_bank_update_rewards_determinism() {
943943
impl VerifyAccountsHashConfig {
944944
fn default_for_test() -> Self {
945945
Self {
946-
test_hash_calculation: true,
947946
ignore_mismatch: false,
948947
require_rooted_bank: false,
949948
run_in_background: false,
@@ -10934,10 +10933,7 @@ fn test_bank_verify_accounts_hash_with_base() {
1093410933
// ensure the accounts hash verifies
1093510934
assert!(bank.verify_accounts_hash(
1093610935
Some((base_slot, base_capitalization)),
10937-
VerifyAccountsHashConfig {
10938-
test_hash_calculation: false,
10939-
..VerifyAccountsHashConfig::default_for_test()
10940-
},
10936+
VerifyAccountsHashConfig::default_for_test(),
1094110937
None,
1094210938
));
1094310939
}

0 commit comments

Comments
 (0)