maybe_update_rent_epoch_on_load uses correct EpochSchedule (#24999)
This commit is contained in:
parent
7b5835ddfa
commit
e0092902ea
|
@ -6024,6 +6024,7 @@ impl Bank {
|
||||||
&mut account,
|
&mut account,
|
||||||
&SlotInfoInEpoch::new_small(storage_slot),
|
&SlotInfoInEpoch::new_small(storage_slot),
|
||||||
&SlotInfoInEpoch::new_small(self.slot()),
|
&SlotInfoInEpoch::new_small(self.slot()),
|
||||||
|
self.epoch_schedule(),
|
||||||
self.rent_collector(),
|
self.rent_collector(),
|
||||||
pubkey,
|
pubkey,
|
||||||
&self.rewrites_skipped_this_slot,
|
&self.rewrites_skipped_this_slot,
|
||||||
|
|
|
@ -271,6 +271,7 @@ impl ExpectedRentCollection {
|
||||||
account: &mut AccountSharedData,
|
account: &mut AccountSharedData,
|
||||||
storage_slot: &SlotInfoInEpoch,
|
storage_slot: &SlotInfoInEpoch,
|
||||||
bank_slot: &SlotInfoInEpoch,
|
bank_slot: &SlotInfoInEpoch,
|
||||||
|
epoch_schedule: &EpochSchedule,
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
pubkey: &Pubkey,
|
pubkey: &Pubkey,
|
||||||
rewrites_skipped_this_slot: &Rewrites,
|
rewrites_skipped_this_slot: &Rewrites,
|
||||||
|
@ -279,6 +280,7 @@ impl ExpectedRentCollection {
|
||||||
account,
|
account,
|
||||||
storage_slot,
|
storage_slot,
|
||||||
bank_slot,
|
bank_slot,
|
||||||
|
epoch_schedule,
|
||||||
rent_collector,
|
rent_collector,
|
||||||
pubkey,
|
pubkey,
|
||||||
rewrites_skipped_this_slot,
|
rewrites_skipped_this_slot,
|
||||||
|
@ -296,6 +298,7 @@ impl ExpectedRentCollection {
|
||||||
account: &AccountSharedData,
|
account: &AccountSharedData,
|
||||||
storage_slot: &SlotInfoInEpoch,
|
storage_slot: &SlotInfoInEpoch,
|
||||||
bank_slot: &SlotInfoInEpoch,
|
bank_slot: &SlotInfoInEpoch,
|
||||||
|
epoch_schedule: &EpochSchedule,
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
pubkey: &Pubkey,
|
pubkey: &Pubkey,
|
||||||
rewrites_skipped_this_slot: &Rewrites,
|
rewrites_skipped_this_slot: &Rewrites,
|
||||||
|
@ -309,10 +312,10 @@ impl ExpectedRentCollection {
|
||||||
}
|
}
|
||||||
|
|
||||||
// grab epoch infno for bank slot and storage slot
|
// grab epoch infno for bank slot and storage slot
|
||||||
let bank_info = bank_slot.get_epoch_info(&rent_collector.epoch_schedule);
|
let bank_info = bank_slot.get_epoch_info(epoch_schedule);
|
||||||
let (current_epoch, partition_from_current_slot) =
|
let (current_epoch, partition_from_current_slot) =
|
||||||
(bank_info.epoch, bank_info.partition_index);
|
(bank_info.epoch, bank_info.partition_index);
|
||||||
let storage_info = storage_slot.get_epoch_info(&rent_collector.epoch_schedule);
|
let storage_info = storage_slot.get_epoch_info(epoch_schedule);
|
||||||
let (storage_epoch, storage_slot_partition) =
|
let (storage_epoch, storage_slot_partition) =
|
||||||
(storage_info.epoch, storage_info.partition_index);
|
(storage_info.epoch, storage_info.partition_index);
|
||||||
let partition_from_pubkey =
|
let partition_from_pubkey =
|
||||||
|
@ -1237,6 +1240,7 @@ pub mod tests {
|
||||||
&account,
|
&account,
|
||||||
&get_slot_info(storage_slot),
|
&get_slot_info(storage_slot),
|
||||||
&get_slot_info(bank_slot),
|
&get_slot_info(bank_slot),
|
||||||
|
&epoch_schedule,
|
||||||
&rent_collector,
|
&rent_collector,
|
||||||
&pubkey,
|
&pubkey,
|
||||||
&rewrites,
|
&rewrites,
|
||||||
|
|
Loading…
Reference in New Issue