From fea2fc9a257af0614c0bf752d4d0d659fe9c8ccb Mon Sep 17 00:00:00 2001 From: Tiago Carvalho Date: Mon, 28 Nov 2022 13:05:47 +0000 Subject: [PATCH 1/3] Enable sign extend wasm opcodes --- shared/Cargo.toml | 4 ++-- shared/src/vm/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 1af1162f92..3745bc7719 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -107,13 +107,13 @@ ics23 = "0.7.0" itertools = "0.10.0" loupe = {version = "0.1.3", optional = true} libsecp256k1 = {git = "https://github.com/heliaxdev/libsecp256k1", rev = "bbb3bd44a49db361f21d9db80f9a087c194c0ae9", default-features = false, features = ["std", "static-context"]} -parity-wasm = {version = "0.42.2", optional = true} +parity-wasm = {version = "0.45.0", features = ["sign_ext"], optional = true} paste = "1.0.9" # A fork with state machine testing proptest = {git = "https://github.com/heliaxdev/proptest", branch = "tomas/sm", optional = true} prost = "0.9.0" prost-types = "0.9.0" -pwasm-utils = {version = "0.18.0", optional = true} +pwasm-utils = {git = "https://github.com/heliaxdev/wasm-utils", tag = "v0.20.0", features = ["sign_ext"], optional = true} rand = {version = "0.8", optional = true} # TODO proptest rexports the RngCore trait but the re-implementations only work for version `0.8`. *sigh* rand_core = {version = "0.6", optional = true} diff --git a/shared/src/vm/mod.rs b/shared/src/vm/mod.rs index 2e14666f81..70fae7a3d4 100644 --- a/shared/src/vm/mod.rs +++ b/shared/src/vm/mod.rs @@ -28,7 +28,7 @@ const UNTRUSTED_WASM_FEATURES: WasmFeatures = WasmFeatures { memory64: false, mutable_global: false, saturating_float_to_int: false, - sign_extension: false, + sign_extension: true, relaxed_simd: false, extended_const: false, }; From 577ebf18f2e61d9fdce77a8fd9316ca1215e5ca2 Mon Sep 17 00:00:00 2001 From: Tiago Carvalho Date: Mon, 28 Nov 2022 13:21:05 +0000 Subject: [PATCH 2/3] Update Cargo.lock files --- Cargo.lock | 9 ++++----- wasm/Cargo.lock | 9 ++++----- wasm_for_tests/wasm_source/Cargo.lock | 9 ++++----- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d72635662f..6792cb13b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4281,9 +4281,9 @@ dependencies = [ [[package]] name = "parity-wasm" -version = "0.42.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" @@ -4730,9 +4730,8 @@ dependencies = [ [[package]] name = "pwasm-utils" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "880b3384fb00b8f6ecccd5d358b93bd2201900ae3daad213791d1864f6441f5c" +version = "0.20.0" +source = "git+https://github.com/heliaxdev/wasm-utils?tag=v0.20.0#782bfa7fb5e513b602e66af492cbc4cb1b06f2ba" dependencies = [ "byteorder", "log 0.4.17", diff --git a/wasm/Cargo.lock b/wasm/Cargo.lock index 3967368aaa..1444f2fc82 100644 --- a/wasm/Cargo.lock +++ b/wasm/Cargo.lock @@ -2738,9 +2738,9 @@ dependencies = [ [[package]] name = "parity-wasm" -version = "0.42.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking_lot" @@ -3076,9 +3076,8 @@ dependencies = [ [[package]] name = "pwasm-utils" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "880b3384fb00b8f6ecccd5d358b93bd2201900ae3daad213791d1864f6441f5c" +version = "0.20.0" +source = "git+https://github.com/heliaxdev/wasm-utils?tag=v0.20.0#782bfa7fb5e513b602e66af492cbc4cb1b06f2ba" dependencies = [ "byteorder", "log", diff --git a/wasm_for_tests/wasm_source/Cargo.lock b/wasm_for_tests/wasm_source/Cargo.lock index a43b493805..6943d2156d 100644 --- a/wasm_for_tests/wasm_source/Cargo.lock +++ b/wasm_for_tests/wasm_source/Cargo.lock @@ -2730,9 +2730,9 @@ dependencies = [ [[package]] name = "parity-wasm" -version = "0.42.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking_lot" @@ -3068,9 +3068,8 @@ dependencies = [ [[package]] name = "pwasm-utils" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "880b3384fb00b8f6ecccd5d358b93bd2201900ae3daad213791d1864f6441f5c" +version = "0.20.0" +source = "git+https://github.com/heliaxdev/wasm-utils?tag=v0.20.0#782bfa7fb5e513b602e66af492cbc4cb1b06f2ba" dependencies = [ "byteorder", "log", From 71b348bd713034803d96a3a935670b0c19d4e88d Mon Sep 17 00:00:00 2001 From: "Raymond E. Pasco" Date: Wed, 30 Nov 2022 04:33:53 -0500 Subject: [PATCH 3/3] changelog: add #833 --- .../unreleased/improvements/833-wasm-vm-allow-sign-extend.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/unreleased/improvements/833-wasm-vm-allow-sign-extend.md diff --git a/.changelog/unreleased/improvements/833-wasm-vm-allow-sign-extend.md b/.changelog/unreleased/improvements/833-wasm-vm-allow-sign-extend.md new file mode 100644 index 0000000000..b6efeba444 --- /dev/null +++ b/.changelog/unreleased/improvements/833-wasm-vm-allow-sign-extend.md @@ -0,0 +1,2 @@ +- Allow sign extension opcodes in WASM + ([#833](https://github.com/anoma/namada/pull/833)) \ No newline at end of file