Our goal is to migrate pallet code to the newer Substrate version and keep the block history (since ~ august 2020).

Old Substrate ver. (10.02.2021) -> New Substrate ver. (14.01.2022)

For such purpose, we've created a brand new repo with the new structure and newer Substrate version. Recently the code migration was finished.

Right now, we are trying to upgrade the runtime of our testnet nodes and getting the FailedToExtractRuntimeVersion error while calling setCode extrinsic.

What should be changed in the runtime from the new repo in order to generate a valid Wasm which will be accepted by the node?

Attributes spec_name, spec_version, and authoring_version are the same between Wasm and native.

Should we update the node (native binary) first?

We tried to do so and run the new node with the original chain_spec, but JSON structure was different (got unknown key errors).

  • Hey, could you please open an issue in Substrate. But your idea of first updating the node sounds good. You should compare a chain spec generated by the newer node vs your old chain spec and check on the differences.
    – bkchr
    Apr 14, 2022 at 9:04

1 Answer 1


We've managed to upgrade the runtime and save the block history. It's still not clear what was the exact root cause, but we've created a runtime from scratch and added all of the FRAME pallets. After upgrading the node in the first place, the runtime was upgraded successfully.

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.