Recently did a runtime upgrade on our node which broke all existing ink contracts. Later included the pallet contracts migration in Executive Type which fixed the issue. My impression was all runtime upgrade defined in pallets were invoked by default on forkless upgrade. Do we really need to invoke each migration from Executive?

1 Answer 1


Yes. You need to include the migrations into the Executive type of your runtime.
The pallet itself can also have a on_runtime_upgrade hook, but normally we don't use that anymore.

Migrations now use the OnRuntimeUpgrade trait which allows for better testing. For a relay chain it could be fine to run all migrations automatically, but for a para-chain you need to consider the block weight limit.
If you just run all migrations in the same block per default without means of preventing it; it could result in an over-weight block.

But it is probably a good idea to add some automatic testing that checks that all migrations are included - or at least going to be included soon.

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.