From 585e7e8cc2a24874898e6490ea96462db7d9c3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Tue, 5 Apr 2022 19:01:45 +0200 Subject: [PATCH] Upgrade to wasmer 2.2 (#11168) --- Cargo.lock | 389 ++++++++++++------ client/executor/common/Cargo.toml | 5 +- client/executor/common/src/sandbox.rs | 2 + .../common/src/sandbox/wasmer_backend.rs | 6 +- .../src/communication/gossip.rs | 2 +- client/finality-grandpa/src/justification.rs | 2 +- 6 files changed, 270 insertions(+), 136 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 23f11860ca6f8..17931984c41e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -795,6 +795,27 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +[[package]] +name = "bytecheck" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +dependencies = [ + "bytecheck_derive", + "ptr_meta", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "byteorder" version = "1.3.4" @@ -1140,11 +1161,11 @@ checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" [[package]] name = "cranelift-bforest" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9221545c0507dc08a62b2d8b5ffe8e17ac580b0a74d1813b496b8d70b070fbd0" +checksum = "7e6bea67967505247f54fa2c85cf4f6e0e31c4e5692c9b70e4ae58e339067333" dependencies = [ - "cranelift-entity 0.68.0", + "cranelift-entity 0.76.0", ] [[package]] @@ -1158,21 +1179,19 @@ dependencies = [ [[package]] name = "cranelift-codegen" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9936ea608b6cd176f107037f6adbb4deac933466fc7231154f96598b2d3ab1" +checksum = "48194035d2752bdd5bdae429e3ab88676e95f52a2b1355a5d4e809f9e39b1d74" dependencies = [ - "byteorder", - "cranelift-bforest 0.68.0", - "cranelift-codegen-meta 0.68.0", - "cranelift-codegen-shared 0.68.0", - "cranelift-entity 0.68.0", - "gimli 0.22.0", + "cranelift-bforest 0.76.0", + "cranelift-codegen-meta 0.76.0", + "cranelift-codegen-shared 0.76.0", + "cranelift-entity 0.76.0", + "gimli 0.25.0", "log 0.4.14", "regalloc 0.0.31", "smallvec 1.8.0", - "target-lexicon 0.11.2", - "thiserror", + "target-lexicon", ] [[package]] @@ -1189,17 +1208,17 @@ dependencies = [ "log 0.4.14", "regalloc 0.0.33", "smallvec 1.8.0", - "target-lexicon 0.12.0", + "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef2b2768568306540f4c8db3acce9105534d34c4a1e440529c1e702d7f8c8d7" +checksum = "976efb22fcab4f2cd6bd4e9913764616a54d895c1a23530128d04e03633c555f" dependencies = [ - "cranelift-codegen-shared 0.68.0", - "cranelift-entity 0.68.0", + "cranelift-codegen-shared 0.76.0", + "cranelift-entity 0.76.0", ] [[package]] @@ -1213,9 +1232,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6759012d6d19c4caec95793f052613e9d4113e925e7f14154defbac0f1d4c938" +checksum = "9dabb5fe66e04d4652e434195b45ae65b5c8172d520247b8f66d8df42b2b45dc" [[package]] name = "cranelift-codegen-shared" @@ -1225,12 +1244,9 @@ checksum = "981da52d8f746af1feb96290c83977ff8d41071a7499e991d8abae0d4869f564" [[package]] name = "cranelift-entity" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86badbce14e15f52a45b666b38abe47b204969dd7f8fb7488cb55dd46b361fa6" -dependencies = [ - "serde", -] +checksum = "3329733e4d4b8e91c809efcaa4faee80bf66f20164e3dd16d707346bd3494799" [[package]] name = "cranelift-entity" @@ -1243,14 +1259,14 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.68.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b608bb7656c554d0a4cf8f50c7a10b857e80306f6ff829ad6d468a7e2323c8d8" +checksum = "279afcc0d3e651b773f94837c3d581177b348c8d69e928104b2e9fccb226f921" dependencies = [ - "cranelift-codegen 0.68.0", + "cranelift-codegen 0.76.0", "log 0.4.14", "smallvec 1.8.0", - "target-lexicon 0.11.2", + "target-lexicon", ] [[package]] @@ -1262,7 +1278,7 @@ dependencies = [ "cranelift-codegen 0.80.0", "log 0.4.14", "smallvec 1.8.0", - "target-lexicon 0.12.0", + "target-lexicon", ] [[package]] @@ -1273,7 +1289,7 @@ checksum = "166028ca0343a6ee7bddac0e70084e142b23f99c701bd6f6ea9123afac1a7a46" dependencies = [ "cranelift-codegen 0.80.0", "libc", - "target-lexicon 0.12.0", + "target-lexicon", ] [[package]] @@ -1757,9 +1773,9 @@ checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28" [[package]] name = "dynasm" -version = "1.1.0" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc2d9a5e44da60059bd38db2d05cbb478619541b8c79890547861ec1e3194f0" +checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ "bitflags", "byteorder", @@ -1772,13 +1788,13 @@ dependencies = [ [[package]] name = "dynasmrt" -version = "1.1.0" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42276e3f205fe63887cca255aa9a65a63fb72764c30b9a6252a7c7e46994f689" +checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2 0.2.1", + "memmap2 0.5.0", ] [[package]] @@ -1851,6 +1867,26 @@ dependencies = [ "syn", ] +[[package]] +name = "enum-iterator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "enumflags2" version = "0.6.4" @@ -2676,9 +2712,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.22.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" +checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" dependencies = [ "fallible-iterator", "indexmap", @@ -3684,16 +3720,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "libloading" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" -dependencies = [ - "cfg-if 1.0.0", - "winapi 0.3.9", -] - [[package]] name = "libloading" version = "0.7.0" @@ -4343,6 +4369,27 @@ dependencies = [ "value-bag", ] +[[package]] +name = "loupe" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" +dependencies = [ + "indexmap", + "loupe-derive", + "rustversion", +] + +[[package]] +name = "loupe-derive" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "lru" version = "0.6.6" @@ -5327,21 +5374,23 @@ dependencies = [ [[package]] name = "object" -version = "0.22.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" dependencies = [ "crc32fast", "indexmap", + "memchr", ] [[package]] name = "object" -version = "0.27.1" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" dependencies = [ "crc32fast", + "hashbrown 0.11.2", "indexmap", "memchr", ] @@ -7365,6 +7414,26 @@ dependencies = [ "cc", ] +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -7776,6 +7845,18 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "region" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +dependencies = [ + "bitflags", + "libc", + "mach", + "winapi 0.3.9", +] + [[package]] name = "remote-externalities" version = "0.10.0-dev" @@ -7804,6 +7885,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "rend" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +dependencies = [ + "bytecheck", +] + [[package]] name = "resolv-conf" version = "0.7.0" @@ -7835,6 +7925,31 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "rkyv" +version = "0.7.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f08c8062c1fe1253064043b8fc07bfea1b9702b71b4a86c11ea3588183b12e1" +dependencies = [ + "bytecheck", + "hashbrown 0.12.0", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e289706df51226e84814bf6ba1a9e1013112ae29bc7a9878f73fce360520c403" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "rocksdb" version = "0.18.0" @@ -8524,7 +8639,6 @@ dependencies = [ "thiserror", "wasm-instrument", "wasmer", - "wasmer-compiler-singlepass", "wasmi", ] @@ -9257,6 +9371,12 @@ dependencies = [ "untrusted", ] +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + [[package]] name = "sec1" version = "0.2.1" @@ -10855,15 +10975,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422045212ea98508ae3d28025bc5aaa2bd4a9cdaecd442a08da2ee620ee9ea95" - -[[package]] -name = "target-lexicon" -version = "0.12.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ae3b39281e4b14b8123bdbaddd472b7dfe215e444181f2f9d2443c2444f834" +checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1" [[package]] name = "tempfile" @@ -11232,6 +11346,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if 1.0.0", + "log 0.4.14", "pin-project-lite 0.2.6", "tracing-attributes", "tracing-core", @@ -11471,9 +11586,9 @@ version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.3", - "rand 0.8.4", + "rand 0.6.5", "static_assertions", ] @@ -11820,21 +11935,25 @@ dependencies = [ [[package]] name = "wasmer" -version = "1.0.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70cfae554988d904d64ca17ab0e7cd652ee5c8a0807094819c1ea93eb9d6866" +checksum = "f727a39e7161f7438ddb8eafe571b67c576a8c2fb459f666d9053b5bba4afdea" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "indexmap", + "js-sys", + "loupe", "more-asserts", - "target-lexicon 0.11.2", + "target-lexicon", "thiserror", + "wasm-bindgen", "wasmer-compiler", "wasmer-compiler-cranelift", + "wasmer-compiler-singlepass", "wasmer-derive", "wasmer-engine", - "wasmer-engine-jit", - "wasmer-engine-native", + "wasmer-engine-dylib", + "wasmer-engine-universal", "wasmer-types", "wasmer-vm", "wat", @@ -11843,34 +11962,38 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "1.0.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7732a9cab472bd921d5a0c422f45b3d03f62fa2c40a89e0770cef6d47e383e" +checksum = "4e9951599222eb12bd13d4d91bcded0a880e4c22c2dfdabdf5dc7e5e803b7bf3" dependencies = [ "enumset", + "loupe", + "rkyv", "serde", "serde_bytes", "smallvec 1.8.0", - "target-lexicon 0.11.2", + "target-lexicon", "thiserror", "wasmer-types", "wasmer-vm", - "wasmparser 0.65.0", + "wasmparser 0.78.2", ] [[package]] name = "wasmer-compiler-cranelift" -version = "1.0.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb9395f094e1d81534f4c5e330ed4cdb424e8df870d29ad585620284f5fddb" +checksum = "44c83273bce44e668f3a2b9ccb7f1193db918b1d6806f64acc5ff71f6ece5f20" dependencies = [ - "cranelift-codegen 0.68.0", - "cranelift-frontend 0.68.0", - "gimli 0.22.0", + "cranelift-codegen 0.76.0", + "cranelift-entity 0.76.0", + "cranelift-frontend 0.76.0", + "gimli 0.25.0", + "loupe", "more-asserts", "rayon", - "serde", "smallvec 1.8.0", + "target-lexicon", "tracing", "wasmer-compiler", "wasmer-types", @@ -11879,17 +12002,17 @@ dependencies = [ [[package]] name = "wasmer-compiler-singlepass" -version = "1.0.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426ae6ef0f606ca815510f3e2ef6f520e217514bfb7a664defe180b9a9e75d07" +checksum = "5432e993840cdb8e6875ddc8c9eea64e7a129579b4706bd91b8eb474d9c4a860" dependencies = [ "byteorder", "dynasm", "dynasmrt", "lazy_static", + "loupe", "more-asserts", "rayon", - "serde", "smallvec 1.8.0", "wasmer-compiler", "wasmer-types", @@ -11898,9 +12021,9 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "1.0.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b86dcd2c3efdb8390728a2b56f762db07789aaa5aa872a9dc776ba3a7912ed" +checksum = "458dbd9718a837e6dbc52003aef84487d79eedef5fa28c7d28b6784be98ac08e" dependencies = [ "proc-macro-error", "proc-macro2", @@ -11910,19 +12033,20 @@ dependencies = [ [[package]] name = "wasmer-engine" -version = "1.0.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efe4667d6bd888f26ae8062a63a9379fa697415b4b4e380f33832e8418fd71b5" +checksum = "6ed603a6d037ebbb14014d7f739ae996a78455a4b86c41cfa4e81c590a1253b9" dependencies = [ "backtrace", - "bincode", + "enumset", "lazy_static", - "memmap2 0.2.1", + "loupe", + "memmap2 0.5.0", "more-asserts", "rustc-demangle", "serde", "serde_bytes", - "target-lexicon 0.11.2", + "target-lexicon", "thiserror", "wasmer-compiler", "wasmer-types", @@ -11930,51 +12054,57 @@ dependencies = [ ] [[package]] -name = "wasmer-engine-jit" -version = "1.0.2" +name = "wasmer-engine-dylib" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26770be802888011b4a3072f2a282fc2faa68aa48c71b3db6252a3937a85f3da" +checksum = "ccd7fdc60e252a795c849b3f78a81a134783051407e7e279c10b7019139ef8dc" dependencies = [ - "bincode", - "cfg-if 0.1.10", - "region", + "cfg-if 1.0.0", + "enum-iterator", + "enumset", + "leb128", + "libloading 0.7.0", + "loupe", + "object 0.28.3", + "rkyv", "serde", - "serde_bytes", + "tempfile", + "tracing", "wasmer-compiler", "wasmer-engine", + "wasmer-object", "wasmer-types", "wasmer-vm", - "winapi 0.3.9", + "which", ] [[package]] -name = "wasmer-engine-native" -version = "1.0.2" +name = "wasmer-engine-universal" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb4083a6c69f2cd4b000b82a80717f37c6cc2e536aee3a8ffe9af3edc276a8b" +checksum = "dcff0cd2c01a8de6009fd863b14ea883132a468a24f2d2ee59dc34453d3a31b5" dependencies = [ - "bincode", - "cfg-if 0.1.10", + "cfg-if 1.0.0", + "enum-iterator", + "enumset", "leb128", - "libloading 0.6.7", - "serde", - "tempfile", - "tracing", + "loupe", + "region 3.0.0", + "rkyv", "wasmer-compiler", "wasmer-engine", - "wasmer-object", "wasmer-types", "wasmer-vm", - "which", + "winapi 0.3.9", ] [[package]] name = "wasmer-object" -version = "1.0.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf8e0c12b82ff81ebecd30d7e118be5fec871d6de885a90eeb105df0a769a7b" +checksum = "24ce18ac2877050e59580d27ee1a88f3192d7a31e77fbba0852abc7888d6e0b5" dependencies = [ - "object 0.22.0", + "object 0.28.3", "thiserror", "wasmer-compiler", "wasmer-types", @@ -11982,29 +12112,34 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "1.0.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f4ac28c2951cd792c18332f03da523ed06b170f5cf6bb5b1bdd7e36c2a8218" +checksum = "659fa3dd6c76f62630deff4ac8c7657b07f0b1e4d7e0f8243a552b9d9b448e24" dependencies = [ - "cranelift-entity 0.68.0", + "indexmap", + "loupe", + "rkyv", "serde", "thiserror", ] [[package]] name = "wasmer-vm" -version = "1.0.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7635ba0b6d2fd325f588d69a950ad9fa04dddbf6ad08b6b2a183146319bf6ae" +checksum = "afdc46158517c2769f9938bc222a7d41b3bb330824196279d8aa2d667cd40641" dependencies = [ "backtrace", "cc", - "cfg-if 0.1.10", + "cfg-if 1.0.0", + "enum-iterator", "indexmap", "libc", + "loupe", "memoffset", "more-asserts", - "region", + "region 3.0.0", + "rkyv", "serde", "thiserror", "wasmer-types", @@ -12039,9 +12174,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.65.0" +version = "0.78.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc2fe6350834b4e528ba0901e7aa405d78b89dc1fa3145359eb4de0e323fcf" +checksum = "52144d4c78e5cf8b055ceab8e5fa22814ce4315d6002ad32cfd914f37c12fd65" [[package]] name = "wasmparser" @@ -12068,10 +12203,10 @@ dependencies = [ "paste 1.0.6", "psm", "rayon", - "region", + "region 2.2.0", "rustc-demangle", "serde", - "target-lexicon 0.12.0", + "target-lexicon", "wasmparser 0.81.0", "wasmtime-cache", "wasmtime-cranelift", @@ -12117,7 +12252,7 @@ dependencies = [ "log 0.4.14", "more-asserts", "object 0.27.1", - "target-lexicon 0.12.0", + "target-lexicon", "thiserror", "wasmparser 0.81.0", "wasmtime-environ", @@ -12137,7 +12272,7 @@ dependencies = [ "more-asserts", "object 0.27.1", "serde", - "target-lexicon 0.12.0", + "target-lexicon", "thiserror", "wasmparser 0.81.0", "wasmtime-types", @@ -12155,10 +12290,10 @@ dependencies = [ "cfg-if 1.0.0", "gimli 0.26.1", "object 0.27.1", - "region", + "region 2.2.0", "rustix", "serde", - "target-lexicon 0.12.0", + "target-lexicon", "thiserror", "wasmtime-environ", "wasmtime-runtime", @@ -12183,7 +12318,7 @@ dependencies = [ "memoffset", "more-asserts", "rand 0.8.4", - "region", + "region 2.2.0", "rustix", "thiserror", "wasmtime-environ", diff --git a/client/executor/common/Cargo.toml b/client/executor/common/Cargo.toml index 9282fe3b03dd6..149d9fdc236cd 100644 --- a/client/executor/common/Cargo.toml +++ b/client/executor/common/Cargo.toml @@ -24,13 +24,10 @@ sp-maybe-compressed-blob = { version = "4.1.0-dev", path = "../../../primitives/ sp-serializer = { version = "4.0.0-dev", path = "../../../primitives/serializer" } thiserror = "1.0.30" environmental = "1.1.3" - -wasmer = { version = "1.0", optional = true } -wasmer-compiler-singlepass = { version = "1.0", optional = true } +wasmer = { version = "2.2", optional = true, features = ["singlepass"] } [features] default = [] wasmer-sandbox = [ "wasmer", - "wasmer-compiler-singlepass", ] diff --git a/client/executor/common/src/sandbox.rs b/client/executor/common/src/sandbox.rs index 3f46ec53bdfe4..a2c1f602b1c9a 100644 --- a/client/executor/common/src/sandbox.rs +++ b/client/executor/common/src/sandbox.rs @@ -251,6 +251,8 @@ pub enum InstantiationError { /// Module is well-formed, instantiated and linked, but while executing the start function /// a trap was generated. StartTrapped, + /// The code was compiled with a CPU feature not available on the host. + CpuFeature, } fn decode_environment_definition( diff --git a/client/executor/common/src/sandbox/wasmer_backend.rs b/client/executor/common/src/sandbox/wasmer_backend.rs index 904afc9470400..44b43757148de 100644 --- a/client/executor/common/src/sandbox/wasmer_backend.rs +++ b/client/executor/common/src/sandbox/wasmer_backend.rs @@ -43,9 +43,8 @@ pub struct Backend { impl Backend { pub fn new() -> Self { - let compiler = wasmer_compiler_singlepass::Singlepass::default(); - - Backend { store: wasmer::Store::new(&wasmer::JIT::new(compiler).engine()) } + let compiler = wasmer::Singlepass::default(); + Backend { store: wasmer::Store::new(&wasmer::Universal::new(compiler).engine()) } } } @@ -191,6 +190,7 @@ pub fn instantiate( wasmer::InstantiationError::Start(_) => InstantiationError::StartTrapped, wasmer::InstantiationError::HostEnvInitialization(_) => InstantiationError::EnvironmentDefinitionCorrupted, + wasmer::InstantiationError::CpuFeature(_) => InstantiationError::CpuFeature, }) })?; diff --git a/client/finality-grandpa/src/communication/gossip.rs b/client/finality-grandpa/src/communication/gossip.rs index 7ac4066780d0f..c39e2e82a621e 100644 --- a/client/finality-grandpa/src/communication/gossip.rs +++ b/client/finality-grandpa/src/communication/gossip.rs @@ -799,7 +799,7 @@ impl Inner { Some(ref mut v) => if v.set_id == set_id { let diff_authorities = self.authorities.iter().collect::>() != - authorities.iter().collect(); + authorities.iter().collect::>(); if diff_authorities { debug!(target: "afg", diff --git a/client/finality-grandpa/src/justification.rs b/client/finality-grandpa/src/justification.rs index 5ee5f278ed8b6..39f24cb8ea57d 100644 --- a/client/finality-grandpa/src/justification.rs +++ b/client/finality-grandpa/src/justification.rs @@ -185,7 +185,7 @@ impl GrandpaJustification { } } - let ancestry_hashes = + let ancestry_hashes: HashSet<_> = self.votes_ancestries.iter().map(|h: &Block::Header| h.hash()).collect(); if visited_hashes != ancestry_hashes {