From 3c89c2bbef624e44130611e54436cd97e0e23caa Mon Sep 17 00:00:00 2001 From: brooks Date: Fri, 13 Sep 2024 12:56:35 -0400 Subject: [PATCH] Adds datapoint if rent collection changes only the rent epoch --- runtime/src/bank.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index d58e650da0cc2e..62529c0bd7ff6c 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -4317,8 +4317,8 @@ impl Bank { let rent_epoch_post = account.rent_epoch(); // did the account change in any way due to rent collection? - let account_changed = - rent_collected_info.rent_amount != 0 || rent_epoch_post != rent_epoch_pre; + let rent_epoch_changed = rent_epoch_post != rent_epoch_pre; + let account_changed = rent_collected_info.rent_amount != 0 || rent_epoch_changed; // always store the account, regardless if it changed or not let always_store_accounts = @@ -4356,6 +4356,17 @@ impl Bank { ); } } + } else { + debug_assert_eq!(rent_collected_info.rent_amount, 0); + if rent_epoch_changed { + datapoint_info!( + "bank-rent_collection_updated_only_rent_epoch", + ("slot", self.slot(), i64), + ("pubkey", pubkey.to_string(), String), + ("rent_epoch_pre", rent_epoch_pre, i64), + ("rent_epoch_post", rent_epoch_post, i64), + ); + } } total_rent_collected_info += rent_collected_info; accounts_to_store.push((pubkey, account));