From 562ce382621e282e70b0f6f3d3116790d81f4914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Mon, 3 Jul 2023 11:56:55 +0200 Subject: [PATCH] Enable Wasm sign_ext (#1189) * Enable Wasm sign_ext * Bump substrate crates * Add warning when building with new rustc * Stable toolchain * Revert "Stable toolchain" This reverts commit aa2a2e6f5c53b831b8bac83cc9c9a97cc700708e. --------- Co-authored-by: Andrew Jones --- Cargo.lock | 776 ++++------------------------------- crates/build/Cargo.toml | 2 +- crates/build/src/lib.rs | 12 + crates/build/src/wasm_opt.rs | 10 +- crates/transcode/Cargo.toml | 4 +- 5 files changed, 112 insertions(+), 692 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d9c143f1f..337b6f824 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,22 +12,13 @@ dependencies = [ "regex", ] -[[package]] -name = "addr2line" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" -dependencies = [ - "gimli 0.26.2", -] - [[package]] name = "addr2line" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.27.2", + "gimli", ] [[package]] @@ -345,12 +336,12 @@ version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ - "addr2line 0.19.0", + "addr2line", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.30.3", + "object", "rustc-demangle", ] @@ -649,9 +640,9 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sp-core 21.0.0", - "sp-runtime 24.0.0", - "sp-weights 20.0.0", + "sp-core", + "sp-runtime", + "sp-weights", "substrate-build-script-utils", "subxt", "tempfile", @@ -873,7 +864,7 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sp-core 20.0.0", + "sp-core", "sp-keyring", "strsim", "thiserror", @@ -914,15 +905,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cranelift-entity" -version = "0.93.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" -dependencies = [ - "serde", -] - [[package]] name = "cranelift-entity" version = "0.95.1" @@ -1211,12 +1193,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - [[package]] name = "duct" version = "0.13.6" @@ -1598,16 +1574,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "gimli" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" -dependencies = [ - "fallible-iterator", - "stable_deref_trait", -] - [[package]] name = "gimli" version = "0.27.2" @@ -2424,12 +2390,6 @@ version = "0.2.146" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" -[[package]] -name = "libm" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" - [[package]] name = "libsecp256k1" version = "0.7.1" @@ -2561,15 +2521,6 @@ dependencies = [ "rustix 0.36.9", ] -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.8.0" @@ -2588,12 +2539,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "merlin" version = "2.0.1" @@ -2678,17 +2623,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-format" version = "0.4.4" @@ -2709,18 +2643,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.15" @@ -2740,18 +2662,6 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" -dependencies = [ - "crc32fast", - "hashbrown 0.12.3", - "indexmap 1.9.3", - "memchr", -] - [[package]] name = "object" version = "0.30.3" @@ -2822,9 +2732,9 @@ dependencies = [ "bitflags", "parity-scale-codec", "scale-info", - "sp-runtime 24.0.0", - "sp-std 8.0.0", - "sp-weights 20.0.0", + "sp-runtime", + "sp-std", + "sp-weights", ] [[package]] @@ -3953,20 +3863,6 @@ dependencies = [ "sha-1", ] -[[package]] -name = "sp-application-crypto" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf23435a4bbd6eeec2bbbc346719ba4f3200e0ddb5f9e9f06c1724db03a8410" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 20.0.0", - "sp-io 22.0.0", - "sp-std 7.0.0", -] - [[package]] name = "sp-application-crypto" version = "23.0.0" @@ -3976,24 +3872,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-std 8.0.0", -] - -[[package]] -name = "sp-arithmetic" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3d3507a803e8bc332fa290ed3015a7b51d4436ce2b836744642fc412040456" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-std 7.0.0", - "static_assertions", + "sp-core", + "sp-io", + "sp-std", ] [[package]] @@ -4007,54 +3888,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 8.0.0", + "sp-std", "static_assertions", ] -[[package]] -name = "sp-core" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7789372146f8ad40d0b40fad0596cb1db5771187a258eabe19b06f00767fcbd6" -dependencies = [ - "array-bytes", - "bitflags", - "blake2", - "bounded-collections", - "bs58", - "dyn-clonable", - "ed25519-zebra", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde", - "lazy_static", - "libsecp256k1", - "log", - "merlin", - "parity-scale-codec", - "parking_lot", - "primitive-types", - "rand 0.8.5", - "regex", - "scale-info", - "schnorrkel", - "secp256k1 0.24.3", - "secrecy", - "serde", - "sp-core-hashing 8.0.0", - "sp-debug-derive 7.0.0", - "sp-externalities 0.18.0", - "sp-runtime-interface 16.0.0", - "sp-std 7.0.0", - "sp-storage 12.0.0", - "ss58-registry", - "substrate-bip39", - "thiserror", - "tiny-bip39", - "zeroize", -] - [[package]] name = "sp-core" version = "21.0.0" @@ -4087,12 +3924,12 @@ dependencies = [ "secp256k1 0.24.3", "secrecy", "serde", - "sp-core-hashing 9.0.0", - "sp-debug-derive 8.0.0", - "sp-externalities 0.19.0", - "sp-runtime-interface 17.0.0", - "sp-std 8.0.0", - "sp-storage 13.0.0", + "sp-core-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", "ss58-registry", "substrate-bip39", "thiserror", @@ -4100,21 +3937,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "sp-core-hashing" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27449abdfbe41b473e625bce8113745e81d65777dd1d5a8462cf24137930dad8" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.6", - "sha2 0.10.6", - "sha3", - "sp-std 7.0.0", - "twox-hash", -] - [[package]] name = "sp-core-hashing" version = "9.0.0" @@ -4126,21 +3948,10 @@ dependencies = [ "digest 0.10.6", "sha2 0.10.6", "sha3", - "sp-std 8.0.0", + "sp-std", "twox-hash", ] -[[package]] -name = "sp-debug-derive" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62211eed9ef9dac4b9d837c56ccc9f8ee4fc49d9d9b7e6b9daf098fe173389ab" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sp-debug-derive" version = "8.0.0" @@ -4152,18 +3963,6 @@ dependencies = [ "syn 2.0.22", ] -[[package]] -name = "sp-externalities" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae0f275760689aaefe967943331d458cd99f5169d18364365d4cb584b246d1c" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std 7.0.0", - "sp-storage 12.0.0", -] - [[package]] name = "sp-externalities" version = "0.19.0" @@ -4172,35 +3971,8 @@ checksum = "a0f71c671e01a8ca60da925d43a1b351b69626e268b8837f8371e320cf1dd100" dependencies = [ "environmental", "parity-scale-codec", - "sp-std 8.0.0", - "sp-storage 13.0.0", -] - -[[package]] -name = "sp-io" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd3431c245992fe51b8256c838fc2e981f8d3b0afc1d1377ca7dbe0a3287a764" -dependencies = [ - "bytes", - "ed25519", - "ed25519-dalek", - "futures", - "libsecp256k1", - "log", - "parity-scale-codec", - "rustversion", - "secp256k1 0.24.3", - "sp-core 20.0.0", - "sp-externalities 0.18.0", - "sp-keystore 0.26.0", - "sp-runtime-interface 16.0.0", - "sp-state-machine 0.27.0", - "sp-std 7.0.0", - "sp-tracing 9.0.0", - "sp-trie 21.0.0", - "tracing", - "tracing-core", + "sp-std", + "sp-storage", ] [[package]] @@ -4218,46 +3990,30 @@ dependencies = [ "parity-scale-codec", "rustversion", "secp256k1 0.24.3", - "sp-core 21.0.0", - "sp-externalities 0.19.0", - "sp-keystore 0.27.0", - "sp-runtime-interface 17.0.0", - "sp-state-machine 0.28.0", - "sp-std 8.0.0", - "sp-tracing 10.0.0", - "sp-trie 22.0.0", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", "tracing", "tracing-core", ] [[package]] name = "sp-keyring" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f0fc76f89011d39243e87650e3bf747ee4b19abaaeb2702988a2e0b0a7d77c" +checksum = "4673405248580504a8bc4e09615ab25ccb182dfaccd27e000fda9dcb2ca1dab1" dependencies = [ "lazy_static", - "sp-core 20.0.0", - "sp-runtime 23.0.0", + "sp-core", + "sp-runtime", "strum 0.24.1", ] -[[package]] -name = "sp-keystore" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452d079f592c97369c9ca8a5083b25f146751c6b5af10cbcacc2b24dc53fd72a" -dependencies = [ - "futures", - "merlin", - "parity-scale-codec", - "parking_lot", - "schnorrkel", - "sp-core 20.0.0", - "sp-externalities 0.18.0", - "thiserror", -] - [[package]] name = "sp-keystore" version = "0.27.0" @@ -4267,22 +4023,11 @@ dependencies = [ "futures", "parity-scale-codec", "parking_lot", - "sp-core 21.0.0", - "sp-externalities 0.19.0", + "sp-core", + "sp-externalities", "thiserror", ] -[[package]] -name = "sp-panic-handler" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75986cc917d897e0f6d0c848088064df4c74ccbb8f1c1848700b725f5ca7fe04" -dependencies = [ - "backtrace", - "lazy_static", - "regex", -] - [[package]] name = "sp-panic-handler" version = "8.0.0" @@ -4294,29 +4039,6 @@ dependencies = [ "regex", ] -[[package]] -name = "sp-runtime" -version = "23.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6220216caa67e3d931c693b06a3590dfcaa255f19bb3c3e3150f1672b8bc53f6" -dependencies = [ - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "paste", - "rand 0.8.5", - "scale-info", - "serde", - "sp-application-crypto 22.0.0", - "sp-arithmetic 15.0.0", - "sp-core 20.0.0", - "sp-io 22.0.0", - "sp-std 7.0.0", - "sp-weights 19.0.0", -] - [[package]] name = "sp-runtime" version = "24.0.0" @@ -4332,31 +4054,12 @@ dependencies = [ "rand 0.8.5", "scale-info", "serde", - "sp-application-crypto 23.0.0", - "sp-arithmetic 16.0.0", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-std 8.0.0", - "sp-weights 20.0.0", -] - -[[package]] -name = "sp-runtime-interface" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5d0cd80200bf85b8b064238b2508b69b6146b13adf36066ec5d924825af737" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types", - "sp-externalities 0.18.0", - "sp-runtime-interface-proc-macro 10.0.0", - "sp-std 7.0.0", - "sp-storage 12.0.0", - "sp-tracing 9.0.0", - "sp-wasm-interface 13.0.0", - "static_assertions", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-weights", ] [[package]] @@ -4369,28 +4072,15 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities 0.19.0", - "sp-runtime-interface-proc-macro 11.0.0", - "sp-std 8.0.0", - "sp-storage 13.0.0", - "sp-tracing 10.0.0", - "sp-wasm-interface 14.0.0", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", "static_assertions", ] -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ae5b00aef477127ddb6177b3464ad1e2bdcc12ee913fc5dfc9d065c6cea89b" -dependencies = [ - "Inflector", - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sp-runtime-interface-proc-macro" version = "11.0.0" @@ -4404,27 +4094,6 @@ dependencies = [ "syn 2.0.22", ] -[[package]] -name = "sp-state-machine" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e49c3bfcc8c832c34552cd8194180cc60508c6d3d9b0b9615d6b7c3e275019" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "parking_lot", - "rand 0.8.5", - "smallvec", - "sp-core 20.0.0", - "sp-externalities 0.18.0", - "sp-panic-handler 7.0.0", - "sp-std 7.0.0", - "sp-trie 21.0.0", - "thiserror", - "tracing", -] - [[package]] name = "sp-state-machine" version = "0.28.0" @@ -4437,41 +4106,21 @@ dependencies = [ "parking_lot", "rand 0.8.5", "smallvec", - "sp-core 21.0.0", - "sp-externalities 0.19.0", - "sp-panic-handler 8.0.0", - "sp-std 8.0.0", - "sp-trie 22.0.0", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", "thiserror", "tracing", ] -[[package]] -name = "sp-std" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de8eef39962b5b97478719c493bed2926cf70cb621005bbf68ebe58252ff986" - [[package]] name = "sp-std" version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53458e3c57df53698b3401ec0934bea8e8cfce034816873c0b0abbd83d7bac0d" -[[package]] -name = "sp-storage" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad1f8c52d4700ac7bc42b3375679a6c6fc1fe876f4b40c6efdf36f933ef0291" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive 7.0.0", - "sp-std 7.0.0", -] - [[package]] name = "sp-storage" version = "13.0.0" @@ -4482,21 +4131,8 @@ dependencies = [ "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 8.0.0", - "sp-std 8.0.0", -] - -[[package]] -name = "sp-tracing" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00fab60bf3d42255ce3f678903d3a2564662371c75623de4a1ffc7cac46143df" -dependencies = [ - "parity-scale-codec", - "sp-std 7.0.0", - "tracing", - "tracing-core", - "tracing-subscriber 0.2.25", + "sp-debug-derive", + "sp-std", ] [[package]] @@ -4506,36 +4142,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357f7591980dd58305956d32f8f6646d0a8ea9ea0e7e868e46f53b68ddf00cec" dependencies = [ "parity-scale-codec", - "sp-std 8.0.0", + "sp-std", "tracing", "tracing-core", "tracing-subscriber 0.2.25", ] -[[package]] -name = "sp-trie" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58401c53c08b6ecad83acd7e14534c8bbcb3fa73e81e26685e0ac70e51b00c56" -dependencies = [ - "ahash 0.8.3", - "hash-db", - "hashbrown 0.13.2", - "lazy_static", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot", - "scale-info", - "schnellru", - "sp-core 20.0.0", - "sp-std 7.0.0", - "thiserror", - "tracing", - "trie-db", - "trie-root", -] - [[package]] name = "sp-trie" version = "22.0.0" @@ -4552,29 +4164,14 @@ dependencies = [ "parking_lot", "scale-info", "schnellru", - "sp-core 21.0.0", - "sp-std 8.0.0", + "sp-core", + "sp-std", "thiserror", "tracing", "trie-db", "trie-root", ] -[[package]] -name = "sp-wasm-interface" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "153b7374179439e2aa783c66ed439bd86920c67bbc95d34c76390561972bc02f" -dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std 7.0.0", - "wasmi", - "wasmtime 6.0.2", -] - [[package]] name = "sp-wasm-interface" version = "14.0.0" @@ -4585,24 +4182,8 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std 8.0.0", - "wasmtime 8.0.1", -] - -[[package]] -name = "sp-weights" -version = "19.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "123c661915e1bf328e21f8ecbe4e5247feba86f9149b782ea4348004547ce8ef" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic 15.0.0", - "sp-core 20.0.0", - "sp-debug-derive 7.0.0", - "sp-std 7.0.0", + "sp-std", + "wasmtime", ] [[package]] @@ -4615,10 +4196,10 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic 16.0.0", - "sp-core 21.0.0", - "sp-debug-derive 8.0.0", - "sp-std 8.0.0", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", + "sp-std", ] [[package]] @@ -4757,9 +4338,9 @@ dependencies = [ "scale-value", "serde", "serde_json", - "sp-core 21.0.0", - "sp-core-hashing 9.0.0", - "sp-runtime 24.0.0", + "sp-core", + "sp-core-hashing", + "sp-runtime", "subxt-macro", "subxt-metadata", "thiserror", @@ -4807,7 +4388,7 @@ dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", - "sp-core-hashing 9.0.0", + "sp-core-hashing", "thiserror", ] @@ -5503,49 +5084,6 @@ dependencies = [ "cxx-build", ] -[[package]] -name = "wasmi" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" -dependencies = [ - "parity-wasm", - "wasmi-validation", - "wasmi_core", -] - -[[package]] -name = "wasmi-validation" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" -dependencies = [ - "parity-wasm", -] - -[[package]] -name = "wasmi_core" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" -dependencies = [ - "downcast-rs", - "libm", - "memory_units", - "num-rational", - "num-traits", -] - -[[package]] -name = "wasmparser" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" -dependencies = [ - "indexmap 1.9.3", - "url", -] - [[package]] name = "wasmparser" version = "0.102.0" @@ -5556,31 +5094,6 @@ dependencies = [ "url", ] -[[package]] -name = "wasmtime" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" -dependencies = [ - "anyhow", - "bincode", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "object 0.29.0", - "once_cell", - "paste", - "psm", - "serde", - "target-lexicon", - "wasmparser 0.100.0", - "wasmtime-environ 6.0.2", - "wasmtime-jit 6.0.2", - "wasmtime-runtime 6.0.2", - "windows-sys 0.42.0", -] - [[package]] name = "wasmtime" version = "8.0.1" @@ -5593,28 +5106,19 @@ dependencies = [ "indexmap 1.9.3", "libc", "log", - "object 0.30.3", + "object", "once_cell", "paste", "psm", "serde", "target-lexicon", - "wasmparser 0.102.0", - "wasmtime-environ 8.0.1", - "wasmtime-jit 8.0.1", - "wasmtime-runtime 8.0.1", + "wasmparser", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-runtime", "windows-sys 0.45.0", ] -[[package]] -name = "wasmtime-asm-macros" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" -dependencies = [ - "cfg-if", -] - [[package]] name = "wasmtime-asm-macros" version = "8.0.1" @@ -5624,25 +5128,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "wasmtime-environ" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" -dependencies = [ - "anyhow", - "cranelift-entity 0.93.2", - "gimli 0.26.2", - "indexmap 1.9.3", - "log", - "object 0.29.0", - "serde", - "target-lexicon", - "thiserror", - "wasmparser 0.100.0", - "wasmtime-types 6.0.2", -] - [[package]] name = "wasmtime-environ" version = "8.0.1" @@ -5650,39 +5135,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", - "cranelift-entity 0.95.1", - "gimli 0.27.2", + "cranelift-entity", + "gimli", "indexmap 1.9.3", "log", - "object 0.30.3", + "object", "serde", "target-lexicon", "thiserror", - "wasmparser 0.102.0", - "wasmtime-types 8.0.1", -] - -[[package]] -name = "wasmtime-jit" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" -dependencies = [ - "addr2line 0.17.0", - "anyhow", - "bincode", - "cfg-if", - "cpp_demangle", - "gimli 0.26.2", - "log", - "object 0.29.0", - "rustc-demangle", - "serde", - "target-lexicon", - "wasmtime-environ 6.0.2", - "wasmtime-jit-icache-coherence 6.0.2", - "wasmtime-runtime 6.0.2", - "windows-sys 0.42.0", + "wasmparser", + "wasmtime-types", ] [[package]] @@ -5691,32 +5153,23 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.19.0", + "addr2line", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.27.2", + "gimli", "log", - "object 0.30.3", + "object", "rustc-demangle", "serde", "target-lexicon", - "wasmtime-environ 8.0.1", - "wasmtime-jit-icache-coherence 8.0.1", - "wasmtime-runtime 8.0.1", + "wasmtime-environ", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", "windows-sys 0.45.0", ] -[[package]] -name = "wasmtime-jit-debug" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" -dependencies = [ - "once_cell", -] - [[package]] name = "wasmtime-jit-debug" version = "8.0.1" @@ -5726,17 +5179,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" -dependencies = [ - "cfg-if", - "libc", - "windows-sys 0.42.0", -] - [[package]] name = "wasmtime-jit-icache-coherence" version = "8.0.1" @@ -5748,30 +5190,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "wasmtime-runtime" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "mach", - "memfd", - "memoffset 0.6.5", - "paste", - "rand 0.8.5", - "rustix 0.36.9", - "wasmtime-asm-macros 6.0.2", - "wasmtime-environ 6.0.2", - "wasmtime-jit-debug 6.0.2", - "windows-sys 0.42.0", -] - [[package]] name = "wasmtime-runtime" version = "8.0.1" @@ -5786,38 +5204,26 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.8.0", + "memoffset", "paste", "rand 0.8.5", "rustix 0.36.9", - "wasmtime-asm-macros 8.0.1", - "wasmtime-environ 8.0.1", - "wasmtime-jit-debug 8.0.1", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-debug", "windows-sys 0.45.0", ] -[[package]] -name = "wasmtime-types" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" -dependencies = [ - "cranelift-entity 0.93.2", - "serde", - "thiserror", - "wasmparser 0.100.0", -] - [[package]] name = "wasmtime-types" version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ - "cranelift-entity 0.95.1", + "cranelift-entity", "serde", "thiserror", - "wasmparser 0.102.0", + "wasmparser", ] [[package]] diff --git a/crates/build/Cargo.toml b/crates/build/Cargo.toml index daa81af7a..152f8e6df 100644 --- a/crates/build/Cargo.toml +++ b/crates/build/Cargo.toml @@ -27,7 +27,7 @@ rustc_version = "0.4.0" scale = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"] } toml = "0.7.5" tracing = "0.1.37" -parity-wasm = "0.45.0" +parity-wasm = { version = "0.45.0", features = ["sign_ext"] } semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1", default-features = false, features = ["derive"] } serde_json = "1.0.99" diff --git a/crates/build/src/lib.rs b/crates/build/src/lib.rs index 472e0f0ac..a1fd2aee3 100644 --- a/crates/build/src/lib.rs +++ b/crates/build/src/lib.rs @@ -296,6 +296,18 @@ fn exec_cargo_for_onchain_target( // Allow nightly features on a stable toolchain env.push(("RUSTC_BOOTSTRAP", Some("1".to_string()))) } + + // newer rustc versions might emit unsupported instructions + if rustc_version::version_meta()?.semver >= Version::new(1, 70, 0) { + maybe_println!( + verbosity, + "{} {}", + "warning:".yellow().bold(), + "You are using a rustc version that might emit unsupported wasm instructions. Build using a version lower than 1.70.0 to make sure your contract will deploy." + .bold() + ); + } + // the linker needs our linker script as file let rustflags = target.rustflags(); if matches!(target, Target::RiscV) { diff --git a/crates/build/src/wasm_opt.rs b/crates/build/src/wasm_opt.rs index 3f0fcb935..8fa3cc717 100644 --- a/crates/build/src/wasm_opt.rs +++ b/crates/build/src/wasm_opt.rs @@ -15,7 +15,10 @@ // along with cargo-contract. If not, see . use anyhow::Result; -use wasm_opt::OptimizationOptions; +use wasm_opt::{ + Feature, + OptimizationOptions, +}; use std::{ fmt, @@ -65,10 +68,9 @@ impl WasmOptHandler { ); OptimizationOptions::from(self.optimization_level) - // Binaryen (and wasm-opt) now enables the `SignExt` and `MutableGlobals` - // features by default, so we want to disable those for now since - // `pallet-contracts` still needs to enable these. + // Since rustc 1.70 `SignExt` can't be disabled anymore. Hence we have to allow it. .mvp_features_only() + .enable_feature(Feature::SignExt) // the memory in our module is imported, `wasm-opt` needs to be told that // the memory is initialized to zeroes, otherwise it won't run the // memory-packing pre-pass. diff --git a/crates/transcode/Cargo.toml b/crates/transcode/Cargo.toml index 25fc1d7ff..7feddfe9c 100644 --- a/crates/transcode/Cargo.toml +++ b/crates/transcode/Cargo.toml @@ -41,8 +41,8 @@ strsim = "0.10.0" [dev-dependencies] assert_matches = "1.5.0" ink = "4.2.0" -sp-core = "20.0.0" -sp-keyring = "23.0.0" +sp-core = "21.0.0" +sp-keyring = "24.0.0" [features] # This `std` feature is required for testing using an inline contract's metadata, because `ink!` annotates the metadata