diff --git a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs index 99cae3b53d648f..d8492992db97a4 100644 --- a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs +++ b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs @@ -512,9 +512,7 @@ impl SchedulerController { (root_bank, working_bank) }; let alt_resolved_slot = root_bank.slot(); - let last_slot_in_epoch = root_bank - .epoch_schedule() - .get_last_slot_in_epoch(root_bank.epoch()); + let sanitized_epoch = root_bank.epoch(); let transaction_account_lock_limit = working_bank.get_transaction_account_lock_limit(); let vote_only = working_bank.vote_only_bank(); @@ -559,7 +557,7 @@ impl SchedulerController { arc_packets.push(packet); transactions.push(tx); max_ages.push(calculate_max_age( - last_slot_in_epoch, + sanitized_epoch, deactivation_slot, alt_resolved_slot, )); @@ -701,10 +699,14 @@ impl SchedulerController { /// slots, the value used here is the lower-bound on the deactivation /// period, i.e. the transaction's address lookups are valid until /// AT LEAST this slot. -fn calculate_max_age(resolved_epoch: Epoch, deactivation_slot: Slot, current_slot: Slot) -> MaxAge { +fn calculate_max_age( + sanitized_epoch: Epoch, + deactivation_slot: Slot, + current_slot: Slot, +) -> MaxAge { let alt_min_expire_slot = estimate_last_valid_slot(deactivation_slot.min(current_slot)); MaxAge { - sanitized_epoch: resolved_epoch, + sanitized_epoch, alt_invalidation_slot: alt_min_expire_slot, } } @@ -1216,11 +1218,11 @@ mod tests { #[test] fn test_calculate_max_age() { let current_slot = 100; - let resolved_epoch = 10; + let sanitized_epoch = 10; // ALT deactivation slot is delayed assert_eq!( - calculate_max_age(resolved_epoch, current_slot - 1, current_slot), + calculate_max_age(sanitized_epoch, current_slot - 1, current_slot), MaxAge { sanitized_epoch, alt_invalidation_slot: current_slot - 1 @@ -1230,7 +1232,7 @@ mod tests { // no deactivation slot assert_eq!( - calculate_max_age(resolved_epoch, u64::MAX, current_slot), + calculate_max_age(sanitized_epoch, u64::MAX, current_slot), MaxAge { sanitized_epoch, alt_invalidation_slot: current_slot + solana_sdk::slot_hashes::get_entries() as u64,