git.delta.rocks / unique-network / refs/commits / 87b85f039f25

difftreelog

fix permanently overweight only if no runtime upgrade

Daniel Shiposha2022-10-25parent: #9058728.patch.diff
in: master

1 file changed

modifiedpallets/scheduler-v2/src/lib.rsdiffbeforeafterboth
968 });968 });
969 Err((Unavailable, Some(task)))969 Err((Unavailable, Some(task)))
970 }970 }
971 Err(Overweight) if is_first => {971 Err(Overweight) if is_first && !Self::is_runtime_upgraded() => {
972 T::Preimages::drop(&task.call);972 T::Preimages::drop(&task.call);
973973
974 if let Some(ref id) = task.maybe_id {974 if let Some(ref id) = task.maybe_id {
1032 }1032 }
1033 }1033 }
1034
1035 fn is_runtime_upgraded() -> bool {
1036 let last = system::LastRuntimeUpgrade::<T>::get();
1037 let current = T::Version::get();
1038
1039 last.map(|v| v.was_upgraded(&current)).unwrap_or(true)
1040 }
10341041
1035 /// Make a dispatch to the given `call` from the given `origin`, ensuring that the `weight`1042 /// Make a dispatch to the given `call` from the given `origin`, ensuring that the `weight`
1036 /// counter does not exceed its limit and that it is counted accurately (e.g. accounted using1043 /// counter does not exceed its limit and that it is counted accurately (e.g. accounted using