diff --git a/Cargo.lock b/Cargo.lock index ac4b3260fac..fcacb027da4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -424,7 +424,7 @@ name = "backtrace-sys" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -506,7 +506,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "blake3" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -571,7 +585,7 @@ name = "brotli-sys" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -653,11 +667,10 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.46" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -714,7 +727,7 @@ name = "clear_on_drop" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -741,7 +754,7 @@ name = "cmake" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -761,7 +774,7 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1421,11 +1434,6 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "hex" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "hex" version = "0.4.0" @@ -1629,7 +1637,7 @@ name = "jemalloc-sys" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1704,7 +1712,7 @@ name = "libloading" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1714,7 +1722,7 @@ version = "6.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bindgen 0.49.2 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2301,8 +2309,8 @@ dependencies = [ "parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "pwasm-utils 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "wabt 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime-core 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-runtime 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-runtime-core 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)", "wasmparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2399,7 +2407,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2548,7 +2556,7 @@ name = "openssl-src" version = "111.6.1+1.1.1d" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2557,7 +2565,7 @@ version = "0.9.52" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-src 111.6.1+1.1.1d (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2599,7 +2607,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2609,16 +2617,6 @@ name = "parity-wasm" version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "parking_lot" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "parking_lot" version = "0.10.0" @@ -2628,20 +2626,6 @@ dependencies = [ "parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "parking_lot_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "parking_lot_core" version = "0.7.0" @@ -3103,7 +3087,7 @@ name = "ring" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3523,6 +3507,11 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "target-lexicon" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "tempdir" version = "0.3.7" @@ -3974,7 +3963,7 @@ name = "wabt-sys" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4072,47 +4061,48 @@ dependencies = [ [[package]] name = "wasmer-runtime" -version = "0.13.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime-core 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-singlepass-backend 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-runtime-core 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-singlepass-backend 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmer-runtime-core" -version = "0.13.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "blake3 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "page_size 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde-bench 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "serde_bytes 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser 0.45.2 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.51.4 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasmer-singlepass-backend" -version = "0.13.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4125,7 +4115,7 @@ dependencies = [ "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmer-runtime-core 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-runtime-core 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4135,7 +4125,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasmparser" -version = "0.45.2" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -4309,6 +4299,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a993f74b4c99c1908d156b8d2e0fb6277736b0ecbd833982fd1241d39b2766a6" "checksum blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" "checksum blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "5850aeee1552f495dd0250014cf64b82b7c8879a89d83b33bbdace2cc4f63182" +"checksum blake3 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46080006c1505f12f64dd2a09264b343381ed3190fa02c8005d5d662ac571c63" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" "checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" "checksum borsh 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9dada4c07fa726bc195503048581e7b1719407f7fbef82741f7b149d3921b3" @@ -4327,7 +4318,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bytestring 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b24c107a4432e408d2caa58d3f5e763b219236221406ea58a4076b62343a039d" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum cached 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "083dc50149e37dfaab1ffe2c3af03576b79550f1e419a5091b28a7191db1c45b" -"checksum cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" = "0213d356d3c4ea2c18c40b037c3be23cd639825c18f25ee670ac7813beeef99c" +"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" "checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e8493056968583b0193c1bb04d6f7684586f3726992d6c573261941a895dbd68" @@ -4338,7 +4329,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "81fb25b677f8bf1eb325017cb6bb8452f87969db0fedb4f757b297bee78a7c62" "checksum console 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f5d540c2d34ac9dd0deb5f3b5f54c36c79efa78f6b3ad19106a554d07a7b5d9f" -"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" +"checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" "checksum copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ff9c56c9fb2a49c05ef0e431485a22400af20d33226dc0764d891d09e724127" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" @@ -4410,7 +4401,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" -"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e" "checksum hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0" "checksum hex-literal-impl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9d4c5c844e2fee0bf673d54c2c177f1713b3d2af2ff6e666b49cb7572e6cf42d" @@ -4484,8 +4474,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum parity-secp256k1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4fca4f82fccae37e8bbdaeb949a4a218a1bbc485d11598f193d2a908042e5fc1" "checksum parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" "checksum parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" -"checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" -"checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" "checksum parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" @@ -4581,6 +4569,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf" "checksum synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203" "checksum sysinfo 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8834e42be61ae4f6338b216fbb69837c7f33c3d4d3a139fb073735b25af4d9e" +"checksum target-lexicon 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6f4c118a7a38378f305a9e111fcb2f7f838c0be324bfb31a77ea04f7f6e684b4" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" @@ -4636,11 +4625,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum wasm-bindgen-macro-support 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "e85031354f25eaebe78bb7db1c3d86140312a911a106b2e29f9cc440ce3e7668" "checksum wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e7e61fc929f4c0dddb748b102ebf9f632e2b8d739f2016542b4de2965a9601" "checksum wasm-bindgen-webidl 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "ef012a0d93fc0432df126a8eaf547b2dce25a8ce9212e1d3cbeef5c11157975d" -"checksum wasmer-runtime 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05726a0bc546d57e06cde6a7754cf9afbf21a5869d080a3c654d35902cd6fab3" -"checksum wasmer-runtime-core 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7b1131f1bb9a0610eeef2974275de019027fa8dcfac78a9976439ce5f4561ade" -"checksum wasmer-singlepass-backend 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae95c8c55b15261a4e99cc8a2eaebf8e63051c4400b2c85209964dac9a811820" +"checksum wasmer-runtime 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)" = "434a3454b98844e5d413ba21a2fa5931bb45bcdd8404bb6147b444d5cbf5a3d5" +"checksum wasmer-runtime-core 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e32bdb04d008eb136c88a12c0fdfb7e5d7ff30b208af4bef1d292d863eb1ba2" +"checksum wasmer-singlepass-backend 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b4f850cf15c8d1d29e6010bd980206100cf58f0d4766216a7b24e6b590ab89c0" "checksum wasmparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)" = "babc64a146209e9ba40dd1ab89b161d27993b274a032a2fc34e967dd43b85e3a" -"checksum wasmparser 0.45.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8b4eab1d9971d0803729cba3617b56eb04fcb4bd25361cb63880ed41a42f20d5" +"checksum wasmparser 0.51.4 (registry+https://github.com/rust-lang/crates.io-index)" = "aeb1956b19469d1c5e63e459d29e7b5aa0f558d9f16fcef09736f8a265e6c10a" "checksum web-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "aaf97caf6aa8c2b1dac90faf0db529d9d63c93846cca4911856f78a83cebf53b" "checksum webpki 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d7e664e770ac0110e2384769bcc59ed19e329d81f555916a6e072714957b81b4" "checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" diff --git a/chain/jsonrpc/build_errors_schema.sh b/chain/jsonrpc/build_errors_schema.sh index 59aa28ddf35..1948ddc281c 100755 --- a/chain/jsonrpc/build_errors_schema.sh +++ b/chain/jsonrpc/build_errors_schema.sh @@ -1,3 +1,4 @@ #!/bin/bash +rm ../../target/rpc_errors_schema.json cargo build --features dump_errors_schema cp ../../target/rpc_errors_schema.json ./res/rpc_errors_schema.json diff --git a/chain/jsonrpc/res/rpc_errors_schema.json b/chain/jsonrpc/res/rpc_errors_schema.json index a71cbfa28f3..6465b61c04e 100644 --- a/chain/jsonrpc/res/rpc_errors_schema.json +++ b/chain/jsonrpc/res/rpc_errors_schema.json @@ -15,6 +15,11 @@ "subtypes": [], "props": {} }, + "CallIndirectOOB": { + "name": "CallIndirectOOB", + "subtypes": [], + "props": {} + }, "CannotAppendActionToJointPromise": { "name": "CannotAppendActionToJointPromise", "subtypes": [], @@ -73,6 +78,7 @@ "LinkError", "MethodResolveError", "WasmTrap", + "WasmUnknownError", "HostError" ], "props": {} @@ -135,6 +141,16 @@ ], "props": {} }, + "IllegalArithmetic": { + "name": "IllegalArithmetic", + "subtypes": [], + "props": {} + }, + "IncorrectCallIndirectSignature": { + "name": "IncorrectCallIndirectSignature", + "subtypes": [], + "props": {} + }, "Instantiate": { "name": "Instantiate", "subtypes": [], @@ -232,6 +248,11 @@ "subtypes": [], "props": {} }, + "MemoryOutOfBounds": { + "name": "MemoryOutOfBounds", + "subtypes": [], + "props": {} + }, "MethodEmptyName": { "name": "MethodEmptyName", "subtypes": [], @@ -262,6 +283,11 @@ "subtypes": [], "props": {} }, + "MisalignedAtomicAccess": { + "name": "MisalignedAtomicAccess", + "subtypes": [], + "props": {} + }, "NumberInputDataDependenciesExceeded": { "name": "NumberInputDataDependenciesExceeded", "subtypes": [], @@ -331,6 +357,11 @@ "limit": "" } }, + "Unreachable": { + "name": "Unreachable", + "subtypes": [], + "props": {} + }, "ValueLengthExceeded": { "name": "ValueLengthExceeded", "subtypes": [], @@ -341,10 +372,20 @@ }, "WasmTrap": { "name": "WasmTrap", + "subtypes": [ + "Unreachable", + "IncorrectCallIndirectSignature", + "MemoryOutOfBounds", + "CallIndirectOOB", + "IllegalArithmetic", + "MisalignedAtomicAccess" + ], + "props": {} + }, + "WasmUnknownError": { + "name": "WasmUnknownError", "subtypes": [], - "props": { - "msg": "" - } + "props": {} }, "WasmerCompileError": { "name": "WasmerCompileError", diff --git a/runtime/near-vm-errors/src/lib.rs b/runtime/near-vm-errors/src/lib.rs index 0c62a590601..b18b2380583 100644 --- a/runtime/near-vm-errors/src/lib.rs +++ b/runtime/near-vm-errors/src/lib.rs @@ -17,12 +17,37 @@ pub enum VMError { Debug, Clone, PartialEq, Eq, BorshDeserialize, BorshSerialize, Deserialize, Serialize, RpcError, )] pub enum FunctionCallError { + /// Wasm compilation error CompilationError(CompilationError), - LinkError { msg: String }, + /// Wasm binary env link error + LinkError { + msg: String, + }, + /// Import/export resolve error MethodResolveError(MethodResolveError), - WasmTrap { msg: String }, + /// A trap happened during execution of a binary + WasmTrap(WasmTrap), + WasmUnknownError, HostError(HostError), } +/// A kind of a trap happened during execution of a binary +#[derive( + Debug, Clone, PartialEq, Eq, BorshDeserialize, BorshSerialize, Deserialize, Serialize, RpcError, +)] +pub enum WasmTrap { + /// An `unreachable` opcode was executed. + Unreachable, + /// Call indirect incorrect signature trap. + IncorrectCallIndirectSignature, + /// Memory out of bounds trap. + MemoryOutOfBounds, + /// Call indirect out of bounds trap. + CallIndirectOOB, + /// An arithmetic exception, e.g. divided by zero. + IllegalArithmetic, + /// Misaligned atomic access trap. + MisalignedAtomicAccess, +} #[derive( Debug, Clone, PartialEq, Eq, BorshDeserialize, BorshSerialize, Deserialize, Serialize, RpcError, @@ -198,7 +223,27 @@ impl fmt::Display for FunctionCallError { FunctionCallError::MethodResolveError(e) => e.fmt(f), FunctionCallError::HostError(e) => e.fmt(f), FunctionCallError::LinkError { msg } => write!(f, "{}", msg), - FunctionCallError::WasmTrap { msg } => write!(f, "WebAssembly trap: {}", msg), + FunctionCallError::WasmTrap(trap) => write!(f, "WebAssembly trap: {}", trap), + FunctionCallError::WasmUnknownError => { + write!(f, "Unknown error during Wasm contract execution") + } + } + } +} + +impl fmt::Display for WasmTrap { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { + match self { + WasmTrap::Unreachable => write!(f, "An `unreachable` opcode was executed."), + WasmTrap::IncorrectCallIndirectSignature => { + write!(f, "Call indirect incorrect signature trap.") + } + WasmTrap::MemoryOutOfBounds => write!(f, "Memory out of bounds trap."), + WasmTrap::CallIndirectOOB => write!(f, "Call indirect out of bounds trap."), + WasmTrap::IllegalArithmetic => { + write!(f, "An arithmetic exception, e.g. divided by zero.") + } + WasmTrap::MisalignedAtomicAccess => write!(f, "Misaligned atomic access trap."), } } } diff --git a/runtime/near-vm-runner/Cargo.toml b/runtime/near-vm-runner/Cargo.toml index cce75af6558..5ea916b63ad 100644 --- a/runtime/near-vm-runner/Cargo.toml +++ b/runtime/near-vm-runner/Cargo.toml @@ -14,8 +14,8 @@ This crate implements the specification of the interface that Near blockchain ex [dependencies] cached = "0.12.0" -wasmer-runtime = { version = "0.13.1", features = ["default-backend-singlepass"], default-features = false } -wasmer-runtime-core = { version = "0.13.1" } +wasmer-runtime = { version = "0.16.2", features = ["default-backend-singlepass"], default-features = false } +wasmer-runtime-core = { version = "0.16.2" } near-runtime-fees = { path="../near-runtime-fees", version = "0.8.0" } near-vm-logic = { path="../near-vm-logic", version = "0.8.0", default-features = false, features = []} near-vm-errors = { path = "../near-vm-errors", version = "0.8.0" } diff --git a/runtime/near-vm-runner/src/errors.rs b/runtime/near-vm-runner/src/errors.rs index 9feba487285..8b71e9666c7 100644 --- a/runtime/near-vm-runner/src/errors.rs +++ b/runtime/near-vm-runner/src/errors.rs @@ -1,4 +1,4 @@ -use near_vm_errors::{CompilationError, FunctionCallError, MethodResolveError, VMError}; +use near_vm_errors::{CompilationError, FunctionCallError, MethodResolveError, VMError, WasmTrap}; use near_vm_logic::VMLogicError; pub trait IntoVMError { @@ -33,9 +33,15 @@ impl IntoVMError for wasmer_runtime::error::CallError { impl IntoVMError for wasmer_runtime::error::CompileError { fn into_vm_error(self) -> VMError { - VMError::FunctionCallError(FunctionCallError::CompilationError( - CompilationError::WasmerCompileError { msg: self.to_string() }, - )) + match self { + wasmer_runtime::error::CompileError::InternalError { .. } => { + // An internal Wasmer error the most probably is a result of a node malfunction + panic!("Internal Wasmer error on Wasm compilation: {}", self); + } + _ => VMError::FunctionCallError(FunctionCallError::CompilationError( + CompilationError::WasmerCompileError { msg: self.to_string() }, + )), + } } } @@ -58,33 +64,51 @@ impl IntoVMError for wasmer_runtime::error::ResolveError { impl IntoVMError for wasmer_runtime::error::RuntimeError { fn into_vm_error(self) -> VMError { - use wasmer_runtime::error::RuntimeError; - match &self { - RuntimeError::Trap { msg } => { - VMError::FunctionCallError(FunctionCallError::WasmTrap { msg: msg.to_string() }) + use wasmer_runtime::ExceptionCode; + let data = &*self.0; + + if let Some(err) = data.downcast_ref::() { + match err { + VMLogicError::HostError(h) => { + VMError::FunctionCallError(FunctionCallError::HostError(h.clone())) + } + VMLogicError::ExternalError(s) => VMError::ExternalError(s.clone()), + VMLogicError::InconsistentStateError(e) => { + VMError::InconsistentStateError(e.clone()) + } } - RuntimeError::Error { data } => { - if let Some(err) = data.downcast_ref::() { - match err { - VMLogicError::HostError(h) => { - VMError::FunctionCallError(FunctionCallError::HostError(h.clone())) - } - VMLogicError::ExternalError(s) => VMError::ExternalError(s.clone()), - VMLogicError::InconsistentStateError(e) => { - VMError::InconsistentStateError(e.clone()) - } - } - } else { - eprintln!( - "Bad error case! Output is non-deterministic {:?} {:?}", - data.type_id(), - self.to_string() - ); - VMError::FunctionCallError(FunctionCallError::WasmTrap { - msg: "unknown".to_string(), - }) + } else if let Some(err) = data.downcast_ref::() { + use wasmer_runtime::ExceptionCode::*; + match err { + Unreachable => { + VMError::FunctionCallError(FunctionCallError::WasmTrap(WasmTrap::Unreachable)) } + IncorrectCallIndirectSignature => VMError::FunctionCallError( + FunctionCallError::WasmTrap(WasmTrap::IncorrectCallIndirectSignature), + ), + MemoryOutOfBounds => VMError::FunctionCallError(FunctionCallError::WasmTrap( + WasmTrap::MemoryOutOfBounds, + )), + CallIndirectOOB => VMError::FunctionCallError(FunctionCallError::WasmTrap( + WasmTrap::CallIndirectOOB, + )), + IllegalArithmetic => VMError::FunctionCallError(FunctionCallError::WasmTrap( + WasmTrap::IllegalArithmetic, + )), + MisalignedAtomicAccess => VMError::FunctionCallError(FunctionCallError::WasmTrap( + WasmTrap::MisalignedAtomicAccess, + )), } + } else { + // TODO: Wasmer provides no way to distingush runtime Internal Wasmer errors or host panics + // (at least for a single-pass backend) + // https://github.com/wasmerio/wasmer/issues/1338 + eprintln!( + "Bad error case! Output might be non-deterministic {:?} {:?}", + data.type_id(), + self.to_string() + ); + VMError::FunctionCallError(FunctionCallError::WasmUnknownError) } } } diff --git a/runtime/near-vm-runner/tests/test_error_cases.rs b/runtime/near-vm-runner/tests/test_error_cases.rs index 29914c64c40..07c65178c7b 100644 --- a/runtime/near-vm-runner/tests/test_error_cases.rs +++ b/runtime/near-vm-runner/tests/test_error_cases.rs @@ -131,9 +131,7 @@ fn test_trap_contract() { make_simple_contract_call(&trap_contract(), b"hello"), ( Some(vm_outcome_with_gas(3856371)), - Some(VMError::FunctionCallError(FunctionCallError::WasmTrap { - msg: "unknown".to_string() - })) + Some(VMError::FunctionCallError(FunctionCallError::WasmUnknownError)) ) ); } @@ -157,9 +155,7 @@ fn test_trap_initializer() { make_simple_contract_call(&trap_initializer(), b"hello"), ( Some(vm_outcome_with_gas(3856371)), - Some(VMError::FunctionCallError(FunctionCallError::WasmTrap { - msg: "unknown".to_string() - })) + Some(VMError::FunctionCallError(FunctionCallError::WasmUnknownError)) ) ); } @@ -257,9 +253,7 @@ fn test_stack_overflow() { make_simple_contract_call(&stack_overflow(), b"hello"), ( Some(vm_outcome_with_gas(63182782464)), - Some(VMError::FunctionCallError(FunctionCallError::WasmTrap { - msg: "unknown".to_string() - })) + Some(VMError::FunctionCallError(FunctionCallError::WasmUnknownError)) ) ); } diff --git a/runtime/near-vm-runner/tests/test_rs_contract.rs b/runtime/near-vm-runner/tests/test_rs_contract.rs index 3bc47ccbb75..6cc6f4dc539 100644 --- a/runtime/near-vm-runner/tests/test_rs_contract.rs +++ b/runtime/near-vm-runner/tests/test_rs_contract.rs @@ -172,10 +172,5 @@ pub fn test_out_of_memory() { &fees, &promise_results, ); - assert_eq!( - result.1, - Some(VMError::FunctionCallError(FunctionCallError::WasmTrap { - msg: "unknown".to_string() - })) - ); + assert_eq!(result.1, Some(VMError::FunctionCallError(FunctionCallError::WasmUnknownError))); }