Companion for paritytech/substrate#12183 (#1601)

* Companion for paritytech/substrate#12183

* Fixes

* Update pallets/xcmp-queue/src/lib.rs

* Update pallets/xcmp-queue/src/lib.rs

* update lockfile for {"substrate", "polkadot"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Keith Yeung
2022-09-08 13:29:53 +08:00
committed by GitHub
parent c119f290db
commit 11b18e89c6
31 changed files with 399 additions and 336 deletions
+1 -1
View File
@@ -287,7 +287,7 @@ pub mod pallet {
Err((message_id, required_weight)) =>
// Too much weight required right now.
{
if required_weight > config.max_individual {
if required_weight.any_gt(config.max_individual) {
// overweight - add to overweight queue and continue with
// message execution.
let overweight_index = page_index.overweight_count;
+3 -3
View File
@@ -808,7 +808,7 @@ impl<T: Config> Pallet<T> {
let mut shuffle_index = 0;
while shuffle_index < shuffled.len() &&
max_weight.saturating_sub(weight_used) >= threshold_weight
max_weight.saturating_sub(weight_used).all_gte(threshold_weight)
{
let index = shuffled[shuffle_index];
let sender = status[index].sender;
@@ -831,7 +831,7 @@ impl<T: Config> Pallet<T> {
if shuffle_index < status.len() {
weight_available +=
(max_weight - weight_available) / (weight_restrict_decay.ref_time() + 1);
if weight_available + threshold_weight > max_weight {
if (weight_available + threshold_weight).any_gt(max_weight) {
weight_available = max_weight;
}
} else {
@@ -871,7 +871,7 @@ impl<T: Config> Pallet<T> {
// other channels a look in. If we've still not unlocked all weight, then we set them
// up for processing a second time anyway.
if !status[index].message_metadata.is_empty() &&
(weight_processed > Weight::zero() || weight_available != max_weight)
(weight_processed.any_gt(Weight::zero()) || weight_available != max_weight)
{
if shuffle_index + 1 == shuffled.len() {
// Only this queue left. Just run around this loop once more.