Skip to content

Run wasm-opt first, remove sign_ext feature#1416

Merged
SkymanOne merged 2 commits intomasterfrom
aj/optimize-first
Dec 1, 2023
Merged

Run wasm-opt first, remove sign_ext feature#1416
SkymanOne merged 2 commits intomasterfrom
aj/optimize-first

Conversation

@ascjones
Copy link
Collaborator

@ascjones ascjones commented Dec 1, 2023

parity-wasm currently requires the sign-ext feature in order to load a Wasm module for validation containting sign_ext instructions, otherwise we get the unknown opcode 192 error. This feature can cause issues when combined with other crates which depend on it but don't handle that new instruction e.g. wasm-instrument (without sign-ext enabled).

However, in #1280 we use SignExtLowering to remove those instructions during optimization, to allow for compatibility with versions of pallet_contracts which do not yet support that instruction.

This PR reverses the optimize and post_process steps so that optimization happens first, removing the instruction.

Proof it works, building any contract in debug mode, sign_ext feature removed, first with original order now with new order:

image

@SkymanOne
Copy link
Contributor

Merging on behalf of @ascjones

@SkymanOne SkymanOne merged commit 981a439 into master Dec 1, 2023
@SkymanOne SkymanOne deleted the aj/optimize-first branch December 1, 2023 13:14
@smiasojed smiasojed mentioned this pull request Dec 1, 2023
@smiasojed smiasojed mentioned this pull request Mar 4, 2024
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.

2 participants