1

Since the Wasm runtime is stored on-chain under consensus rules, if a bug is discovered, what is the procedure to switch to a different Wasm runtime? What if the bug affects the block production? Does it require to use the native runtime?

Thanks!

1 Answer 1

1

Fork-less

If the chain could produce blocks.

Set a new WASM through the runtime upgrade.

Hard fork

If the chain could produce blocks in native.

Use --native, and contact other validators to switch to --native (otherwise, your finalization will stall, then the chain bricked). Make a runtime upgrade and let all validators switch back to WASM mode. After this, I think you might need to mark some blocks as bad/fork blocks. Otherwise the new node can not finish the sync.

I'm not sure about this, I haven't tried this before.

Hard spoon

If you have tried all the ways and the chain could not produce blocks.

Export the chain state and start a new chain base on those exported data.

3
  • From what I understand, in the case of a runtime bug, on-chain governance does not fully apply, since the bug might affect the actual on-chain governance. To me, it seems like the on-chain governance relies on the assumption that runtime logic is bug-free, but practically there are no guarantees. Am I missing something?
    – user2862
    Commented Oct 20, 2022 at 15:34
  • One more thing, here is a quote: The deprecation of the native runtime will now be pursued with a much higher priority. Using the Wasm compiler Wasmtime already brings us to a performance level that is almost the same as using the native runtime, so we don’t really need the native optimization anymore. Especially with all the potential downsides. What happens when the native runtime gets deprecated since it is one of the ways for resolving runtime bugs?
    – user2862
    Commented Oct 20, 2022 at 15:34
  • Just thinking conceptually, why not have 2 runtimes stored on-chain, the current and the previous one, in the case of a bug with the current runtime it can potentially fall back to the previous working one.
    – user2862
    Commented Oct 20, 2022 at 15:34

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.