From 64466725d40e79f1f557be409a87c4f96127260e Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Mon, 2 Jan 2023 22:15:05 -0600 Subject: [PATCH] remove skip rewrite code from collect_rent_from_accounts (#29472) --- runtime/src/bank.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 15c9091039..8132c98ad9 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -5331,7 +5331,6 @@ impl Bank { ) -> CollectRentFromAccountsInfo { let mut rent_debits = RentDebits::default(); let mut total_rent_collected_info = CollectedInfo::default(); - let mut rewrites_skipped = Vec::with_capacity(accounts.len()); let mut accounts_to_store = Vec::<(&Pubkey, &AccountSharedData)>::with_capacity(accounts.len()); let mut time_collecting_rent_us = 0; @@ -5355,19 +5354,7 @@ impl Bank { // Also, there's another subtle side-effect from rewrites: this // ensures we verify the whole on-chain state (= all accounts) // via the bank delta hash slowly once per an epoch. - if can_skip_rewrites && Self::skip_rewrite(rent_collected_info.rent_amount, account) { - // this would have been rewritten previously. Now we skip it. - // calculate the hash that we would have gotten if we did the rewrite. - // This will be needed to calculate the bank's hash. - let (hash, _measure) = measure!(crate::accounts_db::AccountsDb::hash_account( - self.slot(), - account, - pubkey, - self.include_slot_in_hash(), - )); - rewrites_skipped.push((*pubkey, hash)); - assert_eq!(rent_collected_info, CollectedInfo::default()); - } else { + if !can_skip_rewrites || !Self::skip_rewrite(rent_collected_info.rent_amount, account) { if rent_collected_info.rent_amount > 0 { if let Some(rent_paying_pubkeys) = rent_paying_pubkeys { if !rent_paying_pubkeys.contains(pubkey) {