diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index acd36ea59..5bc1ca089 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -134,7 +134,7 @@ jobs: with: node-version: 18.x - name: Install deps - run: cargo +1.85.0 install staging-chain-spec-builder --force # base64ct 1.8.0 requires the Cargo feature called `edition2024` + run: cargo +1.88.0 install staging-chain-spec-builder --force # base64ct 1.8.0 requires the Cargo feature called `edition2024` - name: Run ts tests run: | npm install -g yarn diff --git a/Cargo.lock b/Cargo.lock index a36315b3b..8d1cf7183 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,18 +173,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.29.0", + "gimli 0.31.1", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aead" @@ -196,39 +196,14 @@ dependencies = [ "generic-array", ] -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aes-gcm" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.3.3", "once_cell", "version_check", "zerocopy", @@ -245,9 +220,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "ansi_term" @@ -258,11 +233,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstyle" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" + [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "approx" @@ -284,7 +265,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -293,9 +274,9 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-std 0.4.0", ] [[package]] @@ -304,10 +285,22 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" dependencies = [ - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", ] [[package]] @@ -316,10 +309,10 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", "itertools 0.10.5", @@ -327,16 +320,49 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.4", + "itertools 0.13.0", + "num-bigint", + "num-integer", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1786b2e3832f6f0f7c8d62d5d5a282f6952a1ab99981c54cd52b6ac1d8f02df5" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + [[package]] name = "ark-ff" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "digest 0.10.7", "itertools 0.10.5", @@ -347,6 +373,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "educe", + "itertools 0.13.0", + "num-bigint", + "num-traits", + "paste", + "zeroize", +] + [[package]] name = "ark-ff-asm" version = "0.4.2" @@ -357,6 +403,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.104", +] + [[package]] name = "ark-ff-macros" version = "0.4.2" @@ -370,27 +426,68 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "ark-poly" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", ] +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.4", +] + [[package]] name = "ark-serialize" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ - "ark-serialize-derive", - "ark-std", + "ark-serialize-derive 0.4.2", + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive 0.5.0", + "ark-std 0.5.0", + "arrayvec", "digest 0.10.7", "num-bigint", ] @@ -406,6 +503,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "ark-std" version = "0.4.0" @@ -413,7 +521,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c1c928edb9d8ff24cb5dcb7651d3a98494fff3099eee95c2404cd813a9139f" +dependencies = [ + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] + +[[package]] +name = "ark-vrf" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9501da18569b2afe0eb934fb7afd5a247d238b94116155af4dd068f319adfe6d" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_chacha 0.3.1", + "sha2 0.10.9", + "w3f-ring-proof", + "zeroize", ] [[package]] @@ -424,9 +575,9 @@ checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -447,45 +598,51 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "auto_impl" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ - "addr2line 0.22.0", - "cc", + "addr2line 0.24.2", "cfg-if", "libc", "miniz_oxide", - "object 0.36.3", + "object 0.36.7", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -496,15 +653,15 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.1" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -512,6 +669,17 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "binary-merkle-tree" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "181f5380e435b8ba6d901f8b16fc8908c6f0f8bea8973113d1c8718d89bb1809" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", +] + [[package]] name = "bincode" version = "1.3.3" @@ -539,7 +707,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -566,9 +734,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitvec" @@ -594,9 +762,9 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" dependencies = [ "arrayref", "arrayvec", @@ -605,9 +773,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.4" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", "arrayvec", @@ -636,9 +804,9 @@ dependencies = [ [[package]] name = "bounded-collections" -version = "0.2.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" +checksum = "64ad8a0bed7827f0b07a5d23cec2e58cc02038a99e4ca81616cb2bb2025f804d" dependencies = [ "log", "parity-scale-codec", @@ -648,14 +816,15 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub-router" -version = "0.14.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a8db232b5330d750760bd830c3c836b9ec37922753d3446d5242367a682f05" +checksum = "f7f093f70e1193363e778130745d9758044ae07267bc39a9ca4408144759babb" dependencies = [ "parity-scale-codec", "scale-info", "sp-core", "sp-runtime", + "staging-xcm", ] [[package]] @@ -684,21 +853,21 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "byte-slice-cast" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" [[package]] name = "bytemuck" -version = "1.17.0" +version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" [[package]] name = "byteorder" @@ -708,35 +877,34 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bzip2-sys" -version = "0.1.11+1.0.8" +version = "0.1.13+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" dependencies = [ "cc", - "libc", "pkg-config", ] [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -749,7 +917,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver 1.0.26", "serde", "serde_json", "thiserror", @@ -763,7 +931,7 @@ checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver 1.0.26", "serde", "serde_json", "thiserror", @@ -771,9 +939,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.14" +version = "1.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" +checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7" dependencies = [ "jobserver", "libc", @@ -800,19 +968,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cipher" -version = "0.4.4" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "clang-sys" @@ -825,12 +983,39 @@ dependencies = [ "libloading", ] +[[package]] +name = "clap" +version = "4.5.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" +dependencies = [ + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_lex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" + [[package]] name = "codespan-reporting" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" dependencies = [ + "serde", "termcolor", "unicode-width", ] @@ -852,15 +1037,28 @@ dependencies = [ [[package]] name = "console" -version = "0.15.8" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", - "lazy_static", "libc", + "once_cell", "unicode-width", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "const-hex" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e22e0ed40b96a48d3db274f72fd365bd78f67af39b6bbd47e8a15e1c6207ff" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", ] [[package]] @@ -884,22 +1082,36 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom", + "getrandom 0.2.16", "once_cell", "tiny-keccak", ] [[package]] -name = "constant_time_eq" -version = "0.3.0" +name = "const_format" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", +] [[package]] -name = "constcat" +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "constant_time_eq" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "convert_case" @@ -918,9 +1130,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -1025,18 +1237,18 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -1053,15 +1265,15 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "crypto-bigint" @@ -1070,7 +1282,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -1082,7 +1294,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "typenum", ] @@ -1096,20 +1308,11 @@ dependencies = [ "subtle", ] -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - [[package]] name = "cumulus-pallet-aura-ext" -version = "0.16.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd47d663082f3991d0e3233392ea96ee692669330601afffa9fae60a024ce37a" +checksum = "7db210f52473f603bdb4c2f7919859e5ecae935ba674ac54b12b287615735907" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -1125,9 +1328,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" -version = "0.16.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e708b53cac377910e47aca6a64048433fe1c1db85013aec16a271d4967facb5d" +checksum = "5e3eab3409f29ea088aa016e8e45e246d3630277c0e4b37d7c55aa5ef7aaab2a" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1143,7 +1346,6 @@ dependencies = [ "pallet-message-queue", "parity-scale-codec", "polkadot-parachain-primitives", - "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", "sp-core", @@ -1166,17 +1368,17 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "befbaf3a1ce23ac8476481484fef5f4d500cbd15b4dad6380ce1d28134b0c1f7" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "cumulus-pallet-xcm" -version = "0.16.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5659b958f2ffcbf6bdc31ab22ee2abf218878e02213f2d4f809a7f1233a4c6" +checksum = "a322a86f98d2c7dfaaa787de92568cd776873dfa78339d27ccb14e85631838dc" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1190,9 +1392,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.16.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eab08b5d8e224557627cf4d3ed4c05fc9687446ec805c1772ce9f3662263229" +checksum = "229345265f5551d2b0fdba0f44a1ef85c907b5f4cf47aefc70a17ca70538b719" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", @@ -1216,9 +1418,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" -version = "0.15.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "114859ea473b98046ba46eab82a1830329294015673def6fbadcf34662df4e6f" +checksum = "9f9e219ac5b7cc1ec53c8c3fc01745ec28d77ddd845dc8b9c32e542d70f11888" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -1233,9 +1435,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" -version = "0.15.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a09118ae7a386d65f9e86ef68ec681969370f8cebe41a7724d2aa8d6fd73ac5" +checksum = "56c8bb6be20c760997a62ee067fc63be701b15cac32adc8526f0eefc4623a887" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1243,16 +1445,14 @@ dependencies = [ "scale-info", "sp-core", "sp-inherents", - "sp-runtime", - "sp-state-machine", "sp-trie", ] [[package]] name = "cumulus-primitives-proof-size-hostfunction" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421f03af054aac7c89e87a49e47964886e53a8d7395990eab27b6f201d42524f" +checksum = "9230c15cefe5c80941ac287e3c6a900631de4d673ff167fe622f1698c97a845e" dependencies = [ "sp-externalities", "sp-runtime-interface", @@ -1261,9 +1461,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" -version = "0.15.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455b6a7ecafa48fdc6194cca069d079985d7a67568a83f14cfb935a256108441" +checksum = "fa2c510928cf69deb096c6a487957f9b25b1dd05e5538c3eb572b153e893ee6e" dependencies = [ "cumulus-primitives-core", "sp-inherents", @@ -1272,9 +1472,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" -version = "0.16.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490b10e4805645545785f5b38b3689d466cc9c5354cf8b9b0847b533a2bc7bb4" +checksum = "075080c08260cf07ca74b2029039d81b84748d2e95dce3415c3ac5795494db18" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1282,8 +1482,6 @@ dependencies = [ "pallet-asset-conversion", "parity-scale-codec", "polkadot-runtime-common", - "polkadot-runtime-parachains", - "sp-io", "sp-runtime", "staging-xcm", "staging-xcm-builder", @@ -1292,9 +1490,9 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" -version = "0.15.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc76c015f5efa698671a2f52842abb84feb80c8da17bbe4201607fb9a7c62a5f" +checksum = "d1bf30f2eed8f8bfd89e65d52395d124d45caa4ccd90a7e1326bb2fb7ac347b2" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -1328,58 +1526,76 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "cxx" -version = "1.0.126" +version = "1.0.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c4eae4b7fc8dcb0032eb3b1beee46b38d371cdeaf2d0c64b9944f6f69ad7755" +checksum = "a3523cc02ad831111491dd64b27ad999f1ae189986728e477604e61b81f828df" dependencies = [ "cc", + "cxxbridge-cmd", "cxxbridge-flags", "cxxbridge-macro", + "foldhash", "link-cplusplus", ] [[package]] name = "cxx-build" -version = "1.0.126" +version = "1.0.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c822bf7fb755d97328d6c337120b6f843678178751cba33c9da25cf522272e0" +checksum = "212b754247a6f07b10fa626628c157593f0abf640a3dd04cce2760eca970f909" dependencies = [ "cc", "codespan-reporting", - "once_cell", + "indexmap 2.10.0", "proc-macro2", "quote", "scratch", - "syn 2.0.76", + "syn 2.0.104", +] + +[[package]] +name = "cxxbridge-cmd" +version = "1.0.161" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f426a20413ec2e742520ba6837c9324b55ffac24ead47491a6e29f933c5b135a" +dependencies = [ + "clap", + "codespan-reporting", + "indexmap 2.10.0", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] name = "cxxbridge-flags" -version = "1.0.126" +version = "1.0.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719d6197dc016c88744aff3c0d0340a01ecce12e8939fc282e7c8f583ee64bc6" +checksum = "a258b6069020b4e5da6415df94a50ee4f586a6c38b037a180e940a43d06a070d" [[package]] name = "cxxbridge-macro" -version = "1.0.126" +version = "1.0.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35de3b547387863c8f82013c4f79f1c2162edee956383e4089e1d04c18c4f16c" +checksum = "e8dec184b52be5008d6eaf7e62fc1802caf1ad1227d11b3b7df2c409c7ffc3f4" dependencies = [ + "indexmap 2.10.0", "proc-macro2", "quote", - "syn 2.0.76", + "rustversion", + "syn 2.0.104", ] [[package]] name = "der" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", "zeroize", @@ -1413,20 +1629,51 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", +] + +[[package]] +name = "derive-where" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510c292c8cf384b1a340b816a9a6cf2599eb8f566a44949024af88418000c50b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] name = "derive_more" -version = "0.99.18" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn 2.0.76", + "syn 2.0.104", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -1460,6 +1707,27 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -1471,20 +1739,31 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "docify" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a2f138ad521dc4a2ced1a4576148a6a610b4c5923933b062a263130a6802ce" +checksum = "a772b62b1837c8f060432ddcc10b17aae1453ef17617a99bc07789252d2a5896" dependencies = [ "docify_macros", ] [[package]] name = "docify_macros" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" +checksum = "60e6be249b0a462a14784a99b19bf35a667bb5e09de611738bb7362fa4c95ff7" dependencies = [ "common-path", "derive-syn-parse", @@ -1492,17 +1771,17 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.76", + "syn 2.0.104", "termcolor", - "toml 0.8.19", + "toml 0.8.23", "walkdir", ] [[package]] name = "dyn-clonable" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +checksum = "a36efbb9bfd58e1723780aa04b61aba95ace6a05d9ffabfdb0b43672552f0805" dependencies = [ "dyn-clonable-impl", "dyn-clone", @@ -1510,20 +1789,20 @@ dependencies = [ [[package]] name = "dyn-clonable-impl" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +checksum = "7e8671d54058979a37a26f3511fbf8d198ba1aa35ffb202c42587d918d77213a" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.104", ] [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "ecdsa" @@ -1552,14 +1831,14 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" dependencies = [ "curve25519-dalek", "ed25519", "serde", - "sha2 0.10.8", + "sha2 0.10.9", "subtle", "zeroize", ] @@ -1574,16 +1853,28 @@ dependencies = [ "ed25519", "hashbrown 0.14.5", "hex", - "rand_core", - "sha2 0.10.8", + "rand_core 0.6.4", + "sha2 0.10.9", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" @@ -1598,7 +1889,7 @@ dependencies = [ "generic-array", "group", "pkcs8", - "rand_core", + "rand_core 0.6.4", "sec1", "serdect", "subtle", @@ -1607,15 +1898,35 @@ dependencies = [ [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] [[package]] name = "enumflags2" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" dependencies = [ "enumflags2_derive", "serde", @@ -1623,13 +1934,13 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -1640,7 +1951,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -1664,25 +1975,24 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] name = "ethabi" version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +source = "git+https://github.com/AcalaNetwork/ethabi?branch=acala#6e6ef9b3712aec4ad53193281ca0d92dd217066c" dependencies = [ "ethereum-types", "hex", @@ -1694,9 +2004,9 @@ dependencies = [ [[package]] name = "ethbloom" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" +checksum = "8c321610643004cf908ec0f5f2aa0d8f1f8e14b540562a2887a1111ff1ecbf7b" dependencies = [ "crunchy", "fixed-hash", @@ -1709,14 +2019,15 @@ dependencies = [ [[package]] name = "ethereum" -version = "0.15.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e04d24d20b8ff2235cffbf242d5092de3aa45f77c5270ddbfadd2778ca13fea" +checksum = "3ee371ebb7479ed3258617557ab0b3247e741075cb6b02b820d188f68da44441" dependencies = [ "bytes", "ethereum-types", "hash-db", "hash256-std-hasher", + "k256", "parity-scale-codec", "rlp", "scale-info", @@ -1727,9 +2038,9 @@ dependencies = [ [[package]] name = "ethereum-types" -version = "0.14.1" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +checksum = "1ab15ed80916029f878e0267c3a9f92b67df55e79af370bf66199059ae2b4ee3" dependencies = [ "ethbloom", "fixed-hash", @@ -1760,9 +2071,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "evm" -version = "0.41.1" +version = "0.43.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767f43e9630cc36cf8ff2777cbb0121b055f0d1fd6eaaa13b46a1808f0d0e7e9" +checksum = "b54f188e7563c1702ecefdef92c8b2c4be8941b84a50684907a747f87121aace" dependencies = [ "auto_impl", "environmental", @@ -1781,9 +2092,9 @@ dependencies = [ [[package]] name = "evm-core" -version = "0.41.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1da6cedc5cedb4208e59467106db0d1f50db01b920920589f8e672c02fdc04f" +checksum = "22ef956f8cc0c25a2d8be1dea7d659782b7c5f201f7e8057878f2051eec78350" dependencies = [ "parity-scale-codec", "primitive-types", @@ -1793,9 +2104,9 @@ dependencies = [ [[package]] name = "evm-gasometer" -version = "0.41.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dc0eb591abc5cd7b05bef6a036c2bb6c66ab6c5e0c5ce94bfe377ab670b1fd7" +checksum = "54aa0327b242bad8dd83ba524effd1d798e9102ff592910dfdded79c6bde4ff3" dependencies = [ "environmental", "evm-core", @@ -1841,9 +2152,9 @@ dependencies = [ [[package]] name = "evm-runtime" -version = "0.41.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84bbe09b64ae13a29514048c1bb6fda6374ac0b4f6a1f15a443348ab88ef42cd" +checksum = "cf22109a8f12b6d9ae60475584c80f2c9d48cf12427eac651b69ce14e5b95666" dependencies = [ "auto_impl", "environmental", @@ -1864,7 +2175,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -1881,17 +2192,17 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "ff" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1923,9 +2234,9 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf401df4a4e3872c4fe8151134cf483738e74b67fc934d6532c882b3d24a4550" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", @@ -1933,6 +2244,22 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "finality-grandpa" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f8f43dc520133541781ec03a8cab158ae8b7f7169cdf22e9050aa6cf0fbdfc" +dependencies = [ + "either", + "futures", + "futures-timer", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot", + "scale-info", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1940,7 +2267,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -1951,6 +2278,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1962,9 +2295,9 @@ dependencies = [ [[package]] name = "frame-benchmarking" -version = "37.0.0" +version = "40.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48554572bd164ee905a6ff3378e46c2101610fd2ffe3110875a6503a240fb3d7" +checksum = "4a9e5fcdb30bb83b2d97d7e718127230e0fbbad82b9c32dedf63971f08709def" dependencies = [ "frame-support", "frame-support-procedural", @@ -1987,21 +2320,21 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" -version = "14.0.1" +version = "16.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8156f209055d352994ecd49e19658c6b469d7c6de923bd79868957d0dcfb6f71" +checksum = "b0b525f462fa8121c3d143ad0d876660584f160ad5baa68c57bfeeb293c6b8fb" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "frame-election-provider-support" -version = "37.0.0" +version = "40.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772f6843543fea5d5083f8f7fe714632f6ab7a230a0a805ccc669e97330494a2" +checksum = "258462616cd9a44c9cf4b7e3cb3aebaa050027838aa98f538f8af1ae75c8d2d1" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2016,9 +2349,9 @@ dependencies = [ [[package]] name = "frame-executive" -version = "37.0.2" +version = "40.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d42daa7f480c2f5ade82bca44ce257dccf3f9d1065fb7b8a30da22c00bf07ff0" +checksum = "0cc32bb3f500bb1b4661ad73bc270890178f067af38ed7e4ab2c85d03b18b0f8" dependencies = [ "aquamarine", "frame-support", @@ -2035,9 +2368,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "16.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" +checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" dependencies = [ "cfg-if", "parity-scale-codec", @@ -2047,11 +2380,12 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" -version = "0.5.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4033a2b473472e7ad29ff501d3cedff36f8eaa26f61654d19b6b5cf3e1885296" +checksum = "b9cb18dcd3517d3b994f2820749fe4a9e42c2a057a8c52b30bf21b00d5d6f2b9" dependencies = [ "array-bytes", + "const-hex", "docify", "frame-support", "frame-system", @@ -2063,12 +2397,13 @@ dependencies = [ [[package]] name = "frame-support" -version = "37.1.0" +version = "40.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7078e2b22461a2987d47b8062c07f28df4e518974a4a28c081c55d237090412a" +checksum = "1d6c7c272704856cc88a86aef689a778050e59f89d7ec1e4ffb3a9e8e04e6b10" dependencies = [ "aquamarine", "array-bytes", + "binary-merkle-tree", "bitflags 1.3.2", "docify", "environmental", @@ -2083,7 +2418,6 @@ dependencies = [ "scale-info", "serde", "serde_json", - "smallvec", "sp-api", "sp-arithmetic", "sp-core", @@ -2098,20 +2432,21 @@ dependencies = [ "sp-state-machine", "sp-std", "sp-tracing", + "sp-trie", "sp-weights", - "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" -version = "30.0.5" +version = "33.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f7389269676f3360f03b706ffcb26b6af48520d8fe1607bfef54645da4bb045" +checksum = "bcb3c16c8fe1b4edc6df122212b50f776dfce31a94fa63305100841ba4eb7c93" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", + "docify", "expander", "frame-support-procedural-tools", "itertools 0.11.0", @@ -2120,20 +2455,20 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "frame-support-procedural-tools" -version = "13.0.0" +version = "13.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bead15a320be1764cdd50458c4cfacb23e0cee65f64f500f8e34136a94c7eeca" +checksum = "81a088fd6fda5f53ff0c17fc7551ce8bd0ead14ba742228443c8196296a7369b" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -2144,14 +2479,14 @@ checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "frame-system" -version = "37.1.0" +version = "40.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043790fff021477061b207fd6b33743793b63fc64a583358956787229d039717" +checksum = "d1e700f225f5cfe5d89f564ab23b6c609c144228d4d9871956ef209b20c9df98" dependencies = [ "cfg-if", "docify", @@ -2163,16 +2498,30 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", "sp-version", "sp-weights", ] +[[package]] +name = "frame-system-benchmarking" +version = "40.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e71232838b3b442b49601fc4634d175e552fc954ffebe303d8455963eb3bd5c1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + [[package]] name = "frame-system-rpc-runtime-api" -version = "34.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475c4f8604ba7e4f05cd2c881ba71105093e638b9591ec71a8db14a64b3b4ec3" +checksum = "244a5015742d349a814bc7f2aa999a9ec47924374a22672cfc3043a1eb87295f" dependencies = [ "docify", "parity-scale-codec", @@ -2181,9 +2530,9 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.43.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec60be1ddc39bd312496e58b2dd82e5f3d1e0609b69f9586ba6967a36453e495" +checksum = "ac619a778035be86fc70ac58db9ae3d5d44107dac81ddcaa2f9e8744a0c71eb1" dependencies = [ "frame-support", "parity-scale-codec", @@ -2218,9 +2567,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -2233,9 +2582,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -2243,15 +2592,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -2261,32 +2610,32 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" @@ -2296,9 +2645,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -2334,33 +2683,35 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] -name = "getrandom_or_panic" -version = "0.0.3" +name = "getrandom" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ - "rand", - "rand_core", + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] -name = "ghash" -version = "0.5.1" +name = "getrandom_or_panic" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "opaque-debug", - "polyval", + "rand 0.8.5", + "rand_core 0.6.4", ] [[package]] @@ -2376,25 +2727,19 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ "fallible-iterator 0.3.0", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" @@ -2403,10 +2748,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] +[[package]] +name = "h2" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap 2.10.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hash-db" version = "0.16.0" @@ -2447,6 +2811,15 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +dependencies = [ + "allocator-api2", +] + [[package]] name = "heck" version = "0.4.1" @@ -2467,9 +2840,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hermit-abi" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hex" @@ -2485,18 +2858,9 @@ checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac 0.12.1", -] +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" @@ -2530,9 +2894,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -2541,20 +2905,32 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", + "futures-core", "http", + "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.9.4" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -2564,79 +2940,201 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" [[package]] name = "hyper" -version = "0.14.30" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" dependencies = [ + "atomic-waker", "bytes", "futures-channel", "futures-core", - "futures-util", + "h2", "http", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2", + "pin-utils", + "smallvec", "tokio", - "tower-service", - "tracing", - "want", +] + +[[package]] +name = "hyper-util" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "hyper", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", ] [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] name = "impl-codec" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +checksum = "2d40b9d5e17727407e55028eafc22b2dc68781786e6d7eb8a21103f5058e3a14" dependencies = [ "parity-scale-codec", ] +[[package]] +name = "impl-num-traits" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" +dependencies = [ + "integer-sqrt", + "num-traits", + "uint", +] + [[package]] name = "impl-rlp" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +checksum = "54ed8ad1f3877f7e775b8cbf30ed1bd3209a95401817f19a0eb4402d13f8cf90" dependencies = [ "rlp", ] [[package]] name = "impl-serde" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" dependencies = [ "serde", ] [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.104", ] [[package]] @@ -2671,32 +3169,22 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", - "hashbrown 0.14.5", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", + "hashbrown 0.15.4", ] [[package]] name = "insta" -version = "1.39.0" +version = "1.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" +checksum = "154934ea70c58054b556dd430b99a98c2a7ff5309ac9891597e339b5c28f4371" dependencies = [ "console", - "lazy_static", - "linked-hash-map", + "once_cell", "serde", "similar", ] @@ -2721,15 +3209,26 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "io-uring" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "libc", +] + [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi 0.5.2", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2750,33 +3249,43 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom 0.3.3", "libc", ] [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", "once_cell", "serdect", - "sha2 0.10.8", + "sha2 0.10.9", ] [[package]] @@ -2963,27 +3472,27 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.53.3", ] [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "360e552c93fa0e8152ab463bc4c4837fce76a225df11dfaeea66c313de5e61f7" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "libc", "redox_syscall", ] @@ -3005,18 +3514,18 @@ dependencies = [ [[package]] name = "libsecp256k1" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +checksum = "e79019718125edc905a079a70cfa5f3820bc76139fc91d6f9abc27ea2a887139" dependencies = [ "arrayref", - "base64 0.13.1", + "base64 0.22.1", "digest 0.9.0", "hmac-drbg", "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand", + "rand 0.8.5", "serde", "sha2 0.9.9", "typenum", @@ -3053,9 +3562,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.20" +version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" +checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" dependencies = [ "cc", "pkg-config", @@ -3064,9 +3573,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +checksum = "4a6f6da007f968f9def0d65a05b187e2960183de70c160204ecfccf0ee330212" dependencies = [ "cc", ] @@ -3079,9 +3588,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linregress" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" +checksum = "a9eda9dcf4f2a99787827661f312ac3219292549c2ee992bf9a6248ffb066bf7" dependencies = [ "nalgebra", ] @@ -3094,15 +3603,27 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "litemap" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -3110,25 +3631,24 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lz4" -version = "1.26.0" +version = "1.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958b4caa893816eea05507c20cfe47574a43d9a697138a7872990bba8a0ece68" +checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4" dependencies = [ - "libc", "lz4-sys", ] [[package]] name = "lz4-sys" -version = "1.10.0" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109de74d5d2353660401699a4174a4ff23fcc649caf553df71933c7fb45ad868" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" dependencies = [ "cc", "libc", @@ -3152,7 +3672,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -3166,7 +3686,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -3177,7 +3697,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -3188,7 +3708,7 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -3340,9 +3860,9 @@ dependencies = [ [[package]] name = "matrixmultiply" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" dependencies = [ "autocfg", "rawpointer", @@ -3350,9 +3870,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memfd" @@ -3360,7 +3880,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.34", + "rustix 0.38.44", ] [[package]] @@ -3392,9 +3912,9 @@ dependencies = [ [[package]] name = "merkleized-metadata" -version = "0.1.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f313fcff1d2a4bcaa2deeaa00bf7530d77d5f7bd0467a117dde2e29a75a7a17a" +checksum = "dc9b7ac0ce054412d9a85ff39bac27aec27483b06cef8756b57d9c29d448d081" dependencies = [ "array-bytes", "blake3", @@ -3412,7 +3932,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core", + "rand_core 0.6.4", "zeroize", ] @@ -3424,23 +3944,22 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ - "hermit-abi 0.3.9", "libc", - "wasi", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -3552,7 +4071,7 @@ dependencies = [ "pallet-balances", "pallet-timestamp", "parity-scale-codec", - "rand_chacha", + "rand_chacha 0.3.1", "scale-info", "sp-application-crypto", "sp-core", @@ -4224,13 +4743,12 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.32.6" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4" +checksum = "26aecdf64b707efd1310e3544d709c5c0ac61c13756046aaaba41be5c4f66a3b" dependencies = [ "approx", "matrixmultiply", - "nalgebra-macros", "num-complex", "num-rational", "num-traits", @@ -4238,17 +4756,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "nalgebra-macros" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.76", -] - [[package]] name = "nohash-hasher" version = "0.2.0" @@ -4366,11 +4873,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.5.2", "libc", ] @@ -4425,27 +4932,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - -[[package]] -name = "object" -version = "0.36.3" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "opaque-debug" @@ -4453,9 +4951,15 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "orml-asset-registry" -version = "1.0.0" +version = "1.4.0" dependencies = [ "cumulus-pallet-xcm", "cumulus-primitives-core", @@ -4489,7 +4993,7 @@ dependencies = [ [[package]] name = "orml-auction" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4505,7 +5009,7 @@ dependencies = [ [[package]] name = "orml-authority" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4523,7 +5027,7 @@ dependencies = [ [[package]] name = "orml-benchmarking" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -4545,7 +5049,7 @@ dependencies = [ [[package]] name = "orml-currencies" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4564,7 +5068,7 @@ dependencies = [ [[package]] name = "orml-gradually-update" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4579,7 +5083,7 @@ dependencies = [ [[package]] name = "orml-nft" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4594,7 +5098,7 @@ dependencies = [ [[package]] name = "orml-oracle" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -4613,7 +5117,7 @@ dependencies = [ [[package]] name = "orml-oracle-runtime-api" -version = "1.0.0" +version = "1.4.0" dependencies = [ "parity-scale-codec", "sp-api", @@ -4622,7 +5126,7 @@ dependencies = [ [[package]] name = "orml-parameters" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4638,7 +5142,7 @@ dependencies = [ [[package]] name = "orml-payments" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4656,7 +5160,7 @@ dependencies = [ [[package]] name = "orml-rewards" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4672,7 +5176,7 @@ dependencies = [ [[package]] name = "orml-tokens" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4693,7 +5197,7 @@ dependencies = [ [[package]] name = "orml-tokens-runtime-api" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "parity-scale-codec", @@ -4703,7 +5207,7 @@ dependencies = [ [[package]] name = "orml-traits" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -4722,7 +5226,7 @@ dependencies = [ [[package]] name = "orml-unknown-tokens" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4740,7 +5244,7 @@ dependencies = [ [[package]] name = "orml-utilities" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4756,7 +5260,7 @@ dependencies = [ [[package]] name = "orml-vesting" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4772,7 +5276,7 @@ dependencies = [ [[package]] name = "orml-xcm" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "frame-system", @@ -4786,7 +5290,7 @@ dependencies = [ [[package]] name = "orml-xcm-mock-message-queue" -version = "1.0.0" +version = "1.4.0" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -4802,7 +5306,7 @@ dependencies = [ [[package]] name = "orml-xcm-support" -version = "1.0.0" +version = "1.4.0" dependencies = [ "frame-support", "orml-traits", @@ -4815,7 +5319,7 @@ dependencies = [ [[package]] name = "orml-xtokens" -version = "1.0.0" +version = "1.4.0" dependencies = [ "cumulus-pallet-xcm", "cumulus-primitives-core", @@ -4854,9 +5358,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pallet-asset-conversion" -version = "19.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6847af5ada683672e4ba5307edd30935b523b96ddd3e6c0d9ae538967e7b6e72" +checksum = "e063e39ad8ecd3c2b00c963f50cdf79e614c819a01e1c1ce9993287075b1b4d9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4873,9 +5377,9 @@ dependencies = [ [[package]] name = "pallet-asset-rate" -version = "16.0.0" +version = "19.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16cf98e523678604f17e784986e789f515bb367dc5cf41f8f966b934ea2fb9d5" +checksum = "0e66408a38dcc61847fb287320600c75f7db21d3ca6a7e746a1153f1ced07701" dependencies = [ "frame-benchmarking", "frame-support", @@ -4888,9 +5392,9 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8aba8d3470ea8ca27a8d3fecce2896094d22e7b3109120b01d0d5d2553f5a6d" +checksum = "080d8f7ea66322bdb98ce467c47354e44d7f8f847fdeae921083ad792199b449" dependencies = [ "frame-benchmarking", "frame-support", @@ -4906,9 +5410,9 @@ dependencies = [ [[package]] name = "pallet-assets" -version = "39.0.0" +version = "42.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd34007f64b1159232feacc431ae88b8319e16e594ed6ffc2c1a10ecf6e0ad64" +checksum = "47e7b226dac42400ed2bac82ecdb672413f805c7b48e481875c3ecb7f517bfcf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4923,9 +5427,9 @@ dependencies = [ [[package]] name = "pallet-aura" -version = "36.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2b4c3fc3c5af69af275ee8f1fc70aa73d0633b0cd818c603a2e8b483d4a9ccb" +checksum = "4afcad52b78910d4acb9b260758f69d6167c2e5e03040bd87f42fa2e182f9bad" dependencies = [ "frame-support", "frame-system", @@ -4940,9 +5444,9 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e950b8368ef4af6af91d10061d5fc587ee92ed360e4b5bc32454a68842ccafe2" +checksum = "85cefc0e56c81e8140372ef6275ccd87e00e63d933c92e926fe0bc8de931b80e" dependencies = [ "frame-support", "frame-system", @@ -4956,9 +5460,9 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ddfa02ecfdd0bfa4841dc16ebd3bdd0d1918751b845f4b36b29c01bfaf75b5b" +checksum = "d08ec7786d0232e2f92f36e9e20c7414f3b4d763a35569c0b9c32ed90ed62c50" dependencies = [ "frame-support", "frame-system", @@ -4970,9 +5474,9 @@ dependencies = [ [[package]] name = "pallet-babe" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4cee370246a2a8fa7d62b02b96febde7c8b09d18c9b8ce3a35c20a142379c8" +checksum = "6c78d5bb4aa708189740d5be25ed6797e445972b5146f55d5e2111a2a3dc9560" dependencies = [ "frame-benchmarking", "frame-support", @@ -4994,9 +5498,9 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "38.0.0" +version = "41.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267f2b4c64e06d340fab1e48267e815dc2afaf8e6da16369b26b5c9e1e65f1aa" +checksum = "58e04ed6c01cd829731ec7bcec0de4e49cd806195ca2448a1887c5493efd8262" dependencies = [ "docify", "frame-benchmarking", @@ -5005,14 +5509,15 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", + "sp-core", "sp-runtime", ] [[package]] name = "pallet-bounties" -version = "36.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b025a04d02a33335672b144d58a824ca25c45848867180dbc416618f43d3408" +checksum = "d5f80068c7a78879a529fd5548b0bddd4e053106484087dc16cbd81db6b4e251" dependencies = [ "frame-benchmarking", "frame-support", @@ -5028,9 +5533,9 @@ dependencies = [ [[package]] name = "pallet-broker" -version = "0.16.0" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce40525635682724f4ed243f6be36951df424b24703913fb696d6933e1db55e" +checksum = "47c26e061a2b40adc3ef186de6fb619f993bea265643b5ef41e98c578784ed6e" dependencies = [ "bitvec", "frame-benchmarking", @@ -5047,9 +5552,9 @@ dependencies = [ [[package]] name = "pallet-collator-selection" -version = "18.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e680a751ac8ea4a820096b9b480457a10abd5ce495e65c24457993ad846d4c0" +checksum = "baa9a18a85915578e3e41fd4aea50a9db64fb57c97296e6a311373f68e40face" dependencies = [ "frame-benchmarking", "frame-support", @@ -5059,7 +5564,7 @@ dependencies = [ "pallet-balances", "pallet-session", "parity-scale-codec", - "rand", + "rand 0.8.5", "scale-info", "sp-runtime", "sp-staking", @@ -5067,10 +5572,11 @@ dependencies = [ [[package]] name = "pallet-collective" -version = "37.0.0" +version = "40.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3d561c8e207ecd55cd77d040444f1525a7f6246c5f46a8e7211013ae04b8d" +checksum = "47a387e0ed8cf134d3a8f2c229ef19e7558537cf67d113d4fe2558415a8f49f1" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -5084,9 +5590,9 @@ dependencies = [ [[package]] name = "pallet-democracy" -version = "37.0.0" +version = "40.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4270bbcd896cc6aa04e0bbb07795b715b5320eacca6f46e7c705c0d70cf66357" +checksum = "b9f9e8d2e1a11aa809779748c073ec9e6d44807fbdae7787edbbbbff673ee015" dependencies = [ "frame-benchmarking", "frame-support", @@ -5102,9 +5608,9 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" -version = "36.0.0" +version = "39.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b02a05136d6c5b46fc4963232ffc2069d444100c79fa524627b307fcaea78cd2" +checksum = "c0425fefdbe37d50a05b6984cd536111acb362a5ed8f267a4c6253431af0717f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5113,7 +5619,7 @@ dependencies = [ "log", "pallet-election-provider-support-benchmarking", "parity-scale-codec", - "rand", + "rand 0.8.5", "scale-info", "sp-arithmetic", "sp-core", @@ -5125,9 +5631,9 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" -version = "36.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd65dad4b4de7ec4b0d1631d1e8ad8766eaaa0ab4e871ec6c73a1e894c68afc9" +checksum = "d5db80ea1d9cab28608ad2747981640a82de9d2f8c3d096664ff9e557a42a7c1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5139,9 +5645,9 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" -version = "38.0.0" +version = "41.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b619d7819e43ff1cc6201fb4cf73d6b65f6b6975c1014a1d73ac88e60986b19c" +checksum = "2cf5efc33f6a2eeb167c4b8f065da0417bf76898982f413aca07fae7e1571efc" dependencies = [ "frame-benchmarking", "frame-support", @@ -5158,9 +5664,9 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" -version = "36.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "283f467fdee4862f2fcb7ae354c0380e8e763fc465b6b7c560950aa0cce90731" +checksum = "61735a183468e51aec3a8bfda874acab4f07026a89dec8841394a5f45010ebb7" dependencies = [ "docify", "frame-benchmarking", @@ -5177,9 +5683,9 @@ dependencies = [ [[package]] name = "pallet-identity" -version = "37.0.0" +version = "40.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83fd8ea40185db968ecec0c4782e3cdf9a788ad4fc4a5870eeb0d0981de2680" +checksum = "d9c97dbd01716801ca490a21a4b525f5149b7c2350f3e56b1c6332bb2d471bdb" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5194,9 +5700,9 @@ dependencies = [ [[package]] name = "pallet-indices" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0bd6b183d5bb4c33693c47d8012bb1026b88fff49588dcf5d320a3117f2b8d" +checksum = "6d9305e70776c08ac9a3cdc3885b23306c466b16e75611efeea601fb92cbf250" dependencies = [ "frame-benchmarking", "frame-support", @@ -5205,15 +5711,14 @@ dependencies = [ "scale-info", "sp-core", "sp-io", - "sp-keyring", "sp-runtime", ] [[package]] name = "pallet-membership" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2168417fce51f72b11973f0bb9eab9bde44e4bbad4fc55090e53255e9104b7" +checksum = "eca06af7edcaa916effec49edc0ebbc41ca7a7c00c9824eafbe729a36a73fb0d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5228,9 +5733,9 @@ dependencies = [ [[package]] name = "pallet-message-queue" -version = "40.0.0" +version = "43.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0043ed8838d63b195365119311cef59e2cf32f7a7ca55128a4ae1f9fd80330e2" +checksum = "e4ef2434f1354b0db1f5ee9419e627e726519dc617272daa626aeb0a64c3b57b" dependencies = [ "environmental", "frame-benchmarking", @@ -5246,27 +5751,36 @@ dependencies = [ "sp-weights", ] +[[package]] +name = "pallet-mmr" +version = "40.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd2a5b9cfceb0073d7282733a38473b2b8ba4d93d596c2aa23a2b73900515f11" +dependencies = [ + "log", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", + "sp-mmr-primitives", +] + [[package]] name = "pallet-multisig" -version = "37.0.0" +version = "40.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b836d56979a4cd33b68bca09ea34bd0eb524fad8711cb6471ec84a5c3318ea6f" +checksum = "ca1dbd8f9e06763b6e7b918d56fa780d8301e908316e8091a38dec764218e626" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", "log", "parity-scale-codec", + "polkadot-sdk-frame", "scale-info", - "sp-io", - "sp-runtime", ] [[package]] name = "pallet-preimage" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d77b400c54d7d6645a768a62a430dba851e553d9eef9376cfa1ab0e13acf13" +checksum = "becb813ca45bef02a52869c3c865f84be01d6b92d0b6c411c3e219e95907dbbd" dependencies = [ "frame-benchmarking", "frame-support", @@ -5281,24 +5795,20 @@ dependencies = [ [[package]] name = "pallet-proxy" -version = "37.0.0" +version = "40.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a6f11efebb88d9c64fa3335fb376d3603302ee46bbbe36fff8e1d0e01d0d4" +checksum = "4f84c01677715acc9590b393623393f722c0df459b8dcd9465ae0ac46bb904d0" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", "parity-scale-codec", + "polkadot-sdk-frame", "scale-info", - "sp-io", - "sp-runtime", ] [[package]] name = "pallet-recovery" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769e3fe4e7445d095814447961d674a01b5feea0d07424ef82ef844f12d8e9dc" +checksum = "02eeb358622a13124326b57fc26fbcd2258f7f123cee704c6537c6f2d0c83546" dependencies = [ "frame-benchmarking", "frame-support", @@ -5311,9 +5821,9 @@ dependencies = [ [[package]] name = "pallet-root-testing" -version = "13.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9c14b36f689daf3d2110be82aa64f55f2405742f148a7f24187c5d88fb4648" +checksum = "b96456f941dc194636e81851e77666fc39638a36ce39952cb51e4c1027b6b7b0" dependencies = [ "frame-support", "frame-system", @@ -5326,9 +5836,9 @@ dependencies = [ [[package]] name = "pallet-scheduler" -version = "38.0.0" +version = "41.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca20e5a34daccd584fa00e2239113cbb7e6097d03064a8e7dc4df0640ac8dfce" +checksum = "3cb7b2e47ad83f06891cd6a7fb1bd3ea670272c2b1248e9ae1c832df3678f720" dependencies = [ "docify", "frame-benchmarking", @@ -5344,9 +5854,9 @@ dependencies = [ [[package]] name = "pallet-session" -version = "37.0.0" +version = "40.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84da59cf6db5db9a4424a5967787bf4ea20bfa903988a2438429c09a48365acf" +checksum = "35361f753986d6fe6654b3e5d283700c4f0bb082221c6aaf299912a29679c880" dependencies = [ "frame-support", "frame-system", @@ -5366,9 +5876,9 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "37.0.0" +version = "40.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e59824a9ca557a64c4ba26331a2db84f91610e75620a497610287a16edfb52d7" +checksum = "bd4ce865c70bb5fd4850d2af985d96fc971ebc9a352bba8d97b053f9ca00b80d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5378,7 +5888,7 @@ dependencies = [ "pallet-authorship", "pallet-session", "parity-scale-codec", - "rand_chacha", + "rand_chacha 0.3.1", "scale-info", "serde", "sp-application-crypto", @@ -5389,9 +5899,9 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" -version = "22.0.0" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "988a7ebeacc84d4bdb0b12409681e956ffe35438447d8f8bc78db547cffb6ebc" +checksum = "4b982dbfe9fbc548dc7f9a3078214989ed58cabf521a8313ae1767d6b4b53b9b" dependencies = [ "log", "sp-arithmetic", @@ -5399,9 +5909,9 @@ dependencies = [ [[package]] name = "pallet-sudo" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82e375c0a4c4ed079ae49bd2693548bd57178273b37631bcd7e817242d0f2b0" +checksum = "bdcb93e724a2acc7041d1e368895bc3ce272b6db8338a079037395cd5e6a97db" dependencies = [ "docify", "frame-benchmarking", @@ -5415,9 +5925,9 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "36.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d301332166bded1fb86eda22846287de6c7313c15dce87535aae3c956f5f2c9b" +checksum = "ccf2c41020fe6b676345a2f4e224faf128ba26dfc5d4da7938d1a91049dc3203" dependencies = [ "docify", "frame-benchmarking", @@ -5435,9 +5945,9 @@ dependencies = [ [[package]] name = "pallet-tips" -version = "36.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb28f1cf5ded9cc71fe04eece85be06482c1b6544facb1092ebb18eeb3e23e2e" +checksum = "884613a538e24d02d1848107e4ad66c569a28d227545e3a267ce165e30a7f468" dependencies = [ "frame-benchmarking", "frame-support", @@ -5454,10 +5964,11 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6b4889a0a8565cf0d6ecf3feef787c18ad2c529add4d90ec896873cd422eec" +checksum = "a8ebd61b64848e39e5615832c964dc10b63bcebff26a9ec1cb867b4087240a03" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", @@ -5470,9 +5981,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1879d1f608f565d590fc7520a8d9977b868a412910f6381a5ebfa45acf8abcfb" +checksum = "e3bd3329d44b44623b7615cc069b292f2a1fe5c0f4a6625c36cc906f2a43fcc1" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5483,15 +5994,16 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "36.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee7b2c3dec2979b0ea7bc33f01d78d12ed58b556011c52513dfd422342df8f3" +checksum = "bfd2d341f5df906bcfb7ff50e9abb97769786ba0ed36bfef10d88c9df6a06342" dependencies = [ "docify", "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", + "log", "pallet-balances", "parity-scale-codec", "scale-info", @@ -5502,9 +6014,9 @@ dependencies = [ [[package]] name = "pallet-utility" -version = "37.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db53b324a0d0f078b5e61434fb3f2f4a89d81481dfd799fa4a71d054b441672a" +checksum = "35a321f0aec416f3369a71a2bb0ad41f415823ff140fd22b1a3b724dfa6256f7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5518,9 +6030,9 @@ dependencies = [ [[package]] name = "pallet-vesting" -version = "37.0.0" +version = "40.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271f52d5ec90583ce7bd7d302f89b9ebabe1a820dc3e162fc1e5b14889f3b12c" +checksum = "838e1e6521dfdd7bc9c5ab16489e85e30e94f9ccb7a20e3caa073fb17c9e73f7" dependencies = [ "frame-benchmarking", "frame-support", @@ -5533,15 +6045,14 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "16.0.0" +version = "19.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a8c373e1c15eaa72fada061ffc486d81ff8bdb253ce3d569908c97ed40a89c" +checksum = "ca27d506282f4c9cd2cac6fb0d199edd89d366635f04801319e7145912547a68" dependencies = [ "bounded-collections", "frame-benchmarking", "frame-support", "frame-system", - "log", "pallet-balances", "parity-scale-codec", "scale-info", @@ -5552,19 +6063,19 @@ dependencies = [ "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", + "tracing", "xcm-runtime-apis", ] [[package]] name = "pallet-xcm-benchmarks" -version = "16.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5629e0639e2894d9a647a5146f63b219d7317f34196e91c42ab384f533cd999e" +checksum = "ddc762e28929d9d3a0d65e1e13d79fb258c423a80bb3ab57ff0b2fc8d8cfb04d" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "parity-scale-codec", "scale-info", "sp-io", @@ -5576,9 +6087,9 @@ dependencies = [ [[package]] name = "parachains-common" -version = "17.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91304aa1eb95bdea1471bc3994fb8cb30a8d913bdcd2abe59a70abfaf3e49abf" +checksum = "b68844f03979cb0c8b208306047f3b1134b59c74c1fdc9b7f2d8a591ba69b956" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", @@ -5602,7 +6113,6 @@ dependencies = [ "staging-parachain-info", "staging-xcm", "staging-xcm-executor", - "substrate-wasm-builder", ] [[package]] @@ -5612,8 +6122,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" dependencies = [ "bitcoin_hashes", - "rand", - "rand_core", + "rand 0.8.5", + "rand_core 0.6.4", "serde", "unicode-normalization", ] @@ -5639,7 +6149,7 @@ dependencies = [ "lz4", "memmap2", "parking_lot", - "rand", + "rand 0.8.5", "siphasher", "snap", "winapi", @@ -5647,29 +6157,31 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.12" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", "bytes", + "const_format", "impl-trait-for-tuples", "parity-scale-codec-derive", + "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.6.12" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.104", ] [[package]] @@ -5689,9 +6201,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -5699,9 +6211,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", @@ -5717,7 +6229,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ "base64ct", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -5751,9 +6263,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -5773,15 +6285,25 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "polkadot-ckb-merkle-mountain-range" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "221c71b432b38e494a0fdedb5f720e4cb974edf03a0af09e5b2238dbac7e6947" +dependencies = [ + "cfg-if", + "itertools 0.10.5", +] [[package]] name = "polkadot-core-primitives" -version = "15.0.0" +version = "17.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2900d3b857e34c480101618a950c3a4fbcddc8c0d50573d48553376185908b8" +checksum = "0b7c519ee804fd08d7464871bd2fe164e8f0683501ea59d2a10f5ef214dacb3b" dependencies = [ "parity-scale-codec", "scale-info", @@ -5791,12 +6313,12 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" -version = "14.0.0" +version = "16.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52b5648a2e8ce1f9a0f8c41c38def670cefd91932cd793468e1a5b0b0b4e4af1" +checksum = "72943c0948c686b47bacb1a03e59baff63bfba2e16e208d77f0f8615827f8564" dependencies = [ "bounded-collections", - "derive_more", + "derive_more 0.99.20", "parity-scale-codec", "polkadot-core-primitives", "scale-info", @@ -5808,9 +6330,9 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "15.0.0" +version = "18.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b57bc055fa389372ec5fc0001b99aeffd50f3fd379280ce572d935189bb58dd8" +checksum = "7eadd5ca22e2ded7a12a484a6e0962ed86c379ce4bb83fbd82843b6459a20cef" dependencies = [ "bitvec", "hex-literal", @@ -5831,13 +6353,15 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", + "sp-std", + "thiserror", ] [[package]] name = "polkadot-runtime-common" -version = "16.0.0" +version = "19.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0572bf05ac57526ed10597078e2598cb3ee9ae9b7eba605d222276bbf1cee44b" +checksum = "768b3b70c32202f5e2fa1c673b01dcdb46c726b0d66d865d9638035fd2ecccfc" dependencies = [ "bitvec", "frame-benchmarking", @@ -5868,12 +6392,12 @@ dependencies = [ "rustc-hex", "scale-info", "serde", - "serde_derive", "slot-range-helper", "sp-api", "sp-core", "sp-inherents", "sp-io", + "sp-keyring", "sp-npos-elections", "sp-runtime", "sp-session", @@ -5886,9 +6410,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "16.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4636dd0772d838fb2e3c4a54a6530f2921e80d6cde48eba0ecc029e6378f900" +checksum = "436b4a652ead58e7697a773d819f842d821b7feabdb5e5252d4af0cc0c1ad260" dependencies = [ "bs58", "frame-benchmarking", @@ -5899,13 +6423,12 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "16.0.1" +version = "19.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2fae7580b1a541a810e3602c46086a181a6e8aa2c178f3b6f0a4fb5e0bd9f9c" +checksum = "a76fc49c2a9a7d13fbd1d97d448366ad5b7197d7684ec9013271d99c015d13d6" dependencies = [ "bitflags 1.3.2", "bitvec", - "derive_more", "frame-benchmarking", "frame-support", "frame-system", @@ -5917,17 +6440,17 @@ dependencies = [ "pallet-balances", "pallet-broker", "pallet-message-queue", + "pallet-mmr", "pallet-session", "pallet-staking", "pallet-timestamp", - "pallet-vesting", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-metrics", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "scale-info", "serde", "sp-api", @@ -5940,16 +6463,53 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", + "sp-std", "staging-xcm", "staging-xcm-executor", "static_assertions", ] +[[package]] +name = "polkadot-sdk-frame" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "386c622773c64ba462fea05debe20d71b0caf5d273a6cdb8277a1ca853adfd1c" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-arithmetic", + "sp-block-builder", + "sp-consensus-aura", + "sp-consensus-grandpa", + "sp-core", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-storage", + "sp-transaction-pool", + "sp-version", +] + [[package]] name = "polkavm" -version = "0.9.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3693e5efdb2bf74e449cd25fd777a28bd7ed87e41f5d5da75eb31b4de48b94" +checksum = "dd044ab1d3b11567ab6b98ca71259a992b4034220d5972988a0e96518e5d343d" dependencies = [ "libc", "log", @@ -5960,63 +6520,65 @@ dependencies = [ [[package]] name = "polkavm-assembler" -version = "0.9.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa96d6d868243acc12de813dd48e756cbadcc8e13964c70d272753266deadc1" +checksum = "eaad38dc420bfed79e6f731471c973ce5ff5e47ab403e63cf40358fef8a6368f" dependencies = [ "log", ] [[package]] name = "polkavm-common" -version = "0.9.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" +checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" dependencies = [ "log", + "polkavm-assembler", ] [[package]] name = "polkavm-derive" -version = "0.9.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" +checksum = "c2eb703f3b6404c13228402e98a5eae063fd16b8f58afe334073ec105ee4117e" dependencies = [ "polkavm-derive-impl-macro", ] [[package]] name = "polkavm-derive-impl" -version = "0.9.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" +checksum = "2f2116a92e6e96220a398930f4c8a6cda1264206f3e2034fc9982bfd93f261f7" dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "polkavm-derive-impl-macro" -version = "0.9.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" +checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" dependencies = [ "polkavm-derive-impl", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "polkavm-linker" -version = "0.9.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" +checksum = "e9bfe793b094d9ea5c99b7c43ba46e277b0f8f48f4bbfdbabf8d3ebf701a4bd3" dependencies = [ - "gimli 0.28.1", + "dirs", + "gimli 0.31.1", "hashbrown 0.14.5", "log", - "object 0.32.2", + "object 0.36.7", "polkavm-common", "regalloc2 0.9.3", "rustc-demangle", @@ -6024,20 +6586,17 @@ dependencies = [ [[package]] name = "polkavm-linux-raw" -version = "0.9.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26e85d3456948e650dff0cfc85603915847faf893ed1e66b020bb82ef4557120" +checksum = "23eff02c070c70f31878a3d915e88a914ecf3e153741e2fb572dde28cce20fde" [[package]] -name = "polyval" -version = "0.6.2" +name = "potential_utf" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug", - "universal-hash", + "zerovec", ] [[package]] @@ -6048,31 +6607,32 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ "zerocopy", ] [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "ff24dfcda44452b9816fff4cd4227e1bb73ff5a2f1bc1105aa92fb8565ce44d2" dependencies = [ "proc-macro2", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "primitive-types" -version = "0.12.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" dependencies = [ "fixed-hash", "impl-codec", + "impl-num-traits", "impl-rlp", "impl-serde", "scale-info", @@ -6091,11 +6651,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.22.27", ] [[package]] @@ -6124,20 +6684,20 @@ dependencies = [ [[package]] name = "proc-macro-warning" -version = "1.0.2" +version = "1.84.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" +checksum = "75eea531cfcd120e0851a3f8aed42c4841f78c889eefafd96339c72677ae42c3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -6156,24 +6716,46 @@ dependencies = [ "thiserror", ] +[[package]] +name = "proptest" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" +dependencies = [ + "bitflags 2.9.1", + "lazy_static", + "num-traits", + "rand 0.9.2", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax 0.8.5", + "unarray", +] + [[package]] name = "psm" -version = "0.1.21" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "radium" version = "0.7.0" @@ -6187,8 +6769,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", ] [[package]] @@ -6198,7 +6790,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] @@ -6207,7 +6809,25 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.3", ] [[package]] @@ -6238,11 +6858,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", ] [[package]] @@ -6251,29 +6871,29 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.16", "libredox", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -6303,14 +6923,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] @@ -6324,13 +6944,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -6341,9 +6961,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rfc6979" @@ -6366,9 +6986,9 @@ dependencies = [ [[package]] name = "rlp" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +checksum = "fa24e92bb2a83198bb76d661a71df9f7076b8c420b8696e4d3d97d50d94479e3" dependencies = [ "bytes", "rlp-derive", @@ -6377,13 +6997,13 @@ dependencies = [ [[package]] name = "rlp-derive" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +checksum = "652db34deaaa57929e10ca18e5454a32cb0efc351ae80d320334bbf907b908b3" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.104", ] [[package]] @@ -6581,9 +7201,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustc-hash" @@ -6599,11 +7219,11 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.26", ] [[package]] @@ -6622,34 +7242,47 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "errno", "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", + "linux-raw-sys 0.9.4", + "windows-sys 0.60.2", ] [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "safe_arch" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" dependencies = [ "bytemuck", ] @@ -6665,9 +7298,9 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "29.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b975ee3a95eaacb611e7b415737a7fa2db4d8ad7b880cc1b97371b04e95c7903" +checksum = "7c10a9966875fcbde028c73697c6d5faad5f5d24e94b3c949fb1d063c727381d" dependencies = [ "log", "sp-core", @@ -6677,9 +7310,9 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "37.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73f1673cdfe658c4be6ffd5113b71c0de74616717e604455dcfd29e15781729" +checksum = "ace1a9f5b53e738a353079a5e5a41e55fa62887cc1d7491b97feca6847b4f88d" dependencies = [ "fnv", "futures", @@ -6697,7 +7330,6 @@ dependencies = [ "sp-externalities", "sp-runtime", "sp-state-machine", - "sp-statement-store", "sp-storage", "sp-trie", "substrate-prometheus-endpoint", @@ -6705,9 +7337,9 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.44.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b3a8a704ef66326a1f95ae17fe42a10ef55158c738bd904fbc6d4a0e7f9eb29" +checksum = "8dfc8b2f7156ced83fc9e52a610b580a54d2499e7674f8f629ea3a11e4c2d0e9" dependencies = [ "hash-db", "kvdb", @@ -6732,9 +7364,9 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.40.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963c1ebaf6bd0bc4ab0603c3cd7200ed25230a897a3217928a559fedce6019df" +checksum = "b55c745bf88acb34bd606346c7de6cc06f334f627c1ff40380252a6e52ad9354" dependencies = [ "parity-scale-codec", "parking_lot", @@ -6756,9 +7388,9 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.35.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3b703a33dcb7cddf19176fdf12294b9a6408125836b0f4afee3e6969e7f190" +checksum = "2a2f84b9aa7664a9b401afbf423bcd3c1845f5adedf4f6030586808238a222df" dependencies = [ "polkavm", "sc-allocator", @@ -6770,9 +7402,9 @@ dependencies = [ [[package]] name = "sc-executor-polkavm" -version = "0.32.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fe58d9cacfab73e5595fa84b80f7bd03efebe54a0574daaeb221a1d1f7ab80" +checksum = "7eb4929b3457077f9b30ad397a724116f43f252a889ec334ec369f6cdad8f76c" dependencies = [ "log", "polkavm", @@ -6782,13 +7414,11 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.35.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd498f2f77ec1f861c30804f5bfd796d4afcc8ce44ea1f11bfbe2847551d161" +checksum = "2b5ad79b030a1f91ef0f667e58ac35e1c9fa33a6b8a0ec1ae7fe4890322535ac" dependencies = [ "anyhow", - "cfg-if", - "libc", "log", "parking_lot", "rustix 0.36.17", @@ -6801,9 +7431,9 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f689d0b97c1bbdb2ca31b5f202bda195947f85c7fef990651cad202b99de896b" +checksum = "4b4a6610694637ad5e54ddd6af421178e23353443893213c0c2eb31344b65cd5" dependencies = [ "log", "parity-scale-codec", @@ -6813,12 +7443,13 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "37.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f02936289a079360935685eee5400311994b25e9edb2420a3c4247d419a77f46" +checksum = "55feca303d4ba839f02261c9a73d40f6b0ac7523882b4008472922b934678729" dependencies = [ "async-trait", "futures", + "indexmap 2.10.0", "log", "parity-scale-codec", "serde", @@ -6830,14 +7461,13 @@ dependencies = [ [[package]] name = "sc-utils" -version = "17.0.0" +version = "18.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf1bad736c230f16beb1cf48af9e69564df23b13aca9e5751a61266340b4bb5" +checksum = "44d8879d46892f1378ff633692740d0a5cb13777ee6dafe84d7e9b954b1e6753" dependencies = [ "async-channel", "futures", "futures-timer", - "lazy_static", "log", "parking_lot", "prometheus", @@ -6860,7 +7490,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" dependencies = [ - "derive_more", + "derive_more 0.99.20", "parity-scale-codec", "scale-bits", "scale-type-resolver", @@ -6869,13 +7499,13 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.3" +version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" +checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" dependencies = [ "bitvec", "cfg-if", - "derive_more", + "derive_more 1.0.0", "parity-scale-codec", "scale-info-derive", "serde", @@ -6883,14 +7513,14 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.3" +version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" +checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.104", ] [[package]] @@ -6901,9 +7531,9 @@ checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" [[package]] name = "schnellru" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" dependencies = [ "ahash", "cfg-if", @@ -6912,9 +7542,9 @@ dependencies = [ [[package]] name = "schnorrkel" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +checksum = "6e9fcb6c2e176e86ec703e22560d99d65a5ee9056ae45a08e13e84ebf796296f" dependencies = [ "aead", "arrayref", @@ -6922,9 +7552,9 @@ dependencies = [ "curve25519-dalek", "getrandom_or_panic", "merlin", - "rand_core", + "rand_core 0.6.4", "serde_bytes", - "sha2 0.10.8", + "sha2 0.10.9", "subtle", "zeroize", ] @@ -6937,9 +7567,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scratch" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" +checksum = "9f6280af86e5f559536da57a45ebc84948833b3bee313a7dd25232e09c878a52" [[package]] name = "sec1" @@ -6994,9 +7624,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] @@ -7009,38 +7639,38 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.209" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.15" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3" dependencies = [ "itoa", "memchr", @@ -7050,9 +7680,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] @@ -7082,9 +7712,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -7123,14 +7753,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core", + "rand_core 0.6.4", ] [[package]] name = "simba" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" +checksum = "b3a386a501cd104797982c15ae17aafe8b9261315b5d07e3ec803f2ea26be0fa" dependencies = [ "approx", "num-complex", @@ -7141,9 +7771,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] name = "simple-mermaid" @@ -7159,12 +7789,9 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" [[package]] name = "slice-group-by" @@ -7174,9 +7801,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e34f1146a457a5c554dedeae6c7273aa54c3b031f3e9eb0abd037b5511e2ce9" +checksum = "309676378797233b566bb26fb7f7f9829ae97f988b53a1f7268dd0ad17d47902" dependencies = [ "enumn", "parity-scale-codec", @@ -7186,9 +7813,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "snap" @@ -7198,19 +7825,19 @@ checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "socket2" -version = "0.5.7" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "sp-api" -version = "34.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbce492e0482134128b7729ea36f5ef1a9f9b4de2d48ff8dde7b5e464e28ce75" +checksum = "541da427f47dfb97f3dd0556fa3272bdc5dfa0d4c1ad53a22670a9bae4db63d7" dependencies = [ "docify", "hash-db", @@ -7231,24 +7858,24 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "20.0.3" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e3ec5a1a14307e21d2356e73e01573b6c82330a7e30eaceed59a90161b0c2d2" +checksum = "cedafdeaf15c774433ad8f5b00883bdf7d86e7c8b8e050e3439d4ae422114096" dependencies = [ "Inflector", "blake2", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "sp-application-crypto" -version = "38.0.0" +version = "40.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8133012faa5f75b2f0b1619d9f720c1424ac477152c143e5f7dbde2fe1a958" +checksum = "ba375ab65a76f7413d1bfe48122fd347ce7bd2047e36ecbbd78f12f5adaed121" dependencies = [ "parity-scale-codec", "scale-info", @@ -7259,9 +7886,9 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "26.0.0" +version = "26.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" +checksum = "9971b30935cea3858664965039dabd80f67aca74cc6cc6dd42ff1ab14547bc53" dependencies = [ "docify", "integer-sqrt", @@ -7269,15 +7896,14 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", "static_assertions", ] [[package]] name = "sp-authority-discovery" -version = "34.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "519c33af0e25ba2dd2eb3790dc404d634b6e4ce0801bcc8fa3574e07c365e734" +checksum = "55fc2f6c59c333eef805edcec5e603dd8e3a94e20fddb6b19cb914c9f3be7ad5" dependencies = [ "parity-scale-codec", "scale-info", @@ -7288,9 +7914,9 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "34.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74738809461e3d4bd707b5b94e0e0c064a623a74a6a8fe5c98514417a02858dd" +checksum = "a165b95a2f03d9c09c3e51ac3f23d27b091543a41cd3b3df1348aa5917d01eca" dependencies = [ "sp-api", "sp-inherents", @@ -7299,9 +7925,9 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "37.0.1" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a309eecd6b5689f57e67181deaa628d9c8951db1ba0d26f07c69e14dffdc4765" +checksum = "0afbe184cfe66895497cdfac1ab2927d85294b9c3bcc2c734798994d08b95db6" dependencies = [ "futures", "parity-scale-codec", @@ -7319,14 +7945,13 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.40.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce75efd1e164be667a53c20182c45b4c2abe325abcbd21fc292b82be5b9240f7" +checksum = "5f5fed2e52d0cbf8ddc39a5bb7211f19a26f15f70a6c8d964ee05fc73b64e6c3" dependencies = [ "async-trait", "futures", "log", - "sp-core", "sp-inherents", "sp-runtime", "sp-state-machine", @@ -7335,9 +7960,9 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.40.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8faaa05bbcb9c41f0cc535c4c1315abf6df472b53eae018678d1b4d811ac47" +checksum = "d4f3b3414e7620ad72d0000b520e0570dca38dc63e160c95164ff3f789020cc1" dependencies = [ "async-trait", "parity-scale-codec", @@ -7352,9 +7977,9 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.40.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ee95e17ee8dcd14db7d584b899a426565ca9abe5a266ab82277977fc547f86" +checksum = "b54310103ae4f0e3228e217e2a9ccaca0d7c3502d3aa276623febf4c722ca397" dependencies = [ "async-trait", "parity-scale-codec", @@ -7369,11 +7994,29 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-grandpa" +version = "23.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1e969d551ce631fbaf190a4457c295ef70c50bae657602f2377e433f9454868" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "sp-runtime", +] + [[package]] name = "sp-consensus-slots" -version = "0.40.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5211d11b84d8c8d2674fed81503ddad385782b50c7f60f5e3551d7f2dc8098f" +checksum = "bc83d9e7b1d58e1d020c20d7208b00d21fa73dcf92721114eae432b9f01e62d5" dependencies = [ "parity-scale-codec", "scale-info", @@ -7383,10 +8026,11 @@ dependencies = [ [[package]] name = "sp-core" -version = "34.0.0" +version = "36.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" +checksum = "1cdbb58c21e6b27f2aadf3ff0c8b20a8ead13b9dfe63f46717fd59334517f3b4" dependencies = [ + "ark-vrf", "array-bytes", "bitflags 1.3.2", "blake2", @@ -7408,7 +8052,7 @@ dependencies = [ "parking_lot", "paste", "primitive-types", - "rand", + "rand 0.8.5", "scale-info", "schnorrkel", "secp256k1", @@ -7437,7 +8081,7 @@ dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", - "sha2 0.10.8", + "sha2 0.10.9", "sha3", "twox-hash", ] @@ -7450,7 +8094,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -7471,14 +8115,14 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "sp-externalities" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" +checksum = "30cbf059dce180a8bf8b6c8b08b6290fa3d1c7f069a60f1df038ab5dd5fc0ba6" dependencies = [ "environmental", "parity-scale-codec", @@ -7487,9 +8131,9 @@ dependencies = [ [[package]] name = "sp-genesis-builder" -version = "0.15.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "182812315871732372325f0ad42bb8b85a093a06dd77ae1eec997259f4c32aef" +checksum = "efb0d996dfce9afb8879bdfbba9cb9a7d06f29fda38168b91e90419b3b92c42e" dependencies = [ "parity-scale-codec", "scale-info", @@ -7500,9 +8144,9 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "34.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afffbddc380d99a90c459ba1554bbbc01d62e892de9f1485af6940b89c4c0d57" +checksum = "adb09ff07946f3e1ecdd4bfb40b2cceba60188215ceb941b5b07230294d7aee1" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -7514,9 +8158,9 @@ dependencies = [ [[package]] name = "sp-io" -version = "38.0.2" +version = "40.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e20e9d9fe236466c1e38add64b591237c58540a07408407869d52d0e79fd18" +checksum = "3e41d010bcc515d119901ff7ac83150c335d543c7f6c03be5c8fe08430b8a03b" dependencies = [ "bytes", "docify", @@ -7541,9 +8185,9 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "39.0.0" +version = "41.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c0e20624277f578b27f44ecfbe2ebc2e908488511ee2c900c5281599f700ab3" +checksum = "c601d506585c0bcee79dbde401251b127af5f04c7373fc3cf7d6a6b7f6b970a3" dependencies = [ "sp-core", "sp-runtime", @@ -7552,9 +8196,9 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.40.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" +checksum = "45f893398a5330e28f219662c7a0afa174fb068d8f82d2a9990016c4b0bc4369" dependencies = [ "parity-scale-codec", "parking_lot", @@ -7574,20 +8218,38 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" +checksum = "82d1db25e362edbf5531b427d4bdfc2562bec6a031c3eb2a9145c0a0a01a572d" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", ] +[[package]] +name = "sp-mmr-primitives" +version = "36.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ebcc2d106515a20ecf22b8d41d69e710f8e860849afde777ff73cb46f1bf29" +dependencies = [ + "log", + "parity-scale-codec", + "polkadot-ckb-merkle-mountain-range", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-debug-derive", + "sp-runtime", + "thiserror", +] + [[package]] name = "sp-npos-elections" -version = "34.0.0" +version = "36.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af922f112c7c1ed199eabe14f12a82ceb75e1adf0804870eccfbcf3399492847" +checksum = "85ad469d2982afb7f1fb407920b1b712e831fb7a14317472a97e268a4029e70d" dependencies = [ "parity-scale-codec", "scale-info", @@ -7599,9 +8261,9 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "34.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d9de237d72ecffd07f90826eef18360208b16d8de939d54e61591fac0fcbf99" +checksum = "fe5ac60e48200d7b7f61681320deaf06bdced47cfd5f1cb4589b533b58fa4da4" dependencies = [ "sp-api", "sp-core", @@ -7610,21 +8272,21 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "13.0.0" +version = "13.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f5a17a0a11de029a8b811cb6e8b32ce7e02183cc04a3e965c383246798c416" +checksum = "c8b52e69a577cbfdea62bfaf16f59eb884422ce98f78b5cd8d9bf668776bced1" dependencies = [ "backtrace", - "lazy_static", "regex", ] [[package]] name = "sp-runtime" -version = "39.0.5" +version = "41.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e00503b83cf48fffe48746b91b9b832d6785d4e2eeb0941558371eac6baac6" +checksum = "3864101a28faba3d8eca026e3f56ea20dd1d979ce1bcc20152e86c9d82be52bf" dependencies = [ + "binary-merkle-tree", "docify", "either", "hash256-std-hasher", @@ -7633,7 +8295,7 @@ dependencies = [ "num-traits", "parity-scale-codec", "paste", - "rand", + "rand 0.8.5", "scale-info", "serde", "simple-mermaid", @@ -7642,15 +8304,17 @@ dependencies = [ "sp-core", "sp-io", "sp-std", + "sp-trie", "sp-weights", "tracing", + "tuplex", ] [[package]] name = "sp-runtime-interface" -version = "28.0.0" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" +checksum = "e99db36a7aff44c335f5d5b36c182a3e0cac61de2fefbe2eeac6af5fb13f63bf" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -7674,17 +8338,17 @@ checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "sp-session" -version = "35.0.0" +version = "38.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04fcd2d1270038be94d00103e8e95f7fbab9075dcc78096b91d8931ee970d73" +checksum = "2a4158c5558192b56cf5ba2ea028cbdbf0fc7c65258e5aa7653bdfad6e68ed21" dependencies = [ "parity-scale-codec", "scale-info", @@ -7697,9 +8361,9 @@ dependencies = [ [[package]] name = "sp-staking" -version = "34.0.0" +version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143a764cacbab58347d8b2fd4c8909031fb0888d7b02a0ec9fa44f81f780d732" +checksum = "6f8f9c0a32836e3c8842b0aec0813077654885d45d83b618210fbb730ea63545" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -7711,48 +8375,23 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.43.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930104d6ae882626e8880d9b1578da9300655d337a3ffb45e130c608b6c89660" +checksum = "206508475c01ae2e14f171d35d7fc3eaa7278140d7940416591d49a784792ed6" dependencies = [ "hash-db", - "log", - "parity-scale-codec", - "parking_lot", - "rand", - "smallvec", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-trie", - "thiserror", - "tracing", - "trie-db", -] - -[[package]] -name = "sp-statement-store" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c219bc34ef4d1f9835f3ed881f965643c32034fcc030eb33b759dadbc802c1c2" -dependencies = [ - "aes-gcm", - "curve25519-dalek", - "ed25519-dalek", - "hkdf", - "parity-scale-codec", - "rand", - "scale-info", - "sha2 0.10.8", - "sp-api", - "sp-application-crypto", + "log", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "smallvec", "sp-core", - "sp-crypto-hashing", "sp-externalities", - "sp-runtime", - "sp-runtime-interface", + "sp-panic-handler", + "sp-trie", "thiserror", - "x25519-dalek", + "tracing", + "trie-db", ] [[package]] @@ -7763,9 +8402,9 @@ checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-storage" -version = "21.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c82989b3a4979a7e1ad848aad9f5d0b4388f1f454cc131766526601ab9e8f8" +checksum = "ee3b70ca340e41cde9d2e069d354508a6e37a6573d66f7cc38f11549002f64ec" dependencies = [ "impl-serde", "parity-scale-codec", @@ -7776,9 +8415,9 @@ dependencies = [ [[package]] name = "sp-timestamp" -version = "34.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a1cb4df653d62ccc0dbce1db45d1c9443ec60247ee9576962d24da4c9c6f07" +checksum = "176c77326c15425a15e085261161a9435f9a3c0d4bf61dae6dccf05b957a51c6" dependencies = [ "async-trait", "parity-scale-codec", @@ -7789,9 +8428,9 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "17.0.1" +version = "17.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf641a1d17268c8fcfdb8e0fa51a79c2d4222f4cfda5f3944dbdbc384dced8d5" +checksum = "6147a5b8c98b9ed4bf99dc033fab97a468b4645515460974c8784daeb7c35433" dependencies = [ "parity-scale-codec", "tracing", @@ -7801,9 +8440,9 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "34.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4bf251059485a7dd38fe4afeda8792983511cc47f342ff4695e2dcae6b5247" +checksum = "05fe2b97ebbbdbaab7200914f5fa3e3493972fceb39d3fb9324bc5b63f60a994" dependencies = [ "sp-api", "sp-runtime", @@ -7811,18 +8450,17 @@ dependencies = [ [[package]] name = "sp-trie" -version = "37.0.0" +version = "39.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6282aef9f4b6ecd95a67a45bcdb67a71f4a4155c09a53c10add4ffe823db18cd" +checksum = "a555bf4c42ca89e2e7bf2f11308806dad13cdbd7f8fd60cf2649f12b6ee809bf" dependencies = [ "ahash", "hash-db", - "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot", - "rand", + "rand 0.8.5", "scale-info", "schnellru", "sp-core", @@ -7835,9 +8473,9 @@ dependencies = [ [[package]] name = "sp-version" -version = "37.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d521a405707b5be561367cd3d442ff67588993de24062ce3adefcf8437ee9fe1" +checksum = "bd736a15ff2ea0a67c5a3bbdfd842d88f11f0774d7701a8d8a316f8deba276c5" dependencies = [ "impl-serde", "parity-scale-codec", @@ -7853,21 +8491,22 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "14.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" +checksum = "54cabc8279e835cd9c608d70cb00e693bddec94fe8478e9f3104dad1da5f93ca" dependencies = [ "parity-scale-codec", + "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "sp-wasm-interface" -version = "21.0.0" +version = "21.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b04b919e150b4736d85089d49327eab65507deb1485eec929af69daa2278eb3" +checksum = "b066baa6d57951600b14ffe1243f54c47f9c23dd89c262e17ca00ae8dca58be9" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -7878,9 +8517,9 @@ dependencies = [ [[package]] name = "sp-weights" -version = "31.0.0" +version = "31.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" +checksum = "515aa194eabac059041df2dbee75b059b99981213ec680e9de85b45b6988346a" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -7909,9 +8548,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.47.0" +version = "1.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4743ce898933fbff7bbf414f497c459a782d496269644b3d650a398ae6a487ba" +checksum = "19409f13998e55816d1c728395af0b52ec066206341d939e22e7766df9b494b8" dependencies = [ "Inflector", "num-format", @@ -7930,9 +8569,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-parachain-info" -version = "0.16.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e65e4397580154b0f6760350f51a97afa2ecabcbb3cc133a5116940c1b36a6a" +checksum = "f67defdbfcd90bf9b8d4794d2287a27908e518d0540fe8a15bed7761eb07a7e3" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -7944,50 +8583,56 @@ dependencies = [ [[package]] name = "staging-xcm" -version = "14.1.0" +version = "16.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b7b5f531c6bf9629514ef8e5fda0e9e80dd84516957f710940d0e01d3fb36c" +checksum = "d0126278d7fc6d7dec55e5a109f838bbf401dd084aecf2597e4e11ea07515a0a" dependencies = [ "array-bytes", "bounded-collections", - "derivative", + "derive-where", "environmental", + "frame-support", + "hex-literal", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", "serde", + "sp-runtime", "sp-weights", "xcm-procedural", ] [[package]] name = "staging-xcm-builder" -version = "16.0.0" +version = "20.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bda935caf05b0d1bd929e0211bbc2d1815fa45977e72880f00b49f42688142" +checksum = "6f031952c1496cf7f86d19ab38e3264be9a54b7d8eecb25ba69f977cc7549d08" dependencies = [ + "environmental", "frame-support", "frame-system", "impl-trait-for-tuples", - "log", + "pallet-asset-conversion", "pallet-transaction-payment", "parity-scale-codec", "polkadot-parachain-primitives", "scale-info", "sp-arithmetic", + "sp-core", "sp-io", "sp-runtime", "sp-weights", "staging-xcm", "staging-xcm-executor", + "tracing", ] [[package]] name = "staging-xcm-executor" -version = "16.0.0" +version = "19.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f6e90f1605540994f0186eaa713f1d636d3afc34cf0887b01b880921c845fc" +checksum = "af9bc315e8c7018fcfe0371ce4b7e726fb699e37b2acc3e5effb87a7d131a3ff" dependencies = [ "environmental", "frame-benchmarking", @@ -8010,6 +8655,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "strum" version = "0.24.1" @@ -8057,7 +8708,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -8070,7 +8721,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -8082,7 +8733,7 @@ dependencies = [ "hmac 0.12.1", "pbkdf2", "schnorrkel", - "sha2 0.10.8", + "sha2 0.10.9", "zeroize", ] @@ -8095,17 +8746,19 @@ dependencies = [ "byteorder", "crunchy", "lazy_static", - "rand", + "rand 0.8.5", "rustc-hex", ] [[package]] name = "substrate-prometheus-endpoint" -version = "0.17.0" +version = "0.17.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8fe06b03b8a291c09507c42f92a2c2c10dd3d62975d02c7f64a92d87bfe09b" +checksum = "73389cae0245dee48633a2346fa7b82b5c77e586ff44493ea54f4e0ffa0ef827" dependencies = [ + "http-body-util", "hyper", + "hyper-util", "log", "prometheus", "thiserror", @@ -8114,9 +8767,9 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "24.0.0" +version = "26.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0104598a022d22430f27e535b7aed148af9dcd0a3eb23697c02168071a325e33" +checksum = "1adc17ecd661e16b25708f36f6e6961f809a3ab16c89132a4acd7936c0f31e46" dependencies = [ "array-bytes", "build-helper", @@ -8124,11 +8777,13 @@ dependencies = [ "console", "filetime", "frame-metadata", + "jobserver", "merkleized-metadata", "parity-scale-codec", "parity-wasm 0.45.0", "polkavm-linker", "sc-executor", + "shlex", "sp-core", "sp-io", "sp-maybe-compressed-blob", @@ -8136,7 +8791,7 @@ dependencies = [ "sp-version", "strum 0.26.3", "tempfile", - "toml 0.8.19", + "toml 0.8.23", "walkdir", "wasm-opt", ] @@ -8160,15 +8815,26 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "tap" version = "1.0.1" @@ -8183,14 +8849,14 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if", "fastrand", + "getrandom 0.3.3", "once_cell", - "rustix 0.38.34", + "rustix 1.0.8", "windows-sys 0.59.0", ] @@ -8205,32 +8871,31 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -8283,11 +8948,21 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -8300,17 +8975,33 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "43864ed400b6043a4757a25c7a64a8efde741aed79a056a2fb348a406701bb35" dependencies = [ "backtrace", + "bytes", + "io-uring", "libc", "mio", "parking_lot", "pin-project-lite", + "slab", "socket2", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "tokio-util" +version = "0.7.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", ] [[package]] @@ -8336,21 +9027,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.20", + "toml_edit 0.22.27", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] @@ -8361,7 +9052,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.10.0", "serde", "serde_spanned", "toml_datetime", @@ -8370,39 +9061,29 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.4.0", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.20" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.10.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "toml_write", + "winnow 0.7.12", ] [[package]] -name = "tower-service" -version = "0.3.3" +name = "toml_write" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -8412,20 +9093,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -8444,9 +9125,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -8463,9 +9144,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.29.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" +checksum = "6c0670ab45a6b7002c7df369fee950a27cf29ae0474343fd3a15aa15f691e7a6" dependencies = [ "hash-db", "log", @@ -8482,18 +9163,18 @@ dependencies = [ "hash-db", ] -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - [[package]] name = "tt-call" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" +[[package]] +name = "tuplex" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "676ac81d5454c4dcf37955d34fa8626ede3490f744b86ca14a7b90168d2a08aa" + [[package]] name = "twox-hash" version = "1.6.3" @@ -8502,21 +9183,21 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand", + "rand 0.8.5", "static_assertions", ] [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "uint" -version = "0.9.5" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" dependencies = [ "byteorder", "crunchy", @@ -8525,16 +9206,16 @@ dependencies = [ ] [[package]] -name = "unicode-bidi" -version = "0.3.15" +name = "unarray" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-normalization" @@ -8547,42 +9228,38 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "unicode-xid" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" - -[[package]] -name = "universal-hash" -version = "0.5.1" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" -dependencies = [ - "crypto-common", - "subtle", -] +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vcpkg" @@ -8598,28 +9275,72 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "w3f-bls" -version = "0.1.4" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c5da5fa2c6afa2c9158eaa7cd9aee249765eb32b5fb0c63ad8b9e79336a47ec" +checksum = "e6bfb937b3d12077654a9e43e32a4e9c20177dd9fea0f3aba673e7840bb54f32" dependencies = [ "ark-bls12-377", - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-serialize-derive", + "ark-bls12-381 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-serialize-derive 0.4.2", "arrayref", - "constcat", "digest 0.10.7", - "rand", - "rand_chacha", - "rand_core", - "sha2 0.10.8", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sha2 0.10.9", "sha3", - "thiserror", "zeroize", ] +[[package]] +name = "w3f-pcs" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbe7a8d5c914b69392ab3b267f679a2e546fe29afaddce47981772ac71bd02e1" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "merlin", +] + +[[package]] +name = "w3f-plonk-common" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca389e494fe08c5c108b512e2328309036ee1c0bc7bdfdb743fef54d448c8c" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "getrandom_or_panic", + "rand_core 0.6.4", + "w3f-pcs", +] + +[[package]] +name = "w3f-ring-proof" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a639379402ad51504575dbd258740383291ac8147d3b15859bdf1ea48c677de" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "ark-transcript", + "w3f-pcs", + "w3f-plonk-common", +] + [[package]] name = "walkdir" version = "2.5.0" @@ -8631,24 +9352,24 @@ dependencies = [ ] [[package]] -name = "want" -version = "0.3.1" +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] [[package]] name = "wasm-bencher" version = "0.5.0" -source = "git+https://github.com/open-web3-stack/wasm-bencher?branch=polkadot-stable2407#c4fa8e85ea7bf3ed53e794e0a0733d6dd329bbcd" +source = "git+https://github.com/open-web3-stack/wasm-bencher?branch=polkadot-stable2503#792af34c4edc6692d408a96f1d36e82b82f8ec12" dependencies = [ "ansi_term", "build-helper", @@ -8660,7 +9381,7 @@ dependencies = [ "parity-wasm 0.45.0", "parking_lot", "paste", - "rand", + "rand 0.8.5", "sc-client-db", "sc-executor", "sc-executor-common", @@ -8687,11 +9408,11 @@ dependencies = [ [[package]] name = "wasm-bencher-procedural" version = "0.5.0" -source = "git+https://github.com/open-web3-stack/wasm-bencher?branch=polkadot-stable2407#c4fa8e85ea7bf3ed53e794e0a0733d6dd329bbcd" +source = "git+https://github.com/open-web3-stack/wasm-bencher?branch=polkadot-stable2503#792af34c4edc6692d408a96f1d36e82b82f8ec12" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] @@ -8815,7 +9536,7 @@ dependencies = [ "log", "rustix 0.36.17", "serde", - "sha2 0.10.8", + "sha2 0.10.9", "toml 0.5.11", "windows-sys 0.45.0", "zstd 0.11.2+zstd.1.5.2", @@ -8939,7 +9660,7 @@ dependencies = [ "memfd", "memoffset", "paste", - "rand", + "rand 0.8.5", "rustix 0.36.17", "wasmtime-asm-macros", "wasmtime-environ", @@ -8961,9 +9682,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.28" +version = "0.7.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690" +checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" dependencies = [ "bytemuck", "safe_arch", @@ -9000,6 +9721,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + [[package]] name = "windows-sys" version = "0.45.0" @@ -9020,20 +9747,20 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.53.3", ] [[package]] @@ -9075,13 +9802,30 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -9100,6 +9844,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -9118,6 +9868,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -9136,12 +9892,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -9160,6 +9928,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -9178,6 +9952,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -9196,6 +9976,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -9214,6 +10000,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" version = "0.5.40" @@ -9225,51 +10017,54 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.18" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" dependencies = [ "memchr", ] [[package]] -name = "wyz" -version = "0.5.1" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "tap", + "bitflags 2.9.1", ] [[package]] -name = "x25519-dalek" -version = "2.0.1" +name = "writeable" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ - "curve25519-dalek", - "rand_core", - "serde", - "zeroize", + "tap", ] [[package]] name = "xcm-procedural" -version = "10.1.0" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" +checksum = "9d3d21c65cbf847ae0b1a8e6411b614d269d3108c6c649b039bffcf225e89aa4" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", ] [[package]] name = "xcm-runtime-apis" -version = "0.3.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf11b1fb43e9beb4a3c1c613c3a791ff16ab270566c1ce80f346b09afdced1" +checksum = "b87c89a2721a4423325f21453ff71bb7a874cfdbe31a25d70d571804b68c0e06" dependencies = [ "frame-support", "parity-scale-codec", @@ -9282,9 +10077,9 @@ dependencies = [ [[package]] name = "xcm-simulator" -version = "16.0.0" +version = "20.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf3cdbb92c84bf606bca54a38aec6ec4e43164698e1d7431b286c58bfa0c1ee6" +checksum = "48e303a7ce56f8aa9c259b0e2ccb35938245b2e5e811ac6024faa2f51c76b3c7" dependencies = [ "frame-support", "frame-system", @@ -9297,31 +10092,74 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", ] +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", + "synstructure", +] + [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", + "synstructure", ] [[package]] @@ -9341,7 +10179,40 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.104", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -9384,9 +10255,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.15+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index e74d343c7..ac5000bc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -120,14 +120,14 @@ rand_chacha = { version = "0.3.1", default-features = false } env_logger = { version = "0.10.0" } smallvec = { version = "1.4.1" } ripemd = { version = "0.1.3", default-features = false } -rlp = { version = "0.5.2", default-features = false } +rlp = { version = "0.6.1", default-features = false } sha3 = { version = "0.10.8", default-features = false } tiny-keccak = { version = "2.0" } num = { version = "0.4", default-features = false } bn = { package = "substrate-bn", version = "0.6", default-features = false } libsecp256k1 = { version = "0.7", default-features = false } impl-trait-for-tuples = { version = "0.2.2" } -ethereum-types = { version = "0.14.0", default-features = false } +ethereum-types = { version = "0.15.1", default-features = false } num_enum = { version = "0.5.1", default-features = false } quote = { version = "1.0.20" } syn = { version = "1.0.98" } @@ -137,7 +137,7 @@ bstringify = { version = "0.1.2" } enumflags2 = { version = "0.7.7" } paste = { version = "1.0" } static_assertions = { version = "1.1.0" } -ethabi = { version = "18.0.0", default-features = false } +ethabi = { git = "https://github.com/AcalaNetwork/ethabi", branch = "acala", default-features = false } insta = { version = "1.31.0", features = ["json"] } # Dependencies are split into 2 groups: wasm and client. @@ -147,7 +147,7 @@ insta = { version = "1.31.0", features = ["json"] } # - "client" dependencies are only used in the client, and thus don't need to be no_std compatible. # ORML & Acala (wasm) -wasm-bencher = { git = "https://github.com/open-web3-stack/wasm-bencher", branch = "polkadot-stable2407", default-features = false } +wasm-bencher = { git = "https://github.com/open-web3-stack/wasm-bencher", branch = "polkadot-stable2503", default-features = false } orml-auction = { path = "orml/auction", default-features = false } orml-authority = { path = "orml/authority", default-features = false } orml-benchmarking = { path = "orml/benchmarking", default-features = false } @@ -214,92 +214,92 @@ module-evm-utility-macro = { path = "modules/evm-utility/macro" } orml-build-script-utils = { path = "orml/build-script-utils" } # polkadot-sdk (wasm) -cumulus-pallet-aura-ext = { version = "0.16.0", default-features = false } -cumulus-pallet-parachain-system = { version = "0.16.0", default-features = false } -cumulus-pallet-xcm = { version = "0.16.0", default-features = false } -cumulus-pallet-xcmp-queue = { version = "0.16.0", default-features = false } -cumulus-primitives-core = { version = "0.15.0", default-features = false } -cumulus-primitives-parachain-inherent = { version = "0.15.0", default-features = false } -cumulus-primitives-timestamp = { version = "0.15.1", default-features = false } -cumulus-primitives-utility = { version = "0.16.0", default-features = false } -cumulus-test-relay-sproof-builder = { version = "0.15.0", default-features = false } -frame-benchmarking = { version = "37.0.0", default-features = false } -frame-executive = { version = "37.0.0", default-features = false } -frame-metadata-hash-extension = { version = "0.5.0", default-features = false } -frame-support = { version = "37.0.0", default-features = false } -frame-system = { version = "37.1.0", default-features = false } -frame-system-rpc-runtime-api = { version = "34.0.0", default-features = false } -frame-try-runtime = { version = "0.43.0", default-features = false } -pallet-aura = { version = "36.0.0", default-features = false } -pallet-authority-discovery = { version = "37.0.0", default-features = false } -pallet-authorship = { version = "37.0.0", default-features = false } -pallet-balances = { version = "38.0.0", default-features = false } -pallet-bounties = { version = "36.0.0", default-features = false } -pallet-collective = { version = "37.0.0", default-features = false } -pallet-democracy = { version = "37.0.0", default-features = false } -pallet-elections-phragmen = { version = "38.0.0", default-features = false } -pallet-indices = { version = "37.0.0", default-features = false } -pallet-membership = { version = "37.0.0", default-features = false } -pallet-message-queue = { version = "40.0.0", default-features = false } -pallet-multisig = { version = "37.0.0", default-features = false } -pallet-preimage = { version = "37.0.0", default-features = false } -pallet-proxy = { version = "37.0.0", default-features = false } -pallet-recovery = { version = "37.0.0", default-features = false } -pallet-root-testing = { version = "13.0.0", default-features = false } -pallet-scheduler = { version = "38.0.0", default-features = false } -pallet-session = { version = "37.0.0", default-features = false } -pallet-state-trie-migration = { version = "39.0.0", default-features = false } -pallet-sudo = { version = "37.0.0", default-features = false } -pallet-timestamp = { version = "36.0.0", default-features = false } -pallet-tips = { version = "36.0.0", default-features = false } -pallet-transaction-payment = { version = "37.0.0", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { version = "37.0.0", default-features = false } -pallet-treasury = { version = "36.0.0", default-features = false } -pallet-utility = { version = "37.0.0", default-features = false } -pallet-xcm = { version = "16.0.0", default-features = false } -pallet-xcm-benchmarks = { version = "16.0.0", default-features = false } -parachain-info = { version = "0.16.0", package = "staging-parachain-info", default-features = false } -parachains-common = { version = "17.0.0", default-features = false } -polkadot-core-primitives = { version = "15.0.0", default-features = false } -polkadot-parachain-primitives = { version = "14.0.0", default-features = false } -polkadot-primitives = { version = "15.0.0", default-features = false } -polkadot-runtime-common = { version = "16.0.0", default-features = false } -polkadot-runtime-parachains = { version = "16.0.1", default-features = false } -sp-api = { version = "34.0.0", default-features = false } -sp-application-crypto = { version = "38.0.0", default-features = false } -sp-arithmetic = { version = "26.0.0", default-features = false } -sp-block-builder = { version = "34.0.0", default-features = false } -sp-blockchain = { version = "37.0.1", default-features = false } -sp-consensus = { version = "0.40.0", default-features = false } -sp-consensus-aura = { version = "0.40.0", default-features = false } -sp-consensus-slots = { version = "0.40.0", default-features = false } -sp-core = { version = "34.0.0", default-features = false } +cumulus-pallet-aura-ext = { version = "0.20.0", default-features = false } +cumulus-pallet-parachain-system = { version = "0.20.0", default-features = false } +cumulus-pallet-xcm = { version = "0.19.1", default-features = false } +cumulus-pallet-xcmp-queue = { version = "0.20.0", default-features = false } +cumulus-primitives-core = { version = "0.18.1", default-features = false } +cumulus-primitives-parachain-inherent = { version = "0.18.1", default-features = false } +cumulus-primitives-timestamp = { version = "0.19.0", default-features = false } +cumulus-primitives-utility = { version = "0.20.0", default-features = false } +cumulus-test-relay-sproof-builder = { version = "0.19.0", default-features = false } +frame-benchmarking = { version = "40.0.0", default-features = false } +frame-executive = { version = "40.0.0", default-features = false } +frame-metadata-hash-extension = { version = "0.8.0", default-features = false } +frame-support = { version = "40.1.0", default-features = false } +frame-system = { version = "40.1.0", default-features = false } +frame-system-rpc-runtime-api = { version = "36.0.0", default-features = false } +frame-try-runtime = { version = "0.46.0", default-features = false } +pallet-aura = { version = "39.0.0", default-features = false } +pallet-authority-discovery = { version = "40.0.0", default-features = false } +pallet-authorship = { version = "40.0.0", default-features = false } +pallet-balances = { version = "41.1.0", default-features = false } +pallet-bounties = { version = "39.0.0", default-features = false } +pallet-collective = { version = "40.1.0", default-features = false } +pallet-democracy = { version = "40.1.0", default-features = false } +pallet-elections-phragmen = { version = "41.1.0", default-features = false } +pallet-indices = { version = "40.0.0", default-features = false } +pallet-membership = { version = "40.0.0", default-features = false } +pallet-message-queue = { version = "43.1.0", default-features = false } +pallet-multisig = { version = "40.1.0", default-features = false } +pallet-preimage = { version = "40.0.0", default-features = false } +pallet-proxy = { version = "40.1.0", default-features = false } +pallet-recovery = { version = "40.0.0", default-features = false } +pallet-root-testing = { version = "16.0.0", default-features = false } +pallet-scheduler = { version = "41.0.0", default-features = false } +pallet-session = { version = "40.0.0", default-features = false } +pallet-state-trie-migration = { version = "44.1.0", default-features = false } +pallet-sudo = { version = "40.0.0", default-features = false } +pallet-timestamp = { version = "39.0.0", default-features = false } +pallet-tips = { version = "39.0.0", default-features = false } +pallet-transaction-payment = { version = "40.0.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { version = "40.0.0", default-features = false } +pallet-treasury = { version = "39.0.0", default-features = false } +pallet-utility = { version = "40.0.0", default-features = false } +pallet-xcm = { version = "19.1.0", default-features = false } +pallet-xcm-benchmarks = { version = "20.0.0", default-features = false } +parachain-info = { version = "0.20.0", package = "staging-parachain-info", default-features = false } +parachains-common = { version = "21.0.0", default-features = false } +polkadot-core-primitives = { version = "17.1.0", default-features = false } +polkadot-parachain-primitives = { version = "16.1.0", default-features = false } +polkadot-primitives = { version = "18.1.0", default-features = false } +polkadot-runtime-common = { version = "19.1.0", default-features = false } +polkadot-runtime-parachains = { version = "19.1.0", default-features = false } +sp-api = { version = "36.0.1", default-features = false } +sp-application-crypto = { version = "40.1.0", default-features = false } +sp-arithmetic = { version = "26.1.0", default-features = false } +sp-block-builder = { version = "36.0.0", default-features = false } +sp-blockchain = { version = "39.0.0", default-features = false } +sp-consensus = { version = "0.42.0", default-features = false } +sp-consensus-aura = { version = "0.42.0", default-features = false } +sp-consensus-slots = { version = "0.42.1", default-features = false } +sp-core = { version = "36.1.0", default-features = false } sp-debug-derive = { version = "14.0.0", default-features = false } -sp-externalities = { version = "0.29.0", default-features = false } -sp-genesis-builder = { version = "0.15.0", default-features = false } -sp-inherents = { version = "34.0.0", default-features = false } -sp-io = { version = "38.0.0", default-features = false } -sp-keyring = { version = "39.0.0", default-features = false } -sp-keystore = { version = "0.40.0", default-features = false } -sp-offchain = { version = "34.0.0", default-features = false } -sp-runtime = { version = "39.0.0", default-features = false } -sp-runtime-interface = { version = "28.0.0", default-features = false } -sp-session = { version = "35.0.0", default-features = false } -sp-staking = { version = "34.0.0", default-features = false } -sp-state-machine = { version = "0.43.0", default-features = false } +sp-externalities = { version = "0.30.0", default-features = false } +sp-genesis-builder = { version = "0.17.0", default-features = false } +sp-inherents = { version = "36.0.0", default-features = false } +sp-io = { version = "40.0.0", default-features = false } +sp-keyring = { version = "41.0.0", default-features = false } +sp-keystore = { version = "0.42.0", default-features = false } +sp-offchain = { version = "36.0.0", default-features = false } +sp-runtime = { version = "41.1.0", default-features = false } +sp-runtime-interface = { version = "29.0.1", default-features = false } +sp-session = { version = "38.1.0", default-features = false } +sp-staking = { version = "38.0.0", default-features = false } +sp-state-machine = { version = "0.45.0", default-features = false } sp-std = { version = "14.0.0", default-features = false } -sp-storage = { version = "21.0.0", default-features = false } -sp-timestamp = { version = "34.0.0", default-features = false } -sp-tracing = { version = "17.0.0", default-features = false } -sp-transaction-pool = { version = "34.0.0", default-features = false } -sp-trie = { version = "37.0.0", default-features = false } -sp-version = { version = "37.0.0", default-features = false } -sp-wasm-interface = { version = "21.0.0", default-features = false } -sp-weights = { version = "31.0.0", default-features = false } -xcm = { version = "14.1.0", package = "staging-xcm", default-features = false } -xcm-builder = { version = "16.0.0", package = "staging-xcm-builder", default-features = false } -xcm-executor = { version = "16.0.0", package = "staging-xcm-executor", default-features = false } +sp-storage = { version = "22.0.0", default-features = false } +sp-timestamp = { version = "36.0.0", default-features = false } +sp-tracing = { version = "17.1.0", default-features = false } +sp-transaction-pool = { version = "36.0.0", default-features = false } +sp-trie = { version = "39.1.0", default-features = false } +sp-version = { version = "39.0.0", default-features = false } +sp-wasm-interface = { version = "21.0.1", default-features = false } +sp-weights = { version = "31.1.0", default-features = false } +xcm = { version = "16.1.0", package = "staging-xcm", default-features = false } +xcm-builder = { version = "20.0.0", package = "staging-xcm-builder", default-features = false } +xcm-executor = { version = "19.1.0", package = "staging-xcm-executor", default-features = false } # polkadot-sdk (client) -substrate-wasm-builder = { version = "24.0.0", features = ["metadata-hash"] } -xcm-simulator = { version = "16.0.0" } +substrate-wasm-builder = { version = "26.0.0", features = ["metadata-hash"] } +xcm-simulator = { version = "20.0.0" } diff --git a/Makefile b/Makefile index 13659c660..4e5ddfffa 100644 --- a/Makefile +++ b/Makefile @@ -51,9 +51,9 @@ check-runtimes: .PHONY: check-benchmarks check-benchmarks: SKIP_WASM_BUILD= cargo check --features wasm-bench --package module-evm - SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32-unknown-unknown -p mandala-runtime - SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32-unknown-unknown -p karura-runtime - SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32-unknown-unknown -p acala-runtime + SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32v1-none -p mandala-runtime + SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32v1-none -p karura-runtime + SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32v1-none -p acala-runtime .PHONY: check-integration-tests check-integration-tests: diff --git a/ecosystem-modules/stable-asset b/ecosystem-modules/stable-asset index 8f1024929..f7f35815e 160000 --- a/ecosystem-modules/stable-asset +++ b/ecosystem-modules/stable-asset @@ -1 +1 @@ -Subproject commit 8f102492943bdfbe6a7be793352b9529d6a0a38c +Subproject commit f7f35815e480b089abed72b39b7083850b435b67 diff --git a/evm-tests b/evm-tests index 3e6477fb5..9668b1157 160000 --- a/evm-tests +++ b/evm-tests @@ -1 +1 @@ -Subproject commit 3e6477fb58d1ee3c0fdc9afe6067de51d3d09e6f +Subproject commit 9668b1157039bc4c8ea751e0e08ecf8661c35793 diff --git a/modules/asset-registry/src/lib.rs b/modules/asset-registry/src/lib.rs index 34ac1a700..343f56577 100644 --- a/modules/asset-registry/src/lib.rs +++ b/modules/asset-registry/src/lib.rs @@ -47,7 +47,7 @@ use scale_info::prelude::format; use sp_runtime::{traits::One, ArithmeticError, FixedPointNumber, FixedU128}; use sp_std::{boxed::Box, vec::Vec}; -use xcm::{v3, v4::prelude::*, VersionedLocation}; +use xcm::{v3, v4, v5::prelude::*, VersionedLocation}; mod mock; mod tests; @@ -369,7 +369,8 @@ impl Pallet { metadata: &AssetMetadata>, ) -> Result { let foreign_asset_id = Self::get_next_foreign_asset_id()?; - let v3_location = v3::Location::try_from(location.clone()).map_err(|()| Error::::BadLocation)?; + let v4_location = v4::Location::try_from(location.clone()).map_err(|()| Error::::BadLocation)?; + let v3_location = v3::Location::try_from(v4_location).map_err(|()| Error::::BadLocation)?; LocationToCurrencyIds::::try_mutate(v3_location, |maybe_currency_ids| -> DispatchResult { ensure!(maybe_currency_ids.is_none(), Error::::LocationExisted); *maybe_currency_ids = Some(CurrencyId::ForeignAsset(foreign_asset_id)); @@ -398,7 +399,8 @@ impl Pallet { location: &Location, metadata: &AssetMetadata>, ) -> DispatchResult { - let v3_location = v3::Location::try_from(location.clone()).map_err(|()| Error::::BadLocation)?; + let v4_location = v4::Location::try_from(location.clone()).map_err(|()| Error::::BadLocation)?; + let v3_location = v3::Location::try_from(v4_location).map_err(|()| Error::::BadLocation)?; ForeignAssetLocations::::try_mutate(foreign_asset_id, |maybe_locations| -> DispatchResult { let old_locations = maybe_locations.as_mut().ok_or(Error::::AssetIdNotExists)?; @@ -534,11 +536,15 @@ impl AssetIdMapping Option { - Pallet::::foreign_asset_locations(foreign_asset_id).map(|l| l.try_into().ok())? + Pallet::::foreign_asset_locations(foreign_asset_id).map(|l| { + let v4_location = v4::Location::try_from(l).ok()?; + Location::try_from(v4_location).ok() + })? } fn get_currency_id(location: Location) -> Option { - let v3_location = v3::Location::try_from(location).ok()?; + let v4_location = v4::Location::try_from(location).ok()?; + let v3_location = v3::Location::try_from(v4_location).ok()?; Pallet::::location_to_currency_ids(v3_location) } } @@ -560,7 +566,8 @@ where BalanceOf: Into, { fn calculate_rate(location: Location) -> Option { - let v3_location = v3::Location::try_from(location).ok()?; + let v4_location = v4::Location::try_from(location).ok()?; + let v3_location = v3::Location::try_from(v4_location).ok()?; if let Some(CurrencyId::ForeignAsset(foreign_asset_id)) = Pallet::::location_to_currency_ids(v3_location) { if let Some(asset_metadata) = Pallet::::asset_metadatas(AssetIds::ForeignAssetId(foreign_asset_id)) { let minimum_balance = asset_metadata.minimal_balance.into(); diff --git a/modules/asset-registry/src/mock.rs b/modules/asset-registry/src/mock.rs index b9cab28bb..d56a72af8 100644 --- a/modules/asset-registry/src/mock.rs +++ b/modules/asset-registry/src/mock.rs @@ -59,6 +59,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } impl pallet_timestamp::Config for Runtime { @@ -182,7 +183,7 @@ pub fn deploy_contracts() { ], data: { let mut buf = [0u8; 32]; - U256::from(ALICE_BALANCE).to_big_endian(&mut buf); + U256::from(ALICE_BALANCE).write_as_big_endian(&mut buf); H256::from_slice(&buf).as_bytes().to_vec() }, }], @@ -218,7 +219,7 @@ pub fn deploy_contracts_same_prefix() { ], data: { let mut buf = [0u8; 32]; - U256::from(ALICE_BALANCE).to_big_endian(&mut buf); + U256::from(ALICE_BALANCE).write_as_big_endian(&mut buf); H256::from_slice(&buf).as_bytes().to_vec() }, }], @@ -256,6 +257,7 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: self.balances.into_iter().collect::>(), + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/asset-registry/src/tests.rs b/modules/asset-registry/src/tests.rs index 5483c7010..4cd725f96 100644 --- a/modules/asset-registry/src/tests.rs +++ b/modules/asset-registry/src/tests.rs @@ -33,55 +33,63 @@ use std::str::{from_utf8, FromStr}; #[test] fn key_to_currency_work() { let erc20 = CurrencyId::Erc20(EvmAddress::from_str("0x5dddfce53ee040d9eb21afbc0ae1bb4dbb0ba644").unwrap()); - let v2_location = xcm::v2::MultiLocation::new( + let mut data = [0u8; 32]; + data[..erc20.encode().len()].copy_from_slice(&erc20.encode()[..]); + let v3_location = xcm::v3::MultiLocation::new( 0, - xcm::v2::Junctions::X1(xcm::v2::Junction::GeneralKey(erc20.encode().try_into().unwrap())), + xcm::v3::Junctions::X1(xcm::v3::Junction::GeneralKey { + length: erc20.encode().len() as u8, + data: data, + }), ); - let v3_location_from_v2 = v3::Location::try_from(v2_location.clone()).unwrap(); - let v3_location = v3::Location::new( + let v4_location_from_v3 = v4::Location::try_from(v3_location.clone()).unwrap(); + let v4_location = v4::Location::new( 0, - v3::Junctions::X1(v3::Junction::from(BoundedVec::try_from(erc20.encode()).unwrap())), + v4::Junctions::X1([v4::Junction::from(BoundedVec::try_from(erc20.encode()).unwrap())].into()), ); - assert_eq!(v3_location_from_v2, v3_location); - - let v4_location_from_v3 = Location::try_from(v3_location.clone()).unwrap(); - let v4_location = Location::new(0, Junction::from(BoundedVec::try_from(erc20.encode()).unwrap())); assert_eq!(v4_location_from_v3, v4_location); - assert_eq!(crate::key_to_currency(v4_location), Some(erc20)); + + let v5_location_from_v4 = Location::try_from(v4_location.clone()).unwrap(); + let v5_location = Location::new(0, Junction::from(BoundedVec::try_from(erc20.encode()).unwrap())); + assert_eq!(v5_location_from_v4, v5_location); + assert_eq!(crate::key_to_currency(v5_location), Some(erc20)); } #[test] -fn test_v2_to_v3_incompatible_location() { - let v2_location = xcm::v2::MultiLocation::new( +fn test_v3_to_v4_incompatible_location() { + let v3_location = xcm::v3::MultiLocation::new( 0, - xcm::v2::Junctions::X1(xcm::v2::Junction::GeneralKey(vec![0].try_into().unwrap())), + xcm::v3::Junctions::X1(xcm::v3::Junction::GeneralKey { + length: 32, + data: [0u8; 32], + }), ); - let v3_location = v3::Location::new(0, v3::Junction::from(BoundedVec::try_from(vec![0]).unwrap())); + let v4_location = v4::Location::new(0, v4::Junction::from(BoundedVec::try_from(vec![]).unwrap())); - // Assert that V2 and V3 Location both are encoded differently - assert!(v2_location.encode() != v3_location.encode()); + // Assert that V3 and V4 Location both are encoded differently + assert!(v3_location.encode() != v4_location.encode()); } #[test] -fn test_v3_to_v4_compatible_location() { - let v3_location = v3::Location::new(0, v3::Junction::from(BoundedVec::try_from(vec![0]).unwrap())); +fn test_v4_to_v5_compatible_location() { + let v4_location = v4::Location::new(0, v4::Junction::from(BoundedVec::try_from(vec![0]).unwrap())); - let v4_location = Location::new(0, Junction::from(BoundedVec::try_from(vec![0]).unwrap())); + let v5_location = Location::new(0, Junction::from(BoundedVec::try_from(vec![0]).unwrap())); - // Assert that V3 and V4 Location both are encoded differently - assert!(v3_location.encode() == v4_location.encode()); + // Assert that V4 and V5 Location both are encoded the same way + assert!(v4_location.encode() == v5_location.encode()); } #[test] fn versioned_location_convert_work() { ExtBuilder::default().build().execute_with(|| { - // v2 - let v2_location = VersionedLocation::V2(xcm::v2::MultiLocation { + // v3 + let v3_location = VersionedLocation::V3(xcm::v3::MultiLocation { parents: 0, - interior: xcm::v2::Junctions::X1(xcm::v2::Junction::Parachain(1000)), + interior: xcm::v3::Junctions::X1(xcm::v3::Junction::Parachain(1000)), }); - let v4_location: Location = v2_location.try_into().unwrap(); + let v4_location: Location = v3_location.try_into().unwrap(); assert_eq!( v4_location, Location { @@ -90,14 +98,14 @@ fn versioned_location_convert_work() { } ); - // v3 - let v3_location = VersionedLocation::V3(v3::Location { + // v4 + let v4_location = VersionedLocation::V4(v4::Location { parents: 0, - interior: xcm::v3::Junctions::X1(xcm::v3::Junction::Parachain(1000)), + interior: xcm::v4::Junctions::X1([xcm::v4::Junction::Parachain(1000)].into()), }); - let v4_location: Location = v3_location.clone().try_into().unwrap(); + let v5_location: Location = v4_location.clone().try_into().unwrap(); assert_eq!( - v4_location, + v5_location, Location { parents: 0, interior: Junction::Parachain(1000).into() @@ -105,8 +113,8 @@ fn versioned_location_convert_work() { ); // handle all of VersionedLocation - assert!(match v4_location.into() { - VersionedLocation::V2 { .. } | VersionedLocation::V3 { .. } | VersionedLocation::V4 { .. } => true, + assert!(match v5_location.into() { + VersionedLocation::V3 { .. } | VersionedLocation::V4 { .. } | VersionedLocation::V5 { .. } => true, }); }); } @@ -114,15 +122,15 @@ fn versioned_location_convert_work() { #[test] fn register_foreign_asset_work() { ExtBuilder::default().build().execute_with(|| { - // v2 - let v2_versioned_location = VersionedLocation::V3(v3::MultiLocation { + // v3 + let v3_versioned_location = VersionedLocation::V3(v3::MultiLocation { parents: 0, interior: v3::Junctions::X1(v3::Junction::Parachain(1000)), }); assert_ok!(AssetRegistry::register_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), - Box::new(v2_versioned_location.clone()), + Box::new(v3_versioned_location.clone()), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -131,11 +139,12 @@ fn register_foreign_asset_work() { }) )); - let v3_location: v3::Location = v2_versioned_location.try_into().unwrap(); - let v4_location: Location = v3_location.try_into().unwrap(); + let v3_location: v3::Location = v3_versioned_location.clone().try_into().unwrap(); + let v4_location: v4::Location = v3_versioned_location.try_into().unwrap(); + let v5_location: Location = v4_location.try_into().unwrap(); System::assert_last_event(RuntimeEvent::AssetRegistry(crate::Event::ForeignAssetRegistered { asset_id: 0, - asset_address: v4_location.clone(), + asset_address: v5_location.clone(), metadata: AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -159,18 +168,22 @@ fn register_foreign_asset_work() { Some(CurrencyId::ForeignAsset(0)) ); - // v3 - let v3_versioned_location = VersionedLocation::V3(v3::Location { + // v4 + let v4_versioned_location = VersionedLocation::V4(v4::Location { parents: 0, - interior: v3::Junctions::X1(v3::Junction::GeneralKey { - length: 32, - data: [0u8; 32], - }), + interior: v4::Junctions::X1( + [v4::Junction::GeneralKey { + length: 32, + data: [0u8; 32], + }] + .into(), + ), }); + let v3_location: v3::Location = v4_versioned_location.clone().try_into().unwrap(); assert_ok!(AssetRegistry::register_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), - Box::new(v3_versioned_location.clone()), + Box::new(v4_versioned_location.clone()), Box::new(AssetMetadata { name: b"Another Token Name".to_vec(), symbol: b"ATN".to_vec(), @@ -179,11 +192,11 @@ fn register_foreign_asset_work() { }) )); - let v3_location: v3::Location = v3_versioned_location.try_into().unwrap(); - let v4_location: Location = v3_location.clone().try_into().unwrap(); + let v4_location: v4::Location = v4_versioned_location.try_into().unwrap(); + let v5_location: Location = v4_location.clone().try_into().unwrap(); System::assert_last_event(RuntimeEvent::AssetRegistry(crate::Event::ForeignAssetRegistered { asset_id: 1, - asset_address: v4_location.clone(), + asset_address: v5_location.clone(), metadata: AssetMetadata { name: b"Another Token Name".to_vec(), symbol: b"ATN".to_vec(), @@ -207,8 +220,8 @@ fn register_foreign_asset_work() { Some(CurrencyId::ForeignAsset(1)) ); - // v4 - let v4_versioned_location = VersionedLocation::V4(Location::new( + // v5 + let v5_versioned_location = VersionedLocation::V5(Location::new( 0, [GeneralKey { length: 32, @@ -218,7 +231,7 @@ fn register_foreign_asset_work() { assert_ok!(AssetRegistry::register_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), - Box::new(v4_versioned_location.clone()), + Box::new(v5_versioned_location.clone()), Box::new(AssetMetadata { name: b"Another Token Name2".to_vec(), symbol: b"ATN2".to_vec(), @@ -227,11 +240,12 @@ fn register_foreign_asset_work() { }) )); - let v3_location: v3::Location = v4_versioned_location.clone().try_into().unwrap(); - let v4_location: Location = v4_versioned_location.try_into().unwrap(); + let v3_location: v3::Location = v5_versioned_location.clone().try_into().unwrap(); + let _v4_location: v4::Location = v5_versioned_location.clone().try_into().unwrap(); + let v5_location: Location = v5_versioned_location.try_into().unwrap(); System::assert_last_event(RuntimeEvent::AssetRegistry(crate::Event::ForeignAssetRegistered { asset_id: 2, - asset_address: v4_location.clone(), + asset_address: v5_location.clone(), metadata: AssetMetadata { name: b"Another Token Name2".to_vec(), symbol: b"ATN2".to_vec(), @@ -260,11 +274,11 @@ fn register_foreign_asset_work() { #[test] fn register_foreign_asset_should_not_work() { ExtBuilder::default().build().execute_with(|| { - let v4_location = VersionedLocation::V4(Location::new(0, [Parachain(1000)])); + let v5_location = VersionedLocation::V5(Location::new(0, [Parachain(1000)])); assert_ok!(AssetRegistry::register_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), - Box::new(v4_location.clone()), + Box::new(v5_location.clone()), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -276,7 +290,7 @@ fn register_foreign_asset_should_not_work() { assert_noop!( AssetRegistry::register_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), - Box::new(v4_location.clone()), + Box::new(v5_location.clone()), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -291,7 +305,7 @@ fn register_foreign_asset_should_not_work() { assert_noop!( AssetRegistry::register_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), - Box::new(v4_location), + Box::new(v5_location), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -307,11 +321,11 @@ fn register_foreign_asset_should_not_work() { #[test] fn update_foreign_asset_work() { ExtBuilder::default().build().execute_with(|| { - let v4_versioned_location = VersionedLocation::V4(Location::new(0, [Parachain(1000)])); + let v5_versioned_location = VersionedLocation::V5(Location::new(0, [Parachain(1000)])); assert_ok!(AssetRegistry::register_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), - Box::new(v4_versioned_location.clone()), + Box::new(v5_versioned_location.clone()), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -323,7 +337,7 @@ fn update_foreign_asset_work() { assert_ok!(AssetRegistry::update_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), 0, - Box::new(v4_versioned_location.clone()), + Box::new(v5_versioned_location.clone()), Box::new(AssetMetadata { name: b"New Token Name".to_vec(), symbol: b"NTN".to_vec(), @@ -332,11 +346,12 @@ fn update_foreign_asset_work() { }) )); - let v3_location: v3::Location = v4_versioned_location.clone().try_into().unwrap(); - let v4_location: Location = v4_versioned_location.try_into().unwrap(); + let v3_location: v3::Location = v5_versioned_location.clone().try_into().unwrap(); + let _v4_location: v4::Location = v5_versioned_location.clone().try_into().unwrap(); + let v5_location: Location = v5_versioned_location.try_into().unwrap(); System::assert_last_event(RuntimeEvent::AssetRegistry(crate::Event::ForeignAssetUpdated { asset_id: 0, - asset_address: v4_location.clone(), + asset_address: v5_location.clone(), metadata: AssetMetadata { name: b"New Token Name".to_vec(), symbol: b"NTN".to_vec(), @@ -361,12 +376,12 @@ fn update_foreign_asset_work() { ); // modify location - let new_v4_versioned_location = VersionedLocation::V4(Location::new(0, [Parachain(2000)])); + let new_v5_versioned_location = VersionedLocation::V5(Location::new(0, [Parachain(2000)])); assert_ok!(AssetRegistry::update_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), 0, - Box::new(new_v4_versioned_location.clone()), + Box::new(new_v5_versioned_location.clone()), Box::new(AssetMetadata { name: b"New Token Name".to_vec(), symbol: b"NTN".to_vec(), @@ -383,7 +398,7 @@ fn update_foreign_asset_work() { minimal_balance: 2, }) ); - let new_v3_location: v3::Location = v3::Location::try_from(new_v4_versioned_location).unwrap(); + let new_v3_location: v3::Location = v3::Location::try_from(new_v5_versioned_location).unwrap(); assert_eq!(ForeignAssetLocations::::get(0), Some(new_v3_location.clone())); assert_eq!(LocationToCurrencyIds::::get(v3_location), None); assert_eq!( @@ -396,13 +411,13 @@ fn update_foreign_asset_work() { #[test] fn update_foreign_asset_should_not_work() { ExtBuilder::default().build().execute_with(|| { - let v4_location = VersionedLocation::V4(Location::new(0, [Parachain(1000)])); + let v5_location = VersionedLocation::V5(Location::new(0, [Parachain(1000)])); assert_noop!( AssetRegistry::update_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), 0, - Box::new(v4_location.clone()), + Box::new(v5_location.clone()), Box::new(AssetMetadata { name: b"New Token Name".to_vec(), symbol: b"NTN".to_vec(), @@ -415,7 +430,7 @@ fn update_foreign_asset_should_not_work() { assert_ok!(AssetRegistry::register_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), - Box::new(v4_location.clone()), + Box::new(v5_location.clone()), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -427,7 +442,7 @@ fn update_foreign_asset_should_not_work() { assert_ok!(AssetRegistry::update_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), 0, - Box::new(v4_location), + Box::new(v5_location), Box::new(AssetMetadata { name: b"New Token Name".to_vec(), symbol: b"NTN".to_vec(), @@ -437,10 +452,10 @@ fn update_foreign_asset_should_not_work() { )); // existed location - let new_v4_location = VersionedLocation::V4(Location::new(0, [Parachain(2000)])); + let new_v5_location = VersionedLocation::V5(Location::new(0, [Parachain(2000)])); assert_ok!(AssetRegistry::register_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), - Box::new(new_v4_location.clone()), + Box::new(new_v5_location.clone()), Box::new(AssetMetadata { name: b"Token Name".to_vec(), symbol: b"TN".to_vec(), @@ -452,7 +467,7 @@ fn update_foreign_asset_should_not_work() { AssetRegistry::update_foreign_asset( RuntimeOrigin::signed(CouncilAccount::get()), 0, - Box::new(new_v4_location), + Box::new(new_v5_location), Box::new(AssetMetadata { name: b"New Token Name".to_vec(), symbol: b"NTN".to_vec(), diff --git a/modules/assethub/src/lib.rs b/modules/assethub/src/lib.rs index b2f5d470d..a881fd7f7 100644 --- a/modules/assethub/src/lib.rs +++ b/modules/assethub/src/lib.rs @@ -33,7 +33,7 @@ use primitives::{AccountId, Balance}; use sp_std::{boxed::Box, marker::PhantomData, prelude::*}; pub use cumulus_primitives_core::ParaId; -use xcm::v4::{prelude::*, Weight as XcmWeight}; +use xcm::v5::{prelude::*, Weight as XcmWeight}; /// The encoded index corresponds to AssetHub's Runtime module configuration. /// https://github.com/polkadot-fellows/runtimes/blob/2fb47566718a974c261b68fffaae500be5581820/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs#L1065 @@ -217,7 +217,7 @@ where }, Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: weight, + fallback_max_weight: Some(weight), call: call.encode().into(), }, RefundSurplus, @@ -241,7 +241,7 @@ where .iter() .map(|(call, weight)| Transact { origin_kind: OriginKind::SovereignAccount, - require_weight_at_most: *weight, + fallback_max_weight: Some(*weight), call: call.encode().into(), }) .collect(); diff --git a/modules/auction-manager/src/lib.rs b/modules/auction-manager/src/lib.rs index 2b278fbda..682063993 100644 --- a/modules/auction-manager/src/lib.rs +++ b/modules/auction-manager/src/lib.rs @@ -32,7 +32,7 @@ use frame_support::{pallet_prelude::*, traits::ExistenceRequirement, transactional}; use frame_system::{ - offchain::{SendTransactionTypes, SubmitTransaction}, + offchain::{CreateInherent, SubmitTransaction}, pallet_prelude::*, }; use module_support::{ @@ -133,7 +133,7 @@ pub mod module { use super::*; #[pallet::config] - pub trait Config: frame_system::Config + SendTransactionTypes> { + pub trait Config: frame_system::Config + CreateInherent> { type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The minimum increment size of each bid compared to the previous one @@ -338,7 +338,8 @@ impl Pallet { fn submit_cancel_auction_tx(auction_id: AuctionId) { let call = Call::::cancel { id: auction_id }; - if let Err(err) = SubmitTransaction::>::submit_unsigned_transaction(call.into()) { + let xt = T::create_inherent(call.into()); + if let Err(err) = SubmitTransaction::>::submit_transaction(xt) { log::info!( target: "auction-manager", "offchain worker: submit unsigned auction cancel tx for AuctionId {:?} failed: {:?}", diff --git a/modules/auction-manager/src/mock.rs b/modules/auction-manager/src/mock.rs index 175be17c0..53bda97e5 100644 --- a/modules/auction-manager/src/mock.rs +++ b/modules/auction-manager/src/mock.rs @@ -215,14 +215,23 @@ construct_runtime!( pub type Extrinsic = TestXt; -impl frame_system::offchain::SendTransactionTypes for Runtime +impl frame_system::offchain::CreateTransactionBase for Runtime where RuntimeCall: From, { - type OverarchingCall = RuntimeCall; + type RuntimeCall = RuntimeCall; type Extrinsic = Extrinsic; } +impl frame_system::offchain::CreateInherent for Runtime +where + RuntimeCall: From, +{ + fn create_inherent(call: Self::RuntimeCall) -> Self::Extrinsic { + Extrinsic::new_bare(call) + } +} + pub struct ExtBuilder { balances: Vec<(AccountId, CurrencyId, Balance)>, } diff --git a/modules/auction-manager/src/tests.rs b/modules/auction-manager/src/tests.rs index 45bf6e209..cfa3928e0 100644 --- a/modules/auction-manager/src/tests.rs +++ b/modules/auction-manager/src/tests.rs @@ -647,7 +647,7 @@ fn offchain_worker_cancels_auction_in_shutdown() { run_to_block_offchain(3); let tx = pool_state.write().transactions.pop().unwrap(); let tx = Extrinsic::decode(&mut &*tx).unwrap(); - if let MockCall::AuctionManagerModule(crate::Call::cancel { id: auction_id }) = tx.call { + if let MockCall::AuctionManagerModule(crate::Call::cancel { id: auction_id }) = tx.function { assert_ok!(AuctionManagerModule::cancel(RuntimeOrigin::none(), auction_id)); } @@ -681,7 +681,7 @@ fn offchain_worker_max_iterations_check() { // now offchain worker will cancel one auction but the other one will cancel next block let tx = pool_state.write().transactions.pop().unwrap(); let tx = Extrinsic::decode(&mut &*tx).unwrap(); - if let MockCall::AuctionManagerModule(crate::Call::cancel { id: auction_id }) = tx.call { + if let MockCall::AuctionManagerModule(crate::Call::cancel { id: auction_id }) = tx.function { assert_ok!(AuctionManagerModule::cancel(RuntimeOrigin::none(), auction_id)); } assert!( @@ -695,7 +695,7 @@ fn offchain_worker_max_iterations_check() { // now offchain worker will cancel the next auction let tx = pool_state.write().transactions.pop().unwrap(); let tx = Extrinsic::decode(&mut &*tx).unwrap(); - if let MockCall::AuctionManagerModule(crate::Call::cancel { id: auction_id }) = tx.call { + if let MockCall::AuctionManagerModule(crate::Call::cancel { id: auction_id }) = tx.function { assert_ok!(AuctionManagerModule::cancel(RuntimeOrigin::none(), auction_id)); } assert!(AuctionManagerModule::collateral_auctions(1).is_none()); diff --git a/modules/cdp-engine/src/lib.rs b/modules/cdp-engine/src/lib.rs index 3e0f0643a..dd4e8f9c6 100644 --- a/modules/cdp-engine/src/lib.rs +++ b/modules/cdp-engine/src/lib.rs @@ -32,7 +32,7 @@ use frame_support::{ pallet_prelude::*, traits::ExistenceRequirement, traits::UnixTime, transactional, BoundedVec, PalletId, }; use frame_system::{ - offchain::{SendTransactionTypes, SubmitTransaction}, + offchain::{CreateInherent, SubmitTransaction}, pallet_prelude::*, }; use module_support::{ @@ -82,7 +82,9 @@ pub type LoansOf = module_loans::Pallet; pub type CurrencyOf = ::Currency; /// Risk management params -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, Default, TypeInfo, MaxEncodedLen)] +#[derive( + Encode, Decode, DecodeWithMemTracking, Clone, RuntimeDebug, PartialEq, Eq, Default, TypeInfo, MaxEncodedLen, +)] pub struct RiskManagementParams { /// Maximum total debit value generated from it, when reach the hard /// cap, CDP's owner cannot issue more stablecoin under the collateral @@ -115,7 +117,7 @@ type ChangeOptionRatio = Change>; type ChangeBalance = Change; /// Status of CDP -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)] pub enum CDPStatus { Safe, Unsafe, @@ -127,7 +129,7 @@ pub mod module { use super::*; #[pallet::config] - pub trait Config: frame_system::Config + module_loans::Config + SendTransactionTypes> { + pub trait Config: frame_system::Config + module_loans::Config + CreateInherent> { type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The origin which may update risk management parameters. Root can @@ -672,7 +674,8 @@ impl Pallet { currency_id, who: who.clone(), }; - if SubmitTransaction::>::submit_unsigned_transaction(call.into()).is_err() { + let xt = T::create_inherent(call.into()); + if SubmitTransaction::>::submit_transaction(xt).is_err() { log::info!( target: "cdp-engine offchain worker", "submit unsigned liquidation tx for \nCDP - AccountId {:?} CurrencyId {:?} \nfailed!", @@ -687,7 +690,8 @@ impl Pallet { currency_id, who: who.clone(), }; - if SubmitTransaction::>::submit_unsigned_transaction(call.into()).is_err() { + let xt = T::create_inherent(call.into()); + if SubmitTransaction::>::submit_transaction(xt).is_err() { log::info!( target: "cdp-engine offchain worker", "submit unsigned settlement tx for \nCDP - AccountId {:?} CurrencyId {:?} \nfailed!", diff --git a/modules/cdp-engine/src/mock.rs b/modules/cdp-engine/src/mock.rs index 11b720d0b..0d7f7d1ea 100644 --- a/modules/cdp-engine/src/mock.rs +++ b/modules/cdp-engine/src/mock.rs @@ -102,6 +102,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } pub type AdaptedBasicCurrency = orml_currencies::BasicCurrencyAdapter; @@ -435,6 +436,7 @@ impl Config for Runtime { type WeightInfo = (); } +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( @@ -454,17 +456,26 @@ construct_runtime!( } ); -/// An extrinsic type used for tests. -pub type Extrinsic = TestXt; +impl frame_system::offchain::CreateTransactionBase for Runtime +where + RuntimeCall: From, +{ + type Extrinsic = UncheckedExtrinsic; + type RuntimeCall = RuntimeCall; +} -impl SendTransactionTypes for Runtime +impl frame_system::offchain::CreateInherent for Runtime where - RuntimeCall: From, + RuntimeCall: From, { - type OverarchingCall = RuntimeCall; - type Extrinsic = Extrinsic; + fn create_inherent(call: Self::RuntimeCall) -> Self::Extrinsic { + UncheckedExtrinsic::new_bare(call) + } } +/// An extrinsic type used for tests. +pub type Extrinsic = TestXt; + pub struct ExtBuilder { balances: Vec<(AccountId, CurrencyId, Balance)>, } @@ -493,6 +504,7 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: vec![(CAROL, 10000)], + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/cdp-engine/src/tests.rs b/modules/cdp-engine/src/tests.rs index c0c6a6ce3..7627a577c 100644 --- a/modules/cdp-engine/src/tests.rs +++ b/modules/cdp-engine/src/tests.rs @@ -1702,7 +1702,7 @@ fn offchain_worker_works_cdp() { if let MockCall::CDPEngineModule(crate::Call::liquidate { currency_id: currency_call, who: who_call, - }) = tx.call + }) = tx.function { assert_ok!(CDPEngineModule::liquidate( RuntimeOrigin::none(), @@ -1728,7 +1728,7 @@ fn offchain_worker_works_cdp() { if let MockCall::CDPEngineModule(crate::Call::settle { currency_id: currency_call, who: who_call, - }) = tx.call + }) = tx.function { assert_ok!(CDPEngineModule::settle(RuntimeOrigin::none(), currency_call, who_call)); } @@ -1779,7 +1779,7 @@ fn offchain_worker_iteration_limit_works() { if let MockCall::CDPEngineModule(crate::Call::liquidate { currency_id: currency_call, who: who_call, - }) = tx.call + }) = tx.function { assert_ok!(CDPEngineModule::liquidate( RuntimeOrigin::none(), @@ -1800,7 +1800,7 @@ fn offchain_worker_iteration_limit_works() { if let MockCall::CDPEngineModule(crate::Call::liquidate { currency_id: currency_call, who: who_call, - }) = tx.call + }) = tx.function { assert_ok!(CDPEngineModule::liquidate( RuntimeOrigin::none(), diff --git a/modules/cdp-treasury/src/mock.rs b/modules/cdp-treasury/src/mock.rs index 1e457c6a4..1a59fbdff 100644 --- a/modules/cdp-treasury/src/mock.rs +++ b/modules/cdp-treasury/src/mock.rs @@ -97,6 +97,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } pub type AdaptedBasicCurrency = orml_currencies::BasicCurrencyAdapter; diff --git a/modules/collator-selection/src/mock.rs b/modules/collator-selection/src/mock.rs index cc1200464..10de93ba2 100644 --- a/modules/collator-selection/src/mock.rs +++ b/modules/collator-selection/src/mock.rs @@ -68,6 +68,7 @@ impl pallet_balances::Config for Test { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } pub struct Author4; @@ -144,6 +145,7 @@ impl pallet_session::Config for Test { type SessionHandler = TestSessionHandler; type Keys = MockSessionKeys; type WeightInfo = (); + type DisablingStrategy = (); } ord_parameter_types! { @@ -189,13 +191,17 @@ pub fn new_test_ext() -> sp_io::TestExternalities { let balances = pallet_balances::GenesisConfig:: { balances: vec![(1, 100), (2, 100), (3, 100), (4, 100), (5, 100), (33, 5)], + ..Default::default() }; let collator_selection = collator_selection::GenesisConfig:: { desired_candidates: 2, candidacy_bond: 10, invulnerables, }; - let session = pallet_session::GenesisConfig:: { keys }; + let session = pallet_session::GenesisConfig:: { + keys, + ..Default::default() + }; balances.assimilate_storage(&mut t).unwrap(); // collator selection must be initialized before session. collator_selection.assimilate_storage(&mut t).unwrap(); diff --git a/modules/currencies/src/mock.rs b/modules/currencies/src/mock.rs index b2006a41d..b5d13abed 100644 --- a/modules/currencies/src/mock.rs +++ b/modules/currencies/src/mock.rs @@ -109,7 +109,20 @@ parameter_types! { pub const GetNativeCurrencyId: CurrencyId = NATIVE_CURRENCY_ID; } -#[derive(Encode, Decode, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, MaxEncodedLen, TypeInfo, RuntimeDebug)] +#[derive( + Encode, + Decode, + DecodeWithMemTracking, + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + MaxEncodedLen, + TypeInfo, + RuntimeDebug, +)] pub enum TestId { Foo, } @@ -132,6 +145,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } pub type PalletBalances = pallet_balances::Pallet; @@ -294,7 +308,7 @@ pub fn deploy_contracts() { ], data: { let mut buf = [0u8; 32]; - U256::from(ALICE_BALANCE).to_big_endian(&mut buf); + U256::from(ALICE_BALANCE).write_as_big_endian(&mut buf); H256::from_slice(&buf).as_bytes().to_vec() }, }], @@ -341,6 +355,7 @@ impl ExtBuilder { .filter(|(_, currency_id, _)| *currency_id == NATIVE_CURRENCY_ID) .map(|(account_id, _, initial_balance)| (account_id, initial_balance)) .collect::>(), + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/currencies/src/tests.rs b/modules/currencies/src/tests.rs index 162836840..95e86fdb6 100644 --- a/modules/currencies/src/tests.rs +++ b/modules/currencies/src/tests.rs @@ -3044,7 +3044,7 @@ fn transfer_erc20_will_charge_gas() { } .get_dispatch_info(); assert_eq!( - dispatch_info.weight, + dispatch_info.call_weight, ::WeightInfo::transfer_non_native_currency() + Weight::from_parts(module_support::evm::limits::erc20::TRANSFER.gas, 0) // mock GasToWeight is 1:1 ); @@ -3056,7 +3056,7 @@ fn transfer_erc20_will_charge_gas() { } .get_dispatch_info(); assert_eq!( - dispatch_info.weight, + dispatch_info.call_weight, ::WeightInfo::transfer_non_native_currency() ); }); diff --git a/modules/earning/src/mock.rs b/modules/earning/src/mock.rs index d1fadd944..35e9a20b0 100644 --- a/modules/earning/src/mock.rs +++ b/modules/earning/src/mock.rs @@ -54,6 +54,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_types! { @@ -134,6 +135,7 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: vec![(ALICE, 1000)], + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/emergency-shutdown/src/mock.rs b/modules/emergency-shutdown/src/mock.rs index 7db566a4e..8f97216b2 100644 --- a/modules/emergency-shutdown/src/mock.rs +++ b/modules/emergency-shutdown/src/mock.rs @@ -92,6 +92,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } pub type AdaptedBasicCurrency = orml_currencies::BasicCurrencyAdapter; diff --git a/modules/evm-accounts/src/mock.rs b/modules/evm-accounts/src/mock.rs index df98cc3bc..2634f5aa9 100644 --- a/modules/evm-accounts/src/mock.rs +++ b/modules/evm-accounts/src/mock.rs @@ -63,6 +63,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_type_with_key! { @@ -134,6 +135,7 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: vec![(bob_account_id(), 100000)], + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/evm-bridge/src/lib.rs b/modules/evm-bridge/src/lib.rs index 4253549c6..e4b127e9a 100644 --- a/modules/evm-bridge/src/lib.rs +++ b/modules/evm-bridge/src/lib.rs @@ -150,7 +150,7 @@ impl EVMBridgeTrait, BalanceOf> for EVMBridge { Pallet::::handle_exit_reason(info.exit_reason)?; ensure!(info.value.len() == 32, Error::::InvalidReturnValue); - let value: u8 = U256::from(info.value.as_slice()) + let value: u8 = U256::from_big_endian(info.value.as_slice()) .try_into() .map_err(|_| ArithmeticError::Overflow)?; Ok(value) @@ -174,7 +174,7 @@ impl EVMBridgeTrait, BalanceOf> for EVMBridge { Pallet::::handle_exit_reason(info.exit_reason)?; ensure!(info.value.len() == 32, Error::::InvalidReturnValue); - let value: u128 = U256::from(info.value.as_slice()) + let value: u128 = U256::from_big_endian(info.value.as_slice()) .try_into() .map_err(|_| ArithmeticError::Overflow)?; let supply = value.try_into().map_err(|_| ArithmeticError::Overflow)?; @@ -200,7 +200,7 @@ impl EVMBridgeTrait, BalanceOf> for EVMBridge { Pallet::::handle_exit_reason(info.exit_reason)?; - let value: u128 = U256::from(info.value.as_slice()) + let value: u128 = U256::from_big_endian(info.value.as_slice()) .try_into() .map_err(|_| ArithmeticError::Overflow)?; let balance = value.try_into().map_err(|_| ArithmeticError::Overflow)?; @@ -235,7 +235,7 @@ impl EVMBridgeTrait, BalanceOf> for EVMBridge { // return value is true. let mut bytes = [0u8; 32]; - U256::from(1).to_big_endian(&mut bytes); + U256::from(1).write_as_big_endian(&mut bytes); // Check return value to make sure not calling on empty contracts. ensure!( diff --git a/modules/evm-bridge/src/mock.rs b/modules/evm-bridge/src/mock.rs index 13f79d2f3..66d305128 100644 --- a/modules/evm-bridge/src/mock.rs +++ b/modules/evm-bridge/src/mock.rs @@ -64,6 +64,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } impl pallet_timestamp::Config for Runtime { @@ -184,7 +185,7 @@ pub fn deploy_contracts() { ], data: { let mut buf = [0u8; 32]; - U256::from(ALICE_BALANCE).to_big_endian(&mut buf); + U256::from(ALICE_BALANCE).write_as_big_endian(&mut buf); H256::from_slice(&buf).as_bytes().to_vec() }, }], @@ -250,6 +251,7 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: self.balances.into_iter().collect::>(), + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/evm-bridge/src/tests.rs b/modules/evm-bridge/src/tests.rs index a6d97df14..f62efa386 100644 --- a/modules/evm-bridge/src/tests.rs +++ b/modules/evm-bridge/src/tests.rs @@ -22,7 +22,6 @@ use super::*; use frame_support::{assert_err, assert_noop, assert_ok}; -use insta::assert_json_snapshot; use mock::*; #[test] @@ -236,7 +235,7 @@ fn liquidation_works() { buf[12..32].copy_from_slice(collateral.as_bytes()); buf[44..64].copy_from_slice(repay_dest.as_bytes()); let mut amount_data = [0u8; 32]; - U256::from(100).to_big_endian(&mut amount_data); + U256::from(100).write_as_big_endian(&mut amount_data); buf[64..96].copy_from_slice(&amount_data); buf[96..128].copy_from_slice(&amount_data); buf.to_vec() @@ -277,7 +276,7 @@ fn on_collateral_transfer_works() { let mut buf = [0u8; 64]; buf[12..32].copy_from_slice(collateral.as_bytes()); let mut amount_data = [0u8; 32]; - U256::from(100).to_big_endian(&mut amount_data); + U256::from(100).write_as_big_endian(&mut amount_data); buf[32..64].copy_from_slice(&amount_data); buf.to_vec() }, @@ -317,7 +316,7 @@ fn on_repayment_refund_works() { let mut buf = [0u8; 64]; buf[12..32].copy_from_slice(collateral.as_bytes()); let mut amount_data = [0u8; 32]; - U256::from(100).to_big_endian(&mut amount_data); + U256::from(100).write_as_big_endian(&mut amount_data); buf[32..64].copy_from_slice(&amount_data); buf.to_vec() }, @@ -358,6 +357,7 @@ fn liquidation_err_fails_as_expected() { #[cfg(feature = "tracing")] #[test] fn tracing_should_work() { + use insta::assert_json_snapshot; use module_evm::runner::tracing; use primitives::evm::tracing::TracerConfig; diff --git a/modules/evm-utility/Cargo.toml b/modules/evm-utility/Cargo.toml index f3e95fa82..d473417cb 100644 --- a/modules/evm-utility/Cargo.toml +++ b/modules/evm-utility/Cargo.toml @@ -9,10 +9,10 @@ sha3 = { workspace = true } sp-std = { workspace = true } -evm = { version = "0.41.1", default-features = false, features = ["with-codec"] } -evm-gasometer = { version = "0.41.0", default-features = false } -evm-runtime = { version = "0.41.0", default-features = false } -ethereum = { version = "0.15.0", default-features = false, features = ["with-codec"] } +evm = { version = "0.43.4", default-features = false, features = ["with-codec"] } +evm-gasometer = { version = "0.43.0", default-features = false } +evm-runtime = { version = "0.43.0", default-features = false } +ethereum = { version = "0.18.2", default-features = false, features = ["with-scale", "with-serde"] } [features] default = ["std"] @@ -23,7 +23,7 @@ std = [ "evm/with-serde", "evm-runtime/std", "evm-gasometer/std", - "ethereum/with-serde", + "ethereum/std", ] tracing = [ "evm/tracing", diff --git a/modules/evm/src/bench/mock.rs b/modules/evm/src/bench/mock.rs index c8acf13e8..6c7679ae4 100644 --- a/modules/evm/src/bench/mock.rs +++ b/modules/evm/src/bench/mock.rs @@ -74,6 +74,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } impl pallet_timestamp::Config for Runtime { @@ -116,7 +117,7 @@ impl orml_currencies::Config for Runtime { pub type AdaptedBasicCurrency = orml_currencies::BasicCurrencyAdapter; define_combined_task! { - #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] pub enum ScheduledTasks { EvmTask(EvmTask), } diff --git a/modules/evm/src/bench/mod.rs b/modules/evm/src/bench/mod.rs index d19664277..e31387e04 100644 --- a/modules/evm/src/bench/mod.rs +++ b/modules/evm/src/bench/mod.rs @@ -166,6 +166,7 @@ macro_rules! evm_create { 21_000_000, 1_000_000, vec![], + vec![], ::config(), ) }) @@ -196,6 +197,7 @@ macro_rules! evm_call { 21_000_000, 1_000_000, vec![], + vec![], ::config(), ) .unwrap(); @@ -218,6 +220,7 @@ macro_rules! evm_call { 21_000_000, 1_000_000, vec![], + vec![], ::config(), ) }) diff --git a/modules/evm/src/lib.rs b/modules/evm/src/lib.rs index d02e9c401..354a33dd0 100644 --- a/modules/evm/src/lib.rs +++ b/modules/evm/src/lib.rs @@ -58,7 +58,7 @@ pub use module_support::{ EVM as EVMTrait, }; pub use orml_traits::{currency::TransferAll, MultiCurrency}; -use parity_scale_codec::{Decode, Encode, FullCodec, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, FullCodec, MaxEncodedLen}; pub use primitives::{ evm::{ convert_decimals_from_evm, convert_decimals_to_evm, decode_gas_limit, is_system_contract, CallInfo, CreateInfo, @@ -72,7 +72,10 @@ use serde::{Deserialize, Serialize}; use sha3::{Digest, Keccak256}; use sp_core::{H160, H256, U256}; use sp_runtime::{ - traits::{Convert, DispatchInfoOf, One, PostDispatchInfoOf, SignedExtension, UniqueSaturatedInto, Zero}, + traits::{ + Convert, DispatchInfoOf, DispatchOriginOf, One, PostDispatchInfoOf, TransactionExtension, UniqueSaturatedInto, + Zero, + }, transaction_validity::TransactionValidityError, DispatchError, Either, RuntimeDebug, SaturatedConversion, Saturating, TransactionOutcome, }; @@ -254,14 +257,14 @@ pub mod module { type WeightInfo: WeightInfo; } - #[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo)] + #[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub struct ContractInfo { pub code_hash: H256, pub maintainer: EvmAddress, pub published: bool, } - #[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo)] + #[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub struct AccountInfo { pub nonce: Nonce, pub contract_info: Option, @@ -273,13 +276,27 @@ pub mod module { } } - #[derive(Clone, Copy, Eq, PartialEq, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)] + #[derive( + Clone, Copy, Eq, PartialEq, RuntimeDebug, Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo, + )] pub struct CodeInfo { pub code_size: u32, pub ref_count: u32, } - #[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo, Default, Serialize, Deserialize)] + #[derive( + Clone, + Eq, + PartialEq, + Encode, + Decode, + DecodeWithMemTracking, + RuntimeDebug, + TypeInfo, + Default, + Serialize, + Deserialize, + )] /// Account definition used for genesis block construction. pub struct GenesisAccount { /// Account nonce. @@ -643,6 +660,7 @@ pub mod module { gas_limit, storage_limit, access_list.into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], // TODO T::config(), ); @@ -738,6 +756,7 @@ pub mod module { gas_limit, storage_limit, access_list.into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], // TODO T::config(), ) { Err(e) => { @@ -829,6 +848,7 @@ pub mod module { gas_limit, storage_limit, access_list.into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], // TODO T::config(), ); @@ -910,6 +930,7 @@ pub mod module { gas_limit, storage_limit, access_list.into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], // TODO T::config(), ); @@ -1001,6 +1022,7 @@ pub mod module { gas_limit, storage_limit, access_list.into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], // TODO T::config(), ) { Err(e) => { @@ -1091,6 +1113,7 @@ pub mod module { gas_limit, storage_limit, access_list.into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], // TODO T::config(), ) { Err(e) => { @@ -1274,6 +1297,7 @@ pub mod module { gas_limit, storage_limit, access_list.into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], // TODO T::config(), ) { Err(e) => Err(DispatchErrorWithPostInfo { @@ -1939,6 +1963,7 @@ impl EVMTrait for Pallet { gas_limit, storage_limit, vec![], + vec![], // TODO &config, ); @@ -2096,12 +2121,12 @@ fn encode_revert_message(msg: &[u8]) -> Vec { // (32) should contain a utf-8 encoded revert reason. let mut data = Vec::with_capacity(68 + msg.len()); data.extend_from_slice(&[0u8; 68]); - U256::from(msg.len()).to_big_endian(&mut data[36..68]); + U256::from(msg.len()).write_as_big_endian(&mut data[36..68]); data.extend_from_slice(msg); data } -#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] pub struct SetEvmOrigin(PhantomData); @@ -2129,53 +2154,70 @@ impl Default for SetEvmOrigin { } } -impl SignedExtension for SetEvmOrigin { +/// The info passed between the validate and prepare steps for the `ChargeAssetTxPayment` extension. +#[derive(RuntimeDebugNoBound)] +pub enum Val { + Sender { sender: T::AccountId }, + NoSender, +} + +impl TransactionExtension for SetEvmOrigin { const IDENTIFIER: &'static str = "SetEvmOrigin"; - type AccountId = T::AccountId; - type Call = T::RuntimeCall; - type AdditionalSigned = (); + type Implicit = (); + type Val = Val; type Pre = (); - fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { - Ok(()) + fn weight(&self, _: &T::RuntimeCall) -> Weight { + Weight::zero() } fn validate( &self, - who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, + origin: DispatchOriginOf, + _call: &T::RuntimeCall, + _info: &DispatchInfoOf, _len: usize, - ) -> TransactionValidity { - ExtrinsicOrigin::::set(Some(who.clone())); - Ok(ValidTransaction::default()) + _self_implicit: Self::Implicit, + _inherited_implication: &impl Encode, + _source: TransactionSource, + ) -> Result<(ValidTransaction, Self::Val, DispatchOriginOf), TransactionValidityError> { + let who = frame_system::ensure_signed(origin.clone()) + .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::BadSigner))?; + + Ok((ValidTransaction::default(), Val::Sender { sender: who }, origin)) } - fn pre_dispatch( + fn prepare( self, - who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, + val: Self::Val, + _origin: &DispatchOriginOf, + _call: &T::RuntimeCall, + _info: &DispatchInfoOf, _len: usize, - ) -> Result<(), TransactionValidityError> { - ExtrinsicOrigin::::set(Some(who.clone())); - Ok(()) + ) -> Result { + match val { + Val::Sender { sender } => { + ExtrinsicOrigin::::set(Some(sender.clone())); + Ok(()) + } + Val::NoSender => Ok(()), + } } - fn post_dispatch( - _pre: Option, - _info: &DispatchInfoOf, - _post_info: &PostDispatchInfoOf, + fn post_dispatch_details( + _pre: Self::Pre, + _info: &DispatchInfoOf, + _post_info: &PostDispatchInfoOf, _len: usize, _result: &DispatchResult, - ) -> Result<(), TransactionValidityError> { + ) -> Result { ExtrinsicOrigin::::kill(); XcmOrigin::::kill(); - Ok(()) + Ok(Weight::zero()) } } -#[derive(Clone, RuntimeDebug, PartialEq, Encode, Decode, TypeInfo)] +#[derive(Clone, RuntimeDebug, PartialEq, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub enum EvmTask { // TODO: update Schedule { diff --git a/modules/evm/src/mock.rs b/modules/evm/src/mock.rs index ea8d100e5..659ffd9e2 100644 --- a/modules/evm/src/mock.rs +++ b/modules/evm/src/mock.rs @@ -64,6 +64,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } impl pallet_timestamp::Config for Runtime { @@ -106,7 +107,7 @@ impl orml_currencies::Config for Runtime { pub type AdaptedBasicCurrency = orml_currencies::BasicCurrencyAdapter; define_combined_task! { - #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] pub enum ScheduledTasks { EvmTask(EvmTask), } @@ -291,6 +292,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { pallet_balances::GenesisConfig:: { balances: vec![(TreasuryAccount::get(), INITIAL_BALANCE)], + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/evm/src/precompiles/bn128.rs b/modules/evm/src/precompiles/bn128.rs index 90731fe82..618a283dc 100644 --- a/modules/evm/src/precompiles/bn128.rs +++ b/modules/evm/src/precompiles/bn128.rs @@ -255,7 +255,7 @@ impl Precompile for Bn128Pairing { handle.record_cost(gas_cost)?; let mut buf = [0u8; 32]; - ret_val.to_big_endian(&mut buf); + ret_val.write_as_big_endian(&mut buf); Ok(PrecompileOutput { exit_status: ExitSucceed::Returned, diff --git a/modules/evm/src/precompiles/mod.rs b/modules/evm/src/precompiles/mod.rs index 036a80460..df30698d0 100644 --- a/modules/evm/src/precompiles/mod.rs +++ b/modules/evm/src/precompiles/mod.rs @@ -196,6 +196,10 @@ pub mod tests { self.input } + fn origin(&self) -> H160 { + unimplemented!() + } + fn context(&self) -> &Context { self.context } @@ -207,5 +211,9 @@ pub mod tests { fn gas_limit(&self) -> Option { self.gas_limit } + + fn is_contract_being_constructed(&self, _address: H160) -> bool { + unimplemented!() + } } } diff --git a/modules/evm/src/precompiles/modexp.rs b/modules/evm/src/precompiles/modexp.rs index 027b1c957..69e1796ab 100644 --- a/modules/evm/src/precompiles/modexp.rs +++ b/modules/evm/src/precompiles/modexp.rs @@ -531,7 +531,7 @@ mod tests { // 59999 ^ 21 % 14452 = 10055 let mut output = [0u8; 32]; - U256::from(10055u64).to_big_endian(&mut output); + U256::from(10055u64).write_as_big_endian(&mut output); assert_eq!( IstanbulModexp::execute(&mut MockPrecompileHandle::new( @@ -572,7 +572,7 @@ mod tests { "}; let mut output = [0u8; 32]; - U256::from(1u64).to_big_endian(&mut output); + U256::from(1u64).write_as_big_endian(&mut output); assert_eq!( IstanbulModexp::execute(&mut MockPrecompileHandle::new( diff --git a/modules/evm/src/runner/mod.rs b/modules/evm/src/runner/mod.rs index ae6592702..546d229ac 100644 --- a/modules/evm/src/runner/mod.rs +++ b/modules/evm/src/runner/mod.rs @@ -25,7 +25,7 @@ pub mod tagged_runtime; pub mod tracing; use crate::{BalanceOf, CallInfo, Config, CreateInfo}; -use module_evm_utility::evm; +use module_evm_utility::{ethereum::AuthorizationList, evm}; pub use primitives::evm::{EvmAddress, Vicinity}; use sp_core::{H160, H256}; use sp_runtime::DispatchError; @@ -41,6 +41,7 @@ pub trait Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result; @@ -51,6 +52,7 @@ pub trait Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result; @@ -62,6 +64,7 @@ pub trait Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result; @@ -73,6 +76,7 @@ pub trait Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result; } @@ -87,6 +91,7 @@ pub trait RunnerExtended: Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result; @@ -97,6 +102,7 @@ pub trait RunnerExtended: Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result; } diff --git a/modules/evm/src/runner/stack.rs b/modules/evm/src/runner/stack.rs index 85b4a28b3..8658e0037 100644 --- a/modules/evm/src/runner/stack.rs +++ b/modules/evm/src/runner/stack.rs @@ -33,7 +33,7 @@ use frame_support::{ }; use frame_system::pallet_prelude::*; use module_evm_utility::{ - ethereum::Log, + ethereum::{AuthorizationList, Log}, evm::{self, backend::Backend as BackendT, ExitError, ExitReason, Transfer}, }; use module_support::{AddressMapping, EVMManager, EVM}; @@ -236,6 +236,7 @@ impl RunnerT for Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result { // if the contract not published, the caller must be developer or contract or maintainer. @@ -245,6 +246,11 @@ impl RunnerT for Runner { Error::::NoPermission ); + let authorization_list = authorization_list + .iter() + .map(|d| (U256::from(d.chain_id), d.address, d.nonce, d.authorizing_address().ok())) + .collect::)>>(); + let precompiles = T::PrecompilesValue::get(); let value = U256::from(UniqueSaturatedInto::::unique_saturated_into(value)); Self::execute( @@ -256,7 +262,7 @@ impl RunnerT for Runner { config, false, &precompiles, - |executor| executor.transact_call(source, target, value, input, gas_limit, access_list), + |executor| executor.transact_call(source, target, value, input, gas_limit, access_list, authorization_list), ) } @@ -269,8 +275,14 @@ impl RunnerT for Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result { + let authorization_list = authorization_list + .iter() + .map(|d| (U256::from(d.chain_id), d.address, d.nonce, d.authorizing_address().ok())) + .collect::)>>(); + let precompiles = T::PrecompilesValue::get(); let value = U256::from(UniqueSaturatedInto::::unique_saturated_into(value)); Self::execute( @@ -286,7 +298,8 @@ impl RunnerT for Runner { let address = executor .create_address(evm::CreateScheme::Legacy { caller: source }) .unwrap_or_default(); // transact_create will check the address - let (reason, _) = executor.transact_create(source, value, init, gas_limit, access_list); + let (reason, _) = + executor.transact_create(source, value, init, gas_limit, access_list, authorization_list); (reason, address) }, ) @@ -302,8 +315,14 @@ impl RunnerT for Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result { + let authorization_list = authorization_list + .iter() + .map(|d| (U256::from(d.chain_id), d.address, d.nonce, d.authorizing_address().ok())) + .collect::)>>(); + let precompiles = T::PrecompilesValue::get(); let value = U256::from(UniqueSaturatedInto::::unique_saturated_into(value)); let code_hash = H256::from(sp_io::hashing::keccak_256(&init)); @@ -324,7 +343,8 @@ impl RunnerT for Runner { salt, }) .unwrap_or_default(); // transact_create2 will check the address - let (reason, _) = executor.transact_create2(source, value, init, salt, gas_limit, access_list); + let (reason, _) = + executor.transact_create2(source, value, init, salt, gas_limit, access_list, authorization_list); (reason, address) }, ) @@ -340,8 +360,14 @@ impl RunnerT for Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result { + let authorization_list = authorization_list + .iter() + .map(|d| (U256::from(d.chain_id), d.address, d.nonce, d.authorizing_address().ok())) + .collect::)>>(); + let precompiles = T::PrecompilesValue::get(); let value = U256::from(UniqueSaturatedInto::::unique_saturated_into(value)); Self::execute( @@ -354,8 +380,15 @@ impl RunnerT for Runner { false, &precompiles, |executor| { - let (reason, _) = - executor.transact_create_at_address(source, address, value, init, gas_limit, access_list); + let (reason, _) = executor.transact_create_at_address( + source, + address, + value, + init, + gas_limit, + access_list, + authorization_list, + ); (reason, address) }, ) @@ -374,12 +407,18 @@ impl RunnerExtended for Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result { // Ensure eth_call has evm origin, otherwise xcm charge rent fee will fail. Pallet::::set_origin(T::AddressMapping::get_account_id(&origin)); defer!(Pallet::::kill_origin()); + let authorization_list = authorization_list + .iter() + .map(|d| (U256::from(d.chain_id), d.address, d.nonce, d.authorizing_address().ok())) + .collect::)>>(); + let precompiles = T::PrecompilesValue::get(); let value = U256::from(UniqueSaturatedInto::::unique_saturated_into(value)); Self::execute( @@ -391,7 +430,7 @@ impl RunnerExtended for Runner { config, true, &precompiles, - |executor| executor.transact_call(source, target, value, input, gas_limit, access_list), + |executor| executor.transact_call(source, target, value, input, gas_limit, access_list, authorization_list), ) } @@ -404,8 +443,14 @@ impl RunnerExtended for Runner { gas_limit: u64, storage_limit: u32, access_list: Vec<(H160, Vec)>, + authorization_list: AuthorizationList, config: &evm::Config, ) -> Result { + let authorization_list = authorization_list + .iter() + .map(|d| (U256::from(d.chain_id), d.address, d.nonce, d.authorizing_address().ok())) + .collect::)>>(); + let precompiles = T::PrecompilesValue::get(); let value = U256::from(UniqueSaturatedInto::::unique_saturated_into(value)); Self::execute( @@ -421,7 +466,8 @@ impl RunnerExtended for Runner { let address = executor .create_address(evm::CreateScheme::Legacy { caller: source }) .unwrap_or_default(); // transact_create will check the address - let (reason, _) = executor.transact_create(source, value, init, gas_limit, access_list); + let (reason, _) = + executor.transact_create(source, value, init, gas_limit, access_list, authorization_list); (reason, address) }, ) @@ -431,6 +477,7 @@ impl RunnerExtended for Runner { struct SubstrateStackSubstate<'config> { metadata: StackSubstateMetadata<'config>, deletes: BTreeSet, + creates: BTreeSet, logs: Vec, storage_logs: Vec<(H160, i32)>, parent: Option>>, @@ -451,6 +498,7 @@ impl<'config> SubstrateStackSubstate<'config> { metadata: self.metadata.spit_child(gas_limit, is_static), parent: None, deletes: BTreeSet::new(), + creates: BTreeSet::new(), logs: Vec::new(), storage_logs: Vec::new(), known_original_storage: BTreeMap::new(), @@ -516,10 +564,26 @@ impl<'config> SubstrateStackSubstate<'config> { false } + pub fn created(&self, address: H160) -> bool { + if self.creates.contains(&address) { + return true; + } + + if let Some(parent) = self.parent.as_ref() { + return parent.created(address); + } + + false + } + pub fn set_deleted(&mut self, address: H160) { self.deletes.insert(address); } + pub fn set_created(&mut self, address: H160) { + self.creates.insert(address); + } + pub fn log(&mut self, address: H160, topics: Vec, data: Vec) { self.logs.push(Log { address, topics, data }); } @@ -572,10 +636,17 @@ impl<'config> SubstrateStackSubstate<'config> { } } +#[derive(Default, Clone, Eq, PartialEq)] +pub struct Recorded { + account_codes: Vec, + account_storages: BTreeMap<(H160, H256), bool>, +} + /// Substrate backend for EVM. pub struct SubstrateStackState<'vicinity, 'config, T> { vicinity: &'vicinity Vicinity, substate: SubstrateStackSubstate<'config>, + transient_storage: BTreeMap<(H160, H256), H256>, _marker: PhantomData, } @@ -587,11 +658,13 @@ impl<'vicinity, 'config, T: Config> SubstrateStackState<'vicinity, 'config, T> { substate: SubstrateStackSubstate { metadata, deletes: BTreeSet::new(), + creates: BTreeSet::new(), logs: Vec::new(), storage_logs: Vec::new(), parent: None, known_original_storage: BTreeMap::new(), }, + transient_storage: BTreeMap::new(), _marker: PhantomData, } } @@ -694,6 +767,13 @@ impl BackendT for SubstrateStackState<'_, '_, T> { AccountStorages::::get(address, index) } + fn transient_storage(&self, address: H160, index: H256) -> H256 { + self.transient_storage + .get(&(address, index)) + .copied() + .unwrap_or_default() + } + fn original_storage(&self, address: H160, index: H256) -> Option { if let Some(value) = self.substate.known_original_storage(address, index) { Some(value) @@ -740,6 +820,10 @@ impl<'config, T: Config> StackStateT<'config> for SubstrateStackState<'_, 'confi self.substate.deleted(address) } + fn created(&self, address: H160) -> bool { + self.substate.created(address) + } + fn inc_nonce(&mut self, address: H160) -> Result<(), ExitError> { Pallet::::inc_nonce(&address); Ok(()) @@ -785,6 +869,10 @@ impl<'config, T: Config> StackStateT<'config> for SubstrateStackState<'_, 'confi } } + fn set_transient_storage(&mut self, address: H160, key: H256, value: H256) { + self.transient_storage.insert((address, key), value); + } + fn reset_storage(&mut self, address: H160) { // use drain_prefix to avoid wasm-bencher counting limit as write operation >::drain_prefix(address).for_each(drop); @@ -798,7 +886,11 @@ impl<'config, T: Config> StackStateT<'config> for SubstrateStackState<'_, 'confi self.substate.set_deleted(address) } - fn set_code(&mut self, address: H160, code: Vec) { + fn set_created(&mut self, address: H160) { + self.substate.set_created(address); + } + + fn set_code(&mut self, address: H160, code: Vec, _caller: Option) -> Result<(), ExitError> { log::debug!( target: "evm", "Inserting code ({} bytes) at {:?}", @@ -816,7 +908,7 @@ impl<'config, T: Config> StackStateT<'config> for SubstrateStackState<'_, 'confi address ); debug_assert!(false); - return; + return Ok(()); } }; @@ -829,7 +921,7 @@ impl<'config, T: Config> StackStateT<'config> for SubstrateStackState<'_, 'confi address ); debug_assert!(false); - return; + return Ok(()); } }; @@ -859,6 +951,7 @@ impl<'config, T: Config> StackStateT<'config> for SubstrateStackState<'_, 'confi let used_storage = code_size.saturating_add(T::NewContractExtraBytes::get()); Pallet::::update_contract_storage_size(&address, used_storage as i32); self.substate.metadata.storage_meter_mut().charge(used_storage); + Ok(()) } fn transfer(&mut self, transfer: Transfer) -> Result<(), ExitError> { diff --git a/modules/evm/src/runner/state.rs b/modules/evm/src/runner/state.rs index 23c71fb55..dd60b457a 100644 --- a/modules/evm/src/runner/state.rs +++ b/modules/evm/src/runner/state.rs @@ -308,15 +308,18 @@ pub trait StackState<'config>: Backend { fn is_empty(&self, address: H160) -> bool; fn deleted(&self, address: H160) -> bool; + fn created(&self, address: H160) -> bool; fn is_cold(&self, address: H160) -> bool; fn is_storage_cold(&self, address: H160, key: H256) -> bool; fn inc_nonce(&mut self, address: H160) -> Result<(), ExitError>; fn set_storage(&mut self, address: H160, key: H256, value: H256); + fn set_transient_storage(&mut self, address: H160, key: H256, value: H256); fn reset_storage(&mut self, address: H160); fn log(&mut self, address: H160, topics: Vec, data: Vec); fn set_deleted(&mut self, address: H160); - fn set_code(&mut self, address: H160, code: Vec); + fn set_created(&mut self, address: H160); + fn set_code(&mut self, address: H160, code: Vec, caller: Option) -> Result<(), ExitError>; fn transfer(&mut self, transfer: Transfer) -> Result<(), ExitError>; fn reset_balance(&mut self, address: H160); fn touch(&mut self, address: H160); @@ -425,7 +428,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu kind: RuntimeKind::Execute, inner: MaybeBorrowed::Borrowed(runtime), }); - let (reason, _, _) = self.execute_with_call_stack(&mut call_stack); + let (reason, _, _) = self.execute_with_call_stack(&mut call_stack, None); reason } @@ -433,6 +436,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu fn execute_with_call_stack( &mut self, call_stack: &mut Vec>, + caller: Option, ) -> (ExitReason, Option, Vec) { // This `interrupt_runtime` is used to pass the runtime obtained from the // `Capture::Trap` branch in the match below back to the top of the call stack. @@ -468,8 +472,12 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu let runtime_kind = runtime.kind; let (reason, maybe_address, return_data) = match runtime_kind { RuntimeKind::Create(created_address) => { - let (reason, maybe_address, return_data) = - self.cleanup_for_create(created_address, reason, runtime.inner.machine().return_value()); + let (reason, maybe_address, return_data) = self.cleanup_for_create( + created_address, + reason, + runtime.inner.machine().return_value(), + caller, + ); (reason, maybe_address, return_data) } RuntimeKind::Call(code_address) => { @@ -509,8 +517,9 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu &mut self, init_code: &[u8], access_list: &[(H160, Vec)], + authorization_list: &[(U256, H160, U256, Option)], ) -> Result<(), ExitError> { - let transaction_cost = gasometer::create_transaction_cost(init_code, access_list); + let transaction_cost = gasometer::create_transaction_cost(init_code, access_list, authorization_list); let gasometer = &mut self.state.metadata_mut().gasometer; gasometer.record_transaction(transaction_cost) } @@ -538,7 +547,8 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu value: U256, init_code: Vec, gas_limit: u64, - access_list: Vec<(H160, Vec)>, // See EIP-2930 + access_list: Vec<(H160, Vec)>, // See EIP-2930 + authorization_list: Vec<(U256, H160, U256, Option)>, // See EIP-7702 ) -> (ExitReason, Vec) { event!(TransactCreate { caller, @@ -555,7 +565,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu } } - if let Err(e) = self.record_create_transaction_cost(&init_code, &access_list) { + if let Err(e) = self.record_create_transaction_cost(&init_code, &access_list, &authorization_list) { return emit_exit!(e.into(), Vec::new()); } self.initialize_with_access_list(access_list); @@ -572,7 +582,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu Capture::Trap(rt) => { let mut cs = Vec::with_capacity(DEFAULT_CALL_STACK_CAPACITY); cs.push(rt.0); - let (s, _, v) = self.execute_with_call_stack(&mut cs); + let (s, _, v) = self.execute_with_call_stack(&mut cs, None); emit_exit!(s, v) } } @@ -586,7 +596,8 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu init_code: Vec, salt: H256, gas_limit: u64, - access_list: Vec<(H160, Vec)>, // See EIP-2930 + access_list: Vec<(H160, Vec)>, // See EIP-2930 + authorization_list: Vec<(U256, H160, U256, Option)>, // See EIP-7702 ) -> (ExitReason, Vec) { event!(TransactCreate2 { caller, @@ -610,7 +621,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu } } - if let Err(e) = self.record_create_transaction_cost(&init_code, &access_list) { + if let Err(e) = self.record_create_transaction_cost(&init_code, &access_list, &authorization_list) { return emit_exit!(e.into(), Vec::new()); } self.initialize_with_access_list(access_list); @@ -631,7 +642,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu Capture::Trap(rt) => { let mut cs = Vec::with_capacity(DEFAULT_CALL_STACK_CAPACITY); cs.push(rt.0); - let (s, _, v) = self.execute_with_call_stack(&mut cs); + let (s, _, v) = self.execute_with_call_stack(&mut cs, None); emit_exit!(s, v) } } @@ -646,6 +657,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu init_code: Vec, gas_limit: u64, access_list: Vec<(H160, Vec)>, + authorization_list: Vec<(U256, H160, U256, Option)>, // See EIP-7702 ) -> (ExitReason, Vec) { event!(TransactCreate { caller, @@ -662,7 +674,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu } } - if let Err(e) = self.record_create_transaction_cost(&init_code, &access_list) { + if let Err(e) = self.record_create_transaction_cost(&init_code, &access_list, &authorization_list) { return emit_exit!(e.into(), Vec::new()); } self.initialize_with_access_list(access_list); @@ -679,7 +691,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu Capture::Trap(rt) => { let mut cs = Vec::with_capacity(DEFAULT_CALL_STACK_CAPACITY); cs.push(rt.0); - let (s, _, v) = self.execute_with_call_stack(&mut cs); + let (s, _, v) = self.execute_with_call_stack(&mut cs, None); emit_exit!(s, v) } } @@ -699,6 +711,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu data: Vec, gas_limit: u64, access_list: Vec<(H160, Vec)>, + authorization_list: Vec<(U256, H160, U256, Option)>, ) -> (ExitReason, Vec) { event!(TransactCall { caller, @@ -712,7 +725,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu return emit_exit!(e.into(), Vec::new()); } - let transaction_cost = gasometer::call_transaction_cost(&data, &access_list); + let transaction_cost = gasometer::call_transaction_cost(&data, &access_list, &authorization_list); let gasometer = &mut self.state.metadata_mut().gasometer; match gasometer.record_transaction(transaction_cost) { Ok(()) => (), @@ -765,7 +778,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu Capture::Trap(rt) => { let mut cs = Vec::with_capacity(DEFAULT_CALL_STACK_CAPACITY); cs.push(rt.0); - let (s, _, v) = self.execute_with_call_stack(&mut cs); + let (s, _, v) = self.execute_with_call_stack(&mut cs, Some(caller)); emit_exit!(s, v) } } @@ -891,6 +904,8 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu return Capture::Exit((e.into(), None, Vec::new())); } + self.state.set_created(address); + let after_gas = if take_l64 && self.config.call_l64_after_gas { if self.config.estimate { let initial_after_gas = self.state.metadata().gasometer.gas(); @@ -1111,6 +1126,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu created_address: H160, reason: ExitReason, return_data: Vec, + caller: Option, ) -> (ExitReason, Option, Vec) { fn check_first_byte(config: &Config, code: &[u8]) -> Result<(), ExitError> { if config.disallow_executable_format && Some(&Opcode::EOFMAGIC.as_u8()) == code.first() { @@ -1150,7 +1166,10 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> StackExecu return (e.into(), None, Vec::new()); } // Success requires storage to be collected successfully - self.state.set_code(address, out); + let set_code_result = self.state.set_code(address, out, caller); + if let Err(e) = set_code_result { + return (e.into(), None, Vec::new()); + } let exit_result = self.exit_substate(StackExitKind::Succeeded); if let Err(e) = exit_result { return (e.into(), None, Vec::new()); @@ -1257,6 +1276,10 @@ impl<'config, S: StackState<'config>, P: PrecompileSet> Handler for StackExecuto self.state.storage(address, index) } + fn transient_storage(&self, address: H160, index: H256) -> H256 { + self.state.transient_storage(address, index) + } + fn original_storage(&self, address: H160, index: H256) -> H256 { self.state.original_storage(address, index).unwrap_or_default() } @@ -1339,6 +1362,10 @@ impl<'config, S: StackState<'config>, P: PrecompileSet> Handler for StackExecuto Ok(()) } + fn set_transient_storage(&mut self, address: H160, index: H256, value: H256) { + self.state.set_transient_storage(address, index, value); + } + fn log(&mut self, address: H160, topics: Vec, data: Vec) -> Result<(), ExitError> { event!(Log { address, @@ -1358,13 +1385,23 @@ impl<'config, S: StackState<'config>, P: PrecompileSet> Handler for StackExecuto balance, }); - self.state.transfer(Transfer { - source: address, - target, - value: balance, - })?; - self.state.reset_balance(address); - self.state.set_deleted(address); + if self.config.has_eip_6780 && !self.state.created(address) { + if address != target { + self.state.transfer(Transfer { + source: address, + target, + value: balance, + })?; + } + } else { + self.state.transfer(Transfer { + source: address, + target, + value: balance, + })?; + self.state.reset_balance(address); + self.state.set_deleted(address); + } Ok(()) } @@ -1595,7 +1632,7 @@ impl<'config, S: StackState<'config>, P: PrecompileSet> PrecompileHandle // potentially cause a stack overflow if you're not careful. let mut call_stack = Vec::with_capacity(DEFAULT_CALL_STACK_CAPACITY); call_stack.push(rt.0); - let (reason, _, return_data) = self.executor.execute_with_call_stack(&mut call_stack); + let (reason, _, return_data) = self.executor.execute_with_call_stack(&mut call_stack, None); emit_exit!(reason, return_data) } } @@ -1648,6 +1685,11 @@ impl<'config, S: StackState<'config>, P: PrecompileSet> PrecompileHandle self.context } + /// Retrieve the address of the EOA that originated the transaction. + fn origin(&self) -> H160 { + self.executor.state.origin() + } + /// Is the precompile call is done statically. fn is_static(&self) -> bool { self.is_static @@ -1657,4 +1699,9 @@ impl<'config, S: StackState<'config>, P: PrecompileSet> PrecompileHandle fn gas_limit(&self) -> Option { self.gas_limit } + + /// Check if a given address is a contract being constructed + fn is_contract_being_constructed(&self, address: H160) -> bool { + self.executor.state.created(address) + } } diff --git a/modules/evm/src/tests.rs b/modules/evm/src/tests.rs index 1b0529d41..fee8df27f 100644 --- a/modules/evm/src/tests.rs +++ b/modules/evm/src/tests.rs @@ -160,6 +160,7 @@ fn should_create_and_call_contract() { 1000000, 1000000, vec![], + vec![], ::config(), ).unwrap(); assert_eq!(result.exit_reason, ExitReason::Succeed(ExitSucceed::Returned)); @@ -185,10 +186,11 @@ fn should_create_and_call_contract() { 1000000, 1000000, vec![], + vec![], ::config(), ).unwrap(); assert_eq!( - U256::from(result.value.as_slice()), + U256::from_big_endian(result.value.as_slice()), 6.into(), ); @@ -235,6 +237,7 @@ fn create_reverts_with_message() { 12_000_000, 12_000_000, vec![], + vec![], ::config(), ) .unwrap(); @@ -269,6 +272,7 @@ fn call_reverts_with_message() { 1000000, 1000000, vec![], + vec![], ::config(), ).unwrap(); @@ -291,6 +295,7 @@ fn call_reverts_with_message() { 1000000, 1000000, vec![], + vec![], ::config(), ).unwrap(); @@ -340,6 +345,7 @@ fn should_publish_payable_contract() { 1000000, 100000, vec![], + vec![], ::config(), ) .unwrap(); @@ -362,6 +368,7 @@ fn should_publish_payable_contract() { 100000, 100000, vec![], + vec![], ::config(), ) .unwrap(); @@ -429,6 +436,7 @@ fn should_transfer_from_contract() { 10000000, 10000000, vec![], + vec![], ::config(), ) .expect("create shouldn't fail"); @@ -457,6 +465,7 @@ fn should_transfer_from_contract() { 1000000, 1000000, vec![], + vec![], ::config(), ) .unwrap(); @@ -486,6 +495,7 @@ fn should_transfer_from_contract() { 1000000, 1000000, vec![], + vec![], ::config(), ) .unwrap(); @@ -515,6 +525,7 @@ fn should_transfer_from_contract() { 1000000, 1000000, vec![], + vec![], ::config(), ) .unwrap(); @@ -545,6 +556,7 @@ fn should_transfer_from_contract() { 1000000, 1000000, vec![], + vec![], ::config(), ) .unwrap(); @@ -574,12 +586,13 @@ fn should_transfer_from_contract() { 1000000, 1000000, vec![], + vec![], ::config(), ) .unwrap(); assert_eq!(result.exit_reason, ExitReason::Succeed(ExitSucceed::Returned)); assert_eq!( - U256::from(result.value.as_slice()), + U256::from_big_endian(result.value.as_slice()), U256::from(convert_decimals_to_evm(balance(charlie()))) ); }) @@ -610,6 +623,7 @@ fn contract_should_publish_contracts() { 1000000000, 1000000000, vec![], + vec![], ::config(), ) .unwrap(); @@ -639,6 +653,7 @@ fn contract_should_publish_contracts() { 1000000000, 1000000000, vec![], + vec![], ::config(), ) .unwrap(); @@ -688,6 +703,7 @@ fn contract_should_publish_contracts_without_payable() { 1000000000, 1000000000, vec![], + vec![], ::config(), ) .unwrap(); @@ -711,6 +727,7 @@ fn contract_should_publish_contracts_without_payable() { 1000000000, 1000000000, vec![], + vec![], ::config(), ) .unwrap(); @@ -756,6 +773,7 @@ fn publish_factory() { 2_000_000, 5000, vec![], + vec![], ::config(), ) .unwrap(); @@ -946,6 +964,7 @@ fn should_transfer_maintainer() { 12_000_000, 12_000_000, vec![], + vec![], ::config(), ) .unwrap(); @@ -1017,13 +1036,14 @@ fn should_publish() { 1000000, 1000000, vec![], + vec![], ::config(), ).unwrap(); assert_eq!(result.exit_reason, ExitReason::Succeed(ExitSucceed::Stopped)); assert_eq!(result.used_storage, 0); // create contract - let result = ::Runner::create(alice(), contract, 0, 21_000_000, 21_000_000, vec![],::config()).unwrap(); + let result = ::Runner::create(alice(), contract, 0, 21_000_000, 21_000_000, vec![], vec![], ::config()).unwrap(); let contract_address = result.value; assert_eq!(result.used_storage, 284); @@ -1046,6 +1066,7 @@ fn should_publish() { 1000000, 1000000, vec![], + vec![], ::config(), )); @@ -1080,6 +1101,7 @@ fn should_publish() { 1000000, 1000000, vec![], + vec![], ::config(), )); @@ -1105,6 +1127,7 @@ fn should_publish() { 1000000, 1000000, vec![], + vec![], ::config(), )); @@ -1135,7 +1158,7 @@ fn should_publish_free() { assert_ok!(EVM::enable_account_contract_development(&alice_account_id)); // create contract - let result = ::Runner::create(alice(), contract, 0, 21_000_000, 21_000_000, vec![], ::config()).unwrap(); + let result = ::Runner::create(alice(), contract, 0, 21_000_000, 21_000_000, vec![], vec![], ::config()).unwrap(); let contract_address = result.value; // multiply(2, 3) @@ -1176,6 +1199,7 @@ fn should_publish_free() { 1000000, 1000000, vec![], + vec![], ::config(), )); @@ -1266,6 +1290,7 @@ fn should_set_code() { 21_000_000, 21_000_000, vec![], + vec![], ::config(), ) .unwrap(); @@ -1418,6 +1443,7 @@ fn should_selfdestruct_without_schedule_task() { 1000000, 100000, vec![], + vec![], ::config(), ) .unwrap(); @@ -1517,6 +1543,7 @@ fn should_selfdestruct_with_schedule_task() { 1000000, 100000, vec![], + vec![], ::config(), ) .unwrap(); @@ -1558,7 +1585,7 @@ fn should_selfdestruct_with_schedule_task() { let mut input: Vec = from_hex("0x7b8d56e3").unwrap(); let mut buf = [0u8; 32]; - U256::from(i).to_big_endian(&mut buf); + U256::from(i).write_as_big_endian(&mut buf); input.append(&mut H256::from_slice(&buf).as_bytes().to_vec()); // key input.append(&mut H256::from_slice(&buf).as_bytes().to_vec()); // value @@ -1670,6 +1697,7 @@ fn storage_limit_should_work() { 200_000, 1000, vec![], + vec![], ::config(), ) .unwrap(); @@ -1731,6 +1759,7 @@ fn storage_limit_should_work() { 1000000000, 1000000000, vec![], + vec![], ::config(), ) .unwrap(); @@ -1785,6 +1814,7 @@ fn storage_limit_should_work() { 1000000000, 452, vec![], + vec![], ::config(), ) .unwrap(); @@ -1828,6 +1858,7 @@ fn evm_execute_mode_should_work() { 1000000000, 1000000000, vec![], + vec![], ::config(), ) .unwrap(); @@ -2039,6 +2070,7 @@ fn should_update_storage() { 500000, 100000, vec![], + vec![], ::config(), ) .unwrap(); @@ -2092,6 +2124,7 @@ fn should_update_storage() { 1000000, STORAGE_SIZE, vec![], + vec![], ::config(), ) .unwrap(); @@ -2111,6 +2144,7 @@ fn should_update_storage() { 1000000, STORAGE_SIZE, vec![], + vec![], ::config(), ) .unwrap(); @@ -2531,6 +2565,7 @@ fn strict_call_works() { 500000, 100000, vec![], + vec![], ::config(), ) .unwrap(); @@ -2567,7 +2602,7 @@ fn strict_call_works() { post_info: PostDispatchInfo { actual_weight: Some( Weight { - ref_time: 1491004635, + ref_time: 1482966087, proof_size: 11183, }, ), @@ -2621,7 +2656,7 @@ fn strict_call_works() { post_info: PostDispatchInfo { actual_weight: Some( Weight { - ref_time: 1490048337, + ref_time: 1482009789, proof_size: 11183, }, ), @@ -2721,7 +2756,8 @@ fn aggregated_storage_logs_works() { let cost_per_byte = convert_decimals_from_evm(StorageDepositPerByte::get()).unwrap_or_default(); // create contract - let result = ::Runner::create(alice(), contract, 0, 500000, 100000, vec![], config).unwrap(); + let result = + ::Runner::create(alice(), contract, 0, 500000, 100000, vec![], vec![], config).unwrap(); let contract_address = result.value; let alice_account_id = ::AddressMapping::get_account_id(&alice()); @@ -2735,6 +2771,7 @@ fn aggregated_storage_logs_works() { 30000, 0, vec![], + vec![], config, ) .unwrap(); @@ -3066,6 +3103,7 @@ fn tracer_works() { 500000, 100000, vec![], + vec![], ::config(), ).unwrap() }); diff --git a/modules/homa-validator-list/src/lib.rs b/modules/homa-validator-list/src/lib.rs index 4ff259a30..711d0e264 100644 --- a/modules/homa-validator-list/src/lib.rs +++ b/modules/homa-validator-list/src/lib.rs @@ -55,7 +55,9 @@ pub use weights::WeightInfo; pub const HOMA_VALIDATOR_LIST_ID: LockIdentifier = *b"aca/hmvl"; /// Insurance for a validator from a single address -#[derive(Encode, Decode, Clone, Copy, RuntimeDebug, Default, PartialEq, Eq, MaxEncodedLen, TypeInfo)] +#[derive( + Encode, Decode, DecodeWithMemTracking, Clone, Copy, RuntimeDebug, Default, PartialEq, Eq, MaxEncodedLen, TypeInfo, +)] pub struct Guarantee { /// The total tokens the validator has in insurance total: Balance, @@ -112,7 +114,7 @@ impl Guarantee { } /// Information on a assethub validator's slash -#[derive(Encode, Decode, Clone, RuntimeDebug, Eq, PartialEq, MaxEncodedLen, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, RuntimeDebug, Eq, PartialEq, MaxEncodedLen, TypeInfo)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct SlashInfo { /// Address of a validator on the assethub @@ -122,7 +124,9 @@ pub struct SlashInfo { } /// Validator insurance and frozen status -#[derive(Encode, Decode, Clone, Copy, RuntimeDebug, Default, MaxEncodedLen, TypeInfo, PartialEq)] +#[derive( + Encode, Decode, DecodeWithMemTracking, Clone, Copy, RuntimeDebug, Default, MaxEncodedLen, TypeInfo, PartialEq, +)] pub struct ValidatorBacking { /// Total insurance from all guarantors total_insurance: Balance, diff --git a/modules/homa-validator-list/src/mock.rs b/modules/homa-validator-list/src/mock.rs index bf84f2999..dfda65b5f 100644 --- a/modules/homa-validator-list/src/mock.rs +++ b/modules/homa-validator-list/src/mock.rs @@ -89,6 +89,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_types! { diff --git a/modules/homa/src/lib.rs b/modules/homa/src/lib.rs index 3e70ecde9..3883e90c7 100644 --- a/modules/homa/src/lib.rs +++ b/modules/homa/src/lib.rs @@ -63,7 +63,7 @@ pub mod module { } /// Just a Balance/BlockNumber tuple to encode when a chunk of funds will be unlocked. - #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] + #[derive(PartialEq, Eq, Clone, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] pub struct UnlockChunk { /// Amount of funds to be unlocked. #[codec(compact)] diff --git a/modules/homa/src/mock.rs b/modules/homa/src/mock.rs index 2a52ddfbd..1b39a4f2b 100644 --- a/modules/homa/src/mock.rs +++ b/modules/homa/src/mock.rs @@ -31,7 +31,7 @@ use orml_traits::parameter_type_with_key; use primitives::{Amount, TokenSymbol}; use sp_core::H160; use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage}; -use xcm::v4::prelude::*; +use xcm::v5::prelude::*; pub type AccountId = AccountId32; pub type BlockNumber = u64; @@ -134,6 +134,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } pub type AdaptedBasicCurrency = module_currencies::BasicCurrencyAdapter; @@ -265,6 +266,7 @@ impl ExtBuilder { .filter(|(_, currency_id, _)| *currency_id == NATIVE_CURRENCY_ID) .map(|(account_id, _, initial_balance)| (account_id, initial_balance)) .collect::>(), + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/honzon-bridge/src/mock.rs b/modules/honzon-bridge/src/mock.rs index 2136087e1..665958261 100644 --- a/modules/honzon-bridge/src/mock.rs +++ b/modules/honzon-bridge/src/mock.rs @@ -94,6 +94,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } impl pallet_timestamp::Config for Runtime { @@ -243,7 +244,7 @@ pub fn deploy_contracts() { ], data: { let mut buf = [0u8; 32]; - U256::from(ALICE_BALANCE).to_big_endian(&mut buf); + U256::from(ALICE_BALANCE).write_as_big_endian(&mut buf); H256::from_slice(&buf).as_bytes().to_vec() }, }], @@ -275,6 +276,7 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: self.native_balances, + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/honzon/src/mock.rs b/modules/honzon/src/mock.rs index f58806af2..9c016226e 100644 --- a/modules/honzon/src/mock.rs +++ b/modules/honzon/src/mock.rs @@ -26,7 +26,7 @@ use frame_support::{ traits::{ConstU128, ConstU32, ConstU64, Nothing}, PalletId, }; -use frame_system::{offchain::SendTransactionTypes, EnsureSignedBy}; +use frame_system::EnsureSignedBy; use module_cdp_engine::CollateralCurrencyIds; use module_support::{ mocks::{MockStableAsset, TestRandomness}, @@ -39,7 +39,6 @@ use primitives::{ }; use sp_core::crypto::AccountId32; use sp_runtime::{ - testing::TestXt, traits::{AccountIdConversion, IdentityLookup, One as OneT}, BuildStorage, FixedPointNumber, }; @@ -103,6 +102,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } pub type AdaptedBasicCurrency = orml_currencies::BasicCurrencyAdapter; @@ -315,6 +315,7 @@ impl module_cdp_engine::Config for Runtime { type WeightInfo = (); } +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; impl Config for Runtime { @@ -342,15 +343,21 @@ construct_runtime!( } ); -/// An extrinsic type used for tests. -pub type Extrinsic = TestXt; +impl frame_system::offchain::CreateTransactionBase for Runtime +where + RuntimeCall: From, +{ + type RuntimeCall = RuntimeCall; + type Extrinsic = UncheckedExtrinsic; +} -impl SendTransactionTypes for Runtime +impl frame_system::offchain::CreateInherent for Runtime where - RuntimeCall: From, + RuntimeCall: From, { - type OverarchingCall = RuntimeCall; - type Extrinsic = Extrinsic; + fn create_inherent(call: Self::RuntimeCall) -> Self::Extrinsic { + UncheckedExtrinsic::new_bare(call) + } } pub struct ExtBuilder { @@ -380,6 +387,7 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: self.endowed_native, + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/idle-scheduler/src/mock.rs b/modules/idle-scheduler/src/mock.rs index b025f0221..dd682967d 100644 --- a/modules/idle-scheduler/src/mock.rs +++ b/modules/idle-scheduler/src/mock.rs @@ -28,7 +28,7 @@ use primitives::{define_combined_task, task::TaskResult, Nonce}; use sp_runtime::BuildStorage; use super::*; -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use scale_info::TypeInfo; pub const BASE_WEIGHT: Weight = Weight::from_parts(1_000_000, 0); @@ -69,7 +69,7 @@ impl module_idle_scheduler::Config for Runtime { } // Mock dispatachable tasks -#[derive(Clone, Debug, PartialEq, Encode, Decode, TypeInfo)] +#[derive(Clone, Debug, PartialEq, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub enum BalancesTask { #[codec(index = 0)] OnIdle, @@ -84,7 +84,7 @@ impl DispatchableTask for BalancesTask { } } -#[derive(Clone, Debug, PartialEq, Encode, Decode, TypeInfo)] +#[derive(Clone, Debug, PartialEq, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub enum HomaLiteTask { #[codec(index = 0)] OnIdle, @@ -100,7 +100,7 @@ impl DispatchableTask for HomaLiteTask { } define_combined_task! { - #[derive(Clone, Debug, PartialEq, Encode, Decode, TypeInfo)] + #[derive(Clone, Debug, PartialEq, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub enum ScheduledTasks { BalancesTask(BalancesTask), HomaLiteTask(HomaLiteTask), diff --git a/modules/liquid-crowdloan/src/mock.rs b/modules/liquid-crowdloan/src/mock.rs index 99c51229c..705a11a76 100644 --- a/modules/liquid-crowdloan/src/mock.rs +++ b/modules/liquid-crowdloan/src/mock.rs @@ -87,6 +87,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } pub type AdaptedBasicCurrency = module_currencies::BasicCurrencyAdapter; @@ -116,7 +117,6 @@ impl module_currencies::Config for Runtime { parameter_types! { pub static TransferRecord: Option<(AccountId, AccountId, Balance)> = None; - pub static TransferOk: bool = true; } ord_parameter_types! { @@ -147,15 +147,11 @@ construct_runtime!( pub struct ExtBuilder { balances: Vec<(AccountId, CurrencyId, Balance)>, - transfer_ok: bool, } impl Default for ExtBuilder { fn default() -> Self { - Self { - balances: vec![], - transfer_ok: true, - } + Self { balances: vec![] } } } @@ -165,14 +161,8 @@ impl ExtBuilder { self } - pub fn transfer_ok(mut self, transfer_ok: bool) -> Self { - self.transfer_ok = transfer_ok; - self - } - pub fn build(self) -> sp_io::TestExternalities { TransferRecord::mutate(|v| *v = None); - TransferOk::mutate(|v| *v = self.transfer_ok); let mut t = frame_system::GenesisConfig::::default() .build_storage() @@ -186,6 +176,7 @@ impl ExtBuilder { .filter(|(_, currency_id, _)| *currency_id == ACA) .map(|(account_id, _, initial_balance)| (account_id, initial_balance)) .collect::>(), + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/liquid-crowdloan/src/tests.rs b/modules/liquid-crowdloan/src/tests.rs index 133d0321b..49a5da298 100644 --- a/modules/liquid-crowdloan/src/tests.rs +++ b/modules/liquid-crowdloan/src/tests.rs @@ -20,7 +20,6 @@ #![cfg(test)] -use super::*; use crate::mock::*; use frame_support::{assert_err, assert_ok}; use orml_traits::MultiCurrency; diff --git a/modules/loans/src/mock.rs b/modules/loans/src/mock.rs index fb1e28be7..b9f761088 100644 --- a/modules/loans/src/mock.rs +++ b/modules/loans/src/mock.rs @@ -93,6 +93,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_types! { diff --git a/modules/nft/src/benchmarking.rs b/modules/nft/src/benchmarking.rs index 205721c4b..00498ed9c 100644 --- a/modules/nft/src/benchmarking.rs +++ b/modules/nft/src/benchmarking.rs @@ -160,7 +160,7 @@ mod mock { traits::{ConstU128, ConstU32, Contains, InstanceFilter}, PalletId, }; - use parity_scale_codec::{Decode, Encode}; + use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use sp_core::crypto::AccountId32; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, @@ -190,6 +190,7 @@ mod mock { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } impl pallet_utility::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -197,7 +198,20 @@ mod mock { type PalletsOrigin = OriginCaller; type WeightInfo = (); } - #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] + #[derive( + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + DecodeWithMemTracking, + RuntimeDebug, + MaxEncodedLen, + TypeInfo, + )] pub enum ProxyType { Any, JustTransfer, @@ -247,6 +261,7 @@ mod mock { type MaxPending = ConstU32<2>; type AnnouncementDepositBase = ConstU128<1>; type AnnouncementDepositFactor = ConstU128<1>; + type BlockNumberProvider = System; } parameter_types! { diff --git a/modules/nft/src/lib.rs b/modules/nft/src/lib.rs index b076cf62b..af63c7389 100644 --- a/modules/nft/src/lib.rs +++ b/modules/nft/src/lib.rs @@ -55,7 +55,9 @@ pub mod weights; pub use module::*; pub use weights::WeightInfo; -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo, Serialize, Deserialize)] +#[derive( + Encode, Decode, DecodeWithMemTracking, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo, Serialize, Deserialize, +)] pub struct ClassData { /// Deposit reserved to create token class pub deposit: Balance, @@ -65,7 +67,9 @@ pub struct ClassData { pub attributes: Attributes, } -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo, Serialize, Deserialize)] +#[derive( + Encode, Decode, DecodeWithMemTracking, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo, Serialize, Deserialize, +)] pub struct TokenData { /// Deposit reserved to create token pub deposit: Balance, diff --git a/modules/nft/src/mock.rs b/modules/nft/src/mock.rs index 00197bd43..0b8d29fc6 100644 --- a/modules/nft/src/mock.rs +++ b/modules/nft/src/mock.rs @@ -23,12 +23,12 @@ use super::*; use crate as nft; use frame_support::{ construct_runtime, derive_impl, ord_parameter_types, parameter_types, - traits::{ConstU128, ConstU32, Contains, InstanceFilter, Nothing}, + traits::{ConstU128, ConstU32, InstanceFilter, Nothing}, }; use frame_system::EnsureSignedBy; use module_support::mocks::MockAddressMapping; use orml_traits::parameter_type_with_key; -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use primitives::{Amount, Balance, CurrencyId, ReserveIdentifier, TokenSymbol}; use sp_core::{crypto::AccountId32, H160}; use sp_runtime::{ @@ -60,7 +60,9 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } + impl pallet_utility::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; @@ -68,7 +70,20 @@ impl pallet_utility::Config for Runtime { type WeightInfo = (); } -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive( + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + DecodeWithMemTracking, + RuntimeDebug, + MaxEncodedLen, + TypeInfo, +)] pub enum ProxyType { Any, JustTransfer, @@ -94,17 +109,6 @@ impl InstanceFilter for ProxyType { self == &ProxyType::Any || self == o } } -pub struct BaseFilter; -impl Contains for BaseFilter { - fn contains(c: &RuntimeCall) -> bool { - match *c { - // Remark is used as a no-op call in the benchmarking - RuntimeCall::System(SystemCall::remark { .. }) => true, - RuntimeCall::System(_) => false, - _ => true, - } - } -} impl pallet_proxy::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -119,6 +123,7 @@ impl pallet_proxy::Config for Runtime { type MaxPending = ConstU32<2>; type AnnouncementDepositBase = ConstU128<1>; type AnnouncementDepositFactor = ConstU128<1>; + type BlockNumberProvider = System; } pub type NativeCurrency = module_currencies::BasicCurrencyAdapter; @@ -195,8 +200,6 @@ impl orml_nft::Config for Runtime { type MaxTokenMetadata = ConstU32<1024>; } -use frame_system::Call as SystemCall; - type Block = frame_system::mocking::MockBlock; construct_runtime!( @@ -234,6 +237,7 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: vec![(ALICE, 100000)], + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/nominees-election/src/mock.rs b/modules/nominees-election/src/mock.rs index 2d801141f..b2acb6edd 100644 --- a/modules/nominees-election/src/mock.rs +++ b/modules/nominees-election/src/mock.rs @@ -102,6 +102,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_types! { diff --git a/modules/session-manager/src/mock.rs b/modules/session-manager/src/mock.rs index 24f0c721c..ab36c895f 100644 --- a/modules/session-manager/src/mock.rs +++ b/modules/session-manager/src/mock.rs @@ -70,6 +70,7 @@ impl pallet_session::Config for Runtime { type SessionHandler = TestSessionHandler; type Keys = MockSessionKeys; type WeightInfo = (); + type DisablingStrategy = (); } impl session_manager::Config for Runtime { diff --git a/modules/support/src/bounded.rs b/modules/support/src/bounded.rs index de5077432..2893f1c87 100644 --- a/modules/support/src/bounded.rs +++ b/modules/support/src/bounded.rs @@ -19,7 +19,7 @@ use super::Rate; use frame_support::traits::Get; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use primitives::{Balance, BlockNumber}; use scale_info::TypeInfo; use sp_runtime::{ @@ -46,13 +46,16 @@ pub enum Error { #[cfg_attr(feature = "std", derive(Serialize), serde(transparent))] #[derive(Encode, PartialEq, Eq, PartialOrd, Ord, Copy, Clone, TypeInfo, MaxEncodedLen, RuntimeDebug)] #[scale_info(skip_type_params(Range, MaxChangeAbs))] -pub struct BoundedType( +pub struct BoundedType( T, #[cfg_attr(feature = "std", serde(skip_serializing))] PhantomData<(Range, MaxChangeAbs)>, ); -impl, MaxChangeAbs: Get> Decode - for BoundedType +impl< + T: Encode + Decode + DecodeWithMemTracking + CheckedSub + PartialOrd, + Range: Get<(T, T)>, + MaxChangeAbs: Get, + > Decode for BoundedType { fn decode(input: &mut I) -> Result { let inner = T::decode(input)?; @@ -60,10 +63,18 @@ impl, MaxChange } } +impl< + T: Encode + Decode + DecodeWithMemTracking + CheckedSub + PartialOrd, + Range: Get<(T, T)>, + MaxChangeAbs: Get, + > DecodeWithMemTracking for BoundedType +{ +} + #[cfg(feature = "std")] impl<'de, T, Range, MaxChangeAbs> Deserialize<'de> for BoundedType where - T: Encode + Decode + CheckedSub + PartialOrd + Deserialize<'de>, + T: Encode + Decode + DecodeWithMemTracking + CheckedSub + PartialOrd + Deserialize<'de>, Range: Get<(T, T)>, MaxChangeAbs: Get, { @@ -76,7 +87,7 @@ where } } -impl, MaxChangeAbs: Get> Default +impl, MaxChangeAbs: Get> Default for BoundedType { fn default() -> Self { @@ -87,7 +98,7 @@ impl, MaxChangeAbs: Get> Def impl BoundedType where - T: Encode + Decode + CheckedSub + PartialOrd, + T: Encode + Decode + DecodeWithMemTracking + CheckedSub + PartialOrd, Range: Get<(T, T)>, MaxChangeAbs: Get, { diff --git a/modules/support/src/dex.rs b/modules/support/src/dex.rs index caed186b4..3c1f59cd6 100644 --- a/modules/support/src/dex.rs +++ b/modules/support/src/dex.rs @@ -18,7 +18,7 @@ use frame_support::{ensure, traits::Get}; use nutsfinance_stable_asset::{PoolTokenIndex, StableAssetPoolId}; -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use scale_info::TypeInfo; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; @@ -26,7 +26,7 @@ use sp_core::H160; use sp_runtime::{DispatchError, DispatchResult, RuntimeDebug}; use sp_std::{cmp::PartialEq, prelude::*, result::Result}; -#[derive(RuntimeDebug, Encode, Decode, Clone, Copy, PartialEq, Eq, TypeInfo)] +#[derive(RuntimeDebug, Encode, Decode, DecodeWithMemTracking, Clone, Copy, PartialEq, Eq, TypeInfo)] pub enum SwapLimit { /// use exact amount supply amount to swap. (exact_supply_amount, minimum_target_amount) ExactSupply(Balance, Balance), @@ -34,7 +34,7 @@ pub enum SwapLimit { ExactTarget(Balance, Balance), } -#[derive(Encode, Decode, Eq, PartialEq, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub enum AggregatedSwapPath { Dex(Vec), diff --git a/modules/support/src/homa.rs b/modules/support/src/homa.rs index 5a7f06d13..e861af3ac 100644 --- a/modules/support/src/homa.rs +++ b/modules/support/src/homa.rs @@ -19,7 +19,7 @@ use crate::{ExchangeRate, Rate}; use sp_runtime::DispatchResult; use sp_std::{fmt::Debug, vec::Vec}; -use xcm::v4::prelude::*; +use xcm::v5::prelude::*; pub trait HomaSubAccountXcm { type NomineeId: Debug + Clone + Ord; diff --git a/modules/support/src/incentives.rs b/modules/support/src/incentives.rs index 36e55805b..48709d8be 100644 --- a/modules/support/src/incentives.rs +++ b/modules/support/src/incentives.rs @@ -17,14 +17,14 @@ // along with this program. If not, see . use crate::Rate; -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use primitives::CurrencyId; use scale_info::TypeInfo; use sp_runtime::{DispatchResult, RuntimeDebug}; use sp_std::prelude::*; /// PoolId for various rewards pools -#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub enum PoolId { /// Rewards and shares pool for users who open CDP(CollateralCurrencyId) Loans(CurrencyId), diff --git a/modules/transaction-pause/src/mock.rs b/modules/transaction-pause/src/mock.rs index 2ca699be4..ca714f3af 100644 --- a/modules/transaction-pause/src/mock.rs +++ b/modules/transaction-pause/src/mock.rs @@ -60,6 +60,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_type_with_key! { diff --git a/modules/transaction-payment/src/lib.rs b/modules/transaction-payment/src/lib.rs index 3253edf4d..d5f9cead1 100644 --- a/modules/transaction-payment/src/lib.rs +++ b/modules/transaction-payment/src/lib.rs @@ -48,16 +48,14 @@ use primitives::{Balance, CurrencyId, Multiplier, ReserveIdentifier}; use scale_info::TypeInfo; use sp_runtime::{ traits::{ - AccountIdConversion, Convert, DispatchInfoOf, Dispatchable, One, PostDispatchInfoOf, SaturatedConversion, - Saturating, SignedExtension, Zero, - }, - transaction_validity::{ - InvalidTransaction, TransactionPriority, TransactionValidity, TransactionValidityError, ValidTransaction, + AccountIdConversion, Convert, DispatchInfoOf, DispatchOriginOf, Dispatchable, One, PostDispatchInfoOf, + SaturatedConversion, Saturating, TransactionExtension, Zero, }, + transaction_validity::{InvalidTransaction, TransactionPriority, TransactionValidityError, ValidTransaction}, FixedPointNumber, FixedPointOperand, Percent, Perquintill, }; use sp_std::prelude::*; -use xcm::v4::prelude::Location; +use xcm::v5::prelude::Location; const LOG_TARGET: &str = "transaction-payment"; @@ -271,7 +269,7 @@ pub mod module { pub const RESERVE_ID: ReserveIdentifier = ReserveIdentifier::TransactionPayment; pub const DEPOSIT_ID: ReserveIdentifier = ReserveIdentifier::TransactionPaymentDeposit; - #[derive(Encode, Decode, Clone, PartialEq, RuntimeDebug, TypeInfo)] + #[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, RuntimeDebug, TypeInfo)] pub enum ChargeFeeMethod { FeeCurrency(CurrencyId), FeeAggregatedPath(Vec>), @@ -625,7 +623,7 @@ pub mod module { #[pallet::call_index(3)] #[pallet::weight({ let dispatch_info = call.get_dispatch_info(); - (T::WeightInfo::with_fee_path().saturating_add(dispatch_info.weight), dispatch_info.class,) + (T::WeightInfo::with_fee_path().saturating_add(dispatch_info.call_weight), dispatch_info.class,) })] pub fn with_fee_path( origin: OriginFor, @@ -641,7 +639,7 @@ pub mod module { #[pallet::call_index(4)] #[pallet::weight({ let dispatch_info = call.get_dispatch_info(); - (T::WeightInfo::with_fee_currency().saturating_add(dispatch_info.weight), dispatch_info.class,) + (T::WeightInfo::with_fee_currency().saturating_add(dispatch_info.call_weight), dispatch_info.class,) })] pub fn with_fee_currency( origin: OriginFor, @@ -660,7 +658,7 @@ pub mod module { #[pallet::call_index(6)] #[pallet::weight({ let dispatch_info = call.get_dispatch_info(); - (T::WeightInfo::with_fee_aggregated_path().saturating_add(dispatch_info.weight), dispatch_info.class,) + (T::WeightInfo::with_fee_aggregated_path().saturating_add(dispatch_info.call_weight), dispatch_info.class,) })] pub fn with_fee_aggregated_path( origin: OriginFor, @@ -686,7 +684,7 @@ where /// /// All dispatchables must be annotated with weight and will have some /// fee info. This function always returns. - pub fn query_info( + pub fn query_info( unchecked_extrinsic: Extrinsic, len: u32, ) -> RuntimeDispatchInfo> @@ -702,23 +700,40 @@ where // potential gain in the future. let dispatch_info = ::get_dispatch_info(&unchecked_extrinsic); - let partial_fee = Self::compute_fee(len, &dispatch_info, 0u32.into()); - let DispatchInfo { weight, class, .. } = dispatch_info; + let partial_fee = if unchecked_extrinsic.is_bare() { + // Bare extrinsics have no partial fee. + 0u32.into() + } else { + Self::compute_fee(len, &dispatch_info, 0u32.into()) + }; + + let DispatchInfo { class, .. } = dispatch_info; RuntimeDispatchInfo { - weight, + weight: dispatch_info.total_weight(), class, partial_fee, } } /// Query the detailed fee of a given `call`. - pub fn query_fee_details( + pub fn query_fee_details( unchecked_extrinsic: Extrinsic, len: u32, ) -> FeeDetails> { let dispatch_info = ::get_dispatch_info(&unchecked_extrinsic); - Self::compute_fee_details(len, &dispatch_info, 0u32.into()) + + let tip = 0u32.into(); + + if unchecked_extrinsic.is_bare() { + // Bare extrinsics have no inclusion fee. + FeeDetails { + inclusion_fee: None, + tip, + } + } else { + Self::compute_fee_details(len, &dispatch_info, tip) + } } /// Compute the fee details for a particular transaction. @@ -727,7 +742,7 @@ where info: &DispatchInfoOf>, tip: PalletBalanceOf, ) -> FeeDetails> { - Self::compute_fee_raw(len, info.weight, tip, info.pays_fee, info.class) + Self::compute_fee_raw(len, info.total_weight(), tip, info.pays_fee, info.class) } /// Compute the final fee value for a particular transaction. @@ -1306,7 +1321,7 @@ where /// /// Operational transactions will receive an additional priority bump, so that they are normally /// considered before regular transactions. -#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] pub struct ChargeTransactionPayment(#[codec(compact)] pub PalletBalanceOf); @@ -1321,6 +1336,95 @@ impl sp_std::fmt::Debug for ChargeTransactionPayment } } +/// The info passed between the validate and prepare steps for the `ChargeAssetTxPayment` extension. +#[derive(RuntimeDebugNoBound)] +pub enum Val { + Charge { + tip: PalletBalanceOf, + // who paid the fee + who: T::AccountId, + // transaction fee + fee: PalletBalanceOf, + }, + NoCharge, +} + +/// The info passed between the prepare and post-dispatch steps for the `ChargeAssetTxPayment` +/// extension. +pub enum Pre { + Charge { + tip: PalletBalanceOf, + // who paid the fee + who: T::AccountId, + // imbalance resulting from withdrawing the fee + imbalance: NegativeImbalanceOf, + // transaction fee includes surplus + fee: PalletBalanceOf, + // surplus + surplus: PalletBalanceOf, + }, + NoCharge { + // weight initially estimated by the extension, to be refunded + refund: Weight, + }, +} + +impl core::fmt::Debug for Pre { + #[cfg(feature = "std")] + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + match self { + Pre::Charge { + tip, + who, + imbalance: _, + fee, + surplus, + } => { + write!( + f, + "Charge {{ {tip:?}, {who:?}, imbalance: , {fee:?}, {surplus:?} }}" + ) + } + Pre::NoCharge { refund } => write!(f, "NoCharge {{ refund: {:?} }}", refund), + } + } + + #[cfg(not(feature = "std"))] + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.write_str("") + } +} + +impl Pre { + pub fn tip(&self) -> Option<&PalletBalanceOf> { + match self { + Pre::Charge { tip, .. } => Some(tip), + Pre::NoCharge { .. } => None, + } + } + + pub fn imbalance(&self) -> Option<&NegativeImbalanceOf> { + match self { + Pre::Charge { imbalance, .. } => Some(imbalance), + Pre::NoCharge { .. } => None, + } + } + + pub fn fee(&self) -> Option<&PalletBalanceOf> { + match self { + Pre::Charge { fee, .. } => Some(fee), + Pre::NoCharge { .. } => None, + } + } + + pub fn surplus(&self) -> Option<&PalletBalanceOf> { + match self { + Pre::Charge { surplus, .. } => Some(surplus), + Pre::NoCharge { .. } => None, + } + } +} + impl ChargeTransactionPayment where PalletBalanceOf: Send + Sync + FixedPointOperand, @@ -1334,23 +1438,22 @@ where &self, who: &T::AccountId, call: &CallOf, - info: &DispatchInfoOf>, - len: usize, + _info: &DispatchInfoOf>, + fee: PalletBalanceOf, ) -> Result< ( PalletBalanceOf, - Option>, + NegativeImbalanceOf, PalletBalanceOf, T::AccountId, ), TransactionValidityError, > { let tip = self.0; - let fee = Pallet::::compute_fee(len as u32, info, tip); // Only mess with balances if fee is not zero. if fee.is_zero() { - return Ok((fee, None, 0, who.clone())); + return Ok((fee, Default::default(), 0, who.clone())); } let reason = if tip.is_zero() { @@ -1374,11 +1477,24 @@ where // withdraw native currency as fee, also consider surplus when swap from dex or pool. match ::Currency::withdraw(&payer, fee + fee_surplus, reason, ExistenceRequirement::KeepAlive) { - Ok(imbalance) => Ok((fee + fee_surplus, Some(imbalance), fee_surplus, payer)), + Ok(imbalance) => Ok((fee + fee_surplus, imbalance, fee_surplus, payer)), Err(_) => Err(InvalidTransaction::Payment.into()), } } + fn can_withdraw_fee( + &self, + _who: &T::AccountId, + _call: &CallOf, + info: &DispatchInfoOf>, + len: usize, + ) -> Result, TransactionValidityError> { + let tip = self.0; + let fee = Pallet::::compute_fee(len as u32, info, tip); + + Ok(fee) + } + /// Get an appropriate priority for a transaction with the given `DispatchInfo`, encoded length /// and user-included tip. /// @@ -1405,7 +1521,7 @@ where // TODO: Take into account all dimensions of weight let max_block_weight = max_block_weight.ref_time(); - let info_weight = info.weight.ref_time(); + let info_weight = info.total_weight().ref_time(); let bounded_weight = info_weight.clamp(1, max_block_weight); let bounded_length = (len as u64).clamp(1, max_block_length); @@ -1463,114 +1579,159 @@ where } } -impl SignedExtension for ChargeTransactionPayment +impl TransactionExtension> for ChargeTransactionPayment where PalletBalanceOf: Send + Sync + From + FixedPointOperand, { const IDENTIFIER: &'static str = "ChargeTransactionPayment"; - type AccountId = T::AccountId; - type Call = CallOf; - type AdditionalSigned = (); - type Pre = ( - PalletBalanceOf, - Self::AccountId, - Option>, - PalletBalanceOf, // fee includes surplus - PalletBalanceOf, // surplus - ); - - fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { - Ok(()) + type Implicit = (); + type Val = Val; + type Pre = Pre; + + fn weight(&self, _: &CallOf) -> Weight { + // TODO: impl charge_transaction_payment + Weight::zero() } fn validate( &self, - who: &Self::AccountId, - call: &Self::Call, - info: &DispatchInfoOf, + origin: DispatchOriginOf>, + call: &CallOf, + info: &DispatchInfoOf>, len: usize, - ) -> TransactionValidity { - let (final_fee, _, _, _) = self.withdraw_fee(who, call, info, len)?; + _self_implicit: Self::Implicit, + _inherited_implication: &impl Encode, + _source: TransactionSource, + ) -> Result< + ( + ValidTransaction, + Self::Val, + <::RuntimeCall as Dispatchable>::RuntimeOrigin, + ), + TransactionValidityError, + > { + let Ok(who) = frame_system::ensure_signed(origin.clone()) else { + return Ok((ValidTransaction::default(), Val::NoCharge, origin)); + }; + + let final_fee = self.can_withdraw_fee(&who, call, info, len)?; let tip = self.0; - Ok(ValidTransaction { - priority: Self::get_priority(info, len, tip, final_fee), - ..Default::default() - }) + + Ok(( + ValidTransaction { + priority: Self::get_priority(info, len, tip, final_fee), + ..Default::default() + }, + Val::Charge { + tip: self.0, + who, + fee: final_fee, + }, + origin, + )) } - fn pre_dispatch( + fn prepare( self, - who: &Self::AccountId, - call: &Self::Call, - info: &DispatchInfoOf, - len: usize, + val: Self::Val, + _origin: &DispatchOriginOf>, + call: &CallOf, + info: &DispatchInfoOf>, + _len: usize, ) -> Result { - let (fee, imbalance, surplus, payer) = self.withdraw_fee(who, call, info, len)?; - Ok((self.0, payer, imbalance, fee, surplus)) + match val { + Val::Charge { tip, who, fee } => { + // Mutating call to `withdraw_fee` to actually charge for the transaction. + let (fee, imbalance, surplus, payer) = self.withdraw_fee(&who, call, info, fee)?; + Ok(Pre::Charge { + tip, + who: payer, + imbalance, + fee, + surplus, + }) + } + Val::NoCharge => Ok(Pre::NoCharge { + refund: self.weight(call), + }), + } } - fn post_dispatch( - pre: Option, - info: &DispatchInfoOf, - post_info: &PostDispatchInfoOf, + fn post_dispatch_details( + pre: Self::Pre, + info: &DispatchInfoOf>, + post_info: &PostDispatchInfoOf>, len: usize, _result: &DispatchResult, - ) -> Result<(), TransactionValidityError> { - if let Some((tip, who, Some(paid), fee, surplus)) = pre { - let actual_fee = Pallet::::compute_actual_fee(len as u32, info, post_info, tip); - let refund_fee = fee.saturating_sub(actual_fee); - let mut refund = refund_fee; - let mut actual_tip = tip; - - if !tip.is_zero() && !info.weight.is_zero() { - // tip_pre_weight * unspent_weight - let refund_tip = tip - .checked_div(info.weight.ref_time().saturated_into::>()) - .expect("checked is non-zero; qed") - .saturating_mul( - post_info - .calc_unspent(info) - .ref_time() - .saturated_into::>(), - ); - refund = refund_fee.saturating_add(refund_tip); - actual_tip = tip.saturating_sub(refund_tip); + ) -> Result { + let (tip, who, paid, fee, surplus) = match pre { + Pre::Charge { + tip, + who, + imbalance, + fee, + surplus, + } => (tip, who, imbalance, fee, surplus), + Pre::NoCharge { refund } => { + // No-op: Refund everything + return Ok(refund); } - // the refund surplus also need to return back to user - let rate = Ratio::saturating_from_rational(surplus, fee.saturating_sub(surplus)); - let actual_surplus = rate.saturating_mul_int(actual_fee); - refund = refund.saturating_sub(actual_surplus); - - let actual_payment = match ::Currency::deposit_into_existing(&who, refund) { - Ok(refund_imbalance) => { - // The refund cannot be larger than the up front paid max weight. - // `PostDispatchInfo::calc_unspent` guards against such a case. - match paid.offset(refund_imbalance) { - SameOrOther::Same(actual_payment) => actual_payment, - SameOrOther::None => Default::default(), - _ => return Err(InvalidTransaction::Payment.into()), - } + }; + + let actual_fee = Pallet::::compute_actual_fee(len as u32, info, post_info, tip); + let refund_fee = fee.saturating_sub(actual_fee); + let mut refund = refund_fee; + let mut actual_tip = tip; + + if !tip.is_zero() && !info.total_weight().is_zero() { + // tip_pre_weight * unspent_weight + let refund_tip = tip + .checked_div(info.total_weight().ref_time().saturated_into::>()) + .expect("checked is non-zero; qed") + .saturating_mul( + post_info + .calc_unspent(info) + .ref_time() + .saturated_into::>(), + ); + refund = refund_fee.saturating_add(refund_tip); + actual_tip = tip.saturating_sub(refund_tip); + } + // the refund surplus also need to return back to user + let rate = Ratio::saturating_from_rational(surplus, fee.saturating_sub(surplus)); + let actual_surplus = rate.saturating_mul_int(actual_fee); + refund = refund.saturating_sub(actual_surplus); + + let actual_payment = match ::Currency::deposit_into_existing(&who, refund) { + Ok(refund_imbalance) => { + // The refund cannot be larger than the up front paid max weight. + // `PostDispatchInfo::calc_unspent` guards against such a case. + match paid.offset(refund_imbalance) { + SameOrOther::Same(actual_payment) => actual_payment, + SameOrOther::None => Default::default(), + _ => return Err(InvalidTransaction::Payment.into()), } - // We do not recreate the account using the refund. The up front payment - // is gone in that case. - Err(_) => paid, - }; - let (tip, fee) = actual_payment.split(actual_tip); + } + // We do not recreate the account using the refund. The up front payment + // is gone in that case. + Err(_) => paid, + }; + let (tip, fee) = actual_payment.split(actual_tip); + + // distribute fee + ::OnTransactionPayment::on_unbalanceds(Some(fee).into_iter().chain(Some(tip))); - // distribute fee - ::OnTransactionPayment::on_unbalanceds(Some(fee).into_iter().chain(Some(tip))); + // reset OverrideChargeFeeMethod + OverrideChargeFeeMethod::::kill(); - // reset OverrideChargeFeeMethod - OverrideChargeFeeMethod::::kill(); + Pallet::::deposit_event(Event::::TransactionFeePaid { + who, + actual_fee, + actual_tip, + actual_surplus, + }); - Pallet::::deposit_event(Event::::TransactionFeePaid { - who, - actual_fee, - actual_tip, - actual_surplus, - }); - } - Ok(()) + Ok(Weight::zero()) } } diff --git a/modules/transaction-payment/src/mock.rs b/modules/transaction-payment/src/mock.rs index c6ce5dc1f..418129cc7 100644 --- a/modules/transaction-payment/src/mock.rs +++ b/modules/transaction-payment/src/mock.rs @@ -120,6 +120,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } pub type AdaptedBasicCurrency = module_currencies::BasicCurrencyAdapter; @@ -198,7 +199,7 @@ parameter_types! { pub struct DealWithFees; impl OnUnbalanced> for DealWithFees { - fn on_unbalanceds(mut fees_then_tips: impl Iterator>) { + fn on_unbalanceds(mut fees_then_tips: impl Iterator>) { if let Some(fees) = fees_then_tips.next() { FeeUnbalancedAmount::mutate(|a| *a += fees.peek()); if let Some(tips) = fees_then_tips.next() { @@ -370,6 +371,7 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: self.native_balances, + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/modules/transaction-payment/src/tests.rs b/modules/transaction-payment/src/tests.rs index 78ef54a90..6c80baf2e 100644 --- a/modules/transaction-payment/src/tests.rs +++ b/modules/transaction-payment/src/tests.rs @@ -37,10 +37,11 @@ use pallet_balances::ReserveData; use primitives::currency::*; use sp_io::TestExternalities; use sp_runtime::{ - testing::TestXt, - traits::{One, UniqueSaturatedInto}, + generic::UncheckedExtrinsic, + traits::{DispatchTransaction, One, UniqueSaturatedInto}, + transaction_validity::{InvalidTransaction, TransactionSource::External}, }; -use xcm::v4::prelude::*; +use xcm::v5::prelude::*; const CALL: ::RuntimeCall = RuntimeCall::Currencies(module_currencies::Call::transfer { @@ -53,13 +54,15 @@ const CALL2: ::RuntimeCall = RuntimeCall::Currencies(module_currencies::Call::transfer_native_currency { dest: BOB, amount: 12 }); const INFO: DispatchInfo = DispatchInfo { - weight: Weight::from_parts(1000, 0), + call_weight: Weight::from_parts(1000, 0), + extension_weight: Weight::zero(), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; const INFO2: DispatchInfo = DispatchInfo { - weight: Weight::from_parts(100, 0), + call_weight: Weight::from_parts(100, 0), + extension_weight: Weight::zero(), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; @@ -213,27 +216,30 @@ fn charges_fee_when_native_is_enough_but_cannot_keep_alive() { fee.unique_saturated_into(), )); assert_eq!(Currencies::free_balance(ACA, &ALICE), fee); - assert_noop!( - ChargeTransactionPayment::::from(0).validate(&ALICE, &CALL, &INFO, 5000), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare(Some(ALICE).into(), &CALL, &INFO, 5000, 0) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); // after charge fee, balance=fee-fee2=ED, equal to ED, keep alive let fee2 = 5000 * 2 + 990; let info = DispatchInfo { - weight: Weight::from_parts(990, 0), + call_weight: Weight::from_parts(990, 0), + extension_weight: Weight::zero(), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; let expect_priority = ChargeTransactionPayment::::get_priority(&info, 5000, fee2, fee2); assert_eq!(1000, expect_priority); - assert_eq!( - ChargeTransactionPayment::::from(0) - .validate(&ALICE, &CALL, &info, 5000) - .unwrap() - .priority, - 1 - ); + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(ALICE).into(), + &CALL, + &info, + 5000, + 0 + )); assert_eq!(Currencies::free_balance(ACA, &ALICE), Currencies::minimum_balance(ACA)); }); } @@ -243,23 +249,23 @@ fn charges_fee_when_validate_native_is_enough() { // Alice init 100000 ACA(native asset) builder_with_dex_and_fee_pool(false).execute_with(|| { let fee = 23 * 2 + 1000; // len * byte + weight - assert_eq!( - ChargeTransactionPayment::::from(0) - .validate(&ALICE, &CALL, &INFO, 23) - .unwrap() - .priority, - 1 - ); + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(ALICE).into(), + &CALL, + &INFO, + 23, + 0 + )); assert_eq!(Currencies::free_balance(ACA, &ALICE), 100000 - fee); let fee2 = 18 * 2 + 1000; // len * byte + weight - assert_eq!( - ChargeTransactionPayment::::from(0) - .validate(&ALICE, &CALL2, &INFO, 18) - .unwrap() - .priority, - 1 - ); + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(ALICE).into(), + &CALL2, + &INFO, + 18, + 0 + )); assert_eq!(Currencies::free_balance(ACA, &ALICE), 100000 - fee - fee2); }); } @@ -274,8 +280,10 @@ fn charges_fee_when_locked_transfer_not_enough() { assert_ok!(>::set_lock( [0u8; 8], ACA, &BOB, 1025 )); - assert_noop!( - ChargeTransactionPayment::::from(0).validate(&BOB, &CALL, &INFO, 12), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare(Some(BOB).into(), &CALL, &INFO, 12, 0) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); @@ -283,7 +291,13 @@ fn charges_fee_when_locked_transfer_not_enough() { assert_ok!(>::remove_lock( [0u8; 8], ACA, &BOB )); - assert_ok!(ChargeTransactionPayment::::from(0).validate(&BOB, &CALL, &INFO, 12)); + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(BOB).into(), + &CALL, + &INFO, + 12, + 0 + )); assert_eq!(Currencies::free_balance(ACA, &BOB), 2048 - fee); }); } @@ -293,15 +307,16 @@ fn pre_post_dispatch_and_refund_native_is_enough() { builder_with_dex_and_fee_pool(false).execute_with(|| { let fee = 23 * 2 + 1000; // len * byte + weight let pre = ChargeTransactionPayment::::from(0) - .pre_dispatch(&ALICE, &CALL, &INFO, 23) - .unwrap(); + .validate_and_prepare(Some(ALICE).into(), &CALL, &INFO, 23, 0) + .unwrap() + .0; assert_eq!(Currencies::free_balance(ACA, &ALICE), 100000 - fee); let actual_fee = TransactionPayment::compute_actual_fee(23, &INFO, &POST_INFO, 0); assert_eq!(actual_fee, 23 * 2 + 800); - assert_ok!(ChargeTransactionPayment::::post_dispatch( - Some(pre), + assert_ok!(ChargeTransactionPayment::::post_dispatch_details( + pre, &INFO, &POST_INFO, 23, @@ -327,13 +342,14 @@ fn pre_post_dispatch_and_refund_native_is_enough() { let tip: Balance = 5; let pre = ChargeTransactionPayment::::from(tip) - .pre_dispatch(&CHARLIE, &CALL, &INFO, 23) - .unwrap(); + .validate_and_prepare(Some(CHARLIE).into(), &CALL, &INFO, 23, 0) + .unwrap() + .0; assert_eq!(Currencies::free_balance(ACA, &CHARLIE), 100000 - fee - tip); let actual_fee = TransactionPayment::compute_actual_fee(23, &INFO, &POST_INFO, tip); assert_eq!(actual_fee, 23 * 2 + 800 + 5); - assert_ok!(ChargeTransactionPayment::::post_dispatch( - Some(pre), + assert_ok!(ChargeTransactionPayment::::post_dispatch_details( + pre, &INFO, &POST_INFO, 23, @@ -388,12 +404,16 @@ fn pre_post_dispatch_and_refund_with_fee_currency_call(token: CurrencyId, surplu assert_eq!(89000, aca_init); let pre = ChargeTransactionPayment::::from(0) - .pre_dispatch(&ALICE, &with_fee_currency_call(token), &INFO, 500) - .unwrap(); - assert_eq!(pre.2, Some(pallet_balances::NegativeImbalance::new(fee_surplus))); - assert_eq!(pre.3, fee_surplus); + .validate_and_prepare(Some(ALICE).into(), &with_fee_currency_call(token), &INFO, 500, 0) + .unwrap() + .0; + assert_eq!( + pre.imbalance(), + Some(&pallet_balances::NegativeImbalance::new(fee_surplus)) + ); + assert_eq!(pre.fee(), Some(&fee_surplus)); - // with_fee_currency will set OverrideChargeFeeMethod when pre_dispatch + // with_fee_currency will set OverrideChargeFeeMethod when validate_and_prepare assert_eq!( OverrideChargeFeeMethod::::get(), Some(ChargeFeeMethod::FeeCurrency(token)) @@ -420,15 +440,15 @@ fn pre_post_dispatch_and_refund_with_fee_currency_call(token: CurrencyId, surplu let actual_fee = TransactionPayment::compute_actual_fee(500, &INFO, &POST_INFO, 0); assert_eq!(actual_fee, 500 * 2 + 800); - assert_ok!(ChargeTransactionPayment::::post_dispatch( - Some(pre), + assert_ok!(ChargeTransactionPayment::::post_dispatch_details( + pre, &INFO, &POST_INFO, 500, &Ok(()) )); - // always clear OverrideChargeFeeMethod when post_dispatch + // always clear OverrideChargeFeeMethod when post_dispatch_details assert_eq!(OverrideChargeFeeMethod::::get(), None); let refund = 200; // 1000 - 800 @@ -467,12 +487,16 @@ fn pre_post_dispatch_and_refund_with_fee_currency_call(token: CurrencyId, surplu let token_transfer = token_rate.saturating_mul_int(fee_surplus); let pre = ChargeTransactionPayment::::from(tip) - .pre_dispatch(&CHARLIE, &with_fee_currency_call(token), &INFO, 500) - .unwrap(); - assert_eq!(pre.2, Some(pallet_balances::NegativeImbalance::new(fee_surplus))); - assert_eq!(pre.3, fee_surplus); + .validate_and_prepare(Some(CHARLIE).into(), &with_fee_currency_call(token), &INFO, 500, 0) + .unwrap() + .0; + assert_eq!( + pre.imbalance(), + Some(&pallet_balances::NegativeImbalance::new(fee_surplus)) + ); + assert_eq!(pre.fee(), Some(&fee_surplus)); - // with_fee_currency will set OverrideChargeFeeMethod when pre_dispatch + // with_fee_currency will set OverrideChargeFeeMethod when validate_and_prepare assert_eq!( OverrideChargeFeeMethod::::get(), Some(ChargeFeeMethod::FeeCurrency(token)) @@ -495,15 +519,15 @@ fn pre_post_dispatch_and_refund_with_fee_currency_call(token: CurrencyId, surplu assert_eq!(Currencies::free_balance(token, &CHARLIE), token_init - token_transfer); let actual_fee = TransactionPayment::compute_actual_fee(500, &INFO, &POST_INFO, tip); assert_eq!(actual_fee, 500 * 2 + 800 + 200); - assert_ok!(ChargeTransactionPayment::::post_dispatch( - Some(pre), + assert_ok!(ChargeTransactionPayment::::post_dispatch_details( + pre, &INFO, &POST_INFO, 500, &Ok(()) )); - // always clear OverrideChargeFeeMethod when post_dispatch + // always clear OverrideChargeFeeMethod when post_dispatch_details assert_eq!(OverrideChargeFeeMethod::::get(), None); assert_eq!( @@ -547,10 +571,14 @@ fn pre_post_dispatch_and_refund_with_fee_call_use_dex(with_fee_call: ::from(0) - .pre_dispatch(&ALICE, &with_fee_call, &INFO2, 50) - .unwrap(); - assert_eq!(pre.2, Some(pallet_balances::NegativeImbalance::new(fee_surplus))); - assert_eq!(pre.3, fee_surplus); + .validate_and_prepare(Some(ALICE).into(), &with_fee_call, &INFO2, 50, 0) + .unwrap() + .0; + assert_eq!( + pre.imbalance(), + Some(&pallet_balances::NegativeImbalance::new(fee_surplus)) + ); + assert_eq!(pre.fee(), Some(&fee_surplus)); System::assert_has_event(crate::mock::RuntimeEvent::DEXModule(module_dex::Event::Swap { trader: ALICE, path: vec![LDOT, ACA], @@ -562,8 +590,8 @@ fn pre_post_dispatch_and_refund_with_fee_call_use_dex(with_fee_call: ::post_dispatch( - Some(pre), + assert_ok!(ChargeTransactionPayment::::post_dispatch_details( + pre, &INFO2, &POST_INFO2, 50, @@ -592,13 +620,17 @@ fn pre_post_dispatch_and_refund_with_fee_call_use_dex(with_fee_call: ::from(tip) - .pre_dispatch(&CHARLIE, &with_fee_call, &INFO2, 50) - .unwrap(); - assert_eq!(pre.2, Some(pallet_balances::NegativeImbalance::new(fee_surplus))); - assert_eq!(pre.3, fee_surplus); + .validate_and_prepare(Some(CHARLIE).into(), &with_fee_call, &INFO2, 50, 0) + .unwrap() + .0; + assert_eq!( + pre.imbalance(), + Some(&pallet_balances::NegativeImbalance::new(fee_surplus)) + ); + assert_eq!(pre.fee(), Some(&fee_surplus)); - assert_ok!(ChargeTransactionPayment::::post_dispatch( - Some(pre), + assert_ok!(ChargeTransactionPayment::::post_dispatch_details( + pre, &INFO2, &POST_INFO2, 50, @@ -625,10 +657,16 @@ fn pre_post_dispatch_and_refund_with_fee_call_use_dex(with_fee_call: ::from(0).pre_dispatch(&ALICE, &CALL, &INFO, 23)); + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(ALICE).into(), + &CALL, + &INFO, + 23, + 0 + )); assert_eq!(Currencies::free_balance(ACA, &ALICE), 100000 - fee); }); } @@ -638,13 +676,14 @@ fn refund_fee_according_to_actual_when_post_dispatch_and_native_currency_is_enou builder_with_dex_and_fee_pool(false).execute_with(|| { let fee = 23 * 2 + 1000; // len * byte + weight let pre = ChargeTransactionPayment::::from(0) - .pre_dispatch(&ALICE, &CALL, &INFO, 23) - .unwrap(); + .validate_and_prepare(Some(ALICE).into(), &CALL, &INFO, 23, 0) + .unwrap() + .0; assert_eq!(Currencies::free_balance(ACA, &ALICE), 100000 - fee); let refund = 200; // 1000 - 800 - assert_ok!(ChargeTransactionPayment::::post_dispatch( - Some(pre), + assert_ok!(ChargeTransactionPayment::::post_dispatch_details( + pre, &INFO, &POST_INFO, 23, @@ -669,13 +708,14 @@ fn refund_tip_according_to_actual_when_post_dispatch_and_native_currency_is_enou // tip = 0 let fee = 23 * 2 + 1000; // len * byte + weight let pre = ChargeTransactionPayment::::from(0) - .pre_dispatch(&ALICE, &CALL, &INFO, 23) - .unwrap(); + .validate_and_prepare(Some(ALICE).into(), &CALL, &INFO, 23, 0) + .unwrap() + .0; assert_eq!(Currencies::free_balance(ACA, &ALICE), 100000 - fee); let refund = 200; // 1000 - 800 - assert_ok!(ChargeTransactionPayment::::post_dispatch( - Some(pre), + assert_ok!(ChargeTransactionPayment::::post_dispatch_details( + pre, &INFO, &POST_INFO, 23, @@ -696,14 +736,15 @@ fn refund_tip_according_to_actual_when_post_dispatch_and_native_currency_is_enou let fee = 23 * 2 + 1000; // len * byte + weight let tip = 1000; let pre = ChargeTransactionPayment::::from(tip) - .pre_dispatch(&CHARLIE, &CALL, &INFO, 23) - .unwrap(); + .validate_and_prepare(Some(CHARLIE).into(), &CALL, &INFO, 23, 0) + .unwrap() + .0; assert_eq!(Currencies::free_balance(ACA, &CHARLIE), 100000 - fee - tip); let refund_fee = 200; // 1000 - 800 let refund_tip = 200; // 1000 - 800 - assert_ok!(ChargeTransactionPayment::::post_dispatch( - Some(pre), + assert_ok!(ChargeTransactionPayment::::post_dispatch_details( + pre, &INFO, &POST_INFO, 23, @@ -731,18 +772,19 @@ fn refund_should_not_works() { let tip = 1000; let fee = 23 * 2 + 1000; // len * byte + weight let pre = ChargeTransactionPayment::::from(tip) - .pre_dispatch(&ALICE, &CALL, &INFO, 23) - .unwrap(); + .validate_and_prepare(Some(ALICE).into(), &CALL, &INFO, 23, 0) + .unwrap() + .0; assert_eq!(Currencies::free_balance(ACA, &ALICE), 100000 - fee - tip); // actual_weight > weight const POST_INFO: PostDispatchInfo = PostDispatchInfo { - actual_weight: Some(INFO.weight.add_ref_time(1)), + actual_weight: Some(INFO.call_weight.add_ref_time(1)), pays_fee: Pays::Yes, }; - assert_ok!(ChargeTransactionPayment::::post_dispatch( - Some(pre), + assert_ok!(ChargeTransactionPayment::::post_dispatch_details( + pre, &INFO, &POST_INFO, 23, @@ -784,7 +826,13 @@ fn charges_fee_when_validate_with_fee_call_use_swap(with_fee_call: ::from(0).validate(&BOB, &with_fee_call, &INFO2, 50)); + assert_ok!(ChargeTransactionPayment::::from(0).dispatch_transaction( + Some(BOB).into(), + with_fee_call.clone(), + &INFO2, + 50, + 0 + )); System::assert_has_event(crate::mock::RuntimeEvent::DEXModule(module_dex::Event::Swap { trader: BOB, path: vec![LDOT, ACA], @@ -799,7 +847,13 @@ fn charges_fee_when_validate_with_fee_call_use_swap(with_fee_call: ::from(0).validate(&BOB, &with_fee_call, &INFO2, 50)); + assert_ok!(ChargeTransactionPayment::::from(0).dispatch_transaction( + Some(BOB).into(), + with_fee_call, + &INFO2, + 50, + 0 + )); System::assert_has_event(crate::mock::RuntimeEvent::DEXModule(module_dex::Event::Swap { trader: BOB, path: vec![LDOT, ACA], @@ -831,11 +885,12 @@ fn charges_fee_when_validate_with_fee_currency_call_use_pool() { assert_ok!(Currencies::update_balance(RuntimeOrigin::root(), BOB, AUSD, 10000)); assert_eq!(0, Currencies::free_balance(ACA, &BOB)); - assert_ok!(ChargeTransactionPayment::::from(0).validate( - &BOB, - &with_fee_currency_call(AUSD), + assert_ok!(ChargeTransactionPayment::::from(0).dispatch_transaction( + Some(BOB).into(), + with_fee_currency_call(AUSD), &INFO2, - 50 + 50, + 0 )); assert_eq!(10, Currencies::free_balance(ACA, &BOB)); // ED assert_eq!(7370, Currencies::free_balance(AUSD, &BOB)); @@ -869,11 +924,12 @@ fn charges_fee_when_validate_with_fee_currency_call_use_pool() { assert_ok!(Currencies::update_balance(RuntimeOrigin::root(), BOB, DOT, 10000)); assert_eq!(10, Currencies::free_balance(ACA, &BOB)); // ED - assert_ok!(ChargeTransactionPayment::::from(0).validate( - &BOB, - &with_fee_currency_call(DOT), + assert_ok!(ChargeTransactionPayment::::from(0).dispatch_transaction( + Some(BOB).into(), + with_fee_currency_call(DOT), &INFO2, - 50 + 50, + 0 )); assert_eq!(sub_dot_aca - fee_amount, Currencies::free_balance(ACA, &dot_acc)); assert_eq!(sub_dot_dot + fee_amount / 10, Currencies::free_balance(DOT, &dot_acc)); @@ -914,13 +970,13 @@ fn charges_fee_when_validate_and_native_is_not_enough() { let surplus1 = AlternativeFeeSurplus::get().mul_ceil(fee); let expect_priority = ChargeTransactionPayment::::get_priority(&INFO2, 50, fee, fee); assert_eq!(expect_priority, 2010); - assert_eq!( - ChargeTransactionPayment::::from(0) - .validate(&BOB, &CALL2, &INFO2, 50) - .unwrap() - .priority, - 10 - ); + assert_ok!(ChargeTransactionPayment::::from(0).dispatch_transaction( + Some(BOB).into(), + CALL2, + &INFO2, + 50, + 0 + )); assert_eq!(Currencies::total_balance(ACA, &BOB), ed); assert_eq!(Currencies::free_balance(ACA, &BOB), ed); @@ -941,7 +997,13 @@ fn charges_fee_when_validate_and_native_is_not_enough() { // fee: 112, ed: 10, surplus=110*0.25=28, swap_out:112+28=140ACA, swap_in=260*10=1400AUSD let fee2 = 6 * 2 + 100; // len * byte + weight let surplus2 = AlternativeFeeSurplus::get().mul_ceil(fee2); - assert_ok!(ChargeTransactionPayment::::from(0).validate(&BOB, &CALL2, &INFO2, 6)); + assert_ok!(ChargeTransactionPayment::::from(0).dispatch_transaction( + Some(BOB).into(), + CALL2, + &INFO2, + 6, + 0 + )); assert_eq!(Currencies::total_balance(ACA, &BOB), ed); assert_eq!(Currencies::free_balance(ACA, &BOB), ed); assert_eq!( @@ -959,8 +1021,10 @@ fn charges_fee_when_validate_and_native_is_not_enough() { ); // Bob only has ED of native asset, but has not enough AUSD, validate failed. - assert_noop!( - ChargeTransactionPayment::::from(0).validate(&BOB, &CALL2, &INFO2, 1), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare(Some(BOB).into(), &CALL2, &INFO2, 1, 0) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); assert_eq!(Currencies::total_balance(ACA, &BOB), 10); @@ -1070,8 +1134,10 @@ fn charges_fee_failed_by_slippage_limit() { DEXModule::get_swap_amount(&vec![AUSD, ACA], SwapLimit::ExactSupply(1000, 0)), Some((1000, 5000)) ); - assert_noop!( - ChargeTransactionPayment::::from(0).validate(&BOB, &CALL2, &INFO, 500), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare(Some(BOB).into(), &CALL2, &INFO, 500, 0) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); assert_eq!(DEXModule::get_liquidity_pool(ACA, AUSD), (10000, 1000)); @@ -1171,13 +1237,13 @@ fn charge_fee_by_alternative_swap_first_priority() { // fee=500*2+1000=2000ACA, surplus=2000*0.25=500ACA, fee_amount=2500ACA let surplus: u128 = AlternativeFeeSurplus::get().mul_ceil(2000); let fee_surplus: u128 = 2000 + surplus; - assert_eq!( - ChargeTransactionPayment::::from(0) - .validate(&BOB, &CALL2, &INFO, 500) - .unwrap() - .priority, - 1 - ); + assert_ok!(ChargeTransactionPayment::::from(0).dispatch_transaction( + Some(BOB).into(), + CALL2, + &INFO, + 500, + 0 + )); System::assert_has_event(crate::mock::RuntimeEvent::DEXModule(module_dex::Event::Swap { trader: BOB, path: vec![DOT, AUSD, ACA], @@ -1249,13 +1315,13 @@ fn charge_fee_by_default_fee_tokens_second_priority() { // fee=500*2+1000=2000ACA, surplus=2000*0.25=500ACA, fee_amount=2500ACA let surplus: u128 = AlternativeFeeSurplus::get().mul_ceil(2000); let fee_surplus = 2000 + surplus; - assert_eq!( - ChargeTransactionPayment::::from(0) - .validate(&BOB, &CALL2, &INFO, 500) - .unwrap() - .priority, - 1 - ); + assert_ok!(ChargeTransactionPayment::::from(0).dispatch_transaction( + Some(BOB).into(), + CALL2, + &INFO, + 500, + 0 + )); // Alternative fee swap directly from dex, not from fee pool. System::assert_has_event(crate::mock::RuntimeEvent::DEXModule(module_dex::Event::Swap { trader: BOB, @@ -1288,7 +1354,7 @@ fn query_info_works() { }); let origin = 111111; let extra = (); - let xt = TestXt::new(call, Some((origin, extra))); + let xt = UncheckedExtrinsic::new_signed(call.clone(), origin, (), extra); let info = xt.get_dispatch_info(); let ext = xt.encode(); let len = ext.len() as u32; @@ -1299,11 +1365,11 @@ fn query_info_works() { assert_eq!( TransactionPayment::query_info(xt, len), RuntimeDispatchInfo { - weight: info.weight, + weight: info.call_weight, class: info.class, partial_fee: 5 * 2 /* base_weight * weight_fee */ + len as u128 /* len * byte_fee */ - + info.weight.ref_time().min(BlockWeights::get().max_block.ref_time()) as u128 * 2 * 3 / 2 /* weight */ + + info.call_weight.ref_time().min(BlockWeights::get().max_block.ref_time()) as u128 * 2 * 3 / 2 /* weight */ }, ); }); @@ -1321,14 +1387,16 @@ fn compute_fee_works_without_multiplier() { // Tip only, no fees works let dispatch_info = DispatchInfo { - weight: Weight::from_parts(0, 0), + call_weight: Weight::from_parts(0, 0), + extension_weight: Weight::zero(), class: DispatchClass::Operational, pays_fee: Pays::No, }; assert_eq!(Pallet::::compute_fee(0, &dispatch_info, 10), 10); // No tip, only base fee works let dispatch_info = DispatchInfo { - weight: Weight::from_parts(0, 0), + call_weight: Weight::from_parts(0, 0), + extension_weight: Weight::zero(), class: DispatchClass::Operational, pays_fee: Pays::Yes, }; @@ -1339,7 +1407,8 @@ fn compute_fee_works_without_multiplier() { assert_eq!(Pallet::::compute_fee(42, &dispatch_info, 0), 520); // Weight fee + base fee works let dispatch_info = DispatchInfo { - weight: Weight::from_parts(1000, 0), + call_weight: Weight::from_parts(1000, 0), + extension_weight: Weight::zero(), class: DispatchClass::Operational, pays_fee: Pays::Yes, }; @@ -1358,7 +1427,8 @@ fn compute_fee_works_with_multiplier() { NextFeeMultiplier::::put(Multiplier::saturating_from_rational(3, 2)); // Base fee is unaffected by multiplier let dispatch_info = DispatchInfo { - weight: Weight::from_parts(0, 0), + call_weight: Weight::from_parts(0, 0), + extension_weight: Weight::zero(), class: DispatchClass::Operational, pays_fee: Pays::Yes, }; @@ -1366,7 +1436,8 @@ fn compute_fee_works_with_multiplier() { // Everything works together :) let dispatch_info = DispatchInfo { - weight: Weight::from_parts(123, 0), + call_weight: Weight::from_parts(123, 0), + extension_weight: Weight::zero(), class: DispatchClass::Operational, pays_fee: Pays::Yes, }; @@ -1390,7 +1461,8 @@ fn compute_fee_works_with_negative_multiplier() { // Base fee is unaffected by multiplier. let dispatch_info = DispatchInfo { - weight: Weight::from_parts(0, 0), + call_weight: Weight::from_parts(0, 0), + extension_weight: Weight::zero(), class: DispatchClass::Operational, pays_fee: Pays::Yes, }; @@ -1398,7 +1470,8 @@ fn compute_fee_works_with_negative_multiplier() { // Everything works together. let dispatch_info = DispatchInfo { - weight: Weight::from_parts(123, 0), + call_weight: Weight::from_parts(123, 0), + extension_weight: Weight::zero(), class: DispatchClass::Operational, pays_fee: Pays::Yes, }; @@ -1419,7 +1492,8 @@ fn compute_fee_does_not_overflow() { .execute_with(|| { // Overflow is handled let dispatch_info = DispatchInfo { - weight: Weight::MAX, + call_weight: Weight::MAX, + extension_weight: Weight::zero(), class: DispatchClass::Operational, pays_fee: Pays::Yes, }; @@ -1440,20 +1514,23 @@ fn should_alter_operational_priority() { .build() .execute_with(|| { let normal = DispatchInfo { - weight: Weight::from_parts(100, 0), + call_weight: Weight::from_parts(100, 0), + extension_weight: Weight::zero(), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; let priority = ChargeTransactionPayment::(tip) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; assert_eq!(priority, 60); let priority = ChargeTransactionPayment::(2 * tip) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; assert_eq!(priority, 110); @@ -1464,13 +1541,15 @@ fn should_alter_operational_priority() { .build() .execute_with(|| { let op = DispatchInfo { - weight: Weight::from_parts(100, 0), + call_weight: Weight::from_parts(100, 0), + extension_weight: Weight::zero(), class: DispatchClass::Operational, pays_fee: Pays::Yes, }; let priority = ChargeTransactionPayment::(tip) - .validate(&ALICE, &CALL, &op, len) + .validate_only(Some(ALICE).into(), &CALL, &op, len, External, 0) .unwrap() + .0 .priority; // final_fee = base_fee + len_fee + adjusted_weight_fee + tip = 0 + 20 + 100 + 5 = 125 // priority = final_fee * fee_multiplier * max_tx_per_block + (tip + 1) * max_tx_per_block @@ -1478,8 +1557,9 @@ fn should_alter_operational_priority() { assert_eq!(priority, 6310); let priority = ChargeTransactionPayment::(2 * tip) - .validate(&ALICE, &CALL, &op, len) + .validate_only(Some(ALICE).into(), &CALL, &op, len, External, 0) .unwrap() + .0 .priority; // final_fee = base_fee + len_fee + adjusted_weight_fee + tip = 0 + 20 + 100 + 10 = 130 // priority = final_fee * fee_multiplier * max_tx_per_block + (tip + 1) * max_tx_per_block @@ -1498,13 +1578,15 @@ fn no_tip_has_some_priority() { .build() .execute_with(|| { let normal = DispatchInfo { - weight: Weight::from_parts(100, 0), + call_weight: Weight::from_parts(100, 0), + extension_weight: Weight::zero(), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; let priority = ChargeTransactionPayment::(tip) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; // max_tx_per_block = 10 assert_eq!(priority, 10); @@ -1515,13 +1597,15 @@ fn no_tip_has_some_priority() { .build() .execute_with(|| { let op = DispatchInfo { - weight: Weight::from_parts(100, 0), + call_weight: Weight::from_parts(100, 0), + extension_weight: Weight::zero(), class: DispatchClass::Operational, pays_fee: Pays::Yes, }; let priority = ChargeTransactionPayment::(tip) - .validate(&ALICE, &CALL, &op, len) + .validate_only(Some(ALICE).into(), &CALL, &op, len, External, 0) .unwrap() + .0 .priority; // final_fee = base_fee + len_fee + adjusted_weight_fee + tip = 0 + 20 + 100 + 0 = 120 // priority = final_fee * fee_multiplier * max_tx_per_block + (tip + 1) * max_tx_per_block @@ -1541,55 +1625,63 @@ fn min_tip_has_same_priority() { .build() .execute_with(|| { let normal = DispatchInfo { - weight: Weight::from_parts(100, 0), + call_weight: Weight::from_parts(100, 0), + extension_weight: Weight::zero(), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; let priority = ChargeTransactionPayment::(0) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; // max_tx_per_block = 10 assert_eq!(priority, 0); let priority = ChargeTransactionPayment::(tip - 2) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; // max_tx_per_block = 10 assert_eq!(priority, 0); let priority = ChargeTransactionPayment::(tip - 1) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; // max_tx_per_block = 10 assert_eq!(priority, 10); let priority = ChargeTransactionPayment::(tip) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; // max_tx_per_block = 10 assert_eq!(priority, 10); let priority = ChargeTransactionPayment::(2 * tip - 2) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; // max_tx_per_block = 10 assert_eq!(priority, 10); let priority = ChargeTransactionPayment::(2 * tip - 1) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; // max_tx_per_block = 10 assert_eq!(priority, 20); let priority = ChargeTransactionPayment::(2 * tip) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; // max_tx_per_block = 10 assert_eq!(priority, 20); @@ -1606,20 +1698,23 @@ fn max_tip_has_same_priority() { .build() .execute_with(|| { let normal = DispatchInfo { - weight: Weight::from_parts(100, 0), + call_weight: Weight::from_parts(100, 0), + extension_weight: Weight::zero(), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; let priority = ChargeTransactionPayment::(tip) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; // max_tx_per_block = 10 assert_eq!(priority, 10_000); let priority = ChargeTransactionPayment::(2 * tip) - .validate(&ALICE, &CALL, &normal, len) + .validate_only(Some(ALICE).into(), &CALL, &normal, len, External, 0) .unwrap() + .0 .priority; // max_tx_per_block = 10 assert_eq!(priority, 10_000); @@ -1929,8 +2024,10 @@ fn charge_fee_failed_when_disable_dex() { )); // tx failed because of dex not enabled even though user has enough AUSD - assert_noop!( - ChargeTransactionPayment::::from(0).validate(&BOB, &CALL2, &INFO2, 50), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare(Some(BOB).into(), &CALL2, &INFO2, 50, 0) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); @@ -1939,7 +2036,13 @@ fn charge_fee_failed_when_disable_dex() { // after runtime upgrade, tx success because of dex enabled and has enough token balance // fee=50*2+100=200, ED=10, surplus=200*0.25=50, fee_amount=260, ausd_swap=260*10=2600 let surplus = AlternativeFeeSurplus::get().mul_ceil(200); - assert_ok!(ChargeTransactionPayment::::from(0).validate(&BOB, &CALL2, &INFO2, 50)); + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(BOB).into(), + &CALL2, + &INFO2, + 50, + 0 + )); assert_eq!(100000 - (210 + surplus) * 10, Currencies::free_balance(AUSD, &BOB)); // update threshold, next tx will trigger swap @@ -1966,7 +2069,13 @@ fn charge_fee_failed_when_disable_dex() { Currencies::free_balance(AUSD, &fee_account) ); assert_eq!(9790 - surplus, Currencies::free_balance(ACA, &fee_account)); - assert_ok!(ChargeTransactionPayment::::from(0).validate(&BOB, &CALL2, &INFO2, 50)); + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(BOB).into(), + &CALL2, + &INFO2, + 50, + 0 + )); // AlternativeFeeSurplus=25%, swap 2600 AUSD with 6388 ACA, pool_size=9740+6388=16128 // fee=50*2+100=200, surplus=200*0.25=50, fee_amount=250, ausd_swap=250*10=2500 let fee_aca = Currencies::free_balance(ACA, &fee_account); @@ -2034,7 +2143,13 @@ fn charge_fee_failed_when_disable_dex() { // but `swap_from_pool_or_dex` still can work, because tx fee pool is not disabled. // after swap, the balance gt threshold, tx still success because not trigger swap. // the rate is using new exchange rate, but swap native asset still keep 250 ACA. - assert_ok!(ChargeTransactionPayment::::from(0).validate(&BOB, &CALL2, &INFO2, 50)); + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(BOB).into(), + &CALL2, + &INFO2, + 50, + 0 + )); let fee_balance = Currencies::free_balance(ACA, &fee_account); assert_eq!(fee_aca - (200 + surplus), fee_balance); @@ -2044,7 +2159,13 @@ fn charge_fee_failed_when_disable_dex() { SwapBalanceThreshold::::insert(AUSD, swap_balance_threshold); // this tx success because before execution, native_balance > threshold - assert_ok!(ChargeTransactionPayment::::from(0).validate(&BOB, &CALL2, &INFO2, 50)); + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(BOB).into(), + &CALL2, + &INFO2, + 50, + 0 + )); // assert_eq!(15378, Currencies::free_balance(ACA, &fee_account)); assert_eq!( fee_aca - (200 + surplus) * 2, @@ -2053,7 +2174,13 @@ fn charge_fee_failed_when_disable_dex() { assert_eq!(ed, Currencies::free_balance(ACA, &BOB)); // this tx failed because when execute, native_balance < threshold, the dex swap failed - assert_ok!(ChargeTransactionPayment::::from(0).validate(&BOB, &CALL2, &INFO2, 50)); + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(BOB).into(), + &CALL2, + &INFO2, + 50, + 0 + )); }); } @@ -2199,26 +2326,30 @@ fn with_fee_call_validation_works() { assert_eq!(OverrideChargeFeeMethod::::get(), None); // CHARLIE has enough native token, default charge fee succeed - assert_ok!(ChargeTransactionPayment::::from(0).pre_dispatch(&CHARLIE, &CALL, &INFO, 10)); - // default charge fee will not set OverrideChargeFeeMethod + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(CHARLIE).into(), + &CALL, + &INFO, + 10, + 0 + )); // default charge fee will not set OverrideChargeFeeMethod assert_eq!(OverrideChargeFeeMethod::::get(), None); // BOB has not enough native token, default charge fee fail - assert_noop!( - ChargeTransactionPayment::::from(0).pre_dispatch(&BOB, &CALL, &INFO, 10), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare(Some(BOB).into(), &CALL, &INFO, 10, 0) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); // dex swap not enabled, validate failed. // with_fee_currency test for token in vec![DOT, AUSD] { - assert_noop!( - ChargeTransactionPayment::::from(0).pre_dispatch( - &CHARLIE, - &with_fee_currency_call(token), - &INFO, - 10 - ), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare(Some(CHARLIE).into(), &with_fee_currency_call(token), &INFO, 10, 0) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); @@ -2237,13 +2368,10 @@ fn with_fee_call_validation_works() { // with_fee_path test for path in vec![vec![DOT, AUSD, ACA], vec![AUSD, ACA]] { - assert_noop!( - ChargeTransactionPayment::::from(0).pre_dispatch( - &CHARLIE, - &with_fee_path_call(path.clone()), - &INFO, - 10 - ), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare(Some(CHARLIE).into(), &with_fee_path_call(path.clone()), &INFO, 10, 0) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); @@ -2262,37 +2390,46 @@ fn with_fee_call_validation_works() { // with_fee_aggregated_path test let aggregated_path = vec![AggregatedSwapPath::Dex(vec![DOT, AUSD])]; - assert_noop!( - ChargeTransactionPayment::::from(0).pre_dispatch( - &ALICE, - &with_fee_aggregated_path_by_call(aggregated_path.clone()), - &INFO, - 10 - ), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare( + Some(ALICE).into(), + &with_fee_aggregated_path_by_call(aggregated_path.clone()), + &INFO, + 10, + 0 + ) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); let aggregated_path = vec![AggregatedSwapPath::Dex(vec![DOT, ACA])]; - assert_noop!( - ChargeTransactionPayment::::from(0).pre_dispatch( - &CHARLIE, - &with_fee_aggregated_path_by_call(aggregated_path.clone()), - &INFO, - 10 - ), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare( + Some(CHARLIE).into(), + &with_fee_aggregated_path_by_call(aggregated_path.clone()), + &INFO, + 10, + 0 + ) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); // ensure_can_charge_fee_with_call failed, dot not set OverrideChargeFeeMethod assert_eq!(OverrideChargeFeeMethod::::get(), None); let aggregated_path = vec![AggregatedSwapPath::Taiga(0, 0, 0)]; - assert_noop!( - ChargeTransactionPayment::::from(0).pre_dispatch( - &CHARLIE, - &with_fee_aggregated_path_by_call(aggregated_path.clone()), - &INFO, - 10 - ), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare( + Some(CHARLIE).into(), + &with_fee_aggregated_path_by_call(aggregated_path.clone()), + &INFO, + 10, + 0 + ) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); // ensure_can_charge_fee_with_call failed, dot not set OverrideChargeFeeMethod @@ -2312,11 +2449,12 @@ fn with_fee_call_validation_works() { // with_fee_currency test for token in vec![DOT, AUSD] { - assert_ok!(ChargeTransactionPayment::::from(0).pre_dispatch( - &CHARLIE, + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(CHARLIE).into(), &with_fee_currency_call(token), &INFO, - 10 + 10, + 0 )); // OverrideChargeFeeMethod will be set @@ -2327,22 +2465,20 @@ fn with_fee_call_validation_works() { } // LDOT is not enabled fee pool, cannot charge fee by with_fee_currency - assert_noop!( - ChargeTransactionPayment::::from(0).pre_dispatch( - &CHARLIE, - &with_fee_currency_call(LDOT), - &INFO, - 10 - ), + assert_eq!( + ChargeTransactionPayment::::from(0) + .validate_and_prepare(Some(CHARLIE).into(), &with_fee_currency_call(LDOT), &INFO, 10, 0) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); for path in vec![vec![DOT, AUSD, ACA], vec![AUSD, ACA]] { - assert_ok!(ChargeTransactionPayment::::from(0).pre_dispatch( - &CHARLIE, + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(CHARLIE).into(), &with_fee_path_call(path.clone()), &INFO, - 10 + 10, + 0 )); // OverrideChargeFeeMethod will be set @@ -2353,11 +2489,12 @@ fn with_fee_call_validation_works() { } let aggregated_path = vec![AggregatedSwapPath::Dex(vec![DOT, AUSD, ACA])]; - assert_ok!(ChargeTransactionPayment::::from(0).pre_dispatch( - &CHARLIE, + assert_ok!(ChargeTransactionPayment::::from(0).validate_and_prepare( + Some(CHARLIE).into(), &with_fee_aggregated_path_by_call(aggregated_path.clone()), &INFO, - 10 + 10, + 0 )); assert_eq!( OverrideChargeFeeMethod::::get(), diff --git a/modules/xcm-interface/src/lib.rs b/modules/xcm-interface/src/lib.rs index 39761c5c7..0bb58ab1d 100644 --- a/modules/xcm-interface/src/lib.rs +++ b/modules/xcm-interface/src/lib.rs @@ -48,7 +48,7 @@ const LOG_TARGET: &str = "xcm-interface"; pub mod module { use super::*; - #[derive(Encode, Decode, Eq, PartialEq, Clone, RuntimeDebug, TypeInfo)] + #[derive(Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, Clone, RuntimeDebug, TypeInfo)] pub enum XcmInterfaceOperation { // PalletXcm transfer XcmTransfer, diff --git a/modules/xcm-interface/src/mocks/mod.rs b/modules/xcm-interface/src/mocks/mod.rs index 448e59ace..c4f43b749 100644 --- a/modules/xcm-interface/src/mocks/mod.rs +++ b/modules/xcm-interface/src/mocks/mod.rs @@ -22,12 +22,12 @@ use super::*; use crate as xcm_interface; use frame_support::{ construct_runtime, derive_impl, ord_parameter_types, parameter_types, - traits::{ConstU128, ConstU32, Everything, Nothing}, + traits::{ConstU128, ConstU32, Disabled, Everything, Nothing}, }; use frame_system::{EnsureRoot, EnsureSignedBy}; -use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage}; +use sp_runtime::{traits::IdentityLookup, AccountId32}; use xcm_builder::{EnsureXcmOrigin, FixedWeightBounds, SignedToAccountId32}; -use xcm_executor::traits::XcmAssetTransfers; +use xcm_executor::traits::{FeeManager, FeeReason, XcmAssetTransfers}; pub mod kusama; pub mod polkadot; @@ -108,16 +108,17 @@ impl ExecuteXcm for MockExec { ( 1, Some(Transact { - require_weight_at_most, .. + fallback_max_weight: Some(fallback_max_weight), + .. }), ) => { - if require_weight_at_most.all_lte(weight_limit) { + if fallback_max_weight.all_lte(weight_limit) { Outcome::Complete { - used: *require_weight_at_most, + used: *fallback_max_weight, } } else { Outcome::Error { - error: XcmError::WeightLimitReached(*require_weight_at_most), + error: XcmError::WeightLimitReached(*fallback_max_weight), } } } @@ -141,6 +142,13 @@ impl XcmAssetTransfers for MockExec { type AssetTransactor = (); } +impl FeeManager for MockExec { + fn is_waived(_origin: Option<&Location>, _r: FeeReason) -> bool { + false + } + fn handle_fee(_fee: Assets, _context: Option<&XcmContext>, _r: FeeReason) {} +} + #[macro_export] macro_rules! impl_mock { ($assethub:ty) => { @@ -169,6 +177,7 @@ macro_rules! impl_mock { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } impl pallet_xcm::Config for Runtime { @@ -195,6 +204,7 @@ macro_rules! impl_mock { type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type AuthorizedAliasConsideration = Disabled; } impl Config for Runtime { @@ -226,15 +236,3 @@ impl Default for ExtBuilder { ExtBuilder } } - -impl ExtBuilder { - pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::::default() - .build_storage() - .unwrap(); - - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| frame_system::Pallet::::set_block_number(1u32.into())); - ext - } -} diff --git a/modules/xnft/src/lib.rs b/modules/xnft/src/lib.rs index 760a93929..21a7004b3 100644 --- a/modules/xnft/src/lib.rs +++ b/modules/xnft/src/lib.rs @@ -26,8 +26,8 @@ use module_nft::{ClassIdOf, TokenIdOf}; use sp_runtime::{traits::AccountIdConversion, DispatchResult}; use sp_std::boxed::Box; use xcm::{ - v3, - v4::{ + v3, v4, + v5::{ Asset, AssetId, AssetInstance, Error as XcmError, Fungibility, InteriorLocation, Junction::*, Location, Result as XcmResult, XcmContext, }, diff --git a/modules/xnft/src/xcm_helpers.rs b/modules/xnft/src/xcm_helpers.rs index 1b47fdb0e..ee1c00cee 100644 --- a/modules/xnft/src/xcm_helpers.rs +++ b/modules/xnft/src/xcm_helpers.rs @@ -33,7 +33,8 @@ where ClassIdOf: TryFrom, { pub fn asset_to_collection(asset: &AssetId) -> Result, MatchError> { - let v3_asset = v3::AssetId::try_from(asset.clone()).map_err(|_| MatchError::AssetIdConversionFailed)?; + let v4_asset = v4::AssetId::try_from(asset.clone()).map_err(|_| MatchError::AssetIdConversionFailed)?; + let v3_asset = v3::AssetId::try_from(v4_asset).map_err(|_| MatchError::AssetIdConversionFailed)?; Self::foreign_asset_to_class(v3_asset) .map(ClassLocality::Foreign) .or_else(|| Self::local_asset_to_class(asset).map(ClassLocality::Local)) @@ -63,8 +64,10 @@ where } pub fn deposit_foreign_asset(to: &T::AccountId, asset: ClassIdOf, asset_instance: &AssetInstance) -> XcmResult { + let v4_asset_instance = + v4::AssetInstance::try_from(*asset_instance).map_err(|_| MatchError::InstanceConversionFailed)?; let v3_asset_instance = - v3::AssetInstance::try_from(*asset_instance).map_err(|_| MatchError::InstanceConversionFailed)?; + v3::AssetInstance::try_from(v4_asset_instance).map_err(|_| MatchError::InstanceConversionFailed)?; match Self::asset_instance_to_item(asset, v3_asset_instance) { Some(token_id) => >::do_transfer(&Self::account_id(), to, (asset, token_id)) .map_err(|_| XcmError::FailedToTransactAsset("non-fungible foreign item deposit failed")), @@ -98,7 +101,8 @@ where class_locality: ClassLocality, asset_instance: &AssetInstance, ) -> Option<(ClassIdOf, TokenIdOf)> { - let v3_asset_instance = v3::AssetInstance::try_from(*asset_instance).ok()?; + let v4_asset_instance = v4::AssetInstance::try_from(*asset_instance).ok()?; + let v3_asset_instance = v3::AssetInstance::try_from(v4_asset_instance).ok()?; match class_locality { ClassLocality::Foreign(class_id) => { Self::asset_instance_to_item(class_id, v3_asset_instance).map(|token_id| (class_id, token_id)) diff --git a/orml b/orml index 459ce225e..cee8e0917 160000 --- a/orml +++ b/orml @@ -1 +1 @@ -Subproject commit 459ce225e4914515216905303a86230cac6e2c4a +Subproject commit cee8e0917ff93ed21be0474d4138d09d602afb66 diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index acdebdb08..11d0ac329 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -22,7 +22,7 @@ use crate::{evm::EvmAddress, *}; use bstringify::bstringify; use num_enum::{IntoPrimitive, TryFromPrimitive}; pub use nutsfinance_stable_asset::StableAssetPoolId; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::RuntimeDebug; use sp_std::prelude::*; @@ -402,7 +402,7 @@ create_currency_id! { // 128 - 147: Karura & Kusama native tokens // 148 - 167: Reserved for future usage // 168 - 255: Kusama parachain tokens - #[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo, MaxEncodedLen, Serialize, Deserialize)] + #[derive(Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo, MaxEncodedLen, Serialize, Deserialize)] #[repr(u8)] pub enum TokenSymbol { // 0 - 19: Acala & Polkadot native tokens @@ -443,6 +443,7 @@ pub type Lease = BlockNumber; #[derive( Encode, Decode, + DecodeWithMemTracking, Eq, PartialEq, Copy, @@ -467,6 +468,7 @@ pub enum DexShare { #[derive( Encode, Decode, + DecodeWithMemTracking, Eq, PartialEq, Copy, @@ -612,19 +614,43 @@ impl Into for DexShare { /// H160 CurrencyId Type enum #[derive( - Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TryFromPrimitive, IntoPrimitive, TypeInfo, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + Copy, + Clone, + RuntimeDebug, + PartialOrd, + Ord, + TryFromPrimitive, + IntoPrimitive, + TypeInfo, )] #[repr(u8)] pub enum CurrencyIdType { Token = 1, // 0 is prefix of precompile and predeploy - DexShare, - StableAsset, - LiquidCrowdloan, - ForeignAsset, + DexShare = 2, + StableAsset = 3, + LiquidCrowdloan = 4, + ForeignAsset = 5, } #[derive( - Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TryFromPrimitive, IntoPrimitive, TypeInfo, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + Copy, + Clone, + RuntimeDebug, + PartialOrd, + Ord, + TryFromPrimitive, + IntoPrimitive, + TypeInfo, )] #[repr(u8)] pub enum DexShareType { @@ -650,7 +676,7 @@ impl Into for DexShare { /// The first batch of lcDOT that expires at end of least 13 pub const LCDOT: CurrencyId = CurrencyId::LiquidCrowdloan(13); -#[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo)] +#[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub enum AssetIds { Erc20(EvmAddress), StableAssetId(StableAssetPoolId), @@ -658,7 +684,7 @@ pub enum AssetIds { NativeAssetId(CurrencyId), } -#[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo)] +#[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, DecodeWithMemTracking, TypeInfo)] pub struct AssetMetadata { pub name: Vec, pub symbol: Vec, diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 7209527cb..4cdc82cb5 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -30,7 +30,7 @@ pub mod testing; pub mod unchecked_extrinsic; pub use testing::*; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_core::U256; @@ -110,7 +110,19 @@ pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; pub type Multiplier = FixedU128; #[derive( - Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo, Serialize, Deserialize, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + Copy, + Clone, + RuntimeDebug, + PartialOrd, + Ord, + TypeInfo, + Serialize, + Deserialize, )] pub enum AuthoritysOriginId { Root, @@ -121,7 +133,19 @@ pub enum AuthoritysOriginId { } #[derive( - Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo, Serialize, Deserialize, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + Copy, + Clone, + RuntimeDebug, + PartialOrd, + Ord, + TypeInfo, + Serialize, + Deserialize, )] pub enum DataProviderId { Aggregated = 0, @@ -171,7 +195,11 @@ impl Decode for TradingPair { } } -#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, Default, MaxEncodedLen, TypeInfo)] +impl DecodeWithMemTracking for TradingPair {} + +#[derive( + Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, Copy, Clone, RuntimeDebug, Default, MaxEncodedLen, TypeInfo, +)] pub struct Position { /// The amount of collateral. pub collateral: Balance, @@ -179,7 +207,20 @@ pub struct Position { pub debit: Balance, } -#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, MaxEncodedLen, TypeInfo)] +#[derive( + Encode, + Decode, + DecodeWithMemTracking, + Eq, + PartialEq, + Copy, + Clone, + RuntimeDebug, + PartialOrd, + Ord, + MaxEncodedLen, + TypeInfo, +)] #[repr(u8)] pub enum ReserveIdentifier { CollatorSelection, @@ -196,5 +237,7 @@ pub enum ReserveIdentifier { /// Convert any type that implements Into into byte representation ([u8, 32]) pub fn to_bytes>(value: T) -> [u8; 32] { - Into::<[u8; 32]>::into(value.into()) + let mut bytes = [0u8; 32]; + Into::::into(value).write_as_big_endian(&mut bytes); + bytes } diff --git a/primitives/src/nft.rs b/primitives/src/nft.rs index 491bef75b..cecd21e83 100644 --- a/primitives/src/nft.rs +++ b/primitives/src/nft.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use scale_info::{build::Fields, meta_type, Path, Type, TypeInfo, TypeParameter}; use serde::{Deserialize, Serialize}; @@ -31,7 +31,7 @@ pub type Attributes = BTreeMap, Vec>; #[bitflags] #[repr(u8)] -#[derive(Encode, Decode, Clone, Copy, RuntimeDebug, PartialEq, Eq, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Copy, RuntimeDebug, PartialEq, Eq, TypeInfo)] pub enum ClassProperty { /// Is token transferable Transferable = 0b00000001, @@ -61,6 +61,8 @@ impl Decode for Properties { } } +impl DecodeWithMemTracking for Properties {} + impl TypeInfo for Properties { type Identity = Self; diff --git a/primitives/src/signature.rs b/primitives/src/signature.rs index eccbf42a5..859e4a094 100644 --- a/primitives/src/signature.rs +++ b/primitives/src/signature.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use scale_info::TypeInfo; use sp_runtime::{ traits::{Lazy, Verify}, @@ -27,7 +27,7 @@ use sp_core::{crypto::ByteArray, ecdsa, ed25519, sr25519}; use sp_std::prelude::*; -#[derive(Eq, PartialEq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Eq, PartialEq, Clone, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] pub enum AcalaMultiSignature { /// An Ed25519 signature. Ed25519(ed25519::Signature), diff --git a/primitives/src/task.rs b/primitives/src/task.rs index cfbb03650..1d0a74ec3 100644 --- a/primitives/src/task.rs +++ b/primitives/src/task.rs @@ -16,14 +16,14 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . use frame_support::weights::Weight; -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use scale_info::TypeInfo; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; use sp_runtime::DispatchResult; use sp_runtime::RuntimeDebug; -#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, RuntimeDebug, TypeInfo)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct TaskResult { pub result: DispatchResult, diff --git a/primitives/src/unchecked_extrinsic.rs b/primitives/src/unchecked_extrinsic.rs index 59fd0db9c..9f75a9137 100644 --- a/primitives/src/unchecked_extrinsic.rs +++ b/primitives/src/unchecked_extrinsic.rs @@ -18,21 +18,20 @@ use crate::{evm::EthereumTransactionMessage, signature::AcalaMultiSignature, to_bytes, Address, Balance}; use frame_support::ensure; -use frame_support::{ - dispatch::{DispatchInfo, GetDispatchInfo}, - traits::{ExtrinsicCall, Get}, -}; +use frame_support::traits::{ExtrinsicCall, Get, InherentBuilder, SignedTransactionBuilder}; use module_evm_utility::ethereum::{ EIP1559TransactionMessage, EIP2930TransactionMessage, LegacyTransactionMessage, TransactionAction, }; use module_evm_utility_macro::keccak256; -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use scale_info::TypeInfo; -use sp_core::{H160, H256}; +use sp_core::{H160, H256, U256}; use sp_io::{crypto::secp256k1_ecdsa_recover, hashing::keccak_256}; use sp_runtime::{ - generic::{CheckedExtrinsic, UncheckedExtrinsic}, - traits::{self, Checkable, Convert, Extrinsic, ExtrinsicMetadata, Member, SignedExtension, Zero}, + generic::{CheckedExtrinsic, ExtrinsicFormat, Preamble, UncheckedExtrinsic}, + traits::{ + self, Checkable, Convert, Dispatchable, ExtrinsicLike, ExtrinsicMetadata, Member, TransactionExtension, Zero, + }, transaction_validity::{InvalidTransaction, TransactionValidityError}, AccountId32, RuntimeDebug, }; @@ -40,68 +39,121 @@ use sp_runtime::{ use sp_std::alloc::format; use sp_std::{marker::PhantomData, prelude::*}; -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] #[scale_info(skip_type_params(ConvertEthTx))] -pub struct AcalaUncheckedExtrinsic( - pub UncheckedExtrinsic, +pub struct AcalaUncheckedExtrinsic< + Call: TypeInfo + Dispatchable, + Extension: TransactionExtension, + ConvertEthTx, + StorageDepositPerByte, + TxFeePerGas, +>( + pub UncheckedExtrinsic, PhantomData<(ConvertEthTx, StorageDepositPerByte, TxFeePerGas)>, ); -impl Extrinsic - for AcalaUncheckedExtrinsic +impl< + Call: TypeInfo + Dispatchable, + Extension: TransactionExtension, + ConvertEthTx, + StorageDepositPerByte, + TxFeePerGas, + > AcalaUncheckedExtrinsic { - type Call = Call; + pub fn from_parts(function: Call, preamble: Preamble) -> Self { + AcalaUncheckedExtrinsic(UncheckedExtrinsic::from_parts(function, preamble), PhantomData) + } - type SignaturePayload = (Address, AcalaMultiSignature, Extra); + pub fn new_bare(function: Call) -> Self { + AcalaUncheckedExtrinsic(UncheckedExtrinsic::new_bare(function), PhantomData) + } - fn is_signed(&self) -> Option { - self.0.is_signed() + pub fn new_bare_legacy(function: Call) -> Self { + AcalaUncheckedExtrinsic(UncheckedExtrinsic::new_bare_legacy(function), PhantomData) } - fn new(function: Call, signed_data: Option) -> Option { - Some(if let Some((address, signature, extra)) = signed_data { - Self( - UncheckedExtrinsic::new_signed(function, address, signature, extra), - PhantomData, - ) - } else { - Self(UncheckedExtrinsic::new_unsigned(function), PhantomData) - }) + pub fn new_signed(function: Call, signed: Address, signature: AcalaMultiSignature, tx_ext: Extension) -> Self { + AcalaUncheckedExtrinsic( + UncheckedExtrinsic::new_signed(function, signed, signature, tx_ext), + PhantomData, + ) + } + + pub fn new_transaction(function: Call, tx_ext: Extension) -> Self { + AcalaUncheckedExtrinsic(UncheckedExtrinsic::new_transaction(function, tx_ext), PhantomData) } } -impl ExtrinsicMetadata - for AcalaUncheckedExtrinsic +impl< + Call: TypeInfo + Dispatchable, + Extension: TransactionExtension, + ConvertEthTx, + StorageDepositPerByte, + TxFeePerGas, + > ExtrinsicLike for AcalaUncheckedExtrinsic { - const VERSION: u8 = UncheckedExtrinsic::::VERSION; - type SignedExtensions = Extra; + fn is_bare(&self) -> bool { + self.0.is_bare() + } } -impl ExtrinsicCall - for AcalaUncheckedExtrinsic +impl< + Call: TypeInfo + Dispatchable, + Extension: TransactionExtension, + ConvertEthTx, + StorageDepositPerByte, + TxFeePerGas, + > InherentBuilder for AcalaUncheckedExtrinsic { + fn new_inherent(call: Self::Call) -> Self { + AcalaUncheckedExtrinsic(UncheckedExtrinsic::new_inherent(call), PhantomData) + } +} + +impl< + Call: TypeInfo + Dispatchable, + Extension: TransactionExtension, + ConvertEthTx, + StorageDepositPerByte, + TxFeePerGas, + > ExtrinsicMetadata for AcalaUncheckedExtrinsic +{ + const VERSIONS: &'static [u8] = UncheckedExtrinsic::::VERSIONS; + type TransactionExtensions = Extension; +} + +impl< + Call: TypeInfo + Dispatchable, + Extension: TransactionExtension, + ConvertEthTx, + StorageDepositPerByte, + TxFeePerGas, + > ExtrinsicCall for AcalaUncheckedExtrinsic +{ + type Call = Call; + fn call(&self) -> &Self::Call { self.0.call() } } -impl Checkable - for AcalaUncheckedExtrinsic +impl Checkable + for AcalaUncheckedExtrinsic where - Call: Encode + Member, - Extra: SignedExtension, - ConvertEthTx: Convert<(Call, Extra), Result<(EthereumTransactionMessage, Extra), InvalidTransaction>>, + Call: TypeInfo + Encode + Member + Dispatchable, + Extension: Encode + TransactionExtension, + ConvertEthTx: Convert<(Call, Extension), Result<(EthereumTransactionMessage, Extension), InvalidTransaction>>, StorageDepositPerByte: Get, TxFeePerGas: Get, Lookup: traits::Lookup, { - type Checked = CheckedExtrinsic; + type Checked = CheckedExtrinsic; fn check(self, lookup: &Lookup) -> Result { let function = self.0.function.clone(); - match self.0.signature { - Some((addr, AcalaMultiSignature::Ethereum(sig), extra)) => { + match self.0.preamble { + Preamble::Signed(addr, AcalaMultiSignature::Ethereum(sig), extra) => { let (eth_msg, eth_extra) = ConvertEthTx::convert((function.clone(), extra))?; log::trace!( target: "evm", "Ethereum eth_msg: {:?}", eth_msg @@ -151,11 +203,11 @@ where } Ok(CheckedExtrinsic { - signed: Some((account_id, eth_extra)), + format: ExtrinsicFormat::Signed(account_id, eth_extra), function, }) } - Some((addr, AcalaMultiSignature::Eip2930(sig), extra)) => { + Preamble::Signed(addr, AcalaMultiSignature::Eip2930(sig), extra) => { let (eth_msg, eth_extra) = ConvertEthTx::convert((function.clone(), extra))?; log::trace!( target: "evm", "Eip2930 eth_msg: {:?}", eth_msg @@ -201,11 +253,11 @@ where } Ok(CheckedExtrinsic { - signed: Some((account_id, eth_extra)), + format: ExtrinsicFormat::Signed(account_id, eth_extra), function, }) } - Some((addr, AcalaMultiSignature::Eip1559(sig), extra)) => { + Preamble::Signed(addr, AcalaMultiSignature::Eip1559(sig), extra) => { let (eth_msg, eth_extra) = ConvertEthTx::convert((function.clone(), extra))?; log::trace!( target: "evm", "Eip1559 eth_msg: {:?}", eth_msg @@ -249,11 +301,11 @@ where } Ok(CheckedExtrinsic { - signed: Some((account_id, eth_extra)), + format: ExtrinsicFormat::Signed(account_id, eth_extra), function, }) } - Some((addr, AcalaMultiSignature::AcalaEip712(sig), extra)) => { + Preamble::Signed(addr, AcalaMultiSignature::AcalaEip712(sig), extra) => { let (eth_msg, eth_extra) = ConvertEthTx::convert((function.clone(), extra))?; log::trace!( target: "evm", "AcalaEip712 eth_msg: {:?}", eth_msg @@ -269,7 +321,7 @@ where } Ok(CheckedExtrinsic { - signed: Some((account_id, eth_extra)), + format: ExtrinsicFormat::Signed(account_id, eth_extra), function, }) } @@ -286,19 +338,13 @@ where } } -impl GetDispatchInfo - for AcalaUncheckedExtrinsic -where - Call: GetDispatchInfo, - Extra: SignedExtension, -{ - fn get_dispatch_info(&self) -> DispatchInfo { - self.0.get_dispatch_info() - } -} - -impl serde::Serialize - for AcalaUncheckedExtrinsic +impl< + Call: TypeInfo + Encode + Dispatchable, + Extension: TransactionExtension, + ConvertEthTx, + StorageDepositPerByte, + TxFeePerGas, + > serde::Serialize for AcalaUncheckedExtrinsic { fn serialize(&self, seq: S) -> Result where @@ -308,8 +354,15 @@ impl serde::Deserialize<'a> - for AcalaUncheckedExtrinsic +impl< + 'a, + Call: TypeInfo + Decode + Dispatchable, + Extension: TransactionExtension, + ConvertEthTx, + StorageDepositPerByte, + TxFeePerGas, + > serde::Deserialize<'a> + for AcalaUncheckedExtrinsic { fn deserialize(de: D) -> Result where @@ -320,6 +373,32 @@ impl<'a, Call: Decode, Extra: SignedExtension, ConvertEthTx, StorageDepositPerBy } } +impl< + Call: TypeInfo + Dispatchable, + Extension: TransactionExtension, + ConvertEthTx, + StorageDepositPerByte, + TxFeePerGas, + > SignedTransactionBuilder + for AcalaUncheckedExtrinsic +{ + type Address = Address; + type Signature = AcalaMultiSignature; + type Extension = Extension; + + fn new_signed_transaction( + call: Self::Call, + signed: Address, + signature: AcalaMultiSignature, + tx_ext: Extension, + ) -> Self { + AcalaUncheckedExtrinsic( + UncheckedExtrinsic::new_signed(call, signed, signature, tx_ext), + PhantomData, + ) + } +} + fn recover_signer(sig: &[u8; 65], msg_hash: &[u8; 32]) -> Option { secp256k1_ecdsa_recover(sig, msg_hash) .map(|pubkey| H160::from(H256::from_slice(&keccak_256(&pubkey)))) @@ -359,7 +438,7 @@ fn verify_eip712_signature(eth_msg: EthereumTransactionMessage, sig: [u8; 65]) - let mut access_list: Vec<[u8; 32]> = Vec::new(); eth_msg.access_list.iter().for_each(|v| { let mut access_list_msg = access_list_type_hash.to_vec(); - access_list_msg.extend_from_slice(&to_bytes(v.address.as_bytes())); + access_list_msg.extend_from_slice(&to_bytes(U256::from_big_endian(v.address.as_bytes()))); access_list_msg.extend_from_slice(&keccak_256( &v.storage_keys.iter().map(|v| v.as_bytes()).collect::>().concat(), )); @@ -407,7 +486,6 @@ mod tests { use super::*; use hex_literal::hex; use module_evm_utility::ethereum::AccessListItem; - use sp_core::U256; use std::{ops::Add, str::FromStr}; #[test] diff --git a/runtime/acala/src/constants.rs b/runtime/acala/src/constants.rs index 7c3110463..4d9b43cf0 100644 --- a/runtime/acala/src/constants.rs +++ b/runtime/acala/src/constants.rs @@ -109,6 +109,6 @@ mod tests { let q = Balance::from(ExtrinsicBaseWeight::get().ref_time()); assert_eq!(p, 1_000_000_000); - assert_eq!(q, 107_074_000); + assert_eq!(q, 108_157_000); } } diff --git a/runtime/acala/src/lib.rs b/runtime/acala/src/lib.rs index 967731b8d..ee35cab4a 100644 --- a/runtime/acala/src/lib.rs +++ b/runtime/acala/src/lib.rs @@ -30,13 +30,15 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -use parity_scale_codec::{Decode, DecodeLimit, Encode}; +extern crate alloc; +use alloc::borrow::Cow; +use parity_scale_codec::{Decode, DecodeLimit, DecodeWithMemTracking, Encode}; use polkadot_parachain_primitives::primitives::Sibling; use scale_info::TypeInfo; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H160}; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, + generic, impl_opaque_keys, traits::{ AccountIdConversion, AccountIdLookup, BadOrigin, BlakeTwo256, Block as BlockT, Bounded, Convert, IdentityLookup, SaturatedConversion, StaticLookup, @@ -125,14 +127,14 @@ pub mod xcm_config; /// This runtime version. #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("acala"), - impl_name: create_runtime_str!("acala"), + spec_name: Cow::Borrowed("acala"), + impl_name: Cow::Borrowed("acala"), authoring_version: 1, spec_version: 2300, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, - state_version: 1, + system_version: 1, }; /// The version information used to identify this runtime when compiled @@ -235,6 +237,11 @@ impl Contains for BaseCallFilter { | pallet_xcm::Call::transfer_assets_using_type_and_then { .. } => { return true; } + pallet_xcm::Call::add_authorized_alias { .. } + | pallet_xcm::Call::remove_authorized_alias { .. } + | pallet_xcm::Call::remove_all_authorized_aliases { .. } => { + return false; + } // xcm operations call pallet_xcm::Call::force_xcm_version { .. } | pallet_xcm::Call::force_default_xcm_version { .. } @@ -277,6 +284,7 @@ impl frame_system::Config for Runtime { type DbWeight = RocksDbWeight; type BaseCallFilter = BaseCallFilter; type SystemWeightInfo = (); + type ExtensionsWeightInfo = (); type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = ConstU32<16>; @@ -317,6 +325,7 @@ impl pallet_session::Config for Runtime { type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = (); + type DisablingStrategy = (); } parameter_types! { @@ -382,6 +391,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_types! { @@ -426,6 +436,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -456,6 +469,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -486,6 +502,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -516,6 +535,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -564,6 +586,7 @@ impl pallet_multisig::Config for Runtime { type DepositFactor = MultisigDepositFactor; type MaxSignatories = ConstU32<100>; type WeightInfo = (); + type BlockNumberProvider = System; } pub struct GeneralCouncilProvider; @@ -634,6 +657,7 @@ impl pallet_treasury::Config for Runtime { type Paymaster = PayFromAccount; type BalanceConverter = UnityAssetBalanceConversion; type PayoutPeriod = PayoutSpendPeriod; + type BlockNumberProvider = System; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); } @@ -986,6 +1010,7 @@ impl pallet_scheduler::Config for Runtime { type WeightInfo = (); type OriginPrivilegeCmp = EqualPrivilegeOnly; type Preimages = Preimage; + type BlockNumberProvider = System; } parameter_types! { @@ -1041,15 +1066,12 @@ impl frame_system::offchain::CreateSignedTransaction for R where RuntimeCall: From, { - fn create_transaction>( + fn create_signed_transaction>( call: RuntimeCall, public: ::Signer, account: AccountId, nonce: Nonce, - ) -> Option<( - RuntimeCall, - ::SignaturePayload, - )> { + ) -> Option { // take the biggest period possible. let period = BlockHashCount::get() .checked_next_power_of_two() @@ -1061,7 +1083,7 @@ where // so the actual block number is `n`. .saturating_sub(1); let tip = 0; - let extra: SignedExtra = ( + let tx_ext: TxExtension = ( frame_system::CheckNonZeroSender::::new(), frame_system::CheckSpecVersion::::new(), frame_system::CheckTxVersion::::new(), @@ -1073,15 +1095,16 @@ where module_evm::SetEvmOrigin::::new(), module_transaction_payment::ChargeTransactionPayment::::from(tip), ); - let raw_payload = SignedPayload::new(call, extra) + let raw_payload = SignedPayload::new(call, tx_ext) .map_err(|e| { log::warn!("Unable to create signed payload: {:?}", e); }) .ok()?; let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?; let address = AccountIdLookup::unlookup(account); - let (call, extra, _) = raw_payload.deconstruct(); - Some((call, (address, signature, extra))) + let (call, tx_ext, _) = raw_payload.deconstruct(); + let transaction = UncheckedExtrinsic::new_signed(call, address, signature, tx_ext); + Some(transaction) } } impl frame_system::offchain::SigningTypes for Runtime { @@ -1089,14 +1112,34 @@ impl frame_system::offchain::SigningTypes for Runtime { type Signature = Signature; } -impl frame_system::offchain::SendTransactionTypes for Runtime +impl frame_system::offchain::CreateTransactionBase for Runtime where RuntimeCall: From, { - type OverarchingCall = RuntimeCall; + type RuntimeCall = RuntimeCall; type Extrinsic = UncheckedExtrinsic; } +impl frame_system::offchain::CreateTransaction for Runtime +where + RuntimeCall: From, +{ + type Extension = TxExtension; + + fn create_transaction(call: RuntimeCall, extension: TxExtension) -> UncheckedExtrinsic { + UncheckedExtrinsic::new_transaction(call, extension) + } +} + +impl frame_system::offchain::CreateInherent for Runtime +where + RuntimeCall: From, +{ + fn create_inherent(call: Self::RuntimeCall) -> Self::Extrinsic { + UncheckedExtrinsic::new_bare(call) + } +} + parameter_types! { pub DefaultLiquidationRatio: Ratio = Ratio::saturating_from_rational(150, 100); pub DefaultDebitExchangeRate: ExchangeRate = ExchangeRate::saturating_from_rational(1, 10); @@ -1245,7 +1288,7 @@ parameter_types! { type NegativeImbalance = >::NegativeImbalance; pub struct DealWithFees; impl OnUnbalanced for DealWithFees { - fn on_unbalanceds(mut fees_then_tips: impl Iterator) { + fn on_unbalanceds(mut fees_then_tips: impl Iterator) { if let Some(mut fees) = fees_then_tips.next() { if let Some(tips) = fees_then_tips.next() { tips.merge_into(&mut fees); @@ -1464,6 +1507,7 @@ impl pallet_proxy::Config for Runtime { type CallHasher = BlakeTwo256; type AnnouncementDepositBase = AnnouncementDepositBase; type AnnouncementDepositFactor = AnnouncementDepositFactor; + type BlockNumberProvider = System; } parameter_types! { @@ -1476,7 +1520,7 @@ parameter_types! { > = AllPrecompiles::<_, _, _>::acala(); } -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct StorageDepositPerByte; impl> frame_support::traits::Get for StorageDepositPerByte { fn get() -> I { @@ -1487,7 +1531,7 @@ impl> frame_support::traits::Get for StorageDepositPerByte { } // TODO: remove -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct TxFeePerGas; impl> frame_support::traits::Get for TxFeePerGas { fn get() -> I { @@ -1497,7 +1541,7 @@ impl> frame_support::traits::Get for TxFeePerGas { } } -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct TxFeePerGasV2; impl> frame_support::traits::Get for TxFeePerGasV2 { fn get() -> I { @@ -1561,6 +1605,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { CheckRelayNumber, cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases>; type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight; type ConsensusHook = ConsensusHook; + type SelectCore = cumulus_pallet_parachain_system::DefaultCoreSelector; } impl parachain_info::Config for Runtime {} @@ -1691,7 +1736,7 @@ impl orml_xcm::Config for Runtime { } define_combined_task! { - #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] pub enum ScheduledTasks { EvmTask(EvmTask), } @@ -1945,8 +1990,8 @@ pub type Block = generic::Block; pub type SignedBlock = generic::SignedBlock; /// BlockId type as expected by this runtime. pub type BlockId = generic::BlockId; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( +/// The extension to the basic transaction logic. +pub type TxExtension = ( frame_system::CheckNonZeroSender, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, @@ -1963,11 +2008,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = - AcalaUncheckedExtrinsic; + AcalaUncheckedExtrinsic; /// The payload being signed in transactions. -pub type SignedPayload = generic::SignedPayload; +pub type SignedPayload = generic::SignedPayload; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -2123,10 +2168,10 @@ sp_api::impl_runtime_apis! { Balance, > for Runtime { fn query_info(uxt: ::Extrinsic, len: u32) -> RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) + TransactionPayment::query_info(uxt.0, len) } fn query_fee_details(uxt: ::Extrinsic, len: u32) -> pallet_transaction_payment_rpc_runtime_api::FeeDetails { - TransactionPayment::query_fee_details(uxt, len) + TransactionPayment::query_fee_details(uxt.0, len) } fn query_weight_to_fee(weight: Weight) -> Balance { TransactionPayment::weight_to_fee(weight) @@ -2213,6 +2258,7 @@ sp_api::impl_runtime_apis! { gas_limit, storage_limit, access_list.unwrap_or_default().into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], ::config(), ) } @@ -2233,6 +2279,7 @@ sp_api::impl_runtime_apis! { gas_limit, storage_limit, access_list.unwrap_or_default().into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], ::config(), ) } @@ -2371,7 +2418,7 @@ sp_api::impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig - ) -> Result, sp_runtime::RuntimeString> { + ) -> Result, alloc::string::String> { use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError, add_benchmark as frame_add_benchmark}; use module_nft::benchmarking::Pallet as NftBench; use frame_support::traits::{WhitelistedStorageKeys, TrackedStorageKey}; @@ -2493,15 +2540,15 @@ cumulus_pallet_parachain_system::register_validate_block!( BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, ); -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug)] pub struct ConvertEthereumTx; -impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, SignedExtra), InvalidTransaction>> +impl Convert<(RuntimeCall, TxExtension), Result<(EthereumTransactionMessage, TxExtension), InvalidTransaction>> for ConvertEthereumTx { fn convert( - (call, mut extra): (RuntimeCall, SignedExtra), - ) -> Result<(EthereumTransactionMessage, SignedExtra), InvalidTransaction> { + (call, mut extra): (RuntimeCall, TxExtension), + ) -> Result<(EthereumTransactionMessage, TxExtension), InvalidTransaction> { match call { RuntimeCall::EVM(module_evm::Call::eth_call { action, diff --git a/runtime/acala/src/weights/pallet_xcm.rs b/runtime/acala/src/weights/pallet_xcm.rs index 6bc7526c0..dbe532b9a 100644 --- a/runtime/acala/src/weights/pallet_xcm.rs +++ b/runtime/acala/src/weights/pallet_xcm.rs @@ -359,4 +359,24 @@ impl pallet_xcm::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } } diff --git a/runtime/acala/src/xcm_config.rs b/runtime/acala/src/xcm_config.rs index 0d046562e..6a74afae9 100644 --- a/runtime/acala/src/xcm_config.rs +++ b/runtime/acala/src/xcm_config.rs @@ -26,7 +26,7 @@ use super::{ use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use frame_support::{ parameter_types, - traits::{ConstU32, Everything, Get, Nothing, TransformOrigin}, + traits::{ConstU32, Disabled, Everything, Get, Nothing, TransformOrigin}, }; use module_asset_registry::{ BuyWeightRateOfErc20, BuyWeightRateOfForeignAsset, BuyWeightRateOfLiquidCrowdloan, BuyWeightRateOfStableAsset, @@ -164,6 +164,7 @@ impl xcm_executor::Config for XcmConfig { type HrmpChannelAcceptedHandler = (); type HrmpChannelClosingHandler = (); type XcmRecorder = (); + type XcmEventEmitter = (); } pub type LocalOriginToLocation = SignedToAccountId32; @@ -209,6 +210,7 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRootOrThreeFourthsGeneralCouncil; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type AuthorizedAliasConsideration = Disabled; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/runtime/common/src/check_nonce.rs b/runtime/common/src/check_nonce.rs index e10527c30..ffe394ae2 100644 --- a/runtime/common/src/check_nonce.rs +++ b/runtime/common/src/check_nonce.rs @@ -16,17 +16,17 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use frame_support::dispatch::DispatchInfo; +use frame_support::{dispatch::DispatchInfo, pallet_prelude::DispatchResult, RuntimeDebugNoBound}; use frame_system::pallet_prelude::*; use module_support::AddressMapping; -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use scale_info::TypeInfo; use sp_runtime::{ - traits::{DispatchInfoOf, Dispatchable, One, SignedExtension, Zero}, + traits::{DispatchInfoOf, DispatchOriginOf, Dispatchable, One, PostDispatchInfoOf, TransactionExtension, Zero}, transaction_validity::{ - InvalidTransaction, TransactionLongevity, TransactionValidity, TransactionValidityError, ValidTransaction, + InvalidTransaction, TransactionLongevity, TransactionSource, TransactionValidityError, ValidTransaction, }, - SaturatedConversion, + SaturatedConversion, Saturating, Weight, }; use sp_std::vec; @@ -37,7 +37,7 @@ use sp_std::vec; /// This extension affects `requires` and `provides` tags of validity, but DOES NOT /// set the `priority` field. Make sure that AT LEAST one of the signed extension sets /// some kind of priority upon validating transactions. -#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] pub struct CheckNonce { #[codec(compact)] @@ -90,71 +90,96 @@ impl sp_std::fmt::Debug for CheckN } } -impl SignedExtension for CheckNonce +/// Operation to perform from `validate` to `prepare` in [`CheckNonce`] transaction extension. +#[derive(RuntimeDebugNoBound)] +pub enum Val { + /// Account and its nonce to check for. + CheckNonce((T::AccountId, T::Nonce)), + /// Weight to refund. + Refund(Weight), +} + +/// Operation to perform from `prepare` to `post_dispatch_details` in [`CheckNonce`] transaction +/// extension. +#[derive(RuntimeDebugNoBound)] +pub enum Pre { + /// The transaction extension weight should not be refunded. + NonceChecked, + /// The transaction extension weight should be refunded. + Refund(Weight), +} + +impl TransactionExtension for CheckNonce where T::RuntimeCall: Dispatchable, T::AddressMapping: AddressMapping, { - type AccountId = T::AccountId; - type Call = T::RuntimeCall; - type AdditionalSigned = (); - type Pre = (); const IDENTIFIER: &'static str = "CheckNonce"; + type Implicit = (); + type Val = Val; + type Pre = Pre; - fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { - Ok(()) + fn weight(&self, _: &T::RuntimeCall) -> Weight { + // TODO: implement + Weight::zero() } - fn pre_dispatch( + fn prepare( self, - who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, + val: Self::Val, + _origin: &DispatchOriginOf, + _call: &T::RuntimeCall, + _info: &DispatchInfoOf, _len: usize, ) -> Result { - let mut account = frame_system::Account::::get(who); - if self.is_eth_tx { - // should check evm nonce - let address = ::AddressMapping::get_evm_address(who) - .unwrap_or_else(|| ::AddressMapping::get_default_evm_address(who)); - let evm_nonce = module_evm::Accounts::::get(address) - .map(|x| x.nonce) - .unwrap_or_default(); + let (who, nonce) = match val { + Val::CheckNonce((who, nonce)) => (who, nonce), + Val::Refund(weight) => return Ok(Pre::Refund(weight)), + }; + if self.is_eth_tx { if cfg!(feature = "tracing") { // skip check when enable tracing feature - } else if self.nonce != evm_nonce { - return Err(if self.nonce < evm_nonce { + } else if self.nonce != nonce { + return Err(if self.nonce < nonce { InvalidTransaction::Stale } else { InvalidTransaction::Future } .into()); } - } else if self.nonce != account.nonce { - return Err(if self.nonce < account.nonce { + } else if self.nonce != nonce { + return Err(if self.nonce < nonce { InvalidTransaction::Stale } else { InvalidTransaction::Future } .into()); } + let mut account = frame_system::Account::::get(&who); account.nonce += T::Nonce::one(); frame_system::Account::::insert(who, account); - Ok(()) + Ok(Pre::NonceChecked) } fn validate( &self, - who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, + origin: DispatchOriginOf, + call: &T::RuntimeCall, + _info: &DispatchInfoOf, _len: usize, - ) -> TransactionValidity { + _self_implicit: Self::Implicit, + _inherited_implication: &impl Encode, + _source: TransactionSource, + ) -> Result<(ValidTransaction, Self::Val, DispatchOriginOf), TransactionValidityError> { + let Ok(who) = frame_system::ensure_signed(origin.clone()) else { + return Ok((ValidTransaction::default(), Val::Refund(self.weight(call)), origin)); + }; + if self.is_eth_tx { // should check evm nonce - let address = ::AddressMapping::get_evm_address(who) - .unwrap_or_else(|| ::AddressMapping::get_default_evm_address(who)); + let address = ::AddressMapping::get_evm_address(&who) + .unwrap_or_else(|| ::AddressMapping::get_default_evm_address(&who)); let evm_nonce = module_evm::Accounts::::get(address) .map(|x| x.nonce) .unwrap_or_default(); @@ -162,46 +187,63 @@ where if cfg!(feature = "tracing") { // skip check when enable tracing feature } else if self.nonce < evm_nonce { - return InvalidTransaction::Stale.into(); + return Err(InvalidTransaction::Stale.into()); } let provides = vec![Encode::encode(&(address, self.nonce))]; let requires = if evm_nonce < self.nonce { - vec![Encode::encode(&(address, self.nonce - One::one()))] + vec![Encode::encode(&(address, self.nonce.saturating_sub(One::one())))] } else { vec![] }; let longevity: TransactionLongevity = self.eth_tx_valid_until.saturated_into(); - Ok(ValidTransaction { + let validity = ValidTransaction { priority: 0, requires, provides, longevity, propagate: true, - }) + }; + + Ok((validity, Val::CheckNonce((who.clone(), evm_nonce)), origin)) } else { // check index - let account = frame_system::Account::::get(who); + let account = frame_system::Account::::get(&who); if self.nonce < account.nonce { - return InvalidTransaction::Stale.into(); + return Err(InvalidTransaction::Stale.into()); } - let provides = vec![Encode::encode(&(who, self.nonce))]; + let provides = vec![Encode::encode(&(&who, self.nonce))]; let requires = if account.nonce < self.nonce { - vec![Encode::encode(&(who, self.nonce - One::one()))] + vec![Encode::encode(&(&who, self.nonce.saturating_sub(One::one())))] } else { vec![] }; - Ok(ValidTransaction { + let validity = ValidTransaction { priority: 0, requires, provides, longevity: TransactionLongevity::MAX, propagate: true, - }) + }; + + Ok((validity, Val::CheckNonce((who.clone(), account.nonce)), origin)) + } + } + + fn post_dispatch_details( + pre: Self::Pre, + _info: &DispatchInfo, + _post_info: &PostDispatchInfoOf, + _len: usize, + _result: &DispatchResult, + ) -> Result { + match pre { + Pre::NonceChecked => Ok(Weight::zero()), + Pre::Refund(weight) => Ok(weight), } } } @@ -210,7 +252,8 @@ where mod tests { use super::*; use crate::mock::{new_test_ext, AccountId32, RuntimeCall, TestRuntime}; - use frame_support::{assert_noop, assert_ok}; + use frame_support::assert_ok; + use sp_runtime::{traits::DispatchTransaction, transaction_validity::TransactionSource::External}; /// A simple call, which one doesn't matter. pub const CALL: &::RuntimeCall = @@ -231,23 +274,50 @@ mod tests { }, ); let info = DispatchInfo::default(); + let len = 0_usize; // stale - assert_noop!( - CheckNonce::::from(0).validate(&alice, CALL, &info, 0), - InvalidTransaction::Stale + assert_eq!( + CheckNonce::::from(0) + .validate_only(Some(alice.clone()).into(), CALL, &info, len, External, 0) + .unwrap_err(), + TransactionValidityError::Invalid(InvalidTransaction::Stale) ); - assert_noop!( - CheckNonce::::from(0).pre_dispatch(&alice, CALL, &info, 0), - InvalidTransaction::Stale + assert_eq!( + CheckNonce::::from(0) + .validate_and_prepare(Some(alice.clone()).into(), CALL, &info, len, 0) + .unwrap_err(), + TransactionValidityError::Invalid(InvalidTransaction::Stale) ); // correct - assert_ok!(CheckNonce::::from(1).validate(&alice, CALL, &info, 0)); - assert_ok!(CheckNonce::::from(1).pre_dispatch(&alice, CALL, &info, 0)); + assert_ok!(CheckNonce::::from(1).validate_only( + Some(alice.clone()).into(), + CALL, + &info, + len, + External, + 0 + )); + assert_ok!(CheckNonce::::from(1).validate_and_prepare( + Some(alice.clone()).into(), + CALL, + &info, + len, + 0 + )); // future - assert_ok!(CheckNonce::::from(5).validate(&alice, CALL, &info, 0)); - assert_noop!( - CheckNonce::::from(5).pre_dispatch(&alice, CALL, &info, 0), - InvalidTransaction::Future + assert_ok!(CheckNonce::::from(5).validate_only( + Some(alice.clone()).into(), + CALL, + &info, + len, + External, + 0 + )); + assert_eq!( + CheckNonce::::from(5) + .validate_and_prepare(Some(alice).into(), CALL, &info, len, 0) + .unwrap_err(), + TransactionValidityError::Invalid(InvalidTransaction::Future) ); }) } @@ -281,24 +351,27 @@ mod tests { ); let info = DispatchInfo::default(); + let len = 0_usize; // stale - assert_noop!( + assert_eq!( CheckNonce:: { nonce: 0u32, is_eth_tx: true, eth_tx_valid_until: 10 } - .validate(&alice, CALL, &info, 0), - InvalidTransaction::Stale + .validate_and_prepare(Some(alice.clone()).into(), CALL, &info, len, 0) + .unwrap_err(), + TransactionValidityError::Invalid(InvalidTransaction::Stale) ); - assert_noop!( + assert_eq!( CheckNonce:: { nonce: 0u32, is_eth_tx: true, eth_tx_valid_until: 10 } - .pre_dispatch(&alice, CALL, &info, 0), - InvalidTransaction::Stale + .validate_and_prepare(Some(alice.clone()).into(), CALL, &info, len, 0) + .unwrap_err(), + TransactionValidityError::Invalid(InvalidTransaction::Stale) ); assert_eq!( @@ -307,21 +380,23 @@ mod tests { is_eth_tx: true, eth_tx_valid_until: 10 } - .validate(&alice, CALL, &info, 0), - Ok(ValidTransaction { + .validate_only(Some(alice.clone()).into(), CALL, &info, len, External, 0) + .unwrap() + .0, + ValidTransaction { priority: 0, requires: vec![], provides: vec![Encode::encode(&(address, 1u32))], longevity: 10, propagate: true, - }) + } ); assert_ok!(CheckNonce:: { nonce: 1u32, is_eth_tx: true, eth_tx_valid_until: 10 } - .pre_dispatch(&alice, CALL, &info, 0),); + .validate_and_prepare(Some(alice.clone()).into(), CALL, &info, len, 0),); assert_eq!( CheckNonce:: { @@ -329,23 +404,26 @@ mod tests { is_eth_tx: true, eth_tx_valid_until: 10 } - .validate(&alice, CALL, &info, 0), - Ok(ValidTransaction { + .validate_only(Some(alice.clone()).into(), CALL, &info, len, External, 0) + .unwrap() + .0, + ValidTransaction { priority: 0, requires: vec![Encode::encode(&(address, 2u32))], provides: vec![Encode::encode(&(address, 3u32))], longevity: 10, propagate: true, - }) + } ); - assert_noop!( + assert_eq!( CheckNonce:: { nonce: 3u32, is_eth_tx: true, eth_tx_valid_until: 10 } - .pre_dispatch(&alice, CALL, &info, 0), - InvalidTransaction::Future + .validate_and_prepare(Some(alice).into(), CALL, &info, len, 0) + .unwrap_err(), + TransactionValidityError::Invalid(InvalidTransaction::Future) ); }) } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index d4461b0ca..bff5d8f9f 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -33,7 +33,7 @@ use frame_support::{ }; use frame_system::{limits, pallet_prelude::BlockNumberFor, EnsureRoot}; use orml_traits::{currency::MutationHooks, GetByKey}; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use polkadot_parachain_primitives::primitives::RelayChainBlockNumber; use primitives::{ evm::{is_system_contract, CHAIN_ID_ACALA_TESTNET, CHAIN_ID_KARURA_TESTNET, CHAIN_ID_MANDALA}, @@ -171,7 +171,7 @@ pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), // TODO: drop `* 10` after https://github.com/paritytech/substrate/issues/13501 // and the benchmarked size is not 10x of the measured size - polkadot_primitives::v7::MAX_POV_SIZE as u64 * 10, + polkadot_primitives::v8::MAX_POV_SIZE as u64 * 10, ); const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct()); @@ -359,7 +359,20 @@ pub type EnsureRootOrOneTechnicalCommittee = EitherOfDiverse, pallet_collective::EnsureMember>; /// The type used to represent the kinds of proxying allowed. -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive( + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + DecodeWithMemTracking, + RuntimeDebug, + MaxEncodedLen, + TypeInfo, +)] pub enum ProxyType { Any, CancelProxy, diff --git a/runtime/common/src/mock.rs b/runtime/common/src/mock.rs index 0405105a0..b2a147213 100644 --- a/runtime/common/src/mock.rs +++ b/runtime/common/src/mock.rs @@ -29,7 +29,7 @@ use module_support::{ DispatchableTask, }; use orml_traits::parameter_type_with_key; -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode}; use primitives::{ define_combined_task, evm::convert_decimals_to_evm, task::TaskResult, Amount, BlockNumber, CurrencyId, Nonce, ReserveIdentifier, TokenSymbol, @@ -73,6 +73,7 @@ impl pallet_balances::Config for TestRuntime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } impl pallet_timestamp::Config for TestRuntime { @@ -115,7 +116,7 @@ impl orml_currencies::Config for TestRuntime { pub type AdaptedBasicCurrency = orml_currencies::BasicCurrencyAdapter; define_combined_task! { - #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] pub enum ScheduledTasks { EvmTask(EvmTask), } diff --git a/runtime/common/src/precompile/evm.rs b/runtime/common/src/precompile/evm.rs index 9256d1dfe..2223ab522 100644 --- a/runtime/common/src/precompile/evm.rs +++ b/runtime/common/src/precompile/evm.rs @@ -403,6 +403,7 @@ mod tests { 21_000_000, 21_000_000, vec![], + vec![], ::config(), ) .unwrap(); diff --git a/runtime/common/src/precompile/input.rs b/runtime/common/src/precompile/input.rs index 9a300a2f0..8fc6022e7 100644 --- a/runtime/common/src/precompile/input.rs +++ b/runtime/common/src/precompile/input.rs @@ -315,7 +315,7 @@ where fn decode_i128(bytes: &[u8]) -> Option { if bytes[0..HALF_PARAM_BYTES] == [0xff; HALF_PARAM_BYTES] { - if let Ok(v) = i128::try_from(!U256::from(bytes)) { + if let Ok(v) = i128::try_from(!U256::from_big_endian(bytes)) { if let Some(v) = v.checked_neg() { return v.checked_sub(1); } diff --git a/runtime/common/src/precompile/mock.rs b/runtime/common/src/precompile/mock.rs index 208101e12..3199a9308 100644 --- a/runtime/common/src/precompile/mock.rs +++ b/runtime/common/src/precompile/mock.rs @@ -28,7 +28,7 @@ use frame_support::{ weights::{ConstantMultiplier, IdentityFee}, PalletId, }; -use frame_system::{offchain::SendTransactionTypes, EnsureRoot, EnsureSignedBy}; +use frame_system::{EnsureRoot, EnsureSignedBy}; use module_cdp_engine::CollateralCurrencyIds; use module_evm::{EvmChainId, EvmTask}; use module_evm_accounts::EvmAddressMapping; @@ -39,7 +39,7 @@ use module_support::{ SpecificJointsSwap, }; use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key, MultiCurrency, MultiReservableCurrency}; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; pub use primitives::{ define_combined_task, evm::{convert_decimals_to_evm, EvmAddress}, @@ -54,7 +54,7 @@ use sp_runtime::{ AccountId32, DispatchResult, FixedPointNumber, FixedU128, Perbill, Percent, RuntimeDebug, }; use sp_std::prelude::*; -use xcm::{prelude::*, v4::Xcm}; +use xcm::{prelude::*, v5::Xcm}; use xcm_builder::FixedWeightBounds; pub type AccountId = AccountId32; @@ -157,6 +157,7 @@ impl pallet_balances::Config for Test { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } pub const ACA: CurrencyId = CurrencyId::Token(TokenSymbol::ACA); @@ -200,7 +201,7 @@ impl module_asset_registry::Config for Test { } define_combined_task! { - #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] pub enum ScheduledTasks { EvmTask(EvmTask), } @@ -291,7 +292,20 @@ impl module_transaction_payment::Config for Test { type DefaultFeeTokens = DefaultFeeTokens; } -#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)] +#[derive( + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + DecodeWithMemTracking, + RuntimeDebug, + MaxEncodedLen, + TypeInfo, +)] pub enum ProxyType { Any, JustTransfer, @@ -331,6 +345,7 @@ impl pallet_proxy::Config for Test { type CallHasher = BlakeTwo256; type AnnouncementDepositBase = ConstU128<1>; type AnnouncementDepositFactor = ConstU128<1>; + type BlockNumberProvider = System; } impl pallet_utility::Config for Test { @@ -355,6 +370,7 @@ impl pallet_scheduler::Config for Test { type MaxScheduledPerBlock = ConstU32<50>; type WeightInfo = (); type Preimages = (); + type BlockNumberProvider = System; } pub struct MockDEXIncentives; @@ -875,16 +891,17 @@ impl ExecuteXcm for MockExec { ( 1, Some(Transact { - require_weight_at_most, .. + fallback_max_weight: Some(fallback_max_weight), + .. }), ) => { - if require_weight_at_most.all_lte(weight_limit) { + if fallback_max_weight.all_lte(weight_limit) { Outcome::Complete { - used: *require_weight_at_most, + used: *fallback_max_weight, } } else { Outcome::Error { - error: XcmError::WeightLimitReached(*require_weight_at_most), + error: XcmError::WeightLimitReached(*fallback_max_weight), } } } @@ -1064,12 +1081,21 @@ frame_support::construct_runtime!( } ); -impl SendTransactionTypes for Test +impl frame_system::offchain::CreateTransactionBase for Test where - RuntimeCall: From, + RuntimeCall: From, { - type OverarchingCall = RuntimeCall; type Extrinsic = UncheckedExtrinsic; + type RuntimeCall = RuntimeCall; +} + +impl frame_system::offchain::CreateInherent for Test +where + RuntimeCall: From, +{ + fn create_inherent(call: Self::RuntimeCall) -> Self::Extrinsic { + UncheckedExtrinsic::new_bare(call) + } } #[cfg(test)] diff --git a/runtime/common/src/precompile/xtokens.rs b/runtime/common/src/precompile/xtokens.rs index c6120dff7..6b69e14df 100644 --- a/runtime/common/src/precompile/xtokens.rs +++ b/runtime/common/src/precompile/xtokens.rs @@ -32,7 +32,7 @@ use sp_runtime::{traits::Convert, RuntimeDebug}; use sp_std::{marker::PhantomData, prelude::*}; use xcm::{ prelude::*, - v4::{Asset, Assets, Location}, + v5::{Asset, Assets, Location}, }; /// The `Xtokens` impl precompile. @@ -586,7 +586,7 @@ mod tests { caller: alice_evm_addr(), apparent_value: Default::default(), }; - let dest: VersionedLocation = VersionedLocation::V4(Location::new( + let dest: VersionedLocation = VersionedLocation::V5(Location::new( 1, [ Parachain(2002), @@ -598,7 +598,7 @@ mod tests { )); assert_eq!( dest.encode(), - hex!("04010200491f01000202020202020202020202020202020202020202020202020202020202020202") + hex!("05010200491f01000202020202020202020202020202020202020202020202020202020202020202") ); let weight = WeightLimit::Unlimited; @@ -653,9 +653,9 @@ mod tests { apparent_value: Default::default(), }; let asset: VersionedAsset = (Here, 1_000_000_000_000u128).into(); - assert_eq!(asset.encode(), hex!("04000000070010a5d4e8")); + assert_eq!(asset.encode(), hex!("05000000070010a5d4e8")); - let dest: VersionedLocation = VersionedLocation::V4( + let dest: VersionedLocation = VersionedLocation::V5( Junction::AccountId32 { network: None, id: BOB.into(), @@ -664,7 +664,7 @@ mod tests { ); assert_eq!( dest.encode(), - hex!("04000101000202020202020202020202020202020202020202020202020202020202020202") + hex!("05000101000202020202020202020202020202020202020202020202020202020202020202") ); let weight = WeightLimit::Limited(Weight::from_parts(100_000, 64 * 1024)); @@ -717,7 +717,7 @@ mod tests { caller: alice_evm_addr(), apparent_value: Default::default(), }; - let dest: VersionedLocation = VersionedLocation::V4( + let dest: VersionedLocation = VersionedLocation::V5( Junction::AccountId32 { network: None, id: BOB.into(), @@ -726,7 +726,7 @@ mod tests { ); assert_eq!( dest.encode(), - hex!("04000101000202020202020202020202020202020202020202020202020202020202020202") + hex!("05000101000202020202020202020202020202020202020202020202020202020202020202") ); let weight = WeightLimit::Limited(Weight::from_parts(100_000, 64 * 1024)); @@ -780,12 +780,12 @@ mod tests { apparent_value: Default::default(), }; let asset: VersionedAsset = (Here, 1_000_000_000_000u128).into(); - assert_eq!(asset.encode(), hex!("04000000070010a5d4e8")); + assert_eq!(asset.encode(), hex!("05000000070010a5d4e8")); let fee: VersionedAsset = (Here, 1_000_000).into(); - assert_eq!(fee.encode(), hex!("0400000002093d00")); + assert_eq!(fee.encode(), hex!("0500000002093d00")); - let dest: VersionedLocation = VersionedLocation::V4( + let dest: VersionedLocation = VersionedLocation::V5( Junction::AccountId32 { network: None, id: BOB.into(), @@ -794,7 +794,7 @@ mod tests { ); assert_eq!( dest.encode(), - hex!("04000101000202020202020202020202020202020202020202020202020202020202020202") + hex!("05000101000202020202020202020202020202020202020202020202020202020202020202") ); let weight = WeightLimit::Limited(Weight::from_parts(100_000, 64 * 1024)); @@ -853,7 +853,7 @@ mod tests { caller: alice_evm_addr(), apparent_value: Default::default(), }; - let dest: VersionedLocation = VersionedLocation::V4( + let dest: VersionedLocation = VersionedLocation::V5( Junction::AccountId32 { network: None, id: BOB.into(), @@ -862,7 +862,7 @@ mod tests { ); assert_eq!( dest.encode(), - hex!("04000101000202020202020202020202020202020202020202020202020202020202020202") + hex!("05000101000202020202020202020202020202020202020202020202020202020202020202") ); let weight = WeightLimit::Limited(Weight::from_parts(100_000, 64 * 1024)); @@ -927,9 +927,9 @@ mod tests { apparent_value: Default::default(), }; let assets: VersionedAssets = VersionedAssets::from(Assets::from((Here, 1_000_000_000_000u128))); - assert_eq!(assets.encode(), hex!("0404000000070010a5d4e8")); + assert_eq!(assets.encode(), hex!("0504000000070010a5d4e8")); - let dest: VersionedLocation = VersionedLocation::V4( + let dest: VersionedLocation = VersionedLocation::V5( Junction::AccountId32 { network: None, id: BOB.into(), @@ -938,7 +938,7 @@ mod tests { ); assert_eq!( dest.encode(), - hex!("04000101000202020202020202020202020202020202020202020202020202020202020202") + hex!("05000101000202020202020202020202020202020202020202020202020202020202020202") ); let weight = WeightLimit::Limited(Weight::from_parts(100_000, 64 * 1024)); diff --git a/runtime/common/src/xcm_impl.rs b/runtime/common/src/xcm_impl.rs index 083260fc9..5720c3d43 100644 --- a/runtime/common/src/xcm_impl.rs +++ b/runtime/common/src/xcm_impl.rs @@ -29,10 +29,10 @@ use primitives::{evm::EvmAddress, Balance, CurrencyId}; use sp_core::bounded::BoundedVec; use sp_runtime::{traits::Convert, FixedPointNumber, FixedU128}; use sp_std::{marker::PhantomData, prelude::*}; -use xcm::v4::{prelude::*, Assets, Weight as XcmWeight}; +use xcm::v5::{prelude::*, Assets, Weight as XcmWeight}; use xcm_builder::TakeRevenue; use xcm_executor::{ - traits::{DropAssets, WeightTrader, XcmAssetTransfers}, + traits::{DropAssets, FeeManager, FeeReason, WeightTrader, XcmAssetTransfers}, AssetsInHolding, }; @@ -278,6 +278,18 @@ impl FeeManager + for XcmExecutor +{ + fn is_waived(_origin: Option<&Location>, _: FeeReason) -> bool { + false + } + + fn handle_fee(_assets: Assets, _: Option<&XcmContext>, _: FeeReason) {} +} + /// Convert `AccountKey20` to `AccountId` pub struct AccountKey20Aliases(PhantomData<(Network, AccountId, AddressMapping)>); impl xcm_executor::traits::ConvertLocation diff --git a/runtime/integration-tests/src/evm.rs b/runtime/integration-tests/src/evm.rs index 485e0cea6..19ab6fca5 100644 --- a/runtime/integration-tests/src/evm.rs +++ b/runtime/integration-tests/src/evm.rs @@ -31,11 +31,7 @@ use primitives::{ Position, TradingPair, }; use sp_core::{H256, U256}; -use sp_runtime::{ - traits::SignedExtension, - transaction_validity::{InvalidTransaction, TransactionValidityError}, - Percent, -}; +use sp_runtime::{traits::DispatchTransaction, Percent}; use std::str::FromStr; pub fn erc20_address_0() -> EvmAddress { @@ -107,7 +103,7 @@ pub fn deploy_erc20_contracts() { ], data: { let mut buf = [0u8; 32]; - U256::from(100_000_000_000_000_000_000_000u128).to_big_endian(&mut buf); + U256::from(100_000_000_000_000_000_000_000u128).write_as_big_endian(&mut buf); H256::from_slice(&buf).as_bytes().to_vec() }, }], @@ -142,7 +138,7 @@ pub fn deploy_erc20_contracts() { ], data: { let mut buf = [0u8; 32]; - U256::from(100_000_000_000_000_000_000_000u128).to_big_endian(&mut buf); + U256::from(100_000_000_000_000_000_000_000u128).write_as_big_endian(&mut buf); H256::from_slice(&buf).as_bytes().to_vec() }, }], @@ -968,35 +964,37 @@ fn transaction_payment_module_works_with_evm_contract() { amount: 1, }); let info: DispatchInfo = DispatchInfo { - weight: Weight::from_parts(100, 0), + call_weight: Weight::from_parts(100, 0), + extension_weight: Weight::zero(), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; let fee = module_transaction_payment::Pallet::::compute_fee(len, &info, 0); - assert_debug_snapshot!(fee, @"2500000934"); + assert_debug_snapshot!(fee, @"2500000925"); let surplus_perc = Percent::from_percent(50); // CustomFeeSurplus let fee_surplus = surplus_perc.mul_ceil(fee); let fee = fee + fee_surplus; - assert_debug_snapshot!(fee, @"3750001401"); + assert_debug_snapshot!(fee, @"3750001388"); // empty_account use payment non wrapped call to charge fee by erc20 fee pool. assert_eq!(Currencies::free_balance(erc20_token, &sub_account), 0); assert_ok!( - >::from(0).validate( - &empty_account, + >::from(0).validate_and_prepare( + Some(empty_account.clone()).into(), call, &info, len as usize, + 0 ) ); let erc20_fee = Currencies::free_balance(erc20_token, &sub_account); #[cfg(feature = "with-mandala-runtime")] - assert_debug_snapshot!(erc20_fee, @"10386329737"); + assert_debug_snapshot!(erc20_fee, @"10386329736"); #[cfg(feature = "with-karura-runtime")] - assert_debug_snapshot!(erc20_fee, @"10407164903"); + assert_debug_snapshot!(erc20_fee, @"10407164902"); #[cfg(feature = "with-acala-runtime")] - assert_debug_snapshot!(erc20_fee, @"10407164903"); + assert_debug_snapshot!(erc20_fee, @"10407164902"); assert_eq!( Currencies::free_balance(NATIVE_CURRENCY, &sub_account), @@ -1010,11 +1008,12 @@ fn transaction_payment_module_works_with_evm_contract() { // empty_address use payment non wrapped call to charge fee by erc20 fee pool. assert_ok!( - >::from(0).validate( - &empty_address_account, + >::from(0).validate_and_prepare( + Some(empty_address_account.clone()).into(), call, &info, len as usize, + 0 ) ); assert_eq!(Currencies::free_balance(erc20_token, &sub_account), erc20_fee * 2); @@ -1035,37 +1034,39 @@ fn transaction_payment_module_works_with_evm_contract() { call: Box::new(call.clone()), }); assert_ok!( - >::from(0).validate( - &empty_account, + >::from(0).validate_and_prepare( + Some(empty_account).into(), &with_fee_call, &info, len as usize, + 0 ) ); let erc20_with_fee = Currencies::free_balance(erc20_token, &sub_account) - erc20_fee * 2; #[cfg(feature = "with-karura-runtime")] - assert_debug_snapshot!(erc20_with_fee, @"376162722"); + assert_debug_snapshot!(erc20_with_fee, @"376162721"); #[cfg(feature = "with-acala-runtime")] - assert_debug_snapshot!(erc20_with_fee, @"376162722"); + assert_debug_snapshot!(erc20_with_fee, @"376162721"); #[cfg(feature = "with-mandala-runtime")] - assert_debug_snapshot!(erc20_with_fee, @"375409643"); + assert_debug_snapshot!(erc20_with_fee, @"375409642"); let native_with_fee = 5 * dollar - (fee + ed) * 2 - Currencies::free_balance(NATIVE_CURRENCY, &sub_account); #[cfg(feature = "with-karura-runtime")] - assert_debug_snapshot!(native_with_fee, @"3750001401"); + assert_debug_snapshot!(native_with_fee, @"3750001388"); #[cfg(feature = "with-acala-runtime")] - assert_debug_snapshot!(native_with_fee, @"3750001401"); + assert_debug_snapshot!(native_with_fee, @"3750001388"); #[cfg(feature = "with-mandala-runtime")] - assert_debug_snapshot!(native_with_fee, @"3750001401"); + assert_debug_snapshot!(native_with_fee, @"3750001388"); // empty_address use payment `with_fee_currency` call to charge fee by erc20 fee pool. assert_ok!( - >::from(0).validate( - &empty_address_account, + >::from(0).validate_and_prepare( + Some(empty_address_account).into(), &with_fee_call, &info, len as usize, + 0 ) ); assert_eq!( @@ -1152,7 +1153,7 @@ fn create_contract_use_none_native_token_to_charge_storage() { #[test] fn evm_limits() { ExtBuilder::default().build().execute_with(|| { - assert_debug_snapshot!(runtime_common::EvmLimits::::max_gas_limit(), @"33321436"); + assert_debug_snapshot!(runtime_common::EvmLimits::::max_gas_limit(), @"33321315"); assert_debug_snapshot!(runtime_common::EvmLimits::::max_storage_limit(), @"3670016"); }); } @@ -1518,17 +1519,18 @@ fn transaction_payment_module_charge_erc20_pool() { call: Box::new(call.clone()), }); let info: DispatchInfo = DispatchInfo { - weight: Weight::from_parts(100, 0), + call_weight: Weight::from_parts(100, 0), + extension_weight: Weight::zero(), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; let fee = module_transaction_payment::Pallet::::compute_fee(len, &info, 0); - assert_debug_snapshot!(fee, @"2500000934"); + assert_debug_snapshot!(fee, @"2500000925"); let surplus_perc = Percent::from_percent(50); // CustomFeeSurplus let fee_surplus = surplus_perc.mul_ceil(fee); let fee = fee + fee_surplus; - assert_debug_snapshot!(fee, @"3750001401"); + assert_debug_snapshot!(fee, @"3750001388"); let alice_native_before = Currencies::free_balance(NATIVE_CURRENCY, &alice_evm_account); let alice_erc20_before = Currencies::free_balance(erc20_token, &alice_evm_account); @@ -1536,11 +1538,12 @@ fn transaction_payment_module_charge_erc20_pool() { // charge fee by default ways >::set_origin(alice_evm_account.clone()); assert_ok!( - >::from(0).validate( - &alice_evm_account.clone(), + >::from(0).validate_and_prepare( + Some(alice_evm_account.clone()).into(), call, &info, len as usize, + 0 ) ); @@ -1548,7 +1551,7 @@ fn transaction_payment_module_charge_erc20_pool() { let alice_erc20_after = Currencies::free_balance(erc20_token, &alice_evm_account); // charge tx fee and storage fee by native - assert_debug_snapshot!(alice_native_before - alice_native_after, @"2500000934"); + assert_debug_snapshot!(alice_native_before - alice_native_after, @"2500000925"); assert_eq!(alice_erc20_before - alice_erc20_after, 0); let alice_native_before = Currencies::free_balance(NATIVE_CURRENCY, &account_with_erc20); @@ -1557,11 +1560,12 @@ fn transaction_payment_module_charge_erc20_pool() { // charge erc20 fee for the account only hold erc20 >::set_origin(account_with_erc20.clone()); assert_ok!( - >::from(0).validate( - &account_with_erc20, + >::from(0).validate_and_prepare( + Some(account_with_erc20.clone()).into(), call, &info, len as usize, + 0 ) ); let alice_native_after = Currencies::free_balance(NATIVE_CURRENCY, &account_with_erc20); @@ -1572,24 +1576,24 @@ fn transaction_payment_module_charge_erc20_pool() { assert_debug_snapshot!(alice_native_before, @"0"); assert_debug_snapshot!(alice_native_after, @"237600000000"); assert_debug_snapshot!(alice_erc20_before, @"1000000000000"); - assert_debug_snapshot!(alice_erc20_after, @"975197719831"); - assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"24802280169"); + assert_debug_snapshot!(alice_erc20_after, @"975197719832"); + assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"24802280168"); } #[cfg(feature = "with-karura-runtime")] { assert_debug_snapshot!(alice_native_before, @"0"); assert_debug_snapshot!(alice_native_after, @"237600000000"); assert_debug_snapshot!(alice_erc20_before, @"1000000000000"); - assert_debug_snapshot!(alice_erc20_after, @"975147966009"); - assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"24852033991"); + assert_debug_snapshot!(alice_erc20_after, @"975147966010"); + assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"24852033990"); } #[cfg(feature = "with-acala-runtime")] { assert_debug_snapshot!(alice_native_before, @"0"); assert_debug_snapshot!(alice_native_after, @"512800000000"); assert_debug_snapshot!(alice_erc20_before, @"1000000000000"); - assert_debug_snapshot!(alice_erc20_after, @"946258417072"); - assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"53741582928"); + assert_debug_snapshot!(alice_erc20_after, @"946258417073"); + assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"53741582927"); } let alice_native_before = Currencies::free_balance(NATIVE_CURRENCY, &alice_evm_account); @@ -1598,11 +1602,12 @@ fn transaction_payment_module_charge_erc20_pool() { // charge fee by fee pool >::set_origin(alice_evm_account.clone()); assert_ok!( - >::from(0).validate( - &alice_evm_account.clone(), + >::from(0).validate_and_prepare( + Some(alice_evm_account.clone()).into(), &with_fee_call, &info, len as usize, + 0 ) ); let alice_native_after = Currencies::free_balance(NATIVE_CURRENCY, &alice_evm_account); @@ -1611,30 +1616,30 @@ fn transaction_payment_module_charge_erc20_pool() { // charge storage and tx fee by erc20 #[cfg(feature = "with-mandala-runtime")] { - assert_debug_snapshot!(alice_native_before, @"999998999984699999066"); - assert_debug_snapshot!(alice_native_after, @"999998999984699999066"); + assert_debug_snapshot!(alice_native_before, @"999998999984699999075"); + assert_debug_snapshot!(alice_native_after, @"999998999984699999075"); assert_eq!(alice_native_before - alice_native_after, 0); assert_debug_snapshot!(alice_erc20_before, @"99999999899000000000000"); - assert_debug_snapshot!(alice_erc20_after, @"99999999898999624586944"); - assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"375413056"); + assert_debug_snapshot!(alice_erc20_after, @"99999999898999624586945"); + assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"375413055"); } #[cfg(feature = "with-karura-runtime")] { - assert_debug_snapshot!(alice_native_before, @"999998999984699999066"); - assert_debug_snapshot!(alice_native_after, @"999998999984699999066"); + assert_debug_snapshot!(alice_native_before, @"999998999984699999075"); + assert_debug_snapshot!(alice_native_after, @"999998999984699999075"); assert_eq!(alice_native_before - alice_native_after, 0); assert_debug_snapshot!(alice_erc20_before, @"99999999899000000000000"); - assert_debug_snapshot!(alice_erc20_after, @"99999999898999623833858"); - assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"376166142"); + assert_debug_snapshot!(alice_erc20_after, @"99999999898999623833859"); + assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"376166141"); } #[cfg(feature = "with-acala-runtime")] { - assert_debug_snapshot!(alice_native_before, @"999998999959099999066"); - assert_debug_snapshot!(alice_native_after, @"999998999959099999066"); + assert_debug_snapshot!(alice_native_before, @"999998999959099999075"); + assert_debug_snapshot!(alice_native_after, @"999998999959099999075"); assert_eq!(alice_native_before - alice_native_after, 0); assert_debug_snapshot!(alice_erc20_before, @"99999999899000000000000"); - assert_debug_snapshot!(alice_erc20_after, @"99999999898999623833858"); - assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"376166142"); + assert_debug_snapshot!(alice_erc20_after, @"99999999898999623833859"); + assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"376166141"); } let alice_native_before = Currencies::free_balance(NATIVE_CURRENCY, &account_with_erc20); @@ -1643,11 +1648,12 @@ fn transaction_payment_module_charge_erc20_pool() { // charge erc20 fee for the account only hold erc20 >::set_origin(account_with_erc20.clone()); assert_ok!( - >::from(0).validate( - &account_with_erc20, + >::from(0).validate_and_prepare( + Some(account_with_erc20.clone()).into(), &with_fee_call, &info, len as usize, + 0 ) ); let alice_native_after = Currencies::free_balance(NATIVE_CURRENCY, &account_with_erc20); @@ -1657,25 +1663,25 @@ fn transaction_payment_module_charge_erc20_pool() { { assert_debug_snapshot!(alice_native_before, @"237600000000"); assert_debug_snapshot!(alice_native_after, @"237600000000"); - assert_debug_snapshot!(alice_erc20_before, @"975197719831"); - assert_debug_snapshot!(alice_erc20_after, @"974822306775"); - assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"375413056"); + assert_debug_snapshot!(alice_erc20_before, @"975197719832"); + assert_debug_snapshot!(alice_erc20_after, @"974822306777"); + assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"375413055"); } #[cfg(feature = "with-karura-runtime")] { assert_debug_snapshot!(alice_native_before, @"237600000000"); assert_debug_snapshot!(alice_native_after, @"237600000000"); - assert_debug_snapshot!(alice_erc20_before, @"975147966009"); - assert_debug_snapshot!(alice_erc20_after, @"974771799867"); - assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"376166142"); + assert_debug_snapshot!(alice_erc20_before, @"975147966010"); + assert_debug_snapshot!(alice_erc20_after, @"974771799869"); + assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"376166141"); } #[cfg(feature = "with-acala-runtime")] { assert_debug_snapshot!(alice_native_before, @"512800000000"); assert_debug_snapshot!(alice_native_after, @"512800000000"); - assert_debug_snapshot!(alice_erc20_before, @"946258417072"); - assert_debug_snapshot!(alice_erc20_after, @"945882250930"); - assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"376166142"); + assert_debug_snapshot!(alice_erc20_before, @"946258417073"); + assert_debug_snapshot!(alice_erc20_after, @"945882250932"); + assert_debug_snapshot!(alice_erc20_before - alice_erc20_after, @"376166141"); } }); } diff --git a/runtime/integration-tests/src/payment.rs b/runtime/integration-tests/src/payment.rs index 8c950b871..6133812bd 100644 --- a/runtime/integration-tests/src/payment.rs +++ b/runtime/integration-tests/src/payment.rs @@ -24,7 +24,7 @@ use frame_support::{ }; use module_support::AggregatedSwapPath; use sp_runtime::{ - traits::{AccountIdConversion, SignedExtension, UniqueSaturatedInto}, + traits::{AccountIdConversion, DispatchTransaction, UniqueSaturatedInto}, transaction_validity::{InvalidTransaction, TransactionValidityError}, MultiAddress, Percent, }; @@ -103,7 +103,8 @@ const CALL: ::RuntimeCall = amount: 12, }); pub const INFO: DispatchInfo = DispatchInfo { - weight: Weight::from_parts(100, 0), + call_weight: Weight::from_parts(100, 0), + extension_weight: Weight::zero(), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; @@ -273,22 +274,24 @@ fn charge_transaction_payment_and_threshold_works() { let fee = fee + surplus; assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &CALL, &INFO, len as usize, + 0 ) ); let balance1 = Currencies::free_balance(NATIVE_CURRENCY, &sub_account1); let relay1 = Currencies::free_balance(RELAY_CHAIN_CURRENCY, &sub_account1); assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &CALL, &INFO, len as usize, + 0 ) ); let balance2 = Currencies::free_balance(NATIVE_CURRENCY, &sub_account1); @@ -297,14 +300,8 @@ fn charge_transaction_payment_and_threshold_works() { assert_eq!(relay_exchange_rate.saturating_mul_int(fee), relay2 - relay1); for i in 0..38 { - assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), - &CALL, - &INFO, - len as usize, - ) - ); + assert_ok!(>::from(0) + .validate_and_prepare(Some(AccountId::from(BOB)).into(), &CALL, &INFO, len as usize, 0)); assert_eq!( pool_size - fee * (i + 3), Currencies::free_balance(NATIVE_CURRENCY, &sub_account1) @@ -324,11 +321,12 @@ fn charge_transaction_payment_and_threshold_works() { // before execute this tx, the balance of fee pool is equal to threshold, // so it wouldn't trigger swap from dex. assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &CALL, &INFO, len as usize, + 0 ) ); let balance2 = Currencies::free_balance(NATIVE_CURRENCY, &sub_account1); @@ -338,11 +336,12 @@ fn charge_transaction_payment_and_threshold_works() { // this tx cause swap from dex, but the fee calculation still use the old rate. assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &CALL, &INFO, len as usize, + 0 ) ); let balance1 = Currencies::free_balance(NATIVE_CURRENCY, &sub_account1); @@ -356,11 +355,12 @@ fn charge_transaction_payment_and_threshold_works() { module_transaction_payment::Pallet::::token_exchange_rate(RELAY_CHAIN_CURRENCY).unwrap(); assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &CALL, &INFO, len as usize, + 0 ) ); let balance2 = Currencies::free_balance(NATIVE_CURRENCY, &sub_account1); @@ -374,11 +374,11 @@ fn charge_transaction_payment_and_threshold_works() { fn with_fee_currency_call_works() { let amount = with_fee_call_works(with_fee_currency_call(LIQUID_CURRENCY), false); #[cfg(feature = "with-mandala-runtime")] - assert_debug_snapshot!(amount, @"12701470465"); + assert_debug_snapshot!(amount, @"12701470464"); #[cfg(feature = "with-karura-runtime")] - assert_debug_snapshot!(amount, @"12726949844"); + assert_debug_snapshot!(amount, @"12726949843"); #[cfg(feature = "with-acala-runtime")] - assert_debug_snapshot!(amount, @"12726949844"); + assert_debug_snapshot!(amount, @"12726949843"); } #[test] @@ -388,11 +388,11 @@ fn with_fee_path_call_works() { false, ); #[cfg(feature = "with-mandala-runtime")] - assert_debug_snapshot!(amount, @"12701470465"); + assert_debug_snapshot!(amount, @"12701470464"); #[cfg(feature = "with-karura-runtime")] - assert_debug_snapshot!(amount, @"12726949844"); + assert_debug_snapshot!(amount, @"12726949843"); #[cfg(feature = "with-acala-runtime")] - assert_debug_snapshot!(amount, @"12726949844"); + assert_debug_snapshot!(amount, @"12726949843"); } #[test] @@ -403,11 +403,11 @@ fn with_fee_aggregated_path_call_works() { ]; let amount = with_fee_call_works(with_fee_aggregated_path_call(aggregated_path), true); #[cfg(feature = "with-mandala-runtime")] - assert_debug_snapshot!(amount, @"12701470465"); + assert_debug_snapshot!(amount, @"12701470464"); #[cfg(feature = "with-karura-runtime")] - assert_debug_snapshot!(amount, @"12726949844"); + assert_debug_snapshot!(amount, @"12726949843"); #[cfg(feature = "with-acala-runtime")] - assert_debug_snapshot!(amount, @"12726949844"); + assert_debug_snapshot!(amount, @"12726949843"); } fn with_fee_call_works( @@ -458,21 +458,19 @@ fn with_fee_call_works( // un-wrapped call use dex swap only `AlternativeFeeSwapPath` is set, otherwise use fee pool. // user don't have USD(which use fee pool), and also don't have native token, then failed. - assert_noop!( - >::from(0).validate( - &AccountId::from(BOB), - &CALL, - &INFO, - 50, - ), + assert_eq!( + >::from(0) + .validate_and_prepare(Some(AccountId::from(BOB)).into(), &CALL, &INFO, 50, 0) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &with_fee_call, &INFO, - 50 + 50, + 0 ) ); if is_aggregated_call { @@ -493,23 +491,27 @@ fn with_fee_call_works( RuntimeEvent::Dex(module_dex::Event::Swap { .. }) ))); // Bob don't have any USD currency. - assert_noop!( - >::from(0).validate( - &AccountId::from(BOB), - &with_fee_currency_call(USD_CURRENCY), - &INFO, - 50 - ), + assert_eq!( + >::from(0) + .validate_and_prepare( + Some(AccountId::from(BOB)).into(), + &with_fee_currency_call(USD_CURRENCY), + &INFO, + 50, + 0 + ) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); // Charlie have USD currency. assert_ok!( - >::from(0).validate( - &AccountId::from(CHARLIE), + >::from(0).validate_and_prepare( + Some(AccountId::from(CHARLIE)).into(), &with_fee_currency_call(USD_CURRENCY), &INFO, - 50 + 50, + 0 ) ); diff --git a/runtime/integration-tests/src/runtime.rs b/runtime/integration-tests/src/runtime.rs index 5cb74d80b..7b2b34167 100644 --- a/runtime/integration-tests/src/runtime.rs +++ b/runtime/integration-tests/src/runtime.rs @@ -320,8 +320,9 @@ mod mandala_only_tests { use frame_support::dispatch::GetDispatchInfo; use module_transaction_payment::ChargeTransactionPayment; use pallet_transaction_payment::InclusionFee; + use primitives::unchecked_extrinsic::AcalaUncheckedExtrinsic; use sp_runtime::{ - traits::{Extrinsic, SignedExtension, ValidateUnsigned}, + traits::{DispatchTransaction, ValidateUnsigned}, transaction_validity::{TransactionSource, ValidTransaction}, }; @@ -329,11 +330,11 @@ mod mandala_only_tests { fn check_transaction_fee_for_empty_remark() { ExtBuilder::default().build().execute_with(|| { let call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] }); - let ext = UncheckedExtrinsic::new(call.into(), None).expect("This should not fail"); - let bytes = ext.encode(); + let xt = AcalaUncheckedExtrinsic::::new_transaction(call.clone(), ()); + let bytes = xt.encode(); // Get information on the fee for the call. - let fee = TransactionPayment::query_fee_details(ext, bytes.len() as u32); + let fee = TransactionPayment::query_fee_details(xt.0, bytes.len() as u32); let InclusionFee { base_fee, @@ -342,11 +343,11 @@ mod mandala_only_tests { } = fee.inclusion_fee.unwrap(); assert_debug_snapshot!(base_fee, @"1000000000"); - assert_debug_snapshot!(len_fee, @"50000000"); - assert_debug_snapshot!(adjusted_weight_fee, @"10625773"); + assert_debug_snapshot!(len_fee, @"60000000"); + assert_debug_snapshot!(adjusted_weight_fee, @"14663868"); let total_fee = base_fee.saturating_add(len_fee).saturating_add(adjusted_weight_fee); - assert_debug_snapshot!(total_fee, @"1060625773"); + assert_debug_snapshot!(total_fee, @"1074663868"); }); } @@ -359,87 +360,99 @@ mod mandala_only_tests { // Ensure tx priority order: // Inherent -> Operational tx -> Unsigned tx -> Signed normal tx let call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] }); - let bytes = UncheckedExtrinsic::new(call.clone().into(), None) - .expect("This should not fail") - .encode(); + let xt = AcalaUncheckedExtrinsic::< + RuntimeCall, + (), + ConvertEthereumTx, + StorageDepositPerByte, + TxFeePerGas, + >::new_transaction(call.clone(), ()); + let bytes = xt.encode(); // tips = 0 - assert_eq!( - ChargeTransactionPayment::::from(0).validate( - &alice(), - &call.clone(), - &call.get_dispatch_info(), - bytes.len() - ), - Ok(ValidTransaction { - priority: 0, - requires: vec![], - provides: vec![], - longevity: 18_446_744_073_709_551_615, - propagate: true, - }) + assert_debug_snapshot!( + ChargeTransactionPayment::::from(0) + .validate_only( + Some(alice()).into(), + &call.clone(), + &call.get_dispatch_info(), + bytes.len(), + External, + 0 + ) + .unwrap() + .0, + @r###" + ValidTransaction { + priority: 0, + requires: [], + provides: [], + longevity: 18446744073709551615, + propagate: true, + } + "### ); // tips = TipPerWeightStep assert_debug_snapshot!( - ChargeTransactionPayment::::from(TipPerWeightStep::get()).validate( - &alice(), + ChargeTransactionPayment::::from(TipPerWeightStep::get()).validate_only( + Some(alice()).into(), &call.clone(), &call.get_dispatch_info(), - bytes.len() - ), + bytes.len(), + External, + 0 + ).unwrap().0, @r###" - Ok( - ValidTransaction { - priority: 439466, - requires: [], - provides: [], - longevity: 18446744073709551615, - propagate: true, - }, - ) + ValidTransaction { + priority: 315258, + requires: [], + provides: [], + longevity: 18446744073709551615, + propagate: true, + } "### ); // tips = TipPerWeightStep + 1 assert_debug_snapshot!( - ChargeTransactionPayment::::from(TipPerWeightStep::get() + 1).validate( - &alice(), + ChargeTransactionPayment::::from(TipPerWeightStep::get() + 1).validate_only( + Some(alice()).into(), &call.clone(), &call.get_dispatch_info(), - bytes.len() - ), + bytes.len(), + External, + 0 + ).unwrap().0, @r###" - Ok( - ValidTransaction { - priority: 439466, - requires: [], - provides: [], - longevity: 18446744073709551615, - propagate: true, - }, - ) + ValidTransaction { + priority: 315258, + requires: [], + provides: [], + longevity: 18446744073709551615, + propagate: true, + } "### ); // tips = MaxTipsOfPriority + 1 assert_debug_snapshot!( - ChargeTransactionPayment::::from(MaxTipsOfPriority::get() + 1).validate( - &alice(), + ChargeTransactionPayment::::from(MaxTipsOfPriority::get() + 1).validate_only( + Some(alice()).into(), &call.clone(), &call.get_dispatch_info(), - bytes.len() - ), + bytes.len(), + External, + 0 + ).unwrap().0, @r###" - Ok( - ValidTransaction { - priority: 439466000000, - requires: [], - provides: [], - longevity: 18446744073709551615, - propagate: true, - }, - ) + ValidTransaction { + priority: 315258000000, + requires: [], + provides: [], + longevity: 18446744073709551615, + propagate: true, + } "### ); @@ -485,27 +498,32 @@ mod mandala_only_tests { let call = RuntimeCall::Sudo(pallet_sudo::Call::sudo { call: Box::new(module_emergency_shutdown::Call::open_collateral_refund {}.into()), }); - let bytes = UncheckedExtrinsic::new(call.clone().into(), None) - .expect("This should not fail") - .encode(); + let xt = AcalaUncheckedExtrinsic::< + RuntimeCall, + (), + ConvertEthereumTx, + StorageDepositPerByte, + TxFeePerGas, + >::new_transaction(call.clone(), ()); + let bytes = xt.encode(); assert_debug_snapshot!( - ChargeTransactionPayment::::from(0).validate( - &alice(), + ChargeTransactionPayment::::from(0).validate_only( + Some(alice()).into(), &call.clone(), &call.get_dispatch_info(), - bytes.len() - ), + bytes.len(), + External, + 0 + ).unwrap().0, @r###" - Ok( - ValidTransaction { - priority: 61218482942130000, - requires: [], - provides: [], - longevity: 18446744073709551615, - propagate: true, - }, - ) + ValidTransaction { + priority: 60975980945150000, + requires: [], + provides: [], + longevity: 18446744073709551615, + propagate: true, + } "### ); }); diff --git a/runtime/integration-tests/src/setup.rs b/runtime/integration-tests/src/setup.rs index 3ec410d11..a170a947b 100644 --- a/runtime/integration-tests/src/setup.rs +++ b/runtime/integration-tests/src/setup.rs @@ -24,13 +24,9 @@ pub use frame_support::{ }; pub use frame_system::RawOrigin; pub use parity_scale_codec::{Decode, Encode}; -pub use primitives::TradingPair; use runtime_common::evm_genesis; -pub use runtime_common::{ - cent, dollar, millicent, FixedRateOfAsset, MaxTipsOfPriority, ProxyType, Ratio, TipPerWeightStep, ACA, AUSD, DOT, - LDOT, -}; -pub use xcm::v4::{prelude::*, Weight as XcmWeight}; +pub use runtime_common::{cent, dollar, MaxTipsOfPriority, ProxyType, Ratio, TipPerWeightStep, ACA, AUSD, DOT}; +pub use xcm::v5::prelude::*; pub use xcm_executor::XcmExecutor; pub use module_support::{ @@ -40,17 +36,13 @@ pub use module_support::{ pub use orml_traits::{location::RelativeLocations, Change, GetByKey, MultiCurrency}; pub use insta::assert_debug_snapshot; -pub use primitives::{ - currency::*, - evm::{CHAIN_ID_ACALA_TESTNET, CHAIN_ID_KARURA_TESTNET, CHAIN_ID_MANDALA}, -}; +pub use primitives::currency::*; use sp_consensus_aura::AURA_ENGINE_ID; pub use sp_core::H160; use sp_io::hashing::keccak_256; pub use sp_runtime::{ - traits::{AccountIdConversion, BadOrigin, BlakeTwo256, Convert, Hash, Header, Zero}, - BuildStorage, Digest, DigestItem, DispatchError, DispatchResult, FixedPointNumber, FixedU128, MultiAddress, - Perbill, Permill, + traits::{AccountIdConversion, BadOrigin, BlakeTwo256, Convert, Hash, Header, TransactionExtension, Zero}, + BuildStorage, Digest, DigestItem, DispatchError, DispatchResult, FixedPointNumber, MultiAddress, }; #[cfg(feature = "with-mandala-runtime")] @@ -61,19 +53,21 @@ mod mandala_imports { use mandala_runtime::AlternativeFeeSurplus; pub use mandala_runtime::{ get_all_module_accounts, AcalaOracle, AcalaSwap, AccountId, AggregatedDex, AssetRegistry, AuctionManager, Aura, - AuraExt, Authority, AuthoritysOriginId, Authorship, Balance, Balances, BlockNumber, CDPEnginePalletId, - CDPTreasuryPalletId, CdpEngine, CdpTreasury, CollatorSelection, CreateClassDeposit, CreateTokenDeposit, + AuraExt, Authority, AuthoritysOriginId, Balance, Balances, BlockNumber, CDPEnginePalletId, CDPTreasuryPalletId, + CdpEngine, CdpTreasury, CollatorSelection, ConvertEthereumTx, CreateClassDeposit, CreateTokenDeposit, Currencies, CurrencyId, DataDepositPerByte, DealWithFees, DefaultDebitExchangeRate, DefaultExchangeRate, Dex, EmergencyShutdown, EvmAccounts, ExistentialDeposits, FinancialCouncil, GetNativeCurrencyId, Homa, Honzon, IdleScheduler, Loans, MinRewardDistributeAmount, MinimumDebitValue, NativeTokenExistentialDeposit, NftPalletId, OneDay, OriginCaller, ParachainInfo, ParachainSystem, Proxy, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, Scheduler, Session, SessionKeys, SessionManager, SevenDays, StableAsset, StableAssetPalletId, - SubAccountIndexAccountIdConvertor, System, Timestamp, TokenSymbol, Tokens, TransactionPayment, - TransactionPaymentPalletId, TreasuryAccount, TreasuryPalletId, UncheckedExtrinsic, Utility, Vesting, - XcmInterface, EVM, NFT, + StorageDepositPerByte, SubAccountIndexAccountIdConvertor, System, Timestamp, TokenSymbol, Tokens, + TransactionPayment, TransactionPaymentPalletId, TreasuryAccount, TreasuryPalletId, TxFeePerGas, Vesting, EVM, + NFT, }; + pub use primitives::evm::CHAIN_ID_MANDALA; use primitives::TradingPair; use runtime_common::{ACA, AUSD, DOT, LDOT}; + pub use sp_runtime::transaction_validity::TransactionSource::External; use sp_runtime::Percent; parameter_types! { @@ -108,16 +102,17 @@ mod karura_imports { pub use karura_runtime::{ constants::parachains, get_all_module_accounts, AcalaOracle, AcalaSwap, AccountId, AggregatedDex, AssetRegistry, AuctionManager, Aura, AuraExt, Authority, AuthoritysOriginId, Balance, Balances, BlockNumber, - CDPEnginePalletId, CDPTreasuryPalletId, CdpEngine, CdpTreasury, CreateClassDeposit, CreateTokenDeposit, - Currencies, CurrencyId, DataDepositPerByte, DefaultDebitExchangeRate, DefaultExchangeRate, Dex, - EmergencyShutdown, EvmAccounts, ExistentialDeposits, FinancialCouncil, GetNativeCurrencyId, Homa, Honzon, + CDPEnginePalletId, CDPTreasuryPalletId, CdpEngine, CdpTreasury, ConvertEthereumTx, CreateClassDeposit, + CreateTokenDeposit, Currencies, CurrencyId, DataDepositPerByte, DefaultDebitExchangeRate, DefaultExchangeRate, + Dex, EmergencyShutdown, EvmAccounts, ExistentialDeposits, FinancialCouncil, GetNativeCurrencyId, Homa, Honzon, IdleScheduler, KaruraFoundationAccounts, Loans, MinimumDebitValue, NativeTokenExistentialDeposit, NftPalletId, OneDay, OriginCaller, ParachainAccount, ParachainInfo, ParachainSystem, PolkadotXcm, Proxy, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, Scheduler, Session, SessionManager, SevenDays, StableAsset, - StableAssetPalletId, SubAccountIndexAccountIdConvertor, System, Timestamp, TokenSymbol, Tokens, - TransactionPayment, TransactionPaymentPalletId, TreasuryPalletId, Utility, Vesting, XTokens, XcmInterface, EVM, - NFT, + StableAssetPalletId, StorageDepositPerByte, SubAccountIndexAccountIdConvertor, System, Timestamp, TokenSymbol, + Tokens, TransactionPayment, TransactionPaymentPalletId, TreasuryPalletId, TxExtension, TxFeePerGas, Utility, + Vesting, XTokens, XcmInterface, EVM, NFT, }; + pub use primitives::evm::CHAIN_ID_KARURA_TESTNET; use primitives::TradingPair; use runtime_common::{KAR, KSM, KUSD, LKSM}; use sp_runtime::{traits::AccountIdConversion, Percent}; @@ -153,16 +148,18 @@ mod acala_imports { pub use acala_runtime::{ constants::parachains, get_all_module_accounts, AcalaFoundationAccounts, AcalaOracle, AcalaSwap, AccountId, AggregatedDex, AssetRegistry, AuctionManager, Aura, AuraExt, Authority, AuthoritysOriginId, Balance, Balances, - BlockNumber, CDPEnginePalletId, CDPTreasuryPalletId, CdpEngine, CdpTreasury, CreateClassDeposit, - CreateTokenDeposit, Currencies, CurrencyId, DataDepositPerByte, DefaultDebitExchangeRate, DefaultExchangeRate, - Dex, EmergencyShutdown, EvmAccounts, ExistentialDeposits, FinancialCouncil, GetNativeCurrencyId, Homa, Honzon, - IdleScheduler, Loans, MinimumDebitValue, NativeTokenExistentialDeposit, NftPalletId, OneDay, OriginCaller, - ParachainAccount, ParachainInfo, ParachainSystem, PolkadotXcm, Proxy, Runtime, RuntimeCall, RuntimeEvent, - RuntimeOrigin, Scheduler, Session, SessionManager, SevenDays, StableAsset, StableAssetPalletId, - SubAccountIndexAccountIdConvertor, System, Timestamp, TokenSymbol, Tokens, TransactionPayment, - TransactionPaymentPalletId, TreasuryPalletId, Utility, Vesting, XTokens, XcmInterface, EVM, NFT, + BlockNumber, CDPEnginePalletId, CDPTreasuryPalletId, CdpEngine, CdpTreasury, ConvertEthereumTx, + CreateClassDeposit, CreateTokenDeposit, Currencies, CurrencyId, DataDepositPerByte, DefaultDebitExchangeRate, + DefaultExchangeRate, Dex, EmergencyShutdown, EvmAccounts, ExistentialDeposits, FinancialCouncil, + GetNativeCurrencyId, Homa, Honzon, IdleScheduler, Loans, MinimumDebitValue, NativeTokenExistentialDeposit, + NftPalletId, OneDay, OriginCaller, ParachainAccount, ParachainInfo, ParachainSystem, PolkadotXcm, Proxy, + Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, Scheduler, Session, SessionManager, SevenDays, StableAsset, + StableAssetPalletId, StorageDepositPerByte, SubAccountIndexAccountIdConvertor, System, Timestamp, TokenSymbol, + Tokens, TransactionPayment, TransactionPaymentPalletId, TreasuryPalletId, TxExtension, TxFeePerGas, Utility, + Vesting, XTokens, XcmInterface, EVM, NFT, }; use frame_support::parameter_types; + pub use primitives::evm::CHAIN_ID_ACALA_TESTNET; use primitives::TradingPair; use runtime_common::{ACA, AUSD, DOT, LCDOT, LDOT}; use sp_runtime::traits::AccountIdConversion; @@ -247,6 +244,7 @@ pub fn set_relaychain_block_number(number: BlockNumber) { }; sproof_builder.para_id = ParachainInfo::get().into(); + sproof_builder.current_slot = (number as u64).into(); sproof_builder.included_para_head = Some(parent_head_data.clone()); let (relay_storage_root, proof) = sproof_builder.into_state_root_and_proof(); @@ -344,6 +342,7 @@ impl ExtBuilder { .map(|x| (x.clone(), existential_deposit)), ) .collect::>(), + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/runtime/integration-tests/src/stable_asset.rs b/runtime/integration-tests/src/stable_asset.rs index da00b82e5..61a36f0f3 100644 --- a/runtime/integration-tests/src/stable_asset.rs +++ b/runtime/integration-tests/src/stable_asset.rs @@ -24,7 +24,7 @@ use module_support::{AggregatedSwapPath, ExchangeRate, Swap, SwapLimit, EVM as E use primitives::{currency::AssetMetadata, evm::EvmAddress}; use sp_core::bounded::BoundedVec; use sp_runtime::{ - traits::{SignedExtension, UniqueSaturatedInto}, + traits::{DispatchTransaction, UniqueSaturatedInto}, transaction_validity::{InvalidTransaction, TransactionValidityError}, Percent, }; @@ -542,8 +542,15 @@ fn three_usd_pool_works() { let set_evm_origin = module_evm::SetEvmOrigin::::new(); let pre = set_evm_origin .clone() - .pre_dispatch(&AccountId::from(BOB), &with_fee_currency_call(usdc), &INFO, 50) - .unwrap(); + .validate_and_prepare( + Some(AccountId::from(BOB)).into(), + &with_fee_currency_call(usdc), + &INFO, + 50, + 0, + ) + .unwrap() + .0; let origin = as module_support::evm::EVMBridge< AccountId, @@ -551,8 +558,8 @@ fn three_usd_pool_works() { >>::get_origin(); assert_eq!(origin, Some(AccountId::from(BOB))); - assert_ok!(module_evm::SetEvmOrigin::::post_dispatch( - Some(pre), + assert_ok!(module_evm::SetEvmOrigin::::post_dispatch_details( + pre, &INFO, &POST_INFO, 50, @@ -565,18 +572,27 @@ fn three_usd_pool_works() { assert_eq!(origin, None); // Origin is None, transfer erc20 failed. - assert_noop!( - >::from(0).validate( - &AccountId::from(BOB), - &with_fee_currency_call(usdc), - &INFO, - 50 - ), + assert_eq!( + >::from(0) + .validate_and_prepare( + Some(AccountId::from(BOB)).into(), + &with_fee_currency_call(usdc), + &INFO, + 50, + 0 + ) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); // set origin in SetEvmOrigin::validate() then transfer erc20 will success. - assert_ok!(set_evm_origin.validate(&AccountId::from(BOB), &with_fee_currency_call(usdc), &INFO, 50)); + assert_ok!(set_evm_origin.validate_and_prepare( + Some(AccountId::from(BOB)).into(), + &with_fee_currency_call(usdc), + &INFO, + 50, + 0 + )); let origin = as module_support::evm::EVMBridge< AccountId, Balance, @@ -590,11 +606,12 @@ fn three_usd_pool_works() { // AUSD as fee token, only dex swap event produced. assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &with_fee_currency_call(USD_CURRENCY), &INFO, - 50 + 50, + 0 ) ); @@ -624,18 +641,18 @@ fn three_usd_pool_works() { #[cfg(any(feature = "with-karura-runtime", feature = "with-acala-runtime"))] assert_debug_snapshot!(liquidity_changes, @r###" - [ - 227029656, - 2250002378, - ] - "###); + [ + 227029655, + 2250002368, + ] + "###); #[cfg(feature = "with-mandala-runtime")] assert_debug_snapshot!(liquidity_changes, @r###" - [ - 226576496, - 2250002368, - ] - "###); + [ + 226576495, + 2250002358, + ] + "###); // with_fee_path_call failed let invalid_swap_path = vec![ @@ -647,23 +664,27 @@ fn three_usd_pool_works() { vec![usdc, NATIVE_CURRENCY], ]; for path in invalid_swap_path { - assert_noop!( - >::from(0).validate( - &AccountId::from(BOB), - &with_fee_path_call(path), - &INFO, - 50 - ), + assert_eq!( + >::from(0) + .validate_and_prepare( + Some(AccountId::from(BOB)).into(), + &with_fee_path_call(path), + &INFO, + 50, + 0 + ) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); } // USD_CURRENCY to NATIVE_CURRENCY is valid, because it exist in dex swap. assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &with_fee_path_call(vec![USD_CURRENCY, NATIVE_CURRENCY]), &INFO, - 50 + 50, + 0 ) ); @@ -680,13 +701,16 @@ fn three_usd_pool_works() { AggregatedSwapPath::::Taiga(0, 0, 1), // USDT, USDC AggregatedSwapPath::::Dex(vec![USD_CURRENCY, NATIVE_CURRENCY]), ]; - assert_noop!( - >::from(0).validate( - &AccountId::from(BOB), - &with_fee_aggregated_path_call(invalid_aggregated_path), - &INFO, - 50 - ), + assert_eq!( + >::from(0) + .validate_and_prepare( + Some(AccountId::from(BOB)).into(), + &with_fee_aggregated_path_call(invalid_aggregated_path), + &INFO, + 50, + 0 + ) + .unwrap_err(), TransactionValidityError::Invalid(InvalidTransaction::Payment) ); assert_aggregated_dex_event(usdc, with_fee_aggregated_path_call(usdc_aggregated_path), None); @@ -730,19 +754,21 @@ fn three_usd_pool_works() { let usdt_amount = Currencies::free_balance(usdt, &AccountId::from(BOB)); let usdc_amount = Currencies::free_balance(usdc, &AccountId::from(BOB)); assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &with_fee_currency_call(usdt), &INFO, len as usize, + 0 ) ); assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &with_fee_currency_call(usdc), &INFO, len as usize, + 0 ) ); assert_eq!( @@ -763,19 +789,21 @@ fn three_usd_pool_works() { ); assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &with_fee_currency_call(usdt), &INFO, len as usize, + 0 ) ); assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &with_fee_currency_call(usdc), &INFO, len as usize, + 0 ) ); @@ -792,11 +820,12 @@ fn assert_aggregated_dex_event( ) { System::reset_events(); assert_ok!( - >::from(0).validate( - &AccountId::from(BOB), + >::from(0).validate_and_prepare( + Some(AccountId::from(BOB)).into(), &with_fee_call, &INFO, - len.unwrap_or(50) + len.unwrap_or(50), + 0 ) ); assert!(System::events().iter().any(|r| matches!( diff --git a/runtime/integration-tests/src/treasury.rs b/runtime/integration-tests/src/treasury.rs index b52ec9610..2b1e45998 100644 --- a/runtime/integration-tests/src/treasury.rs +++ b/runtime/integration-tests/src/treasury.rs @@ -66,11 +66,11 @@ fn treasury_should_take_xcm_execution_revenue() { let actual_amount = Tokens::free_balance(RELAY_CHAIN_CURRENCY, &ALICE.into()); #[cfg(feature = "with-mandala-runtime")] - assert_debug_snapshot!(actual_amount, @"9999999719830"); + assert_debug_snapshot!(actual_amount, @"9999999722650"); #[cfg(feature = "with-karura-runtime")] - assert_debug_snapshot!(actual_amount, @"999999887932000"); + assert_debug_snapshot!(actual_amount, @"999999889060000"); #[cfg(feature = "with-acala-runtime")] - assert_debug_snapshot!(actual_amount, @"9999998879320"); + assert_debug_snapshot!(actual_amount, @"9999998890600"); assert_eq!( Tokens::free_balance(RELAY_CHAIN_CURRENCY, &TreasuryAccount::get()), diff --git a/runtime/karura/src/constants.rs b/runtime/karura/src/constants.rs index fa8f4252a..14133ecaf 100644 --- a/runtime/karura/src/constants.rs +++ b/runtime/karura/src/constants.rs @@ -124,6 +124,6 @@ mod tests { let q = Balance::from(ExtrinsicBaseWeight::get().ref_time()); assert_eq!(p, 1_000_000_000); - assert_eq!(q, 107_074_000); + assert_eq!(q, 108_157_000); } } diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index 63f6e238a..8bea29d94 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -30,14 +30,16 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -use parity_scale_codec::{Decode, DecodeLimit, Encode}; +extern crate alloc; +use alloc::borrow::Cow; +use parity_scale_codec::{Decode, DecodeLimit, DecodeWithMemTracking, Encode}; use polkadot_parachain_primitives::primitives::Sibling; use scale_info::TypeInfo; use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H160}; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, + generic, impl_opaque_keys, traits::{ AccountIdConversion, AccountIdLookup, BadOrigin, BlakeTwo256, Block as BlockT, Bounded, Convert, IdentityLookup, SaturatedConversion, StaticLookup, @@ -129,14 +131,14 @@ pub mod xcm_config; /// This runtime version. #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("karura"), - impl_name: create_runtime_str!("karura"), + spec_name: Cow::Borrowed("karura"), + impl_name: Cow::Borrowed("karura"), authoring_version: 1, spec_version: 2300, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, - state_version: 1, + system_version: 1, }; /// The version information used to identify this runtime when compiled @@ -242,6 +244,11 @@ impl Contains for BaseCallFilter { | pallet_xcm::Call::transfer_assets_using_type_and_then { .. } => { return true; } + pallet_xcm::Call::add_authorized_alias { .. } + | pallet_xcm::Call::remove_authorized_alias { .. } + | pallet_xcm::Call::remove_all_authorized_aliases { .. } => { + return false; + } // xcm operations call pallet_xcm::Call::force_xcm_version { .. } | pallet_xcm::Call::force_default_xcm_version { .. } @@ -284,6 +291,7 @@ impl frame_system::Config for Runtime { type DbWeight = RocksDbWeight; type BaseCallFilter = BaseCallFilter; type SystemWeightInfo = (); + type ExtensionsWeightInfo = (); type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = ConstU32<16>; @@ -324,6 +332,7 @@ impl pallet_session::Config for Runtime { type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = (); + type DisablingStrategy = (); } parameter_types! { @@ -389,6 +398,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_types! { @@ -434,6 +444,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -464,6 +477,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -494,6 +510,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -524,6 +543,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -572,6 +594,7 @@ impl pallet_multisig::Config for Runtime { type DepositFactor = MultisigDepositFactor; type MaxSignatories = ConstU32<100>; type WeightInfo = (); + type BlockNumberProvider = System; } pub struct GeneralCouncilProvider; @@ -642,6 +665,7 @@ impl pallet_treasury::Config for Runtime { type Paymaster = PayFromAccount; type BalanceConverter = UnityAssetBalanceConversion; type PayoutPeriod = PayoutSpendPeriod; + type BlockNumberProvider = System; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); } @@ -992,6 +1016,7 @@ impl pallet_scheduler::Config for Runtime { type WeightInfo = (); type OriginPrivilegeCmp = EqualPrivilegeOnly; type Preimages = Preimage; + type BlockNumberProvider = System; } parameter_types! { @@ -1047,15 +1072,12 @@ impl frame_system::offchain::CreateSignedTransaction for R where RuntimeCall: From, { - fn create_transaction>( + fn create_signed_transaction>( call: RuntimeCall, public: ::Signer, account: AccountId, nonce: Nonce, - ) -> Option<( - RuntimeCall, - ::SignaturePayload, - )> { + ) -> Option { // take the biggest period possible. let period = BlockHashCount::get() .checked_next_power_of_two() @@ -1067,7 +1089,7 @@ where // so the actual block number is `n`. .saturating_sub(1); let tip = 0; - let extra: SignedExtra = ( + let tx_ext: TxExtension = ( frame_system::CheckNonZeroSender::::new(), frame_system::CheckSpecVersion::::new(), frame_system::CheckTxVersion::::new(), @@ -1079,15 +1101,16 @@ where module_evm::SetEvmOrigin::::new(), module_transaction_payment::ChargeTransactionPayment::::from(tip), ); - let raw_payload = SignedPayload::new(call, extra) + let raw_payload = SignedPayload::new(call, tx_ext) .map_err(|e| { log::warn!("Unable to create signed payload: {:?}", e); }) .ok()?; let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?; let address = AccountIdLookup::unlookup(account); - let (call, extra, _) = raw_payload.deconstruct(); - Some((call, (address, signature, extra))) + let (call, tx_ext, _) = raw_payload.deconstruct(); + let transaction = UncheckedExtrinsic::new_signed(call, address, signature, tx_ext); + Some(transaction) } } @@ -1096,14 +1119,34 @@ impl frame_system::offchain::SigningTypes for Runtime { type Signature = Signature; } -impl frame_system::offchain::SendTransactionTypes for Runtime +impl frame_system::offchain::CreateTransactionBase for Runtime where RuntimeCall: From, { - type OverarchingCall = RuntimeCall; + type RuntimeCall = RuntimeCall; type Extrinsic = UncheckedExtrinsic; } +impl frame_system::offchain::CreateTransaction for Runtime +where + RuntimeCall: From, +{ + type Extension = TxExtension; + + fn create_transaction(call: RuntimeCall, extension: TxExtension) -> UncheckedExtrinsic { + UncheckedExtrinsic::new_transaction(call, extension) + } +} + +impl frame_system::offchain::CreateInherent for Runtime +where + RuntimeCall: From, +{ + fn create_inherent(call: RuntimeCall) -> UncheckedExtrinsic { + UncheckedExtrinsic::new_bare(call) + } +} + parameter_types! { pub DefaultLiquidationRatio: Ratio = Ratio::saturating_from_rational(150, 100); pub DefaultDebitExchangeRate: ExchangeRate = ExchangeRate::saturating_from_rational(1, 10); @@ -1251,7 +1294,7 @@ parameter_types! { type NegativeImbalance = >::NegativeImbalance; pub struct DealWithFees; impl OnUnbalanced for DealWithFees { - fn on_unbalanceds(mut fees_then_tips: impl Iterator) { + fn on_unbalanceds(mut fees_then_tips: impl Iterator) { if let Some(mut fees) = fees_then_tips.next() { if let Some(tips) = fees_then_tips.next() { tips.merge_into(&mut fees); @@ -1490,6 +1533,7 @@ impl pallet_proxy::Config for Runtime { type CallHasher = BlakeTwo256; type AnnouncementDepositBase = AnnouncementDepositBase; type AnnouncementDepositFactor = AnnouncementDepositFactor; + type BlockNumberProvider = System; } parameter_types! { @@ -1500,7 +1544,7 @@ parameter_types! { pub PrecompilesValue: AllPrecompiles, ()> = AllPrecompiles::<_, _, _>::karura(); } -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct StorageDepositPerByte; impl> frame_support::traits::Get for StorageDepositPerByte { fn get() -> I { @@ -1511,7 +1555,7 @@ impl> frame_support::traits::Get for StorageDepositPerByte { } // TODO: remove -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct TxFeePerGas; impl> frame_support::traits::Get for TxFeePerGas { fn get() -> I { @@ -1521,7 +1565,7 @@ impl> frame_support::traits::Get for TxFeePerGas { } } -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct TxFeePerGasV2; impl> frame_support::traits::Get for TxFeePerGasV2 { fn get() -> I { @@ -1584,6 +1628,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { CheckRelayNumber, cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases>; type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight; type ConsensusHook = ConsensusHook; + type SelectCore = cumulus_pallet_parachain_system::DefaultCoreSelector; } impl parachain_info::Config for Runtime {} @@ -1698,7 +1743,7 @@ impl orml_xcm::Config for Runtime { } define_combined_task! { - #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] pub enum ScheduledTasks { EvmTask(EvmTask), } @@ -1953,8 +1998,8 @@ pub type Block = generic::Block; pub type SignedBlock = generic::SignedBlock; /// BlockId type as expected by this runtime. pub type BlockId = generic::BlockId; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( +/// The extension to the basic transaction logic. +pub type TxExtension = ( frame_system::CheckNonZeroSender, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, @@ -1971,11 +2016,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = - AcalaUncheckedExtrinsic; + AcalaUncheckedExtrinsic; /// The payload being signed in transactions. -pub type SignedPayload = generic::SignedPayload; +pub type SignedPayload = generic::SignedPayload; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -2131,10 +2176,10 @@ impl_runtime_apis! { Balance, > for Runtime { fn query_info(uxt: ::Extrinsic, len: u32) -> RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) + TransactionPayment::query_info(uxt.0, len) } fn query_fee_details(uxt: ::Extrinsic, len: u32) -> pallet_transaction_payment_rpc_runtime_api::FeeDetails { - TransactionPayment::query_fee_details(uxt, len) + TransactionPayment::query_fee_details(uxt.0, len) } fn query_weight_to_fee(weight: Weight) -> Balance { TransactionPayment::weight_to_fee(weight) @@ -2219,6 +2264,7 @@ impl_runtime_apis! { gas_limit, storage_limit, access_list.unwrap_or_default().into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], ::config(), ) } @@ -2239,6 +2285,7 @@ impl_runtime_apis! { gas_limit, storage_limit, access_list.unwrap_or_default().into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], ::config(), ) } @@ -2377,7 +2424,7 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig - ) -> Result, sp_runtime::RuntimeString> { + ) -> Result, alloc::string::String> { use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError, add_benchmark as frame_add_benchmark}; use module_nft::benchmarking::Pallet as NftBench; use frame_support::traits::{WhitelistedStorageKeys, TrackedStorageKey}; @@ -2499,15 +2546,15 @@ cumulus_pallet_parachain_system::register_validate_block!( BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, ); -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug)] pub struct ConvertEthereumTx; -impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, SignedExtra), InvalidTransaction>> +impl Convert<(RuntimeCall, TxExtension), Result<(EthereumTransactionMessage, TxExtension), InvalidTransaction>> for ConvertEthereumTx { fn convert( - (call, mut extra): (RuntimeCall, SignedExtra), - ) -> Result<(EthereumTransactionMessage, SignedExtra), InvalidTransaction> { + (call, mut extra): (RuntimeCall, TxExtension), + ) -> Result<(EthereumTransactionMessage, TxExtension), InvalidTransaction> { match call { RuntimeCall::EVM(module_evm::Call::eth_call { action, diff --git a/runtime/karura/src/weights/pallet_xcm.rs b/runtime/karura/src/weights/pallet_xcm.rs index 6bc7526c0..dbe532b9a 100644 --- a/runtime/karura/src/weights/pallet_xcm.rs +++ b/runtime/karura/src/weights/pallet_xcm.rs @@ -359,4 +359,24 @@ impl pallet_xcm::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } } diff --git a/runtime/karura/src/xcm_config.rs b/runtime/karura/src/xcm_config.rs index 3035860ea..76d5f1058 100644 --- a/runtime/karura/src/xcm_config.rs +++ b/runtime/karura/src/xcm_config.rs @@ -26,7 +26,7 @@ use super::{ use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use frame_support::{ parameter_types, - traits::{ConstU32, Everything, Get, Nothing, TransformOrigin}, + traits::{ConstU32, Disabled, Everything, Get, Nothing, TransformOrigin}, }; use module_asset_registry::{BuyWeightRateOfErc20, BuyWeightRateOfForeignAsset, BuyWeightRateOfStableAsset}; use module_support::HomaSubAccountXcm; @@ -211,6 +211,7 @@ impl xcm_executor::Config for XcmConfig { type HrmpChannelAcceptedHandler = (); type HrmpChannelClosingHandler = (); type XcmRecorder = (); + type XcmEventEmitter = (); } pub type LocalOriginToLocation = SignedToAccountId32; @@ -256,6 +257,7 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRootOrThreeFourthsGeneralCouncil; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type AuthorizedAliasConsideration = Disabled; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/runtime/mandala/src/benchmarking/asset_registry.rs b/runtime/mandala/src/benchmarking/asset_registry.rs index b512fad26..c529e4d8d 100644 --- a/runtime/mandala/src/benchmarking/asset_registry.rs +++ b/runtime/mandala/src/benchmarking/asset_registry.rs @@ -26,7 +26,7 @@ use module_support::AddressMapping; use orml_benchmarking::runtime_benchmarks; use primitives::currency::AssetMetadata; use sp_std::{boxed::Box, str::FromStr, vec}; -use xcm::{prelude::*, v4::Location}; +use xcm::{prelude::*, v5::Location}; pub fn alice() -> AccountId { ::AddressMapping::get_account_id(&alice_evm_addr()) @@ -61,7 +61,7 @@ runtime_benchmarks! { { Runtime, module_asset_registry } register_foreign_asset { - let location = VersionedLocation::V4(Location::new( + let location = VersionedLocation::V5(Location::new( 0, [Parachain(1000)], )); @@ -74,7 +74,7 @@ runtime_benchmarks! { }: _(RawOrigin::Root, Box::new(location), Box::new(asset_metadata)) update_foreign_asset { - let location = VersionedLocation::V4(Location::new( + let location = VersionedLocation::V5(Location::new( 0, [Parachain(1000)], )); diff --git a/runtime/mandala/src/benchmarking/authority.rs b/runtime/mandala/src/benchmarking/authority.rs index 7b0ed77b7..87102e415 100644 --- a/runtime/mandala/src/benchmarking/authority.rs +++ b/runtime/mandala/src/benchmarking/authority.rs @@ -170,7 +170,7 @@ runtime_benchmarks! { let caller: AccountId = whitelisted_caller(); let call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] }); let hash = ::Hashing::hash_of(&call); - let call_weight_bound = call.get_dispatch_info().weight; + let call_weight_bound = call.get_dispatch_info().call_weight; System::set_block_number(1u32); Authority::authorize_call(RuntimeOrigin::root(), Box::new(call.clone()), Some(caller.clone()))?; }: _(RawOrigin::Signed(caller), hash, call_weight_bound) diff --git a/runtime/mandala/src/benchmarking/evm.rs b/runtime/mandala/src/benchmarking/evm.rs index 57b4e34c6..b7a4a0513 100644 --- a/runtime/mandala/src/benchmarking/evm.rs +++ b/runtime/mandala/src/benchmarking/evm.rs @@ -278,6 +278,7 @@ mod tests { 1_000_000, 100_000, vec![], + vec![], config, ) .unwrap(); @@ -304,6 +305,7 @@ mod tests { 1_000_000, 100_000, vec![], + vec![], config, ) .unwrap(); @@ -322,6 +324,7 @@ mod tests { 1_000_000, 100_000, vec![], + vec![], config, ) .unwrap(); diff --git a/runtime/mandala/src/constants.rs b/runtime/mandala/src/constants.rs index 51a9fd45a..a72a3468f 100644 --- a/runtime/mandala/src/constants.rs +++ b/runtime/mandala/src/constants.rs @@ -108,6 +108,6 @@ mod tests { let q = Balance::from(ExtrinsicBaseWeight::get().ref_time()); assert_eq!(p, 1_000_000_000); - assert_eq!(q, 107_074_000); + assert_eq!(q, 108_157_000); } } diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index 3afc5db0e..c5a201acd 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -30,6 +30,8 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +extern crate alloc; +use alloc::borrow::Cow; use cumulus_pallet_parachain_system::RelaychainDataProvider; use frame_support::{ construct_runtime, @@ -55,7 +57,7 @@ use module_evm::{runner::RunnerExtended, CallInfo, CreateInfo, EvmChainId, EvmTa use module_evm_accounts::EvmAddressMapping; use module_support::{AddressMapping, AssetIdMapping, DispatchableTask, ExchangeRateProvider, FractionalRate, PoolId}; use module_transaction_payment::TargetedFeeAdjustment; -use parity_scale_codec::{Decode, DecodeLimit, Encode}; +use parity_scale_codec::{Decode, DecodeLimit, DecodeWithMemTracking, Encode}; use polkadot_parachain_primitives::primitives::Sibling; use scale_info::TypeInfo; @@ -75,7 +77,7 @@ use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H160}; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, + generic, impl_opaque_keys, traits::{ AccountIdConversion, BadOrigin, BlakeTwo256, Block as BlockT, Bounded, Convert, IdentityLookup, SaturatedConversion, StaticLookup, @@ -129,14 +131,14 @@ pub mod xcm_config; /// This runtime version. #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("mandala"), - impl_name: create_runtime_str!("mandala"), + spec_name: Cow::Borrowed("mandala"), + impl_name: Cow::Borrowed("mandala"), authoring_version: 1, spec_version: 2300, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, - state_version: 1, + system_version: 1, }; /// The version information used to identify this runtime when compiled @@ -238,6 +240,7 @@ impl frame_system::Config for Runtime { type DbWeight = RocksDbWeight; type BaseCallFilter = BaseCallFilter; type SystemWeightInfo = (); + type ExtensionsWeightInfo = (); type SS58Prefix = SS58Prefix; type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; type MaxConsumers = ConstU32<16>; @@ -279,6 +282,7 @@ impl pallet_session::Config for Runtime { type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = (); + type DisablingStrategy = (); } parameter_types! { @@ -359,6 +363,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_types! { @@ -393,6 +398,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -423,6 +431,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -453,6 +464,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -483,6 +497,9 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type WeightInfo = (); type MaxProposalWeight = MaxProposalWeight; + type DisapproveOrigin = EnsureRoot; + type KillOrigin = EnsureRoot; + type Consideration = (); } impl pallet_membership::Config for Runtime { @@ -531,6 +548,7 @@ impl pallet_multisig::Config for Runtime { type DepositFactor = MultisigDepositFactor; type MaxSignatories = ConstU32<100>; type WeightInfo = (); + type BlockNumberProvider = System; } pub struct GeneralCouncilProvider; @@ -597,6 +615,7 @@ impl pallet_treasury::Config for Runtime { type Paymaster = PayFromAccount; type BalanceConverter = UnityAssetBalanceConversion; type PayoutPeriod = PayoutSpendPeriod; + type BlockNumberProvider = System; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); } @@ -645,6 +664,7 @@ impl pallet_recovery::Config for Runtime { type MaxFriends = ConstU32<9>; type RecoveryDeposit = RecoveryDeposit; type WeightInfo = (); + type BlockNumberProvider = System; } parameter_types! { @@ -1021,6 +1041,7 @@ impl pallet_scheduler::Config for Runtime { type WeightInfo = (); type OriginPrivilegeCmp = EqualPrivilegeOnly; type Preimages = Preimage; + type BlockNumberProvider = System; } parameter_types! { @@ -1076,15 +1097,12 @@ impl frame_system::offchain::CreateSignedTransaction for R where RuntimeCall: From, { - fn create_transaction>( + fn create_signed_transaction>( call: RuntimeCall, public: ::Signer, account: AccountId, nonce: Nonce, - ) -> Option<( - RuntimeCall, - ::SignaturePayload, - )> { + ) -> Option { // take the biggest period possible. let period = BlockHashCount::get() .checked_next_power_of_two() @@ -1096,7 +1114,7 @@ where // so the actual block number is `n`. .saturating_sub(1); let tip = 0; - let extra: SignedExtra = ( + let tx_ext: TxExtension = ( frame_system::CheckNonZeroSender::::new(), frame_system::CheckSpecVersion::::new(), frame_system::CheckTxVersion::::new(), @@ -1107,15 +1125,16 @@ where module_evm::SetEvmOrigin::::new(), module_transaction_payment::ChargeTransactionPayment::::from(tip), ); - let raw_payload = SignedPayload::new(call, extra) + let raw_payload = SignedPayload::new(call, tx_ext) .map_err(|e| { log::warn!("Unable to create signed payload: {:?}", e); }) .ok()?; let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?; let address = Indices::unlookup(account); - let (call, extra, _) = raw_payload.deconstruct(); - Some((call, (address, signature, extra))) + let (call, tx_ext, _) = raw_payload.deconstruct(); + let transaction = UncheckedExtrinsic::new_signed(call, address, signature, tx_ext); + Some(transaction) } } @@ -1124,14 +1143,34 @@ impl frame_system::offchain::SigningTypes for Runtime { type Signature = Signature; } -impl frame_system::offchain::SendTransactionTypes for Runtime +impl frame_system::offchain::CreateTransactionBase for Runtime where RuntimeCall: From, { - type OverarchingCall = RuntimeCall; + type RuntimeCall = RuntimeCall; type Extrinsic = UncheckedExtrinsic; } +impl frame_system::offchain::CreateTransaction for Runtime +where + RuntimeCall: From, +{ + type Extension = TxExtension; + + fn create_transaction(call: RuntimeCall, extension: TxExtension) -> UncheckedExtrinsic { + UncheckedExtrinsic::new_transaction(call, extension) + } +} + +impl frame_system::offchain::CreateInherent for Runtime +where + RuntimeCall: From, +{ + fn create_inherent(call: Self::RuntimeCall) -> Self::Extrinsic { + UncheckedExtrinsic::new_bare(call) + } +} + parameter_types! { pub DefaultLiquidationRatio: Ratio = Ratio::saturating_from_rational(110, 100); pub DefaultDebitExchangeRate: ExchangeRate = ExchangeRate::saturating_from_rational(1, 10); @@ -1285,7 +1324,7 @@ parameter_types! { type NegativeImbalance = >::NegativeImbalance; pub struct DealWithFees; impl OnUnbalanced for DealWithFees { - fn on_unbalanceds(mut fees_then_tips: impl Iterator) { + fn on_unbalanceds(mut fees_then_tips: impl Iterator) { if let Some(mut fees) = fees_then_tips.next() { if let Some(tips) = fees_then_tips.next() { tips.merge_into(&mut fees); @@ -1636,6 +1675,7 @@ impl pallet_proxy::Config for Runtime { type CallHasher = BlakeTwo256; type AnnouncementDepositBase = AnnouncementDepositBase; type AnnouncementDepositFactor = AnnouncementDepositFactor; + type BlockNumberProvider = System; } parameter_types! { @@ -1657,7 +1697,7 @@ parameter_types! { pub PublicationFee: Balance = dollar(ACA); } -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct StorageDepositPerByte; impl> frame_support::traits::Get for StorageDepositPerByte { fn get() -> I { @@ -1671,7 +1711,7 @@ impl> frame_support::traits::Get for StorageDepositPerByte { } // TODO: remove -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct TxFeePerGas; impl> frame_support::traits::Get for TxFeePerGas { fn get() -> I { @@ -1681,7 +1721,7 @@ impl> frame_support::traits::Get for TxFeePerGas { } } -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct TxFeePerGasV2; impl> frame_support::traits::Get for TxFeePerGasV2 { fn get() -> I { @@ -1753,6 +1793,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { CheckRelayNumber, cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases>; type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight; type ConsensusHook = ConsensusHook; + type SelectCore = cumulus_pallet_parachain_system::DefaultCoreSelector; } impl parachain_info::Config for Runtime {} @@ -1833,7 +1874,7 @@ impl nutsfinance_stable_asset::Config for Runtime { } define_combined_task! { - #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] + #[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)] pub enum ScheduledTasks { EvmTask(EvmTask), } @@ -1885,15 +1926,15 @@ impl orml_parameters::Config for Runtime { type WeightInfo = (); } -#[derive(Clone, Encode, Decode, PartialEq, Eq, RuntimeDebug)] +#[derive(Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug)] pub struct ConvertEthereumTx; -impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, SignedExtra), InvalidTransaction>> +impl Convert<(RuntimeCall, TxExtension), Result<(EthereumTransactionMessage, TxExtension), InvalidTransaction>> for ConvertEthereumTx { fn convert( - (call, mut extra): (RuntimeCall, SignedExtra), - ) -> Result<(EthereumTransactionMessage, SignedExtra), InvalidTransaction> { + (call, mut extra): (RuntimeCall, TxExtension), + ) -> Result<(EthereumTransactionMessage, TxExtension), InvalidTransaction> { match call { RuntimeCall::EVM(module_evm::Call::eth_call { action, @@ -2009,8 +2050,8 @@ pub type Block = generic::Block; pub type SignedBlock = generic::SignedBlock; /// BlockId type as expected by this runtime. pub type BlockId = generic::BlockId; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( +/// The extension to the basic transaction logic. +pub type TxExtension = ( frame_system::CheckNonZeroSender, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, @@ -2026,11 +2067,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = - AcalaUncheckedExtrinsic; + AcalaUncheckedExtrinsic; /// The payload being signed in transactions. -pub type SignedPayload = generic::SignedPayload; +pub type SignedPayload = generic::SignedPayload; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -2310,10 +2351,10 @@ impl_runtime_apis! { Balance, > for Runtime { fn query_info(uxt: ::Extrinsic, len: u32) -> RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) + TransactionPayment::query_info(uxt.0, len) } fn query_fee_details(uxt: ::Extrinsic, len: u32) -> FeeDetails { - TransactionPayment::query_fee_details(uxt, len) + TransactionPayment::query_fee_details(uxt.0, len) } fn query_weight_to_fee(weight: Weight) -> Balance { TransactionPayment::weight_to_fee(weight) @@ -2398,6 +2439,7 @@ impl_runtime_apis! { gas_limit, storage_limit, access_list.unwrap_or_default().into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], ::config(), ) } @@ -2418,6 +2460,7 @@ impl_runtime_apis! { gas_limit, storage_limit, access_list.unwrap_or_default().into_iter().map(|v| (v.address, v.storage_keys)).collect(), + vec![], ::config(), ) } @@ -2557,7 +2600,7 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig - ) -> Result, sp_runtime::RuntimeString> { + ) -> Result, alloc::string::String> { use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError, add_benchmark as frame_add_benchmark}; use module_nft::benchmarking::Pallet as NftBench; use frame_support::traits::{WhitelistedStorageKeys, TrackedStorageKey}; @@ -2685,7 +2728,10 @@ mod tests { use frame_support::{dispatch::DispatchInfo, traits::WhitelistedStorageKeys}; use frame_system::offchain::CreateSignedTransaction; use sp_core::hexdisplay::HexDisplay; - use sp_runtime::traits::SignedExtension; + use sp_runtime::{ + traits::DispatchTransaction, transaction_validity::TransactionSource::External, + transaction_validity::ValidTransaction, + }; use std::collections::HashSet; #[test] @@ -2782,7 +2828,7 @@ mod tests { access_list: vec![], }); - let extra: SignedExtra = ( + let extra: TxExtension = ( frame_system::CheckNonZeroSender::::new(), frame_system::CheckSpecVersion::::new(), frame_system::CheckTxVersion::::new(), @@ -2822,38 +2868,50 @@ mod tests { // valid tx in future assert_eq!( - extra.5.validate(&alice, &call, &info, 0), - Ok(sp_runtime::transaction_validity::ValidTransaction { + extra + .5 + .validate_only(Some(alice.clone()).into(), &call, &info, 0, External, 0) + .unwrap() + .0, + ValidTransaction { priority: 0, requires: vec![Encode::encode(&(alice.clone(), 2u32))], provides: vec![Encode::encode(&(alice.clone(), 3u32))], longevity: sp_runtime::transaction_validity::TransactionLongevity::MAX, propagate: true, - }) + } ); // valid evm tx assert_eq!( - expected_extra.5.validate(&alice, &call, &info, 0), - Ok(sp_runtime::transaction_validity::ValidTransaction { + expected_extra + .5 + .validate_only(Some(alice.clone()).into(), &call, &info, 0, External, 0) + .unwrap() + .0, + ValidTransaction { priority: 0, requires: vec![], provides: vec![Encode::encode(&(address, 3u32))], longevity: 30, propagate: true, - }) + } ); // valid evm tx in future expected_extra.5.nonce = 4; assert_eq!( - expected_extra.5.validate(&alice, &call, &info, 0), - Ok(sp_runtime::transaction_validity::ValidTransaction { + expected_extra + .5 + .validate_only(Some(alice.clone()).into(), &call, &info, 0, External, 0) + .unwrap() + .0, + ValidTransaction { priority: 0, requires: vec![Encode::encode(&(address, 3u32))], provides: vec![Encode::encode(&(address, 4u32))], longevity: 30, propagate: true, - }) + } ); }); } diff --git a/runtime/mandala/src/weights/pallet_xcm.rs b/runtime/mandala/src/weights/pallet_xcm.rs index 6bc7526c0..dbe532b9a 100644 --- a/runtime/mandala/src/weights/pallet_xcm.rs +++ b/runtime/mandala/src/weights/pallet_xcm.rs @@ -359,4 +359,24 @@ impl pallet_xcm::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_authorized_alias() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } } diff --git a/runtime/mandala/src/xcm_config.rs b/runtime/mandala/src/xcm_config.rs index 580009a8e..1eab48754 100644 --- a/runtime/mandala/src/xcm_config.rs +++ b/runtime/mandala/src/xcm_config.rs @@ -26,7 +26,7 @@ use super::{ pub use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; pub use frame_support::{ parameter_types, - traits::{ConstU32, Everything, Get, Nothing, TransformOrigin}, + traits::{ConstU32, Disabled, Equals, Everything, Get, Nothing, TransformOrigin}, weights::Weight, }; use module_asset_registry::{BuyWeightRateOfErc20, BuyWeightRateOfForeignAsset, BuyWeightRateOfStableAsset}; @@ -137,6 +137,7 @@ impl xcm_executor::Config for XcmConfig { type HrmpChannelAcceptedHandler = (); type HrmpChannelClosingHandler = (); type XcmRecorder = (); + type XcmEventEmitter = (); } /// No local origins on this chain are allowed to dispatch XCM sends/executions. @@ -183,6 +184,7 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRootOrThreeFourthsGeneralCouncil; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + type AuthorizedAliasConsideration = Disabled; } impl cumulus_pallet_xcm::Config for Runtime { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e5acc0608..b596760ad 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] channel = "1.84.1" -components = ["rust-src", "rustfmt", "clippy"] -targets = ["wasm32-unknown-unknown"] +components = ["rustfmt", "clippy"] +targets = ["wasm32v1-none"]