-
Notifications
You must be signed in to change notification settings - Fork 342
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
Compiling Wasm with Rust 1.70 leads to unsupported Wasm opcodes #1727
Comments
Also, keep an eye on: rust-lang/rust#109807 |
We had this issue with the compiler versions 1.70+ but compiling with this command seem to fix it:
|
I think we just make sure to support the sign extension from 1.3 onwards |
Since I rarely do toolchain customization, thought I'd drop a comment on how I'm dealing with this. Perhaps saves someone a couple minutes:
|
Can you confirm that 1.69.0 works well? I just realized that the current rust-optimizer is on 1.68.2 and not yet 1.69.0. Is it safe to bump it to 1.69.0? |
Yes, I just double-checked on Juno testnet with a simple contract Tested by optimizing, storing, instantiating, doing a contract execution and query, and confirming state changed as I expected. |
* Add osmosis implementation * Working instantiation * Update instantiation test * Add deposit test * Set rust version to 1.69 CosmWasm/cosmwasm#1727 * Revert "Set rust version to 1.69" This reverts commit 96871d4. * Set toolchain version to 1.69.0 * Add additional deposit test * Add failing test * Fix fmt errors * commit * Add rewards test * Remove summary * Add further tests --------- Co-authored-by: Max <[email protected]>
Done in #1743. Will be shipped as part of 1.3. |
A workaround for CosmWasm < 1.3 is using |
Starting from v1.70, Rust uses the Wasm sign extenstion opcodes when comipling to Wasm. Our Wasm parser for static analysis had to be updated in order to correctly parse these opcodes. Refs: - https://github.com/WebAssembly/sign-extension-ops/blob/master/proposals/sign-extension-ops/Overview.md - CosmWasm/cosmwasm#1727 - CosmWasm/cosmwasm#1743
Starting from v1.70, Rust uses the Wasm sign extension opcodes when compiling to Wasm. Our Wasm parser for static analysis had to be updated in order to correctly parse these opcodes. Refs: - CosmWasm/cosmwasm#1727 - CosmWasm/cosmwasm#1743 - https://github.com/WebAssembly/sign-extension-ops/blob/master/proposals/sign-extension-ops/Overview.md
Starting from v1.70, Rust uses the Wasm sign extenstion opcodes when comipling to Wasm. Our Wasm parser for static analysis had to be updated in order to correctly parse these opcodes. Refs: - https://github.com/WebAssembly/sign-extension-ops/blob/master/proposals/sign-extension-ops/Overview.md - CosmWasm/cosmwasm#1727 - CosmWasm/cosmwasm#1743
Starting from v1.70, Rust uses the Wasm sign extenstion opcodes when comipling to Wasm. Our Wasm parser for static analysis had to be updated in order to correctly parse these opcodes. Refs: - https://github.com/WebAssembly/sign-extension-ops/blob/master/proposals/sign-extension-ops/Overview.md - CosmWasm/cosmwasm#1727 - CosmWasm/cosmwasm#1743
I'm still getting this issue when compiling with |
One of:
|
* rename states: tokens -> nft_info, contract_info -> collection_info * renamed structs and deprecate: TokenInfo -> NftInfo, ContractInfo -> CollectionInfo, ContractInfoResponse -> CollectionInfoResponse * cargo schema * change storage keys for collection info and nft info, consider in migration and keep legacy data for backward migration * use PA repo for `cw-ownable` * rename generics and make more readable * CollectionInfoResponse -> CollectionInfo * add CollectionInfoExtension with RoyaltyInfo * cargo schema * typo * cleanup * rename * cargo schema * cleanup * creator and owner changes: - new query GetMinterOwnership and GetCreatorOwnership, deprecated Ownership - new execute UpdateMinterOwnership and UpdateCreatorOwnership, deprecate UpdateOwnership - dedicated stores for minter and creator, where creator usess by default cw_ownable singleton! - new migrate msg allowing to reset creator and minter - cleanup migration and split legacy part to dedicated functions - also make sure using decicated CREATOR and MINTER stores and NOT use cw_ownable::... * refactor and move key logic to cw721 package: - move logic from cw721-base to cw721 - merge cw721-base and cw721-metadata-onchain into one, distinction is: `extension: T` where T for base contract is `type DefaultMetadataExtension = Option<Metadata>` - all logic now in default implementation for traits Cw721Execute and Cw721Query * fix ci * cargo fmt * cargo fmt + clippy * cargo fmt * cargo schema * cargo clippy * undo: do not rename token keys * fix unit test * remove useless generic `TMetadataResponse` * remove response structs to msg.rs * cargo schema * move to dedicated fn * docs * rename * cargo clippy * add build script * undo collection info extension and royalty info additions, will be added in next pr * cleanup * generate schemas for entry points, cleanup * update rustc 1.65 -> 1.71 * update cosmwasm version 1.2 -> 1.5, due to rustc compiler issues see also: CosmWasm/cosmwasm#1727 * update optimizer * update rustc 1.71 -> 1.78 * use optimizer * formatting * install rustup first * set $HOME/.cargo/env * install libgcc * install build-base * cleanup * cleanup * Sync cw1155 with upstream (#5) * wip: sync up cw1155 with upstream improvements from cw-awesome * fix build errors/tests --------- Co-authored-by: mr-t <[email protected]>
When compiling a CosmWasm contract with Rust 1.70 (and above?) to Wasm, instructions are emitted that cause the following error:
or
This referes to C0-C4 in this overview, i.e. the sign extension of Wasm.
See also use-ink/cargo-contract#1139.
Until this resolved, using Rust 1.69.0 is the recommended way. This is also the version used in the latest rust-optimizer/workspace-optimizer.
The text was updated successfully, but these errors were encountered: