Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
remove skip rewrite code from collect_rent_from_accounts (#29472)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Jan 3, 2023
1 parent 5a969ce commit 6446672
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit 6446672

Please sign in to comment.