diff --git a/.changelog/unreleased/improvements/3308-wasmer-upgrade.md b/.changelog/unreleased/improvements/3308-wasmer-upgrade.md new file mode 100644 index 0000000000..b7f43144a2 --- /dev/null +++ b/.changelog/unreleased/improvements/3308-wasmer-upgrade.md @@ -0,0 +1,4 @@ +- Upgrade `wasmer` vm to upstream version `4.3.1`, + moving away from the [forked code based on version + `2.3.0`](https://github.com/heliaxdev/wasmer/tree/255054f7f58b7b4a525f2fee6b9b86422d1ca15b). + ([\#3308](https://github.com/anoma/namada/pull/3308)) \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 81feb55cae..1ce5394e9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,7 +54,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "once_cell", "version_check", ] @@ -411,7 +411,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.32.1", + "object", "rustc-demangle", ] @@ -833,6 +833,15 @@ dependencies = [ "serde", ] +[[package]] +name = "bytesize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +dependencies = [ + "serde", +] + [[package]] name = "bzip2-sys" version = "0.1.11+1.0.8" @@ -962,9 +971,9 @@ dependencies = [ [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -973,18 +982,18 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", - "half", + "half 2.4.1", ] [[package]] @@ -1025,6 +1034,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", + "clap_derive", ] [[package]] @@ -1039,6 +1049,18 @@ dependencies = [ "strsim", ] +[[package]] +name = "clap_derive" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "clap_lex" version = "0.6.0" @@ -1219,7 +1241,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "once_cell", "tiny-keccak", ] @@ -1365,56 +1387,74 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" +checksum = "2a2ab4512dfd3a6f4be184403a195f76e81a8a9f9e6c898e19d2dc3ce20e0115" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" +checksum = "98b022ed2a5913a38839dfbafe6cf135342661293b08049843362df4301261dc" dependencies = [ + "arrayvec", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", + "cranelift-egraph", "cranelift-entity", + "cranelift-isle", "gimli 0.26.2", "log", - "regalloc", + "regalloc2", "smallvec", "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" +checksum = "639307b45434ad112a98f8300c0f0ab085cbefcd767efcdef9ef19d4c0756e74" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" +checksum = "278e52e29c53fcf32431ef08406c295699a70306d05a0715c5b1bf50e33a9ab7" + +[[package]] +name = "cranelift-egraph" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624b54323b06e675293939311943ba82d323bb340468ce1889be5da7932c8d73" +dependencies = [ + "cranelift-entity", + "fxhash", + "hashbrown 0.12.3", + "indexmap 1.9.3", + "log", + "smallvec", +] [[package]] name = "cranelift-entity" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" +checksum = "9a59bcbca89c3f1b70b93ab3cbba5e5e0cbf3e63dadb23c7525cb142e21a9d4c" [[package]] name = "cranelift-frontend" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" +checksum = "0d70abacb8cfef3dc8ff7e8836e9c1d70f7967dfdac824a4cd5e30223415aca6" dependencies = [ "cranelift-codegen", "log", @@ -1422,6 +1462,12 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cranelift-isle" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" + [[package]] name = "crc32fast" version = "1.3.2" @@ -1506,6 +1552,15 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.19" @@ -1636,14 +1691,38 @@ dependencies = [ "serde", ] +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + [[package]] name = "darling" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.3", + "darling_macro 0.20.3", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", ] [[package]] @@ -1659,17 +1738,41 @@ dependencies = [ "syn 2.0.52", ] +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + [[package]] name = "darling_macro" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core", + "darling_core 0.20.3", "quote", "syn 2.0.52", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "data-encoding" version = "2.5.0" @@ -1729,6 +1832,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1889,7 +2023,7 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] @@ -2055,7 +2189,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ - "darling", + "darling 0.20.3", "proc-macro2", "quote", "syn 2.0.52", @@ -2762,9 +2896,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -2865,7 +2999,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.11", - "indexmap 2.1.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util 0.7.10", @@ -2879,21 +3013,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] -name = "hash32" -version = "0.2.1" +name = "half" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ - "byteorder", + "cfg-if", + "crunchy", ] [[package]] -name = "hashbrown" -version = "0.11.2" +name = "hash32" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" dependencies = [ - "ahash 0.7.8", + "byteorder", ] [[package]] @@ -3856,20 +3991,21 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +version = "2.2.4" +source = "git+https://github.com/heliaxdev/indexmap?tag=2.2.4-heliax-1#b5b5b547bd6ab04bbb16e060326a50ddaeb6c909" dependencies = [ + "borsh 1.2.1", "equivalent", "hashbrown 0.14.3", + "serde", ] [[package]] name = "indexmap" -version = "2.2.4" -source = "git+https://github.com/heliaxdev/indexmap?tag=2.2.4-heliax-1#b5b5b547bd6ab04bbb16e060326a50ddaeb6c909" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ - "borsh 1.2.1", "equivalent", "hashbrown 0.14.3", "serde", @@ -3930,13 +4066,13 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", - "windows-sys 0.48.0", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -4159,9 +4295,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.150" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libgit2-sys" @@ -4286,27 +4422,6 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -[[package]] -name = "loupe" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap 1.9.3", - "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 1.0.109", -] - [[package]] name = "mach" version = "0.3.2" @@ -4327,7 +4442,7 @@ dependencies = [ "regex", "serde", "serde_derive", - "serde_yaml", + "serde_yaml 0.7.5", ] [[package]] @@ -4384,7 +4499,7 @@ dependencies = [ "blake2b_simd", "bls12_381", "directories", - "getrandom 0.2.11", + "getrandom 0.2.15", "group", "itertools 0.11.0", "jubjub", @@ -4427,12 +4542,12 @@ dependencies = [ ] [[package]] -name = "memoffset" -version = "0.6.5" +name = "memmap2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ - "autocfg", + "libc", ] [[package]] @@ -4567,7 +4682,6 @@ dependencies = [ "itertools 0.12.1", "k256", "linkme", - "loupe", "masp_primitives", "masp_proofs", "namada_account", @@ -4612,8 +4726,6 @@ dependencies = [ "wasmer", "wasmer-cache", "wasmer-compiler-singlepass", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-vm", "wasmparser 0.107.0", "wasmtimer", @@ -4736,7 +4848,6 @@ dependencies = [ "wasm-instrument", "wasmer", "wasmer-compiler-singlepass", - "wasmer-engine-universal", ] [[package]] @@ -5672,18 +5783,6 @@ dependencies = [ "syn 2.0.52", ] -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap 1.9.3", - "memchr", -] - [[package]] name = "object" version = "0.32.1" @@ -5797,7 +5896,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6624905ddd92e460ff0685567539ed1ac985b2dee4c92c7edcd64fce905b00c" dependencies = [ "ct-codecs", - "getrandom 0.2.11", + "getrandom 0.2.15", "subtle", "zeroize", ] @@ -6046,7 +6145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap 2.2.6", ] [[package]] @@ -6115,9 +6214,9 @@ checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] name = "plotters" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" dependencies = [ "num-traits 0.2.17", "plotters-backend", @@ -6128,15 +6227,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" [[package]] name = "plotters-svg" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" dependencies = [ "plotters-backend", ] @@ -6529,7 +6628,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", ] [[package]] @@ -6618,19 +6717,20 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "libredox", "thiserror", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regalloc2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" dependencies = [ + "fxhash", "log", - "rustc-hash", + "slice-group-by", "smallvec", ] @@ -6774,7 +6874,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "getrandom 0.2.11", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -6799,6 +6899,7 @@ dependencies = [ "bitvec", "bytecheck", "hashbrown 0.12.3", + "indexmap 1.9.3", "ptr_meta", "rend", "rkyv_derive", @@ -7077,6 +7178,7 @@ dependencies = [ "schemars_derive", "serde", "serde_json", + "url", ] [[package]] @@ -7169,6 +7271,12 @@ dependencies = [ "libc", ] +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + [[package]] name = "semver" version = "0.11.0" @@ -7210,9 +7318,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] @@ -7235,6 +7343,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_bytes" version = "0.11.12" @@ -7250,15 +7369,15 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" dependencies = [ - "half", + "half 1.8.2", "serde", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", @@ -7331,6 +7450,19 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "serdect" version = "0.2.0" @@ -7395,6 +7527,16 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + [[package]] name = "shlex" version = "1.3.0" @@ -7453,6 +7595,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + [[package]] name = "slip10_ed25519" version = "0.1.3" @@ -7920,7 +8068,7 @@ dependencies = [ "bytes", "flex-error", "futures", - "getrandom 0.2.11", + "getrandom 0.2.15", "peg", "pin-project", "rand 0.8.5", @@ -8285,6 +8433,18 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + [[package]] name = "toml" version = "0.8.2" @@ -8312,7 +8472,9 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", + "serde", + "serde_spanned", "toml_datetime", "winnow 0.5.25", ] @@ -8323,7 +8485,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -8682,6 +8844,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "untrusted" version = "0.7.1" @@ -8703,6 +8871,7 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -8729,7 +8898,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "serde", ] @@ -8925,46 +9094,38 @@ dependencies = [ [[package]] name = "wasmer" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce4a267a570e121c9375136adefa2c48810273907de9c6817bc19db4d6144bc" dependencies = [ + "bytes", "cfg-if", + "derivative", "indexmap 1.9.3", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", "target-lexicon", "thiserror", + "tracing", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", "wasmer-compiler-cranelift", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", "wat", "winapi", ] -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", -] - [[package]] name = "wasmer-cache" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a40804bcc2567f112003182fc5edc29584da5199c4a1f5a8d6a6e4b65feff0" dependencies = [ "blake3", "hex", @@ -8974,31 +9135,42 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9c23098e86ef1038155684fe50f0c1079a0e2a2e70f115b789df17e6ba98d20" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "lazy_static", + "leb128", + "memmap2 0.5.10", + "more-asserts", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", - "target-lexicon", "thiserror", "wasmer-types", - "wasmparser 0.83.0", + "wasmer-vm", + "wasmparser 0.121.2", + "winapi", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95287b79973ad5f485215733ef9f0d4bb951a6b7e655585d2bd3d4a4ba1253c9" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "gimli 0.26.2", - "loupe", "more-asserts", "rayon", "smallvec", @@ -9006,185 +9178,128 @@ dependencies = [ "tracing", "wasmer-compiler", "wasmer-types", - "wasmer-vm", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d78d59be3ce78ad859e176b88f0d5bec0120ece0684922d7c5da1289e251b1" dependencies = [ "byteorder", "dynasm", "dynasmrt", + "enumset", "gimli 0.26.2", "lazy_static", - "loupe", "more-asserts", "rayon", "smallvec", "wasmer-compiler", "wasmer-types", - "wasmer-vm", -] - -[[package]] -name = "wasmer-derive" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", - "wasmer-vm", -] - -[[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +name = "wasmer-config" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a0f70c177b1c5062cfe0f5308c3317751796fef9403c22a0cd7b4cacd4ccd8" dependencies = [ - "cfg-if", - "enum-iterator", - "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.4", - "rkyv", + "anyhow", + "bytesize", + "derive_builder", + "hex", + "indexmap 2.2.6", + "schemars", + "semver 1.0.20", "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", -] - -[[package]] -name = "wasmer-engine-universal" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "cfg-if", - "enumset", - "leb128", - "loupe", - "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", - "wasmer-types", - "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", + "serde_cbor", + "serde_json", + "serde_yaml 0.9.34+deprecated", "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "toml 0.8.2", + "url", ] [[package]] -name = "wasmer-object" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +name = "wasmer-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48f36aeeecb655f15fdd358bdf6e4cec27df181468fa4226084157e8462bd5e" dependencies = [ - "object 0.28.4", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "wasmer-types" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83cb97b6b20084757a2a8d548dc0d4179c3fe9e2d711740423a1e6aa3f8b9091" dependencies = [ - "backtrace", + "bytecheck", "enum-iterator", + "enumset", + "getrandom 0.2.15", + "hex", "indexmap 1.9.3", - "loupe", + "more-asserts", "rkyv", - "serde", + "sha2 0.10.8", + "target-lexicon", "thiserror", + "webc", + "xxhash-rust", ] [[package]] name = "wasmer-vm" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc1e19d986844b17b927ec8b0c7f3da6a7a2c2cb3b0f8ca5d4cb1a1f71bfb124" dependencies = [ "backtrace", "cc", "cfg-if", "corosensei", + "crossbeam-queue", + "dashmap", + "derivative", "enum-iterator", + "fnv", "indexmap 1.9.3", "lazy_static", "libc", - "loupe", "mach", - "memoffset 0.6.5", + "memoffset 0.9.0", "more-asserts", "region", - "rkyv", "scopeguard", - "serde", "thiserror", - "wasmer-artifact", "wasmer-types", "winapi", ] [[package]] name = "wasmparser" -version = "0.83.0" +version = "0.107.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +dependencies = [ + "indexmap 1.9.3", + "semver 1.0.20", +] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ - "indexmap 1.9.3", + "bitflags 2.5.0", + "indexmap 2.2.6", "semver 1.0.20", ] @@ -9233,6 +9348,36 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webc" +version = "6.0.0-alpha9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b4e8dd987046eede4348d660404ff990412631b7d493f9e547adcf2862cd5" +dependencies = [ + "anyhow", + "base64 0.21.7", + "bytes", + "cfg-if", + "clap", + "document-features", + "flate2", + "indexmap 1.9.3", + "libc", + "once_cell", + "semver 1.0.20", + "serde", + "serde_cbor", + "serde_json", + "sha2 0.10.8", + "shared-buffer", + "tar", + "tempfile", + "thiserror", + "toml 0.7.8", + "url", + "wasmer-config", +] + [[package]] name = "webpki-roots" version = "0.25.3" @@ -9597,6 +9742,12 @@ dependencies = [ "libc", ] +[[package]] +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + [[package]] name = "yaml-rust" version = "0.4.5" diff --git a/Cargo.toml b/Cargo.toml index 5bd30ef595..355f89487d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -189,9 +189,10 @@ tracing-log = "0.2.0" tracing-subscriber = {version = "0.3.7", default-features = false, features = ["env-filter", "fmt"]} wasmparser = "0.107.0" wasm-instrument = {version = "0.4.0", features = ["sign_ext"]} -wasmer = {git = "https://github.com/heliaxdev/wasmer", rev = "255054f7f58b7b4a525f2fee6b9b86422d1ca15b"} -wasmer-compiler-singlepass = { git = "https://github.com/heliaxdev/wasmer", rev = "255054f7f58b7b4a525f2fee6b9b86422d1ca15b" } -wasmer-engine-universal = { git = "https://github.com/heliaxdev/wasmer", rev = "255054f7f58b7b4a525f2fee6b9b86422d1ca15b" } +wasmer = "4.3.1" +wasmer-cache = "4.3.1" +wasmer-compiler-singlepass = "4.3.1" +wasmer-vm = "4.3.1" winapi = "0.3.9" yansi = "0.5.1" zeroize = { version = "1.5.5", features = ["zeroize_derive"] } diff --git a/crates/benches/Cargo.toml b/crates/benches/Cargo.toml index 74bf5960e0..a0e72930cb 100644 --- a/crates/benches/Cargo.toml +++ b/crates/benches/Cargo.toml @@ -58,5 +58,4 @@ tempfile.workspace = true sha2.workspace = true wasm-instrument.workspace = true wasmer-compiler-singlepass.workspace = true -wasmer-engine-universal.workspace = true wasmer.workspace = true diff --git a/crates/benches/wasm_opcodes.rs b/crates/benches/wasm_opcodes.rs index b9ce3bfdb2..ceae69bc51 100644 --- a/crates/benches/wasm_opcodes.rs +++ b/crates/benches/wasm_opcodes.rs @@ -410,12 +410,11 @@ impl Display for WatBuilder { // optimizations that would compile out the benchmarks since most of them are // trivial operations fn get_wasm_store() -> Store { - wasmer::Store::new( - &wasmer_engine_universal::Universal::new( - wasmer_compiler_singlepass::Singlepass::default(), - ) - .engine(), - ) + Store::new(::new( + Box::new(wasmer_compiler_singlepass::Singlepass::default()), + wasmer::Target::default(), + wasmer::sys::Features::default(), + )) } // An empty wasm module to serve as the base reference for all the other @@ -428,12 +427,13 @@ fn empty_module(c: &mut Criterion) { ) "#, ); - let module = Module::new(&get_wasm_store(), module_wat).unwrap(); - let instance = Instance::new(&module, &imports! {}).unwrap(); + let mut store = get_wasm_store(); + let module = Module::new(&store, module_wat).unwrap(); + let instance = Instance::new(&mut store, &module, &imports! {}).unwrap(); let function = instance.exports.get_function(ENTRY_POINT).unwrap(); c.bench_function("empty_module", |b| { - b.iter(|| function.call(&[Value::I32(0)]).unwrap()); + b.iter(|| function.call(&mut store, &[Value::I32(0)]).unwrap()); }); } @@ -441,16 +441,19 @@ fn ops(c: &mut Criterion) { let mut group = c.benchmark_group("wasm_opts"); for builder in bench_functions() { - let module = - Module::new(&get_wasm_store(), builder.to_string()).unwrap(); - let instance = Instance::new(&module, &imports! {}).unwrap(); + let mut store = get_wasm_store(); + let module = Module::new(&store, builder.to_string()).unwrap(); + let instance = + Instance::new(&mut store, &module, &imports! {}).unwrap(); let function = instance.exports.get_function(ENTRY_POINT).unwrap(); group.bench_function(format!("{}", builder.instruction), |b| { if let Unreachable = builder.instruction { - b.iter(|| function.call(&[Value::I32(0)]).unwrap_err()); + b.iter(|| { + function.call(&mut store, &[Value::I32(0)]).unwrap_err() + }); } else { - b.iter(|| function.call(&[Value::I32(0)]).unwrap()); + b.iter(|| function.call(&mut store, &[Value::I32(0)]).unwrap()); } }); } diff --git a/crates/namada/Cargo.toml b/crates/namada/Cargo.toml index 9099bf663e..502966354f 100644 --- a/crates/namada/Cargo.toml +++ b/crates/namada/Cargo.toml @@ -19,14 +19,11 @@ default = ["wasm-runtime"] mainnet = ["namada_core/mainnet"] std = ["namada_sdk/std"] wasm-runtime = [ - "loupe", "parity-wasm", "rayon", "wasm-instrument", "wasmer-cache", "wasmer-compiler-singlepass", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-vm", "wasmer", ] @@ -112,7 +109,6 @@ ethers.workspace = true eyre.workspace = true itertools.workspace = true linkme = {workspace = true, optional = true} -loupe = { version = "0.1.3", optional = true } masp_primitives.workspace = true masp_proofs.workspace = true parity-wasm = { version = "0.45.0", features = ["sign_ext"], optional = true } @@ -132,11 +128,9 @@ tracing.workspace = true uint = "0.9.5" wasm-instrument = { workspace = true, optional = true } wasmer = { workspace = true, optional = true } -wasmer-cache = { git = "https://github.com/heliaxdev/wasmer", rev = "255054f7f58b7b4a525f2fee6b9b86422d1ca15b", optional = true } +wasmer-cache = { workspace = true, optional = true } wasmer-compiler-singlepass = { workspace = true, optional = true } -wasmer-engine-dylib = { git = "https://github.com/heliaxdev/wasmer", rev = "255054f7f58b7b4a525f2fee6b9b86422d1ca15b", optional = true } -wasmer-engine-universal = { workspace = true, optional = true } -wasmer-vm = { git = "https://github.com/heliaxdev/wasmer", rev = "255054f7f58b7b4a525f2fee6b9b86422d1ca15b", optional = true } +wasmer-vm = { workspace = true, optional = true } wasmparser.workspace = true [target.'cfg(not(target_family = "wasm"))'.dependencies] diff --git a/crates/namada/src/vm/host_env.rs b/crates/namada/src/vm/host_env.rs index ed09242f16..8984b4ac5f 100644 --- a/crates/namada/src/vm/host_env.rs +++ b/crates/namada/src/vm/host_env.rs @@ -1,5 +1,6 @@ //! Virtual machine's host environment exposes functions that may be called from //! within a virtual machine. + use std::cell::RefCell; use std::collections::BTreeSet; use std::fmt::Debug; @@ -92,7 +93,6 @@ pub type TxResult = std::result::Result; /// A transaction's host environment pub struct TxVmEnv where - MEM: VmMemory, D: DB + for<'iter> DBIter<'iter>, H: StorageHasher, CA: WasmCacheAccess, @@ -150,7 +150,6 @@ where impl TxVmEnv where - MEM: VmMemory, D: DB + for<'iter> DBIter<'iter>, H: StorageHasher, CA: WasmCacheAccess, @@ -228,7 +227,7 @@ where impl Clone for TxVmEnv where - MEM: VmMemory, + MEM: Clone, D: DB + for<'iter> DBIter<'iter>, H: StorageHasher, CA: WasmCacheAccess, @@ -306,7 +305,6 @@ where /// A validity predicate's host environment pub struct VpVmEnv where - MEM: VmMemory, D: DB + for<'iter> DBIter<'iter>, H: StorageHasher, EVAL: VpEvaluator, @@ -392,7 +390,6 @@ impl VpVmEnv where D: DB + for<'iter> DBIter<'iter>, H: StorageHasher, - MEM: VmMemory, EVAL: VpEvaluator, CA: WasmCacheAccess, { @@ -452,7 +449,7 @@ where impl Clone for VpVmEnv where - MEM: VmMemory, + MEM: Clone, D: DB + for<'iter> DBIter<'iter>, H: StorageHasher, EVAL: VpEvaluator, @@ -590,7 +587,7 @@ where /// Add a gas cost incured in a transaction pub fn tx_charge_gas( - env: &TxVmEnv, + env: &mut TxVmEnv, used_gas: u64, ) -> TxResult<()> where @@ -614,7 +611,7 @@ where /// Called from VP wasm to request to use the given gas amount pub fn vp_charge_gas( - env: &VpVmEnv, + env: &mut VpVmEnv, used_gas: u64, ) -> vp_host_fns::EnvResult<()> where @@ -631,7 +628,7 @@ where /// Storage `has_key` function exposed to the wasm VM Tx environment. It will /// try to check the write log first and if no entry found then the storage. pub fn tx_has_key( - env: &TxVmEnv, + env: &mut TxVmEnv, key_ptr: u64, key_len: u64, ) -> TxResult @@ -663,7 +660,7 @@ where /// Returns `-1` when the key is not present, or the length of the data when /// the key is present (the length may be `0`). pub fn tx_read( - env: &TxVmEnv, + env: &mut TxVmEnv, key_ptr: u64, key_len: u64, ) -> TxResult @@ -706,7 +703,7 @@ where /// Returns `-1` when the key is not present, or the length of the data when /// the key is present (the length may be `0`). pub fn tx_read_temp( - env: &TxVmEnv, + env: &mut TxVmEnv, key_ptr: u64, key_len: u64, ) -> TxResult @@ -752,7 +749,7 @@ where /// any) back to the guest, the second step reads the value from cache into a /// pre-allocated buffer with the obtained size. pub fn tx_result_buffer( - env: &TxVmEnv, + env: &mut TxVmEnv, result_ptr: u64, ) -> TxResult<()> where @@ -776,7 +773,7 @@ where /// It will try to get an iterator from the storage and return the corresponding /// ID of the iterator, ordered by storage keys. pub fn tx_iter_prefix( - env: &TxVmEnv, + env: &mut TxVmEnv, prefix_ptr: u64, prefix_len: u64, ) -> TxResult @@ -816,7 +813,7 @@ where /// Returns `-1` when the key is not present, or the length of the data when /// the key is present (the length may be `0`). pub fn tx_iter_next( - env: &TxVmEnv, + env: &mut TxVmEnv, iter_id: u64, ) -> TxResult where @@ -827,25 +824,25 @@ where { tracing::debug!("tx_iter_next iter_id {}", iter_id,); - let state = env.state(); let iterators = unsafe { env.ctx.iterators.get_mut() }; let iter_id = PrefixIteratorId::new(iter_id); while let Some((key, val, iter_gas)) = iterators.next(iter_id) { - let (log_val, log_gas) = state - .write_log() - .read( - &Key::parse(key.clone()) - .map_err(TxRuntimeError::StorageDataError)?, - ) - .into_storage_result()?; + let (log_val, log_gas) = { + let state = env.state(); + let (log_val, log_gas) = state + .write_log() + .read( + &Key::parse(key.clone()) + .map_err(TxRuntimeError::StorageDataError)?, + ) + .into_storage_result()?; + (log_val.cloned(), log_gas) + }; tx_charge_gas::(env, checked!(iter_gas + log_gas)?)?; match log_val { - Some(write_log::StorageModification::Write { ref value }) => { - let key_val = borsh::to_vec(&KeyVal { - key, - val: value.clone(), - }) - .map_err(TxRuntimeError::EncodingError)?; + Some(write_log::StorageModification::Write { value }) => { + let key_val = borsh::to_vec(&KeyVal { key, val: value }) + .map_err(TxRuntimeError::EncodingError)?; let len: i64 = key_val .len() .try_into() @@ -881,7 +878,7 @@ where /// Storage write function exposed to the wasm VM Tx environment. The given /// key/value will be written to the write log. pub fn tx_write( - env: &TxVmEnv, + env: &mut TxVmEnv, key_ptr: u64, key_len: u64, val_ptr: u64, @@ -923,7 +920,7 @@ where /// given key/value will be written only to the write log. It will be never /// written to the storage. pub fn tx_write_temp( - env: &TxVmEnv, + env: &mut TxVmEnv, key_ptr: u64, key_len: u64, val_ptr: u64, @@ -961,7 +958,7 @@ where } fn check_address_existence( - env: &TxVmEnv, + env: &mut TxVmEnv, key: &Key, ) -> TxResult<()> where @@ -1008,7 +1005,7 @@ where /// Storage delete function exposed to the wasm VM Tx environment. The given /// key/value will be written as deleted to the write log. pub fn tx_delete( - env: &TxVmEnv, + env: &mut TxVmEnv, key_ptr: u64, key_len: u64, ) -> TxResult<()> @@ -1038,7 +1035,7 @@ where /// Expose the functionality to emit events to the wasm VM's Tx environment. /// An emitted event will land in the write log. pub fn tx_emit_event( - env: &TxVmEnv, + env: &mut TxVmEnv, event_ptr: u64, event_len: u64, ) -> TxResult<()> @@ -1065,7 +1062,7 @@ where /// Expose the functionality to query events from the wasm VM's Tx environment. pub fn tx_get_events( - env: &TxVmEnv, + env: &mut TxVmEnv, event_type_ptr: u64, event_type_len: u64, ) -> TxResult @@ -1106,7 +1103,7 @@ where /// Returns `-1` when the key is not present, or the length of the data when /// the key is present (the length may be `0`). pub fn vp_read_pre( - env: &VpVmEnv, + env: &mut VpVmEnv, key_ptr: u64, key_len: u64, ) -> vp_host_fns::EnvResult @@ -1156,7 +1153,7 @@ where /// Returns `-1` when the key is not present, or the length of the data when /// the key is present (the length may be `0`). pub fn vp_read_post( - env: &VpVmEnv, + env: &mut VpVmEnv, key_ptr: u64, key_len: u64, ) -> vp_host_fns::EnvResult @@ -1201,7 +1198,7 @@ where /// Returns `-1` when the key is not present, or the length of the data when /// the key is present (the length may be `0`). pub fn vp_read_temp( - env: &VpVmEnv, + env: &mut VpVmEnv, key_ptr: u64, key_len: u64, ) -> vp_host_fns::EnvResult @@ -1249,7 +1246,7 @@ where /// any) back to the guest, the second step reads the value from cache into a /// pre-allocated buffer with the obtained size. pub fn vp_result_buffer( - env: &VpVmEnv, + env: &mut VpVmEnv, result_ptr: u64, ) -> vp_host_fns::EnvResult<()> where @@ -1274,7 +1271,7 @@ where /// Storage `has_key` in prior state (before tx execution) function exposed to /// the wasm VM VP environment. It will try to read from the storage. pub fn vp_has_key_pre( - env: &VpVmEnv, + env: &mut VpVmEnv, key_ptr: u64, key_len: u64, ) -> vp_host_fns::EnvResult @@ -1305,7 +1302,7 @@ where /// to the wasm VM VP environment. It will try to check the write log first and /// if no entry found then the storage. pub fn vp_has_key_post( - env: &VpVmEnv, + env: &mut VpVmEnv, key_ptr: u64, key_len: u64, ) -> vp_host_fns::EnvResult @@ -1337,7 +1334,7 @@ where /// the storage and return the corresponding ID of the iterator, ordered by /// storage keys. pub fn vp_iter_prefix_pre( - env: &VpVmEnv, + env: &mut VpVmEnv, prefix_ptr: u64, prefix_len: u64, ) -> vp_host_fns::EnvResult @@ -1376,7 +1373,7 @@ where /// the storage and return the corresponding ID of the iterator, ordered by /// storage keys. pub fn vp_iter_prefix_post( - env: &VpVmEnv, + env: &mut VpVmEnv, prefix_ptr: u64, prefix_len: u64, ) -> vp_host_fns::EnvResult @@ -1417,7 +1414,7 @@ where /// Returns `-1` when the key is not present, or the length of the data when /// the key is present (the length may be `0`). pub fn vp_iter_next( - env: &VpVmEnv, + env: &mut VpVmEnv, iter_id: u64, ) -> vp_host_fns::EnvResult where @@ -1450,7 +1447,7 @@ where /// Verifier insertion function exposed to the wasm VM Tx environment. pub fn tx_insert_verifier( - env: &TxVmEnv, + env: &mut TxVmEnv, addr_ptr: u64, addr_len: u64, ) -> TxResult<()> @@ -1484,7 +1481,7 @@ where /// Update a validity predicate function exposed to the wasm VM Tx environment pub fn tx_update_validity_predicate( - env: &TxVmEnv, + env: &mut TxVmEnv, addr_ptr: u64, addr_len: u64, code_hash_ptr: u64, @@ -1535,7 +1532,7 @@ where /// Initialize a new account established address. #[allow(clippy::too_many_arguments)] pub fn tx_init_account( - env: &TxVmEnv, + env: &mut TxVmEnv, code_hash_ptr: u64, code_hash_len: u64, code_tag_ptr: u64, @@ -1591,7 +1588,7 @@ where /// Getting the chain ID function exposed to the wasm VM Tx environment. pub fn tx_get_chain_id( - env: &TxVmEnv, + env: &mut TxVmEnv, result_ptr: u64, ) -> TxResult<()> where @@ -1614,7 +1611,7 @@ where /// environment. The height is that of the block to which the current /// transaction is being applied. pub fn tx_get_block_height( - env: &TxVmEnv, + env: &mut TxVmEnv, ) -> TxResult where MEM: VmMemory, @@ -1632,7 +1629,7 @@ where /// environment. The index is that of the transaction being applied /// in the current block. pub fn tx_get_tx_index( - env: &TxVmEnv, + env: &mut TxVmEnv, ) -> TxResult where MEM: VmMemory, @@ -1654,7 +1651,7 @@ where /// environment. The height is that of the block to which the current /// transaction is being applied. pub fn vp_get_tx_index( - env: &VpVmEnv, + env: &mut VpVmEnv, ) -> vp_host_fns::EnvResult where MEM: VmMemory, @@ -1673,7 +1670,7 @@ where /// environment. The epoch is that of the block to which the current /// transaction is being applied. pub fn tx_get_block_epoch( - env: &TxVmEnv, + env: &mut TxVmEnv, ) -> TxResult where MEM: VmMemory, @@ -1689,7 +1686,7 @@ where /// Get predecessor epochs function exposed to the wasm VM Tx environment. pub fn tx_get_pred_epochs( - env: &TxVmEnv, + env: &mut TxVmEnv, ) -> TxResult where MEM: VmMemory, @@ -1716,7 +1713,7 @@ where /// Get the native token's address pub fn tx_get_native_token( - env: &TxVmEnv, + env: &mut TxVmEnv, result_ptr: u64, ) -> TxResult<()> where @@ -1744,7 +1741,7 @@ where /// Getting the block header function exposed to the wasm VM Tx environment. pub fn tx_get_block_header( - env: &TxVmEnv, + env: &mut TxVmEnv, height: u64, ) -> TxResult where @@ -1776,7 +1773,7 @@ where /// Getting the chain ID function exposed to the wasm VM VP environment. pub fn vp_get_chain_id( - env: &VpVmEnv, + env: &mut VpVmEnv, result_ptr: u64, ) -> vp_host_fns::EnvResult<()> where @@ -1800,7 +1797,7 @@ where /// environment. The height is that of the block to which the current /// transaction is being applied. pub fn vp_get_block_height( - env: &VpVmEnv, + env: &mut VpVmEnv, ) -> vp_host_fns::EnvResult where MEM: VmMemory, @@ -1817,7 +1814,7 @@ where /// Getting the block header function exposed to the wasm VM VP environment. pub fn vp_get_block_header( - env: &VpVmEnv, + env: &mut VpVmEnv, height: u64, ) -> vp_host_fns::EnvResult where @@ -1850,7 +1847,7 @@ where /// Getting the transaction hash function exposed to the wasm VM VP environment. pub fn vp_get_tx_code_hash( - env: &VpVmEnv, + env: &mut VpVmEnv, result_ptr: u64, ) -> vp_host_fns::EnvResult<()> where @@ -1883,7 +1880,7 @@ where /// environment. The epoch is that of the block to which the current /// transaction is being applied. pub fn vp_get_block_epoch( - env: &VpVmEnv, + env: &mut VpVmEnv, ) -> vp_host_fns::EnvResult where MEM: VmMemory, @@ -1900,7 +1897,7 @@ where /// Get predecessor epochs function exposed to the wasm VM VP environment. pub fn vp_get_pred_epochs( - env: &VpVmEnv, + env: &mut VpVmEnv, ) -> vp_host_fns::EnvResult where MEM: VmMemory, @@ -1924,7 +1921,7 @@ where /// Expose the functionality to query events from the wasm VM's VP environment. pub fn vp_get_events( - env: &VpVmEnv, + env: &mut VpVmEnv, event_type_ptr: u64, event_type_len: u64, ) -> vp_host_fns::EnvResult @@ -1958,7 +1955,7 @@ where /// performance #[allow(clippy::too_many_arguments)] pub fn vp_verify_tx_section_signature( - env: &VpVmEnv, + env: &mut VpVmEnv, hash_list_ptr: u64, hash_list_len: u64, public_keys_map_ptr: u64, @@ -2040,7 +2037,7 @@ where /// printed at the [`tracing::Level::INFO`]. This function is for development /// only. pub fn tx_log_string( - env: &TxVmEnv, + env: &mut TxVmEnv, str_ptr: u64, str_len: u64, ) -> TxResult<()> @@ -2060,7 +2057,7 @@ where /// Validate a VP WASM code hash in a tx environment. fn tx_validate_vp_code_hash( - env: &TxVmEnv, + env: &mut TxVmEnv, code_hash: &[u8], code_tag: &Option, ) -> TxResult<()> @@ -2072,12 +2069,12 @@ where { let code_hash = Hash::try_from(code_hash) .map_err(|e| TxRuntimeError::InvalidVpCodeHash(e.to_string()))?; - let state = env.state(); // First check that code hash corresponds to the code tag if it is present if let Some(tag) = code_tag { let hash_key = Key::wasm_hash(tag); - let (result, gas) = state + let (result, gas) = env + .state() .db_read(&hash_key) .map_err(TxRuntimeError::StateError)?; tx_charge_gas::(env, gas)?; @@ -2108,7 +2105,7 @@ where // Then check that the corresponding VP code does indeed exist let code_key = Key::wasm_code(&code_hash); - let is_present = state.has_key(&code_key)?; + let is_present = env.state().has_key(&code_key)?; if !is_present { return Err(TxRuntimeError::InvalidVpCodeHash( "The corresponding VP code doesn't exist".to_string(), @@ -2118,8 +2115,9 @@ where } /// Set the sentinel for an invalid tx section commitment -pub fn tx_set_commitment_sentinel(env: &TxVmEnv) -where +pub fn tx_set_commitment_sentinel( + env: &mut TxVmEnv, +) where D: 'static + DB + for<'iter> DBIter<'iter>, H: 'static + StorageHasher, MEM: VmMemory, @@ -2132,7 +2130,7 @@ where /// Verify a transaction signature #[allow(clippy::too_many_arguments)] pub fn tx_verify_tx_section_signature( - env: &TxVmEnv, + env: &mut TxVmEnv, hash_list_ptr: u64, hash_list_len: u64, public_keys_map_ptr: u64, @@ -2204,7 +2202,7 @@ where /// Appends the new note commitments to the tree in storage pub fn tx_update_masp_note_commitment_tree( - env: &TxVmEnv, + env: &mut TxVmEnv, transaction_ptr: u64, transaction_len: u64, ) -> TxResult @@ -2241,7 +2239,7 @@ where /// Yield a byte array value from the guest. pub fn tx_yield_value( - env: &TxVmEnv, + env: &mut TxVmEnv, buf_ptr: u64, buf_len: u64, ) -> TxResult<()> @@ -2263,7 +2261,7 @@ where /// Evaluate a validity predicate with the given input data. pub fn vp_eval( - env: &VpVmEnv, + env: &mut VpVmEnv, vp_code_hash_ptr: u64, vp_code_hash_len: u64, input_data_ptr: u64, @@ -2315,7 +2313,7 @@ where /// Get the native token's address pub fn vp_get_native_token( - env: &VpVmEnv, + env: &mut VpVmEnv, result_ptr: u64, ) -> vp_host_fns::EnvResult<()> where @@ -2340,7 +2338,7 @@ where /// printed at the [`tracing::Level::INFO`]. This function is for development /// only. pub fn vp_log_string( - env: &VpVmEnv, + env: &mut VpVmEnv, str_ptr: u64, str_len: u64, ) -> vp_host_fns::EnvResult<()> @@ -2361,7 +2359,7 @@ where /// Yield a byte array value from the guest. pub fn vp_yield_value( - env: &VpVmEnv, + env: &mut VpVmEnv, buf_ptr: u64, buf_len: u64, ) -> vp_host_fns::EnvResult<()> @@ -2385,6 +2383,8 @@ where /// A helper module for testing #[cfg(feature = "testing")] pub mod testing { + use std::rc::Rc; + use super::*; use crate::vm::memory::testing::NativeMemory; use crate::vm::wasm::memory::WasmMemory; @@ -2451,15 +2451,14 @@ pub mod testing { S: State, CA: WasmCacheAccess, { - let store = crate::vm::wasm::compilation_cache::common::store(); - let initial_memory = - crate::vm::wasm::memory::prepare_tx_memory(&store).unwrap(); - let mut wasm_memory = WasmMemory::default(); - wasm_memory.inner.initialize(initial_memory); + let mut store = crate::vm::wasm::compilation_cache::common::store(); + + let wasm_memory = + crate::vm::wasm::memory::prepare_tx_memory(&mut store).unwrap(); let (write_log, in_mem, db) = state.split_borrow(); - TxVmEnv::new( - wasm_memory, + let mut env = TxVmEnv::new( + WasmMemory::new(Rc::new(RefCell::new(store))), write_log, in_mem, db, @@ -2476,7 +2475,10 @@ pub mod testing { vp_wasm_cache, #[cfg(feature = "wasm-runtime")] tx_wasm_cache, - ) + ); + + env.memory.init_from(&wasm_memory); + env } /// Setup a validity predicate environment diff --git a/crates/namada/src/vm/memory.rs b/crates/namada/src/vm/memory.rs index e55117726c..fe53a6c832 100644 --- a/crates/namada/src/vm/memory.rs +++ b/crates/namada/src/vm/memory.rs @@ -9,28 +9,28 @@ pub trait VmMemory: Clone + Send + Sync { /// Returns bytes read from memory together with the associated gas cost. fn read_bytes( - &self, + &mut self, offset: u64, len: usize, ) -> Result<(Vec, u64), Self::Error>; /// Write bytes to memory. Returns the gas cost. fn write_bytes( - &self, + &mut self, offset: u64, bytes: impl AsRef<[u8]>, ) -> Result; /// Returns string read from memory together with the associated gas cost. fn read_string( - &self, + &mut self, offset: u64, len: usize, ) -> Result<(String, u64), Self::Error>; /// Write string to memory. Returns the gas cost. fn write_string( - &self, + &mut self, offset: u64, string: String, ) -> Result; @@ -55,7 +55,7 @@ pub mod testing { type Error = Infallible; fn read_bytes( - &self, + &mut self, offset: u64, len: usize, ) -> Result<(Vec, u64)> { @@ -64,7 +64,7 @@ pub mod testing { } fn write_bytes( - &self, + &mut self, offset: u64, bytes: impl AsRef<[u8]>, ) -> Result { @@ -77,7 +77,7 @@ pub mod testing { } fn read_string( - &self, + &mut self, offset: u64, len: usize, ) -> Result<(String, u64)> { @@ -88,7 +88,7 @@ pub mod testing { Ok((string, 0)) } - fn write_string(&self, offset: u64, string: String) -> Result { + fn write_string(&mut self, offset: u64, string: String) -> Result { let bytes = string.as_bytes(); let len = bytes.len(); let target = diff --git a/crates/namada/src/vm/wasm/compilation_cache/common.rs b/crates/namada/src/vm/wasm/compilation_cache/common.rs index b23d79e50c..146d03df3a 100644 --- a/crates/namada/src/vm/wasm/compilation_cache/common.rs +++ b/crates/namada/src/vm/wasm/compilation_cache/common.rs @@ -1,8 +1,7 @@ //! WASM compilation cache. +//! //! The cache is backed by in-memory LRU cache with configurable size -//! limit and a file system cache of compiled modules (either to dynamic libs -//! compiled via the `dylib` module, or serialized modules compiled via the -//! `universal` module). +//! limit and a file system cache of serialized modules. use std::collections::hash_map::RandomState; use std::fs; @@ -496,9 +495,6 @@ fn hash_of_code(code: impl AsRef<[u8]>) -> Hash { fn compile( code: impl AsRef<[u8]>, ) -> Result<(Module, Store), wasm::run::Error> { - // There's an issue with dylib compiler on mac in linker and on linux - // with the dylib's store loading the dylib from a file, so we're caching a - // module serialized to bytes instead for now. universal::compile(code).map_err(wasm::run::Error::CompileError) } @@ -581,39 +577,6 @@ mod universal { } } -/// A dynamic library engine compilation. -mod dylib { - use super::*; - - #[allow(dead_code)] - #[cfg(windows)] - pub const FILE_EXT: &str = "dll"; - #[allow(dead_code)] - #[cfg(all(not(unix), target_os = "macos"))] - pub const FILE_EXT: &str = "dylib"; - #[allow(dead_code)] - #[cfg(all(unix, not(target_os = "macos")))] - pub const FILE_EXT: &str = "so"; - - /// Compile wasm to a dynamic library - #[allow(dead_code)] - pub fn compile( - code: impl AsRef<[u8]>, - ) -> Result<(Module, Store), wasmer::CompileError> { - let store = store(); - let module = Module::new(&store, code.as_ref())?; - Ok((module, store)) - } - - /// Dylib WASM store - #[allow(dead_code)] - pub fn store() -> Store { - let compiler = wasmer_compiler_singlepass::Singlepass::default(); - let engine = wasmer_engine_dylib::Dylib::new(compiler).engine(); - Store::new_with_tunables(&engine, memory::vp_limit()) - } -} - /// Testing helpers #[cfg(any(test, feature = "testing"))] pub mod testing { @@ -1063,10 +1026,6 @@ mod test { /// Get the WASM code bytes, its hash and find the compiled module's size fn load_wasm(file: impl AsRef) -> WasmWithMeta { - // When `WeightScale` calls `loupe::size_of_val` in the cache, for some - // reason it returns 8 bytes more than the same call in here. - let _extra_bytes = 8; - let file = file.as_ref(); let code = fs::read(file).unwrap(); let hash = hash_of_code(&code); diff --git a/crates/namada/src/vm/wasm/host_env.rs b/crates/namada/src/vm/wasm/host_env.rs index 1dc86a9a09..0d8d740693 100644 --- a/crates/namada/src/vm/wasm/host_env.rs +++ b/crates/namada/src/vm/wasm/host_env.rs @@ -4,86 +4,58 @@ //! imports, so they can be called from inside the wasm. use namada_state::{DBIter, StorageHasher, DB}; -use wasmer::{ - Function, HostEnvInitError, ImportObject, Instance, Store, WasmerEnv, -}; +use wasmer::{Function, FunctionEnv, Imports}; use crate::vm::host_env::{TxVmEnv, VpEvaluator, VpVmEnv}; use crate::vm::wasm::memory::WasmMemory; use crate::vm::{host_env, WasmCacheAccess}; -impl WasmerEnv for TxVmEnv -where - D: DB + for<'iter> DBIter<'iter> + 'static, - H: StorageHasher + 'static, - CA: WasmCacheAccess + 'static, -{ - fn init_with_instance( - &mut self, - instance: &Instance, - ) -> std::result::Result<(), HostEnvInitError> { - self.memory.init_env_memory(&instance.exports) - } -} - -impl WasmerEnv for VpVmEnv -where - D: DB + for<'iter> DBIter<'iter> + 'static, - H: StorageHasher + 'static, - EVAL: VpEvaluator + 'static, - CA: WasmCacheAccess + 'static, -{ - fn init_with_instance( - &mut self, - instance: &Instance, - ) -> std::result::Result<(), HostEnvInitError> { - self.memory.init_env_memory(&instance.exports) - } -} - /// Prepare imports (memory and host functions) exposed to the vm guest running /// transaction code #[allow(clippy::too_many_arguments)] pub fn tx_imports( - wasm_store: &Store, + wasm_store: &mut impl wasmer::AsStoreMut, env: TxVmEnv, -) -> ImportObject +) -> Imports where D: DB + for<'iter> DBIter<'iter> + 'static, H: StorageHasher + 'static, CA: WasmCacheAccess + 'static, { + let env = FunctionEnv::new(wasm_store, env); + wasmer::imports! { - // default namespace + // Default namespace "env" => { - // Wasm middleware gas injection hook - "gas" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_charge_gas), - "namada_tx_read" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_read), - "namada_tx_read_temp" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_read_temp), - "namada_tx_result_buffer" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_result_buffer), - "namada_tx_has_key" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_has_key), - "namada_tx_write" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_write), - "namada_tx_write_temp" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_write_temp), - "namada_tx_delete" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_delete), - "namada_tx_iter_prefix" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_iter_prefix), - "namada_tx_iter_next" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_iter_next), - "namada_tx_insert_verifier" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_insert_verifier), - "namada_tx_update_validity_predicate" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_update_validity_predicate), - "namada_tx_init_account" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_init_account), - "namada_tx_emit_event" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_emit_event), - "namada_tx_get_events" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_get_events), - "namada_tx_get_chain_id" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_get_chain_id), - "namada_tx_get_tx_index" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_get_tx_index), - "namada_tx_get_block_height" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_get_block_height), - "namada_tx_get_block_header" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_get_block_header), - "namada_tx_get_block_epoch" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_get_block_epoch), - "namada_tx_get_pred_epochs" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_get_pred_epochs), - "namada_tx_get_native_token" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_get_native_token), - "namada_tx_log_string" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_log_string), - "namada_tx_set_commitment_sentinel" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_set_commitment_sentinel), - "namada_tx_verify_tx_section_signature" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_verify_tx_section_signature), - "namada_tx_update_masp_note_commitment_tree" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_update_masp_note_commitment_tree), - "namada_tx_yield_value" => Function::new_native_with_env(wasm_store, env.clone(), host_env::tx_yield_value), + // Gas injection hook + "gas" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_1(host_env::tx_charge_gas)), + // Tx Host functions + "namada_tx_delete" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_delete)), + "namada_tx_emit_event" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_emit_event)), + "namada_tx_get_block_epoch" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_0(host_env::tx_get_block_epoch)), + "namada_tx_get_block_header" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_1(host_env::tx_get_block_header)), + "namada_tx_get_block_height" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_0(host_env::tx_get_block_height)), + "namada_tx_get_chain_id" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_1(host_env::tx_get_chain_id)), + "namada_tx_get_events" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_get_events)), + "namada_tx_get_native_token" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_1(host_env::tx_get_native_token)), + "namada_tx_get_pred_epochs" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_0(host_env::tx_get_pred_epochs)), + "namada_tx_get_tx_index" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_0(host_env::tx_get_tx_index)), + "namada_tx_has_key" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_has_key)), + "namada_tx_init_account" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_7(host_env::tx_init_account)), + "namada_tx_insert_verifier" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_insert_verifier)), + "namada_tx_iter_next" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_1(host_env::tx_iter_next)), + "namada_tx_iter_prefix" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_iter_prefix)), + "namada_tx_log_string" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_log_string)), + "namada_tx_read" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_read)), + "namada_tx_read_temp" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_read_temp)), + "namada_tx_result_buffer" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_1(host_env::tx_result_buffer)), + "namada_tx_set_commitment_sentinel" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_0(host_env::tx_set_commitment_sentinel)), + "namada_tx_update_masp_note_commitment_tree" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_update_masp_note_commitment_tree)), + "namada_tx_update_validity_predicate" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_6(host_env::tx_update_validity_predicate)), + "namada_tx_verify_tx_section_signature" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_7(host_env::tx_verify_tx_section_signature)), + "namada_tx_write" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_4(host_env::tx_write)), + "namada_tx_write_temp" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_4(host_env::tx_write_temp)), + "namada_tx_yield_value" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_yield_value)), }, } } @@ -91,42 +63,347 @@ where /// Prepare imports (memory and host functions) exposed to the vm guest running /// validity predicate code pub fn vp_imports( - wasm_store: &Store, + wasm_store: &mut impl wasmer::AsStoreMut, env: VpVmEnv, -) -> ImportObject +) -> Imports where D: DB + for<'iter> DBIter<'iter> + 'static, H: StorageHasher + 'static, EVAL: VpEvaluator + 'static, CA: WasmCacheAccess + 'static, { + let env = FunctionEnv::new(wasm_store, env); + wasmer::imports! { - // default namespace + // Default namespace "env" => { - // Wasm middleware gas injection hook - "gas" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_charge_gas), - "namada_vp_read_pre" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_read_pre), - "namada_vp_read_post" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_read_post), - "namada_vp_read_temp" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_read_temp), - "namada_vp_result_buffer" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_result_buffer), - "namada_vp_has_key_pre" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_has_key_pre), - "namada_vp_has_key_post" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_has_key_post), - "namada_vp_iter_prefix_pre" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_iter_prefix_pre), - "namada_vp_iter_prefix_post" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_iter_prefix_pre), - "namada_vp_iter_next" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_iter_next), - "namada_vp_get_chain_id" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_get_chain_id), - "namada_vp_get_tx_index" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_get_tx_index), - "namada_vp_get_block_height" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_get_block_height), - "namada_vp_get_block_header" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_get_block_header), - "namada_vp_get_tx_code_hash" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_get_tx_code_hash), - "namada_vp_get_block_epoch" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_get_block_epoch), - "namada_vp_get_pred_epochs" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_get_pred_epochs), - "namada_vp_get_events" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_get_events), - "namada_vp_yield_value" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_yield_value), - "namada_vp_verify_tx_section_signature" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_verify_tx_section_signature), - "namada_vp_eval" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_eval), - "namada_vp_get_native_token" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_get_native_token), - "namada_vp_log_string" => Function::new_native_with_env(wasm_store, env.clone(), host_env::vp_log_string), + // Gas injection hook + "gas" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_1(host_env::vp_charge_gas)), + // VP Host functions + "namada_vp_eval" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_4(host_env::vp_eval)), + "namada_vp_get_block_header" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_1(host_env::vp_get_block_header)), + "namada_vp_get_block_height" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_0(host_env::vp_get_block_height)), + "namada_vp_get_chain_id" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_1(host_env::vp_get_chain_id)), + "namada_vp_get_events" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_get_events)), + "namada_vp_get_native_token" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_1(host_env::vp_get_native_token)), + "namada_vp_get_pred_epochs" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_0(host_env::vp_get_pred_epochs)), + "namada_vp_get_tx_code_hash" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_1(host_env::vp_get_tx_code_hash)), + "namada_vp_get_tx_index" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_0(host_env::vp_get_tx_index)), + "namada_vp_has_key_post" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_has_key_post)), + "namada_vp_has_key_pre" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_has_key_pre)), + "namada_vp_iter_next" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_1(host_env::vp_iter_next)), + "namada_vp_iter_prefix_post" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_iter_prefix_post)), + "namada_vp_iter_prefix_pre" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_iter_prefix_pre)), + "namada_vp_log_string" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_log_string)), + "namada_vp_read_post" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_read_post)), + "namada_vp_read_pre" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_read_pre)), + "namada_vp_read_temp" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_read_temp)), + "namada_vp_result_buffer" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_1(host_env::vp_result_buffer)), + "namada_vp_verify_tx_section_signature" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_9(host_env::vp_verify_tx_section_signature)), + "namada_vp_yield_value" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_yield_value)), }, } } + +// TODO(namada#3313): Attempt to reduce the boilerplate of this module with +// macros, traits or something of this sort... +mod wrap_tx { + //! Wrap tx host functions with any number of arguments in a callback + //! that can be passed to [`wasmer`], to be used by the guest wasm code. + + #![allow(missing_docs)] + + use namada_state::{DBIter, StorageHasher, DB}; + use wasmer::FunctionEnvMut; + + use crate::vm::host_env::TxVmEnv; + use crate::vm::wasm::memory::WasmMemory; + use crate::vm::WasmCacheAccess; + + pub(super) fn _0( + f: F, + ) -> impl Fn(FunctionEnvMut<'_, TxVmEnv>) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + F: Fn(&mut TxVmEnv) -> RET, + { + move |mut env| f(env.data_mut()) + } + + pub(super) fn _1( + f: F, + ) -> impl Fn(FunctionEnvMut<'_, TxVmEnv>, ARG0) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + F: Fn(&mut TxVmEnv, ARG0) -> RET, + { + move |mut env, arg0| f(env.data_mut(), arg0) + } + + pub(super) fn _2( + f: F, + ) -> impl Fn(FunctionEnvMut<'_, TxVmEnv>, ARG0, ARG1) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + F: Fn(&mut TxVmEnv, ARG0, ARG1) -> RET, + { + move |mut env, arg0, arg1| f(env.data_mut(), arg0, arg1) + } + + pub(super) fn _4( + f: F, + ) -> impl Fn( + FunctionEnvMut<'_, TxVmEnv>, + ARG0, + ARG1, + ARG2, + ARG3, + ) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + F: Fn( + &mut TxVmEnv, + ARG0, + ARG1, + ARG2, + ARG3, + ) -> RET, + { + move |mut env, arg0, arg1, arg2, arg3| { + f(env.data_mut(), arg0, arg1, arg2, arg3) + } + } + + pub(super) fn _6( + f: F, + ) -> impl Fn( + FunctionEnvMut<'_, TxVmEnv>, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + F: Fn( + &mut TxVmEnv, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ) -> RET, + { + move |mut env, arg0, arg1, arg2, arg3, arg4, arg5| { + f(env.data_mut(), arg0, arg1, arg2, arg3, arg4, arg5) + } + } + + pub(super) fn _7< + F, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ARG6, + RET, + D, + H, + CA, + >( + f: F, + ) -> impl Fn( + FunctionEnvMut<'_, TxVmEnv>, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ARG6, + ) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + F: Fn( + &mut TxVmEnv, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ARG6, + ) -> RET, + { + move |mut env, arg0, arg1, arg2, arg3, arg4, arg5, arg6| { + f(env.data_mut(), arg0, arg1, arg2, arg3, arg4, arg5, arg6) + } + } +} + +// TODO(namada#3313): Attempt to reduce the boilerplate of this module with +// macros, traits or something of this sort... +mod wrap_vp { + //! Wrap vp host functions with any number of arguments in a callback + //! that can be passed to [`wasmer`], to be used by the guest wasm code. + + #![allow(missing_docs)] + + use namada_state::{DBIter, StorageHasher, DB}; + use wasmer::FunctionEnvMut; + + use crate::vm::host_env::{VpEvaluator, VpVmEnv}; + use crate::vm::wasm::memory::WasmMemory; + use crate::vm::WasmCacheAccess; + + pub(super) fn _0( + f: F, + ) -> impl Fn(FunctionEnvMut<'_, VpVmEnv>) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + EVAL: VpEvaluator + 'static, + F: Fn(&mut VpVmEnv) -> RET, + { + move |mut env| f(env.data_mut()) + } + + pub(super) fn _1( + f: F, + ) -> impl Fn(FunctionEnvMut<'_, VpVmEnv>, ARG0) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + EVAL: VpEvaluator + 'static, + F: Fn(&mut VpVmEnv, ARG0) -> RET, + { + move |mut env, arg0| f(env.data_mut(), arg0) + } + + pub(super) fn _2( + f: F, + ) -> impl Fn( + FunctionEnvMut<'_, VpVmEnv>, + ARG0, + ARG1, + ) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + EVAL: VpEvaluator + 'static, + F: Fn(&mut VpVmEnv, ARG0, ARG1) -> RET, + { + move |mut env, arg0, arg1| f(env.data_mut(), arg0, arg1) + } + + pub(super) fn _4( + f: F, + ) -> impl Fn( + FunctionEnvMut<'_, VpVmEnv>, + ARG0, + ARG1, + ARG2, + ARG3, + ) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + EVAL: VpEvaluator + 'static, + F: Fn( + &mut VpVmEnv, + ARG0, + ARG1, + ARG2, + ARG3, + ) -> RET, + { + move |mut env, arg0, arg1, arg2, arg3| { + f(env.data_mut(), arg0, arg1, arg2, arg3) + } + } + + pub(super) fn _9< + F, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ARG6, + ARG7, + ARG8, + RET, + D, + H, + EVAL, + CA, + >( + f: F, + ) -> impl Fn( + FunctionEnvMut<'_, VpVmEnv>, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ARG6, + ARG7, + ARG8, + ) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + EVAL: VpEvaluator + 'static, + F: Fn( + &mut VpVmEnv, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ARG6, + ARG7, + ARG8, + ) -> RET, + { + move |mut env, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8| { + f( + env.data_mut(), + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + arg7, + arg8, + ) + } + } +} diff --git a/crates/namada/src/vm/wasm/memory.rs b/crates/namada/src/vm/wasm/memory.rs index 451301ec9b..894e4efc44 100644 --- a/crates/namada/src/vm/wasm/memory.rs +++ b/crates/namada/src/vm/wasm/memory.rs @@ -1,18 +1,20 @@ //! Wasm memory is used for bi-directionally passing data between the host and a //! wasm instance. +use std::cell::RefCell; use std::ptr::NonNull; +use std::rc::Rc; use std::str::Utf8Error; -use std::sync::Arc; use borsh_ext::BorshSerializeExt; use namada_gas::MEMORY_ACCESS_GAS_PER_BYTE; use namada_sdk::arith::{self, checked}; use namada_tx::BatchedTxRef; use thiserror::Error; +use wasmer::sys::BaseTunables; use wasmer::{ - vm, BaseTunables, HostEnvInitError, LazyInit, Memory, MemoryError, - MemoryType, Pages, TableType, Target, Tunables, WASM_PAGE_SIZE, + vm, Memory, MemoryError, MemoryType, Pages, Store, TableType, Target, + Tunables, WASM_PAGE_SIZE, }; use wasmer_vm::{ MemoryStyle, TableStyle, VMMemoryDefinition, VMTableDefinition, @@ -28,8 +30,10 @@ pub enum Error { OverflowingOffset(u64, usize), #[error("Failed initializing the memory: {0}")] InitMemoryError(wasmer::MemoryError), - #[error("Memory ouf of bounds: {0}")] - MemoryOutOfBounds(wasmer::MemoryError), + #[error("Failed to grow memory: {0}")] + Grow(wasmer::MemoryError), + #[error("Wasm memory access error: {0}")] + Access(#[from] wasmer::MemoryAccessError), #[error("Encoding error: {0}")] EncodingError(std::io::Error), #[error("Memory is not initialized")] @@ -47,7 +51,9 @@ pub type Result = std::result::Result; // The bounds are set in number of pages, the actual size is multiplied by // `wasmer::WASM_PAGE_SIZE = 64kiB`. -// TODO set bounds to accommodate for wasm env size +// +// TODO: set bounds to accommodate for wasm env size +// /// Initial pages in tx memory pub const TX_MEMORY_INIT_PAGES: u32 = 100; // 6.4 MiB /// Mamixmum pages in tx memory @@ -58,7 +64,9 @@ pub const VP_MEMORY_INIT_PAGES: u32 = 100; // 6.4 MiB pub const VP_MEMORY_MAX_PAGES: u32 = 200; // 12.8 MiB /// Prepare memory for instantiating a transaction module -pub fn prepare_tx_memory(store: &wasmer::Store) -> Result { +pub fn prepare_tx_memory( + store: &mut impl wasmer::AsStoreMut, +) -> Result { let mem_type = wasmer::MemoryType::new( TX_MEMORY_INIT_PAGES, Some(TX_MEMORY_MAX_PAGES), @@ -68,7 +76,9 @@ pub fn prepare_tx_memory(store: &wasmer::Store) -> Result { } /// Prepare memory for instantiating a validity predicate module -pub fn prepare_vp_memory(store: &wasmer::Store) -> Result { +pub fn prepare_vp_memory( + store: &mut impl wasmer::AsStoreMut, +) -> Result { let mem_type = wasmer::MemoryType::new( VP_MEMORY_INIT_PAGES, Some(VP_MEMORY_MAX_PAGES), @@ -89,6 +99,7 @@ pub struct TxCallInput { /// Write transaction inputs into wasm memory pub fn write_tx_inputs( + store: &mut impl wasmer::AsStoreMut, memory: &wasmer::Memory, tx_data: &BatchedTxRef<'_>, ) -> Result { @@ -96,7 +107,7 @@ pub fn write_tx_inputs( let tx_data_bytes = tx_data.serialize_to_vec(); let tx_data_len = tx_data_bytes.len() as _; - write_memory_bytes(memory, tx_data_ptr, tx_data_bytes)?; + write_memory_bytes(store, memory, tx_data_ptr, tx_data_bytes)?; Ok(TxCallInput { tx_data_ptr, @@ -127,6 +138,7 @@ pub struct VpCallInput { /// Write validity predicate inputs into wasm memory pub fn write_vp_inputs( + store: &mut impl wasmer::AsStoreMut, memory: &wasmer::Memory, VpInput { addr, @@ -158,7 +170,7 @@ pub fn write_vp_inputs( &verifiers_bytes[..], ] .concat(); - write_memory_bytes(memory, addr_ptr, bytes)?; + write_memory_bytes(store, memory, addr_ptr, bytes)?; Ok(VpCallInput { addr_ptr, @@ -174,12 +186,22 @@ pub fn write_vp_inputs( /// Check that the given offset and length fits into the memory bounds. If not, /// it will try to grow the memory. -fn check_bounds(memory: &Memory, base_addr: u64, offset: usize) -> Result<()> { +// TODO(namada#3314): avoid growing memory if we're only performing reads; +// return an Err instead +fn check_bounds( + store: &mut impl wasmer::AsStoreMut, + memory: &Memory, + base_addr: u64, + offset: usize, +) -> Result<()> { + let store_mut = store.as_store_mut(); + let memview = memory.view(&store_mut); + tracing::debug!( "check_bounds pages {}, data_size {}, base_addr {base_addr}, offset \ {offset}", - memory.size().0, - memory.data_size(), + memview.size().0, + memview.data_size(), ); let desired_offset = base_addr .checked_add(offset as u64) @@ -193,8 +215,8 @@ fn check_bounds(memory: &Memory, base_addr: u64, offset: usize) -> Result<()> { } }) .ok_or(Error::OverflowingOffset(base_addr, offset))?; - if memory.data_size() < desired_offset { - let cur_pages = memory.size().0 as usize; + if memview.data_size() < desired_offset { + let cur_pages = memview.size().0 as usize; let capacity = checked!(cur_pages * WASM_PAGE_SIZE)?; // usizes should be at least 32 bits wide on most architectures, // so this cast shouldn't cause panics, given the invariant that @@ -209,9 +231,9 @@ fn check_bounds(memory: &Memory, base_addr: u64, offset: usize) -> Result<()> { checked!((missing + WASM_PAGE_SIZE - 1) / WASM_PAGE_SIZE)?; let req_pages: u32 = u32::try_from(req_pages)?; tracing::debug!(req_pages, "Attempting to grow wasm memory"); - memory.grow(req_pages).map_err(Error::MemoryOutOfBounds)?; + memory.grow(store, req_pages).map_err(Error::Grow)?; tracing::debug!( - mem_size = memory.data_size(), + mem_size = memory.view(&store.as_store_mut()).data_size(), "Wasm memory size has been successfully extended" ); } @@ -220,62 +242,69 @@ fn check_bounds(memory: &Memory, base_addr: u64, offset: usize) -> Result<()> { /// Read bytes from memory at the given offset and length fn read_memory_bytes( + store: &mut impl wasmer::AsStoreMut, memory: &Memory, offset: u64, len: usize, ) -> Result> { - check_bounds(memory, offset, len)?; - let offset = usize::try_from(offset)?; - let vec: Vec<_> = memory.view()[offset..checked!(offset + len)?] - .iter() - .map(|cell| cell.get()) - .collect(); - Ok(vec) + check_bounds(store, memory, offset, len)?; + let mut buf = vec![0; len]; + memory.view(&store.as_store_mut()).read(offset, &mut buf)?; + Ok(buf) } /// Write bytes into memory at the given offset fn write_memory_bytes( + store: &mut impl wasmer::AsStoreMut, memory: &Memory, offset: u64, bytes: impl AsRef<[u8]>, ) -> Result<()> { - let slice = bytes.as_ref(); - let len = slice.len(); - check_bounds(memory, offset, len as _)?; - let offset = usize::try_from(offset)?; - memory.view()[offset..checked!(offset + len)?] - .iter() - .zip(slice.iter()) - .for_each(|(cell, v)| cell.set(*v)); + let buf = bytes.as_ref(); + check_bounds(store, memory, offset, buf.len() as _)?; + memory.view(&store.as_store_mut()).write(offset, buf)?; Ok(()) } /// The wasm memory -#[derive(Debug, Clone, Default)] +#[derive(Debug, Clone)] pub struct WasmMemory { - pub(crate) inner: LazyInit, + store: Rc>, + memory: Rc>>, } +// TODO(namada#3313): Wasm memory is neither `Send` nor `Sync`, but we must +// implement it for now for the code to compile. +unsafe impl Send for WasmMemory {} +unsafe impl Sync for WasmMemory {} + impl WasmMemory { - /// Initialize the memory from the given exports, used to implement - /// [`wasmer::WasmerEnv`]. - pub fn init_env_memory( - &mut self, - exports: &wasmer::Exports, - ) -> std::result::Result<(), HostEnvInitError> { - // "`TxEnv` holds a reference to the Wasm `Memory`, which itself - // internally holds a reference to the instance which owns that - // memory. However the instance itself also holds a reference to - // the `TxEnv` when it is instantiated, thus creating a circular - // reference. - // You can work around this by using `get_with_generics_weak` which - // creates a weak reference to the `Instance` internally." - // - let memory = exports.get_with_generics_weak("memory")?; - if !self.inner.initialize(memory) { + /// Build a new wasm memory. + pub fn new(store: Rc>) -> Self { + Self { + store, + memory: Rc::new(RefCell::new(None)), + } + } + + /// Initialize the host memory with a pointer to the given memory. + pub fn init_from(&mut self, memory: &Memory) { + if self.memory.borrow().is_some() { tracing::error!("wasm memory is already initialized"); + return; } - Ok(()) + *self.memory.borrow_mut() = Some(memory.clone()); + } + + /// Access the inner [`Memory`]. + #[inline] + fn access(&self, f: F) -> Result + where + F: FnOnce(&Memory) -> Result, + { + let borrow = self.memory.borrow(); + let memory = borrow.as_ref().ok_or(Error::UninitializedMemory)?; + f(memory) } } @@ -284,29 +313,45 @@ impl VmMemory for WasmMemory { /// Read bytes from memory at the given offset and length, return the bytes /// and the gas cost - fn read_bytes(&self, offset: u64, len: usize) -> Result<(Vec, u64)> { - let memory = self.inner.get_ref().ok_or(Error::UninitializedMemory)?; - let bytes = read_memory_bytes(memory, offset, len)?; - let len = bytes.len() as u64; - let gas = checked!(len * MEMORY_ACCESS_GAS_PER_BYTE)?; - Ok((bytes, gas)) + fn read_bytes( + &mut self, + offset: u64, + len: usize, + ) -> Result<(Vec, u64)> { + self.access(|memory| { + let mut store = self.store.borrow_mut(); + let bytes = read_memory_bytes(&mut *store, memory, offset, len)?; + let len = bytes.len() as u64; + let gas = checked!(len * MEMORY_ACCESS_GAS_PER_BYTE)?; + Ok((bytes, gas)) + }) } /// Write bytes into memory at the given offset and return the gas cost - fn write_bytes(&self, offset: u64, bytes: impl AsRef<[u8]>) -> Result { - // No need for a separate gas multiplier for writes since we are only - // writing to memory and we already charge gas for every memory page - // allocated - let len = bytes.as_ref().len() as u64; - let gas = checked!(len * MEMORY_ACCESS_GAS_PER_BYTE)?; - let memory = self.inner.get_ref().ok_or(Error::UninitializedMemory)?; - write_memory_bytes(memory, offset, bytes)?; - Ok(gas) + fn write_bytes( + &mut self, + offset: u64, + bytes: impl AsRef<[u8]>, + ) -> Result { + self.access(|memory| { + // No need for a separate gas multiplier for writes since we are + // only writing to memory and we already charge gas for + // every memory page allocated + let len = bytes.as_ref().len() as u64; + let gas = checked!(len * MEMORY_ACCESS_GAS_PER_BYTE)?; + let mut store = self.store.borrow_mut(); + write_memory_bytes(&mut *store, memory, offset, bytes)?; + Ok(gas) + }) } /// Read string from memory at the given offset and bytes length, and return /// the gas cost - fn read_string(&self, offset: u64, len: usize) -> Result<(String, u64)> { + fn read_string( + &mut self, + offset: u64, + len: usize, + ) -> Result<(String, u64)> { let (bytes, gas) = self.read_bytes(offset, len)?; let string = std::str::from_utf8(&bytes) .map_err(Error::InvalidUtf8String)? @@ -316,12 +361,11 @@ impl VmMemory for WasmMemory { /// Write string into memory at the given offset and return the gas cost #[allow(dead_code)] - fn write_string(&self, offset: u64, string: String) -> Result { + fn write_string(&mut self, offset: u64, string: String) -> Result { self.write_bytes(offset, string.as_bytes()) } } -#[derive(loupe::MemoryUsage)] /// A custom [`Tunables`] to set a WASM memory limits. /// /// Adapted from . @@ -341,6 +385,7 @@ pub fn vp_limit() -> Limit { let limit = Pages(VP_MEMORY_MAX_PAGES); Limit { limit, base } } + /// A [`Limit`] with memory limit setup for transaction WASM execution. pub fn tx_limit() -> Limit { let base = BaseTunables::for_target(&Target::default()); @@ -412,7 +457,7 @@ impl Tunables for Limit { &self, ty: &MemoryType, style: &MemoryStyle, - ) -> std::result::Result, MemoryError> { + ) -> std::result::Result { let adjusted = self.adjust_memory(ty); self.validate_memory(&adjusted)?; self.base.create_host_memory(&adjusted, style) @@ -427,7 +472,7 @@ impl Tunables for Limit { ty: &MemoryType, style: &MemoryStyle, vm_definition_location: NonNull, - ) -> std::result::Result, MemoryError> { + ) -> std::result::Result { let adjusted = self.adjust_memory(ty); self.validate_memory(&adjusted)?; self.base @@ -442,7 +487,7 @@ impl Tunables for Limit { &self, ty: &TableType, style: &TableStyle, - ) -> std::result::Result, String> { + ) -> std::result::Result { self.base.create_host_table(ty, style) } @@ -455,14 +500,18 @@ impl Tunables for Limit { ty: &TableType, style: &TableStyle, vm_definition_location: NonNull, - ) -> std::result::Result, String> { + ) -> std::result::Result { self.base.create_vm_table(ty, style, vm_definition_location) } } #[cfg(test)] pub mod tests { - use wasmer::{wat2wasm, Cranelift, Instance, Module, Store}; + use wasmer::sys::Features; + use wasmer::{ + wat2wasm, Cranelift, Engine, Instance, Module, NativeEngineExt, Store, + Target, + }; use super::*; @@ -479,14 +528,19 @@ pub mod tests { // Any compiler and any engine do the job here let compiler = Cranelift::default(); - let engine = wasmer_engine_universal::Universal::new(compiler).engine(); + let mut engine = ::new( + Box::new(compiler), + Target::default(), + Features::default(), + ); let base = BaseTunables::for_target(&Target::default()); let limit = Pages(24); let tunables = Limit { limit, base }; + engine.set_tunables(tunables); // Create a store, that holds the engine and our custom tunables - let store = Store::new_with_tunables(&engine, tunables); + let mut store = Store::new(engine); println!("Compiling module..."); let module = Module::new(&store, wasm_bytes).unwrap(); @@ -495,7 +549,8 @@ pub mod tests { let import_object = wasmer::imports! {}; // Now at this point, our custom tunables are used - let instance = Instance::new(&module, &import_object).unwrap(); + let instance = + Instance::new(&mut store, &module, &import_object).unwrap(); // Check what happened let mut memories: Vec = instance @@ -508,6 +563,6 @@ pub mod tests { let first_memory = memories.pop().unwrap(); println!("Memory of this instance: {:?}", first_memory); - assert_eq!(first_memory.ty().maximum.unwrap(), limit); + assert_eq!(first_memory.ty(&store).maximum.unwrap(), limit); } } diff --git a/crates/namada/src/vm/wasm/run.rs b/crates/namada/src/vm/wasm/run.rs index 002081a288..53adc441d3 100644 --- a/crates/namada/src/vm/wasm/run.rs +++ b/crates/namada/src/vm/wasm/run.rs @@ -6,6 +6,7 @@ use std::error::Error as _; use std::fmt::Debug; use std::marker::PhantomData; use std::num::NonZeroU32; +use std::rc::Rc; use borsh::BorshDeserialize; use namada_core::validity_predicate::VpError; @@ -16,7 +17,8 @@ use namada_tx::{BatchedTxRef, Commitment, Section, Tx, TxCommitments}; use parity_wasm::elements::Instruction::*; use parity_wasm::elements::{self, SignExtInstruction}; use thiserror::Error; -use wasmer::{BaseTunables, Module, Store}; +use wasmer::sys::{BaseTunables, Features}; +use wasmer::{Engine, Module, NativeEngineExt, Store, Target}; use super::memory::{Limit, WasmMemory}; use super::TxCache; @@ -191,6 +193,7 @@ where let (module, store) = fetch_or_compile(tx_wasm_cache, &tx_code.code, state, gas_meter)?; + let store = Rc::new(RefCell::new(store)); let mut iterators: PrefixIterators<'_, ::D> = PrefixIterators::default(); @@ -200,8 +203,8 @@ where let sentinel = RefCell::new(TxSentinel::default()); let (write_log, in_mem, db) = state.split_borrow(); - let env = TxVmEnv::new( - WasmMemory::default(), + let mut env = TxVmEnv::new( + WasmMemory::new(Rc::clone(&store)), write_log, in_mem, db, @@ -218,51 +221,69 @@ where tx_wasm_cache, ); - let imports = tx_imports(&store, env); - // Instantiate the wasm module - let instance = wasmer::Instance::new(&module, &imports) - .map_err(|e| Error::InstantiationError(Box::new(e)))?; + let instance = { + let mut store = store.borrow_mut(); + let imports = tx_imports(&mut *store, env.clone()); + wasmer::Instance::new(&mut *store, &module, &imports) + .map_err(|e| Error::InstantiationError(Box::new(e)))? + }; - // We need to write the inputs in the memory exported from the wasm - // module - let memory = instance + // Fetch guest's main memory + let guest_memory = instance .exports .get_memory("memory") .map_err(Error::MissingModuleMemory)?; + + env.memory.init_from(guest_memory); + + // Write the inputs in the memory exported from the wasm + // module let memory::TxCallInput { tx_data_ptr, tx_data_len, - } = memory::write_tx_inputs(memory, &batched_tx) - .map_err(Error::MemoryError)?; + } = { + let mut store = store.borrow_mut(); + memory::write_tx_inputs(&mut *store, guest_memory, &batched_tx) + .map_err(Error::MemoryError)? + }; + // Get the module's entrypoint to be called - let apply_tx = instance - .exports - .get_function(TX_ENTRYPOINT) - .map_err(Error::MissingModuleEntrypoint)? - .native::<(u64, u64), u64>() - .map_err(|error| Error::UnexpectedModuleEntrypointInterface { - entrypoint: TX_ENTRYPOINT, - error, - })?; - let ok = apply_tx.call(tx_data_ptr, tx_data_len).map_err(|err| { - tracing::debug!("Tx WASM failed with {}", err); - match *sentinel.borrow() { - TxSentinel::None => Error::RuntimeError(err), - TxSentinel::OutOfGas => Error::GasError(err.to_string()), - TxSentinel::InvalidCommitment => { - Error::MissingSection(err.to_string()) + let apply_tx = { + let store = store.borrow(); + instance + .exports + .get_function(TX_ENTRYPOINT) + .map_err(Error::MissingModuleEntrypoint)? + .typed::<(u64, u64), u64>(&*store) + .map_err(|error| Error::UnexpectedModuleEntrypointInterface { + entrypoint: TX_ENTRYPOINT, + error, + })? + }; + let ok = apply_tx + .call( + unsafe { &mut *RefCell::as_ptr(&*store) }, + tx_data_ptr, + tx_data_len, + ) + .map_err(|err| { + tracing::debug!("Tx WASM failed with {}", err); + match *sentinel.borrow() { + TxSentinel::None => Error::RuntimeError(err), + TxSentinel::OutOfGas => Error::GasError(err.to_string()), + TxSentinel::InvalidCommitment => { + Error::MissingSection(err.to_string()) + } } - } - })?; + })?; + + // NB: early drop this data to avoid memory errors + _ = (instance, env); if ok == 1 { Ok(verifiers) } else { - // NB: drop imports so we can safely access the - // `&mut` ptrs we shared with the guest - _ = (instance, imports); - let err = yielded_value.take().map_or_else( || Ok("Execution ended abruptly with an unknown error".to_owned()), |borsh_encoded_err| { @@ -306,6 +327,7 @@ where state, gas_meter, )?; + let store = Rc::new(RefCell::new(store)); let mut iterators: PrefixIterators<'_, ::D> = PrefixIterators::default(); @@ -318,8 +340,8 @@ where cache_access: PhantomData, }; let BatchedTxRef { tx, cmt } = batched_tx; - let env = VpVmEnv::new( - WasmMemory::default(), + let mut env = VpVmEnv::new( + WasmMemory::new(Rc::clone(&store)), address, state.write_log(), state.in_mem(), @@ -338,9 +360,14 @@ where ); let yielded_value_borrow = env.ctx.yielded_value; - let imports = vp_imports(&store, env); + + let imports = { + let mut store = store.borrow_mut(); + vp_imports(&mut *store, env.clone()) + }; run_vp( + store, module, imports, &vp_code_hash, @@ -349,20 +376,26 @@ where keys_changed, verifiers, yielded_value_borrow, + |guest_memory| env.memory.init_from(guest_memory), ) } #[allow(clippy::too_many_arguments)] -fn run_vp( +fn run_vp( + store: Rc>, module: wasmer::Module, - vp_imports: wasmer::ImportObject, + vp_imports: wasmer::Imports, vp_code_hash: &Hash, input_data: &BatchedTxRef<'_>, address: &Address, keys_changed: &BTreeSet, verifiers: &BTreeSet
, yielded_value: HostRef>>, -) -> Result<()> { + mut init_memory_callback: F, +) -> Result<()> +where + F: FnMut(&wasmer::Memory), +{ let input: VpInput<'_> = VpInput { addr: address, data: input_data, @@ -371,15 +404,22 @@ fn run_vp( }; // Instantiate the wasm module - let instance = wasmer::Instance::new(&module, &vp_imports) - .map_err(|e| Error::InstantiationError(Box::new(e)))?; + let instance = { + let mut store = store.borrow_mut(); + wasmer::Instance::new(&mut *store, &module, &vp_imports) + .map_err(|e| Error::InstantiationError(Box::new(e)))? + }; - // We need to write the inputs in the memory exported from the wasm - // module - let memory = instance + // Fetch guest's main memory + let guest_memory = instance .exports .get_memory("memory") .map_err(Error::MissingModuleMemory)?; + + init_memory_callback(guest_memory); + + // Write the inputs in the memory exported from the wasm + // module let memory::VpCallInput { addr_ptr, addr_len, @@ -389,20 +429,28 @@ fn run_vp( keys_changed_len, verifiers_ptr, verifiers_len, - } = memory::write_vp_inputs(memory, input).map_err(Error::MemoryError)?; + } = { + let mut store = store.borrow_mut(); + memory::write_vp_inputs(&mut *store, guest_memory, input) + .map_err(Error::MemoryError)? + }; // Get the module's entrypoint to be called - let validate_tx = instance - .exports - .get_function(VP_ENTRYPOINT) - .map_err(Error::MissingModuleEntrypoint)? - .native::<(u64, u64, u64, u64, u64, u64, u64, u64), u64>() - .map_err(|error| Error::UnexpectedModuleEntrypointInterface { - entrypoint: VP_ENTRYPOINT, - error, - })?; + let validate_tx = { + let store = store.borrow(); + instance + .exports + .get_function(VP_ENTRYPOINT) + .map_err(Error::MissingModuleEntrypoint)? + .typed::<(u64, u64, u64, u64, u64, u64, u64, u64), u64>(&*store) + .map_err(|error| Error::UnexpectedModuleEntrypointInterface { + entrypoint: VP_ENTRYPOINT, + error, + })? + }; let is_valid = validate_tx .call( + unsafe { &mut *RefCell::as_ptr(&*store) }, addr_ptr, addr_len, data_ptr, @@ -438,13 +486,12 @@ fn run_vp( "wasm vp" ); + // NB: early drop this data to avoid memory errors + _ = (instance, vp_imports); + if is_valid == 1 { Ok(()) } else { - // NB: drop imports so we can safely access the - // `&mut` ptrs we shared with the guest - _ = (instance, vp_imports); - unsafe { yielded_value.get_mut() }.take().map_or_else( || Err(Error::VpError(VpError::Unspecified)), |borsh_encoded_err| { @@ -526,15 +573,20 @@ where &ctx.state(), gas_meter, )?; + let store = Rc::new(RefCell::new(store)); - let env = VpVmEnv { - memory: WasmMemory::default(), + let mut env = VpVmEnv { + memory: WasmMemory::new(Rc::clone(&store)), ctx, }; let yielded_value_borrow = env.ctx.yielded_value; - let imports = vp_imports(&store, env); + let imports = { + let mut store = store.borrow_mut(); + vp_imports(&mut *store, env.clone()) + }; run_vp( + store, module, imports, &vp_code_hash, @@ -543,6 +595,7 @@ where keys_changed, verifiers, yielded_value_borrow, + |guest_memory| env.memory.init_from(guest_memory), ) } } @@ -551,10 +604,16 @@ where pub fn untrusted_wasm_store(limit: Limit) -> wasmer::Store { // Use Singlepass compiler with the default settings let compiler = wasmer_compiler_singlepass::Singlepass::default(); - wasmer::Store::new_with_tunables( - &wasmer_engine_universal::Universal::new(compiler).engine(), - limit, - ) + let mut engine = ::new( + Box::new(compiler), + // NB: The default target corresponds to the host's triplet + Target::default(), + // NB: WASM features are validated via `validate_untrusted_wasm`, + // so we can use the default features here + Features::default(), + ); + engine.set_tunables(limit); + wasmer::Store::new(engine) } /// Inject gas counter and stack-height limiter into the given wasm code @@ -1288,7 +1347,7 @@ mod tests { // of memory match result { // Dylib engine error (used anywhere except mac) - Err(Error::MemoryError(memory::Error::MemoryOutOfBounds( + Err(Error::MemoryError(memory::Error::Grow( wasmer::MemoryError::CouldNotGrow { .. }, ))) => {} Err(error) => { @@ -1352,7 +1411,7 @@ mod tests { // of memory match result { // Dylib engine error (used anywhere except mac) - Err(Error::MemoryError(memory::Error::MemoryOutOfBounds( + Err(Error::MemoryError(memory::Error::Grow( wasmer::MemoryError::CouldNotGrow { .. }, ))) => { // as expected diff --git a/crates/tests/src/integration/ledger_tests.rs b/crates/tests/src/integration/ledger_tests.rs index 818d8b4fa8..23e8acf5a5 100644 --- a/crates/tests/src/integration/ledger_tests.rs +++ b/crates/tests/src/integration/ledger_tests.rs @@ -1875,4 +1875,4 @@ fn make_migration_json() -> (Hash, tempfile::NamedTempFile) { let hash = Hash::sha256(json.as_bytes()); std::fs::write(file.path(), json).expect("Test failed"); (hash, file) -} \ No newline at end of file +} diff --git a/crates/tests/src/vm_host_env/tx.rs b/crates/tests/src/vm_host_env/tx.rs index f6f0ff580f..594391024d 100644 --- a/crates/tests/src/vm_host_env/tx.rs +++ b/crates/tests/src/vm_host_env/tx.rs @@ -354,7 +354,7 @@ mod native_tx_host_env { batched_tx, }: &mut TestTxEnv| { - let tx_env = vm::host_env::testing::tx_env( + let mut tx_env = vm::host_env::testing::tx_env( state, iterators, verifiers, @@ -371,7 +371,7 @@ mod native_tx_host_env { // Call the `host_env` function and unwrap any // runtime errors - $fn( &tx_env, $($arg),* ).unwrap() + $fn( &mut tx_env, $($arg),* ).unwrap() }) } }); @@ -398,7 +398,7 @@ mod native_tx_host_env { batched_tx }: &mut TestTxEnv| { - let tx_env = vm::host_env::testing::tx_env( + let mut tx_env = vm::host_env::testing::tx_env( state, iterators, verifiers, @@ -415,7 +415,7 @@ mod native_tx_host_env { // Call the `host_env` function and unwrap any // runtime errors - $fn( &tx_env, $($arg),* ).unwrap() + $fn( &mut tx_env, $($arg),* ).unwrap() }) } }); @@ -442,7 +442,7 @@ mod native_tx_host_env { batched_tx, }: &mut TestTxEnv| { - let tx_env = vm::host_env::testing::tx_env( + let mut tx_env = vm::host_env::testing::tx_env( state, iterators, verifiers, @@ -458,7 +458,7 @@ mod native_tx_host_env { ); // Call the `host_env` function - $fn( &tx_env, $($arg),* ) + $fn( &mut tx_env, $($arg),* ) }) } }); @@ -582,13 +582,18 @@ mod tests { // dbg!(&setup); let mut test_env = TestTxEnv::default(); - let tx_env = setup_host_env(&setup, &mut test_env); + let mut tx_env = setup_host_env(&setup, &mut test_env); // Can fail, but must not panic - let _res = - host_env::tx_read(&tx_env, setup.key_memory_ptr, setup.key_len()); - let _res = - host_env::tx_result_buffer(&tx_env, setup.read_buffer_memory_ptr); + let _res = host_env::tx_read( + &mut tx_env, + setup.key_memory_ptr, + setup.key_len(), + ); + let _res = host_env::tx_result_buffer( + &mut tx_env, + setup.read_buffer_memory_ptr, + ); } proptest! { @@ -603,10 +608,10 @@ mod tests { fn test_tx_charge_gas_cannot_panic_aux(setup: TestSetup, gas: u64) { let mut test_env = TestTxEnv::default(); - let tx_env = setup_host_env(&setup, &mut test_env); + let mut tx_env = setup_host_env(&setup, &mut test_env); // Can fail, but must not panic - let _res = host_env::tx_charge_gas(&tx_env, gas); + let _res = host_env::tx_charge_gas(&mut tx_env, gas); } proptest! { @@ -622,11 +627,11 @@ mod tests { // dbg!(&setup); let mut test_env = TestTxEnv::default(); - let tx_env = setup_host_env(&setup, &mut test_env); + let mut tx_env = setup_host_env(&setup, &mut test_env); // Can fail, but must not panic let _res = host_env::tx_has_key( - &tx_env, + &mut tx_env, setup.key_memory_ptr, setup.key_len(), ); @@ -645,18 +650,18 @@ mod tests { // dbg!(&setup); let mut test_env = TestTxEnv::default(); - let tx_env = setup_host_env(&setup, &mut test_env); + let mut tx_env = setup_host_env(&setup, &mut test_env); // Can fail, but must not panic let _res = host_env::tx_write( - &tx_env, + &mut tx_env, setup.key_memory_ptr, setup.key_len(), setup.val_memory_ptr, setup.val_len(), ); let _res = host_env::tx_write_temp( - &tx_env, + &mut tx_env, setup.key_memory_ptr, setup.key_len(), setup.val_memory_ptr, @@ -677,11 +682,14 @@ mod tests { // dbg!(&setup); let mut test_env = TestTxEnv::default(); - let tx_env = setup_host_env(&setup, &mut test_env); + let mut tx_env = setup_host_env(&setup, &mut test_env); // Can fail, but must not panic - let _res = - host_env::tx_delete(&tx_env, setup.key_memory_ptr, setup.key_len()); + let _res = host_env::tx_delete( + &mut tx_env, + setup.key_memory_ptr, + setup.key_len(), + ); } proptest! { @@ -697,16 +705,16 @@ mod tests { // dbg!(&setup); let mut test_env = TestTxEnv::default(); - let tx_env = setup_host_env(&setup, &mut test_env); + let mut tx_env = setup_host_env(&setup, &mut test_env); // Can fail, but must not panic let _res = host_env::tx_iter_prefix( - &tx_env, + &mut tx_env, setup.key_memory_ptr, setup.key_len(), ); let _res = host_env::tx_iter_next( - &tx_env, + &mut tx_env, // This field is not used for anything else in this test setup.val_memory_ptr, ); @@ -751,7 +759,7 @@ mod tests { batched_tx, } = test_env; - let tx_env = vm::host_env::testing::tx_env_with_wasm_memory( + let mut tx_env = vm::host_env::testing::tx_env_with_wasm_memory( state, iterators, verifiers, diff --git a/crates/tests/src/vm_host_env/vp.rs b/crates/tests/src/vm_host_env/vp.rs index 4444310a39..10a7bda496 100644 --- a/crates/tests/src/vm_host_env/vp.rs +++ b/crates/tests/src/vm_host_env/vp.rs @@ -267,7 +267,7 @@ mod native_vp_host_env { vp_cache_dir: _, }: &mut TestVpEnv| { - let env = vm::host_env::testing::vp_env( + let mut env = vm::host_env::testing::vp_env( addr, state, iterators, @@ -285,7 +285,7 @@ mod native_vp_host_env { // Call the `host_env` function and unwrap any // runtime errors - $fn( &env, $($arg),* ).unwrap() + $fn( &mut env, $($arg),* ).unwrap() }) } }); @@ -312,7 +312,7 @@ mod native_vp_host_env { vp_cache_dir: _, }: &mut TestVpEnv| { - let env = vm::host_env::testing::vp_env( + let mut env = vm::host_env::testing::vp_env( addr, state, iterators, @@ -330,7 +330,7 @@ mod native_vp_host_env { // Call the `host_env` function and unwrap any // runtime errors - $fn( &env, $($arg),* ).unwrap() + $fn( &mut env, $($arg),* ).unwrap() }) } }); diff --git a/wasm/Cargo.lock b/wasm/Cargo.lock index fe08f81667..38de353f40 100644 --- a/wasm/Cargo.lock +++ b/wasm/Cargo.lock @@ -54,7 +54,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "once_cell", "version_check", ] @@ -83,6 +83,55 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.75" @@ -304,7 +353,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.32.1", + "object", "rustc-demangle", ] @@ -661,6 +710,15 @@ dependencies = [ "serde", ] +[[package]] +name = "bytesize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +dependencies = [ + "serde", +] + [[package]] name = "camino" version = "1.1.6" @@ -787,6 +845,46 @@ dependencies = [ "version_check", ] +[[package]] +name = "clap" +version = "4.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "clap_lex" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + [[package]] name = "clru" version = "0.5.0" @@ -844,6 +942,12 @@ dependencies = [ "thiserror", ] +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + [[package]] name = "concat-idents" version = "1.1.5" @@ -994,56 +1098,74 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" +checksum = "2a2ab4512dfd3a6f4be184403a195f76e81a8a9f9e6c898e19d2dc3ce20e0115" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" +checksum = "98b022ed2a5913a38839dfbafe6cf135342661293b08049843362df4301261dc" dependencies = [ + "arrayvec", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", + "cranelift-egraph", "cranelift-entity", + "cranelift-isle", "gimli 0.26.2", "log", - "regalloc", + "regalloc2", "smallvec", "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" +checksum = "639307b45434ad112a98f8300c0f0ab085cbefcd767efcdef9ef19d4c0756e74" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" +checksum = "278e52e29c53fcf32431ef08406c295699a70306d05a0715c5b1bf50e33a9ab7" + +[[package]] +name = "cranelift-egraph" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624b54323b06e675293939311943ba82d323bb340468ce1889be5da7932c8d73" +dependencies = [ + "cranelift-entity", + "fxhash", + "hashbrown 0.12.3", + "indexmap 1.9.3", + "log", + "smallvec", +] [[package]] name = "cranelift-entity" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" +checksum = "9a59bcbca89c3f1b70b93ab3cbba5e5e0cbf3e63dadb23c7525cb142e21a9d4c" [[package]] name = "cranelift-frontend" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" +checksum = "0d70abacb8cfef3dc8ff7e8836e9c1d70f7967dfdac824a4cd5e30223415aca6" dependencies = [ "cranelift-codegen", "log", @@ -1051,6 +1173,12 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cranelift-isle" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" + [[package]] name = "crc32fast" version = "1.3.2" @@ -1080,10 +1208,19 @@ dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", - "memoffset 0.9.0", + "memoffset", "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.19" @@ -1180,14 +1317,38 @@ dependencies = [ "serde", ] +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + [[package]] name = "darling" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.3", + "darling_macro 0.20.3", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", ] [[package]] @@ -1203,17 +1364,41 @@ dependencies = [ "syn 2.0.52", ] +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + [[package]] name = "darling_macro" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core", + "darling_core 0.20.3", "quote", "syn 2.0.52", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if 1.0.0", + "hashbrown 0.14.3", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "data-encoding" version = "2.5.0" @@ -1256,6 +1441,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1319,6 +1535,15 @@ dependencies = [ "syn 2.0.52", ] +[[package]] +name = "document-features" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" +dependencies = [ + "litrs", +] + [[package]] name = "dunce" version = "1.0.4" @@ -1368,7 +1593,7 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] @@ -1514,7 +1739,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ - "darling", + "darling 0.20.3", "proc-macro2", "quote", "syn 2.0.52", @@ -1893,6 +2118,18 @@ dependencies = [ "subtle", ] +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "windows-sys 0.52.0", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1911,6 +2148,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "flex-error" version = "0.4.4" @@ -2105,9 +2352,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -2189,7 +2436,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.11", - "indexmap 2.1.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -2197,13 +2444,10 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.11.2" +name = "half" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "hashbrown" @@ -3065,20 +3309,21 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +version = "2.2.4" +source = "git+https://github.com/heliaxdev/indexmap?tag=2.2.4-heliax-1#b5b5b547bd6ab04bbb16e060326a50ddaeb6c909" dependencies = [ + "borsh 1.4.0", "equivalent", "hashbrown 0.14.3", + "serde", ] [[package]] name = "indexmap" -version = "2.2.4" -source = "git+https://github.com/heliaxdev/indexmap?tag=2.2.4-heliax-1#b5b5b547bd6ab04bbb16e060326a50ddaeb6c909" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ - "borsh 1.4.0", "equivalent", "hashbrown 0.14.3", "serde", @@ -3137,6 +3382,12 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.11.0" @@ -3260,16 +3511,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - [[package]] name = "libm" version = "0.2.8" @@ -3313,6 +3554,12 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.11" @@ -3329,27 +3576,6 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -[[package]] -name = "loupe" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap 1.9.3", - "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 1.0.109", -] - [[package]] name = "mach" version = "0.3.2" @@ -3413,7 +3639,7 @@ dependencies = [ "blake2b_simd", "bls12_381", "directories", - "getrandom 0.2.11", + "getrandom 0.2.15", "group", "itertools 0.11.0", "jubjub", @@ -3456,12 +3682,12 @@ dependencies = [ ] [[package]] -name = "memoffset" -version = "0.6.5" +name = "memmap2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ - "autocfg", + "libc", ] [[package]] @@ -3554,7 +3780,6 @@ dependencies = [ "eyre", "itertools 0.12.1", "linkme", - "loupe", "masp_primitives", "masp_proofs", "namada_account", @@ -3594,8 +3819,6 @@ dependencies = [ "wasmer", "wasmer-cache", "wasmer-compiler-singlepass", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-vm", "wasmparser 0.107.0", "wasmtimer", @@ -4312,18 +4535,6 @@ dependencies = [ "syn 2.0.52", ] -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap 1.9.3", - "memchr", -] - [[package]] name = "object" version = "0.32.1" @@ -4377,7 +4588,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6624905ddd92e460ff0685567539ed1ac985b2dee4c92c7edcd64fce905b00c" dependencies = [ "ct-codecs", - "getrandom 0.2.11", + "getrandom 0.2.15", "subtle", "zeroize", ] @@ -4580,7 +4791,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap 2.2.6", ] [[package]] @@ -4926,7 +5137,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", ] [[package]] @@ -5015,19 +5226,20 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "libredox", "thiserror", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regalloc2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" dependencies = [ + "fxhash", "log", - "rustc-hash", + "slice-group-by", "smallvec", ] @@ -5163,7 +5375,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "getrandom 0.2.11", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -5188,6 +5400,7 @@ dependencies = [ "bitvec", "bytecheck", "hashbrown 0.12.3", + "indexmap 1.9.3", "ptr_meta", "rend", "rkyv_derive", @@ -5386,6 +5599,7 @@ dependencies = [ "schemars_derive", "serde", "serde_json", + "url", ] [[package]] @@ -5449,6 +5663,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + [[package]] name = "semver" version = "0.11.0" @@ -5490,9 +5710,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] @@ -5515,6 +5735,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_bytes" version = "0.11.12" @@ -5524,11 +5755,21 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", @@ -5589,6 +5830,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "serdect" version = "0.2.0" @@ -5642,6 +5896,16 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -5694,6 +5958,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + [[package]] name = "slip10_ed25519" version = "0.1.3" @@ -5793,6 +6063,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.1" @@ -5925,6 +6201,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "target-lexicon" version = "0.12.12" @@ -6072,7 +6359,7 @@ dependencies = [ "async-trait", "bytes", "flex-error", - "getrandom 0.2.11", + "getrandom 0.2.15", "peg", "pin-project", "rand 0.8.5", @@ -6316,6 +6603,18 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + [[package]] name = "toml" version = "0.8.2" @@ -6343,7 +6642,9 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", + "serde", + "serde_spanned", "toml_datetime", "winnow 0.5.25", ] @@ -6354,7 +6655,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -6367,7 +6668,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", "toml_datetime", "winnow 0.5.25", ] @@ -6450,7 +6751,6 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -6511,7 +6811,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" name = "tx_become_validator" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6520,7 +6820,7 @@ dependencies = [ name = "tx_bond" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada", "namada_test_utils", "namada_tests", @@ -6537,7 +6837,7 @@ dependencies = [ name = "tx_bridge_pool" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6546,7 +6846,7 @@ dependencies = [ name = "tx_change_consensus_key" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6555,7 +6855,7 @@ dependencies = [ name = "tx_change_validator_commission" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada", "namada_test_utils", "namada_tests", @@ -6572,7 +6872,7 @@ dependencies = [ name = "tx_change_validator_metadata" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6581,7 +6881,7 @@ dependencies = [ name = "tx_claim_rewards" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6590,7 +6890,7 @@ dependencies = [ name = "tx_deactivate_validator" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6599,7 +6899,7 @@ dependencies = [ name = "tx_ibc" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6608,7 +6908,7 @@ dependencies = [ name = "tx_init_account" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6617,7 +6917,7 @@ dependencies = [ name = "tx_init_proposal" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6626,7 +6926,7 @@ dependencies = [ name = "tx_reactivate_validator" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6635,7 +6935,7 @@ dependencies = [ name = "tx_redelegate" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada", "namada_test_utils", "namada_tests", @@ -6652,7 +6952,7 @@ dependencies = [ name = "tx_resign_steward" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6661,7 +6961,7 @@ dependencies = [ name = "tx_reveal_pk" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6670,7 +6970,7 @@ dependencies = [ name = "tx_transfer" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6679,7 +6979,7 @@ dependencies = [ name = "tx_unbond" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada", "namada_test_utils", "namada_tests", @@ -6696,7 +6996,7 @@ dependencies = [ name = "tx_unjail_validator" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6705,7 +7005,7 @@ dependencies = [ name = "tx_update_account" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6714,7 +7014,7 @@ dependencies = [ name = "tx_update_steward_commission" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6723,7 +7023,7 @@ dependencies = [ name = "tx_vote_proposal" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tx_prelude", "wee_alloc", ] @@ -6732,7 +7032,7 @@ dependencies = [ name = "tx_withdraw" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada", "namada_test_utils", "namada_tests", @@ -6853,6 +7153,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "untrusted" version = "0.7.1" @@ -6874,15 +7180,22 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "serde", ] @@ -6902,7 +7215,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" name = "vp_implicit" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada", "namada_test_utils", "namada_tests", @@ -6919,7 +7232,7 @@ dependencies = [ name = "vp_user" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada", "namada_test_utils", "namada_tests", @@ -7058,46 +7371,38 @@ dependencies = [ [[package]] name = "wasmer" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce4a267a570e121c9375136adefa2c48810273907de9c6817bc19db4d6144bc" dependencies = [ + "bytes", "cfg-if 1.0.0", + "derivative", "indexmap 1.9.3", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", "target-lexicon", "thiserror", + "tracing", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", "wasmer-compiler-cranelift", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", "wat", "winapi", ] -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", -] - [[package]] name = "wasmer-cache" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a40804bcc2567f112003182fc5edc29584da5199c4a1f5a8d6a6e4b65feff0" dependencies = [ "blake3", "hex", @@ -7107,31 +7412,42 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9c23098e86ef1038155684fe50f0c1079a0e2a2e70f115b789df17e6ba98d20" dependencies = [ + "backtrace", + "bytes", + "cfg-if 1.0.0", + "enum-iterator", "enumset", - "loupe", + "lazy_static", + "leb128", + "memmap2 0.5.10", + "more-asserts", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", - "target-lexicon", "thiserror", "wasmer-types", - "wasmparser 0.83.0", + "wasmer-vm", + "wasmparser 0.121.2", + "winapi", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95287b79973ad5f485215733ef9f0d4bb951a6b7e655585d2bd3d4a4ba1253c9" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "gimli 0.26.2", - "loupe", "more-asserts", "rayon", "smallvec", @@ -7139,185 +7455,128 @@ dependencies = [ "tracing", "wasmer-compiler", "wasmer-types", - "wasmer-vm", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d78d59be3ce78ad859e176b88f0d5bec0120ece0684922d7c5da1289e251b1" dependencies = [ "byteorder", "dynasm", "dynasmrt", + "enumset", "gimli 0.26.2", "lazy_static", - "loupe", "more-asserts", "rayon", "smallvec", "wasmer-compiler", "wasmer-types", - "wasmer-vm", ] [[package]] -name = "wasmer-derive" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wasmer-engine" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", - "wasmer-vm", -] - -[[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +name = "wasmer-config" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a0f70c177b1c5062cfe0f5308c3317751796fef9403c22a0cd7b4cacd4ccd8" dependencies = [ - "cfg-if 1.0.0", - "enum-iterator", - "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.4", - "rkyv", + "anyhow", + "bytesize", + "derive_builder", + "hex", + "indexmap 2.2.6", + "schemars", + "semver 1.0.20", "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", -] - -[[package]] -name = "wasmer-engine-universal" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "cfg-if 1.0.0", - "enumset", - "leb128", - "loupe", - "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", - "wasmer-types", - "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", + "serde_cbor", + "serde_json", + "serde_yaml", "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "toml 0.8.2", + "url", ] [[package]] -name = "wasmer-object" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +name = "wasmer-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48f36aeeecb655f15fdd358bdf6e4cec27df181468fa4226084157e8462bd5e" dependencies = [ - "object 0.28.4", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "wasmer-types" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83cb97b6b20084757a2a8d548dc0d4179c3fe9e2d711740423a1e6aa3f8b9091" dependencies = [ - "backtrace", + "bytecheck", "enum-iterator", + "enumset", + "getrandom 0.2.15", + "hex", "indexmap 1.9.3", - "loupe", + "more-asserts", "rkyv", - "serde", + "sha2 0.10.8", + "target-lexicon", "thiserror", + "webc", + "xxhash-rust", ] [[package]] name = "wasmer-vm" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc1e19d986844b17b927ec8b0c7f3da6a7a2c2cb3b0f8ca5d4cb1a1f71bfb124" dependencies = [ "backtrace", "cc", "cfg-if 1.0.0", "corosensei", + "crossbeam-queue", + "dashmap", + "derivative", "enum-iterator", + "fnv", "indexmap 1.9.3", "lazy_static", "libc", - "loupe", "mach", - "memoffset 0.6.5", + "memoffset", "more-asserts", "region", - "rkyv", "scopeguard", - "serde", "thiserror", - "wasmer-artifact", "wasmer-types", "winapi", ] [[package]] name = "wasmparser" -version = "0.83.0" +version = "0.107.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +dependencies = [ + "indexmap 1.9.3", + "semver 1.0.20", +] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ - "indexmap 1.9.3", + "bitflags 2.5.0", + "indexmap 2.2.6", "semver 1.0.20", ] @@ -7366,6 +7625,36 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webc" +version = "6.0.0-alpha9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b4e8dd987046eede4348d660404ff990412631b7d493f9e547adcf2862cd5" +dependencies = [ + "anyhow", + "base64 0.21.7", + "bytes", + "cfg-if 1.0.0", + "clap", + "document-features", + "flate2", + "indexmap 1.9.3", + "libc", + "once_cell", + "semver 1.0.20", + "serde", + "serde_cbor", + "serde_json", + "sha2 0.10.8", + "shared-buffer", + "tar", + "tempfile", + "thiserror", + "toml 0.7.8", + "url", + "wasmer-config", +] + [[package]] name = "webpki-roots" version = "0.25.3" @@ -7667,6 +7956,23 @@ dependencies = [ "tap", ] +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + [[package]] name = "zcash_encoding" version = "0.2.0" diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index 890a3b6c61..ad76e0cf0f 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -40,7 +40,7 @@ namada_vp_prelude = { path = "../crates/vp_prelude" } once_cell = { version = "1.8.0" } wee_alloc = "0.4.5" -getrandom = { version = "0.2", features = ["custom"] } +getrandom = { version = "0.2.15", features = ["custom"] } [profile.release] # smaller and faster wasm (https://rustwasm.github.io/book/reference/code-size.html#compiling-with-link-time-optimizations-lto) diff --git a/wasm/tx_bond/Cargo.toml b/wasm/tx_bond/Cargo.toml index 7c4a73c733..df1dd9a5f4 100644 --- a/wasm/tx_bond/Cargo.toml +++ b/wasm/tx_bond/Cargo.toml @@ -14,7 +14,7 @@ wee_alloc.workspace = true getrandom.workspace = true [dev-dependencies] -namada = {path = "../../crates/namada"} +namada = {path = "../../crates/namada", default-features = false} namada_tests = {path = "../../crates/tests"} namada_test_utils = {path = "../../crates/test_utils"} namada_tx_prelude = { workspace = true, features = ["testing"] } diff --git a/wasm/tx_change_validator_commission/Cargo.toml b/wasm/tx_change_validator_commission/Cargo.toml index d2905316ff..87815504b3 100644 --- a/wasm/tx_change_validator_commission/Cargo.toml +++ b/wasm/tx_change_validator_commission/Cargo.toml @@ -14,7 +14,7 @@ wee_alloc.workspace = true getrandom.workspace = true [dev-dependencies] -namada = {path = "../../crates/namada"} +namada = {path = "../../crates/namada", default-features = false} namada_tests = {path = "../../crates/tests"} namada_test_utils = {path = "../../crates/test_utils"} namada_vp_prelude = {path = "../../crates/vp_prelude"} diff --git a/wasm/tx_redelegate/Cargo.toml b/wasm/tx_redelegate/Cargo.toml index cd3e662f75..1c567420b2 100644 --- a/wasm/tx_redelegate/Cargo.toml +++ b/wasm/tx_redelegate/Cargo.toml @@ -14,7 +14,7 @@ wee_alloc.workspace = true getrandom.workspace = true [dev-dependencies] -namada = {path = "../../crates/namada"} +namada = {path = "../../crates/namada", default-features = false} namada_tests = {path = "../../crates/tests"} namada_test_utils = {path = "../../crates/test_utils"} namada_tx_prelude = { workspace = true, features = ["testing"] } diff --git a/wasm/tx_unbond/Cargo.toml b/wasm/tx_unbond/Cargo.toml index 75cc46c9f8..a8918cddf2 100644 --- a/wasm/tx_unbond/Cargo.toml +++ b/wasm/tx_unbond/Cargo.toml @@ -14,7 +14,7 @@ wee_alloc.workspace = true getrandom.workspace = true [dev-dependencies] -namada = {path = "../../crates/namada"} +namada = {path = "../../crates/namada", default-features = false} namada_tests = {path = "../../crates/tests"} namada_test_utils = {path = "../../crates/test_utils"} namada_tx_prelude = { workspace = true, features = ["testing"] } diff --git a/wasm/tx_withdraw/Cargo.toml b/wasm/tx_withdraw/Cargo.toml index f447b81cc0..62d5daa30d 100644 --- a/wasm/tx_withdraw/Cargo.toml +++ b/wasm/tx_withdraw/Cargo.toml @@ -14,7 +14,7 @@ wee_alloc.workspace = true getrandom.workspace = true [dev-dependencies] -namada = {path = "../../crates/namada"} +namada = {path = "../../crates/namada", default-features = false} namada_tests = {path = "../../crates/tests"} namada_test_utils = {path = "../../crates/test_utils"} namada_tx_prelude = { workspace = true, features = ["testing"] } diff --git a/wasm/vp_implicit/Cargo.toml b/wasm/vp_implicit/Cargo.toml index 6a3487b74d..e237b39337 100644 --- a/wasm/vp_implicit/Cargo.toml +++ b/wasm/vp_implicit/Cargo.toml @@ -15,7 +15,7 @@ wee_alloc.workspace = true getrandom.workspace = true [dev-dependencies] -namada = {path = "../../crates/namada"} +namada = {path = "../../crates/namada", default-features = false} namada_tests = {path = "../../crates/tests"} namada_test_utils = {path = "../../crates/test_utils"} namada_vp_prelude = {path = "../../crates/vp_prelude"} diff --git a/wasm/vp_user/Cargo.toml b/wasm/vp_user/Cargo.toml index fdcc100666..e10d44d4c7 100644 --- a/wasm/vp_user/Cargo.toml +++ b/wasm/vp_user/Cargo.toml @@ -15,7 +15,7 @@ wee_alloc.workspace = true getrandom.workspace = true [dev-dependencies] -namada = {path = "../../crates/namada"} +namada = {path = "../../crates/namada", default-features = false} namada_tests = {path = "../../crates/tests"} namada_test_utils = {path = "../../crates/test_utils"} namada_vp_prelude = {path = "../../crates/vp_prelude"} diff --git a/wasm_for_tests/Cargo.lock b/wasm_for_tests/Cargo.lock index cc34f08061..66bc05e21f 100644 --- a/wasm_for_tests/Cargo.lock +++ b/wasm_for_tests/Cargo.lock @@ -54,7 +54,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "once_cell", "version_check", ] @@ -83,6 +83,55 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.75" @@ -304,7 +353,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.32.1", + "object", "rustc-demangle", ] @@ -661,6 +710,15 @@ dependencies = [ "serde", ] +[[package]] +name = "bytesize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +dependencies = [ + "serde", +] + [[package]] name = "camino" version = "1.1.6" @@ -787,6 +845,46 @@ dependencies = [ "version_check", ] +[[package]] +name = "clap" +version = "4.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.65", +] + +[[package]] +name = "clap_lex" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + [[package]] name = "clru" version = "0.5.0" @@ -844,6 +942,12 @@ dependencies = [ "thiserror", ] +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + [[package]] name = "concat-idents" version = "1.1.5" @@ -994,56 +1098,74 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" +checksum = "2a2ab4512dfd3a6f4be184403a195f76e81a8a9f9e6c898e19d2dc3ce20e0115" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" +checksum = "98b022ed2a5913a38839dfbafe6cf135342661293b08049843362df4301261dc" dependencies = [ + "arrayvec", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", + "cranelift-egraph", "cranelift-entity", + "cranelift-isle", "gimli 0.26.2", "log", - "regalloc", + "regalloc2", "smallvec", "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" +checksum = "639307b45434ad112a98f8300c0f0ab085cbefcd767efcdef9ef19d4c0756e74" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" +checksum = "278e52e29c53fcf32431ef08406c295699a70306d05a0715c5b1bf50e33a9ab7" + +[[package]] +name = "cranelift-egraph" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624b54323b06e675293939311943ba82d323bb340468ce1889be5da7932c8d73" +dependencies = [ + "cranelift-entity", + "fxhash", + "hashbrown 0.12.3", + "indexmap 1.9.3", + "log", + "smallvec", +] [[package]] name = "cranelift-entity" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" +checksum = "9a59bcbca89c3f1b70b93ab3cbba5e5e0cbf3e63dadb23c7525cb142e21a9d4c" [[package]] name = "cranelift-frontend" -version = "0.82.3" +version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" +checksum = "0d70abacb8cfef3dc8ff7e8836e9c1d70f7967dfdac824a4cd5e30223415aca6" dependencies = [ "cranelift-codegen", "log", @@ -1051,6 +1173,12 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cranelift-isle" +version = "0.91.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "393bc73c451830ff8dbb3a07f61843d6cb41a084f9996319917c0b291ed785bb" + [[package]] name = "crc32fast" version = "1.3.2" @@ -1080,10 +1208,19 @@ dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", - "memoffset 0.9.0", + "memoffset", "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.19" @@ -1180,14 +1317,38 @@ dependencies = [ "serde", ] +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + [[package]] name = "darling" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.3", + "darling_macro 0.20.3", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", ] [[package]] @@ -1203,17 +1364,41 @@ dependencies = [ "syn 2.0.65", ] +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + [[package]] name = "darling_macro" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core", + "darling_core 0.20.3", "quote", "syn 2.0.65", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if 1.0.0", + "hashbrown 0.14.3", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "data-encoding" version = "2.5.0" @@ -1256,6 +1441,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1319,6 +1535,15 @@ dependencies = [ "syn 2.0.65", ] +[[package]] +name = "document-features" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" +dependencies = [ + "litrs", +] + [[package]] name = "dunce" version = "1.0.4" @@ -1368,7 +1593,7 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] @@ -1514,7 +1739,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ - "darling", + "darling 0.20.3", "proc-macro2", "quote", "syn 2.0.65", @@ -1893,6 +2118,18 @@ dependencies = [ "subtle", ] +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "windows-sys 0.52.0", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1911,6 +2148,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "flex-error" version = "0.4.4" @@ -2105,9 +2352,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -2189,7 +2436,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.11", - "indexmap 2.1.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -2197,13 +2444,10 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.11.2" +name = "half" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "hashbrown" @@ -3065,20 +3309,21 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +version = "2.2.4" +source = "git+https://github.com/heliaxdev/indexmap?tag=2.2.4-heliax-1#b5b5b547bd6ab04bbb16e060326a50ddaeb6c909" dependencies = [ + "borsh 1.2.1", "equivalent", "hashbrown 0.14.3", + "serde", ] [[package]] name = "indexmap" -version = "2.2.4" -source = "git+https://github.com/heliaxdev/indexmap?tag=2.2.4-heliax-1#b5b5b547bd6ab04bbb16e060326a50ddaeb6c909" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ - "borsh 1.2.1", "equivalent", "hashbrown 0.14.3", "serde", @@ -3137,6 +3382,12 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.11.0" @@ -3260,16 +3511,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - [[package]] name = "libm" version = "0.2.8" @@ -3293,6 +3534,12 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.11" @@ -3309,27 +3556,6 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -[[package]] -name = "loupe" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap 1.9.3", - "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 1.0.109", -] - [[package]] name = "mach" version = "0.3.2" @@ -3393,7 +3619,7 @@ dependencies = [ "blake2b_simd", "bls12_381", "directories", - "getrandom 0.2.11", + "getrandom 0.2.15", "group", "itertools 0.11.0", "jubjub", @@ -3436,12 +3662,12 @@ dependencies = [ ] [[package]] -name = "memoffset" -version = "0.6.5" +name = "memmap2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ - "autocfg", + "libc", ] [[package]] @@ -3533,7 +3759,6 @@ dependencies = [ "ethers", "eyre", "itertools 0.12.1", - "loupe", "masp_primitives", "masp_proofs", "namada_account", @@ -3572,8 +3797,6 @@ dependencies = [ "wasmer", "wasmer-cache", "wasmer-compiler-singlepass", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-vm", "wasmparser 0.107.0", "wasmtimer", @@ -4257,18 +4480,6 @@ dependencies = [ "syn 2.0.65", ] -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap 1.9.3", - "memchr", -] - [[package]] name = "object" version = "0.32.1" @@ -4322,7 +4533,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6624905ddd92e460ff0685567539ed1ac985b2dee4c92c7edcd64fce905b00c" dependencies = [ "ct-codecs", - "getrandom 0.2.11", + "getrandom 0.2.15", "subtle", "zeroize", ] @@ -4525,7 +4736,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap 2.2.6", ] [[package]] @@ -4863,7 +5074,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", ] [[package]] @@ -4952,19 +5163,20 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "libredox", "thiserror", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regalloc2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" dependencies = [ + "fxhash", "log", - "rustc-hash", + "slice-group-by", "smallvec", ] @@ -5100,7 +5312,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "getrandom 0.2.11", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -5125,6 +5337,7 @@ dependencies = [ "bitvec", "bytecheck", "hashbrown 0.12.3", + "indexmap 1.9.3", "ptr_meta", "rend", "rkyv_derive", @@ -5323,6 +5536,7 @@ dependencies = [ "schemars_derive", "serde", "serde_json", + "url", ] [[package]] @@ -5386,6 +5600,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + [[package]] name = "semver" version = "0.11.0" @@ -5427,9 +5647,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] @@ -5452,6 +5672,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_bytes" version = "0.11.12" @@ -5461,11 +5692,21 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", @@ -5526,6 +5767,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "serdect" version = "0.2.0" @@ -5579,6 +5833,16 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -5631,6 +5895,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + [[package]] name = "slip10_ed25519" version = "0.1.3" @@ -5730,6 +6000,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strum" version = "0.24.1" @@ -5862,6 +6138,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "target-lexicon" version = "0.12.12" @@ -6009,7 +6296,7 @@ dependencies = [ "async-trait", "bytes", "flex-error", - "getrandom 0.2.11", + "getrandom 0.2.15", "peg", "pin-project", "rand 0.8.5", @@ -6253,6 +6540,18 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + [[package]] name = "toml" version = "0.8.2" @@ -6280,7 +6579,9 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", + "serde", + "serde_spanned", "toml_datetime", "winnow 0.5.25", ] @@ -6291,7 +6592,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -6376,7 +6677,6 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -6437,7 +6737,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" name = "tx_fail" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "proptest", @@ -6451,7 +6751,7 @@ dependencies = [ name = "tx_infinite_guest_gas" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "proptest", @@ -6465,7 +6765,7 @@ dependencies = [ name = "tx_infinite_host_gas" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "proptest", @@ -6479,7 +6779,7 @@ dependencies = [ name = "tx_invalid_data" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "proptest", @@ -6493,7 +6793,7 @@ dependencies = [ name = "tx_memory_limit" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "proptest", @@ -6507,7 +6807,7 @@ dependencies = [ name = "tx_no_op" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "proptest", @@ -6521,7 +6821,7 @@ dependencies = [ name = "tx_proposal_code" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "proptest", @@ -6535,7 +6835,7 @@ dependencies = [ name = "tx_proposal_ibc_token_inflation" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "proptest", @@ -6549,7 +6849,7 @@ dependencies = [ name = "tx_proposal_masp_reward" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "proptest", @@ -6563,7 +6863,7 @@ dependencies = [ name = "tx_read_storage_key" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "proptest", @@ -6577,7 +6877,7 @@ dependencies = [ name = "tx_write" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_test_utils", "namada_tests", "namada_tx_prelude", @@ -6696,6 +6996,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "untrusted" version = "0.7.1" @@ -6717,15 +7023,22 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "serde", ] @@ -6745,7 +7058,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" name = "vp_always_false" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_vp_prelude", "proptest", @@ -6759,7 +7072,7 @@ dependencies = [ name = "vp_always_true" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_vp_prelude", "proptest", @@ -6773,7 +7086,7 @@ dependencies = [ name = "vp_eval" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "namada_vp_prelude", @@ -6788,7 +7101,7 @@ dependencies = [ name = "vp_infinite_guest_gas" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_vp_prelude", "proptest", @@ -6802,7 +7115,7 @@ dependencies = [ name = "vp_infinite_host_gas" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_tx_prelude", "namada_vp_prelude", @@ -6817,7 +7130,7 @@ dependencies = [ name = "vp_memory_limit" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_vp_prelude", "proptest", @@ -6831,7 +7144,7 @@ dependencies = [ name = "vp_read_storage_key" version = "0.37.0" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "namada_tests", "namada_vp_prelude", "proptest", @@ -6967,46 +7280,38 @@ dependencies = [ [[package]] name = "wasmer" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce4a267a570e121c9375136adefa2c48810273907de9c6817bc19db4d6144bc" dependencies = [ + "bytes", "cfg-if 1.0.0", + "derivative", "indexmap 1.9.3", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", "target-lexicon", "thiserror", + "tracing", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", "wasmer-compiler-cranelift", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", "wat", "winapi", ] -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", -] - [[package]] name = "wasmer-cache" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a40804bcc2567f112003182fc5edc29584da5199c4a1f5a8d6a6e4b65feff0" dependencies = [ "blake3", "hex", @@ -7016,31 +7321,42 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9c23098e86ef1038155684fe50f0c1079a0e2a2e70f115b789df17e6ba98d20" dependencies = [ + "backtrace", + "bytes", + "cfg-if 1.0.0", + "enum-iterator", "enumset", - "loupe", + "lazy_static", + "leb128", + "memmap2 0.5.10", + "more-asserts", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", - "target-lexicon", "thiserror", "wasmer-types", - "wasmparser 0.83.0", + "wasmer-vm", + "wasmparser 0.121.2", + "winapi", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95287b79973ad5f485215733ef9f0d4bb951a6b7e655585d2bd3d4a4ba1253c9" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "gimli 0.26.2", - "loupe", "more-asserts", "rayon", "smallvec", @@ -7048,185 +7364,128 @@ dependencies = [ "tracing", "wasmer-compiler", "wasmer-types", - "wasmer-vm", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d78d59be3ce78ad859e176b88f0d5bec0120ece0684922d7c5da1289e251b1" dependencies = [ "byteorder", "dynasm", "dynasmrt", + "enumset", "gimli 0.26.2", "lazy_static", - "loupe", "more-asserts", "rayon", "smallvec", "wasmer-compiler", "wasmer-types", - "wasmer-vm", ] [[package]] -name = "wasmer-derive" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wasmer-engine" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", - "wasmer-vm", -] - -[[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +name = "wasmer-config" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a0f70c177b1c5062cfe0f5308c3317751796fef9403c22a0cd7b4cacd4ccd8" dependencies = [ - "cfg-if 1.0.0", - "enum-iterator", - "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.4", - "rkyv", + "anyhow", + "bytesize", + "derive_builder", + "hex", + "indexmap 2.2.6", + "schemars", + "semver 1.0.20", "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", -] - -[[package]] -name = "wasmer-engine-universal" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "cfg-if 1.0.0", - "enumset", - "leb128", - "loupe", - "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", - "wasmer-types", - "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" -dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", + "serde_cbor", + "serde_json", + "serde_yaml", "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "toml 0.8.2", + "url", ] [[package]] -name = "wasmer-object" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +name = "wasmer-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48f36aeeecb655f15fdd358bdf6e4cec27df181468fa4226084157e8462bd5e" dependencies = [ - "object 0.28.4", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "wasmer-types" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83cb97b6b20084757a2a8d548dc0d4179c3fe9e2d711740423a1e6aa3f8b9091" dependencies = [ - "backtrace", + "bytecheck", "enum-iterator", + "enumset", + "getrandom 0.2.15", + "hex", "indexmap 1.9.3", - "loupe", + "more-asserts", "rkyv", - "serde", + "sha2 0.10.8", + "target-lexicon", "thiserror", + "webc", + "xxhash-rust", ] [[package]] name = "wasmer-vm" -version = "2.3.0" -source = "git+https://github.com/heliaxdev/wasmer?rev=255054f7f58b7b4a525f2fee6b9b86422d1ca15b#255054f7f58b7b4a525f2fee6b9b86422d1ca15b" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc1e19d986844b17b927ec8b0c7f3da6a7a2c2cb3b0f8ca5d4cb1a1f71bfb124" dependencies = [ "backtrace", "cc", "cfg-if 1.0.0", "corosensei", + "crossbeam-queue", + "dashmap", + "derivative", "enum-iterator", + "fnv", "indexmap 1.9.3", "lazy_static", "libc", - "loupe", "mach", - "memoffset 0.6.5", + "memoffset", "more-asserts", "region", - "rkyv", "scopeguard", - "serde", "thiserror", - "wasmer-artifact", "wasmer-types", "winapi", ] [[package]] name = "wasmparser" -version = "0.83.0" +version = "0.107.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +dependencies = [ + "indexmap 1.9.3", + "semver 1.0.20", +] [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ - "indexmap 1.9.3", + "bitflags 2.5.0", + "indexmap 2.2.6", "semver 1.0.20", ] @@ -7275,6 +7534,36 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webc" +version = "6.0.0-alpha9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b4e8dd987046eede4348d660404ff990412631b7d493f9e547adcf2862cd5" +dependencies = [ + "anyhow", + "base64 0.21.7", + "bytes", + "cfg-if 1.0.0", + "clap", + "document-features", + "flate2", + "indexmap 1.9.3", + "libc", + "once_cell", + "semver 1.0.20", + "serde", + "serde_cbor", + "serde_json", + "sha2 0.10.8", + "shared-buffer", + "tar", + "tempfile", + "thiserror", + "toml 0.7.8", + "url", + "wasmer-config", +] + [[package]] name = "webpki-roots" version = "0.25.3" @@ -7576,6 +7865,23 @@ dependencies = [ "tap", ] +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + [[package]] name = "zcash_encoding" version = "0.2.0" diff --git a/wasm_for_tests/Cargo.toml b/wasm_for_tests/Cargo.toml index 4aa5b90290..def83e389f 100644 --- a/wasm_for_tests/Cargo.toml +++ b/wasm_for_tests/Cargo.toml @@ -33,7 +33,7 @@ namada_test_utils = { path = "../crates/test_utils" } namada_tx_prelude = { path = "../crates/tx_prelude" } namada_vp_prelude = { path = "../crates/vp_prelude" } wee_alloc = "0.4.5" -getrandom = { version = "0.2", features = ["custom"] } +getrandom = { version = "0.2.15", features = ["custom"] } [profile.release] # smaller and faster wasm (https://rustwasm.github.io/book/reference/code-size.html#compiling-with-link-time-optimizations-lto)