remove skip rewrite code from collect_rent_from_accounts (#29472)
This commit is contained in:
parent
5a969ce3f1
commit
64466725d4
|
@ -5331,7 +5331,6 @@ impl Bank {
|
||||||
) -> CollectRentFromAccountsInfo {
|
) -> CollectRentFromAccountsInfo {
|
||||||
let mut rent_debits = RentDebits::default();
|
let mut rent_debits = RentDebits::default();
|
||||||
let mut total_rent_collected_info = CollectedInfo::default();
|
let mut total_rent_collected_info = CollectedInfo::default();
|
||||||
let mut rewrites_skipped = Vec::with_capacity(accounts.len());
|
|
||||||
let mut accounts_to_store =
|
let mut accounts_to_store =
|
||||||
Vec::<(&Pubkey, &AccountSharedData)>::with_capacity(accounts.len());
|
Vec::<(&Pubkey, &AccountSharedData)>::with_capacity(accounts.len());
|
||||||
let mut time_collecting_rent_us = 0;
|
let mut time_collecting_rent_us = 0;
|
||||||
|
@ -5355,19 +5354,7 @@ impl Bank {
|
||||||
// Also, there's another subtle side-effect from rewrites: this
|
// Also, there's another subtle side-effect from rewrites: this
|
||||||
// ensures we verify the whole on-chain state (= all accounts)
|
// ensures we verify the whole on-chain state (= all accounts)
|
||||||
// via the bank delta hash slowly once per an epoch.
|
// via the bank delta hash slowly once per an epoch.
|
||||||
if can_skip_rewrites && Self::skip_rewrite(rent_collected_info.rent_amount, account) {
|
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 rent_collected_info.rent_amount > 0 {
|
if rent_collected_info.rent_amount > 0 {
|
||||||
if let Some(rent_paying_pubkeys) = rent_paying_pubkeys {
|
if let Some(rent_paying_pubkeys) = rent_paying_pubkeys {
|
||||||
if !rent_paying_pubkeys.contains(pubkey) {
|
if !rent_paying_pubkeys.contains(pubkey) {
|
||||||
|
|
Loading…
Reference in New Issue