Recently in Ternoa mainnet we performed a RU(runtime upgrade) to upgrade our versions to polkato-v0.9.31. In system pallet substrate have introduced new extrinsic set_code in this version which consumes max_block_weight which is not allowing us to do any RU from this version.

When we checked these answers there are broadly two options to resolve this issue to perform a RU using a sudo_unchecked_weight or utility -> with_weight function to override the weight. but 0.9.31 version's utility pallet doesn't have with_weight function and in our chain we don't have sudo pallet. So this is becoming a serious problem for us. ANY HELP WILL BE APPRECIATED.

1 Answer 1


I think there is still a way to do a runtime upgrade by using System::SetStorage which seems to be present in your runtime.
The weight of that should be rather low and you can overwrite the :code key.
It is very hacky since no event or log will be deposited, but besides that it should work i think. Please test it locally first with chopsticks or another way to ensure that it will not make the situation worse.

  • Thanks for putting some lights. Can you let me know how to use this System.set_storage()? Nov 2, 2023 at 13:51
  • 1
    OMG this worked like a charm, thank you Nov 2, 2023 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.