finalize prioritization_fee_cache after oc-ed bank is frozen (#33100)
This commit is contained in:
parent
224eea42d5
commit
904b2a7672
|
@ -181,6 +181,7 @@ impl OptimisticallyConfirmedBankTracker {
|
||||||
last_notified_confirmed_slot: &mut Slot,
|
last_notified_confirmed_slot: &mut Slot,
|
||||||
pending_optimistically_confirmed_banks: &mut HashSet<Slot>,
|
pending_optimistically_confirmed_banks: &mut HashSet<Slot>,
|
||||||
slot_notification_subscribers: &Option<Arc<RwLock<Vec<SlotNotificationSender>>>>,
|
slot_notification_subscribers: &Option<Arc<RwLock<Vec<SlotNotificationSender>>>>,
|
||||||
|
prioritization_fee_cache: &PrioritizationFeeCache,
|
||||||
) {
|
) {
|
||||||
if bank.is_frozen() {
|
if bank.is_frozen() {
|
||||||
if bank.slot() > *last_notified_confirmed_slot {
|
if bank.slot() > *last_notified_confirmed_slot {
|
||||||
|
@ -194,6 +195,9 @@ impl OptimisticallyConfirmedBankTracker {
|
||||||
slot_notification_subscribers,
|
slot_notification_subscribers,
|
||||||
SlotNotification::OptimisticallyConfirmed(bank.slot()),
|
SlotNotification::OptimisticallyConfirmed(bank.slot()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// finalize block's minimum prioritization fee cache for this bank
|
||||||
|
prioritization_fee_cache.finalize_priority_fee(bank.slot());
|
||||||
}
|
}
|
||||||
} else if bank.slot() > bank_forks.read().unwrap().root() {
|
} else if bank.slot() > bank_forks.read().unwrap().root() {
|
||||||
pending_optimistically_confirmed_banks.insert(bank.slot());
|
pending_optimistically_confirmed_banks.insert(bank.slot());
|
||||||
|
@ -209,6 +213,7 @@ impl OptimisticallyConfirmedBankTracker {
|
||||||
last_notified_confirmed_slot: &mut Slot,
|
last_notified_confirmed_slot: &mut Slot,
|
||||||
pending_optimistically_confirmed_banks: &mut HashSet<Slot>,
|
pending_optimistically_confirmed_banks: &mut HashSet<Slot>,
|
||||||
slot_notification_subscribers: &Option<Arc<RwLock<Vec<SlotNotificationSender>>>>,
|
slot_notification_subscribers: &Option<Arc<RwLock<Vec<SlotNotificationSender>>>>,
|
||||||
|
prioritization_fee_cache: &PrioritizationFeeCache,
|
||||||
) {
|
) {
|
||||||
for confirmed_bank in bank.parents_inclusive().iter().rev() {
|
for confirmed_bank in bank.parents_inclusive().iter().rev() {
|
||||||
if confirmed_bank.slot() > slot_threshold {
|
if confirmed_bank.slot() > slot_threshold {
|
||||||
|
@ -223,6 +228,7 @@ impl OptimisticallyConfirmedBankTracker {
|
||||||
last_notified_confirmed_slot,
|
last_notified_confirmed_slot,
|
||||||
pending_optimistically_confirmed_banks,
|
pending_optimistically_confirmed_banks,
|
||||||
slot_notification_subscribers,
|
slot_notification_subscribers,
|
||||||
|
prioritization_fee_cache,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -291,6 +297,7 @@ impl OptimisticallyConfirmedBankTracker {
|
||||||
last_notified_confirmed_slot,
|
last_notified_confirmed_slot,
|
||||||
pending_optimistically_confirmed_banks,
|
pending_optimistically_confirmed_banks,
|
||||||
slot_notification_subscribers,
|
slot_notification_subscribers,
|
||||||
|
prioritization_fee_cache,
|
||||||
);
|
);
|
||||||
|
|
||||||
*highest_confirmed_slot = slot;
|
*highest_confirmed_slot = slot;
|
||||||
|
@ -307,9 +314,6 @@ impl OptimisticallyConfirmedBankTracker {
|
||||||
slot,
|
slot,
|
||||||
timestamp: timestamp(),
|
timestamp: timestamp(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// finalize block's minimum prioritization fee cache for this bank
|
|
||||||
prioritization_fee_cache.finalize_priority_fee(slot);
|
|
||||||
}
|
}
|
||||||
BankNotification::Frozen(bank) => {
|
BankNotification::Frozen(bank) => {
|
||||||
let frozen_slot = bank.slot();
|
let frozen_slot = bank.slot();
|
||||||
|
@ -348,6 +352,7 @@ impl OptimisticallyConfirmedBankTracker {
|
||||||
last_notified_confirmed_slot,
|
last_notified_confirmed_slot,
|
||||||
pending_optimistically_confirmed_banks,
|
pending_optimistically_confirmed_banks,
|
||||||
slot_notification_subscribers,
|
slot_notification_subscribers,
|
||||||
|
prioritization_fee_cache,
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut w_optimistically_confirmed_bank =
|
let mut w_optimistically_confirmed_bank =
|
||||||
|
|
Loading…
Reference in New Issue