Skip to content

Commit

Permalink
Revert "feature: on accounts hash calculation, do not try to rehash a…
Browse files Browse the repository at this point in the history
…ccounts solana-labs#28934"

This reverts commit 7ff7691.
  • Loading branch information
jeffwashington committed Nov 28, 2022
1 parent f186c37 commit e0ef8f1
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 1,430 deletions.
4 changes: 1 addition & 3 deletions accounts-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use {
test_utils::{create_test_accounts, update_accounts_bench},
Accounts,
},
accounts_db::{AccountShrinkThreshold, TEST_DISABLE_REHASH_FOR_RENT_EPOCH},
accounts_db::AccountShrinkThreshold,
accounts_index::AccountSecondaryIndexes,
ancestors::Ancestors,
rent_collector::RentCollector,
Expand Down Expand Up @@ -125,7 +125,6 @@ fn main() {
&ancestors,
&EpochSchedule::default(),
&RentCollector::default(),
TEST_DISABLE_REHASH_FOR_RENT_EPOCH,
);
time.stop();
let mut time_store = Measure::start("hash using store");
Expand All @@ -139,7 +138,6 @@ fn main() {
&EpochSchedule::default(),
&RentCollector::default(),
false,
TEST_DISABLE_REHASH_FOR_RENT_EPOCH,
);
time_store.stop();
if results != results_store {
Expand Down
5 changes: 0 additions & 5 deletions core/src/accounts_hash_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ impl AccountsHashVerifier {
rent_collector: &accounts_package.rent_collector,
store_detailed_debug_info_on_failure: false,
full_snapshot: None,
disable_rehash_for_rent_epoch: accounts_package.disable_rehash_for_rent_epoch,
},
&sorted_storages,
timings,
Expand All @@ -167,8 +166,6 @@ impl AccountsHashVerifier {
// now that we've failed, store off the failing contents that produced a bad capitalization
store_detailed_debug_info_on_failure: true,
full_snapshot: None,
disable_rehash_for_rent_epoch: accounts_package
.disable_rehash_for_rent_epoch,
},
&sorted_storages,
HashStats::default(),
Expand Down Expand Up @@ -339,7 +336,6 @@ mod tests {
super::*,
solana_gossip::{cluster_info::make_accounts_hashes_message, contact_info::ContactInfo},
solana_runtime::{
accounts_db::TEST_DISABLE_REHASH_FOR_RENT_EPOCH,
rent_collector::RentCollector,
snapshot_utils::{ArchiveFormat, SnapshotVersion},
},
Expand Down Expand Up @@ -433,7 +429,6 @@ mod tests {
accounts: Arc::clone(&accounts),
epoch_schedule: EpochSchedule::default(),
rent_collector: RentCollector::default(),
disable_rehash_for_rent_epoch: TEST_DISABLE_REHASH_FOR_RENT_EPOCH,
};

AccountsHashVerifier::process_accounts_package(
Expand Down
5 changes: 1 addition & 4 deletions runtime/benches/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use {
rayon::iter::{IntoParallelRefIterator, ParallelIterator},
solana_runtime::{
accounts::{test_utils::create_test_accounts, AccountAddressFilter, Accounts},
accounts_db::{AccountShrinkThreshold, TEST_DISABLE_REHASH_FOR_RENT_EPOCH},
accounts_db::AccountShrinkThreshold,
accounts_index::{AccountSecondaryIndexes, ScanConfig},
ancestors::Ancestors,
bank::*,
Expand Down Expand Up @@ -114,7 +114,6 @@ fn test_accounts_hash_bank_hash(bencher: &mut Bencher) {
&ancestors,
&EpochSchedule::default(),
&RentCollector::default(),
TEST_DISABLE_REHASH_FOR_RENT_EPOCH,
);
let test_hash_calculation = false;
bencher.iter(|| {
Expand All @@ -129,7 +128,6 @@ fn test_accounts_hash_bank_hash(bencher: &mut Bencher) {
false,
false,
false,
TEST_DISABLE_REHASH_FOR_RENT_EPOCH,
))
});
}
Expand All @@ -153,7 +151,6 @@ fn test_update_accounts_hash(bencher: &mut Bencher) {
&ancestors,
&EpochSchedule::default(),
&RentCollector::default(),
TEST_DISABLE_REHASH_FOR_RENT_EPOCH,
);
});
}
Expand Down
4 changes: 0 additions & 4 deletions runtime/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,6 @@ impl Accounts {
debug_verify: bool,
epoch_schedule: &EpochSchedule,
rent_collector: &RentCollector,
disable_rehash_for_rent_epoch: bool,
) -> u64 {
let use_index = false;
let is_startup = true;
Expand All @@ -829,7 +828,6 @@ impl Accounts {
epoch_schedule,
rent_collector,
is_startup,
disable_rehash_for_rent_epoch,
)
.1
}
Expand All @@ -849,7 +847,6 @@ impl Accounts {
ignore_mismatch: bool,
store_detailed_debug_info: bool,
use_bg_thread_pool: bool,
disable_rehash_for_rent_epoch: bool,
) -> bool {
if let Err(err) = self.accounts_db.verify_bank_hash_and_lamports_new(
slot,
Expand All @@ -862,7 +859,6 @@ impl Accounts {
ignore_mismatch,
store_detailed_debug_info,
use_bg_thread_pool,
disable_rehash_for_rent_epoch,
) {
warn!("verify_bank_hash failed: {:?}, slot: {}", err, slot);
false
Expand Down
1 change: 0 additions & 1 deletion runtime/src/accounts_background_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ impl SnapshotRequestHandler {
rent_collector: snapshot_root_bank.rent_collector(),
store_detailed_debug_info_on_failure: false,
full_snapshot: None,
disable_rehash_for_rent_epoch: snapshot_root_bank.feature_set.is_active(&solana_sdk::feature_set::disable_rehash_for_rent_epoch::id()),
},
).unwrap();
assert_eq!(previous_hash, this_hash);
Expand Down
Loading

0 comments on commit e0ef8f1

Please sign in to comment.