diff --git a/Cargo.lock b/Cargo.lock index 5a50334..6a60771 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,22 +12,13 @@ dependencies = [ "regex", ] -[[package]] -name = "addr2line" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" -dependencies = [ - "gimli 0.26.2", -] - [[package]] name = "addr2line" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.27.2", + "gimli", ] [[package]] @@ -152,9 +143,9 @@ dependencies = [ [[package]] name = "array-bytes" -version = "4.2.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" [[package]] name = "arrayref" @@ -193,7 +184,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", ] [[package]] @@ -208,12 +199,12 @@ version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ - "addr2line 0.19.0", + "addr2line", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.30.3", + "object", "rustc-demangle", ] @@ -229,6 +220,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + [[package]] name = "base64ct" version = "1.6.0" @@ -246,9 +243,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.64.0" +version = "0.65.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" dependencies = [ "bitflags", "cexpr", @@ -256,12 +253,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", + "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] @@ -343,9 +341,9 @@ dependencies = [ [[package]] name = "bounded-collections" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbd1d11282a1eb134d3c3b7cf8ce213b5161c6e5f73fb1b98618482c606b64" +checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" dependencies = [ "log", "parity-scale-codec", @@ -435,9 +433,9 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.15.4" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" dependencies = [ "camino", "cargo-platform", @@ -467,9 +465,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.10.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9" dependencies = [ "smallvec", ] @@ -531,6 +529,16 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "colorchoice" version = "1.0.0" @@ -552,6 +560,28 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" +[[package]] +name = "const-random" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" +dependencies = [ + "const-random-macro", + "proc-macro-hack", +] + +[[package]] +name = "const-random-macro" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" +dependencies = [ + "getrandom 0.2.9", + "once_cell", + "proc-macro-hack", + "tiny-keccak", +] + [[package]] name = "constant_time_eq" version = "0.2.5" @@ -584,28 +614,27 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc42ba2e232e5b20ff7dc299a812d53337dadce9a7e39a238e6a5cb82d2e57b" +checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "253531aca9b6f56103c9420369db3263e784df39aa1c90685a1f69cfbba0623e" +checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" dependencies = [ - "arrayvec 0.7.2", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", "cranelift-isle", - "gimli 0.26.2", - "hashbrown 0.12.3", + "gimli", + "hashbrown 0.13.2", "log", "regalloc2", "smallvec", @@ -614,33 +643,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f2154365e2bff1b1b8537a7181591fdff50d8e27fa6e40d5c69c3bad0ca7c8" +checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687e14e3f5775248930e0d5a84195abef8b829958e9794bf8d525104993612b4" +checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" [[package]] name = "cranelift-entity" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8483c2db6f45fe9ace984e5adc5d058102227e4c62e5aa2054e16b0275fd3a6e" +checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" dependencies = [ "cranelift-codegen", "log", @@ -650,15 +679,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9793158837678902446c411741d87b43f57dadfb944f2440db4287cda8cbd59" +checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" [[package]] name = "cranelift-native" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72668c7755f2b880665cb422c8ad2d56db58a88b9bebfef0b73edc2277c13c49" +checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" dependencies = [ "cranelift-codegen", "libc", @@ -667,9 +696,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852ce4b088b44ac4e29459573943009a70d1b192c8d77ef949b4e814f656fc1" +checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -720,7 +749,7 @@ dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.8.0", + "memoffset", "scopeguard", ] @@ -807,6 +836,50 @@ dependencies = [ "zeroize", ] +[[package]] +name = "cxx" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "666a3ec767f4bbaf0dcfcc3b4ea048b90520b254fdf88813e763f4c762636c14" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c0c11acd0e63bae27dcd2afced407063312771212b7a823b4fd72d633be30fb" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.28", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6e8c238aadc4b9f2c00269d04c87abb23f96dd240803872536eed1a304bb40e" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59d9ffb4193dd22180b8d5747b1e095c3d9c9c665ce39b0483a488948f437e06" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + [[package]] name = "der" version = "0.7.6" @@ -890,12 +963,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - [[package]] name = "dyn-clonable" version = "0.9.0" @@ -1045,15 +1112,15 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "expander" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +checksum = "5f86a749cf851891866c10515ef6c299b5c69661465e9c3bbe7e07a2b77fb0f7" dependencies = [ "blake2", "fs-err", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] @@ -1097,6 +1164,18 @@ dependencies = [ "log", ] +[[package]] +name = "filetime" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1126,9 +1205,8 @@ dependencies = [ [[package]] name = "frame-benchmarking" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4abc114f98a623f17dd8a89d9c777def6c6ee4707ea46d412503ffdfd8dc053a" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-support-procedural", @@ -1152,9 +1230,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "15.1.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ "cfg-if", "parity-scale-codec", @@ -1164,9 +1242,8 @@ dependencies = [ [[package]] name = "frame-support" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80da0f683e5da274ff0401a02d16f4fb976686ed4286204fa00ab29207013d2c" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bitflags", "environmental", @@ -1175,7 +1252,7 @@ dependencies = [ "impl-trait-for-tuples", "k256", "log", - "once_cell", + "macro_magic", "parity-scale-codec", "paste", "scale-info", @@ -1185,6 +1262,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", + "sp-debug-derive", "sp-inherents", "sp-io", "sp-runtime", @@ -1198,51 +1276,50 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e680991289aa3e7b11609228642df005edd888b72b52fbbabb361d2b7cb1ed" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", + "expander", "frame-support-procedural-tools", "itertools", + "macro_magic", "proc-macro-warning", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "frame-support-procedural-tools" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd1ce0e420f441e4b5fc53cda17fd63f98147a392191ff3c94270d01110a070" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "frame-support-procedural-tools-derive" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64b7713ff42072fba1dadf3165fb4837e7d84d28fd7fae5f7d752a659607682" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "frame-system" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2030166945857f87e124b9535412c7d119ccb4bf6283e032ea2216e46ec97a9" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ + "cfg-if", "frame-support", "log", "parity-scale-codec", @@ -1335,7 +1412,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", ] [[package]] @@ -1427,21 +1504,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" dependencies = [ "fallible-iterator", "indexmap", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" - [[package]] name = "glob" version = "0.3.1" @@ -1506,6 +1577,12 @@ dependencies = [ "ahash 0.8.3", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hermit-abi" version = "0.2.6" @@ -1820,9 +1897,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2182b8219fee6bd83aacaab7344e840179ae079d5216aa4e249b4d704646a844" +checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", @@ -1860,17 +1937,11 @@ dependencies = [ "winapi", ] -[[package]] -name = "libm" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - [[package]] name = "librocksdb-sys" -version = "0.8.3+7.4.4" +version = "0.11.0+8.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557b255ff04123fcc176162f56ed0c9cd42d8f357cf55b3fabeb60f7413741b3" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" dependencies = [ "bindgen", "bzip2-sys", @@ -1888,7 +1959,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" dependencies = [ "arrayref", - "base64", + "base64 0.13.1", "digest 0.9.0", "hmac-drbg", "libsecp256k1-core", @@ -1940,6 +2011,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "link-cplusplus" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +dependencies = [ + "cc", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1986,15 +2066,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "lru" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" -dependencies = [ - "hashbrown 0.12.3", -] - [[package]] name = "lz4" version = "1.24.0" @@ -2024,6 +2095,54 @@ dependencies = [ "libc", ] +[[package]] +name = "macro_magic" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "macro_magic_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c12469fc165526520dff2807c2975310ab47cf7190a45b99b49a7dc8befab17b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "macro_magic_macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.28", +] + [[package]] name = "matchers" version = "0.0.1" @@ -2067,15 +2186,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.8.0" @@ -2094,12 +2204,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "merlin" version = "2.0.1" @@ -2182,17 +2286,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-complex" version = "0.4.3" @@ -2229,7 +2322,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", - "num-bigint", "num-integer", "num-traits", ] @@ -2253,24 +2345,15 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" -dependencies = [ - "crc32fast", - "hashbrown 0.12.3", - "indexmap", - "memchr", -] - [[package]] name = "object" version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ + "crc32fast", + "hashbrown 0.13.2", + "indexmap", "memchr", ] @@ -2294,9 +2377,8 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "pallet-balances" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f2e3044b5556fb98038ae68f8c4dc30941b00f1047664437e1c2a16f5166bd" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -2330,9 +2412,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.5.0" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ddb756ca205bd108aee3c62c6d3c994e1df84a59b9d6d4a5ea42ee1fd5a9a28" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -2345,9 +2427,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.4" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2459,7 +2541,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", ] [[package]] @@ -2507,6 +2589,16 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettyplease" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" +dependencies = [ + "proc-macro2", + "syn 2.0.28", +] + [[package]] name = "primitive-types" version = "0.12.1" @@ -2530,22 +2622,28 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro-warning" -version = "0.2.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d4f284d87b9cedc2ff57223cbc4e3937cd6063c01e92c8e2a8c080df0013933" +checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "proc-macro2" -version = "1.0.58" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -2575,9 +2673,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.27" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -2733,14 +2831,14 @@ checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", ] [[package]] name = "regalloc2" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" +checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" dependencies = [ "fxhash", "log", @@ -2780,18 +2878,6 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" -[[package]] -name = "region" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -2804,9 +2890,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" dependencies = [ "libc", "librocksdb-sys", @@ -2890,9 +2976,8 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9125c40a62c10913294a32a27ec94453898198c41243c31c254c8d578df1c2bc" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "log", "sp-core", @@ -2902,9 +2987,8 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "659086026d731c1c503f1ca80073230cfab52afee990542e9146e8ee8fdc40d0" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "fnv", "futures", @@ -2920,18 +3004,17 @@ dependencies = [ "sp-core", "sp-database", "sp-externalities", - "sp-keystore", "sp-runtime", "sp-state-machine", + "sp-statement-store", "sp-storage", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f2188a7355b5997448788e175a7a44b0caa12eee505f291fb593aed51966d8" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "kvdb", @@ -2956,16 +3039,14 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f56163cb9950689d8be465735982cf455d559d6bae7c65f01cf79fb32cc97e0" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "lru", "parity-scale-codec", "parking_lot", "sc-executor-common", - "sc-executor-wasmi", "sc-executor-wasmtime", + "schnellru", "sp-api", "sp-core", "sp-externalities", @@ -2976,48 +3057,29 @@ dependencies = [ "sp-version", "sp-wasm-interface", "tracing", - "wasmi", ] [[package]] name = "sc-executor-common" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a039005564f63a1803e59888e0a0b9345d984d260bf8f8a3dfc06ab4d2d9ead1" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface", "thiserror", "wasm-instrument", - "wasmi", -] - -[[package]] -name = "sc-executor-wasmi" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "511a186b611402910e35676fb5d2be66f98dd148c32f9ac0b7ee9a83a403ff3c" -dependencies = [ - "log", - "sc-allocator", - "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", - "wasmi", ] [[package]] name = "sc-executor-wasmtime" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c03401def5d2b833406713d0adcd3403e810e6c54b5f430e83c1e581a93882" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "anyhow", "cfg-if", "libc", "log", - "once_cell", "rustix 0.36.13", "sc-allocator", "sc-executor-common", @@ -3028,9 +3090,8 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c60607de5e5c7ff91a0b90147209b838bace62ccc9b0b420b60a5c52f66ccd7" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "log", "parity-scale-codec", @@ -3040,24 +3101,24 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb9259fbf4d6bb05314e8194b3b0484d1b85488109c75d724455c3817023c4a" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", "log", + "parity-scale-codec", "serde", "sp-blockchain", + "sp-core", "sp-runtime", "thiserror", ] [[package]] name = "sc-utils" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424e0af91552772a6c14a58be7b3d9db598cedbf2f3c4f1fc44c9e1d3139258f" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-channel", "futures", @@ -3130,6 +3191,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" + [[package]] name = "sec1" version = "0.7.2" @@ -3197,22 +3264,22 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", ] [[package]] @@ -3370,15 +3437,17 @@ dependencies = [ [[package]] name = "sp-api" -version = "19.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2600bccfb4897e030d8974a17cfb1abfb3151d1f130db4ed4af1aa3ded436e1" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "log", "parity-scale-codec", + "scale-info", "sp-api-proc-macro", "sp-core", + "sp-externalities", + "sp-metadata-ir", "sp-runtime", "sp-state-machine", "sp-std", @@ -3389,9 +3458,8 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58a2f5386a0eb163fcb68b8057b3623cb8efa1470153aa5a9dac13907dbb95d" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "blake2", @@ -3399,14 +3467,13 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "sp-application-crypto" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf23435a4bbd6eeec2bbbc346719ba4f3200e0ddb5f9e9f06c1724db03a8410" +version = "23.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -3418,9 +3485,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3d3507a803e8bc332fa290ed3015a7b51d4436ce2b836744642fc412040456" +version = "16.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "integer-sqrt", "num-traits", @@ -3433,15 +3499,14 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f599badbd075bc6e56fd95cacb3ed09cd46693d56c303cd5a9838a294755076f" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "log", - "lru", "parity-scale-codec", "parking_lot", + "schnellru", "sp-api", "sp-consensus", "sp-database", @@ -3452,9 +3517,8 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6490d6f21d72a11c8cdd6b4155aa43c5d2886de8ca2b6cfb2ca9594bbb9547c8" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -3468,9 +3532,8 @@ dependencies = [ [[package]] name = "sp-core" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7789372146f8ad40d0b40fad0596cb1db5771187a258eabe19b06f00767fcbd6" +version = "21.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "bitflags", @@ -3489,6 +3552,7 @@ dependencies = [ "merlin", "parity-scale-codec", "parking_lot", + "paste", "primitive-types", "rand 0.8.5", "regex", @@ -3507,41 +3571,37 @@ dependencies = [ "substrate-bip39", "thiserror", "tiny-bip39", + "tracing", "zeroize", ] [[package]] name = "sp-core-hashing" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27449abdfbe41b473e625bce8113745e81d65777dd1d5a8462cf24137930dad8" +version = "9.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.6", "sha2 0.10.6", "sha3", - "sp-std", "twox-hash", ] [[package]] name = "sp-core-hashing-proc-macro" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23061dbb10975058aaca7965991386d93d0ffa1c4316094357ce65814a0a2a1e" +version = "9.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "proc-macro2", "quote", "sp-core-hashing", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "sp-database" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd6ef59a4a9e1945d5b49eb10a957b9d6b1c83af8379351baf0fa8ec12d8d64" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "kvdb", "parking_lot", @@ -3549,20 +3609,18 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62211eed9ef9dac4b9d837c56ccc9f8ee4fc49d9d9b7e6b9daf098fe173389ab" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "sp-externalities" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae0f275760689aaefe967943331d458cd99f5169d18364365d4cb584b246d1c" +version = "0.19.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "environmental", "parity-scale-codec", @@ -3572,15 +3630,13 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "19.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802044b0af966f76f0f42c23b24349c8f6f267e3ce4165244ac01bd0a49f7bb7" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-core", "sp-runtime", "sp-std", "thiserror", @@ -3588,14 +3644,12 @@ dependencies = [ [[package]] name = "sp-io" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd3431c245992fe51b8256c838fc2e981f8d3b0afc1d1377ca7dbe0a3287a764" +version = "23.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bytes", "ed25519", "ed25519-dalek", - "futures", "libsecp256k1", "log", "parity-scale-codec", @@ -3615,15 +3669,11 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452d079f592c97369c9ca8a5083b25f146751c6b5af10cbcacc2b24dc53fd72a" +version = "0.27.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "futures", - "merlin", "parity-scale-codec", "parking_lot", - "schnorrkel", "sp-core", "sp-externalities", "thiserror", @@ -3631,19 +3681,28 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5df7732c6f130c3e819b142dc76bff0380133b65095567891c0a6a888c147fa3" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "thiserror", - "zstd", + "zstd 0.12.4", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-std", ] [[package]] name = "sp-panic-handler" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75986cc917d897e0f6d0c848088064df4c74ccbb8f1c1848700b725f5ca7fe04" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "backtrace", "lazy_static", @@ -3652,9 +3711,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "23.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6220216caa67e3d931c693b06a3590dfcaa255f19bb3c3e3150f1672b8bc53f6" +version = "24.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "either", "hash256-std-hasher", @@ -3675,9 +3733,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5d0cd80200bf85b8b064238b2508b69b6146b13adf36066ec5d924825af737" +version = "17.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -3694,25 +3751,25 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ae5b00aef477127ddb6177b3464ad1e2bdcc12ee913fc5dfc9d065c6cea89b" +version = "11.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "sp-staking" -version = "19.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04b95b340fdd272af8bbec8dbc80996931a04b89d3d1edac555dcdd447f5982d" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", + "serde", "sp-core", "sp-runtime", "sp-std", @@ -3720,9 +3777,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e49c3bfcc8c832c34552cd8194180cc60508c6d3d9b0b9615d6b7c3e275019" +version = "0.28.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "log", @@ -3737,19 +3793,35 @@ dependencies = [ "sp-trie", "thiserror", "tracing", + "trie-db", +] + +[[package]] +name = "sp-statement-store" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-externalities", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "thiserror", ] [[package]] name = "sp-std" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de8eef39962b5b97478719c493bed2926cf70cb621005bbf68ebe58252ff986" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" [[package]] name = "sp-storage" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad1f8c52d4700ac7bc42b3375679a6c6fc1fe876f4b40c6efdf36f933ef0291" +version = "13.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -3761,9 +3833,8 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00fab60bf3d42255ce3f678903d3a2564662371c75623de4a1ffc7cac46143df" +version = "10.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "sp-std", @@ -3774,9 +3845,8 @@ dependencies = [ [[package]] name = "sp-trie" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58401c53c08b6ecad83acd7e14534c8bbcb3fa73e81e26685e0ac70e51b00c56" +version = "22.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ahash 0.8.3", "hash-db", @@ -3798,9 +3868,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34be5b74199bdda63e9ec48dc1e9dd605af947b76fba0c738a422a6d4ae14f47" +version = "22.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -3816,36 +3885,32 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a42f1acfd2bbaa92c4d97f7a0840e900a5dfa8e8d57b91c031c64f1df2112e90" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "sp-wasm-interface" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "153b7374179439e2aa783c66ed439bd86920c67bbc95d34c76390561972bc02f" +version = "14.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", "sp-std", - "wasmi", "wasmtime", ] [[package]] name = "sp-weights" -version = "19.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "123c661915e1bf328e21f8ecbe4e5247feba86f9149b782ea4348004547ce8ef" +version = "20.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -3900,6 +3965,47 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros 0.25.2", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "strum_macros" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.28", +] + [[package]] name = "substrate-bip39" version = "0.4.4" @@ -3915,9 +4021,8 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ef64b8fac4ecd85e4fcc7d6a8dfb8dccaec8b6754a8cd4c8112d6dc3afd240" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hyper", "log", @@ -3945,9 +4050,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.16" +version = "2.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" dependencies = [ "proc-macro2", "quote", @@ -4005,7 +4110,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", ] [[package]] @@ -4047,6 +4152,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -4146,7 +4260,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", ] [[package]] @@ -4293,6 +4407,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + [[package]] name = "unicode-xid" version = "0.2.4" @@ -4373,10 +4493,11 @@ dependencies = [ "ansi_term", "build-helper", "cargo_metadata", + "filetime", "frame-support", - "hash-db", "linregress", "parity-scale-codec", + "parity-wasm 0.45.0", "parking_lot", "paste", "rand 0.8.5", @@ -4393,12 +4514,14 @@ dependencies = [ "sp-state-machine", "sp-std", "sp-storage", + "strum 0.25.0", "tempfile", "thiserror", "toml 0.7.4", "walkdir", "wasm-bencher-procedural", "wasm-gc-api", + "wasm-opt", ] [[package]] @@ -4407,7 +4530,7 @@ version = "0.5.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] @@ -4448,7 +4571,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", "wasm-bindgen-shared", ] @@ -4470,7 +4593,7 @@ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4502,44 +4625,50 @@ dependencies = [ ] [[package]] -name = "wasmi" -version = "0.13.2" +name = "wasm-opt" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" +checksum = "87fef6d0d508f08334e0ab0e6877feb4c0ecb3956bcf2cb950699b22fedf3e9c" dependencies = [ - "parity-wasm 0.45.0", - "wasmi-validation", - "wasmi_core", + "anyhow", + "libc", + "strum 0.24.1", + "strum_macros 0.24.3", + "tempfile", + "thiserror", + "wasm-opt-cxx-sys", + "wasm-opt-sys", ] [[package]] -name = "wasmi-validation" -version = "0.5.0" +name = "wasm-opt-cxx-sys" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" +checksum = "bc816bbc1596c8f2e8127e137a760c798023ef3d378f2ae51f0f1840e2dfa445" dependencies = [ - "parity-wasm 0.45.0", + "anyhow", + "cxx", + "cxx-build", + "wasm-opt-sys", ] [[package]] -name = "wasmi_core" -version = "0.2.1" +name = "wasm-opt-sys" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" +checksum = "40199e4f68ef1071b3c6d0bd8026a12b481865d4b9e49c156932ea9a6234dd14" dependencies = [ - "downcast-rs", - "libm", - "memory_units", - "num-rational", - "num-traits", - "region", + "anyhow", + "cc", + "cxx", + "cxx-build", ] [[package]] name = "wasmparser" -version = "0.100.0" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ "indexmap", "url", @@ -4547,9 +4676,9 @@ dependencies = [ [[package]] name = "wasmtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", @@ -4557,7 +4686,7 @@ dependencies = [ "indexmap", "libc", "log", - "object 0.29.0", + "object", "once_cell", "paste", "psm", @@ -4570,26 +4699,26 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-asm-macros" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ceb3adf61d654be0be67fffdce42447b0880481348785be5fe40b5dd7663a4c" +checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64", + "base64 0.21.2", "bincode", "directories-next", "file-per-thread-logger", @@ -4598,15 +4727,15 @@ dependencies = [ "serde", "sha2 0.10.6", "toml 0.5.11", - "windows-sys 0.42.0", - "zstd", + "windows-sys 0.45.0", + "zstd 0.11.2+zstd.1.5.2", ] [[package]] name = "wasmtime-cranelift" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c366bb8647e01fd08cb5589976284b00abfded5529b33d7e7f3f086c68304a4" +checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" dependencies = [ "anyhow", "cranelift-codegen", @@ -4614,27 +4743,43 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.26.2", + "gimli", "log", - "object 0.29.0", + "object", "target-lexicon", "thiserror", "wasmparser", + "wasmtime-cranelift-shared", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-native", + "gimli", + "object", + "target-lexicon", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.26.2", + "gimli", "indexmap", "log", - "object 0.29.0", + "object", "serde", "target-lexicon", "thiserror", @@ -4644,18 +4789,18 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.17.0", + "addr2line", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.26.2", + "gimli", "log", - "object 0.29.0", + "object", "rustc-demangle", "serde", "target-lexicon", @@ -4663,36 +4808,36 @@ dependencies = [ "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-jit-debug" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ - "object 0.29.0", + "object", "once_cell", "rustix 0.36.13", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ "cfg-if", "libc", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-runtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", @@ -4702,21 +4847,21 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.6.5", + "memoffset", "paste", "rand 0.8.5", "rustix 0.36.13", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-types" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", @@ -4757,7 +4902,7 @@ version = "0.5.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", ] [[package]] @@ -4810,21 +4955,6 @@ dependencies = [ "windows-targets 0.48.0", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -4992,7 +5122,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.28", ] [[package]] @@ -5001,7 +5131,16 @@ version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ - "zstd-safe", + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", ] [[package]] @@ -5014,6 +5153,16 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + [[package]] name = "zstd-sys" version = "2.0.8+zstd.1.5.5" diff --git a/Cargo.toml b/Cargo.toml index 1c3a55e..19371cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,3 +14,20 @@ resolver = "2" [profile.dev] split-debuginfo = "unpacked" + +[workspace.dependencies] +sp-core = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sp-std = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sp-io = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sp-runtime-interface = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sp-runtime = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sp-state-machine = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sc-executor = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sc-executor-common = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sc-client-db = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sp-maybe-compressed-blob = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +frame-support = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +frame-system = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sp-externalities = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +sp-storage = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } +pallet-balances = { git="https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false } diff --git a/bencher/Cargo.toml b/bencher/Cargo.toml index ad5cd51..f74d6dc 100644 --- a/bencher/Cargo.toml +++ b/bencher/Cargo.toml @@ -10,7 +10,11 @@ edition = "2021" [dependencies] paste = "^1.0" build-helper = { version = "^0.1", optional = true } -cargo_metadata = { version = "^0.15", optional = true } +cargo_metadata = { version = "^0.17", optional = true } +strum = { version = "^0.25", features = ["derive"], optional = true } +filetime = { version = "^0.2", optional = true } +wasm-opt = { version = "^0.112", optional = true } +parity-wasm = { version = "0.45", optional = true } tempfile = { version = "^3.5", optional = true } toml = { version = "^0.7", optional = true } walkdir = { version = "^2.3", optional = true } @@ -22,22 +26,21 @@ parking_lot = { version = "^0.12", optional = true } thiserror = { version = "^1.0", optional = true } serde = { version = "^1.0", optional = true, features = ['derive'] } serde_json = {version = "^1.0", optional = true } -hash-db = { version = "^0.16", default-features = false, optional = true } wasm-bencher-procedural = { path = "bencher-procedural", version = "*", default-features = false } codec = { package = "parity-scale-codec", version = "^3.0", features = ["derive"], default-features = false } -sp-core = {version = "20.0.0", default-features = false } -sp-std = { version = "7.0.0", default-features = false } -sp-io = { version = "22.0.0", default-features = false } -sp-runtime-interface = { version = "16.0.0", default-features = false } -sp-state-machine = { version = "0.27.0", default-features = false, optional = true } -sc-executor = { version = "0.25.0", default-features = false, optional = true } -sc-executor-common = { version = "0.22.0", default-features = false, optional = true } -sc-client-db = { version = "0.28.0", default-features = false, features = ["rocksdb"], optional = true } -sp-maybe-compressed-blob = { version = "5.0.0", default-features = false, optional = true } -frame-support = { version = "21.0.0", default-features = false } -sp-externalities = { version = "0.18.0", default-features = false } -sp-storage = { version = "12.0.0", default-features = false, optional = true } +sp-core = { workspace = true, default-features = false } +sp-std = { workspace = true, default-features = false } +sp-io = { workspace = true, default-features = false } +sp-runtime-interface = { workspace = true, default-features = false } +sp-state-machine = { workspace = true, default-features = false, optional = true } +sc-executor = { workspace = true, default-features = false, optional = true } +sc-executor-common = { workspace = true, default-features = false, optional = true } +sc-client-db = { workspace = true, default-features = false, features = ["rocksdb"], optional = true } +sp-maybe-compressed-blob = { workspace = true, default-features = false, optional = true } +frame-support = { workspace = true, default-features = false } +sp-externalities = { workspace = true, default-features = false } +sp-storage = { workspace = true, default-features = false, optional = true } [features] default = ["std"] @@ -45,6 +48,10 @@ std = [ "wasm-bencher-procedural/std", "build-helper", "cargo_metadata", + "strum", + "filetime", + "wasm-opt", + "parity-wasm", "tempfile", "toml", "walkdir", @@ -56,7 +63,6 @@ std = [ "thiserror", "serde/std", "serde_json/std", - "hash-db/std", "codec/std", "sp-core/std", "sp-std/std", diff --git a/bencher/bencher-procedural/Cargo.toml b/bencher/bencher-procedural/Cargo.toml index c5dfb8a..450a9cf 100644 --- a/bencher/bencher-procedural/Cargo.toml +++ b/bencher/bencher-procedural/Cargo.toml @@ -11,7 +11,7 @@ proc-macro = true [dependencies] proc-macro2 = "^1.0" quote = "^1.0" -syn = { version = "^1.0", features = ["full"] } +syn = { version = "^2.0", features = ["full"] } [features] default = ["std"] diff --git a/bencher/src/bench_runner.rs b/bencher/src/bench_runner.rs index 8333dc3..01bef1d 100644 --- a/bencher/src/bench_runner.rs +++ b/bencher/src/bench_runner.rs @@ -2,7 +2,7 @@ use super::{ bench_ext::BenchExt, tracker::{BenchTracker, BenchTrackerExt}, }; -use sc_executor::{WasmExecutionMethod, WasmExecutor, WasmtimeInstantiationStrategy}; +use sc_executor::WasmExecutor; use sc_executor_common::runtime_blob::RuntimeBlob; use sp_externalities::Extensions; use sp_state_machine::{Ext, OverlayedChanges, StorageTransactionCache}; @@ -19,15 +19,10 @@ type ComposeHostFunctions = ( ); fn executor() -> WasmExecutor { - WasmExecutor::::new( - WasmExecutionMethod::Compiled { - instantiation_strategy: WasmtimeInstantiationStrategy::PoolingCopyOnWrite, - }, - Default::default(), - 1, - None, - 0, - ) + WasmExecutor::::builder() + .with_max_runtime_instances(1) + .with_runtime_cache_size(0) + .build() } /// Run benches diff --git a/bencher/src/build_wasm/mod.rs b/bencher/src/build_wasm/mod.rs index a3ab7d9..e4ba555 100644 --- a/bencher/src/build_wasm/mod.rs +++ b/bencher/src/build_wasm/mod.rs @@ -1,14 +1,103 @@ use rand::{distributions::Alphanumeric, thread_rng, Rng}; +use std::{ + fs, + path::{Path, PathBuf}, + process::Command, +}; -pub mod prerequisites; -pub mod wasm_project; +mod prerequisites; +mod wasm_project; -/// Environment variable to disable color output of the wasm build. -const WASM_BUILD_NO_COLOR: &str = "WASM_BUILD_NO_COLOR"; +/// Environment variable that tells us to skip building the wasm binary. +const SKIP_BUILD_ENV: &str = "SKIP_WASM_BUILD"; -/// Returns `true` when color output is enabled. -pub fn color_output_enabled() -> bool { - std::env::var(WASM_BUILD_NO_COLOR).is_err() +/// Environment variable that tells us whether we should avoid network requests +const OFFLINE: &str = "CARGO_NET_OFFLINE"; + +/// Environment variable to force a certain build type when building the wasm binary. +/// Expects "debug", "release" or "production" as value. +/// +/// When unset the WASM binary uses the same build type as the main cargo build with +/// the exception of a debug build: In this case the wasm build defaults to `release` in +/// order to avoid a slowdown when not explicitly requested. +const WASM_BUILD_TYPE_ENV: &str = "WASM_BUILD_TYPE"; + +/// Environment variable to extend the `RUSTFLAGS` variable given to the wasm build. +const WASM_BUILD_RUSTFLAGS_ENV: &str = "WASM_BUILD_RUSTFLAGS"; + +/// Environment variable to set the target directory to copy the final wasm binary. +/// +/// The directory needs to be an absolute path. +const WASM_TARGET_DIRECTORY: &str = "WASM_TARGET_DIRECTORY"; + +/// Environment variable that hints the workspace we are building. +const WASM_BUILD_WORKSPACE_HINT: &str = "WASM_BUILD_WORKSPACE_HINT"; + +/// Write to the given `file` if the `content` is different. +fn write_file_if_changed(file: impl AsRef, content: impl AsRef) { + if fs::read_to_string(file.as_ref()).ok().as_deref() != Some(content.as_ref()) { + fs::write(file.as_ref(), content.as_ref()) + .unwrap_or_else(|_| panic!("Writing `{}` can not fail!", file.as_ref().display())); + } +} + +/// Copy `src` to `dst` if the `dst` does not exist or is different. +fn copy_file_if_changed(src: PathBuf, dst: PathBuf) { + let src_file = fs::read_to_string(&src).ok(); + let dst_file = fs::read_to_string(&dst).ok(); + + if src_file != dst_file { + fs::copy(&src, &dst).unwrap_or_else(|_| { + panic!( + "Copying `{}` to `{}` can not fail; qed", + src.display(), + dst.display() + ) + }); + } +} + +/// Wraps a specific command which represents a cargo invocation. +#[derive(Debug)] +pub struct CargoCommand { + program: String, +} + +impl CargoCommand { + fn new(program: &str) -> Self { + CargoCommand { + program: program.into(), + } + } + + fn command(&self) -> Command { + Command::new(&self.program) + } +} + +/// Wraps a [`CargoCommand`] and the version of `rustc` the cargo command uses. +pub struct CargoCommandVersioned { + command: CargoCommand, + version: String, +} + +impl CargoCommandVersioned { + pub fn new(command: CargoCommand, version: String) -> Self { + Self { command, version } + } + + /// Returns the `rustc` version. + pub fn rustc_version(&self) -> &str { + &self.version + } +} + +impl std::ops::Deref for CargoCommandVersioned { + type Target = CargoCommand; + + fn deref(&self) -> &CargoCommand { + &self.command + } } pub fn build() -> std::io::Result> { @@ -21,8 +110,9 @@ pub fn build() -> std::io::Result> { .map(char::from) .collect::(); + let profile = wasm_project::Profile::detect(&std::env::current_dir()?).name(); let mut out_dir = std::path::PathBuf::from(manifest_dir); - out_dir.push(format!("target/release/build/{}-{}/out", pkg_name, random)); + out_dir.push(format!("target/{profile}/build/{pkg_name}-{random}/out")); std::env::set_var("OUT_DIR", out_dir.display().to_string()); @@ -44,6 +134,7 @@ pub fn build() -> std::io::Result> { cargo_cmd, vec!["wasm-bench".to_string()], None, + false, ); let (wasm_binary, _wasm_binary_bloaty) = if let Some(wasm_binary) = wasm_binary { diff --git a/bencher/src/build_wasm/prerequisites.rs b/bencher/src/build_wasm/prerequisites.rs index f8a18f0..42d26ec 100644 --- a/bencher/src/build_wasm/prerequisites.rs +++ b/bencher/src/build_wasm/prerequisites.rs @@ -1,182 +1,6 @@ -// This file is part of Substrate. - -// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - +use super::{CargoCommand, CargoCommandVersioned}; use crate::colorize::{color_output_enabled, red_bold, yellow_bold}; -use std::{ - env, fs, - io::BufRead, - path::{Path, PathBuf}, - process::Command, -}; - -/// Environment variable to set the toolchain used to compile the wasm binary. -pub const WASM_BUILD_TOOLCHAIN: &str = "WASM_BUILD_TOOLCHAIN"; - -/// Write to the given `file` if the `content` is different. -pub fn write_file_if_changed(file: impl AsRef, content: impl AsRef) { - if fs::read_to_string(file.as_ref()).ok().as_deref() != Some(content.as_ref()) { - fs::write(file.as_ref(), content.as_ref()) - .unwrap_or_else(|_| panic!("Writing `{}` can not fail!", file.as_ref().display())); - } -} - -/// Copy `src` to `dst` if the `dst` does not exist or is different. -pub fn copy_file_if_changed(src: PathBuf, dst: PathBuf) { - let src_file = fs::read_to_string(&src).ok(); - let dst_file = fs::read_to_string(&dst).ok(); - - if src_file != dst_file { - fs::copy(&src, &dst).unwrap_or_else(|_| { - panic!( - "Copying `{}` to `{}` can not fail; qed", - src.display(), - dst.display() - ) - }); - } -} - -/// Get a cargo command that compiles with nightly -fn get_nightly_cargo() -> CargoCommand { - let env_cargo = - CargoCommand::new(&env::var("CARGO").expect("`CARGO` env variable is always set by cargo")); - let default_cargo = CargoCommand::new("cargo"); - let rustup_run_nightly = CargoCommand::new_with_args("rustup", &["run", "nightly", "cargo"]); - let wasm_toolchain = env::var(WASM_BUILD_TOOLCHAIN).ok(); - - // First check if the user requested a specific toolchain - if let Some(cmd) = wasm_toolchain.and_then(|t| get_rustup_nightly(Some(t))) { - cmd - } else if env_cargo.is_nightly() { - env_cargo - } else if default_cargo.is_nightly() { - default_cargo - } else if rustup_run_nightly.is_nightly() { - rustup_run_nightly - } else { - // If no command before provided us with a nightly compiler, we try to search - // one with rustup. If that fails as well, we return the default cargo and let - // the prequisities check fail. - get_rustup_nightly(None).unwrap_or(default_cargo) - } -} - -/// Get a nightly from rustup. If `selected` is `Some(_)`, a `CargoCommand` -/// using the given nightly is returned. -fn get_rustup_nightly(selected: Option) -> Option { - let host = format!( - "-{}", - env::var("HOST").expect("`HOST` is always set by cargo") - ); - - let version = match selected { - Some(selected) => selected, - None => { - let output = Command::new("rustup").args(["toolchain", "list"]).output().ok()?.stdout; - let lines = output.as_slice().lines(); - - let mut latest_nightly = None; - for line in lines.filter_map(|l| l.ok()) { - if line.starts_with("nightly-") && line.ends_with(&host) { - // Rustup prints them sorted - latest_nightly = Some(line.clone()); - } - } - - latest_nightly?.trim_end_matches(&host).into() - }, - }; - - Some(CargoCommand::new_with_args( - "rustup", - &["run", &version, "cargo"], - )) -} - -/// Wraps a specific command which represents a cargo invocation. -#[derive(Debug)] -pub struct CargoCommand { - program: String, - args: Vec, -} - -impl CargoCommand { - fn new(program: &str) -> Self { - CargoCommand { - program: program.into(), - args: Vec::new(), - } - } - - fn new_with_args(program: &str, args: &[&str]) -> Self { - CargoCommand { - program: program.into(), - args: args.iter().map(ToString::to_string).collect(), - } - } - - pub fn command(&self) -> Command { - let mut cmd = Command::new(&self.program); - cmd.args(&self.args); - cmd - } - - /// Check if the supplied cargo command is a nightly version - fn is_nightly(&self) -> bool { - // `RUSTC_BOOTSTRAP` tells a stable compiler to behave like a nightly. So, when - // this env variable is set, we can assume that whatever rust compiler we have, - // it is a nightly compiler. For "more" information, see: - // https://github.com/rust-lang/rust/blob/fa0f7d0080d8e7e9eb20aa9cbf8013f96c81287f/src/libsyntax/feature_gate/check.rs#L891 - env::var("RUSTC_BOOTSTRAP").is_ok() - || self - .command() - .arg("--version") - .output() - .map_err(|_| ()) - .and_then(|o| String::from_utf8(o.stdout).map_err(|_| ())) - .unwrap_or_default() - .contains("-nightly") - } -} - -/// Wraps a [`CargoCommand`] and the version of `rustc` the cargo command uses. -pub struct CargoCommandVersioned { - command: CargoCommand, - version: String, -} - -impl CargoCommandVersioned { - fn new(command: CargoCommand, version: String) -> Self { - Self { command, version } - } - - /// Returns the `rustc` version. - pub fn rustc_version(&self) -> &str { - &self.version - } -} - -impl std::ops::Deref for CargoCommandVersioned { - type Target = CargoCommand; - - fn deref(&self) -> &CargoCommand { - &self.command - } -} +use std::{fs, path::Path}; use tempfile::tempdir; @@ -184,11 +8,7 @@ use tempfile::tempdir; /// /// Returns the versioned cargo command on success. pub fn check() -> Result { - let cargo_command = get_nightly_cargo(); - - if !cargo_command.is_nightly() { - return Err(red_bold("Rust nightly not installed, please install it!")); - } + let cargo_command = CargoCommand::new("cargo"); check_wasm_toolchain_installed(cargo_command) } @@ -201,7 +21,7 @@ fn create_check_toolchain_project(project_dir: &Path) { let build_rs_file = project_dir.join("build.rs"); let manifest_path = project_dir.join("Cargo.toml"); - write_file_if_changed( + super::write_file_if_changed( manifest_path, r#" [package] @@ -217,7 +37,7 @@ fn create_check_toolchain_project(project_dir: &Path) { [workspace] "#, ); - write_file_if_changed(lib_rs_file, "pub fn test() {}"); + super::write_file_if_changed(lib_rs_file, "pub fn test() {}"); // We want to know the rustc version of the rustc that is being used by our // cargo command. The cargo command is determined by some *very* complex @@ -228,7 +48,7 @@ fn create_check_toolchain_project(project_dir: &Path) { // process. This `build.rs` is exactly doing this. It gets the rustc version by // calling `rustc --version` and exposing it in the `RUSTC_VERSION` environment // variable. - write_file_if_changed( + super::write_file_if_changed( build_rs_file, r#" fn main() { @@ -249,7 +69,7 @@ fn create_check_toolchain_project(project_dir: &Path) { ); // Just prints the `RURSTC_VERSION` environment variable that is being created // by the `build.rs` script. - write_file_if_changed( + super::write_file_if_changed( main_rs_file, r#" fn main() { diff --git a/bencher/src/build_wasm/wasm_project.rs b/bencher/src/build_wasm/wasm_project.rs index 41f56d4..bd982c0 100644 --- a/bencher/src/build_wasm/wasm_project.rs +++ b/bencher/src/build_wasm/wasm_project.rs @@ -1,27 +1,7 @@ -// This file is part of Substrate. - -// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#![allow(clippy::option_map_unit_fn)] - -use super::{ - color_output_enabled, - prerequisites::{copy_file_if_changed, write_file_if_changed, CargoCommandVersioned}, -}; +use super::{write_file_if_changed, CargoCommandVersioned, OFFLINE}; +use cargo_metadata::{CargoOpt, Metadata, MetadataCommand}; +use parity_wasm::elements::{deserialize_buffer, Module}; use std::{ borrow::ToOwned, collections::HashSet, @@ -31,29 +11,19 @@ use std::{ path::{Path, PathBuf}, process, }; - +use strum::{EnumIter, IntoEnumIterator}; use toml::value::Table; -use cargo_metadata::{Metadata, MetadataCommand}; - -/// Environment variable that tells us to skip building the wasm binary. -const SKIP_BUILD_ENV: &str = "SKIP_WASM_BUILD"; - -/// Environment variable to force a certain build type when building the wasm -/// binary. Expects "debug" or "release" as value. -/// -/// By default the WASM binary uses the same build type as the main cargo build. -const WASM_BUILD_TYPE_ENV: &str = "WASM_BUILD_TYPE"; - -/// Environment variable to extend the `RUSTFLAGS` variable given to the wasm -/// build. -const WASM_BUILD_RUSTFLAGS_ENV: &str = "WASM_BUILD_RUSTFLAGS"; - -/// Environment variable to set the target directory to copy the final wasm -/// binary. +/// Colorize an info message. /// -/// The directory needs to be an absolute path. -const WASM_TARGET_DIRECTORY: &str = "WASM_TARGET_DIRECTORY"; +/// Returns the colorized message. +fn colorize_info_message(message: &str) -> String { + if crate::colorize::color_output_enabled() { + ansi_term::Color::Yellow.bold().paint(message).to_string() + } else { + message.into() + } +} /// Holds the path to the bloaty WASM binary. pub struct WasmBinaryBloaty(PathBuf); @@ -63,6 +33,11 @@ impl WasmBinaryBloaty { pub fn wasm_binary_bloaty_path_escaped(&self) -> String { self.0.display().to_string().escape_default().to_string() } + + /// Returns the path to the wasm binary. + pub fn wasm_binary_bloaty_path(&self) -> &Path { + &self.0 + } } /// Holds the path to the WASM binary. @@ -86,11 +61,21 @@ fn crate_metadata(cargo_manifest: &Path) -> Metadata { let cargo_lock_existed = cargo_lock.exists(); - let crate_metadata = MetadataCommand::new() - .manifest_path(cargo_manifest) + // If we can find a `Cargo.lock`, we assume that this is the workspace root and there exists a + // `Cargo.toml` that we can use for getting the metadata. + let cargo_manifest = if let Some(mut cargo_lock) = find_cargo_lock(cargo_manifest) { + cargo_lock.set_file_name("Cargo.toml"); + cargo_lock + } else { + cargo_manifest.to_path_buf() + }; + + let mut crate_metadata_command = create_metadata_command(cargo_manifest); + crate_metadata_command.features(CargoOpt::AllFeatures); + + let crate_metadata = crate_metadata_command .exec() .expect("`cargo metadata` can not fail on project `Cargo.toml`; qed"); - // If the `Cargo.lock` didn't exist, we need to remove it after // calling `cargo metadata`. This is required to ensure that we don't change // the build directory outside of the `target` folder. Commands like @@ -102,8 +87,7 @@ fn crate_metadata(cargo_manifest: &Path) -> Metadata { crate_metadata } -/// Creates the WASM project, compiles the WASM binary and compacts the WASM -/// binary. +/// Creates the WASM project, compiles the WASM binary and compacts the WASM binary. /// /// # Returns /// @@ -114,6 +98,7 @@ pub fn create_and_compile( cargo_cmd: CargoCommandVersioned, features_to_enable: Vec, wasm_binary_name: Option, + check_for_runtime_version_section: bool, ) -> (Option, WasmBinaryBloaty) { let wasm_workspace_root = get_wasm_workspace_root(); let wasm_workspace = wasm_workspace_root.join("wbuild"); @@ -128,19 +113,48 @@ pub fn create_and_compile( features_to_enable, ); - build_project(&project, default_rustflags, cargo_cmd); + let profile = build_project(&project, default_rustflags, cargo_cmd); let (wasm_binary, wasm_binary_compressed, bloaty) = - compact_wasm_file(&project, project_cargo_toml, wasm_binary_name); + compact_wasm_file(&project, profile, project_cargo_toml, wasm_binary_name); + + if check_for_runtime_version_section { + ensure_runtime_version_wasm_section_exists(bloaty.wasm_binary_bloaty_path()); + } - wasm_binary - .as_ref() - .map(|wasm_binary| copy_wasm_to_target_directory(project_cargo_toml, wasm_binary)); + if let Some(wasm_binary) = wasm_binary.as_ref() { + copy_wasm_to_target_directory(project_cargo_toml, wasm_binary) + } - wasm_binary_compressed.as_ref().map(|wasm_binary_compressed| { + if let Some(wasm_binary_compressed) = wasm_binary_compressed.as_ref() { copy_wasm_to_target_directory(project_cargo_toml, wasm_binary_compressed) - }); + } + + let final_wasm_binary = wasm_binary_compressed.or(wasm_binary); - (wasm_binary_compressed.or(wasm_binary), bloaty) + (final_wasm_binary, bloaty) +} + +/// Ensures that the `runtime_version` wasm section exists in the given wasm file. +/// +/// If the section can not be found, it will print an error and exit the builder. +fn ensure_runtime_version_wasm_section_exists(wasm: &Path) { + let wasm_blob = fs::read(wasm).expect("`{wasm}` was just written and should exist; qed"); + + let module: Module = match deserialize_buffer(&wasm_blob) { + Ok(m) => m, + Err(e) => { + println!("Failed to deserialize `{}`: {e:?}", wasm.display()); + process::exit(1); + }, + }; + + if !module.custom_sections().any(|cs| cs.name() == "runtime_version") { + println!( + "Couldn't find the `runtime_version` wasm section. \ + Please ensure that you are using the `sp_version::runtime_version` attribute macro!" + ); + process::exit(1); + } } /// Find the `Cargo.lock` relative to the `OUT_DIR` environment variable. @@ -159,18 +173,29 @@ fn find_cargo_lock(cargo_manifest: &Path) -> Option { } } - if let Some(path) = find_impl(build_helper::out_dir()) { - return Some(path); + if let Ok(workspace) = env::var(super::WASM_BUILD_WORKSPACE_HINT) { + let path = PathBuf::from(workspace); + + if path.join("Cargo.lock").exists() { + return Some(path.join("Cargo.lock")); + } else { + build_helper::warning!( + "`{}` env variable doesn't point to a directory that contains a `Cargo.lock`.", + super::WASM_BUILD_WORKSPACE_HINT, + ); + } } - if let Some(path) = find_impl(cargo_manifest.to_path_buf()) { + if let Some(path) = find_impl(build_helper::out_dir()) { return Some(path); } build_helper::warning!( - "Could not find `Cargo.lock` for `{}`, while searching from `{}`.", + "Could not find `Cargo.lock` for `{}`, while searching from `{}`. \ + To fix this, point the `{}` env variable to the directory of the workspace being compiled.", cargo_manifest.display(), - build_helper::out_dir().display() + build_helper::out_dir().display(), + super::WASM_BUILD_WORKSPACE_HINT, ); None @@ -237,25 +262,31 @@ fn create_project_cargo_toml( let mut wasm_workspace_toml = Table::new(); - // Add `profile` with release and dev + // Add different profiles which are selected by setting `WASM_BUILD_TYPE`. let mut release_profile = Table::new(); release_profile.insert("panic".into(), "abort".into()); - release_profile.insert("lto".into(), true.into()); + release_profile.insert("lto".into(), "thin".into()); + + let mut production_profile = Table::new(); + production_profile.insert("inherits".into(), "release".into()); + production_profile.insert("lto".into(), "fat".into()); + production_profile.insert("codegen-units".into(), 1.into()); let mut dev_profile = Table::new(); dev_profile.insert("panic".into(), "abort".into()); let mut profile = Table::new(); profile.insert("release".into(), release_profile.into()); + profile.insert("production".into(), production_profile.into()); profile.insert("dev".into(), dev_profile.into()); wasm_workspace_toml.insert("profile".into(), profile.into()); // Add patch section from the project root `Cargo.toml` - if let Some(mut patch) = workspace_toml.remove("patch").and_then(|p| p.try_into::().ok()) + while let Some(mut patch) = + workspace_toml.remove("patch").and_then(|p| p.try_into::
().ok()) { - // Iterate over all patches and make the patch path absolute from the workspace - // root path. + // Iterate over all patches and make the patch path absolute from the workspace root path. patch .iter_mut() .filter_map(|p| { @@ -311,34 +342,73 @@ fn create_project_cargo_toml( ); } -/// Find a package by the given `manifest_path` in the metadata. +/// Find a package by the given `manifest_path` in the metadata. In case it can't be found by its +/// manifest_path, fallback to finding it by name; this is necessary during publish because the +/// package's manifest path will be *generated* within a specific packaging directory, thus it won't +/// be found by its original path anymore. /// /// Panics if the package could not be found. fn find_package_by_manifest_path<'a>( + pkg_name: &str, manifest_path: &Path, crate_metadata: &'a cargo_metadata::Metadata, ) -> &'a cargo_metadata::Package { - crate_metadata + if let Some(pkg) = crate_metadata.packages.iter().find(|p| p.manifest_path == manifest_path) { + return pkg; + } + + let pkgs_by_name = crate_metadata .packages .iter() - .find(|p| p.manifest_path == manifest_path) - .expect("Wasm project exists in its own metadata; qed") + .filter(|p| p.name == pkg_name) + .collect::>(); + + if let Some(pkg) = pkgs_by_name.first() { + if pkgs_by_name.len() > 1 { + panic!( + "Found multiple packages matching the name {pkg_name} ({manifest_path:?}): {:?}", + pkgs_by_name + ); + } + pkg + } else { + panic!("Failed to find entry for package {pkg_name} ({manifest_path:?})."); + } } /// Get a list of enabled features for the project. fn project_enabled_features( + pkg_name: &str, cargo_manifest: &Path, crate_metadata: &cargo_metadata::Metadata, ) -> Vec { - let package = find_package_by_manifest_path(cargo_manifest, crate_metadata); + let package = find_package_by_manifest_path(pkg_name, cargo_manifest, crate_metadata); + + let std_enabled = package.features.get("std"); let mut enabled_features = package .features - .keys() - .filter(|f| { + .iter() + .filter(|(f, v)| { let mut feature_env = f.replace('-', "_"); feature_env.make_ascii_uppercase(); + // If this is a feature that corresponds only to an optional dependency + // and this feature is enabled by the `std` feature, we assume that this + // is only done through the `std` feature. This is a bad heuristic and should + // be removed after namespaced features are landed: + // https://doc.rust-lang.org/cargo/reference/unstable.html#namespaced-features + // Then we can just express this directly in the `Cargo.toml` and do not require + // this heuristic anymore. However, for the transition phase between now and namespaced + // features already being present in nightly, we need this code to make + // runtimes compile with all the possible rustc versions. + if v.len() == 1 + && v.get(0).map_or(false, |v| *v == format!("dep:{}", f)) + && std_enabled.as_ref().map(|e| e.iter().any(|ef| ef == *f)).unwrap_or(false) + { + return false; + } + // We don't want to enable the `std`/`default` feature for the wasm build and // we need to check if the feature is enabled by checking the env variable. *f != "std" @@ -347,7 +417,7 @@ fn project_enabled_features( .map(|v| v == "1") .unwrap_or_default() }) - .cloned() + .map(|d| d.0.clone()) .collect::>(); enabled_features.sort(); @@ -356,10 +426,11 @@ fn project_enabled_features( /// Returns if the project has the `runtime-wasm` feature fn has_runtime_wasm_feature_declared( + pkg_name: &str, cargo_manifest: &Path, crate_metadata: &cargo_metadata::Metadata, ) -> bool { - let package = find_package_by_manifest_path(cargo_manifest, crate_metadata); + let package = find_package_by_manifest_path(pkg_name, cargo_manifest, crate_metadata); package.features.keys().any(|k| k == "runtime-wasm") } @@ -384,9 +455,10 @@ fn create_project( fs::create_dir_all(wasm_project_folder.join("src")) .expect("Wasm project dir create can not fail; qed"); - let mut enabled_features = project_enabled_features(project_cargo_toml, crate_metadata); + let mut enabled_features = + project_enabled_features(&crate_name, project_cargo_toml, crate_metadata); - if has_runtime_wasm_feature_declared(project_cargo_toml, crate_metadata) { + if has_runtime_wasm_feature_declared(&crate_name, project_cargo_toml, crate_metadata) { enabled_features.push("runtime-wasm".into()); } @@ -409,60 +481,183 @@ fn create_project( if let Some(crate_lock_file) = find_cargo_lock(project_cargo_toml) { // Use the `Cargo.lock` of the main project. - copy_file_if_changed(crate_lock_file, wasm_project_folder.join("Cargo.lock")); + super::copy_file_if_changed(crate_lock_file, wasm_project_folder.join("Cargo.lock")); } wasm_project_folder } -/// Returns if the project should be built as a release. -fn is_release_build() -> bool { - if let Ok(var) = env::var(WASM_BUILD_TYPE_ENV) { - match var.as_str() { - "release" => true, - "debug" => false, - var => panic!( - "Unexpected value for `{}` env variable: {}\nOne of the following are expected: `debug` or `release`.", - WASM_BUILD_TYPE_ENV, var, - ), +/// The cargo profile that is used to build the wasm project. +#[derive(Debug, EnumIter)] +pub enum Profile { + /// The `--profile dev` profile. + Debug, + /// The `--profile release` profile. + Release, + /// The `--profile production` profile. + Production, +} + +impl Profile { + /// Create a profile by detecting which profile is used for the main build. + /// + /// We cannot easily determine the profile that is used by the main cargo invocation + /// because the `PROFILE` environment variable won't contain any custom profiles like + /// "production". It would only contain the builtin profile where the custom profile + /// inherits from. This is why we inspect the build path to learn which profile is used. + /// + /// # Note + /// + /// Can be overriden by setting [`super::WASM_BUILD_TYPE_ENV`]. + pub fn detect(wasm_project: &Path) -> Profile { + let (name, overriden) = if let Ok(name) = env::var(super::WASM_BUILD_TYPE_ENV) { + (name, true) + } else { + // First go backwards to the beginning of the target directory. + // Then go forwards to find the "wbuild" directory. + // We need to go backwards first because when starting from the root there + // might be a chance that someone has a "wbuild" directory somewhere in the path. + let name = wasm_project + .components() + .rev() + .take_while(|c| c.as_os_str() != "target") + .collect::>() + .iter() + .rev() + .take_while(|c| c.as_os_str() != "wbuild") + .last() + .expect("We put the wasm project within a `target/.../wbuild` path; qed") + .as_os_str() + .to_str() + .expect("All our profile directory names are ascii; qed") + .to_string(); + (name, false) + }; + match (Profile::iter().find(|p| p.directory() == name), overriden) { + // When not overriden by a env variable we default to using the `Release` profile + // for the wasm build even when the main build uses the debug build. This + // is because the `Debug` profile is too slow for normal development activities. + (Some(Profile::Debug), false) => Profile::Release, + // For any other profile or when overriden we take it at face value. + (Some(profile), _) => profile, + // For non overriden unknown profiles we fall back to `Release`. + // This allows us to continue building when a custom profile is used for the + // main builds cargo. When explicitly passing a profile via env variable we are + // not doing a fallback. + (None, false) => { + let profile = Profile::Release; + build_helper::warning!( + "Unknown cargo profile `{}`. Defaulted to `{:?}` for the runtime build.", + name, + profile, + ); + profile + }, + // Invalid profile specified. + (None, true) => { + // We use println! + exit instead of a panic in order to have a cleaner output. + println!( + "Unexpected profile name: `{}`. One of the following is expected: {:?}", + name, + Profile::iter().map(|p| p.directory()).collect::>(), + ); + process::exit(1); + }, } - } else { - true } + + /// The name of the profile as supplied to the cargo `--profile` cli option. + pub fn name(&self) -> &'static str { + match self { + Self::Debug => "dev", + Self::Release => "release", + Self::Production => "production", + } + } + + /// The sub directory within `target` where cargo places the build output. + /// + /// # Note + /// + /// Usually this is the same as [`Self::name`] with the exception of the debug + /// profile which is called `dev`. + fn directory(&self) -> &'static str { + match self { + Self::Debug => "debug", + _ => self.name(), + } + } + + /// Whether the resulting binary should be compacted and compressed. + fn wants_compact(&self) -> bool { + !matches!(self, Self::Debug) + } +} + +/// Check environment whether we should build without network +fn offline_build() -> bool { + env::var(OFFLINE).map_or(false, |v| v == "true") } /// Build the project to create the WASM binary. -fn build_project(project: &Path, default_rustflags: &str, cargo_cmd: CargoCommandVersioned) { +fn build_project( + project: &Path, + default_rustflags: &str, + cargo_cmd: CargoCommandVersioned, +) -> Profile { let manifest_path = project.join("Cargo.toml"); let mut build_cmd = cargo_cmd.command(); let rustflags = format!( - "-C link-arg=--export-table {} {}", + "-C target-cpu=mvp -C target-feature=-sign-ext -C link-arg=--export-table {} {}", default_rustflags, - env::var(WASM_BUILD_RUSTFLAGS_ENV).unwrap_or_default(), + env::var(super::WASM_BUILD_RUSTFLAGS_ENV).unwrap_or_default(), ); build_cmd .args(["rustc", "--target=wasm32-unknown-unknown"]) .arg(format!("--manifest-path={}", manifest_path.display())) .env("RUSTFLAGS", rustflags) - // Unset the `CARGO_TARGET_DIR` to prevent a cargo deadlock (cargo locks a target dir exclusive). - // The runner project is created in `CARGO_TARGET_DIR` and executing it will create a sub target - // directory inside of `CARGO_TARGET_DIR`. + // Unset the `CARGO_TARGET_DIR` to prevent a cargo deadlock (cargo locks a target dir + // exclusive). The runner project is created in `CARGO_TARGET_DIR` and executing it will + // create a sub target directory inside of `CARGO_TARGET_DIR`. .env_remove("CARGO_TARGET_DIR") + // As we are being called inside a build-script, this env variable is set. However, we set + // our own `RUSTFLAGS` and thus, we need to remove this. Otherwise cargo favors this + // env variable. + .env_remove("CARGO_ENCODED_RUSTFLAGS") // We don't want to call ourselves recursively - .env(SKIP_BUILD_ENV, ""); + .env(super::SKIP_BUILD_ENV, ""); - if color_output_enabled() { + if crate::colorize::color_output_enabled() { build_cmd.arg("--color=always"); } - if is_release_build() { - build_cmd.arg("--release"); - }; + let profile = Profile::detect(project); + build_cmd.arg("--profile"); + build_cmd.arg(profile.name()); + + if offline_build() { + build_cmd.arg("--offline"); + } + + println!( + "{}", + colorize_info_message("Information that should be included in a bug report.") + ); + println!( + "{} {:?}", + colorize_info_message("Executing build command:"), + build_cmd + ); + println!( + "{} {}", + colorize_info_message("Using rustc version:"), + cargo_cmd.rustc_version() + ); match build_cmd.status().map(|s| s.success()) { - Ok(true) => {}, + Ok(true) => profile, // Use `process.exit(1)` to have a clean error output. _ => process::exit(1), } @@ -471,56 +666,47 @@ fn build_project(project: &Path, default_rustflags: &str, cargo_cmd: CargoComman /// Compact the WASM binary using `wasm-gc` and compress it using zstd. fn compact_wasm_file( project: &Path, + profile: Profile, cargo_manifest: &Path, - wasm_binary_name: Option, + out_name: Option, ) -> (Option, Option, WasmBinaryBloaty) { - let is_release_build = is_release_build(); - let target = if is_release_build { "release" } else { "debug" }; - let default_wasm_binary_name = get_wasm_binary_name(cargo_manifest); - let wasm_file = project + let default_out_name = get_wasm_binary_name(cargo_manifest); + let out_name = out_name.unwrap_or_else(|| default_out_name.clone()); + let in_path = project .join("target/wasm32-unknown-unknown") - .join(target) - .join(format!("{}.wasm", default_wasm_binary_name)); - - let wasm_compact_file = if is_release_build { - let wasm_compact_file = project.join(format!( - "{}.compact.wasm", - wasm_binary_name.clone().unwrap_or_else(|| default_wasm_binary_name.clone()), - )); - wasm_gc::garbage_collect_file(&wasm_file, &wasm_compact_file) + .join(profile.directory()) + .join(format!("{}.wasm", default_out_name)); + + let (wasm_compact_path, wasm_compact_compressed_path) = if profile.wants_compact() { + let wasm_compact_path = project.join(format!("{}.compact.wasm", out_name,)); + wasm_opt::OptimizationOptions::new_opt_level_0() + .mvp_features_only() + .debug_info(true) + .add_pass(wasm_opt::Pass::StripDwarf) + .run(&in_path, &wasm_compact_path) .expect("Failed to compact generated WASM binary."); - Some(WasmBinary(wasm_compact_file)) - } else { - None - }; - - let wasm_compact_compressed_file = wasm_compact_file.as_ref().and_then(|compact_binary| { - let file_name = - wasm_binary_name.clone().unwrap_or_else(|| default_wasm_binary_name.clone()); - let wasm_compact_compressed_file = - project.join(format!("{}.compact.compressed.wasm", file_name,)); - - if compress_wasm(&compact_binary.0, &wasm_compact_compressed_file) { - Some(WasmBinary(wasm_compact_compressed_file)) + let wasm_compact_compressed_path = + project.join(format!("{}.compact.compressed.wasm", out_name)); + if compress_wasm(&wasm_compact_path, &wasm_compact_compressed_path) { + ( + Some(WasmBinary(wasm_compact_path)), + Some(WasmBinary(wasm_compact_compressed_path)), + ) } else { - None + (Some(WasmBinary(wasm_compact_path)), None) } - }); - - let bloaty_file_name = if let Some(name) = wasm_binary_name { - format!("{}.wasm", name) } else { - format!("{}.wasm", default_wasm_binary_name) + (None, None) }; - let bloaty_file = project.join(bloaty_file_name); - fs::copy(wasm_file, &bloaty_file).expect("Copying the bloaty file to the project dir."); + let bloaty_path = project.join(format!("{}.wasm", out_name)); + fs::copy(in_path, &bloaty_path).expect("Copying the bloaty file to the project dir."); ( - wasm_compact_file, - wasm_compact_compressed_file, - WasmBinaryBloaty(bloaty_file), + wasm_compact_path, + wasm_compact_compressed_path, + WasmBinaryBloaty(bloaty_path), ) } @@ -534,8 +720,8 @@ fn compress_wasm(wasm_binary_path: &Path, compressed_binary_out_path: &Path) -> true } else { - println!( - "cargo:warning=Writing uncompressed wasm. Exceeded maximum size {}", + build_helper::warning!( + "Writing uncompressed wasm. Exceeded maximum size {}", CODE_BLOB_BOMB_LIMIT, ); @@ -582,20 +768,33 @@ impl<'a> Deref for DeduplicatePackage<'a> { } } -/// Copy the WASM binary to the target directory set in `WASM_TARGET_DIRECTORY` -/// environment variable. If the variable is not set, this is a no-op. +fn create_metadata_command(path: impl Into) -> MetadataCommand { + let mut metadata_command = MetadataCommand::new(); + metadata_command.manifest_path(path); + + if offline_build() { + metadata_command.other_options(vec!["--offline".to_owned()]); + } + metadata_command +} + +/// Copy the WASM binary to the target directory set in `WASM_TARGET_DIRECTORY` environment +/// variable. If the variable is not set, this is a no-op. fn copy_wasm_to_target_directory(cargo_manifest: &Path, wasm_binary: &WasmBinary) { - let target_dir = match env::var(WASM_TARGET_DIRECTORY) { + let target_dir = match env::var(super::WASM_TARGET_DIRECTORY) { Ok(path) => PathBuf::from(path), Err(_) => return, }; - assert!( - target_dir.is_absolute(), - "Environment variable `{}` with `{}` is not an absolute path!", - WASM_TARGET_DIRECTORY, - target_dir.display() - ); + if !target_dir.is_absolute() { + // We use println! + exit instead of a panic in order to have a cleaner output. + println!( + "Environment variable `{}` with `{}` is not an absolute path!", + super::WASM_TARGET_DIRECTORY, + target_dir.display(), + ); + process::exit(1); + } fs::create_dir_all(&target_dir).expect("Creates `WASM_TARGET_DIRECTORY`."); diff --git a/bencher/src/colorize.rs b/bencher/src/colorize.rs index 98cf737..6c87567 100644 --- a/bencher/src/colorize.rs +++ b/bencher/src/colorize.rs @@ -23,7 +23,7 @@ pub fn yellow_bold(message: &str) -> String { } pub fn cyan(message: &str) -> String { - if crate::build_wasm::color_output_enabled() { + if color_output_enabled() { ansi_term::Color::Cyan.paint(message).to_string() } else { message.into() @@ -31,7 +31,7 @@ pub fn cyan(message: &str) -> String { } pub fn green_bold(message: &str) -> String { - if crate::build_wasm::color_output_enabled() { + if color_output_enabled() { ansi_term::Color::Green.bold().paint(message).to_string() } else { message.into() diff --git a/bencher/test/Cargo.toml b/bencher/test/Cargo.toml index bd61ae5..e58df95 100644 --- a/bencher/test/Cargo.toml +++ b/bencher/test/Cargo.toml @@ -16,16 +16,16 @@ required-features = ["wasm-bench"] serde = { version = "^1.0", optional = true } scale-info = { version = "^2.7.0", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "^3.0.0", features = ["derive"], default-features = false } -frame-support = { version = "21.0.0", default-features = false } -frame-system = { version = "21.0.0", default-features = false } -sp-runtime = { version = "23.0.0", default-features = false } -sp-core = { version = "20.0.0", default-features = false } -sp-std = { version = "7.0.0", default-features = false } +frame-support = { workspace = true, default-features = false } +frame-system = { workspace = true, default-features = false } +sp-runtime = { workspace = true, default-features = false } +sp-core = { workspace = true, default-features = false } +sp-std = { workspace = true, default-features = false } wasm-bencher = { path = "..", version = "*", default-features = false } weight-meter = { path = "../../weight-meter", version = "*", default-features = false } [dev-dependencies] -sp-io = "22.0.0" +sp-io = { workspace = true } [features] default = ["std"] diff --git a/bencher/test/src/lib.rs b/bencher/test/src/lib.rs index 9048246..6d27ef6 100644 --- a/bencher/test/src/lib.rs +++ b/bencher/test/src/lib.rs @@ -19,7 +19,7 @@ pub mod pallet { pub trait Config: frame_system::Config {} #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::pallet] pub struct Pallet(PhantomData); diff --git a/bencher/test/src/mock.rs b/bencher/test/src/mock.rs index 32c41b5..9982897 100644 --- a/bencher/test/src/mock.rs +++ b/bencher/test/src/mock.rs @@ -22,13 +22,9 @@ pub type UncheckedExtrinsic = pub type Block = sp_runtime::generic::Block; frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Test: crate::pallet::{Pallet, Call, Storage}, + pub enum Runtime { + System: frame_system, + Test: crate::pallet, } ); @@ -38,14 +34,13 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type RuntimeCall = RuntimeCall; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = (); type Version = (); @@ -68,8 +63,10 @@ pub struct ExtBuilder; #[cfg(test)] impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - - t.into() + use sp_runtime::BuildStorage; + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } } diff --git a/weight-gen/Cargo.toml b/weight-gen/Cargo.toml index dc31b00..4814baa 100644 --- a/weight-gen/Cargo.toml +++ b/weight-gen/Cargo.toml @@ -9,8 +9,8 @@ edition = "2021" [dependencies] serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -clap = "^4.2.7" -handlebars = "^4.3.7" +clap = "^4.2" +handlebars = "^4.3" [features] default = ["std"] diff --git a/weight-meter/Cargo.toml b/weight-meter/Cargo.toml index a150d04..b940c76 100644 --- a/weight-meter/Cargo.toml +++ b/weight-meter/Cargo.toml @@ -15,20 +15,25 @@ weight-meter-procedural = { path = "weight-meter-procedural", version = "*", def serde = "^1.0" scale-info = { version = "^2.7.0", features = ["derive"] } codec = { package = "parity-scale-codec", version = "^3.0.0" } -sp-runtime = "23.0.0" -sp-io = "22.0.0" -sp-std = "7.0.0" +sp-runtime = { workspace = true } +sp-io = { workspace = true } +sp-std = { workspace = true } -frame-support = "21.0.0" -frame-system = "21.0.0" -pallet-balances = "21.0.0" +frame-support = { workspace = true } +frame-system = { workspace = true } +pallet-balances = { workspace = true } wasm-bencher = { path = "../bencher", version = "*" } [features] default = ["std"] std = [ + "sp-io/std", + "sp-std/std", "weight-meter-procedural/std", + "frame-support/std", + "frame-system/std", + "pallet-balances/std", ] wasm-bench = [ "weight-meter-procedural/wasm-bench", diff --git a/weight-meter/src/mock.rs b/weight-meter/src/mock.rs index 5be741c..ce7ac53 100644 --- a/weight-meter/src/mock.rs +++ b/weight-meter/src/mock.rs @@ -10,7 +10,7 @@ pub mod test_module { pub struct Pallet(PhantomData); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::storage] #[pallet::getter(fn something)] @@ -136,24 +136,20 @@ pub mod test_module { use frame_support::sp_runtime::traits::IdentityLookup; use frame_support::traits::{ConstU128, ConstU32, ConstU64, Everything}; -use sp_runtime::testing::{Header, H256}; +use sp_runtime::testing::H256; -pub type BlockNumber = u64; - -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type Balance = u128; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -180,7 +176,7 @@ impl pallet_balances::Config for Runtime { type MaxLocks = (); type MaxReserves = (); type ReserveIdentifier = [u8; 8]; - type HoldIdentifier = (); + type RuntimeHoldReason = (); type FreezeIdentifier = (); type MaxHolds = (); type MaxFreezes = (); @@ -190,14 +186,10 @@ impl pallet_balances::Config for Runtime { impl test_module::Config for Runtime {} frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - TestModule: test_module::{Pallet, Call, Storage}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + pub enum Runtime { + System: frame_system, + TestModule: test_module, + Balances: pallet_balances, } ); @@ -206,7 +198,8 @@ pub struct ExtBuilder(); impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + use sp_runtime::BuildStorage; + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: vec![(100, 100_000)],