remove skip rewrite code from collect_rent_from_accounts (#29472)

This commit is contained in:
Jeff Washington (jwash) 2023-01-02 22:15:05 -06:00 committed by GitHub
parent 5a969ce3f1
commit 64466725d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 14 deletions

View File

@ -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) {