2

In parachain context, imagine we have declared a migration within type Executvie where we want to migrate some state from pallet A to pallet B in on_runtime_upgrade. In the new wasm the pallet A gets deleted and pallet B gets added.

What if on_runtime_upgrade fails somehow in the middle way? We could have some incomplete or corrupted state for both pallet A and B, right? If this migration is related to block authoring (e.g. session/collator settings), is it possible that the parachain gets stuck?

Is there a way to prevent that besides try-runtime and testing on the testnet?

1 Answer 1

2

No, on_runtime_upgrade must not fail. If it fails, you are in big troubles, which most of the time means that your chain is fucked.

As you already said, make sure to use try-runtime and test nets to test the upgrade.

2
  • Thank you :) would it be possible to keep the block production unstoppable even when such a thing happens? I believe one of the biggest concerns is the chain gets stuck after an inappropriate runtime-upgrade or migration. E.g. divide the runtime-upgrade into 2 parts and only apply the new wasm when the migration succeeds. Is that feasible? Or like perform try-runtime as an on-chain check beforehand and refuses to upgrade when something unexpected happens
    – Kailai
    Commented Aug 31, 2022 at 15:14
  • 1
    No you can not run try-runtime on chain. There is also not really anything that you can do to bring back the block production. For standalone blockchains there is some issue on what could be done: github.com/paritytech/substrate/issues/7558
    – bkchr
    Commented Sep 1, 2022 at 21:11

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.