Skip to content

feat: disable the wasmv1 runtime from execution version 2 (massa MIP-0002) - #362

Merged
peterjah merged 1 commit into
mainfrom
remove-wasmv1-get-ds-keys
Sep 25, 2026
Merged

peterjah merged 1 commit into
mainfrom
remove-wasmv1-get-ds-keys

Conversation

@peterjah

@peterjah peterjah commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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.

@bilboquet

Copy link
Copy Markdown
Contributor

I think Damir agreed to remove the whole wasmv1 abi system.
Didn't you understand the same?

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 massa-sc-runtime/src/execution.rs:56

So we, probably, can drop the code and bypass MIP.

Leo-Besancon
Leo-Besancon previously approved these changes Sep 25, 2026

@Leo-Besancon Leo-Besancon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a comment

Comment thread src/wasmv1_execution/abi/abis.rs Outdated
@Leo-Besancon

Copy link
Copy Markdown
Member

If we agree, I suggest to start by blocking the module loading in massa-sc-runtime/src/execution.rs:56

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

@bilboquet

bilboquet commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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.
so we have to keep the code, and use a MIP to disable it (I think) as a whole.
@Leo-Besancon @peterjah WDYT?

…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.
@peterjah
peterjah force-pushed the remove-wasmv1-get-ds-keys branch from 9a534df to 611ca95 Compare September 25, 2026 14:27
@peterjah peterjah changed the title feat(wasmv1): withdraw abi_get_ds_keys from execution version 2 (mass… feat: disable the wasmv1 runtime from execution version 2 (massa MIP-0002) Sep 25, 2026

@Leo-Besancon Leo-Besancon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@peterjah
peterjah enabled auto-merge September 25, 2026 14:56
@peterjah
peterjah added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit f1bd55d Sep 25, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants