feat: disable the wasmv1 runtime from execution version 2 (massa MIP-0002) - #362
Conversation
|
I think Damir agreed to remove the whole wasmv1 abi system. Moreover, It's highly possible (and your test on abi_get_ds_keys tends to confirm this) that no SC on mainnet are using wasmv1 abis. If we agree, I suggest to start by blocking the module loading in So we, probably, can drop the code and bypass MIP. |
If we do that I think someone could fork the network before MIP activation no? If someone deploys a SC using wasmv1 abis before the MIP activation, old nodes would still execute it, and new nodes won't |
you're right. |
…0002) exec() refuses wasmv1 modules (bytecode format byte 1) once the host reports an execution component version >= WASMV1_RUNTIME_DISABLED_EXECUTION_VERSION (2, massa MIP-0002): every execution path goes through it (run_main for ExecuteSC, run_function for calls, async messages, deferred calls and sub-calls from both runtimes), and each fails with "wasmv1 modules are no longer supported". AssemblyScript modules are unaffected. Before activation, or with a host that cannot report its version, wasmv1 modules execute as before, so updated and non-updated nodes agree until the MIP activates. No wasmv1 contract is deployed on mainnet: 0 of 1 262 contract bytecodes carry format byte 1 (final slot 5313654). The wasmv1 code can be deleted once MIP-0002 is active. TestInterface's reported version is now switchable for the before/after test.
9a534df to
611ca95
Compare
Leo-Besancon
left a comment
There was a problem hiding this comment.
LGTM! Let's add in the versioning cleanup issue on massa repo the cleanup of the runtime, the whole wasmv1_execution rust module should be able to go (or at least declared deprecated, but removing it is better IMO) on MAIN.6.0
The wasmv1 abi_get_ds_keys import is only registered while the host reports an execution component version below WASMV1_GET_DS_KEYS_REMOVED_EXECUTION_VERSION (2, massa MIP-0002). From that version on, a module importing it fails to instantiate, as if the ABI never existed. Before activation, or with a host that cannot report its version, it resolves as before, so updated and non-updated nodes agree until the MIP activates.exec() refuses wasmv1 modules (bytecode format byte 1) once the host reports an
execution component version >= WASMV1_RUNTIME_DISABLED_EXECUTION_VERSION (2,
massa MIP-0002): every execution path goes through it (run_main for ExecuteSC,
run_function for calls, async messages, deferred calls and sub-calls from both
runtimes), and each fails with "wasmv1 modules are no longer supported".
AssemblyScript modules are unaffected. Before activation, or with a host that
cannot report its version, wasmv1 modules execute as before, so updated and
non-updated nodes agree until the MIP activates.
No wasmv1 contract is deployed on mainnet: 0 of 1 262 contract bytecodes carry
format byte 1 (final slot 5313654). The wasmv1 code can be deleted once MIP-0002
is active.