Remove old feature: cumulative_rent_related_fixes (#15754)

This commit is contained in:
Ryo Onodera
2021-03-08 09:58:50 +09:00
committed by GitHub
parent 3a1d51c657
commit 8b0c6db871
5 changed files with 32 additions and 124 deletions

View File

@@ -192,7 +192,6 @@ impl Accounts {
let mut tx_rent: TransactionRent = 0;
let mut accounts = Vec::with_capacity(message.account_keys.len());
let mut account_deps = Vec::with_capacity(message.account_keys.len());
let rent_fix_enabled = feature_set.cumulative_rent_related_fixes_enabled();
for (i, key) in message.account_keys.iter().enumerate() {
let account = if message.is_non_loader_key(key, i) {
@@ -213,11 +212,8 @@ impl Accounts {
.load(ancestors, key)
.map(|(mut account, _)| {
if message.is_writable(i) {
let rent_due = rent_collector.collect_from_existing_account(
&key,
&mut account,
rent_fix_enabled,
);
let rent_due = rent_collector
.collect_from_existing_account(&key, &mut account);
(account, rent_due)
} else {
(account, 0)
@@ -836,7 +832,6 @@ impl Accounts {
rent_collector: &RentCollector,
last_blockhash_with_fee_calculator: &(Hash, FeeCalculator),
fix_recent_blockhashes_sysvar_delay: bool,
rent_fix_enabled: bool,
) {
let accounts_to_store = self.collect_accounts_to_store(
txs,
@@ -846,7 +841,6 @@ impl Accounts {
rent_collector,
last_blockhash_with_fee_calculator,
fix_recent_blockhashes_sysvar_delay,
rent_fix_enabled,
);
self.accounts_db.store_cached(slot, &accounts_to_store);
}
@@ -871,7 +865,6 @@ impl Accounts {
rent_collector: &RentCollector,
last_blockhash_with_fee_calculator: &(Hash, FeeCalculator),
fix_recent_blockhashes_sysvar_delay: bool,
rent_fix_enabled: bool,
) -> Vec<(&'a Pubkey, &'a Account)> {
let mut accounts = Vec::with_capacity(loaded.len());
for (i, ((raccs, _nonce_rollback), (_, tx))) in loaded
@@ -940,11 +933,8 @@ impl Accounts {
}
}
if account.rent_epoch == 0 {
loaded_transaction.rent += rent_collector.collect_from_created_account(
&key,
account,
rent_fix_enabled,
);
loaded_transaction.rent +=
rent_collector.collect_from_created_account(&key, account);
}
accounts.push((key, &*account));
}
@@ -1899,7 +1889,6 @@ mod tests {
&rent_collector,
&(Hash::default(), FeeCalculator::default()),
true,
true,
);
assert_eq!(collected_accounts.len(), 2);
assert!(collected_accounts
@@ -2265,7 +2254,6 @@ mod tests {
&rent_collector,
&(next_blockhash, FeeCalculator::default()),
true,
true,
);
assert_eq!(collected_accounts.len(), 2);
assert_eq!(
@@ -2376,7 +2364,6 @@ mod tests {
&rent_collector,
&(next_blockhash, FeeCalculator::default()),
true,
true,
);
assert_eq!(collected_accounts.len(), 1);
let collected_nonce_account = collected_accounts