This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Returning PermanentlyOverweight
error on scheduled runtime upgrade when using set_code()
#13288
Closed
2 tasks done
Labels
J2-unconfirmed
Issue might be valid, but it’s not yet known.
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
I have tested some runtime upgrade actions while using the
node-template
of the currentmaster
branch. But when trying the instant runtime upgrade by thesudoUncheckedWeight()
extrinsic, it worked fine as expected.Instead, when trying to schedule a runtime upgrade at a certain future block, it always returns a
PermanentlyOverweight
error frompallet_scheduler
. (Both sudo and governance proposals)So I've tried to check out where the exact error point was and found out it was in the
execute_dispatch()
method. https://github.com/paritytech/substrate/blob/master/frame/scheduler/src/lib.rs#L1119Inside the method it measures the weight for the scheduled call (
max_weight
). But in the case ofset_code()
, the weight is set as the maximum block weight of the system. So the actual measured weight for the scheduledset_code()
call will bemax_block_weight + execute_dispatch_unsigned_weight
, that will always exceed the limit of the maximum block weight. So due to this kind of situation it will always fall into anOverweight
error.https://github.com/paritytech/substrate/blob/master/frame/scheduler/src/lib.rs#L1132
So I'm leaving an issue for any help to figure it out. And please let me know if I've done the right way to upgrade a runtime. (Just followed the official documentations)
My runtime impl for
pallet_scheduler
andpallet_preimage
. Except implementing the pallets, no other changes have been made.type Preimages = ();
forpallet_scheduler
is not set topallet_preimage
. This will always lead to anExhausted
error.Steps to reproduce
pallet_scheduler
andpallet_preimage
to thenode-template
runtime../target/release/node-template --dev
)spec_version
and rebuild the project in a second terminal.set_code()
call byschedule()
The text was updated successfully, but these errors were encountered: