Exercise 08
Objectives: code-substitute, chainspec file
Needs: Exercise 03, Exercise 05
Content: Here we are going to meet the first emergency mechanism: code-substitute.
Familiarize yourself with: https://www.notion.so/cardinalcryptography/Recovery-code_substitute (you don't need to study the Experiments section).
We will perform two runtime changes:
Start a local chain from the
mainbranch (without any of our previous changes). Pass--execution Wasmflag, so that the nodes use the on-chain blob right away instead of the native runtime. (We need it, because the code-substitute mechanism overrides only the on-chain code - otherwise we would have to make artificial runtime update just to give up native runtime).Build a new runtime wasm blob introducing pallet
banishmentfrom Exercise 03. Don't bumpspec_version!Prepare a new chainspec with the new runtime as code-substitute. You can use
scripts/set_code_substitute.pytool.Restart nodes with the new chainspec (you can use
run_node.shscript, withBOOTSTRAP=false). Confirm, that the chain is moving forward from the point it was stopped. Confirm, that the new pallet has been added.Build another runtime introducing changes to pallet
banishmentfrom Exercise 05. Don't forget to bumpspec_versionto be higher than the one from code-substitute.Perform a proper runtime update.
Confirm that the new changes have been introduced, thus cancelling the substitution from chainspec.
References:
Last updated
Was this helpful?