From 87b85f039f256f216a2eb3044fb8024a5e1fe10d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 25 Oct 2022 14:18:03 +0000 Subject: [PATCH] fix: permanently overweight only if no runtime upgrade --- --- a/pallets/scheduler-v2/src/lib.rs +++ b/pallets/scheduler-v2/src/lib.rs @@ -968,7 +968,7 @@ }); Err((Unavailable, Some(task))) } - Err(Overweight) if is_first => { + Err(Overweight) if is_first && !Self::is_runtime_upgraded() => { T::Preimages::drop(&task.call); if let Some(ref id) = task.maybe_id { @@ -1032,6 +1032,13 @@ } } + fn is_runtime_upgraded() -> bool { + let last = system::LastRuntimeUpgrade::::get(); + let current = T::Version::get(); + + last.map(|v| v.was_upgraded(¤t)).unwrap_or(true) + } + /// Make a dispatch to the given `call` from the given `origin`, ensuring that the `weight` /// counter does not exceed its limit and that it is counted accurately (e.g. accounted using /// post info if available). -- gitstuff