Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run wasm-opt first, remove sign_ext feature #1416

Merged
merged 2 commits into from
Dec 1, 2023
Merged

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
11 checks passed
@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