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!
If the chain could produce blocks.
Set a new WASM through the runtime upgrade.
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.
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.
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?