mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 16:51:03 +00:00
[FRAME] Use 'ready' pages in XCMP suspend logic (#2393)
Changes: - `QueueFootprint` gets a new field; `ready_pages` that contains the non-overweight and not yet processed pages. - `XCMP` queue pallet is change to use the `ready_pages` instead of `pages` to calculate the channel suspension thresholds. This should give the XCMP queue pallet a more correct view of when to suspend channels. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
c367ac2488
commit
329c077236
@@ -600,7 +600,7 @@ impl<T: Config> Pallet<T> {
|
||||
let QueueConfigData { drop_threshold, .. } = <QueueConfig<T>>::get();
|
||||
let fp = T::XcmpQueue::footprint(sender);
|
||||
// Assume that it will not fit into the current page:
|
||||
let new_pages = fp.pages.saturating_add(1);
|
||||
let new_pages = fp.ready_pages.saturating_add(1);
|
||||
if new_pages > drop_threshold {
|
||||
// This should not happen since the channel should have been suspended in
|
||||
// [`on_queue_changed`].
|
||||
@@ -663,12 +663,12 @@ impl<T: Config> OnQueueChanged<ParaId> for Pallet<T> {
|
||||
let mut suspended_channels = <InboundXcmpSuspended<T>>::get();
|
||||
let suspended = suspended_channels.contains(¶);
|
||||
|
||||
if suspended && fp.pages <= resume_threshold {
|
||||
if suspended && fp.ready_pages <= resume_threshold {
|
||||
Self::send_signal(para, ChannelSignal::Resume);
|
||||
|
||||
suspended_channels.remove(¶);
|
||||
<InboundXcmpSuspended<T>>::put(suspended_channels);
|
||||
} else if !suspended && fp.pages >= suspend_threshold {
|
||||
} else if !suspended && fp.ready_pages >= suspend_threshold {
|
||||
log::warn!("XCMP queue for sibling {:?} is full; suspending channel.", para);
|
||||
Self::send_signal(para, ChannelSignal::Suspend);
|
||||
|
||||
|
||||
@@ -247,6 +247,7 @@ impl<T: OnQueueChanged<ParaId>> EnqueueMessage<ParaId> for EnqueueToLocalStorage
|
||||
}
|
||||
}
|
||||
footprint.pages = footprint.storage.size as u32 / 16; // Number does not matter
|
||||
footprint.ready_pages = footprint.pages;
|
||||
footprint
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user