diff --git a/Cargo.lock b/Cargo.lock index 093f5587e..adc5407ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,6 +27,117 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aead" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", +] + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array 0.14.7", +] + +[[package]] +name = "aes" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +dependencies = [ + "aes-soft", + "aesni", + "cipher 0.2.5", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher 0.3.0", + "cpufeatures", + "opaque-debug 0.3.0", +] + +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if", + "cipher 0.4.4", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "cipher 0.3.0", + "ctr 0.8.0", + "ghash 0.4.4", + "subtle", +] + +[[package]] +name = "aes-gcm" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" +dependencies = [ + "aead 0.5.2", + "aes 0.8.3", + "cipher 0.4.4", + "ctr 0.9.2", + "ghash 0.5.0", + "subtle", +] + +[[package]] +name = "aes-soft" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" +dependencies = [ + "cipher 0.2.5", + "opaque-debug 0.3.0", +] + +[[package]] +name = "aesni" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" +dependencies = [ + "cipher 0.2.5", + "opaque-debug 0.3.0", +] + [[package]] name = "ahash" version = "0.7.6" @@ -59,6 +170,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "always-assert" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4436e0292ab1bb631b42973c61205e704475fe8126af845c8d923c0996328127" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -84,2065 +207,10733 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.71" +name = "anstream" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] [[package]] -name = "array-bytes" -version = "4.2.0" +name = "anstyle" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" [[package]] -name = "arrayref" -version = "0.3.7" +name = "anstyle-parse" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] [[package]] -name = "arrayvec" -version = "0.5.2" +name = "anstyle-query" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] [[package]] -name = "arrayvec" -version = "0.7.4" +name = "anstyle-wincon" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] [[package]] -name = "autocfg" -version = "1.1.0" +name = "anyhow" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] -name = "backtrace" -version = "0.3.67" +name = "approx" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", + "num-traits", ] [[package]] -name = "base64" -version = "0.13.1" +name = "aquamarine" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "df752953c49ce90719c7bf1fc587bc8227aed04732ea0c0f85e5397d7fdbd1a1" +dependencies = [ + "include_dir", + "itertools", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "bincode" -version = "1.3.3" +name = "arbitrary" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" dependencies = [ - "serde", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", ] [[package]] -name = "bitflags" -version = "1.3.2" +name = "ark-ec" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] [[package]] -name = "bitvec" -version = "1.0.1" +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" dependencies = [ - "funty", - "radium", - "tap", - "wyz", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-std", ] [[package]] -name = "blake2" -version = "0.10.6" +name = "ark-ff" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", "digest 0.10.7", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", ] [[package]] -name = "blake2b_simd" -version = "1.0.1" +name = "ark-ff-asm" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ - "arrayref", - "arrayvec 0.7.4", - "constant_time_eq", + "quote", + "syn 1.0.109", ] [[package]] -name = "block-buffer" -version = "0.7.3" +name = "ark-ff-macros" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "block-buffer" -version = "0.9.0" +name = "ark-poly" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" dependencies = [ - "generic-array 0.14.7", + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", ] [[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +name = "ark-secret-scalar" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=c86ebd4#c86ebd4114d3165d05f9ce28c1d9e8d7a9a4e801" dependencies = [ - "generic-array 0.14.7", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "ark-transcript", + "digest 0.10.7", + "rand_core 0.6.4", + "zeroize", ] [[package]] -name = "block-padding" -version = "0.1.5" +name = "ark-serialize" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ - "byte-tools", + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", ] [[package]] -name = "bounded-collections" -version = "0.1.8" +name = "ark-serialize-derive" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ - "log", - "parity-scale-codec", - "scale-info", - "serde", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "bs58" +name = "ark-std" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] [[package]] -name = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +name = "ark-transcript" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=c86ebd4#c86ebd4114d3165d05f9ce28c1d9e8d7a9a4e801" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] [[package]] -name = "byte-slice-cast" -version = "1.2.2" +name = "array-bytes" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" [[package]] -name = "byte-tools" -version = "0.3.1" +name = "arrayref" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] -name = "byteorder" -version = "1.4.3" +name = "arrayvec" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] -name = "bytes" -version = "1.4.0" +name = "arrayvec" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] -name = "cc" -version = "1.0.79" +name = "asn1-rs" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" +dependencies = [ + "asn1-rs-derive 0.1.0", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time 0.3.27", +] [[package]] -name = "chrono" -version = "0.4.26" +name = "asn1-rs" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "android-tzdata", - "iana-time-zone", + "asn1-rs-derive 0.4.0", + "asn1-rs-impl", + "displaydoc", + "nom", "num-traits", - "winapi", + "rusticata-macros", + "thiserror", + "time 0.3.27", ] [[package]] -name = "constant_time_eq" -version = "0.2.6" +name = "asn1-rs-derive" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" +checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] [[package]] -name = "core-foundation-sys" -version = "0.8.4" +name = "asn1-rs-derive" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] [[package]] -name = "cpp_demangle" -version = "0.3.5" +name = "asn1-rs-impl" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "cpufeatures" -version = "0.2.8" +name = "assert_matches" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" -dependencies = [ - "libc", -] +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] -name = "cranelift-entity" -version = "0.95.1" +name = "async-channel" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ - "serde", + "concurrent-queue", + "event-listener", + "futures-core", ] [[package]] -name = "crc32fast" -version = "1.3.2" +name = "async-io" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ + "async-lock", + "autocfg", "cfg-if", + "concurrent-queue", + "futures-lite", + "log", + "parking", + "polling", + "rustix 0.37.20", + "slab", + "socket2 0.4.9", + "waker-fn", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "async-lock" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener", +] [[package]] -name = "crypto-common" -version = "0.1.6" +name = "async-trait" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ - "generic-array 0.14.7", - "typenum", + "proc-macro2", + "quote", + "syn 2.0.29", ] [[package]] -name = "crypto-mac" -version = "0.8.0" +name = "asynchronous-codec" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ - "generic-array 0.14.7", - "subtle", + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite 0.2.9", ] [[package]] -name = "crypto-mac" -version = "0.11.1" +name = "atomic-waker" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array 0.14.7", - "subtle", -] +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" [[package]] -name = "curve25519-dalek" -version = "2.1.3" +name = "atty" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core 0.5.1", - "subtle", - "zeroize", + "hermit-abi 0.1.19", + "libc", + "winapi", ] [[package]] -name = "curve25519-dalek" -version = "3.2.0" +name = "autocfg" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.6.2", + "object", + "rustc-demangle", +] + +[[package]] +name = "bandersnatch_vrfs" +version = "0.0.1" +source = "git+https://github.com/w3f/ring-vrf?rev=c86ebd4#c86ebd4114d3165d05f9ce28c1d9e8d7a9a4e801" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-serialize", + "ark-std", + "dleq_vrf", + "fflonk", + "merlin 3.0.0", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "ring 0.1.0", + "sha2 0.10.7", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "base-x" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" [[package]] -name = "derive_more" -version = "0.99.17" +name = "base16ct" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" [[package]] -name = "digest" -version = "0.8.1" +name = "base16ct" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] -name = "digest" -version = "0.9.0" +name = "base64" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array 0.14.7", -] +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] -name = "digest" -version = "0.10.7" +name = "base64" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" dependencies = [ - "block-buffer 0.10.4", - "crypto-common", - "subtle", + "serde", ] [[package]] -name = "dyn-clonable" -version = "0.9.0" +name = "bincode" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "dyn-clonable-impl", - "dyn-clone", + "serde", ] [[package]] -name = "dyn-clonable-impl" -version = "0.9.0" +name = "bindgen" +version = "0.65.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "prettyplease 0.2.12", "proc-macro2", "quote", - "syn 1.0.109", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.29", ] [[package]] -name = "dyn-clone" -version = "1.0.11" +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "ed25519" -version = "1.5.3" +name = "bitflags" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" -dependencies = [ - "signature", -] +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] -name = "ed25519-dalek" +name = "bitvec" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ - "curve25519-dalek 3.2.0", - "ed25519", - "sha2 0.9.9", - "zeroize", + "funty", + "radium", + "tap", + "wyz", ] [[package]] -name = "ed25519-zebra" -version = "3.1.0" +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", - "hex", - "rand_core 0.6.4", - "sha2 0.9.9", - "zeroize", + "digest 0.10.7", ] [[package]] -name = "environmental" -version = "1.1.4" +name = "blake2b_simd" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq 0.2.6", +] [[package]] -name = "errno" -version = "0.3.1" +name = "blake2s_simd" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq 0.2.6", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "blake3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" dependencies = [ + "arrayref", + "arrayvec 0.7.4", "cc", - "libc", + "cfg-if", + "constant_time_eq 0.3.0", + "digest 0.10.7", ] [[package]] -name = "fake-simd" -version = "0.1.2" +name = "block-buffer" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding 0.1.5", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] [[package]] -name = "fallible-iterator" -version = "0.2.0" +name = "block-buffer" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.7", +] [[package]] -name = "fixed-hash" -version = "0.8.0" +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", - "static_assertions", + "generic-array 0.14.7", ] [[package]] -name = "form_urlencoded" -version = "1.2.0" +name = "block-modes" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" dependencies = [ - "percent-encoding", + "block-padding 0.2.1", + "cipher 0.2.5", ] [[package]] -name = "funty" -version = "2.0.0" +name = "block-padding" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] [[package]] -name = "futures" -version = "0.3.28" +name = "block-padding" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "bounded-collections" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", + "log", + "parity-scale-codec", + "scale-info", + "serde", ] [[package]] -name = "futures-channel" -version = "0.3.28" +name = "bounded-vec" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "68534a48cbf63a4b1323c433cf21238c9ec23711e0df13b08c33e5c2082663ce" dependencies = [ - "futures-core", - "futures-sink", + "thiserror", ] [[package]] -name = "futures-core" -version = "0.3.28" +name = "bs58" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] -name = "futures-executor" -version = "0.3.28" +name = "bstr" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", + "memchr", + "serde", ] [[package]] -name = "futures-io" -version = "0.3.28" +name = "build-helper" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" +dependencies = [ + "semver 0.6.0", +] [[package]] -name = "futures-macro" -version = "0.3.28" +name = "bumpalo" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.18", -] +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] -name = "futures-sink" -version = "0.3.28" +name = "byte-slice-cast" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] -name = "futures-task" -version = "0.3.28" +name = "byte-tools" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] -name = "futures-util" -version = "0.3.28" +name = "bytemuck" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" [[package]] -name = "generic-array" -version = "0.12.4" +name = "byteorder" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] -name = "generic-array" -version = "0.14.7" +name = "bytes" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] -name = "getrandom" -version = "0.1.16" +name = "bzip2-sys" +version = "0.1.11+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" dependencies = [ - "cfg-if", + "cc", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "pkg-config", ] [[package]] -name = "getrandom" -version = "0.2.10" +name = "camino" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "serde", ] [[package]] -name = "gimli" -version = "0.27.3" +name = "cargo-platform" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", + "serde", ] [[package]] -name = "hash-db" -version = "0.16.0" +name = "cargo_metadata" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.18", + "serde", + "serde_json", + "thiserror", +] [[package]] -name = "hash256-std-hasher" -version = "0.15.2" +name = "cc" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" dependencies = [ - "crunchy", + "jobserver", ] [[package]] -name = "hashbrown" -version = "0.12.3" +name = "ccm" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" dependencies = [ - "ahash 0.7.6", + "aead 0.3.2", + "cipher 0.2.5", + "subtle", ] [[package]] -name = "hashbrown" -version = "0.13.2" +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "ahash 0.8.3", + "nom", ] [[package]] -name = "hermit-abi" -version = "0.2.6" +name = "cfg-expr" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9" dependencies = [ - "libc", + "smallvec", ] [[package]] -name = "hermit-abi" -version = "0.3.1" +name = "cfg-if" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "hex" -version = "0.4.3" +name = "cfg_aliases" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] -name = "hex-literal" -version = "0.4.1" +name = "chacha20" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +dependencies = [ + "cfg-if", + "cipher 0.3.0", + "cpufeatures", + "zeroize", +] [[package]] -name = "hmac" -version = "0.8.1" +name = "chacha20poly1305" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", + "aead 0.4.3", + "chacha20", + "cipher 0.3.0", + "poly1305", + "zeroize", ] [[package]] -name = "hmac" -version = "0.11.0" +name = "chrono" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ - "crypto-mac 0.11.1", - "digest 0.9.0", + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "time 0.1.45", + "wasm-bindgen", + "winapi", ] [[package]] -name = "hmac" -version = "0.12.1" +name = "cid" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" dependencies = [ - "digest 0.10.7", + "core2", + "multibase", + "multihash", + "serde", + "unsigned-varint", ] [[package]] -name = "hmac-drbg" -version = "0.3.0" +name = "cipher" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "digest 0.9.0", "generic-array 0.14.7", - "hmac 0.8.1", ] [[package]] -name = "iana-time-zone" -version = "0.1.57" +name = "cipher" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows", + "generic-array 0.14.7", ] [[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" +name = "cipher" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "cc", + "crypto-common", + "inout", ] [[package]] -name = "idna" -version = "0.4.0" +name = "ckb-merkle-mountain-range" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "cfg-if", ] [[package]] -name = "impl-codec" -version = "0.6.0" +name = "clang-sys" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ - "parity-scale-codec", + "glob", + "libc", + "libloading", ] [[package]] -name = "impl-serde" -version = "0.4.0" +name = "clap" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +checksum = "1d5f1946157a96594eb2d2c10eb7ad9a2b27518cb3000209dec700c35df9197d" dependencies = [ - "serde", + "clap_builder", + "clap_derive", + "once_cell", ] [[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" +name = "clap_builder" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "78116e32a042dd73c2901f0dc30790d20ff3447f3e3472fad359e8c3d282bcd6" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "anstream", + "anstyle", + "clap_lex", + "strsim", ] [[package]] -name = "indexmap" -version = "1.9.3" +name = "clap_derive" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", + "heck", + "proc-macro2", + "quote", + "syn 2.0.29", ] [[package]] -name = "integer-sqrt" -version = "0.1.5" +name = "clap_lex" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" + +[[package]] +name = "coarsetime" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a90d114103adbc625300f346d4d09dfb4ab1c4a8df6868435dd903392ecf4354" dependencies = [ - "num-traits", + "libc", + "once_cell", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "codespan-reporting" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", + "termcolor", + "unicode-width", ] [[package]] -name = "itoa" -version = "1.0.6" +name = "colorchoice" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] -name = "js-sys" -version = "0.3.64" +name = "comfy-table" +version = "7.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "9ab77dbd8adecaf3f0db40581631b995f312a8a5ae3aa9993188bb8f23d83a5b" dependencies = [ - "wasm-bindgen", + "strum", + "strum_macros", + "unicode-width", ] [[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +name = "common" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof#0e948f3c28cbacecdd3020403c4841c0eb339213" dependencies = [ - "cpufeatures", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "fflonk", + "merlin 3.0.0", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "common-path" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] -name = "libc" -version = "0.2.146" +name = "concurrent-queue" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +dependencies = [ + "crossbeam-utils", +] [[package]] -name = "libsecp256k1" -version = "0.7.1" +name = "const-oid" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" -dependencies = [ - "arrayref", - "base64", - "digest 0.9.0", - "hmac-drbg", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", - "rand 0.8.5", - "serde", - "sha2 0.9.9", - "typenum", -] +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] -name = "libsecp256k1-core" -version = "0.3.0" +name = "const-random" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" dependencies = [ - "crunchy", - "digest 0.9.0", - "subtle", + "const-random-macro", + "proc-macro-hack", ] [[package]] -name = "libsecp256k1-gen-ecmult" -version = "0.3.0" +name = "const-random-macro" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" dependencies = [ - "libsecp256k1-core", + "getrandom 0.2.10", + "once_cell", + "proc-macro-hack", + "tiny-keccak", ] [[package]] -name = "libsecp256k1-gen-genmult" -version = "0.3.0" +name = "constant_time_eq" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" -dependencies = [ - "libsecp256k1-core", -] +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" [[package]] -name = "linux-raw-sys" -version = "0.1.4" +name = "constant_time_eq" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] -name = "linux-raw-sys" -version = "0.3.8" +name = "convert_case" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] -name = "lock_api" -version = "0.4.10" +name = "core-foundation" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ - "autocfg", - "scopeguard", + "core-foundation-sys", + "libc", ] [[package]] -name = "log" -version = "0.4.19" +name = "core-foundation-sys" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] -name = "mach" -version = "0.3.2" +name = "core2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" dependencies = [ - "libc", + "memchr", ] [[package]] -name = "matchers" -version = "0.0.1" +name = "cpp_demangle" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" dependencies = [ - "regex-automata", + "cfg-if", ] [[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memfd" -version = "0.6.3" +name = "cpu-time" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +checksum = "e9e393a7668fe1fad3075085b86c781883000b4ede868f43627b34a87c8b7ded" dependencies = [ - "rustix 0.37.20", + "libc", + "winapi", ] [[package]] -name = "memoffset" -version = "0.8.0" +name = "cpufeatures" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" dependencies = [ - "autocfg", + "libc", ] [[package]] -name = "memory-db" -version = "0.32.0" +name = "cranelift-bforest" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" dependencies = [ - "hash-db", + "cranelift-entity", ] [[package]] -name = "merlin" -version = "2.0.1" +name = "cranelift-codegen" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" dependencies = [ - "byteorder", - "keccak", - "rand_core 0.5.1", - "zeroize", + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-entity", + "cranelift-isle", + "gimli", + "hashbrown 0.13.2", + "log", + "regalloc2", + "smallvec", + "target-lexicon", ] [[package]] -name = "miniz_oxide" -version = "0.6.2" +name = "cranelift-codegen-meta" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" dependencies = [ - "adler", + "cranelift-codegen-shared", ] [[package]] -name = "nohash-hasher" -version = "0.2.0" +name = "cranelift-codegen-shared" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" [[package]] -name = "num-format" -version = "0.4.4" +name = "cranelift-entity" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" dependencies = [ - "arrayvec 0.7.4", - "itoa", + "serde", ] [[package]] -name = "num-traits" -version = "0.2.15" +name = "cranelift-frontend" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" dependencies = [ - "autocfg", + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", ] [[package]] -name = "num_cpus" -version = "1.15.0" +name = "cranelift-isle" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" + +[[package]] +name = "cranelift-native" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" dependencies = [ - "hermit-abi 0.2.6", + "cranelift-codegen", "libc", + "target-lexicon", ] [[package]] -name = "object" -version = "0.30.4" +name = "cranelift-wasm" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" dependencies = [ - "crc32fast", - "hashbrown 0.13.2", - "indexmap", - "memchr", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools", + "log", + "smallvec", + "wasmparser", + "wasmtime-types", ] [[package]] -name = "once_cell" -version = "1.18.0" +name = "crc" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] [[package]] -name = "opaque-debug" -version = "0.2.3" +name = "crc-catalog" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "crc32fast" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] [[package]] -name = "parity-scale-codec" -version = "3.6.1" +name = "crossbeam-channel" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2287753623c76f953acd29d15d8100bcab84d29db78fb6f352adb3c53e83b967" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ - "arrayvec 0.7.4", - "bitvec", - "byte-slice-cast", - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", + "cfg-if", + "crossbeam-utils", ] [[package]] -name = "parity-scale-codec-derive" -version = "3.6.1" +name = "crossbeam-deque" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b6937b5e67bfba3351b87b040d48352a2fcb6ad72f81855412ce97b45c8f110" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", ] [[package]] -name = "parking_lot" -version = "0.12.1" +name = "crossbeam-epoch" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ - "lock_api", - "parking_lot_core", + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset 0.9.0", + "scopeguard", ] [[package]] -name = "parking_lot_core" -version = "0.9.8" +name = "crossbeam-queue" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" dependencies = [ "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.48.0", + "crossbeam-utils", ] [[package]] -name = "paste" -version = "1.0.12" +name = "crossbeam-utils" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] [[package]] -name = "pbkdf2" -version = "0.8.0" +name = "crunchy" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ - "crypto-mac 0.11.1", + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", ] [[package]] -name = "pbkdf2" -version = "0.11.0" +name = "crypto-bigint" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" dependencies = [ - "digest 0.10.7", + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", ] [[package]] -name = "percent-encoding" -version = "2.3.0" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "typenum", +] [[package]] -name = "pin-project-lite" -version = "0.2.9" +name = "crypto-mac" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] [[package]] -name = "pin-utils" -version = "0.1.0" +name = "crypto-mac" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "ctr" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher 0.3.0", +] [[package]] -name = "primitive-types" -version = "0.12.1" +name = "ctr" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "fixed-hash", - "impl-codec", - "impl-serde", - "scale-info", - "uint", + "cipher 0.4.4", ] [[package]] -name = "proc-macro-crate" -version = "1.3.1" +name = "curve25519-dalek" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" dependencies = [ - "once_cell", - "toml_edit", + "byteorder", + "digest 0.8.1", + "rand_core 0.5.1", + "subtle", + "zeroize", ] [[package]] -name = "proc-macro2" -version = "1.0.60" +name = "curve25519-dalek" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ - "unicode-ident", + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", ] [[package]] -name = "psm" -version = "0.1.21" +name = "curve25519-dalek" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" dependencies = [ - "cc", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", + "zeroize", ] [[package]] -name = "quote" -version = "1.0.28" +name = "curve25519-dalek-derive" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", + "quote", + "syn 2.0.29", ] [[package]] -name = "radium" -version = "0.7.0" +name = "cxx" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +checksum = "28403c86fc49e3401fdf45499ba37fad6493d9329449d6449d7f0e10f4654d28" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] [[package]] -name = "rand" -version = "0.7.3" +name = "cxx-build" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +checksum = "78da94fef01786dc3e0c76eafcd187abcaa9972c78e05ff4041e24fdf059c285" dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.29", ] [[package]] -name = "rand" -version = "0.8.5" +name = "cxxbridge-flags" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] +checksum = "e2a6f5e1dfb4b34292ad4ea1facbfdaa1824705b231610087b00b17008641809" [[package]] -name = "rand_chacha" -version = "0.2.2" +name = "cxxbridge-macro" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d" dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "proc-macro2", + "quote", + "syn 2.0.29", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "darling" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", + "darling_core", + "darling_macro", ] [[package]] -name = "rand_core" -version = "0.5.1" +name = "darling_core" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ - "getrandom 0.1.16", + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", ] [[package]] -name = "rand_core" -version = "0.6.4" +name = "darling_macro" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ - "getrandom 0.2.10", + "darling_core", + "quote", + "syn 1.0.109", ] [[package]] -name = "rand_hc" -version = "0.2.0" +name = "data-encoding" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] -name = "redox_syscall" -version = "0.3.5" +name = "data-encoding-macro" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" dependencies = [ - "bitflags", + "data-encoding", + "data-encoding-macro-internal", ] [[package]] -name = "ref-cast" -version = "1.0.16" +name = "data-encoding-macro-internal" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43faa91b1c8b36841ee70e97188a869d37ae21759da6846d4be66de5bf7b12c" +checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" dependencies = [ - "ref-cast-impl", + "data-encoding", + "syn 1.0.109", ] [[package]] -name = "ref-cast-impl" -version = "1.0.16" +name = "der" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.18", + "const-oid", + "pem-rfc7468", + "zeroize", ] [[package]] -name = "regex" -version = "1.8.4" +name = "der" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.7.2", + "const-oid", + "zeroize", ] [[package]] -name = "regex-automata" -version = "0.1.10" +name = "der-parser" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" dependencies = [ - "regex-syntax 0.6.29", + "asn1-rs 0.3.1", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", ] [[package]] -name = "regex-syntax" -version = "0.6.29" +name = "der-parser" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs 0.5.2", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] [[package]] -name = "regex-syntax" -version = "0.7.2" +name = "deranged" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] -name = "rustc-demangle" -version = "0.1.23" +name = "derivative" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "rustc-hash" -version = "1.1.0" +name = "derive-syn-parse" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "rustc-hex" -version = "2.1.0" +name = "derive_builder" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" +dependencies = [ + "derive_builder_macro", +] [[package]] -name = "rustix" -version = "0.36.14" +name = "derive_builder_core" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e4d67015953998ad0eb82887a0eb0129e18a7e2f3b7b0f6c422fddcd503d62" +checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "rustix" -version = "0.37.20" +name = "derive_builder_macro" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", + "derive_builder_core", + "syn 1.0.109", ] [[package]] -name = "rustversion" -version = "1.0.12" +name = "derive_more" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] [[package]] -name = "ryu" -version = "1.0.13" +name = "difflib" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" [[package]] -name = "scale-info" -version = "2.8.0" +name = "digest" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad560913365790f17cbf12479491169f01b9d46d29cfc7422bf8c64bdc61b731" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "bitvec", - "cfg-if", - "derive_more", - "parity-scale-codec", - "scale-info-derive", - "serde", + "generic-array 0.12.4", ] [[package]] -name = "scale-info-derive" -version = "2.8.0" +name = "digest" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19df9bd9ace6cc2fe19387c96ce677e823e07d017ceed253e7bb3d1d1bd9c73b" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", + "generic-array 0.14.7", ] [[package]] -name = "schnellru" -version = "0.2.1" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "ahash 0.8.3", - "cfg-if", - "hashbrown 0.13.2", + "block-buffer 0.10.4", + "const-oid", + "crypto-common", + "subtle", ] [[package]] -name = "schnorrkel" -version = "0.9.1" +name = "directories" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "curve25519-dalek 2.1.3", - "getrandom 0.1.16", - "merlin", - "rand 0.7.3", - "rand_core 0.5.1", - "sha2 0.8.2", - "subtle", - "zeroize", + "dirs-sys", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "directories-next" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] [[package]] -name = "secp256k1" -version = "0.24.3" +name = "dirs-sys" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ - "secp256k1-sys", + "libc", + "redox_users", + "winapi", ] [[package]] -name = "secp256k1-sys" -version = "0.6.1" +name = "dirs-sys-next" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ - "cc", + "libc", + "redox_users", + "winapi", ] [[package]] -name = "secrecy" -version = "0.8.0" +name = "displaydoc" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "dleq_vrf" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=c86ebd4#c86ebd4114d3165d05f9ce28c1d9e8d7a9a4e801" dependencies = [ + "ark-ec", + "ark-ff", + "ark-secret-scalar", + "ark-serialize", + "ark-std", + "ark-transcript", + "arrayvec 0.7.4", + "rand_core 0.6.4", "zeroize", ] [[package]] -name = "serde" -version = "1.0.164" +name = "docify" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "029de870d175d11969524d91a3fb2cbf6d488b853bff99d41cf65e533ac7d9d2" dependencies = [ - "serde_derive", + "docify_macros", ] [[package]] -name = "serde_derive" -version = "1.0.164" +name = "docify_macros" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "cac43324656a1b05eb0186deb51f27d2d891c704c37f34de281ef6297ba193e5" dependencies = [ + "common-path", + "derive-syn-parse", + "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "regex", + "syn 2.0.29", + "termcolor", + "toml 0.7.6", + "walkdir", ] [[package]] -name = "serde_json" -version = "1.0.97" +name = "downcast" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + +[[package]] +name = "dyn-clonable" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" dependencies = [ - "itoa", - "ryu", - "serde", + "dyn-clonable-impl", + "dyn-clone", ] [[package]] -name = "sha2" -version = "0.8.2" +name = "dyn-clonable-impl" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "sha2" -version = "0.9.9" +name = "dyn-clone" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" + +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", ] [[package]] -name = "sha2" -version = "0.10.7" +name = "ecdsa" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ - "cfg-if", - "cpufeatures", + "der 0.7.8", "digest 0.10.7", + "elliptic-curve 0.13.5", + "rfc6979 0.4.0", + "signature 2.1.0", + "spki 0.7.2", ] [[package]] -name = "sha3" -version = "0.10.8" +name = "ed25519" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ - "digest 0.10.7", - "keccak", + "pkcs8 0.10.2", + "signature 2.1.0", ] [[package]] -name = "sharded-slab" -version = "0.1.4" +name = "ed25519-dalek" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ - "lazy_static", + "curve25519-dalek 4.0.0", + "ed25519", + "rand_core 0.6.4", + "serde", + "sha2 0.10.7", + "zeroize", ] [[package]] -name = "signature" -version = "1.6.4" +name = "ed25519-zebra" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +dependencies = [ + "curve25519-dalek 3.2.0", + "hashbrown 0.12.3", + "hex", + "rand_core 0.6.4", + "sha2 0.9.9", + "zeroize", +] [[package]] -name = "slab" -version = "0.4.8" +name = "either" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ - "autocfg", + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array 0.14.7", + "group 0.12.1", + "hkdf", + "pem-rfc7468", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sec1 0.3.0", + "subtle", + "zeroize", ] [[package]] -name = "smallvec" -version = "1.10.0" +name = "elliptic-curve" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +dependencies = [ + "base16ct 0.2.0", + "crypto-bigint 0.5.2", + "digest 0.10.7", + "ff 0.13.0", + "generic-array 0.14.7", + "group 0.13.0", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "sec1 0.7.3", + "subtle", + "zeroize", +] [[package]] -name = "sp-arithmetic" -version = "16.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "enum-as-inner" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-std", - "static_assertions", + "heck", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "sp-core" -version = "21.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "enumflags2" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +dependencies = [ + "enumflags2_derive", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "enumn" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b893c4eb2dc092c811165f84dc7447fae16fb66521717968c34c509b39b1a5c5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "exit-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" +dependencies = [ + "futures", +] + +[[package]] +name = "expander" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a718c0675c555c5f976fff4ea9e2c150fa06cefa201cadef87cfbf9324075881" +dependencies = [ + "blake3", + "fs-err", + "proc-macro2", + "quote", +] + +[[package]] +name = "expander" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3774182a5df13c3d1690311ad32fbe913feef26baba609fa2dd5f72042bd2ab6" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", +] + +[[package]] +name = "expander" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f86a749cf851891866c10515ef6c299b5c69661465e9c3bbe7e07a2b77fb0f7" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "fatality" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad875162843b0d046276327afe0136e9ed3a23d5a754210fb6f1f33610d39ab" +dependencies = [ + "fatality-proc-macro", + "thiserror", +] + +[[package]] +name = "fatality-proc-macro" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" +dependencies = [ + "expander 0.0.4", + "indexmap 1.9.3", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", + "thiserror", +] + +[[package]] +name = "fdlimit" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" +dependencies = [ + "libc", +] + +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fflonk" +version = "0.1.0" +source = "git+https://github.com/w3f/fflonk#26a5045b24e169cffc1f9328ca83d71061145c40" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "merlin 3.0.0", +] + +[[package]] +name = "fiat-crypto" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" + +[[package]] +name = "file-per-thread-logger" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" +dependencies = [ + "env_logger", + "log", +] + +[[package]] +name = "filetime" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", +] + +[[package]] +name = "finality-grandpa" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" +dependencies = [ + "either", + "futures", + "futures-timer", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot 0.12.1", + "scale-info", +] + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +dependencies = [ + "crc32fast", + "libz-sys", + "miniz_oxide 0.7.1", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fork-tree" +version = "3.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + +[[package]] +name = "frame-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-support", + "frame-support-procedural", + "frame-system", + "linregress", + "log", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "static_assertions", +] + +[[package]] +name = "frame-benchmarking-cli" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "Inflector", + "array-bytes", + "chrono", + "clap", + "comfy-table", + "frame-benchmarking", + "frame-support", + "frame-system", + "gethostname", + "handlebars", + "itertools", + "lazy_static", + "linked-hash-map", + "log", + "parity-scale-codec", + "rand 0.8.5", + "rand_pcg", + "sc-block-builder", + "sc-cli", + "sc-client-api", + "sc-client-db", + "sc-executor", + "sc-service", + "sc-sysinfo", + "serde", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-storage", + "sp-trie", + "sp-wasm-interface", + "thiserror", + "thousands", +] + +[[package]] +name = "frame-election-provider-solution-type" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "frame-election-provider-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-election-provider-solution-type", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "frame-executive" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-support", + "frame-system", + "frame-try-runtime", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "frame-metadata" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "frame-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "aquamarine", + "bitflags 1.3.2", + "docify", + "environmental", + "frame-metadata", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "macro_magic", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "serde_json", + "smallvec", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-core-hashing-proc-macro", + "sp-debug-derive", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-metadata-ir", + "sp-runtime", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-weights", + "static_assertions", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse", + "expander 2.0.0", + "frame-support-procedural-tools", + "itertools", + "macro_magic", + "proc-macro-warning", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "frame-system" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "cfg-if", + "frame-support", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-version", + "sp-weights", +] + +[[package]] +name = "frame-system-rpc-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "sp-api", +] + +[[package]] +name = "frame-try-runtime" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-support", + "parity-scale-codec", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "fs-err" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite 0.2.9", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "futures-rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" +dependencies = [ + "futures-io", + "rustls 0.20.8", + "webpki 0.22.0", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite 0.2.9", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "ghash" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" +dependencies = [ + "opaque-debug 0.3.0", + "polyval 0.5.3", +] + +[[package]] +name = "ghash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +dependencies = [ + "opaque-debug 0.3.0", + "polyval 0.6.1", +] + +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +dependencies = [ + "fallible-iterator", + "indexmap 1.9.3", + "stable_deref_trait", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "globset" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "handlebars" +version = "4.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +dependencies = [ + "ahash 0.8.3", + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac 0.12.1", +] + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.7", + "hmac 0.8.1", +] + +[[package]] +name = "honggfuzz" +version = "0.5.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "848e9c511092e0daa0a35a63e8e6e475a3e8f870741448b9f6028d69b142f18e" +dependencies = [ + "arbitrary", + "lazy_static", + "memmap2", + "rustc_version", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite 0.2.9", +] + +[[package]] +name = "http-range-header" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite 0.2.9", + "socket2 0.4.9", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "log", + "rustls 0.21.6", + "rustls-native-certs", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows 0.48.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "if-addrs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "if-watch" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9465340214b296cd17a0009acdb890d6160010b8adf8f78a00d0d7ab270f79f" +dependencies = [ + "async-io", + "core-foundation", + "fnv", + "futures", + "if-addrs", + "ipnet", + "log", + "rtnetlink", + "system-configuration", + "tokio", + "windows 0.34.0", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "integer-encoding" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "interceptor" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" +dependencies = [ + "async-trait", + "bytes", + "log", + "rand 0.8.5", + "rtcp", + "rtp", + "thiserror", + "tokio", + "waitgroup", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ip_network" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" + +[[package]] +name = "ipconfig" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" +dependencies = [ + "socket2 0.5.3", + "widestring", + "windows-sys 0.48.0", + "winreg", +] + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.1", + "rustix 0.38.3", + "windows-sys 0.48.0", +] + +[[package]] +name = "is_executable" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" +dependencies = [ + "winapi", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpsee" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" +dependencies = [ + "jsonrpsee-core", + "jsonrpsee-proc-macros", + "jsonrpsee-server", + "jsonrpsee-types", + "tracing", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" +dependencies = [ + "anyhow", + "arrayvec 0.7.4", + "async-trait", + "beef", + "futures-channel", + "futures-util", + "globset", + "hyper", + "jsonrpsee-types", + "parking_lot 0.12.1", + "rand 0.8.5", + "rustc-hash", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" +dependencies = [ + "heck", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "jsonrpsee-server" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" +dependencies = [ + "futures-channel", + "futures-util", + "http", + "hyper", + "jsonrpsee-core", + "jsonrpsee-types", + "serde", + "serde_json", + "soketto", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "k256" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +dependencies = [ + "cfg-if", + "ecdsa 0.16.8", + "elliptic-curve 0.13.5", + "once_cell", + "sha2 0.10.7", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "kvdb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d770dcb02bf6835887c3a979b5107a04ff4bbde97a5f0928d27404a155add9" +dependencies = [ + "smallvec", +] + +[[package]] +name = "kvdb-memorydb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" +dependencies = [ + "kvdb", + "parking_lot 0.12.1", +] + +[[package]] +name = "kvdb-rocksdb" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" +dependencies = [ + "kvdb", + "num_cpus", + "parking_lot 0.12.1", + "regex", + "rocksdb", + "smallvec", +] + +[[package]] +name = "landlock" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520baa32708c4e957d2fc3a186bc5bd8d26637c33137f399ddfc202adb240068" +dependencies = [ + "enumflags2", + "libc", + "thiserror", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.146" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libp2p" +version = "0.51.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "getrandom 0.2.10", + "instant", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", + "libp2p-dns", + "libp2p-identify", + "libp2p-identity", + "libp2p-kad", + "libp2p-mdns", + "libp2p-metrics", + "libp2p-noise", + "libp2p-ping", + "libp2p-quic", + "libp2p-request-response", + "libp2p-swarm", + "libp2p-tcp", + "libp2p-wasm-ext", + "libp2p-webrtc", + "libp2p-websocket", + "libp2p-yamux", + "multiaddr", + "pin-project", +] + +[[package]] +name = "libp2p-allow-block-list" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-core" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-identity", + "log", + "multiaddr", + "multihash", + "multistream-select", + "once_cell", + "parking_lot 0.12.1", + "pin-project", + "quick-protobuf", + "rand 0.8.5", + "rw-stream-sink", + "smallvec", + "thiserror", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-dns" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" +dependencies = [ + "futures", + "libp2p-core", + "log", + "parking_lot 0.12.1", + "smallvec", + "trust-dns-resolver", +] + +[[package]] +name = "libp2p-identify" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" +dependencies = [ + "asynchronous-codec", + "either", + "futures", + "futures-timer", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "log", + "lru 0.10.1", + "quick-protobuf", + "quick-protobuf-codec", + "smallvec", + "thiserror", + "void", +] + +[[package]] +name = "libp2p-identity" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" +dependencies = [ + "bs58", + "ed25519-dalek", + "log", + "multiaddr", + "multihash", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.7", + "thiserror", + "zeroize", +] + +[[package]] +name = "libp2p-kad" +version = "0.43.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" +dependencies = [ + "arrayvec 0.7.4", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "log", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.7", + "smallvec", + "thiserror", + "uint", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-mdns" +version = "0.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" +dependencies = [ + "data-encoding", + "futures", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "log", + "rand 0.8.5", + "smallvec", + "socket2 0.4.9", + "tokio", + "trust-dns-proto", + "void", +] + +[[package]] +name = "libp2p-metrics" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" +dependencies = [ + "libp2p-core", + "libp2p-identify", + "libp2p-kad", + "libp2p-ping", + "libp2p-swarm", + "prometheus-client", +] + +[[package]] +name = "libp2p-noise" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" +dependencies = [ + "bytes", + "curve25519-dalek 3.2.0", + "futures", + "libp2p-core", + "libp2p-identity", + "log", + "once_cell", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.7", + "snow", + "static_assertions", + "thiserror", + "x25519-dalek 1.1.1", + "zeroize", +] + +[[package]] +name = "libp2p-ping" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" +dependencies = [ + "either", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "rand 0.8.5", + "void", +] + +[[package]] +name = "libp2p-quic" +version = "0.7.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-tls", + "log", + "parking_lot 0.12.1", + "quinn-proto", + "rand 0.8.5", + "rustls 0.20.8", + "thiserror", + "tokio", +] + +[[package]] +name = "libp2p-request-response" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" +dependencies = [ + "async-trait", + "futures", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "rand 0.8.5", + "smallvec", +] + +[[package]] +name = "libp2p-swarm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm-derive", + "log", + "rand 0.8.5", + "smallvec", + "tokio", + "void", +] + +[[package]] +name = "libp2p-swarm-derive" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" +dependencies = [ + "heck", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "libp2p-tcp" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" +dependencies = [ + "futures", + "futures-timer", + "if-watch", + "libc", + "libp2p-core", + "log", + "socket2 0.4.9", + "tokio", +] + +[[package]] +name = "libp2p-tls" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" +dependencies = [ + "futures", + "futures-rustls", + "libp2p-core", + "libp2p-identity", + "rcgen 0.10.0", + "ring 0.16.20", + "rustls 0.20.8", + "thiserror", + "webpki 0.22.0", + "x509-parser 0.14.0", + "yasna", +] + +[[package]] +name = "libp2p-wasm-ext" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" +dependencies = [ + "futures", + "js-sys", + "libp2p-core", + "parity-send-wrapper", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "libp2p-webrtc" +version = "0.4.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" +dependencies = [ + "async-trait", + "asynchronous-codec", + "bytes", + "futures", + "futures-timer", + "hex", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-noise", + "log", + "multihash", + "quick-protobuf", + "quick-protobuf-codec", + "rand 0.8.5", + "rcgen 0.9.3", + "serde", + "stun", + "thiserror", + "tinytemplate", + "tokio", + "tokio-util", + "webrtc", +] + +[[package]] +name = "libp2p-websocket" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111273f7b3d3510524c752e8b7a5314b7f7a1fee7e68161c01a7d72cbb06db9f" +dependencies = [ + "either", + "futures", + "futures-rustls", + "libp2p-core", + "log", + "parking_lot 0.12.1", + "quicksink", + "rw-stream-sink", + "soketto", + "url", + "webpki-roots", +] + +[[package]] +name = "libp2p-yamux" +version = "0.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" +dependencies = [ + "futures", + "libp2p-core", + "log", + "thiserror", + "yamux", +] + +[[package]] +name = "librocksdb-sys" +version = "0.11.0+8.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" +dependencies = [ + "bindgen", + "bzip2-sys", + "cc", + "glob", + "libc", + "libz-sys", + "tikv-jemalloc-sys", +] + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64 0.13.1", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libz-sys" +version = "1.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +dependencies = [ + "cc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linked_hash_set" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "linregress" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4de0b5f52a9f84544d268f5fabb71b38962d6aa3c6600b8bcd27d44ccf9c9c45" +dependencies = [ + "nalgebra", +] + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "lru" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" +dependencies = [ + "hashbrown 0.13.2", +] + +[[package]] +name = "lru" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eedb2bdbad7e0634f83989bf596f497b070130daaa398ab22d84c39e266deec5" +dependencies = [ + "hashbrown 0.14.0", +] + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "macro_magic" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "macro_magic_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c12469fc165526520dff2807c2975310ab47cf7190a45b99b49a7dc8befab17b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "macro_magic_macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "matrixmultiply" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memfd" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +dependencies = [ + "rustix 0.37.20", +] + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memory-db" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +dependencies = [ + "hash-db", +] + +[[package]] +name = "merlin" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "mick-jaeger" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" +dependencies = [ + "futures", + "rand 0.8.5", + "thrift", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "mmr-gadget" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-offchain", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + +[[package]] +name = "mmr-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "anyhow", + "jsonrpsee", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + +[[package]] +name = "mockall" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "lazy_static", + "mockall_derive", + "predicates", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "multiaddr" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "log", + "multibase", + "multihash", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint", + "url", +] + +[[package]] +name = "multibase" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multihash" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.7", + "multihash-derive", + "sha2 0.10.7", + "sha3", + "unsigned-varint", +] + +[[package]] +name = "multihash-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" +dependencies = [ + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "multistream-select" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" +dependencies = [ + "bytes", + "futures", + "log", + "pin-project", + "smallvec", + "unsigned-varint", +] + +[[package]] +name = "nalgebra" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "307ed9b18cc2423f29e83f84fd23a8e73628727990181f18641a8b5dc2ab1caa" +dependencies = [ + "approx", + "matrixmultiply", + "nalgebra-macros", + "num-complex", + "num-rational", + "num-traits", + "simba", + "typenum", +] + +[[package]] +name = "nalgebra-macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "names" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146" +dependencies = [ + "rand 0.8.5", +] + +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" + +[[package]] +name = "netlink-packet-core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-proto" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +dependencies = [ + "bytes", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror", + "tokio", +] + +[[package]] +name = "netlink-sys" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +dependencies = [ + "bytes", + "futures", + "libc", + "log", + "tokio", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec 0.7.4", + "itoa", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "object" +version = "0.30.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +dependencies = [ + "crc32fast", + "hashbrown 0.13.2", + "indexmap 1.9.3", + "memchr", +] + +[[package]] +name = "oid-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" +dependencies = [ + "asn1-rs 0.3.1", +] + +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs 0.5.2", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "orchestra" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "227585216d05ba65c7ab0a0450a3cf2cbd81a98862a54c4df8e14d5ac6adb015" +dependencies = [ + "async-trait", + "dyn-clonable", + "futures", + "futures-timer", + "orchestra-proc-macro", + "pin-project", + "prioritized-metered-channel", + "thiserror", + "tracing", +] + +[[package]] +name = "orchestra-proc-macro" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2871aadd82a2c216ee68a69837a526dfe788ecbe74c4c5038a6acdbff6653066" +dependencies = [ + "expander 0.0.6", + "itertools", + "petgraph", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ordered-float" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" +dependencies = [ + "num-traits", +] + +[[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.7", +] + +[[package]] +name = "p384" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" +dependencies = [ + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.7", +] + +[[package]] +name = "pallet-assets" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-authority-discovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-authority-discovery", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-authorship" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-babe" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-babe", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-balances" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-election-provider-multi-phase" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-election-provider-support-benchmarking", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-std", + "strum", +] + +[[package]] +name = "pallet-election-provider-support-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-system", + "parity-scale-codec", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-fast-unstake" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-grandpa", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-im-online" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-indices" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-keyring", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-message-queue" +version = "7.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", +] + +[[package]] +name = "pallet-offences" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-salary" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-session" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-trie", +] + +[[package]] +name = "pallet-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "rand_chacha 0.2.2", + "scale-info", + "serde", + "sp-application-crypto", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-staking-reward-curve" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "pallet-staking-reward-fn" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "log", + "sp-arithmetic", +] + +[[package]] +name = "pallet-sudo" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-timestamp" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-std", + "sp-storage", + "sp-timestamp", +] + +[[package]] +name = "pallet-transaction-payment" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-transaction-payment-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "jsonrpsee", + "pallet-transaction-payment-rpc-runtime-api", + "parity-scale-codec", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "pallet-transaction-payment-rpc-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "pallet-transaction-payment", + "parity-scale-codec", + "sp-api", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "pallet-treasury" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-uniques" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-vesting" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-xcm" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bounded-collections", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm 1.0.0", + "xcm-executor 1.0.0", +] + +[[package]] +name = "pallet-xcm" +version = "3.0.0" +dependencies = [ + "bounded-collections", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-runtime-parachains", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm 3.0.0", + "xcm-builder 3.0.0", + "xcm-executor 3.0.0", +] + +[[package]] +name = "pallet-xcm-benchmarks" +version = "3.0.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", + "pallet-balances", + "pallet-xcm 3.0.0", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", + "xcm 3.0.0", + "xcm-builder 3.0.0", + "xcm-executor 3.0.0", +] + +[[package]] +name = "parity-db" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78f19d20a0d2cc52327a88d131fa1c4ea81ea4a04714aedcfeca2dd410049cf8" +dependencies = [ + "blake2", + "crc32fast", + "fs2", + "hex", + "libc", + "log", + "lz4", + "memmap2", + "parking_lot 0.12.1", + "rand 0.8.5", + "siphasher", + "snap", +] + +[[package]] +name = "parity-scale-codec" +version = "3.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" +dependencies = [ + "arrayvec 0.7.4", + "bitvec", + "byte-slice-cast", + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parity-send-wrapper" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" + +[[package]] +name = "parity-wasm" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" + +[[package]] +name = "parking" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.8", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "smallvec", + "windows-targets 0.48.0", +] + +[[package]] +name = "partial_sort" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" + +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.1", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "pem-rfc7468" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pest" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "pest_meta" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.7", +] + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.0.0", +] + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der 0.7.8", + "spki 0.7.2", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "platforms" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" + +[[package]] +name = "polkadot-approval-distribution" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "futures-timer", + "polkadot-node-jaeger", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-bitfield-distribution" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "always-assert", + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-distribution" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "derive_more", + "fatality", + "futures", + "lru 0.11.0", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "sp-core", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-recovery" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "fatality", + "futures", + "lru 0.11.0", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "sc-network", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-collator-protocol" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bitvec", + "fatality", + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror", + "tokio-util", + "tracing-gum", +] + +[[package]] +name = "polkadot-core-primitives" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "polkadot-dispute-distribution" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "derive_more", + "fatality", + "futures", + "futures-timer", + "indexmap 1.9.3", + "lru 0.11.0", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-network", + "sp-application-crypto", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-erasure-coding" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-primitives", + "reed-solomon-novelpoly", + "sp-core", + "sp-trie", + "thiserror", +] + +[[package]] +name = "polkadot-gossip-support" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "rand_chacha 0.3.1", + "sc-network", + "sc-network-common", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "tracing-gum", +] + +[[package]] +name = "polkadot-network-bridge" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "always-assert", + "async-trait", + "bytes", + "fatality", + "futures", + "parity-scale-codec", + "parking_lot 0.12.1", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sc-network", + "sp-consensus", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-collation-generation" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "sp-maybe-compressed-blob", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-approval-voting" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bitvec", + "derive_more", + "futures", + "futures-timer", + "kvdb", + "lru 0.11.0", + "merlin 2.0.1", + "parity-scale-codec", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sc-keystore", + "schnorrkel", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-runtime", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-av-store" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bitvec", + "futures", + "futures-timer", + "kvdb", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sp-consensus", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-backing" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bitvec", + "fatality", + "futures", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "polkadot-statement-table", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-bitfield-signing" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing-gum", + "wasm-timer", +] + +[[package]] +name = "polkadot-node-core-candidate-validation" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "parity-scale-codec", + "polkadot-node-core-pvf", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-parachain", + "polkadot-primitives", + "sp-maybe-compressed-blob", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-chain-api" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-primitives", + "sc-client-api", + "sc-consensus-babe", + "sp-blockchain", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-chain-selection" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "futures-timer", + "kvdb", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-dispute-coordinator" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "fatality", + "futures", + "kvdb", + "lru 0.11.0", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-parachains-inherent" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sp-blockchain", + "sp-inherents", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-prospective-parachains" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bitvec", + "fatality", + "futures", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-provisioner" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bitvec", + "fatality", + "futures", + "futures-timer", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "always-assert", + "futures", + "futures-timer", + "libc", + "parity-scale-codec", + "pin-project", + "polkadot-core-primitives", + "polkadot-node-core-pvf-common", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-parachain", + "polkadot-primitives", + "rand 0.8.5", + "slotmap", + "sp-core", + "sp-maybe-compressed-blob", + "sp-wasm-interface", + "substrate-build-script-utils", + "tempfile", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf-checker" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf-common" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "cpu-time", + "futures", + "landlock", + "libc", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-primitives", + "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", + "sp-core", + "sp-externalities", + "sp-io", + "sp-tracing", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-runtime-api" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "lru 0.11.0", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "sp-consensus-babe", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-jaeger" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "lazy_static", + "log", + "mick-jaeger", + "parity-scale-codec", + "parking_lot 0.12.1", + "polkadot-node-primitives", + "polkadot-primitives", + "sc-network", + "sp-core", + "thiserror", + "tokio", +] + +[[package]] +name = "polkadot-node-metrics" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bs58", + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "polkadot-primitives", + "prioritized-metered-channel", + "sc-cli", + "sc-service", + "sc-tracing", + "substrate-prometheus-endpoint", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-network-protocol" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-channel", + "async-trait", + "bitvec", + "derive_more", + "fatality", + "futures", + "hex", + "parity-scale-codec", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-primitives", + "rand 0.8.5", + "sc-authority-discovery", + "sc-network", + "strum", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-primitives" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bounded-vec", + "futures", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-primitives", + "schnorrkel", + "serde", + "sp-application-crypto", + "sp-consensus-babe", + "sp-core", + "sp-keystore", + "sp-maybe-compressed-blob", + "sp-runtime", + "thiserror", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "polkadot-node-subsystem" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "polkadot-node-jaeger", + "polkadot-node-subsystem-types", + "polkadot-overseer", +] + +[[package]] +name = "polkadot-node-subsystem-types" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "derive_more", + "futures", + "orchestra", + "polkadot-node-jaeger", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-primitives", + "polkadot-statement-table", + "sc-network", + "sc-transaction-pool-api", + "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "polkadot-node-subsystem-util" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "derive_more", + "fatality", + "futures", + "futures-channel", + "itertools", + "kvdb", + "lru 0.11.0", + "parity-db", + "parity-scale-codec", + "parking_lot 0.11.2", + "pin-project", + "polkadot-node-jaeger", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "prioritized-metered-channel", + "rand 0.8.5", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-overseer" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "lru 0.11.0", + "orchestra", + "parking_lot 0.12.1", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "sc-client-api", + "sp-api", + "sp-core", + "tikv-jemalloc-ctl", + "tracing-gum", +] + +[[package]] +name = "polkadot-parachain" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bounded-collections", + "derive_more", + "frame-support", + "parity-scale-codec", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "polkadot-primitives" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bitvec", + "hex-literal", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "polkadot-rpc" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "jsonrpsee", + "mmr-rpc", + "pallet-transaction-payment-rpc", + "polkadot-primitives", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-babe-rpc", + "sc-consensus-beefy", + "sc-consensus-beefy-rpc", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "sc-consensus-grandpa-rpc", + "sc-rpc", + "sc-sync-state-rpc", + "sc-transaction-pool-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-keystore", + "sp-runtime", + "substrate-frame-rpc-system", + "substrate-state-trie-migration-rpc", +] + +[[package]] +name = "polkadot-runtime-common" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bitvec", + "frame-election-provider-support", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "libsecp256k1", + "log", + "pallet-authorship", + "pallet-balances", + "pallet-election-provider-multi-phase", + "pallet-fast-unstake", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-fn", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-treasury", + "pallet-vesting", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "slot-range-helper", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "static_assertions", + "xcm 1.0.0", +] + +[[package]] +name = "polkadot-runtime-metrics" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bs58", + "parity-scale-codec", + "polkadot-primitives", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "polkadot-runtime-parachains" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bitflags 1.3.2", + "bitvec", + "derive_more", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-message-queue", + "pallet-session", + "pallet-staking", + "pallet-timestamp", + "pallet-vesting", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-metrics", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rustc-hex", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "static_assertions", + "xcm 1.0.0", + "xcm-executor 1.0.0", +] + +[[package]] +name = "polkadot-service" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "frame-benchmarking", + "frame-benchmarking-cli", + "frame-support", + "frame-system", + "frame-system-rpc-runtime-api", + "futures", + "hex-literal", + "is_executable", + "kvdb", + "kvdb-rocksdb", + "log", + "lru 0.11.0", + "mmr-gadget", + "pallet-babe", + "pallet-im-online", + "pallet-staking", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "parity-db", + "parity-scale-codec", + "polkadot-approval-distribution", + "polkadot-availability-bitfield-distribution", + "polkadot-availability-distribution", + "polkadot-availability-recovery", + "polkadot-collator-protocol", + "polkadot-core-primitives", + "polkadot-dispute-distribution", + "polkadot-gossip-support", + "polkadot-network-bridge", + "polkadot-node-collation-generation", + "polkadot-node-core-approval-voting", + "polkadot-node-core-av-store", + "polkadot-node-core-backing", + "polkadot-node-core-bitfield-signing", + "polkadot-node-core-candidate-validation", + "polkadot-node-core-chain-api", + "polkadot-node-core-chain-selection", + "polkadot-node-core-dispute-coordinator", + "polkadot-node-core-parachains-inherent", + "polkadot-node-core-prospective-parachains", + "polkadot-node-core-provisioner", + "polkadot-node-core-pvf", + "polkadot-node-core-pvf-checker", + "polkadot-node-core-runtime-api", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-rpc", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "polkadot-statement-distribution", + "sc-authority-discovery", + "sc-basic-authorship", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-consensus-babe", + "sc-consensus-beefy", + "sc-consensus-grandpa", + "sc-consensus-slots", + "sc-executor", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-network-sync", + "sc-offchain", + "sc-service", + "sc-sync-state-rpc", + "sc-sysinfo", + "sc-telemetry", + "sc-transaction-pool", + "sc-transaction-pool-api", + "serde", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-keystore", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-storage", + "sp-timestamp", + "sp-transaction-pool", + "sp-version", + "sp-weights", + "substrate-prometheus-endpoint", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-statement-distribution" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "arrayvec 0.7.4", + "bitvec", + "fatality", + "futures", + "futures-timer", + "indexmap 1.9.3", + "parity-scale-codec", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "sp-staking", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-statement-table" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "polkadot-primitives", + "sp-core", +] + +[[package]] +name = "polkadot-test-client" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-benchmarking", + "parity-scale-codec", + "polkadot-node-subsystem", + "polkadot-primitives", + "polkadot-test-runtime", + "polkadot-test-service", + "sc-block-builder", + "sc-consensus", + "sc-offchain", + "sc-service", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-timestamp", + "substrate-test-client", +] + +[[package]] +name = "polkadot-test-runtime" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bitvec", + "frame-election-provider-support", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-rpc-runtime-api", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-grandpa", + "pallet-indices", + "pallet-offences", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-vesting", + "pallet-xcm 1.0.0", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", + "test-runtime-constants", + "xcm 1.0.0", + "xcm-builder 1.0.0", + "xcm-executor 1.0.0", +] + +[[package]] +name = "polkadot-test-service" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-system", + "futures", + "hex", + "pallet-balances", + "pallet-staking", + "pallet-transaction-payment", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-rpc", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "polkadot-service", + "polkadot-test-runtime", + "rand 0.8.5", + "sc-authority-discovery", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-consensus", + "sc-consensus-babe", + "sc-consensus-grandpa", + "sc-network", + "sc-service", + "sc-tracing", + "sc-transaction-pool", + "sp-arithmetic", + "sp-authority-discovery", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-grandpa", + "sp-core", + "sp-inherents", + "sp-keyring", + "sp-runtime", + "sp-state-machine", + "substrate-test-client", + "tempfile", + "test-runtime-constants", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite 0.2.9", + "windows-sys 0.48.0", +] + +[[package]] +name = "poly1305" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +dependencies = [ + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.4.1", +] + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.4.1", +] + +[[package]] +name = "polyval" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.5.1", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "float-cmp", + "itertools", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "prettyplease" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" +dependencies = [ + "proc-macro2", + "syn 2.0.29", +] + +[[package]] +name = "primitive-types" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "prioritized-metered-channel" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382698e48a268c832d0b181ed438374a6bb708a82a8ca273bb0f61c74cf209c4" +dependencies = [ + "coarsetime", + "crossbeam-queue", + "derive_more", + "futures", + "futures-timer", + "nanorand", + "thiserror", + "tracing", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +dependencies = [ + "thiserror", + "toml 0.5.11", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro-warning" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prometheus" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot 0.12.1", + "thiserror", +] + +[[package]] +name = "prometheus-client" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.1", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +dependencies = [ + "bytes", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prettyplease 0.1.25", + "prost", + "prost-types", + "regex", + "syn 1.0.109", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +dependencies = [ + "prost", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "quicksink" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" +dependencies = [ + "futures-core", + "futures-sink", + "pin-project-lite 0.1.12", +] + +[[package]] +name = "quinn-proto" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash", + "rustls 0.20.8", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki 0.22.0", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.10", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "rcgen" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +dependencies = [ + "pem", + "ring 0.16.20", + "time 0.3.27", + "x509-parser 0.13.2", + "yasna", +] + +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring 0.16.20", + "time 0.3.27", + "yasna", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.10", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "reed-solomon-novelpoly" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221" +dependencies = [ + "derive_more", + "fs-err", + "itertools", + "static_init 0.5.2", + "thiserror", +] + +[[package]] +name = "ref-cast" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43faa91b1c8b36841ee70e97188a869d37ae21759da6846d4be66de5bf7b12c" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "regalloc2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" +dependencies = [ + "fxhash", + "log", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "regex" +version = "1.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error", +] + +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac 0.12.1", + "zeroize", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + +[[package]] +name = "ring" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof#0e948f3c28cbacecdd3020403c4841c0eb339213" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "common", + "fflonk", + "merlin 3.0.0", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rocksdb" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" +dependencies = [ + "libc", + "librocksdb-sys", +] + +[[package]] +name = "rpassword" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +dependencies = [ + "libc", + "rtoolbox", + "winapi", +] + +[[package]] +name = "rtcp" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" +dependencies = [ + "bytes", + "thiserror", + "webrtc-util", +] + +[[package]] +name = "rtnetlink" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +dependencies = [ + "futures", + "log", + "netlink-packet-route", + "netlink-proto", + "nix", + "thiserror", + "tokio", +] + +[[package]] +name = "rtoolbox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "rtp" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" +dependencies = [ + "async-trait", + "bytes", + "rand 0.8.5", + "serde", + "thiserror", + "webrtc-util", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.18", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + +[[package]] +name = "rustix" +version = "0.36.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14e4d67015953998ad0eb82887a0eb0129e18a7e2f3b7b0f6c422fddcd503d62" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.37.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys 0.4.5", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.1", + "log", + "ring 0.16.20", + "sct 0.6.1", + "webpki 0.21.4", +] + +[[package]] +name = "rustls" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +dependencies = [ + "log", + "ring 0.16.20", + "sct 0.7.0", + "webpki 0.22.0", +] + +[[package]] +name = "rustls" +version = "0.21.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +dependencies = [ + "log", + "ring 0.16.20", + "rustls-webpki", + "sct 0.7.0", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.2", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +dependencies = [ + "ring 0.16.20", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" + +[[package]] +name = "rw-stream-sink" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" +dependencies = [ + "futures", + "pin-project", + "static_assertions", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "safe_arch" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sc-allocator" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "log", + "sp-core", + "sp-wasm-interface", + "thiserror", +] + +[[package]] +name = "sc-authority-discovery" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "ip_network", + "libp2p", + "log", + "multihash", + "parity-scale-codec", + "prost", + "prost-build", + "rand 0.8.5", + "sc-client-api", + "sc-network", + "sp-api", + "sp-authority-discovery", + "sp-blockchain", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-basic-authorship" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "sc-block-builder", + "sc-client-api", + "sc-proposer-metrics", + "sc-telemetry", + "sc-transaction-pool-api", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-inherents", + "sp-runtime", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-block-builder" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "sc-client-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-inherents", + "sp-runtime", +] + +[[package]] +name = "sc-chain-spec" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "memmap2", + "sc-chain-spec-derive", + "sc-client-api", + "sc-executor", + "sc-network", + "sc-telemetry", + "serde", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "sc-chain-spec-derive" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "sc-cli" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "chrono", + "clap", + "fdlimit", + "futures", + "libp2p-identity", + "log", + "names", + "parity-scale-codec", + "rand 0.8.5", + "regex", + "rpassword", + "sc-client-api", + "sc-client-db", + "sc-keystore", + "sc-network", + "sc-service", + "sc-telemetry", + "sc-tracing", + "sc-utils", + "serde", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-keyring", + "sp-keystore", + "sp-panic-handler", + "sp-runtime", + "sp-version", + "thiserror", + "tiny-bip39", + "tokio", +] + +[[package]] +name = "sc-client-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "fnv", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-executor", + "sc-transaction-pool-api", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-database", + "sp-externalities", + "sp-runtime", + "sp-state-machine", + "sp-statement-store", + "sp-storage", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-client-db" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "hash-db", + "kvdb", + "kvdb-memorydb", + "kvdb-rocksdb", + "linked-hash-map", + "log", + "parity-db", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-state-db", + "schnellru", + "sp-arithmetic", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-runtime", + "sp-state-machine", + "sp-trie", +] + +[[package]] +name = "sc-consensus" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "libp2p-identity", + "log", + "mockall", + "parking_lot 0.12.1", + "sc-client-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-babe" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "fork-tree", + "futures", + "log", + "num-bigint", + "num-rational", + "num-traits", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-consensus", + "sc-consensus-epochs", + "sc-consensus-slots", + "sc-telemetry", + "sc-transaction-pool-api", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-babe-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "jsonrpsee", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-rpc-api", + "serde", + "sp-api", + "sp-application-crypto", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "async-channel", + "async-trait", + "fnv", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-gossip", + "sc-network-sync", + "sc-utils", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-keystore", + "sp-mmr-primitives", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sc-consensus-beefy-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-consensus-beefy", + "sc-rpc", + "serde", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-consensus-epochs" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "fork-tree", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-grandpa" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "ahash 0.8.3", + "array-bytes", + "async-trait", + "dyn-clone", + "finality-grandpa", + "fork-tree", + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-telemetry", + "sc-transaction-pool-api", + "sc-utils", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-grandpa-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "finality-grandpa", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus-grandpa", + "sc-rpc", + "serde", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-consensus-slots" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sc-telemetry", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "sc-executor" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-executor-common", + "sc-executor-wasmtime", + "schnellru", + "sp-api", + "sp-core", + "sp-externalities", + "sp-io", + "sp-panic-handler", + "sp-runtime-interface", + "sp-trie", + "sp-version", + "sp-wasm-interface", + "tracing", +] + +[[package]] +name = "sc-executor-common" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "sc-allocator", + "sp-maybe-compressed-blob", + "sp-wasm-interface", + "thiserror", + "wasm-instrument", +] + +[[package]] +name = "sc-executor-wasmtime" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "anyhow", + "cfg-if", + "libc", + "log", + "rustix 0.36.14", + "sc-allocator", + "sc-executor-common", + "sp-runtime-interface", + "sp-wasm-interface", + "wasmtime", +] + +[[package]] +name = "sc-informant" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "ansi_term", + "futures", + "futures-timer", + "log", + "sc-client-api", + "sc-network", + "sc-network-common", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-keystore" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "parking_lot 0.12.1", + "serde_json", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror", +] + +[[package]] +name = "sc-network" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "async-channel", + "async-trait", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures", + "futures-timer", + "ip_network", + "libp2p", + "linked_hash_set", + "log", + "mockall", + "parity-scale-codec", + "parking_lot 0.12.1", + "partial_sort", + "pin-project", + "rand 0.8.5", + "sc-client-api", + "sc-network-common", + "sc-utils", + "serde", + "serde_json", + "smallvec", + "sp-arithmetic", + "sp-blockchain", + "sp-core", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "unsigned-varint", + "wasm-timer", + "zeroize", +] + +[[package]] +name = "sc-network-bitswap" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-channel", + "cid", + "futures", + "libp2p-identity", + "log", + "prost", + "prost-build", + "sc-client-api", + "sc-network", + "sp-blockchain", + "sp-runtime", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "sc-network-common" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "bitflags 1.3.2", + "futures", + "libp2p-identity", + "parity-scale-codec", + "prost-build", + "sc-consensus", + "sp-consensus", + "sp-consensus-grandpa", + "sp-runtime", +] + +[[package]] +name = "sc-network-gossip" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "ahash 0.8.3", + "futures", + "futures-timer", + "libp2p", + "log", + "sc-network", + "sc-network-common", + "schnellru", + "sp-runtime", + "substrate-prometheus-endpoint", + "tracing", +] + +[[package]] +name = "sc-network-light" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "async-channel", + "futures", + "libp2p-identity", + "log", + "parity-scale-codec", + "prost", + "prost-build", + "sc-client-api", + "sc-network", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-network-sync" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "async-channel", + "async-trait", + "fork-tree", + "futures", + "futures-timer", + "libp2p", + "log", + "mockall", + "parity-scale-codec", + "prost", + "prost-build", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-utils", + "schnellru", + "smallvec", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-network-transactions" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "futures", + "libp2p", + "log", + "parity-scale-codec", + "sc-network", + "sc-network-common", + "sc-utils", + "sp-consensus", + "sp-runtime", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-offchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "bytes", + "fnv", + "futures", + "futures-timer", + "hyper", + "hyper-rustls", + "libp2p", + "log", + "num_cpus", + "once_cell", + "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-transaction-pool-api", + "sc-utils", + "sp-api", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-offchain", + "sp-runtime", + "threadpool", + "tracing", +] + +[[package]] +name = "sc-proposer-metrics" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "log", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-rpc-api", + "sc-tracing", + "sc-transaction-pool-api", + "sc-utils", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-keystore", + "sp-offchain", + "sp-rpc", + "sp-runtime", + "sp-session", + "sp-statement-store", + "sp-version", + "tokio", +] + +[[package]] +name = "sc-rpc-api" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-transaction-pool-api", + "scale-info", + "serde", + "serde_json", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-version", + "thiserror", +] + +[[package]] +name = "sc-rpc-server" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "http", + "jsonrpsee", + "log", + "serde_json", + "substrate-prometheus-endpoint", + "tokio", + "tower", + "tower-http", +] + +[[package]] +name = "sc-rpc-spec-v2" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "futures", + "futures-util", + "hex", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-chain-spec", + "sc-client-api", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-version", + "thiserror", + "tokio", + "tokio-stream", +] + +[[package]] +name = "sc-service" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "directories", + "exit-future", + "futures", + "futures-timer", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "pin-project", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-executor", + "sc-informant", + "sc-keystore", + "sc-network", + "sc-network-bitswap", + "sc-network-common", + "sc-network-light", + "sc-network-sync", + "sc-network-transactions", + "sc-rpc", + "sc-rpc-server", + "sc-rpc-spec-v2", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-storage", + "sp-transaction-pool", + "sp-transaction-storage-proof", + "sp-trie", + "sp-version", + "static_init 1.0.3", + "substrate-prometheus-endpoint", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "sc-state-db" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sp-core", +] + +[[package]] +name = "sc-sync-state-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "serde", + "serde_json", + "sp-blockchain", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-sysinfo" +version = "6.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "libc", + "log", + "rand 0.8.5", + "rand_pcg", + "regex", + "sc-telemetry", + "serde", + "serde_json", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sc-telemetry" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "chrono", + "futures", + "libp2p", + "log", + "parking_lot 0.12.1", + "pin-project", + "rand 0.8.5", + "sc-utils", + "serde", + "serde_json", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sc-tracing" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "ansi_term", + "atty", + "chrono", + "lazy_static", + "libc", + "log", + "parking_lot 0.12.1", + "regex", + "rustc-hash", + "sc-client-api", + "sc-tracing-proc-macro", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-tracing", + "thiserror", + "tracing", + "tracing-log", + "tracing-subscriber", +] + +[[package]] +name = "sc-tracing-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "sc-transaction-pool" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "linked-hash-map", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-tracing", + "sp-transaction-pool", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-transaction-pool-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "futures", + "log", + "parity-scale-codec", + "serde", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-utils" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-channel", + "futures", + "futures-timer", + "lazy_static", + "log", + "parking_lot 0.12.1", + "prometheus", + "sp-arithmetic", +] + +[[package]] +name = "scale-info" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad560913365790f17cbf12479491169f01b9d46d29cfc7422bf8c64bdc61b731" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19df9bd9ace6cc2fe19387c96ce677e823e07d017ceed253e7bb3d1d1bd9c73b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "schnellru" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +dependencies = [ + "ahash 0.8.3", + "cfg-if", + "hashbrown 0.13.2", +] + +[[package]] +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "curve25519-dalek 2.1.3", + "getrandom 0.1.16", + "merlin 2.0.1", + "rand 0.7.3", + "rand_core 0.5.1", + "sha2 0.8.2", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" + +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring 0.16.20", + "untrusted", +] + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring 0.16.20", + "untrusted", +] + +[[package]] +name = "sdp" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" +dependencies = [ + "rand 0.8.5", + "substring", + "thiserror", + "url", +] + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct 0.1.1", + "der 0.6.1", + "generic-array 0.14.7", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.8", + "generic-array 0.14.7", + "pkcs8 0.10.2", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.187" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a7fe14252655bd1e578af19f5fa00fe02fd0013b100ca6b49fde31c41bae4c" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.187" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e46b2a6ca578b3f1d4501b12f78ed4692006d79d82a1a7c561c12dbc3d625eb8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "serde_json" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "simba" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", + "wide", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "slot-range-helper" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "enumn", + "parity-scale-codec", + "paste", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "snap" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" + +[[package]] +name = "snow" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" +dependencies = [ + "aes-gcm 0.9.4", + "blake2", + "chacha20poly1305", + "curve25519-dalek 4.0.0", + "rand_core 0.6.4", + "ring 0.16.20", + "rustc_version", + "sha2 0.10.7", + "subtle", +] + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64 0.13.1", + "bytes", + "flate2", + "futures", + "http", + "httparse", + "log", + "rand 0.8.5", + "sha-1", +] + +[[package]] +name = "sp-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro", + "sp-core", + "sp-externalities", + "sp-metadata-ir", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "Inflector", + "blake2", + "expander 2.0.0", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "sp-application-crypto" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "static_assertions", +] + +[[package]] +name = "sp-authority-discovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-block-builder" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-blockchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "schnellru", + "sp-api", + "sp-consensus", + "sp-database", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "sp-consensus" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "futures", + "log", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "sp-consensus-babe" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "lazy_static", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", + "strum", +] + +[[package]] +name = "sp-consensus-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-consensus-slots" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-core" +version = "21.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "arrayvec 0.7.4", + "bandersnatch_vrfs", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin 2.0.1", + "parity-scale-codec", + "parking_lot 0.12.1", + "paste", + "primitive-types", + "rand 0.8.5", + "regex", + "scale-info", + "schnorrkel", + "secp256k1", + "secrecy", + "serde", + "sp-core-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "tracing", + "zeroize", +] + +[[package]] +name = "sp-core-hashing" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.7", + "sha3", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing-proc-macro" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "quote", + "sp-core-hashing", + "syn 2.0.29", +] + +[[package]] +name = "sp-database" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "kvdb", + "parking_lot 0.12.1", +] + +[[package]] +name = "sp-debug-derive" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "sp-externalities" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std", + "sp-storage", +] + +[[package]] +name = "sp-genesis-builder" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "serde_json", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-inherents" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-io" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bytes", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "rustversion", + "secp256k1", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keyring" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "lazy_static", + "sp-core", + "sp-runtime", + "strum", +] + +[[package]] +name = "sp-keystore" +version = "0.27.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "parking_lot 0.12.1", + "sp-core", + "sp-externalities", + "thiserror", +] + +[[package]] +name = "sp-maybe-compressed-blob" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "thiserror", + "zstd 0.12.4", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-std", +] + +[[package]] +name = "sp-mmr-primitives" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "ckb-merkle-mountain-range", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-debug-derive", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-npos-elections" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-offchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "sp-api", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "sp-panic-handler" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-rpc" +version = "6.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "rustc-hash", + "serde", + "sp-core", +] + +[[package]] +name = "sp-runtime" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-weights", +] + +[[package]] +name = "sp-runtime-interface" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "sp-session" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "sp-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-state-machine" +version = "0.28.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "smallvec", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", + "thiserror", + "tracing", + "trie-db", +] + +[[package]] +name = "sp-statement-store" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "aes-gcm 0.10.2", + "curve25519-dalek 4.0.0", + "ed25519-dalek", + "hkdf", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sha2 0.10.7", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-externalities", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "thiserror", + "x25519-dalek 2.0.0", +] + +[[package]] +name = "sp-std" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" + +[[package]] +name = "sp-storage" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-timestamp" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "parity-scale-codec", + "sp-inherents", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-tracing" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-transaction-pool" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "sp-api", + "sp-runtime", +] + +[[package]] +name = "sp-transaction-storage-proof" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-trie", +] + +[[package]] +name = "sp-trie" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "ahash 0.8.3", + "hash-db", + "hashbrown 0.13.2", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot 0.12.1", + "scale-info", + "schnellru", + "sp-core", + "sp-std", + "thiserror", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-version" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-core-hashing-proc-macro", + "sp-runtime", + "sp-std", + "sp-version-proc-macro", + "thiserror", +] + +[[package]] +name = "sp-version-proc-macro" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "sp-wasm-interface" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" dependencies = [ - "array-bytes", - "bitflags", - "blake2", - "bounded-collections", - "bs58", - "dyn-clonable", - "ed25519-zebra", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde", - "lazy_static", - "libsecp256k1", + "anyhow", + "impl-trait-for-tuples", "log", - "merlin", "parity-scale-codec", - "parking_lot", - "paste", - "primitive-types", - "rand 0.8.5", - "regex", + "sp-std", + "wasmtime", +] + +[[package]] +name = "sp-weights" +version = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "parity-scale-codec", "scale-info", - "schnorrkel", - "secp256k1", - "secrecy", "serde", - "sp-core-hashing", + "smallvec", + "sp-arithmetic", + "sp-core", "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", "sp-std", - "sp-storage", - "ss58-registry", - "substrate-bip39", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der 0.7.8", +] + +[[package]] +name = "ss58-registry" +version = "1.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47a8ad42e5fc72d5b1eb104a5546937eaf39843499948bb666d6e93c62423b" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "static_init" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11b73400442027c4adedda20a9f9b7945234a5bd8d5f7e86da22bd5d0622369c" +dependencies = [ + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "static_init_macro 0.5.0", +] + +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags 1.3.2", + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "parking_lot_core 0.8.6", + "static_init_macro 1.0.2", + "winapi", +] + +[[package]] +name = "static_init_macro" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "static_init_macro" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "stun" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" +dependencies = [ + "base64 0.13.1", + "crc", + "lazy_static", + "md-5", + "rand 0.8.5", + "ring 0.16.20", + "subtle", "thiserror", - "tiny-bip39", + "tokio", + "url", + "webrtc-util", +] + +[[package]] +name = "substrate-bip39" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel", + "sha2 0.9.9", "zeroize", ] [[package]] -name = "sp-core-hashing" -version = "9.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "substrate-build-script-utils" +version = "3.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" + +[[package]] +name = "substrate-frame-rpc-system" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.7", - "sha3", - "sp-std", - "twox-hash", + "frame-system-rpc-runtime-api", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-rpc-api", + "sc-transaction-pool-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "hyper", + "log", + "prometheus", + "thiserror", + "tokio", +] + +[[package]] +name = "substrate-state-trie-migration-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-client-api", + "sc-rpc-api", + "serde", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-trie", + "trie-db", +] + +[[package]] +name = "substrate-test-client" +version = "2.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "array-bytes", + "async-trait", + "futures", + "parity-scale-codec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-executor", + "sc-offchain", + "sc-service", + "serde", + "serde_json", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-keyring", + "sp-keystore", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "substrate-wasm-builder" +version = "5.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "ansi_term", + "build-helper", + "cargo_metadata", + "filetime", + "parity-wasm", + "sp-maybe-compressed-blob", + "strum", + "tempfile", + "toml 0.7.6", + "walkdir", + "wasm-opt", +] + +[[package]] +name = "substring" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" +dependencies = [ + "autocfg", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", ] [[package]] -name = "sp-debug-derive" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.18", + "core-foundation-sys", + "libc", ] [[package]] -name = "sp-externalities" -version = "0.19.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std", - "sp-storage", -] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] -name = "sp-io" -version = "23.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "target-lexicon" +version = "0.12.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ - "bytes", - "ed25519", - "ed25519-dalek", - "futures", - "libsecp256k1", - "log", - "parity-scale-codec", - "rustversion", - "secp256k1", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-trie", - "tracing", - "tracing-core", + "cfg-if", + "fastrand 2.0.0", + "redox_syscall 0.3.5", + "rustix 0.38.3", + "windows-sys 0.48.0", ] [[package]] -name = "sp-keystore" -version = "0.27.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ - "futures", - "parity-scale-codec", - "parking_lot", - "sp-core", - "sp-externalities", - "thiserror", + "winapi-util", ] [[package]] -name = "sp-panic-handler" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "test-runtime-constants" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" dependencies = [ - "backtrace", - "lazy_static", - "regex", + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec", + "sp-core", + "sp-runtime", + "sp-weights", ] [[package]] -name = "sp-runtime-interface" -version = "17.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", - "static_assertions", + "thiserror-impl", ] [[package]] -name = "sp-runtime-interface-proc-macro" -version = "11.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ - "Inflector", - "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] -name = "sp-state-machine" -version = "0.28.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "thousands" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "parking_lot", - "rand 0.8.5", - "smallvec", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std", - "sp-trie", - "thiserror", - "tracing", + "cfg-if", + "once_cell", ] [[package]] -name = "sp-std" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] [[package]] -name = "sp-storage" -version = "13.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "thrift" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b82ca8f46f95b3ce96081fe3dd89160fdea970c254bb72925255d1b62aae692e" dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive", - "sp-std", + "byteorder", + "integer-encoding", + "log", + "ordered-float", + "threadpool", ] [[package]] -name = "sp-tracing" -version = "10.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "tikv-jemalloc-ctl" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619bfed27d807b54f7f776b9430d4f8060e66ee138a28632ca898584d462c31c" dependencies = [ - "parity-scale-codec", - "sp-std", - "tracing", - "tracing-core", - "tracing-subscriber", + "libc", + "paste", + "tikv-jemalloc-sys", ] [[package]] -name = "sp-trie" -version = "22.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "tikv-jemalloc-sys" +version = "0.5.4+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" dependencies = [ - "ahash 0.8.3", - "hash-db", - "hashbrown 0.13.2", - "lazy_static", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot", - "scale-info", - "schnellru", - "sp-core", - "sp-std", - "thiserror", - "tracing", - "trie-db", - "trie-root", + "cc", + "libc", ] [[package]] -name = "sp-wasm-interface" -version = "14.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std", - "wasmtime", + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", ] [[package]] -name = "sp-weights" -version = "20.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fe1f8ba1c4f23931ae89c1ada35efb3d908b50f5" +name = "time" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" dependencies = [ - "parity-scale-codec", - "scale-info", + "deranged", + "itoa", "serde", - "smallvec", - "sp-arithmetic", - "sp-core", - "sp-debug-derive", - "sp-std", + "time-core", + "time-macros", ] [[package]] -name = "ss58-registry" -version = "1.40.0" +name = "time-core" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47a8ad42e5fc72d5b1eb104a5546937eaf39843499948bb666d6e93c62423b" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "time-macros" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" dependencies = [ - "Inflector", - "num-format", - "proc-macro2", - "quote", - "serde", - "serde_json", - "unicode-xid", + "time-core", ] [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "tiny-bip39" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" +dependencies = [ + "anyhow", + "hmac 0.12.1", + "once_cell", + "pbkdf2 0.11.0", + "rand 0.8.5", + "rustc-hash", + "sha2 0.10.7", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "tiny-keccak" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] [[package]] -name = "substrate-bip39" -version = "0.4.4" +name = "tinytemplate" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel", - "sha2 0.9.9", - "zeroize", + "serde", + "serde_json", ] [[package]] -name = "subtle" -version = "2.4.1" +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +dependencies = [ + "autocfg", + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot 0.12.1", + "pin-project-lite 0.2.9", + "signal-hook-registry", + "socket2 0.4.9", + "tokio-macros", + "windows-sys 0.48.0", +] [[package]] -name = "syn" -version = "1.0.109" +name = "tokio-macros" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "unicode-ident", + "syn 2.0.29", ] [[package]] -name = "syn" -version = "2.0.18" +name = "tokio-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "rustls 0.21.6", + "tokio", ] [[package]] -name = "tap" -version = "1.0.1" +name = "tokio-stream" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.9", + "tokio", + "tokio-util", +] [[package]] -name = "target-lexicon" -version = "0.12.8" +name = "tokio-util" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite 0.2.9", + "tokio", + "tracing", +] [[package]] -name = "thiserror" -version = "1.0.40" +name = "toml" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ - "thiserror-impl", + "serde", ] [[package]] -name = "thiserror-impl" -version = "1.0.40" +name = "toml" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.18", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", ] [[package]] -name = "thread_local" -version = "1.1.7" +name = "toml_datetime" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ - "cfg-if", - "once_cell", + "serde", ] [[package]] -name = "tiny-bip39" -version = "1.0.0" +name = "toml_edit" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "anyhow", - "hmac 0.12.1", - "once_cell", - "pbkdf2 0.11.0", - "rand 0.8.5", - "rustc-hash", - "sha2 0.10.7", - "thiserror", - "unicode-normalization", - "wasm-bindgen", - "zeroize", + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tower" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ - "tinyvec_macros", + "tower-layer", + "tower-service", + "tracing", ] [[package]] -name = "tinyvec_macros" -version = "0.1.1" +name = "tower-http" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" +dependencies = [ + "bitflags 2.4.0", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "pin-project-lite 0.2.9", + "tower-layer", + "tower-service", +] [[package]] -name = "toml_datetime" -version = "0.6.2" +name = "tower-layer" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] -name = "toml_edit" -version = "0.19.10" +name = "tower-service" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" @@ -2151,7 +10942,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", - "pin-project-lite", + "log", + "pin-project-lite 0.2.9", "tracing-attributes", "tracing-core", ] @@ -2164,7 +10956,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", ] [[package]] @@ -2177,6 +10969,40 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-gum" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "coarsetime", + "polkadot-node-jaeger", + "polkadot-primitives", + "tracing", + "tracing-gum-proc-macro", +] + +[[package]] +name = "tracing-gum-proc-macro" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "expander 2.0.0", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.29", +] + [[package]] name = "tracing-log" version = "0.1.3" @@ -2208,6 +11034,7 @@ dependencies = [ "chrono", "lazy_static", "matchers", + "parking_lot 0.11.2", "regex", "serde", "serde_json", @@ -2242,6 +11069,83 @@ dependencies = [ "hash-db", ] +[[package]] +name = "trust-dns-proto" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "rand 0.8.5", + "smallvec", + "socket2 0.4.9", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lazy_static", + "lru-cache", + "parking_lot 0.12.1", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "tt-call" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" + +[[package]] +name = "turn" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" +dependencies = [ + "async-trait", + "base64 0.13.1", + "futures", + "log", + "md-5", + "rand 0.8.5", + "ring 0.16.20", + "stun", + "thiserror", + "tokio", + "webrtc-util", +] + [[package]] name = "twox-hash" version = "1.6.3" @@ -2260,6 +11164,12 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + [[package]] name = "uint" version = "0.9.5" @@ -2285,48 +11195,159 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] -name = "unicode-normalization" -version = "0.1.22" +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "unsigned-varint" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +dependencies = [ + "asynchronous-codec", + "bytes", + "futures-io", + "futures-util", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna 0.4.0", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom 0.2.10", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "waitgroup" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" dependencies = [ - "tinyvec", + "atomic-waker", ] [[package]] -name = "unicode-xid" -version = "0.2.4" +name = "waker-fn" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] -name = "url" -version = "2.4.0" +name = "walkdir" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", + "same-file", + "winapi-util", ] [[package]] -name = "valuable" -version = "0.1.0" +name = "want" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] [[package]] -name = "version_check" -version = "0.9.4" +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasi" @@ -2355,10 +11376,22 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.87" @@ -2377,7 +11410,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2388,13 +11421,77 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +[[package]] +name = "wasm-instrument" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "wasm-opt" +version = "0.114.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d005a95f934878a1fb446a816d51c3601a0120ff929005ba3bab3c749cfd1c7" +dependencies = [ + "anyhow", + "libc", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "wasm-opt-cxx-sys", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-cxx-sys" +version = "0.114.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d04e240598162810fad3b2e96fa0dec6dba1eb65a03f3bd99a9248ab8b56caa" +dependencies = [ + "anyhow", + "cxx", + "cxx-build", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-sys" +version = "0.114.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2efd2aaca519d64098c4faefc8b7433a97ed511caf4c9e516384eb6aef1ff4f9" +dependencies = [ + "anyhow", + "cc", + "cxx", + "cxx-build", +] + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "wasmparser" version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ - "indexmap", + "indexmap 1.9.3", "url", ] @@ -2407,16 +11504,19 @@ dependencies = [ "anyhow", "bincode", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "object", "once_cell", "paste", "psm", + "rayon", "serde", "target-lexicon", "wasmparser", + "wasmtime-cache", + "wasmtime-cranelift", "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", @@ -2432,6 +11532,63 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "wasmtime-cache" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" +dependencies = [ + "anyhow", + "base64 0.21.2", + "bincode", + "directories-next", + "file-per-thread-logger", + "log", + "rustix 0.36.14", + "serde", + "sha2 0.10.7", + "toml 0.5.11", + "windows-sys 0.45.0", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "wasmtime-cranelift" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli", + "log", + "object", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-cranelift-shared", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-native", + "gimli", + "object", + "target-lexicon", + "wasmtime-environ", +] + [[package]] name = "wasmtime-environ" version = "8.0.1" @@ -2441,7 +11598,7 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli", - "indexmap", + "indexmap 1.9.3", "log", "object", "serde", @@ -2469,6 +11626,7 @@ dependencies = [ "serde", "target-lexicon", "wasmtime-environ", + "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", "wasmtime-runtime", "windows-sys 0.45.0", @@ -2480,7 +11638,9 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ + "object", "once_cell", + "rustix 0.36.14", ] [[package]] @@ -2503,12 +11663,12 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "mach", "memfd", - "memoffset", + "memoffset 0.8.0", "paste", "rand 0.8.5", "rustix 0.36.14", @@ -2519,17 +11679,291 @@ dependencies = [ ] [[package]] -name = "wasmtime-types" -version = "8.0.1" +name = "wasmtime-types" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring 0.16.20", + "untrusted", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring 0.16.20", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki 0.22.0", +] + +[[package]] +name = "webrtc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "hex", + "interceptor", + "lazy_static", + "log", + "rand 0.8.5", + "rcgen 0.9.3", + "regex", + "ring 0.16.20", + "rtcp", + "rtp", + "rustls 0.19.1", + "sdp", + "serde", + "serde_json", + "sha2 0.10.7", + "stun", + "thiserror", + "time 0.3.27", + "tokio", + "turn", + "url", + "waitgroup", + "webrtc-data", + "webrtc-dtls", + "webrtc-ice", + "webrtc-mdns", + "webrtc-media", + "webrtc-sctp", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "webrtc-data" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" +dependencies = [ + "bytes", + "derive_builder", + "log", + "thiserror", + "tokio", + "webrtc-sctp", + "webrtc-util", +] + +[[package]] +name = "webrtc-dtls" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" +dependencies = [ + "aes 0.6.0", + "aes-gcm 0.10.2", + "async-trait", + "bincode", + "block-modes", + "byteorder", + "ccm", + "curve25519-dalek 3.2.0", + "der-parser 8.2.0", + "elliptic-curve 0.12.3", + "hkdf", + "hmac 0.12.1", + "log", + "p256", + "p384", + "rand 0.8.5", + "rand_core 0.6.4", + "rcgen 0.10.0", + "ring 0.16.20", + "rustls 0.19.1", + "sec1 0.3.0", + "serde", + "sha1", + "sha2 0.10.7", + "signature 1.6.4", + "subtle", + "thiserror", + "tokio", + "webpki 0.21.4", + "webrtc-util", + "x25519-dalek 2.0.0", + "x509-parser 0.13.2", +] + +[[package]] +name = "webrtc-ice" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" +dependencies = [ + "arc-swap", + "async-trait", + "crc", + "log", + "rand 0.8.5", + "serde", + "serde_json", + "stun", + "thiserror", + "tokio", + "turn", + "url", + "uuid", + "waitgroup", + "webrtc-mdns", + "webrtc-util", +] + +[[package]] +name = "webrtc-mdns" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" +dependencies = [ + "log", + "socket2 0.4.9", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-media" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" +dependencies = [ + "byteorder", + "bytes", + "rand 0.8.5", + "rtp", + "thiserror", +] + +[[package]] +name = "webrtc-sctp" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "crc", + "log", + "rand 0.8.5", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-srtp" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "aes-gcm 0.9.4", + "async-trait", + "byteorder", + "bytes", + "ctr 0.8.0", + "hmac 0.11.0", + "log", + "rtcp", + "rtp", + "sha-1", + "subtle", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-util" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" +dependencies = [ + "async-trait", + "bitflags 1.3.2", + "bytes", + "cc", + "ipnet", + "lazy_static", + "libc", + "log", + "nix", + "rand 0.8.5", + "thiserror", + "tokio", + "winapi", +] + +[[package]] +name = "which" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ - "cranelift-entity", - "serde", - "thiserror", - "wasmparser", + "either", + "libc", + "once_cell", +] + +[[package]] +name = "wide" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa469ffa65ef7e0ba0f164183697b89b854253fd31aeb92358b7b6155177d62f" +dependencies = [ + "bytemuck", + "safe_arch", ] +[[package]] +name = "widestring" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" + [[package]] name = "winapi" version = "0.3.9" @@ -2546,12 +11980,34 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" +dependencies = [ + "windows_aarch64_msvc 0.34.0", + "windows_i686_gnu 0.34.0", + "windows_i686_msvc 0.34.0", + "windows_x86_64_gnu 0.34.0", + "windows_x86_64_msvc 0.34.0", +] + [[package]] name = "windows" version = "0.48.0" @@ -2621,6 +12077,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -2633,6 +12095,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -2645,6 +12113,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -2657,6 +12131,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -2681,6 +12161,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -2695,13 +12181,23 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.7" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "wyz" version = "0.5.1" @@ -2711,6 +12207,82 @@ dependencies = [ "tap", ] +[[package]] +name = "x25519-dalek" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +dependencies = [ + "curve25519-dalek 3.2.0", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "x25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +dependencies = [ + "curve25519-dalek 4.0.0", + "rand_core 0.6.4", + "serde", + "zeroize", +] + +[[package]] +name = "x509-parser" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" +dependencies = [ + "asn1-rs 0.3.1", + "base64 0.13.1", + "data-encoding", + "der-parser 7.0.0", + "lazy_static", + "nom", + "oid-registry 0.4.0", + "ring 0.16.20", + "rusticata-macros", + "thiserror", + "time 0.3.27", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs 0.5.2", + "base64 0.13.1", + "data-encoding", + "der-parser 8.2.0", + "lazy_static", + "nom", + "oid-registry 0.6.1", + "rusticata-macros", + "thiserror", + "time 0.3.27", +] + +[[package]] +name = "xcm" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "bounded-collections", + "derivative", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-weights", + "xcm-procedural 1.0.0", +] + [[package]] name = "xcm" version = "3.0.0" @@ -2726,7 +12298,130 @@ dependencies = [ "serde", "sp-io", "sp-weights", - "xcm-procedural", + "xcm-procedural 3.0.0", +] + +[[package]] +name = "xcm-builder" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-transaction-payment", + "parity-scale-codec", + "polkadot-parachain", + "scale-info", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "xcm 1.0.0", + "xcm-executor 1.0.0", +] + +[[package]] +name = "xcm-builder" +version = "3.0.0" +dependencies = [ + "assert_matches", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-assets", + "pallet-balances", + "pallet-salary", + "pallet-transaction-payment", + "pallet-xcm 3.0.0", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-parachains", + "polkadot-test-runtime", + "primitive-types", + "scale-info", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "xcm 3.0.0", + "xcm-executor 3.0.0", +] + +[[package]] +name = "xcm-executor" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "xcm 1.0.0", +] + +[[package]] +name = "xcm-executor" +version = "3.0.0" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "xcm 3.0.0", +] + +[[package]] +name = "xcm-executor-integration-tests" +version = "3.0.0" +dependencies = [ + "frame-support", + "frame-system", + "futures", + "pallet-xcm 3.0.0", + "parity-scale-codec", + "polkadot-test-client", + "polkadot-test-runtime", + "polkadot-test-service", + "sp-consensus", + "sp-keyring", + "sp-runtime", + "sp-state-machine", + "sp-tracing", + "xcm 3.0.0", + "xcm-executor 3.0.0", +] + +[[package]] +name = "xcm-procedural" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=master#2c17d3925a891b5c879e93ec082d2a6190c3de6b" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.29", ] [[package]] @@ -2736,7 +12431,100 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", +] + +[[package]] +name = "xcm-simulator" +version = "3.0.0" +dependencies = [ + "frame-support", + "parity-scale-codec", + "paste", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime-parachains", + "sp-io", + "sp-std", + "xcm 3.0.0", + "xcm-builder 3.0.0", + "xcm-executor 3.0.0", +] + +[[package]] +name = "xcm-simulator-example" +version = "3.0.0" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-balances", + "pallet-message-queue", + "pallet-uniques", + "pallet-xcm 3.0.0", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime-parachains", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", + "xcm 3.0.0", + "xcm-builder 3.0.0", + "xcm-executor 3.0.0", + "xcm-simulator", +] + +[[package]] +name = "xcm-simulator-fuzzer" +version = "3.0.0" +dependencies = [ + "arbitrary", + "frame-support", + "frame-system", + "honggfuzz", + "pallet-balances", + "pallet-message-queue", + "pallet-xcm 3.0.0", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime-parachains", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm 3.0.0", + "xcm-builder 3.0.0", + "xcm-executor 3.0.0", + "xcm-simulator", +] + +[[package]] +name = "yamux" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" +dependencies = [ + "futures", + "log", + "nohash-hasher", + "parking_lot 0.12.1", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time 0.3.27", ] [[package]] @@ -2756,5 +12544,54 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.29", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.8+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +dependencies = [ + "cc", + "libc", + "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index dec6d6a28..814ee642e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,25 +4,21 @@ description = "The basic XCM datastructures." authors.workspace = true edition.workspace = true version.workspace = true - -[workspace.package] -authors = ["Parity Technologies "] -edition = "2021" -version = "3.0.0" +license.workspace = true [dependencies] -bounded-collections = { version = "0.1.7", default-features = false, features = ["serde"] } +bounded-collections = { version = "0.1.8", default-features = false, features = ["serde"] } derivative = { version = "2.2.0", default-features = false, features = [ "use_core" ] } impl-trait-for-tuples = "0.2.2" log = { version = "0.4.17", default-features = false } -parity-scale-codec = { version = "3.4.0", default-features = false, features = [ "derive", "max-encoded-len" ] } +parity-scale-codec = { version = "3.6.1", default-features = false, features = [ "derive", "max-encoded-len" ] } scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] } -sp-weights = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["serde"] } +sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false, features = ["serde"] } serde = { version = "1.0.163", default-features = false, features = ["alloc", "derive"] } xcm-procedural = { path = "procedural" } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } hex = "0.4.3" hex-literal = "0.4.1" @@ -36,3 +32,24 @@ std = [ "serde/std", "sp-weights/std", ] + +[workspace] +resolver = "2" + +members = [ + "pallet-xcm", + "pallet-xcm-benchmarks", + "procedural", + "xcm-builder", + "xcm-executor", + "xcm-executor/integration-tests", + "xcm-simulator", + "xcm-simulator/example", + "xcm-simulator/fuzzer", +] + +[workspace.package] +authors = ["Parity Technologies "] +edition = "2021" +version = "3.0.0" +license = "GPL-3.0-only" diff --git a/pallet-xcm-benchmarks/Cargo.toml b/pallet-xcm-benchmarks/Cargo.toml new file mode 100644 index 000000000..2c66d0f1f --- /dev/null +++ b/pallet-xcm-benchmarks/Cargo.toml @@ -0,0 +1,57 @@ +[package] +name = "pallet-xcm-benchmarks" +authors.workspace = true +edition.workspace = true +license.workspace = true +version.workspace = true + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } +log = "0.4.17" +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +xcm-builder = { path = "../xcm-builder", default-features = false } +xcm-executor = { path = "../xcm-executor", default-features = false } +xcm = { path = "..", default-features = false } + +[dev-dependencies] +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +xcm = { path = ".." } +# temp +pallet-xcm = { path = "../pallet-xcm" } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +# westend-runtime = { path = "../../runtime/westend", features = ["runtime-benchmarks"] } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } + +[features] +default = [ "std" ] +std = [ + "codec/std", + "frame-benchmarking/std", + "frame-support/std", + "frame-system/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "xcm-builder/std", + "xcm-executor/std", +] +runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", +] diff --git a/pallet-xcm-benchmarks/src/fungible/benchmarking.rs b/pallet-xcm-benchmarks/src/fungible/benchmarking.rs new file mode 100644 index 000000000..504b79540 --- /dev/null +++ b/pallet-xcm-benchmarks/src/fungible/benchmarking.rs @@ -0,0 +1,282 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use super::*; +use crate::{account_and_location, new_executor, AssetTransactorOf, XcmCallOf}; +use frame_benchmarking::{benchmarks_instance_pallet, BenchmarkError, BenchmarkResult}; +use frame_support::{ + pallet_prelude::Get, + traits::fungible::{Inspect, Mutate}, +}; +use sp_runtime::traits::{Bounded, Zero}; +use sp_std::{prelude::*, vec}; +use xcm::latest::prelude::*; +use xcm_executor::traits::{ConvertLocation, TransactAsset}; + +benchmarks_instance_pallet! { + where_clause { where + < + < + T::TransactAsset + as + Inspect + >::Balance + as + TryInto + >::Error: sp_std::fmt::Debug, + } + + withdraw_asset { + let (sender_account, sender_location) = account_and_location::(1); + let worst_case_holding = T::worst_case_holding(0); + let asset = T::get_multi_asset(); + + >::deposit_asset( + &asset, + &sender_location, + &XcmContext { + origin: Some(sender_location.clone()), + message_id: [0; 32], + topic: None, + }, + ).unwrap(); + // check the assets of origin. + assert!(!T::TransactAsset::balance(&sender_account).is_zero()); + + let mut executor = new_executor::(sender_location); + executor.set_holding(worst_case_holding.into()); + let instruction = Instruction::>::WithdrawAsset(vec![asset.clone()].into()); + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // check one of the assets of origin. + assert!(T::TransactAsset::balance(&sender_account).is_zero()); + assert!(executor.holding().ensure_contains(&vec![asset].into()).is_ok()); + } + + transfer_asset { + let (sender_account, sender_location) = account_and_location::(1); + let asset = T::get_multi_asset(); + let assets: MultiAssets = vec![ asset.clone() ].into(); + // this xcm doesn't use holding + + let dest_location = T::valid_destination()?; + let dest_account = T::AccountIdConverter::convert_location(&dest_location).unwrap(); + + >::deposit_asset( + &asset, + &sender_location, + &XcmContext { + origin: Some(sender_location.clone()), + message_id: [0; 32], + topic: None, + }, + ).unwrap(); + assert!(T::TransactAsset::balance(&dest_account).is_zero()); + + let mut executor = new_executor::(sender_location); + let instruction = Instruction::TransferAsset { assets, beneficiary: dest_location }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + assert!(T::TransactAsset::balance(&sender_account).is_zero()); + assert!(!T::TransactAsset::balance(&dest_account).is_zero()); + } + + transfer_reserve_asset { + let (sender_account, sender_location) = account_and_location::(1); + let dest_location = T::valid_destination()?; + let dest_account = T::AccountIdConverter::convert_location(&dest_location).unwrap(); + + let asset = T::get_multi_asset(); + >::deposit_asset( + &asset, + &sender_location, + &XcmContext { + origin: Some(sender_location.clone()), + message_id: [0; 32], + topic: None, + }, + ).unwrap(); + let assets: MultiAssets = vec![ asset ].into(); + assert!(T::TransactAsset::balance(&dest_account).is_zero()); + + let mut executor = new_executor::(sender_location); + let instruction = Instruction::TransferReserveAsset { + assets, + dest: dest_location, + xcm: Xcm::new() + }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + assert!(T::TransactAsset::balance(&sender_account).is_zero()); + assert!(!T::TransactAsset::balance(&dest_account).is_zero()); + // TODO: Check sender queue is not empty. #4426 + } + + reserve_asset_deposited { + let (trusted_reserve, transferable_reserve_asset) = T::TrustedReserve::get() + .ok_or(BenchmarkError::Override( + BenchmarkResult::from_weight(T::BlockWeights::get().max_block) + ))?; + + let assets: MultiAssets = vec![ transferable_reserve_asset ].into(); + + let mut executor = new_executor::(trusted_reserve); + let instruction = Instruction::ReserveAssetDeposited(assets.clone()); + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + assert!(executor.holding().ensure_contains(&assets).is_ok()); + } + + initiate_reserve_withdraw { + let holding = T::worst_case_holding(1); + let assets_filter = MultiAssetFilter::Definite(holding.clone()); + let reserve = T::valid_destination().map_err(|_| BenchmarkError::Skip)?; + let mut executor = new_executor::(Default::default()); + executor.set_holding(holding.into()); + let instruction = Instruction::InitiateReserveWithdraw { assets: assets_filter, reserve, xcm: Xcm(vec![]) }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // The execute completing successfully is as good as we can check. + // TODO: Potentially add new trait to XcmSender to detect a queued outgoing message. #4426 + } + + receive_teleported_asset { + // If there is no trusted teleporter, then we skip this benchmark. + let (trusted_teleporter, teleportable_asset) = T::TrustedTeleporter::get() + .ok_or(BenchmarkError::Skip)?; + + if let Some((checked_account, _)) = T::CheckedAccount::get() { + T::TransactAsset::mint_into( + &checked_account, + < + T::TransactAsset + as + Inspect + >::Balance::max_value() / 2u32.into(), + )?; + } + + let assets: MultiAssets = vec![ teleportable_asset ].into(); + + let mut executor = new_executor::(trusted_teleporter); + let instruction = Instruction::ReceiveTeleportedAsset(assets.clone()); + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm).map_err(|_| { + BenchmarkError::Override( + BenchmarkResult::from_weight(T::BlockWeights::get().max_block) + ) + })?; + } verify { + assert!(executor.holding().ensure_contains(&assets).is_ok()); + } + + deposit_asset { + let asset = T::get_multi_asset(); + let mut holding = T::worst_case_holding(1); + + // Add our asset to the holding. + holding.push(asset.clone()); + + // our dest must have no balance initially. + let dest_location = T::valid_destination()?; + let dest_account = T::AccountIdConverter::convert_location(&dest_location).unwrap(); + assert!(T::TransactAsset::balance(&dest_account).is_zero()); + + let mut executor = new_executor::(Default::default()); + executor.set_holding(holding.into()); + let instruction = Instruction::>::DepositAsset { + assets: asset.into(), + beneficiary: dest_location, + }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // dest should have received some asset. + assert!(!T::TransactAsset::balance(&dest_account).is_zero()) + } + + deposit_reserve_asset { + let asset = T::get_multi_asset(); + let mut holding = T::worst_case_holding(1); + + // Add our asset to the holding. + holding.push(asset.clone()); + + // our dest must have no balance initially. + let dest_location = T::valid_destination()?; + let dest_account = T::AccountIdConverter::convert_location(&dest_location).unwrap(); + assert!(T::TransactAsset::balance(&dest_account).is_zero()); + + let mut executor = new_executor::(Default::default()); + executor.set_holding(holding.into()); + let instruction = Instruction::>::DepositReserveAsset { + assets: asset.into(), + dest: dest_location, + xcm: Xcm::new(), + }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // dest should have received some asset. + assert!(!T::TransactAsset::balance(&dest_account).is_zero()) + } + + initiate_teleport { + let asset = T::get_multi_asset(); + let mut holding = T::worst_case_holding(0); + + // Add our asset to the holding. + holding.push(asset.clone()); + + // Checked account starts at zero + assert!(T::CheckedAccount::get().map_or(true, |(c, _)| T::TransactAsset::balance(&c).is_zero())); + + let mut executor = new_executor::(Default::default()); + executor.set_holding(holding.into()); + let instruction = Instruction::>::InitiateTeleport { + assets: asset.into(), + dest: T::valid_destination()?, + xcm: Xcm::new(), + }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + if let Some((checked_account, _)) = T::CheckedAccount::get() { + // teleport checked account should have received some asset. + assert!(!T::TransactAsset::balance(&checked_account).is_zero()); + } + } + + impl_benchmark_test_suite!( + Pallet, + crate::fungible::mock::new_test_ext(), + crate::fungible::mock::Test + ); +} diff --git a/pallet-xcm-benchmarks/src/fungible/mock.rs b/pallet-xcm-benchmarks/src/fungible/mock.rs new file mode 100644 index 000000000..f5759afc0 --- /dev/null +++ b/pallet-xcm-benchmarks/src/fungible/mock.rs @@ -0,0 +1,213 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! A mock runtime for XCM benchmarking. + +use crate::{fungible as xcm_balances_benchmark, mock::*}; +use frame_benchmarking::BenchmarkError; +use frame_support::{ + parameter_types, + traits::{ConstU32, Everything, Nothing}, + weights::Weight, +}; +use sp_core::H256; +use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; +use xcm::latest::prelude::*; +use xcm_builder::{AllowUnpaidExecutionFrom, MintLocation}; + +type Block = frame_system::mocking::MockBlock; + +// For testing the pallet, we construct a mock runtime. +frame_support::construct_runtime!( + pub enum Test + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + XcmBalancesBenchmark: xcm_balances_benchmark::{Pallet}, + } +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, u64::MAX)); +} +impl frame_system::Config for Test { + type BaseCallFilter = Everything; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type Nonce = u64; + type Hash = H256; + type RuntimeCall = RuntimeCall; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Block = Block; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); + type MaxConsumers = ConstU32<16>; +} + +parameter_types! { + pub const ExistentialDeposit: u64 = 7; +} + +impl pallet_balances::Config for Test { + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type Balance = u64; + type DustRemoval = (); + type RuntimeEvent = RuntimeEvent; + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); + type RuntimeHoldReason = RuntimeHoldReason; + type FreezeIdentifier = (); + type MaxHolds = ConstU32<0>; + type MaxFreezes = ConstU32<0>; +} + +parameter_types! { + pub const AssetDeposit: u64 = 100 * ExistentialDeposit::get(); + pub const ApprovalDeposit: u64 = 1 * ExistentialDeposit::get(); + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: u64 = 10 * ExistentialDeposit::get(); + pub const MetadataDepositPerByte: u64 = 1 * ExistentialDeposit::get(); +} + +pub struct MatchAnyFungible; +impl xcm_executor::traits::MatchesFungible for MatchAnyFungible { + fn matches_fungible(m: &MultiAsset) -> Option { + use sp_runtime::traits::SaturatedConversion; + match m { + MultiAsset { fun: Fungible(amount), .. } => Some((*amount).saturated_into::()), + _ => None, + } + } +} + +// Use balances as the asset transactor. +pub type AssetTransactor = xcm_builder::CurrencyAdapter< + Balances, + MatchAnyFungible, + AccountIdConverter, + u64, + CheckingAccount, +>; + +parameter_types! { + /// Maximum number of instructions in a single XCM fragment. A sanity check against weight + /// calculations getting too crazy. + pub const MaxInstructions: u32 = 100; + pub const MaxAssetsIntoHolding: u32 = 64; +} + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type RuntimeCall = RuntimeCall; + type XcmSender = DevNull; + type AssetTransactor = AssetTransactor; + type OriginConverter = (); + type IsReserve = TrustedReserves; + type IsTeleporter = TrustedTeleporters; + type UniversalLocation = UniversalLocation; + type Barrier = AllowUnpaidExecutionFrom; + type Weigher = xcm_builder::FixedWeightBounds; + type Trader = xcm_builder::FixedRateOfFungible; + type ResponseHandler = DevNull; + type AssetTrap = (); + type AssetLocker = (); + type AssetExchanger = (); + type AssetClaims = (); + type SubscriptionService = (); + type PalletInstancesInfo = AllPalletsWithSystem; + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; + type Aliasers = Nothing; +} + +impl crate::Config for Test { + type XcmConfig = XcmConfig; + type AccountIdConverter = AccountIdConverter; + fn valid_destination() -> Result { + let valid_destination: MultiLocation = + X1(AccountId32 { network: None, id: [0u8; 32] }).into(); + + Ok(valid_destination) + } + fn worst_case_holding(depositable_count: u32) -> MultiAssets { + crate::mock_worst_case_holding( + depositable_count, + ::MaxAssetsIntoHolding::get(), + ) + } +} + +pub type TrustedTeleporters = xcm_builder::Case; +pub type TrustedReserves = xcm_builder::Case; + +parameter_types! { + pub const CheckingAccount: Option<(u64, MintLocation)> = Some((100, MintLocation::Local)); + pub const ChildTeleporter: MultiLocation = Parachain(1000).into_location(); + pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some(( + ChildTeleporter::get(), + MultiAsset { id: Concrete(Here.into_location()), fun: Fungible(100) }, + )); + pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = Some(( + ChildTeleporter::get(), + MultiAsset { id: Concrete(Here.into_location()), fun: Fungible(100) }, + )); + pub const TeleportConcreteFungible: (MultiAssetFilter, MultiLocation) = + (Wild(AllOf { fun: WildFungible, id: Concrete(Here.into_location()) }), ChildTeleporter::get()); + pub const ReserveConcreteFungible: (MultiAssetFilter, MultiLocation) = + (Wild(AllOf { fun: WildFungible, id: Concrete(Here.into_location()) }), ChildTeleporter::get()); +} + +impl xcm_balances_benchmark::Config for Test { + type TransactAsset = Balances; + type CheckedAccount = CheckingAccount; + type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; + + fn get_multi_asset() -> MultiAsset { + let amount = + >::minimum_balance() as u128; + MultiAsset { id: Concrete(Here.into()), fun: Fungible(amount) } + } +} + +#[cfg(feature = "runtime-benchmarks")] +pub fn new_test_ext() -> sp_io::TestExternalities { + use sp_runtime::BuildStorage; + let t = RuntimeGenesisConfig { ..Default::default() }.build_storage().unwrap(); + sp_tracing::try_init_simple(); + t.into() +} diff --git a/pallet-xcm-benchmarks/src/fungible/mod.rs b/pallet-xcm-benchmarks/src/fungible/mod.rs new file mode 100644 index 000000000..292921eb5 --- /dev/null +++ b/pallet-xcm-benchmarks/src/fungible/mod.rs @@ -0,0 +1,52 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +// Benchmarking for the `AssetTransactor` trait via `Fungible`. + +pub use pallet::*; + +#[cfg(feature = "runtime-benchmarks")] +pub mod benchmarking; +#[cfg(test)] +mod mock; + +#[frame_support::pallet] +pub mod pallet { + use frame_support::pallet_prelude::Get; + #[pallet::config] + pub trait Config: frame_system::Config + crate::Config { + /// The type of `fungible` that is being used under the hood. + /// + /// This is useful for testing and checking. + type TransactAsset: frame_support::traits::fungible::Mutate; + + /// The account used to check assets being teleported. + type CheckedAccount: Get>; + + /// A trusted location which we allow teleports from, and the asset we allow to teleport. + type TrustedTeleporter: Get>; + + /// A trusted location where reserve assets are stored, and the asset we allow to be + /// reserves. + type TrustedReserve: Get>; + + /// Give me a fungible asset that your asset transactor is going to accept. + fn get_multi_asset() -> xcm::latest::MultiAsset; + } + + #[pallet::pallet] + pub struct Pallet(_); +} diff --git a/pallet-xcm-benchmarks/src/generic/benchmarking.rs b/pallet-xcm-benchmarks/src/generic/benchmarking.rs new file mode 100644 index 000000000..4583ecdba --- /dev/null +++ b/pallet-xcm-benchmarks/src/generic/benchmarking.rs @@ -0,0 +1,640 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use super::*; +use crate::{new_executor, XcmCallOf}; +use codec::Encode; +use frame_benchmarking::{benchmarks, BenchmarkError}; +use frame_support::dispatch::GetDispatchInfo; +use sp_std::vec; +use xcm::{ + latest::{prelude::*, MaxDispatchErrorLen, MaybeErrorCode, Weight}, + DoubleEncoded, +}; +use xcm_executor::{ExecutorError, FeesMode}; + +benchmarks! { + report_holding { + let holding = T::worst_case_holding(0); + + let mut executor = new_executor::(Default::default()); + executor.set_holding(holding.clone().into()); + + let instruction = Instruction::>::ReportHolding { + response_info: QueryResponseInfo { + destination: T::valid_destination()?, + query_id: Default::default(), + max_weight: Weight::MAX, + }, + // Worst case is looking through all holdings for every asset explicitly. + assets: Definite(holding), + }; + + let xcm = Xcm(vec![instruction]); + + } : { + executor.bench_process(xcm)?; + } verify { + // The completion of execution above is enough to validate this is completed. + } + + // This benchmark does not use any additional orders or instructions. This should be managed + // by the `deep` and `shallow` implementation. + buy_execution { + let holding = T::worst_case_holding(0).into(); + + let mut executor = new_executor::(Default::default()); + executor.set_holding(holding); + + let fee_asset = Concrete(Here.into()); + + let instruction = Instruction::>::BuyExecution { + fees: (fee_asset, 100_000_000u128).into(), // should be something inside of holding + weight_limit: WeightLimit::Unlimited, + }; + + let xcm = Xcm(vec![instruction]); + } : { + executor.bench_process(xcm)?; + } verify { + + } + + query_response { + let mut executor = new_executor::(Default::default()); + let (query_id, response) = T::worst_case_response(); + let max_weight = Weight::MAX; + let querier: Option = Some(Here.into()); + let instruction = Instruction::QueryResponse { query_id, response, max_weight, querier }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // The assert above is enough to show this XCM succeeded + } + + // We don't care about the call itself, since that is accounted for in the weight parameter + // and included in the final weight calculation. So this is just the overhead of submitting + // a noop call. + transact { + let (origin, noop_call) = T::transact_origin_and_runtime_call()?; + let mut executor = new_executor::(origin); + let double_encoded_noop_call: DoubleEncoded<_> = noop_call.encode().into(); + + let instruction = Instruction::Transact { + origin_kind: OriginKind::SovereignAccount, + require_weight_at_most: noop_call.get_dispatch_info().weight, + call: double_encoded_noop_call, + }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // TODO Make the assertion configurable? + } + + refund_surplus { + let holding = T::worst_case_holding(0).into(); + let mut executor = new_executor::(Default::default()); + executor.set_holding(holding); + executor.set_total_surplus(Weight::from_parts(1337, 1337)); + executor.set_total_refunded(Weight::zero()); + + let instruction = Instruction::>::RefundSurplus; + let xcm = Xcm(vec![instruction]); + } : { + let result = executor.bench_process(xcm)?; + } verify { + assert_eq!(executor.total_surplus(), &Weight::from_parts(1337, 1337)); + assert_eq!(executor.total_refunded(), &Weight::from_parts(1337, 1337)); + } + + set_error_handler { + let mut executor = new_executor::(Default::default()); + let instruction = Instruction::>::SetErrorHandler(Xcm(vec![])); + let xcm = Xcm(vec![instruction]); + } : { + executor.bench_process(xcm)?; + } verify { + assert_eq!(executor.error_handler(), &Xcm(vec![])); + } + + set_appendix { + let mut executor = new_executor::(Default::default()); + let appendix = Xcm(vec![]); + let instruction = Instruction::>::SetAppendix(appendix); + let xcm = Xcm(vec![instruction]); + } : { + executor.bench_process(xcm)?; + } verify { + assert_eq!(executor.appendix(), &Xcm(vec![])); + } + + clear_error { + let mut executor = new_executor::(Default::default()); + executor.set_error(Some((5u32, XcmError::Overflow))); + let instruction = Instruction::>::ClearError; + let xcm = Xcm(vec![instruction]); + } : { + executor.bench_process(xcm)?; + } verify { + assert!(executor.error().is_none()) + } + + descend_origin { + let mut executor = new_executor::(Default::default()); + let who = X2(OnlyChild, OnlyChild); + let instruction = Instruction::DescendOrigin(who.clone()); + let xcm = Xcm(vec![instruction]); + } : { + executor.bench_process(xcm)?; + } verify { + assert_eq!( + executor.origin(), + &Some(MultiLocation { + parents: 0, + interior: who, + }), + ); + } + + clear_origin { + let mut executor = new_executor::(Default::default()); + let instruction = Instruction::ClearOrigin; + let xcm = Xcm(vec![instruction]); + } : { + executor.bench_process(xcm)?; + } verify { + assert_eq!(executor.origin(), &None); + } + + report_error { + let mut executor = new_executor::(Default::default()); + executor.set_error(Some((0u32, XcmError::Unimplemented))); + let query_id = Default::default(); + let destination = T::valid_destination().map_err(|_| BenchmarkError::Skip)?; + let max_weight = Default::default(); + + let instruction = Instruction::ReportError(QueryResponseInfo { + query_id, destination, max_weight + }); + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // the execution succeeding is all we need to verify this xcm was successful + } + + claim_asset { + use xcm_executor::traits::DropAssets; + + let (origin, ticket, assets) = T::claimable_asset()?; + + // We place some items into the asset trap to claim. + ::AssetTrap::drop_assets( + &origin, + assets.clone().into(), + &XcmContext { + origin: Some(origin.clone()), + message_id: [0; 32], + topic: None, + }, + ); + + // Assets should be in the trap now. + + let mut executor = new_executor::(origin); + let instruction = Instruction::ClaimAsset { assets: assets.clone(), ticket }; + let xcm = Xcm(vec![instruction]); + } :{ + executor.bench_process(xcm)?; + } verify { + assert!(executor.holding().ensure_contains(&assets).is_ok()); + } + + trap { + let mut executor = new_executor::(Default::default()); + let instruction = Instruction::Trap(10); + let xcm = Xcm(vec![instruction]); + // In order to access result in the verification below, it needs to be defined here. + let mut _result = Ok(()); + } : { + _result = executor.bench_process(xcm); + } verify { + assert!(matches!(_result, Err(ExecutorError { + xcm_error: XcmError::Trap(10), + .. + }))); + } + + subscribe_version { + use xcm_executor::traits::VersionChangeNotifier; + let origin = T::subscribe_origin()?; + let query_id = Default::default(); + let max_response_weight = Default::default(); + let mut executor = new_executor::(origin.clone()); + let instruction = Instruction::SubscribeVersion { query_id, max_response_weight }; + let xcm = Xcm(vec![instruction]); + } : { + executor.bench_process(xcm)?; + } verify { + assert!(::SubscriptionService::is_subscribed(&origin)); + } + + unsubscribe_version { + use xcm_executor::traits::VersionChangeNotifier; + // First we need to subscribe to notifications. + let (origin, _) = T::transact_origin_and_runtime_call()?; + let query_id = Default::default(); + let max_response_weight = Default::default(); + ::SubscriptionService::start( + &origin, + query_id, + max_response_weight, + &XcmContext { + origin: Some(origin.clone()), + message_id: [0; 32], + topic: None, + }, + ).map_err(|_| "Could not start subscription")?; + assert!(::SubscriptionService::is_subscribed(&origin)); + + let mut executor = new_executor::(origin.clone()); + let instruction = Instruction::UnsubscribeVersion; + let xcm = Xcm(vec![instruction]); + } : { + executor.bench_process(xcm)?; + } verify { + assert!(!::SubscriptionService::is_subscribed(&origin)); + } + + burn_asset { + let holding = T::worst_case_holding(0); + let assets = holding.clone(); + + let mut executor = new_executor::(Default::default()); + executor.set_holding(holding.into()); + + let instruction = Instruction::BurnAsset(assets.into()); + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + assert!(executor.holding().is_empty()); + } + + expect_asset { + let holding = T::worst_case_holding(0); + let assets = holding.clone(); + + let mut executor = new_executor::(Default::default()); + executor.set_holding(holding.into()); + + let instruction = Instruction::ExpectAsset(assets.into()); + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // `execute` completing successfully is as good as we can check. + } + + expect_origin { + let expected_origin = Parent.into(); + let mut executor = new_executor::(Default::default()); + + let instruction = Instruction::ExpectOrigin(Some(expected_origin)); + let xcm = Xcm(vec![instruction]); + let mut _result = Ok(()); + }: { + _result = executor.bench_process(xcm); + } verify { + assert!(matches!(_result, Err(ExecutorError { + xcm_error: XcmError::ExpectationFalse, + .. + }))); + } + + expect_error { + let mut executor = new_executor::(Default::default()); + executor.set_error(Some((3u32, XcmError::Overflow))); + + let instruction = Instruction::ExpectError(None); + let xcm = Xcm(vec![instruction]); + let mut _result = Ok(()); + }: { + _result = executor.bench_process(xcm); + } verify { + assert!(matches!(_result, Err(ExecutorError { + xcm_error: XcmError::ExpectationFalse, + .. + }))); + } + + expect_transact_status { + let mut executor = new_executor::(Default::default()); + let worst_error = || -> MaybeErrorCode { + vec![0; MaxDispatchErrorLen::get() as usize].into() + }; + executor.set_transact_status(worst_error()); + + let instruction = Instruction::ExpectTransactStatus(worst_error()); + let xcm = Xcm(vec![instruction]); + let mut _result = Ok(()); + }: { + _result = executor.bench_process(xcm); + } verify { + assert!(matches!(_result, Ok(..))); + } + + query_pallet { + let query_id = Default::default(); + let destination = T::valid_destination().map_err(|_| BenchmarkError::Skip)?; + let max_weight = Default::default(); + let mut executor = new_executor::(Default::default()); + + let instruction = Instruction::QueryPallet { + module_name: b"frame_system".to_vec(), + response_info: QueryResponseInfo { destination, query_id, max_weight }, + }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // TODO: Potentially add new trait to XcmSender to detect a queued outgoing message. #4426 + } + + expect_pallet { + let mut executor = new_executor::(Default::default()); + + let instruction = Instruction::ExpectPallet { + index: 0, + name: b"System".to_vec(), + module_name: b"frame_system".to_vec(), + crate_major: 4, + min_crate_minor: 0, + }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // the execution succeeding is all we need to verify this xcm was successful + } + + report_transact_status { + let query_id = Default::default(); + let destination = T::valid_destination().map_err(|_| BenchmarkError::Skip)?; + let max_weight = Default::default(); + + let mut executor = new_executor::(Default::default()); + executor.set_transact_status(b"MyError".to_vec().into()); + + let instruction = Instruction::ReportTransactStatus(QueryResponseInfo { + query_id, + destination, + max_weight, + }); + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // TODO: Potentially add new trait to XcmSender to detect a queued outgoing message. #4426 + } + + clear_transact_status { + let mut executor = new_executor::(Default::default()); + executor.set_transact_status(b"MyError".to_vec().into()); + + let instruction = Instruction::ClearTransactStatus; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + assert_eq!(executor.transact_status(), &MaybeErrorCode::Success); + } + + set_topic { + let mut executor = new_executor::(Default::default()); + + let instruction = Instruction::SetTopic([1; 32]); + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + assert_eq!(executor.topic(), &Some([1; 32])); + } + + clear_topic { + let mut executor = new_executor::(Default::default()); + executor.set_topic(Some([2; 32])); + + let instruction = Instruction::ClearTopic; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + assert_eq!(executor.topic(), &None); + } + + exchange_asset { + let (give, want) = T::worst_case_asset_exchange().map_err(|_| BenchmarkError::Skip)?; + let assets = give.clone(); + + let mut executor = new_executor::(Default::default()); + executor.set_holding(give.into()); + let instruction = Instruction::ExchangeAsset { + give: assets.into(), + want: want.clone(), + maximal: true, + }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + assert_eq!(executor.holding(), &want.into()); + } + + universal_origin { + let (origin, alias) = T::universal_alias().map_err(|_| BenchmarkError::Skip)?; + + let mut executor = new_executor::(origin); + + let instruction = Instruction::UniversalOrigin(alias.clone()); + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + use frame_support::traits::Get; + let universal_location = ::UniversalLocation::get(); + assert_eq!(executor.origin(), &Some(X1(alias).relative_to(&universal_location))); + } + + export_message { + let x in 1 .. 1000; + // The `inner_xcm` influences `ExportMessage` total weight based on + // `inner_xcm.encoded_size()`, so for this benchmark use smallest encoded instruction + // to approximate weight per "unit" of encoded size; then actual weight can be estimated + // to be `inner_xcm.encoded_size() * benchmarked_unit`. + // Use `ClearOrigin` as the small encoded instruction. + let inner_xcm = Xcm(vec![ClearOrigin; x as usize]); + // Get `origin`, `network` and `destination` from configured runtime. + let (origin, network, destination) = T::export_message_origin_and_destination()?; + let mut executor = new_executor::(origin); + let xcm = Xcm(vec![ExportMessage { + network, destination, xcm: inner_xcm, + }]); + }: { + executor.bench_process(xcm)?; + } verify { + // The execute completing successfully is as good as we can check. + // TODO: Potentially add new trait to XcmSender to detect a queued outgoing message. #4426 + } + + set_fees_mode { + let mut executor = new_executor::(Default::default()); + executor.set_fees_mode(FeesMode { jit_withdraw: false }); + + let instruction = Instruction::SetFeesMode { jit_withdraw: true }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + assert_eq!(executor.fees_mode(), &FeesMode { jit_withdraw: true }); + } + + lock_asset { + let (unlocker, owner, asset) = T::unlockable_asset()?; + + let mut executor = new_executor::(owner); + executor.set_holding(asset.clone().into()); + + let instruction = Instruction::LockAsset { asset, unlocker }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // TODO: Potentially add new trait to XcmSender to detect a queued outgoing message. #4426 + } + + unlock_asset { + use xcm_executor::traits::{AssetLock, Enact}; + + let (unlocker, owner, asset) = T::unlockable_asset()?; + + let mut executor = new_executor::(unlocker.clone()); + + // We first place the asset in lock first... + ::AssetLocker::prepare_lock( + unlocker, + asset.clone(), + owner.clone(), + ) + .map_err(|_| BenchmarkError::Skip)? + .enact() + .map_err(|_| BenchmarkError::Skip)?; + + // ... then unlock them with the UnlockAsset instruction. + let instruction = Instruction::UnlockAsset { asset, target: owner }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + + } + + note_unlockable { + use xcm_executor::traits::{AssetLock, Enact}; + + let (unlocker, owner, asset) = T::unlockable_asset()?; + + let mut executor = new_executor::(unlocker.clone()); + + // We first place the asset in lock first... + ::AssetLocker::prepare_lock( + unlocker, + asset.clone(), + owner.clone(), + ) + .map_err(|_| BenchmarkError::Skip)? + .enact() + .map_err(|_| BenchmarkError::Skip)?; + + // ... then note them as unlockable with the NoteUnlockable instruction. + let instruction = Instruction::NoteUnlockable { asset, owner }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + + } + + request_unlock { + use xcm_executor::traits::{AssetLock, Enact}; + + let (locker, owner, asset) = T::unlockable_asset()?; + + // We first place the asset in lock first... + ::AssetLocker::prepare_lock( + locker.clone(), + asset.clone(), + owner.clone(), + ) + .map_err(|_| BenchmarkError::Skip)? + .enact() + .map_err(|_| BenchmarkError::Skip)?; + + // ... then request for an unlock with the RequestUnlock instruction. + let mut executor = new_executor::(owner); + let instruction = Instruction::RequestUnlock { asset, locker }; + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + // TODO: Potentially add new trait to XcmSender to detect a queued outgoing message. #4426 + } + + unpaid_execution { + let mut executor = new_executor::(Default::default()); + executor.set_origin(Some(Here.into())); + + let instruction = Instruction::>::UnpaidExecution { + weight_limit: WeightLimit::Unlimited, + check_origin: Some(Here.into()), + }; + + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } + + alias_origin { + let (origin, target) = T::alias_origin().map_err(|_| BenchmarkError::Skip)?; + + let mut executor = new_executor::(origin); + + let instruction = Instruction::AliasOrigin(target.clone()); + let xcm = Xcm(vec![instruction]); + }: { + executor.bench_process(xcm)?; + } verify { + assert_eq!(executor.origin(), &Some(target)); + } + + impl_benchmark_test_suite!( + Pallet, + crate::generic::mock::new_test_ext(), + crate::generic::mock::Test + ); +} diff --git a/pallet-xcm-benchmarks/src/generic/mock.rs b/pallet-xcm-benchmarks/src/generic/mock.rs new file mode 100644 index 000000000..1b244f316 --- /dev/null +++ b/pallet-xcm-benchmarks/src/generic/mock.rs @@ -0,0 +1,226 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! A mock runtime for XCM benchmarking. + +use crate::{generic, mock::*, *}; +use codec::Decode; +use frame_support::{ + match_types, parameter_types, + traits::{Everything, OriginTrait}, + weights::Weight, +}; +use sp_core::H256; +use sp_runtime::traits::{BlakeTwo256, IdentityLookup, TrailingZeroInput}; +use xcm_builder::{ + test_utils::{ + Assets, TestAssetExchanger, TestAssetLocker, TestAssetTrap, TestSubscriptionService, + TestUniversalAliases, + }, + AliasForeignAccountId32, AllowUnpaidExecutionFrom, +}; +use xcm_executor::traits::ConvertOrigin; + +type Block = frame_system::mocking::MockBlock; + +frame_support::construct_runtime!( + pub enum Test + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + XcmGenericBenchmarks: generic::{Pallet}, + } +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, u64::MAX)); +} + +impl frame_system::Config for Test { + type BaseCallFilter = Everything; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type Nonce = u64; + type Hash = H256; + type RuntimeCall = RuntimeCall; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Block = Block; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +/// The benchmarks in this pallet should never need an asset transactor to begin with. +pub struct NoAssetTransactor; +impl xcm_executor::traits::TransactAsset for NoAssetTransactor { + fn deposit_asset(_: &MultiAsset, _: &MultiLocation, _: &XcmContext) -> Result<(), XcmError> { + unreachable!(); + } + + fn withdraw_asset( + _: &MultiAsset, + _: &MultiLocation, + _: Option<&XcmContext>, + ) -> Result { + unreachable!(); + } +} + +parameter_types! { + pub const MaxInstructions: u32 = 100; + pub const MaxAssetsIntoHolding: u32 = 64; +} + +match_types! { + pub type OnlyParachains: impl Contains = { + MultiLocation { parents: 0, interior: X1(Parachain(_)) } + }; +} + +type Aliasers = AliasForeignAccountId32; +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type RuntimeCall = RuntimeCall; + type XcmSender = DevNull; + type AssetTransactor = NoAssetTransactor; + type OriginConverter = AlwaysSignedByDefault; + type IsReserve = AllAssetLocationsPass; + type IsTeleporter = (); + type UniversalLocation = UniversalLocation; + type Barrier = AllowUnpaidExecutionFrom; + type Weigher = xcm_builder::FixedWeightBounds; + type Trader = xcm_builder::FixedRateOfFungible; + type ResponseHandler = DevNull; + type AssetTrap = TestAssetTrap; + type AssetLocker = TestAssetLocker; + type AssetExchanger = TestAssetExchanger; + type AssetClaims = TestAssetTrap; + type SubscriptionService = TestSubscriptionService; + type PalletInstancesInfo = AllPalletsWithSystem; + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + // No bridges yet... + type MessageExporter = (); + type UniversalAliases = TestUniversalAliases; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; + type Aliasers = Aliasers; +} + +impl crate::Config for Test { + type XcmConfig = XcmConfig; + type AccountIdConverter = AccountIdConverter; + fn valid_destination() -> Result { + let valid_destination: MultiLocation = + Junction::AccountId32 { network: None, id: [0u8; 32] }.into(); + + Ok(valid_destination) + } + fn worst_case_holding(depositable_count: u32) -> MultiAssets { + crate::mock_worst_case_holding( + depositable_count, + ::MaxAssetsIntoHolding::get(), + ) + } +} + +impl generic::Config for Test { + type RuntimeCall = RuntimeCall; + + fn worst_case_response() -> (u64, Response) { + let assets: MultiAssets = (Concrete(Here.into()), 100).into(); + (0, Response::Assets(assets)) + } + + fn worst_case_asset_exchange() -> Result<(MultiAssets, MultiAssets), BenchmarkError> { + Ok(Default::default()) + } + + fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> { + Ok((Here.into(), GlobalConsensus(ByGenesis([0; 32])))) + } + + fn transact_origin_and_runtime_call( + ) -> Result<(MultiLocation, ::RuntimeCall), BenchmarkError> { + Ok((Default::default(), frame_system::Call::remark_with_event { remark: vec![] }.into())) + } + + fn subscribe_origin() -> Result { + Ok(Default::default()) + } + + fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> { + let assets: MultiAssets = (Concrete(Here.into()), 100).into(); + let ticket = MultiLocation { parents: 0, interior: X1(GeneralIndex(0)) }; + Ok((Default::default(), ticket, assets)) + } + + fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> { + let assets: MultiAsset = (Concrete(Here.into()), 100).into(); + Ok((Default::default(), Default::default(), assets)) + } + + fn export_message_origin_and_destination( + ) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> { + // No MessageExporter in tests + Err(BenchmarkError::Skip) + } + + fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> { + let origin: MultiLocation = + (Parachain(1), AccountId32 { network: None, id: [0; 32] }).into(); + let target: MultiLocation = AccountId32 { network: None, id: [0; 32] }.into(); + Ok((origin, target)) + } +} + +#[cfg(feature = "runtime-benchmarks")] +pub fn new_test_ext() -> sp_io::TestExternalities { + use sp_runtime::BuildStorage; + let t = RuntimeGenesisConfig { ..Default::default() }.build_storage().unwrap(); + sp_tracing::try_init_simple(); + t.into() +} + +pub struct AlwaysSignedByDefault(core::marker::PhantomData); +impl ConvertOrigin for AlwaysSignedByDefault +where + RuntimeOrigin: OriginTrait, + ::AccountId: Decode, +{ + fn convert_origin( + _origin: impl Into, + _kind: OriginKind, + ) -> Result { + Ok(RuntimeOrigin::signed( + ::AccountId::decode(&mut TrailingZeroInput::zeroes()) + .expect("infinite length input; no invalid inputs for type; qed"), + )) + } +} diff --git a/pallet-xcm-benchmarks/src/generic/mod.rs b/pallet-xcm-benchmarks/src/generic/mod.rs new file mode 100644 index 000000000..195066ee5 --- /dev/null +++ b/pallet-xcm-benchmarks/src/generic/mod.rs @@ -0,0 +1,95 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +pub use pallet::*; + +#[cfg(feature = "runtime-benchmarks")] +pub mod benchmarking; +#[cfg(test)] +mod mock; + +#[frame_support::pallet] +pub mod pallet { + use frame_benchmarking::BenchmarkError; + use frame_support::{ + dispatch::{Dispatchable, GetDispatchInfo}, + pallet_prelude::Encode, + }; + use xcm::latest::{ + InteriorMultiLocation, Junction, MultiAsset, MultiAssets, MultiLocation, NetworkId, + Response, + }; + + #[pallet::config] + pub trait Config: frame_system::Config + crate::Config { + type RuntimeCall: Dispatchable + + GetDispatchInfo + + From> + + Encode; + + /// The response which causes the most runtime weight. + fn worst_case_response() -> (u64, Response); + + /// The pair of asset collections which causes the most runtime weight if demanded to be + /// exchanged. + /// + /// The first element in the returned tuple represents the assets that are being exchanged + /// from, whereas the second element represents the assets that are being exchanged to. + /// + /// If set to `Err`, benchmarks which rely on an `exchange_asset` will be skipped. + fn worst_case_asset_exchange() -> Result<(MultiAssets, MultiAssets), BenchmarkError>; + + /// A `(MultiLocation, Junction)` that is one of the `UniversalAliases` configured by the + /// XCM executor. + /// + /// If set to `Err`, benchmarks which rely on a universal alias will be skipped. + fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError>; + + /// The `MultiLocation` and `RuntimeCall` used for successful transaction XCMs. + /// + /// If set to `Err`, benchmarks which rely on a `transact_origin_and_runtime_call` will be + /// skipped. + fn transact_origin_and_runtime_call( + ) -> Result<(MultiLocation, >::RuntimeCall), BenchmarkError>; + + /// A valid `MultiLocation` we can successfully subscribe to. + /// + /// If set to `Err`, benchmarks which rely on a `subscribe_origin` will be skipped. + fn subscribe_origin() -> Result; + + /// Return an origin, ticket, and assets that can be trapped and claimed. + fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError>; + + /// Return an unlocker, owner and assets that can be locked and unlocked. + fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError>; + + /// A `(MultiLocation, NetworkId, InteriorMultiLocation)` we can successfully export message + /// to. + /// + /// If set to `Err`, benchmarks which rely on `export_message` will be skipped. + fn export_message_origin_and_destination( + ) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError>; + + /// A `(MultiLocation, MultiLocation)` that is one of the `Aliasers` configured by the XCM + /// executor. + /// + /// If set to `Err`, benchmarks which rely on a universal alias will be skipped. + fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError>; + } + + #[pallet::pallet] + pub struct Pallet(_); +} diff --git a/pallet-xcm-benchmarks/src/lib.rs b/pallet-xcm-benchmarks/src/lib.rs new file mode 100644 index 000000000..c6a963435 --- /dev/null +++ b/pallet-xcm-benchmarks/src/lib.rs @@ -0,0 +1,110 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Pallet that serves no other purpose than benchmarking raw messages [`Xcm`]. + +#![cfg_attr(not(feature = "std"), no_std)] + +use codec::Encode; +use frame_benchmarking::{account, BenchmarkError}; +use sp_std::prelude::*; +use xcm::latest::prelude::*; +use xcm_executor::{traits::ConvertLocation, Config as XcmConfig}; + +pub mod fungible; +pub mod generic; + +#[cfg(test)] +mod mock; + +/// A base trait for all individual pallets +pub trait Config: frame_system::Config { + /// The XCM configurations. + /// + /// These might affect the execution of XCM messages, such as defining how the + /// `TransactAsset` is implemented. + type XcmConfig: XcmConfig; + + /// A converter between a multi-location to a sovereign account. + type AccountIdConverter: ConvertLocation; + + /// Does any necessary setup to create a valid destination for XCM messages. + /// Returns that destination's multi-location to be used in benchmarks. + fn valid_destination() -> Result; + + /// Worst case scenario for a holding account in this runtime. + fn worst_case_holding(depositable_count: u32) -> MultiAssets; +} + +const SEED: u32 = 0; + +/// The XCM executor to use for doing stuff. +pub type ExecutorOf = xcm_executor::XcmExecutor<::XcmConfig>; +/// The overarching call type. +pub type OverArchingCallOf = ::RuntimeCall; +/// The asset transactor of our executor +pub type AssetTransactorOf = <::XcmConfig as XcmConfig>::AssetTransactor; +/// The call type of executor's config. Should eventually resolve to the same overarching call type. +pub type XcmCallOf = <::XcmConfig as XcmConfig>::RuntimeCall; + +pub fn mock_worst_case_holding(depositable_count: u32, max_assets: u32) -> MultiAssets { + let fungibles_amount: u128 = 100; + let holding_fungibles = max_assets / 2 - depositable_count; + let holding_non_fungibles = holding_fungibles; + (0..holding_fungibles) + .map(|i| { + MultiAsset { + id: Concrete(GeneralIndex(i as u128).into()), + fun: Fungible(fungibles_amount * i as u128), + } + .into() + }) + .chain(core::iter::once(MultiAsset { id: Concrete(Here.into()), fun: Fungible(u128::MAX) })) + .chain((0..holding_non_fungibles).map(|i| MultiAsset { + id: Concrete(GeneralIndex(i as u128).into()), + fun: NonFungible(asset_instance_from(i)), + })) + .collect::>() + .into() +} + +pub fn asset_instance_from(x: u32) -> AssetInstance { + let bytes = x.encode(); + let mut instance = [0u8; 4]; + instance.copy_from_slice(&bytes); + AssetInstance::Array4(instance) +} + +pub fn new_executor(origin: MultiLocation) -> ExecutorOf { + ExecutorOf::::new(origin, [0; 32]) +} + +/// Build a multi-location from an account id. +fn account_id_junction(index: u32) -> Junction { + let account: T::AccountId = account("account", index, SEED); + let mut encoded = account.encode(); + encoded.resize(32, 0u8); + let mut id = [0u8; 32]; + id.copy_from_slice(&encoded); + Junction::AccountId32 { network: None, id } +} + +pub fn account_and_location(index: u32) -> (T::AccountId, MultiLocation) { + let location: MultiLocation = account_id_junction::(index).into(); + let account = T::AccountIdConverter::convert_location(&location).unwrap(); + + (account, location) +} diff --git a/pallet-xcm-benchmarks/src/mock.rs b/pallet-xcm-benchmarks/src/mock.rs new file mode 100644 index 000000000..e02c5bf08 --- /dev/null +++ b/pallet-xcm-benchmarks/src/mock.rs @@ -0,0 +1,71 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use crate::*; +use frame_support::{parameter_types, traits::ContainsPair}; +use xcm::latest::Weight; + +// An xcm sender/receiver akin to > /dev/null +pub struct DevNull; +impl xcm::opaque::latest::SendXcm for DevNull { + type Ticket = (); + fn validate(_: &mut Option, _: &mut Option>) -> SendResult<()> { + Ok(((), MultiAssets::new())) + } + fn deliver(_: ()) -> Result { + Ok([0; 32]) + } +} + +impl xcm_executor::traits::OnResponse for DevNull { + fn expecting_response(_: &MultiLocation, _: u64, _: Option<&MultiLocation>) -> bool { + false + } + fn on_response( + _: &MultiLocation, + _: u64, + _: Option<&MultiLocation>, + _: Response, + _: Weight, + _: &XcmContext, + ) -> Weight { + Weight::zero() + } +} + +pub struct AccountIdConverter; +impl xcm_executor::traits::ConvertLocation for AccountIdConverter { + fn convert_location(ml: &MultiLocation) -> Option { + match ml { + MultiLocation { parents: 0, interior: X1(Junction::AccountId32 { id, .. }) } => + Some(::decode(&mut &*id.to_vec()).unwrap()), + _ => None, + } + } +} + +parameter_types! { + pub UniversalLocation: InteriorMultiLocation = Junction::Parachain(101).into(); + pub UnitWeightCost: Weight = Weight::from_parts(10, 10); + pub WeightPrice: (AssetId, u128, u128) = (Concrete(Here.into()), 1_000_000, 1024); +} + +pub struct AllAssetLocationsPass; +impl ContainsPair for AllAssetLocationsPass { + fn contains(_: &MultiAsset, _: &MultiLocation) -> bool { + true + } +} diff --git a/pallet-xcm-benchmarks/template.hbs b/pallet-xcm-benchmarks/template.hbs new file mode 100644 index 000000000..81cdf6281 --- /dev/null +++ b/pallet-xcm-benchmarks/template.hbs @@ -0,0 +1,64 @@ +{{header}} +//! Autogenerated weights for `{{pallet}}` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}} +//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: `{{cmd.repeat}}`, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` +//! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}` +//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}` +//! WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} + +// Executed Command: +{{#each args as |arg|}} +// {{arg}} +{{/each}} + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `{{pallet}}`. +pub struct WeightInfo(PhantomData); +impl WeightInfo { + {{#each benchmarks as |benchmark|}} + {{#each benchmark.comments as |comment|}} + /// {{comment}} + {{/each}} + {{#each benchmark.component_ranges as |range|}} + /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. + {{/each}} + pub(crate) fn {{benchmark.name~}} + ( + {{~#each benchmark.components as |c| ~}} + {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} + ) -> Weight { + // Proof Size summary in bytes: + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds. + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) + {{#each benchmark.component_weight as |cw|}} + // Standard Error: {{underscore cw.error}} + .saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) + {{/each}} + {{#if (ne benchmark.base_reads "0")}} + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}})) + {{/if}} + {{#each benchmark.component_reads as |cr|}} + .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) + {{/each}} + {{#if (ne benchmark.base_writes "0")}} + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}})) + {{/if}} + {{#each benchmark.component_writes as |cw|}} + .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) + {{/each}} + {{#each benchmark.component_calculated_proof_size as |cp|}} + .saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) + {{/each}} + } + {{/each}} +} diff --git a/pallet-xcm/Cargo.toml b/pallet-xcm/Cargo.toml new file mode 100644 index 000000000..b7e0ce70a --- /dev/null +++ b/pallet-xcm/Cargo.toml @@ -0,0 +1,57 @@ +[package] +name = "pallet-xcm" +authors.workspace = true +edition.workspace = true +license.workspace = true +version.workspace = true + +[dependencies] +bounded-collections = { version = "0.1.8", default-features = false } +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.163", optional = true, features = ["derive"] } +log = { version = "0.4.17", default-features = false } + +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false} +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false} +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false} +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false} +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false} +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false} + +xcm = { path = "..", default-features = false } +xcm-executor = { path = "../xcm-executor", default-features = false } + +[dev-dependencies] +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +xcm-builder = { path = "../xcm-builder" } + +[features] +default = [ "std" ] +# Enable `VersionedRuntimeUpgrade` for the migrations that is currently still experimental. +experimental = [ "frame-support/experimental" ] +std = [ + "bounded-collections/std", + "codec/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "serde", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "xcm-executor/std", + "xcm/std", +] +runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", +] +try-runtime = [ "frame-support/try-runtime" ] diff --git a/pallet-xcm/src/benchmarking.rs b/pallet-xcm/src/benchmarking.rs new file mode 100644 index 000000000..aca4bd1fb --- /dev/null +++ b/pallet-xcm/src/benchmarking.rs @@ -0,0 +1,198 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use super::*; +use bounded_collections::{ConstU32, WeakBoundedVec}; +use frame_benchmarking::{benchmarks, BenchmarkError, BenchmarkResult}; +use frame_support::weights::Weight; +use frame_system::RawOrigin; +use sp_std::prelude::*; +use xcm::{latest::prelude::*, v2}; + +type RuntimeOrigin = ::RuntimeOrigin; + +benchmarks! { + send { + let send_origin = + T::SendXcmOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + if T::SendXcmOrigin::try_origin(send_origin.clone()).is_err() { + return Err(BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX))) + } + let msg = Xcm(vec![ClearOrigin]); + let versioned_dest: VersionedMultiLocation = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)), + )? + .into(); + let versioned_msg = VersionedXcm::from(msg); + }: _>(send_origin, Box::new(versioned_dest), Box::new(versioned_msg)) + + teleport_assets { + let asset: MultiAsset = (Here, 10).into(); + let send_origin = + T::ExecuteXcmOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + let origin_location = T::ExecuteXcmOrigin::try_origin(send_origin.clone()) + .map_err(|_| BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)))?; + if !T::XcmTeleportFilter::contains(&(origin_location, vec![asset.clone()])) { + return Err(BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX))) + } + + let recipient = [0u8; 32]; + let versioned_dest: VersionedMultiLocation = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)), + )? + .into(); + let versioned_beneficiary: VersionedMultiLocation = + AccountId32 { network: None, id: recipient.into() }.into(); + let versioned_assets: VersionedMultiAssets = asset.into(); + }: _>(send_origin, Box::new(versioned_dest), Box::new(versioned_beneficiary), Box::new(versioned_assets), 0) + + reserve_transfer_assets { + let asset: MultiAsset = (Here, 10).into(); + let send_origin = + T::ExecuteXcmOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + let origin_location = T::ExecuteXcmOrigin::try_origin(send_origin.clone()) + .map_err(|_| BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)))?; + if !T::XcmReserveTransferFilter::contains(&(origin_location, vec![asset.clone()])) { + return Err(BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX))) + } + + let recipient = [0u8; 32]; + let versioned_dest: VersionedMultiLocation = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)), + )? + .into(); + let versioned_beneficiary: VersionedMultiLocation = + AccountId32 { network: None, id: recipient.into() }.into(); + let versioned_assets: VersionedMultiAssets = asset.into(); + }: _>(send_origin, Box::new(versioned_dest), Box::new(versioned_beneficiary), Box::new(versioned_assets), 0) + + execute { + let execute_origin = + T::ExecuteXcmOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + let origin_location = T::ExecuteXcmOrigin::try_origin(execute_origin.clone()) + .map_err(|_| BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)))?; + let msg = Xcm(vec![ClearOrigin]); + if !T::XcmExecuteFilter::contains(&(origin_location, msg.clone())) { + return Err(BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX))) + } + let versioned_msg = VersionedXcm::from(msg); + }: _>(execute_origin, Box::new(versioned_msg), Weight::zero()) + + force_xcm_version { + let loc = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)), + )?; + let xcm_version = 2; + }: _(RawOrigin::Root, Box::new(loc), xcm_version) + + force_default_xcm_version {}: _(RawOrigin::Root, Some(2)) + + force_subscribe_version_notify { + let versioned_loc: VersionedMultiLocation = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)), + )? + .into(); + }: _(RawOrigin::Root, Box::new(versioned_loc)) + + force_unsubscribe_version_notify { + let loc = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)), + )?; + let versioned_loc: VersionedMultiLocation = loc.into(); + let _ = Pallet::::request_version_notify(loc); + }: _(RawOrigin::Root, Box::new(versioned_loc)) + + force_suspension {}: _(RawOrigin::Root, true) + + migrate_supported_version { + let old_version = XCM_VERSION - 1; + let loc = VersionedMultiLocation::from(MultiLocation::from(Parent)); + SupportedVersion::::insert(old_version, loc, old_version); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::MigrateSupportedVersion, Weight::zero()); + } + + migrate_version_notifiers { + let old_version = XCM_VERSION - 1; + let loc = VersionedMultiLocation::from(MultiLocation::from(Parent)); + VersionNotifiers::::insert(old_version, loc, 0); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::MigrateVersionNotifiers, Weight::zero()); + } + + already_notified_target { + let loc = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(T::DbWeight::get().reads(1))), + )?; + let loc = VersionedMultiLocation::from(loc); + let current_version = T::AdvertisedXcmVersion::get(); + VersionNotifyTargets::::insert(current_version, loc, (0, Weight::zero(), current_version)); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::NotifyCurrentTargets(None), Weight::zero()); + } + + notify_current_targets { + let loc = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(T::DbWeight::get().reads_writes(1, 3))), + )?; + let loc = VersionedMultiLocation::from(loc); + let current_version = T::AdvertisedXcmVersion::get(); + let old_version = current_version - 1; + VersionNotifyTargets::::insert(current_version, loc, (0, Weight::zero(), old_version)); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::NotifyCurrentTargets(None), Weight::zero()); + } + + notify_target_migration_fail { + let bad_loc: v2::MultiLocation = v2::Junction::Plurality { + id: v2::BodyId::Named(WeakBoundedVec::>::try_from(vec![0; 32]) + .expect("vec has a length of 32 bits; qed")), + part: v2::BodyPart::Voice, + } + .into(); + let bad_loc = VersionedMultiLocation::from(bad_loc); + let current_version = T::AdvertisedXcmVersion::get(); + VersionNotifyTargets::::insert(current_version, bad_loc, (0, Weight::zero(), current_version)); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::MigrateAndNotifyOldTargets, Weight::zero()); + } + + migrate_version_notify_targets { + let current_version = T::AdvertisedXcmVersion::get(); + let old_version = current_version - 1; + let loc = VersionedMultiLocation::from(MultiLocation::from(Parent)); + VersionNotifyTargets::::insert(old_version, loc, (0, Weight::zero(), current_version)); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::MigrateAndNotifyOldTargets, Weight::zero()); + } + + migrate_and_notify_old_targets { + let loc = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(T::DbWeight::get().reads_writes(1, 3))), + )?; + let loc = VersionedMultiLocation::from(loc); + let old_version = T::AdvertisedXcmVersion::get() - 1; + VersionNotifyTargets::::insert(old_version, loc, (0, Weight::zero(), old_version)); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::MigrateAndNotifyOldTargets, Weight::zero()); + } + + impl_benchmark_test_suite!( + Pallet, + crate::mock::new_test_ext_with_balances(Vec::new()), + crate::mock::Test + ); +} diff --git a/pallet-xcm/src/lib.rs b/pallet-xcm/src/lib.rs new file mode 100644 index 000000000..aefcf3091 --- /dev/null +++ b/pallet-xcm/src/lib.rs @@ -0,0 +1,2261 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Pallet to handle XCM messages. + +#![cfg_attr(not(feature = "std"), no_std)] + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; +#[cfg(test)] +mod mock; +#[cfg(test)] +mod tests; + +pub mod migration; + +use codec::{Decode, Encode, EncodeLike, MaxEncodedLen}; +use frame_support::traits::{ + Contains, ContainsPair, Currency, Defensive, EnsureOrigin, Get, LockableCurrency, OriginTrait, +}; +use scale_info::TypeInfo; +use sp_runtime::{ + traits::{ + AccountIdConversion, BadOrigin, BlakeTwo256, BlockNumberProvider, Hash, Saturating, Zero, + }, + RuntimeDebug, +}; +use sp_std::{boxed::Box, marker::PhantomData, prelude::*, result::Result, vec}; +use xcm::{latest::QueryResponseInfo, prelude::*}; +use xcm_executor::traits::{ConvertOrigin, Properties}; + +use frame_support::{ + dispatch::{Dispatchable, GetDispatchInfo}, + pallet_prelude::*, + traits::WithdrawReasons, + PalletId, +}; +use frame_system::pallet_prelude::*; +pub use pallet::*; +use xcm_executor::{ + traits::{ + CheckSuspension, ClaimAssets, ConvertLocation, DropAssets, MatchesFungible, OnResponse, + QueryHandler, QueryResponseStatus, VersionChangeNotifier, WeightBounds, + }, + Assets, +}; + +pub trait WeightInfo { + fn send() -> Weight; + fn teleport_assets() -> Weight; + fn reserve_transfer_assets() -> Weight; + fn execute() -> Weight; + fn force_xcm_version() -> Weight; + fn force_default_xcm_version() -> Weight; + fn force_subscribe_version_notify() -> Weight; + fn force_unsubscribe_version_notify() -> Weight; + fn force_suspension() -> Weight; + fn migrate_supported_version() -> Weight; + fn migrate_version_notifiers() -> Weight; + fn already_notified_target() -> Weight; + fn notify_current_targets() -> Weight; + fn notify_target_migration_fail() -> Weight; + fn migrate_version_notify_targets() -> Weight; + fn migrate_and_notify_old_targets() -> Weight; +} + +/// fallback implementation +pub struct TestWeightInfo; +impl WeightInfo for TestWeightInfo { + fn send() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn teleport_assets() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn reserve_transfer_assets() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn execute() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn force_xcm_version() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn force_default_xcm_version() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn force_subscribe_version_notify() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn force_unsubscribe_version_notify() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn force_suspension() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn migrate_supported_version() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn migrate_version_notifiers() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn already_notified_target() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn notify_current_targets() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn notify_target_migration_fail() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn migrate_version_notify_targets() -> Weight { + Weight::from_parts(100_000_000, 0) + } + + fn migrate_and_notify_old_targets() -> Weight { + Weight::from_parts(100_000_000, 0) + } +} + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::{ + dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo}, + parameter_types, + }; + use frame_system::Config as SysConfig; + use sp_core::H256; + use xcm_executor::traits::{MatchesFungible, WeightBounds}; + + parameter_types! { + /// An implementation of `Get` which just returns the latest XCM version which we can + /// support. + pub const CurrentXcmVersion: u32 = XCM_VERSION; + } + + const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + + #[pallet::pallet] + #[pallet::storage_version(STORAGE_VERSION)] + #[pallet::without_storage_info] + pub struct Pallet(_); + + pub type BalanceOf = + <::Currency as Currency<::AccountId>>::Balance; + + #[pallet::config] + /// The module configuration trait. + pub trait Config: frame_system::Config { + /// The overarching event type. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + /// A lockable currency. + // TODO: We should really use a trait which can handle multiple currencies. + type Currency: LockableCurrency>; + + /// The `MultiAsset` matcher for `Currency`. + type CurrencyMatcher: MatchesFungible>; + + /// Required origin for sending XCM messages. If successful, it resolves to `MultiLocation` + /// which exists as an interior location within this chain's XCM context. + type SendXcmOrigin: EnsureOrigin< + ::RuntimeOrigin, + Success = MultiLocation, + >; + + /// The type used to actually dispatch an XCM to its destination. + type XcmRouter: SendXcm; + + /// Required origin for executing XCM messages, including the teleport functionality. If + /// successful, then it resolves to `MultiLocation` which exists as an interior location + /// within this chain's XCM context. + type ExecuteXcmOrigin: EnsureOrigin< + ::RuntimeOrigin, + Success = MultiLocation, + >; + + /// Our XCM filter which messages to be executed using `XcmExecutor` must pass. + type XcmExecuteFilter: Contains<(MultiLocation, Xcm<::RuntimeCall>)>; + + /// Something to execute an XCM message. + type XcmExecutor: ExecuteXcm<::RuntimeCall>; + + /// Our XCM filter which messages to be teleported using the dedicated extrinsic must pass. + type XcmTeleportFilter: Contains<(MultiLocation, Vec)>; + + /// Our XCM filter which messages to be reserve-transferred using the dedicated extrinsic + /// must pass. + type XcmReserveTransferFilter: Contains<(MultiLocation, Vec)>; + + /// Means of measuring the weight consumed by an XCM message locally. + type Weigher: WeightBounds<::RuntimeCall>; + + /// This chain's Universal Location. + type UniversalLocation: Get; + + /// The runtime `Origin` type. + type RuntimeOrigin: From + From<::RuntimeOrigin>; + + /// The runtime `Call` type. + type RuntimeCall: Parameter + + GetDispatchInfo + + IsType<::RuntimeCall> + + Dispatchable< + RuntimeOrigin = ::RuntimeOrigin, + PostInfo = PostDispatchInfo, + >; + + const VERSION_DISCOVERY_QUEUE_SIZE: u32; + + /// The latest supported version that we advertise. Generally just set it to + /// `pallet_xcm::CurrentXcmVersion`. + type AdvertisedXcmVersion: Get; + + /// The origin that is allowed to call privileged operations on the XCM pallet + type AdminOrigin: EnsureOrigin<::RuntimeOrigin>; + + /// The assets which we consider a given origin is trusted if they claim to have placed a + /// lock. + type TrustedLockers: ContainsPair; + + /// How to get an `AccountId` value from a `MultiLocation`, useful for handling asset locks. + type SovereignAccountOf: ConvertLocation; + + /// The maximum number of local XCM locks that a single account may have. + type MaxLockers: Get; + + /// The maximum number of consumers a single remote lock may have. + type MaxRemoteLockConsumers: Get; + + /// The ID type for local consumers of remote locks. + type RemoteLockConsumerIdentifier: Parameter + Member + MaxEncodedLen + Ord + Copy; + + /// Weight information for extrinsics in this pallet. + type WeightInfo: WeightInfo; + + /// A `MultiLocation` that can be reached via `XcmRouter`. Used only in benchmarks. + /// + /// If `None`, the benchmarks that depend on a reachable destination will be skipped. + #[cfg(feature = "runtime-benchmarks")] + type ReachableDest: Get>; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// Execution of an XCM message was attempted. + Attempted { outcome: xcm::latest::Outcome }, + /// A XCM message was sent. + Sent { + origin: MultiLocation, + destination: MultiLocation, + message: Xcm<()>, + message_id: XcmHash, + }, + /// Query response received which does not match a registered query. This may be because a + /// matching query was never registered, it may be because it is a duplicate response, or + /// because the query timed out. + UnexpectedResponse { origin: MultiLocation, query_id: QueryId }, + /// Query response has been received and is ready for taking with `take_response`. There is + /// no registered notification call. + ResponseReady { query_id: QueryId, response: Response }, + /// Query response has been received and query is removed. The registered notification has + /// been dispatched and executed successfully. + Notified { query_id: QueryId, pallet_index: u8, call_index: u8 }, + /// Query response has been received and query is removed. The registered notification + /// could not be dispatched because the dispatch weight is greater than the maximum weight + /// originally budgeted by this runtime for the query result. + NotifyOverweight { + query_id: QueryId, + pallet_index: u8, + call_index: u8, + actual_weight: Weight, + max_budgeted_weight: Weight, + }, + /// Query response has been received and query is removed. There was a general error with + /// dispatching the notification call. + NotifyDispatchError { query_id: QueryId, pallet_index: u8, call_index: u8 }, + /// Query response has been received and query is removed. The dispatch was unable to be + /// decoded into a `Call`; this might be due to dispatch function having a signature which + /// is not `(origin, QueryId, Response)`. + NotifyDecodeFailed { query_id: QueryId, pallet_index: u8, call_index: u8 }, + /// Expected query response has been received but the origin location of the response does + /// not match that expected. The query remains registered for a later, valid, response to + /// be received and acted upon. + InvalidResponder { + origin: MultiLocation, + query_id: QueryId, + expected_location: Option, + }, + /// Expected query response has been received but the expected origin location placed in + /// storage by this runtime previously cannot be decoded. The query remains registered. + /// + /// This is unexpected (since a location placed in storage in a previously executing + /// runtime should be readable prior to query timeout) and dangerous since the possibly + /// valid response will be dropped. Manual governance intervention is probably going to be + /// needed. + InvalidResponderVersion { origin: MultiLocation, query_id: QueryId }, + /// Received query response has been read and removed. + ResponseTaken { query_id: QueryId }, + /// Some assets have been placed in an asset trap. + AssetsTrapped { hash: H256, origin: MultiLocation, assets: VersionedMultiAssets }, + /// An XCM version change notification message has been attempted to be sent. + /// + /// The cost of sending it (borne by the chain) is included. + VersionChangeNotified { + destination: MultiLocation, + result: XcmVersion, + cost: MultiAssets, + message_id: XcmHash, + }, + /// The supported version of a location has been changed. This might be through an + /// automatic notification or a manual intervention. + SupportedVersionChanged { location: MultiLocation, version: XcmVersion }, + /// A given location which had a version change subscription was dropped owing to an error + /// sending the notification to it. + NotifyTargetSendFail { location: MultiLocation, query_id: QueryId, error: XcmError }, + /// A given location which had a version change subscription was dropped owing to an error + /// migrating the location to our new XCM format. + NotifyTargetMigrationFail { location: VersionedMultiLocation, query_id: QueryId }, + /// Expected query response has been received but the expected querier location placed in + /// storage by this runtime previously cannot be decoded. The query remains registered. + /// + /// This is unexpected (since a location placed in storage in a previously executing + /// runtime should be readable prior to query timeout) and dangerous since the possibly + /// valid response will be dropped. Manual governance intervention is probably going to be + /// needed. + InvalidQuerierVersion { origin: MultiLocation, query_id: QueryId }, + /// Expected query response has been received but the querier location of the response does + /// not match the expected. The query remains registered for a later, valid, response to + /// be received and acted upon. + InvalidQuerier { + origin: MultiLocation, + query_id: QueryId, + expected_querier: MultiLocation, + maybe_actual_querier: Option, + }, + /// A remote has requested XCM version change notification from us and we have honored it. + /// A version information message is sent to them and its cost is included. + VersionNotifyStarted { destination: MultiLocation, cost: MultiAssets, message_id: XcmHash }, + /// We have requested that a remote chain send us XCM version change notifications. + VersionNotifyRequested { + destination: MultiLocation, + cost: MultiAssets, + message_id: XcmHash, + }, + /// We have requested that a remote chain stops sending us XCM version change + /// notifications. + VersionNotifyUnrequested { + destination: MultiLocation, + cost: MultiAssets, + message_id: XcmHash, + }, + /// Fees were paid from a location for an operation (often for using `SendXcm`). + FeesPaid { paying: MultiLocation, fees: MultiAssets }, + /// Some assets have been claimed from an asset trap + AssetsClaimed { hash: H256, origin: MultiLocation, assets: VersionedMultiAssets }, + } + + #[pallet::origin] + #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] + pub enum Origin { + /// It comes from somewhere in the XCM space wanting to transact. + Xcm(MultiLocation), + /// It comes as an expected response from an XCM location. + Response(MultiLocation), + } + impl From for Origin { + fn from(location: MultiLocation) -> Origin { + Origin::Xcm(location) + } + } + + #[pallet::error] + pub enum Error { + /// The desired destination was unreachable, generally because there is a no way of routing + /// to it. + Unreachable, + /// There was some other issue (i.e. not to do with routing) in sending the message. + /// Perhaps a lack of space for buffering the message. + SendFailure, + /// The message execution fails the filter. + Filtered, + /// The message's weight could not be determined. + UnweighableMessage, + /// The destination `MultiLocation` provided cannot be inverted. + DestinationNotInvertible, + /// The assets to be sent are empty. + Empty, + /// Could not re-anchor the assets to declare the fees for the destination chain. + CannotReanchor, + /// Too many assets have been attempted for transfer. + TooManyAssets, + /// Origin is invalid for sending. + InvalidOrigin, + /// The version of the `Versioned` value used is not able to be interpreted. + BadVersion, + /// The given location could not be used (e.g. because it cannot be expressed in the + /// desired version of XCM). + BadLocation, + /// The referenced subscription could not be found. + NoSubscription, + /// The location is invalid since it already has a subscription from us. + AlreadySubscribed, + /// Invalid asset for the operation. + InvalidAsset, + /// The owner does not own (all) of the asset that they wish to do the operation on. + LowBalance, + /// The asset owner has too many locks on the asset. + TooManyLocks, + /// The given account is not an identifiable sovereign account for any location. + AccountNotSovereign, + /// The operation required fees to be paid which the initiator could not meet. + FeesNotMet, + /// A remote lock with the corresponding data could not be found. + LockNotFound, + /// The unlock operation cannot succeed because there are still consumers of the lock. + InUse, + } + + impl From for Error { + fn from(e: SendError) -> Self { + match e { + SendError::Fees => Error::::FeesNotMet, + SendError::NotApplicable => Error::::Unreachable, + _ => Error::::SendFailure, + } + } + } + + /// The status of a query. + #[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] + pub enum QueryStatus { + /// The query was sent but no response has yet been received. + Pending { + /// The `QueryResponse` XCM must have this origin to be considered a reply for this + /// query. + responder: VersionedMultiLocation, + /// The `QueryResponse` XCM must have this value as the `querier` field to be + /// considered a reply for this query. If `None` then the querier is ignored. + maybe_match_querier: Option, + maybe_notify: Option<(u8, u8)>, + timeout: BlockNumber, + }, + /// The query is for an ongoing version notification subscription. + VersionNotifier { origin: VersionedMultiLocation, is_active: bool }, + /// A response has been received. + Ready { response: VersionedResponse, at: BlockNumber }, + } + + #[derive(Copy, Clone)] + pub(crate) struct LatestVersionedMultiLocation<'a>(pub(crate) &'a MultiLocation); + impl<'a> EncodeLike for LatestVersionedMultiLocation<'a> {} + impl<'a> Encode for LatestVersionedMultiLocation<'a> { + fn encode(&self) -> Vec { + let mut r = VersionedMultiLocation::from(MultiLocation::default()).encode(); + r.truncate(1); + self.0.using_encoded(|d| r.extend_from_slice(d)); + r + } + } + + #[derive(Clone, Encode, Decode, Eq, PartialEq, Ord, PartialOrd, TypeInfo)] + pub enum VersionMigrationStage { + MigrateSupportedVersion, + MigrateVersionNotifiers, + NotifyCurrentTargets(Option>), + MigrateAndNotifyOldTargets, + } + + impl Default for VersionMigrationStage { + fn default() -> Self { + Self::MigrateSupportedVersion + } + } + + /// The latest available query index. + #[pallet::storage] + pub(super) type QueryCounter = StorageValue<_, QueryId, ValueQuery>; + + /// The ongoing queries. + #[pallet::storage] + #[pallet::getter(fn query)] + pub(super) type Queries = + StorageMap<_, Blake2_128Concat, QueryId, QueryStatus>, OptionQuery>; + + /// The existing asset traps. + /// + /// Key is the blake2 256 hash of (origin, versioned `MultiAssets`) pair. Value is the number of + /// times this pair has been trapped (usually just 1 if it exists at all). + #[pallet::storage] + #[pallet::getter(fn asset_trap)] + pub(super) type AssetTraps = StorageMap<_, Identity, H256, u32, ValueQuery>; + + /// Default version to encode XCM when latest version of destination is unknown. If `None`, + /// then the destinations whose XCM version is unknown are considered unreachable. + #[pallet::storage] + #[pallet::whitelist_storage] + pub(super) type SafeXcmVersion = StorageValue<_, XcmVersion, OptionQuery>; + + /// The Latest versions that we know various locations support. + #[pallet::storage] + pub(super) type SupportedVersion = StorageDoubleMap< + _, + Twox64Concat, + XcmVersion, + Blake2_128Concat, + VersionedMultiLocation, + XcmVersion, + OptionQuery, + >; + + /// All locations that we have requested version notifications from. + #[pallet::storage] + pub(super) type VersionNotifiers = StorageDoubleMap< + _, + Twox64Concat, + XcmVersion, + Blake2_128Concat, + VersionedMultiLocation, + QueryId, + OptionQuery, + >; + + /// The target locations that are subscribed to our version changes, as well as the most recent + /// of our versions we informed them of. + #[pallet::storage] + pub(super) type VersionNotifyTargets = StorageDoubleMap< + _, + Twox64Concat, + XcmVersion, + Blake2_128Concat, + VersionedMultiLocation, + (QueryId, Weight, XcmVersion), + OptionQuery, + >; + + pub struct VersionDiscoveryQueueSize(PhantomData); + impl Get for VersionDiscoveryQueueSize { + fn get() -> u32 { + T::VERSION_DISCOVERY_QUEUE_SIZE + } + } + + /// Destinations whose latest XCM version we would like to know. Duplicates not allowed, and + /// the `u32` counter is the number of times that a send to the destination has been attempted, + /// which is used as a prioritization. + #[pallet::storage] + #[pallet::whitelist_storage] + pub(super) type VersionDiscoveryQueue = StorageValue< + _, + BoundedVec<(VersionedMultiLocation, u32), VersionDiscoveryQueueSize>, + ValueQuery, + >; + + /// The current migration's stage, if any. + #[pallet::storage] + pub(super) type CurrentMigration = + StorageValue<_, VersionMigrationStage, OptionQuery>; + + #[derive(Clone, Encode, Decode, Eq, PartialEq, Ord, PartialOrd, TypeInfo, MaxEncodedLen)] + #[scale_info(skip_type_params(MaxConsumers))] + pub struct RemoteLockedFungibleRecord> { + /// Total amount of the asset held by the remote lock. + pub amount: u128, + /// The owner of the locked asset. + pub owner: VersionedMultiLocation, + /// The location which holds the original lock. + pub locker: VersionedMultiLocation, + /// Local consumers of the remote lock with a consumer identifier and the amount + /// of fungible asset every consumer holds. + /// Every consumer can hold up to total amount of the remote lock. + pub consumers: BoundedVec<(ConsumerIdentifier, u128), MaxConsumers>, + } + + impl> RemoteLockedFungibleRecord { + /// Amount of the remote lock in use by consumers. + /// Returns `None` if the remote lock has no consumers. + pub fn amount_held(&self) -> Option { + self.consumers.iter().max_by(|x, y| x.1.cmp(&y.1)).map(|max| max.1) + } + } + + /// Fungible assets which we know are locked on a remote chain. + #[pallet::storage] + pub(super) type RemoteLockedFungibles = StorageNMap< + _, + ( + NMapKey, + NMapKey, + NMapKey, + ), + RemoteLockedFungibleRecord, + OptionQuery, + >; + + /// Fungible assets which we know are locked on this chain. + #[pallet::storage] + pub(super) type LockedFungibles = StorageMap< + _, + Blake2_128Concat, + T::AccountId, + BoundedVec<(BalanceOf, VersionedMultiLocation), T::MaxLockers>, + OptionQuery, + >; + + /// Global suspension state of the XCM executor. + #[pallet::storage] + pub(super) type XcmExecutionSuspended = StorageValue<_, bool, ValueQuery>; + + #[pallet::genesis_config] + pub struct GenesisConfig { + #[serde(skip)] + pub _config: sp_std::marker::PhantomData, + /// The default version to encode outgoing XCM messages with. + pub safe_xcm_version: Option, + } + + impl Default for GenesisConfig { + fn default() -> Self { + Self { safe_xcm_version: Some(XCM_VERSION), _config: Default::default() } + } + } + + #[pallet::genesis_build] + impl BuildGenesisConfig for GenesisConfig { + fn build(&self) { + SafeXcmVersion::::set(self.safe_xcm_version); + } + } + + #[pallet::hooks] + impl Hooks> for Pallet { + fn on_initialize(_n: BlockNumberFor) -> Weight { + let mut weight_used = Weight::zero(); + if let Some(migration) = CurrentMigration::::get() { + // Consume 10% of block at most + let max_weight = T::BlockWeights::get().max_block / 10; + let (w, maybe_migration) = Self::check_xcm_version_change(migration, max_weight); + CurrentMigration::::set(maybe_migration); + weight_used.saturating_accrue(w); + } + + // Here we aim to get one successful version negotiation request sent per block, ordered + // by the destinations being most sent to. + let mut q = VersionDiscoveryQueue::::take().into_inner(); + // TODO: correct weights. + weight_used.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); + q.sort_by_key(|i| i.1); + while let Some((versioned_dest, _)) = q.pop() { + if let Ok(dest) = MultiLocation::try_from(versioned_dest) { + if Self::request_version_notify(dest).is_ok() { + // TODO: correct weights. + weight_used.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); + break + } + } + } + // Should never fail since we only removed items. But better safe than panicking as it's + // way better to drop the queue than panic on initialize. + if let Ok(q) = BoundedVec::try_from(q) { + VersionDiscoveryQueue::::put(q); + } + weight_used + } + } + + pub mod migrations { + use super::*; + use frame_support::traits::{PalletInfoAccess, StorageVersion}; + + #[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)] + enum QueryStatusV0 { + Pending { + responder: VersionedMultiLocation, + maybe_notify: Option<(u8, u8)>, + timeout: BlockNumber, + }, + VersionNotifier { + origin: VersionedMultiLocation, + is_active: bool, + }, + Ready { + response: VersionedResponse, + at: BlockNumber, + }, + } + impl From> for QueryStatus { + fn from(old: QueryStatusV0) -> Self { + use QueryStatusV0::*; + match old { + Pending { responder, maybe_notify, timeout } => QueryStatus::Pending { + responder, + maybe_notify, + timeout, + maybe_match_querier: Some(MultiLocation::here().into()), + }, + VersionNotifier { origin, is_active } => + QueryStatus::VersionNotifier { origin, is_active }, + Ready { response, at } => QueryStatus::Ready { response, at }, + } + } + } + + pub fn migrate_to_v1( + ) -> frame_support::weights::Weight { + let on_chain_storage_version =

::on_chain_storage_version(); + log::info!( + target: "runtime::xcm", + "Running migration storage v1 for xcm with storage version {:?}", + on_chain_storage_version, + ); + + if on_chain_storage_version < 1 { + let mut count = 0; + Queries::::translate::>, _>(|_key, value| { + count += 1; + Some(value.into()) + }); + StorageVersion::new(1).put::

(); + log::info!( + target: "runtime::xcm", + "Running migration storage v1 for xcm with storage version {:?} was complete", + on_chain_storage_version, + ); + // calculate and return migration weights + T::DbWeight::get().reads_writes(count as u64 + 1, count as u64 + 1) + } else { + log::warn!( + target: "runtime::xcm", + "Attempted to apply migration to v1 but failed because storage version is {:?}", + on_chain_storage_version, + ); + T::DbWeight::get().reads(1) + } + } + } + + #[pallet::call] + impl Pallet { + #[pallet::call_index(0)] + #[pallet::weight(T::WeightInfo::send())] + pub fn send( + origin: OriginFor, + dest: Box, + message: Box>, + ) -> DispatchResult { + let origin_location = T::SendXcmOrigin::ensure_origin(origin)?; + let interior: Junctions = + origin_location.try_into().map_err(|_| Error::::InvalidOrigin)?; + let dest = MultiLocation::try_from(*dest).map_err(|()| Error::::BadVersion)?; + let message: Xcm<()> = (*message).try_into().map_err(|()| Error::::BadVersion)?; + + let message_id = + Self::send_xcm(interior, dest, message.clone()).map_err(Error::::from)?; + let e = Event::Sent { origin: origin_location, destination: dest, message, message_id }; + Self::deposit_event(e); + Ok(()) + } + + /// Teleport some assets from the local chain to some destination chain. + /// + /// Fee payment on the destination side is made from the asset in the `assets` vector of + /// index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited, + /// with all fees taken as needed from the asset. + /// + /// - `origin`: Must be capable of withdrawing the `assets` and executing XCM. + /// - `dest`: Destination context for the assets. Will typically be `X2(Parent, + /// Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send + /// from relay to parachain. + /// - `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will + /// generally be an `AccountId32` value. + /// - `assets`: The assets to be withdrawn. The first item should be the currency used to to + /// pay the fee on the `dest` side. May not be empty. + /// - `fee_asset_item`: The index into `assets` of the item which should be used to pay + /// fees. + #[pallet::call_index(1)] + #[pallet::weight({ + let maybe_assets: Result = (*assets.clone()).try_into(); + let maybe_dest: Result = (*dest.clone()).try_into(); + match (maybe_assets, maybe_dest) { + (Ok(assets), Ok(dest)) => { + use sp_std::vec; + let count = assets.len() as u32; + let mut message = Xcm(vec![ + WithdrawAsset(assets), + SetFeesMode { jit_withdraw: true }, + InitiateTeleport { + assets: Wild(AllCounted(count)), + dest, + xcm: Xcm(vec![]), + }, + ]); + T::Weigher::weight(&mut message).map_or(Weight::MAX, |w| T::WeightInfo::teleport_assets().saturating_add(w)) + } + _ => Weight::MAX, + } + })] + pub fn teleport_assets( + origin: OriginFor, + dest: Box, + beneficiary: Box, + assets: Box, + fee_asset_item: u32, + ) -> DispatchResult { + Self::do_teleport_assets(origin, dest, beneficiary, assets, fee_asset_item, None) + } + + /// Transfer some assets from the local chain to the sovereign account of a destination + /// chain and forward a notification XCM. + /// + /// Fee payment on the destination side is made from the asset in the `assets` vector of + /// index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited, + /// with all fees taken as needed from the asset. + /// + /// - `origin`: Must be capable of withdrawing the `assets` and executing XCM. + /// - `dest`: Destination context for the assets. Will typically be `X2(Parent, + /// Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send + /// from relay to parachain. + /// - `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will + /// generally be an `AccountId32` value. + /// - `assets`: The assets to be withdrawn. This should include the assets used to pay the + /// fee on the `dest` side. + /// - `fee_asset_item`: The index into `assets` of the item which should be used to pay + /// fees. + #[pallet::call_index(2)] + #[pallet::weight({ + let maybe_assets: Result = (*assets.clone()).try_into(); + let maybe_dest: Result = (*dest.clone()).try_into(); + match (maybe_assets, maybe_dest) { + (Ok(assets), Ok(dest)) => { + use sp_std::vec; + let mut message = Xcm(vec![ + SetFeesMode { jit_withdraw: true }, + TransferReserveAsset { assets, dest, xcm: Xcm(vec![]) } + ]); + T::Weigher::weight(&mut message).map_or(Weight::MAX, |w| T::WeightInfo::reserve_transfer_assets().saturating_add(w)) + } + _ => Weight::MAX, + } + })] + pub fn reserve_transfer_assets( + origin: OriginFor, + dest: Box, + beneficiary: Box, + assets: Box, + fee_asset_item: u32, + ) -> DispatchResult { + Self::do_reserve_transfer_assets( + origin, + dest, + beneficiary, + assets, + fee_asset_item, + None, + ) + } + + /// Execute an XCM message from a local, signed, origin. + /// + /// An event is deposited indicating whether `msg` could be executed completely or only + /// partially. + /// + /// No more than `max_weight` will be used in its attempted execution. If this is less than + /// the maximum amount of weight that the message could take to be executed, then no + /// execution attempt will be made. + /// + /// NOTE: A successful return to this does *not* imply that the `msg` was executed + /// successfully to completion; only that *some* of it was executed. + #[pallet::call_index(3)] + #[pallet::weight(max_weight.saturating_add(T::WeightInfo::execute()))] + pub fn execute( + origin: OriginFor, + message: Box::RuntimeCall>>, + max_weight: Weight, + ) -> DispatchResultWithPostInfo { + let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?; + let hash = message.using_encoded(sp_io::hashing::blake2_256); + let message = (*message).try_into().map_err(|()| Error::::BadVersion)?; + let value = (origin_location, message); + ensure!(T::XcmExecuteFilter::contains(&value), Error::::Filtered); + let (origin_location, message) = value; + let outcome = T::XcmExecutor::execute_xcm_in_credit( + origin_location, + message, + hash, + max_weight, + max_weight, + ); + let result = + Ok(Some(outcome.weight_used().saturating_add(T::WeightInfo::execute())).into()); + Self::deposit_event(Event::Attempted { outcome }); + result + } + + /// Extoll that a particular destination can be communicated with through a particular + /// version of XCM. + /// + /// - `origin`: Must be an origin specified by AdminOrigin. + /// - `location`: The destination that is being described. + /// - `xcm_version`: The latest version of XCM that `location` supports. + #[pallet::call_index(4)] + #[pallet::weight(T::WeightInfo::force_xcm_version())] + pub fn force_xcm_version( + origin: OriginFor, + location: Box, + version: XcmVersion, + ) -> DispatchResult { + T::AdminOrigin::ensure_origin(origin)?; + let location = *location; + SupportedVersion::::insert( + XCM_VERSION, + LatestVersionedMultiLocation(&location), + version, + ); + Self::deposit_event(Event::SupportedVersionChanged { location, version }); + Ok(()) + } + + /// Set a safe XCM version (the version that XCM should be encoded with if the most recent + /// version a destination can accept is unknown). + /// + /// - `origin`: Must be an origin specified by AdminOrigin. + /// - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable. + #[pallet::call_index(5)] + #[pallet::weight(T::WeightInfo::force_default_xcm_version())] + pub fn force_default_xcm_version( + origin: OriginFor, + maybe_xcm_version: Option, + ) -> DispatchResult { + T::AdminOrigin::ensure_origin(origin)?; + SafeXcmVersion::::set(maybe_xcm_version); + Ok(()) + } + + /// Ask a location to notify us regarding their XCM version and any changes to it. + /// + /// - `origin`: Must be an origin specified by AdminOrigin. + /// - `location`: The location to which we should subscribe for XCM version notifications. + #[pallet::call_index(6)] + #[pallet::weight(T::WeightInfo::force_subscribe_version_notify())] + pub fn force_subscribe_version_notify( + origin: OriginFor, + location: Box, + ) -> DispatchResult { + T::AdminOrigin::ensure_origin(origin)?; + let location: MultiLocation = + (*location).try_into().map_err(|()| Error::::BadLocation)?; + Self::request_version_notify(location).map_err(|e| { + match e { + XcmError::InvalidLocation => Error::::AlreadySubscribed, + _ => Error::::InvalidOrigin, + } + .into() + }) + } + + /// Require that a particular destination should no longer notify us regarding any XCM + /// version changes. + /// + /// - `origin`: Must be an origin specified by AdminOrigin. + /// - `location`: The location to which we are currently subscribed for XCM version + /// notifications which we no longer desire. + #[pallet::call_index(7)] + #[pallet::weight(T::WeightInfo::force_unsubscribe_version_notify())] + pub fn force_unsubscribe_version_notify( + origin: OriginFor, + location: Box, + ) -> DispatchResult { + T::AdminOrigin::ensure_origin(origin)?; + let location: MultiLocation = + (*location).try_into().map_err(|()| Error::::BadLocation)?; + Self::unrequest_version_notify(location).map_err(|e| { + match e { + XcmError::InvalidLocation => Error::::NoSubscription, + _ => Error::::InvalidOrigin, + } + .into() + }) + } + + /// Transfer some assets from the local chain to the sovereign account of a destination + /// chain and forward a notification XCM. + /// + /// Fee payment on the destination side is made from the asset in the `assets` vector of + /// index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight + /// is needed than `weight_limit`, then the operation will fail and the assets send may be + /// at risk. + /// + /// - `origin`: Must be capable of withdrawing the `assets` and executing XCM. + /// - `dest`: Destination context for the assets. Will typically be `X2(Parent, + /// Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send + /// from relay to parachain. + /// - `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will + /// generally be an `AccountId32` value. + /// - `assets`: The assets to be withdrawn. This should include the assets used to pay the + /// fee on the `dest` side. + /// - `fee_asset_item`: The index into `assets` of the item which should be used to pay + /// fees. + /// - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase. + #[pallet::call_index(8)] + #[pallet::weight({ + let maybe_assets: Result = (*assets.clone()).try_into(); + let maybe_dest: Result = (*dest.clone()).try_into(); + match (maybe_assets, maybe_dest) { + (Ok(assets), Ok(dest)) => { + use sp_std::vec; + let mut message = Xcm(vec![ + SetFeesMode { jit_withdraw: true }, + TransferReserveAsset { assets, dest, xcm: Xcm(vec![]) } + ]); + T::Weigher::weight(&mut message).map_or(Weight::MAX, |w| T::WeightInfo::reserve_transfer_assets().saturating_add(w)) + } + _ => Weight::MAX, + } + })] + pub fn limited_reserve_transfer_assets( + origin: OriginFor, + dest: Box, + beneficiary: Box, + assets: Box, + fee_asset_item: u32, + weight_limit: WeightLimit, + ) -> DispatchResult { + Self::do_reserve_transfer_assets( + origin, + dest, + beneficiary, + assets, + fee_asset_item, + Some(weight_limit), + ) + } + + /// Teleport some assets from the local chain to some destination chain. + /// + /// Fee payment on the destination side is made from the asset in the `assets` vector of + /// index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight + /// is needed than `weight_limit`, then the operation will fail and the assets send may be + /// at risk. + /// + /// - `origin`: Must be capable of withdrawing the `assets` and executing XCM. + /// - `dest`: Destination context for the assets. Will typically be `X2(Parent, + /// Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send + /// from relay to parachain. + /// - `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will + /// generally be an `AccountId32` value. + /// - `assets`: The assets to be withdrawn. The first item should be the currency used to to + /// pay the fee on the `dest` side. May not be empty. + /// - `fee_asset_item`: The index into `assets` of the item which should be used to pay + /// fees. + /// - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase. + #[pallet::call_index(9)] + #[pallet::weight({ + let maybe_assets: Result = (*assets.clone()).try_into(); + let maybe_dest: Result = (*dest.clone()).try_into(); + match (maybe_assets, maybe_dest) { + (Ok(assets), Ok(dest)) => { + use sp_std::vec; + let count = assets.len() as u32; + let mut message = Xcm(vec![ + WithdrawAsset(assets), + SetFeesMode { jit_withdraw: true }, + InitiateTeleport { assets: Wild(AllCounted(count)), dest, xcm: Xcm(vec![]) }, + ]); + T::Weigher::weight(&mut message).map_or(Weight::MAX, |w| T::WeightInfo::teleport_assets().saturating_add(w)) + } + _ => Weight::MAX, + } + })] + pub fn limited_teleport_assets( + origin: OriginFor, + dest: Box, + beneficiary: Box, + assets: Box, + fee_asset_item: u32, + weight_limit: WeightLimit, + ) -> DispatchResult { + Self::do_teleport_assets( + origin, + dest, + beneficiary, + assets, + fee_asset_item, + Some(weight_limit), + ) + } + + /// Set or unset the global suspension state of the XCM executor. + /// + /// - `origin`: Must be an origin specified by AdminOrigin. + /// - `suspended`: `true` to suspend, `false` to resume. + #[pallet::call_index(10)] + #[pallet::weight(T::WeightInfo::force_suspension())] + pub fn force_suspension(origin: OriginFor, suspended: bool) -> DispatchResult { + T::AdminOrigin::ensure_origin(origin)?; + XcmExecutionSuspended::::set(suspended); + Ok(()) + } + } +} + +/// The maximum number of distinct assets allowed to be transferred in a single helper extrinsic. +const MAX_ASSETS_FOR_TRANSFER: usize = 2; + +impl QueryHandler for Pallet { + type QueryId = u64; + type BlockNumber = BlockNumberFor; + type Error = XcmError; + type UniversalLocation = T::UniversalLocation; + + /// Attempt to create a new query ID and register it as a query that is yet to respond. + fn new_query( + responder: impl Into, + timeout: BlockNumberFor, + match_querier: impl Into, + ) -> Self::QueryId { + Self::do_new_query(responder, None, timeout, match_querier).into() + } + + /// To check the status of the query, use `fn query()` passing the resultant `QueryId` + /// value. + fn report_outcome( + message: &mut Xcm<()>, + responder: impl Into, + timeout: Self::BlockNumber, + ) -> Result { + let responder = responder.into(); + let destination = Self::UniversalLocation::get() + .invert_target(&responder) + .map_err(|()| XcmError::LocationNotInvertible)?; + let query_id = Self::new_query(responder, timeout, Here); + let response_info = QueryResponseInfo { destination, query_id, max_weight: Weight::zero() }; + let report_error = Xcm(vec![ReportError(response_info)]); + message.0.insert(0, SetAppendix(report_error)); + Ok(query_id) + } + + /// Removes response when ready and emits [Event::ResponseTaken] event. + fn take_response(query_id: Self::QueryId) -> QueryResponseStatus { + match Queries::::get(query_id) { + Some(QueryStatus::Ready { response, at }) => match response.try_into() { + Ok(response) => { + Queries::::remove(query_id); + Self::deposit_event(Event::ResponseTaken { query_id }); + QueryResponseStatus::Ready { response, at } + }, + Err(_) => QueryResponseStatus::UnexpectedVersion, + }, + Some(QueryStatus::Pending { timeout, .. }) => QueryResponseStatus::Pending { timeout }, + Some(_) => QueryResponseStatus::UnexpectedVersion, + None => QueryResponseStatus::NotFound, + } + } + + #[cfg(feature = "runtime-benchmarks")] + fn expect_response(id: Self::QueryId, response: Response) { + let response = response.into(); + Queries::::insert( + id, + QueryStatus::Ready { response, at: frame_system::Pallet::::block_number() }, + ); + } +} + +impl Pallet { + fn do_reserve_transfer_assets( + origin: OriginFor, + dest: Box, + beneficiary: Box, + assets: Box, + fee_asset_item: u32, + maybe_weight_limit: Option, + ) -> DispatchResult { + let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?; + let dest = (*dest).try_into().map_err(|()| Error::::BadVersion)?; + let beneficiary: MultiLocation = + (*beneficiary).try_into().map_err(|()| Error::::BadVersion)?; + let assets: MultiAssets = (*assets).try_into().map_err(|()| Error::::BadVersion)?; + + ensure!(assets.len() <= MAX_ASSETS_FOR_TRANSFER, Error::::TooManyAssets); + let value = (origin_location, assets.into_inner()); + ensure!(T::XcmReserveTransferFilter::contains(&value), Error::::Filtered); + let (origin_location, assets) = value; + let context = T::UniversalLocation::get(); + let fees = assets + .get(fee_asset_item as usize) + .ok_or(Error::::Empty)? + .clone() + .reanchored(&dest, context) + .map_err(|_| Error::::CannotReanchor)?; + let max_assets = assets.len() as u32; + let assets: MultiAssets = assets.into(); + let weight_limit = match maybe_weight_limit { + Some(weight_limit) => weight_limit, + None => { + let fees = fees.clone(); + let mut remote_message = Xcm(vec![ + ReserveAssetDeposited(assets.clone()), + ClearOrigin, + BuyExecution { fees, weight_limit: Limited(Weight::zero()) }, + DepositAsset { assets: Wild(AllCounted(max_assets)), beneficiary }, + ]); + // use local weight for remote message and hope for the best. + let remote_weight = T::Weigher::weight(&mut remote_message) + .map_err(|()| Error::::UnweighableMessage)?; + Limited(remote_weight) + }, + }; + let xcm = Xcm(vec![ + BuyExecution { fees, weight_limit }, + DepositAsset { assets: Wild(AllCounted(max_assets)), beneficiary }, + ]); + let mut message = Xcm(vec![ + SetFeesMode { jit_withdraw: true }, + TransferReserveAsset { assets, dest, xcm }, + ]); + let weight = + T::Weigher::weight(&mut message).map_err(|()| Error::::UnweighableMessage)?; + let hash = message.using_encoded(sp_io::hashing::blake2_256); + let outcome = + T::XcmExecutor::execute_xcm_in_credit(origin_location, message, hash, weight, weight); + Self::deposit_event(Event::Attempted { outcome }); + Ok(()) + } + + fn do_teleport_assets( + origin: OriginFor, + dest: Box, + beneficiary: Box, + assets: Box, + fee_asset_item: u32, + maybe_weight_limit: Option, + ) -> DispatchResult { + let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?; + let dest = (*dest).try_into().map_err(|()| Error::::BadVersion)?; + let beneficiary: MultiLocation = + (*beneficiary).try_into().map_err(|()| Error::::BadVersion)?; + let assets: MultiAssets = (*assets).try_into().map_err(|()| Error::::BadVersion)?; + + ensure!(assets.len() <= MAX_ASSETS_FOR_TRANSFER, Error::::TooManyAssets); + let value = (origin_location, assets.into_inner()); + ensure!(T::XcmTeleportFilter::contains(&value), Error::::Filtered); + let (origin_location, assets) = value; + let context = T::UniversalLocation::get(); + let fees = assets + .get(fee_asset_item as usize) + .ok_or(Error::::Empty)? + .clone() + .reanchored(&dest, context) + .map_err(|_| Error::::CannotReanchor)?; + let max_assets = assets.len() as u32; + let assets: MultiAssets = assets.into(); + let weight_limit = match maybe_weight_limit { + Some(weight_limit) => weight_limit, + None => { + let fees = fees.clone(); + let mut remote_message = Xcm(vec![ + ReceiveTeleportedAsset(assets.clone()), + ClearOrigin, + BuyExecution { fees, weight_limit: Limited(Weight::zero()) }, + DepositAsset { assets: Wild(AllCounted(max_assets)), beneficiary }, + ]); + // use local weight for remote message and hope for the best. + let remote_weight = T::Weigher::weight(&mut remote_message) + .map_err(|()| Error::::UnweighableMessage)?; + Limited(remote_weight) + }, + }; + let xcm = Xcm(vec![ + BuyExecution { fees, weight_limit }, + DepositAsset { assets: Wild(AllCounted(max_assets)), beneficiary }, + ]); + let mut message = Xcm(vec![ + WithdrawAsset(assets), + SetFeesMode { jit_withdraw: true }, + InitiateTeleport { assets: Wild(AllCounted(max_assets)), dest, xcm }, + ]); + let weight = + T::Weigher::weight(&mut message).map_err(|()| Error::::UnweighableMessage)?; + let hash = message.using_encoded(sp_io::hashing::blake2_256); + let outcome = + T::XcmExecutor::execute_xcm_in_credit(origin_location, message, hash, weight, weight); + Self::deposit_event(Event::Attempted { outcome }); + Ok(()) + } + + /// Will always make progress, and will do its best not to use much more than `weight_cutoff` + /// in doing so. + pub(crate) fn check_xcm_version_change( + mut stage: VersionMigrationStage, + weight_cutoff: Weight, + ) -> (Weight, Option) { + let mut weight_used = Weight::zero(); + + let sv_migrate_weight = T::WeightInfo::migrate_supported_version(); + let vn_migrate_weight = T::WeightInfo::migrate_version_notifiers(); + let vnt_already_notified_weight = T::WeightInfo::already_notified_target(); + let vnt_notify_weight = T::WeightInfo::notify_current_targets(); + let vnt_migrate_weight = T::WeightInfo::migrate_version_notify_targets(); + let vnt_migrate_fail_weight = T::WeightInfo::notify_target_migration_fail(); + let vnt_notify_migrate_weight = T::WeightInfo::migrate_and_notify_old_targets(); + + use VersionMigrationStage::*; + + if stage == MigrateSupportedVersion { + // We assume that supported XCM version only ever increases, so just cycle through lower + // XCM versioned from the current. + for v in 0..XCM_VERSION { + for (old_key, value) in SupportedVersion::::drain_prefix(v) { + if let Ok(new_key) = old_key.into_latest() { + SupportedVersion::::insert(XCM_VERSION, new_key, value); + } + weight_used.saturating_accrue(sv_migrate_weight); + if weight_used.any_gte(weight_cutoff) { + return (weight_used, Some(stage)) + } + } + } + stage = MigrateVersionNotifiers; + } + if stage == MigrateVersionNotifiers { + for v in 0..XCM_VERSION { + for (old_key, value) in VersionNotifiers::::drain_prefix(v) { + if let Ok(new_key) = old_key.into_latest() { + VersionNotifiers::::insert(XCM_VERSION, new_key, value); + } + weight_used.saturating_accrue(vn_migrate_weight); + if weight_used.any_gte(weight_cutoff) { + return (weight_used, Some(stage)) + } + } + } + stage = NotifyCurrentTargets(None); + } + + let xcm_version = T::AdvertisedXcmVersion::get(); + + if let NotifyCurrentTargets(maybe_last_raw_key) = stage { + let mut iter = match maybe_last_raw_key { + Some(k) => VersionNotifyTargets::::iter_prefix_from(XCM_VERSION, k), + None => VersionNotifyTargets::::iter_prefix(XCM_VERSION), + }; + while let Some((key, value)) = iter.next() { + let (query_id, max_weight, target_xcm_version) = value; + let new_key: MultiLocation = match key.clone().try_into() { + Ok(k) if target_xcm_version != xcm_version => k, + _ => { + // We don't early return here since we need to be certain that we + // make some progress. + weight_used.saturating_accrue(vnt_already_notified_weight); + continue + }, + }; + let response = Response::Version(xcm_version); + let message = + Xcm(vec![QueryResponse { query_id, response, max_weight, querier: None }]); + let event = match send_xcm::(new_key, message) { + Ok((message_id, cost)) => { + let value = (query_id, max_weight, xcm_version); + VersionNotifyTargets::::insert(XCM_VERSION, key, value); + Event::VersionChangeNotified { + destination: new_key, + result: xcm_version, + cost, + message_id, + } + }, + Err(e) => { + VersionNotifyTargets::::remove(XCM_VERSION, key); + Event::NotifyTargetSendFail { location: new_key, query_id, error: e.into() } + }, + }; + Self::deposit_event(event); + weight_used.saturating_accrue(vnt_notify_weight); + if weight_used.any_gte(weight_cutoff) { + let last = Some(iter.last_raw_key().into()); + return (weight_used, Some(NotifyCurrentTargets(last))) + } + } + stage = MigrateAndNotifyOldTargets; + } + if stage == MigrateAndNotifyOldTargets { + for v in 0..XCM_VERSION { + for (old_key, value) in VersionNotifyTargets::::drain_prefix(v) { + let (query_id, max_weight, target_xcm_version) = value; + let new_key = match MultiLocation::try_from(old_key.clone()) { + Ok(k) => k, + Err(()) => { + Self::deposit_event(Event::NotifyTargetMigrationFail { + location: old_key, + query_id: value.0, + }); + weight_used.saturating_accrue(vnt_migrate_fail_weight); + if weight_used.any_gte(weight_cutoff) { + return (weight_used, Some(stage)) + } + continue + }, + }; + + let versioned_key = LatestVersionedMultiLocation(&new_key); + if target_xcm_version == xcm_version { + VersionNotifyTargets::::insert(XCM_VERSION, versioned_key, value); + weight_used.saturating_accrue(vnt_migrate_weight); + } else { + // Need to notify target. + let response = Response::Version(xcm_version); + let message = Xcm(vec![QueryResponse { + query_id, + response, + max_weight, + querier: None, + }]); + let event = match send_xcm::(new_key, message) { + Ok((message_id, cost)) => { + VersionNotifyTargets::::insert( + XCM_VERSION, + versioned_key, + (query_id, max_weight, xcm_version), + ); + Event::VersionChangeNotified { + destination: new_key, + result: xcm_version, + cost, + message_id, + } + }, + Err(e) => Event::NotifyTargetSendFail { + location: new_key, + query_id, + error: e.into(), + }, + }; + Self::deposit_event(event); + weight_used.saturating_accrue(vnt_notify_migrate_weight); + } + if weight_used.any_gte(weight_cutoff) { + return (weight_used, Some(stage)) + } + } + } + } + (weight_used, None) + } + + /// Request that `dest` informs us of its version. + pub fn request_version_notify(dest: impl Into) -> XcmResult { + let dest = dest.into(); + let versioned_dest = VersionedMultiLocation::from(dest); + let already = VersionNotifiers::::contains_key(XCM_VERSION, &versioned_dest); + ensure!(!already, XcmError::InvalidLocation); + let query_id = QueryCounter::::mutate(|q| { + let r = *q; + q.saturating_inc(); + r + }); + // TODO #3735: Correct weight. + let instruction = SubscribeVersion { query_id, max_response_weight: Weight::zero() }; + let (message_id, cost) = send_xcm::(dest, Xcm(vec![instruction]))?; + Self::deposit_event(Event::VersionNotifyRequested { destination: dest, cost, message_id }); + VersionNotifiers::::insert(XCM_VERSION, &versioned_dest, query_id); + let query_status = + QueryStatus::VersionNotifier { origin: versioned_dest, is_active: false }; + Queries::::insert(query_id, query_status); + Ok(()) + } + + /// Request that `dest` ceases informing us of its version. + pub fn unrequest_version_notify(dest: impl Into) -> XcmResult { + let dest = dest.into(); + let versioned_dest = LatestVersionedMultiLocation(&dest); + let query_id = VersionNotifiers::::take(XCM_VERSION, versioned_dest) + .ok_or(XcmError::InvalidLocation)?; + let (message_id, cost) = send_xcm::(dest, Xcm(vec![UnsubscribeVersion]))?; + Self::deposit_event(Event::VersionNotifyUnrequested { + destination: dest, + cost, + message_id, + }); + Queries::::remove(query_id); + Ok(()) + } + + /// Relay an XCM `message` from a given `interior` location in this context to a given `dest` + /// location. The `fee_payer` is charged for the delivery unless `None` in which case fees + /// are not charged (and instead borne by the chain). + pub fn send_xcm( + interior: impl Into, + dest: impl Into, + mut message: Xcm<()>, + ) -> Result { + let interior = interior.into(); + let dest = dest.into(); + let maybe_fee_payer = if interior != Junctions::Here { + message.0.insert(0, DescendOrigin(interior)); + Some(interior.into()) + } else { + None + }; + log::debug!(target: "xcm::send_xcm", "dest: {:?}, message: {:?}", &dest, &message); + let (ticket, price) = validate_send::(dest, message)?; + if let Some(fee_payer) = maybe_fee_payer { + Self::charge_fees(fee_payer, price).map_err(|_| SendError::Fees)?; + } + T::XcmRouter::deliver(ticket) + } + + pub fn check_account() -> T::AccountId { + const ID: PalletId = PalletId(*b"py/xcmch"); + AccountIdConversion::::into_account_truncating(&ID) + } + + /// Create a new expectation of a query response with the querier being here. + fn do_new_query( + responder: impl Into, + maybe_notify: Option<(u8, u8)>, + timeout: BlockNumberFor, + match_querier: impl Into, + ) -> u64 { + QueryCounter::::mutate(|q| { + let r = *q; + q.saturating_inc(); + Queries::::insert( + r, + QueryStatus::Pending { + responder: responder.into().into(), + maybe_match_querier: Some(match_querier.into().into()), + maybe_notify, + timeout, + }, + ); + r + }) + } + + /// Consume `message` and return another which is equivalent to it except that it reports + /// back the outcome and dispatches `notify` on this chain. + /// + /// - `message`: The message whose outcome should be reported. + /// - `responder`: The origin from which a response should be expected. + /// - `notify`: A dispatchable function which will be called once the outcome of `message` is + /// known. It may be a dispatchable in any pallet of the local chain, but other than the usual + /// origin, it must accept exactly two arguments: `query_id: QueryId` and `outcome: Response`, + /// and in that order. It should expect that the origin is `Origin::Response` and will contain + /// the responder's location. + /// - `timeout`: The block number after which it is permissible for `notify` not to be called + /// even if a response is received. + /// + /// `report_outcome_notify` may return an error if the `responder` is not invertible. + /// + /// It is assumed that the querier of the response will be `Here`. + /// + /// NOTE: `notify` gets called as part of handling an incoming message, so it should be + /// lightweight. Its weight is estimated during this function and stored ready for + /// weighing `ReportOutcome` on the way back. If it turns out to be heavier once it returns + /// then reporting the outcome will fail. Futhermore if the estimate is too high, then it + /// may be put in the overweight queue and need to be manually executed. + pub fn report_outcome_notify( + message: &mut Xcm<()>, + responder: impl Into, + notify: impl Into<::RuntimeCall>, + timeout: BlockNumberFor, + ) -> Result<(), XcmError> { + let responder = responder.into(); + let destination = T::UniversalLocation::get() + .invert_target(&responder) + .map_err(|()| XcmError::LocationNotInvertible)?; + let notify: ::RuntimeCall = notify.into(); + let max_weight = notify.get_dispatch_info().weight; + let query_id = Self::new_notify_query(responder, notify, timeout, Here); + let response_info = QueryResponseInfo { destination, query_id, max_weight }; + let report_error = Xcm(vec![ReportError(response_info)]); + message.0.insert(0, SetAppendix(report_error)); + Ok(()) + } + + /// Attempt to create a new query ID and register it as a query that is yet to respond, and + /// which will call a dispatchable when a response happens. + pub fn new_notify_query( + responder: impl Into, + notify: impl Into<::RuntimeCall>, + timeout: BlockNumberFor, + match_querier: impl Into, + ) -> u64 { + let notify = notify.into().using_encoded(|mut bytes| Decode::decode(&mut bytes)).expect( + "decode input is output of Call encode; Call guaranteed to have two enums; qed", + ); + Self::do_new_query(responder, Some(notify), timeout, match_querier) + } + + /// Note that a particular destination to whom we would like to send a message is unknown + /// and queue it for version discovery. + fn note_unknown_version(dest: &MultiLocation) { + log::trace!( + target: "xcm::pallet_xcm::note_unknown_version", + "XCM version is unknown for destination: {:?}", + dest, + ); + let versioned_dest = VersionedMultiLocation::from(*dest); + VersionDiscoveryQueue::::mutate(|q| { + if let Some(index) = q.iter().position(|i| &i.0 == &versioned_dest) { + // exists - just bump the count. + q[index].1.saturating_inc(); + } else { + let _ = q.try_push((versioned_dest, 1)); + } + }); + } + + /// Withdraw given `assets` from the given `location` and pay as XCM fees. + /// + /// Fails if: + /// - the `assets` are not known on this chain; + /// - the `assets` cannot be withdrawn with that location as the Origin. + fn charge_fees(location: MultiLocation, assets: MultiAssets) -> DispatchResult { + T::XcmExecutor::charge_fees(location, assets.clone()) + .map_err(|_| Error::::FeesNotMet)?; + Self::deposit_event(Event::FeesPaid { paying: location, fees: assets }); + Ok(()) + } +} + +pub struct LockTicket { + sovereign_account: T::AccountId, + amount: BalanceOf, + unlocker: MultiLocation, + item_index: Option, +} + +impl xcm_executor::traits::Enact for LockTicket { + fn enact(self) -> Result<(), xcm_executor::traits::LockError> { + use xcm_executor::traits::LockError::UnexpectedState; + let mut locks = LockedFungibles::::get(&self.sovereign_account).unwrap_or_default(); + match self.item_index { + Some(index) => { + ensure!(locks.len() > index, UnexpectedState); + ensure!(locks[index].1.try_as::<_>() == Ok(&self.unlocker), UnexpectedState); + locks[index].0 = locks[index].0.max(self.amount); + }, + None => { + locks + .try_push((self.amount, self.unlocker.into())) + .map_err(|(_balance, _location)| UnexpectedState)?; + }, + } + LockedFungibles::::insert(&self.sovereign_account, locks); + T::Currency::extend_lock( + *b"py/xcmlk", + &self.sovereign_account, + self.amount, + WithdrawReasons::all(), + ); + Ok(()) + } +} + +pub struct UnlockTicket { + sovereign_account: T::AccountId, + amount: BalanceOf, + unlocker: MultiLocation, +} + +impl xcm_executor::traits::Enact for UnlockTicket { + fn enact(self) -> Result<(), xcm_executor::traits::LockError> { + use xcm_executor::traits::LockError::UnexpectedState; + let mut locks = + LockedFungibles::::get(&self.sovereign_account).ok_or(UnexpectedState)?; + let mut maybe_remove_index = None; + let mut locked = BalanceOf::::zero(); + let mut found = false; + // We could just as well do with with an into_iter, filter_map and collect, however this way + // avoids making an allocation. + for (i, x) in locks.iter_mut().enumerate() { + if x.1.try_as::<_>().defensive() == Ok(&self.unlocker) { + x.0 = x.0.saturating_sub(self.amount); + if x.0.is_zero() { + maybe_remove_index = Some(i); + } + found = true; + } + locked = locked.max(x.0); + } + ensure!(found, UnexpectedState); + if let Some(remove_index) = maybe_remove_index { + locks.swap_remove(remove_index); + } + LockedFungibles::::insert(&self.sovereign_account, locks); + let reasons = WithdrawReasons::all(); + T::Currency::set_lock(*b"py/xcmlk", &self.sovereign_account, locked, reasons); + Ok(()) + } +} + +pub struct ReduceTicket { + key: (u32, T::AccountId, VersionedAssetId), + amount: u128, + locker: VersionedMultiLocation, + owner: VersionedMultiLocation, +} + +impl xcm_executor::traits::Enact for ReduceTicket { + fn enact(self) -> Result<(), xcm_executor::traits::LockError> { + use xcm_executor::traits::LockError::UnexpectedState; + let mut record = RemoteLockedFungibles::::get(&self.key).ok_or(UnexpectedState)?; + ensure!(self.locker == record.locker && self.owner == record.owner, UnexpectedState); + let new_amount = record.amount.checked_sub(self.amount).ok_or(UnexpectedState)?; + ensure!(record.amount_held().map_or(true, |h| new_amount >= h), UnexpectedState); + if new_amount == 0 { + RemoteLockedFungibles::::remove(&self.key); + } else { + record.amount = new_amount; + RemoteLockedFungibles::::insert(&self.key, &record); + } + Ok(()) + } +} + +impl xcm_executor::traits::AssetLock for Pallet { + type LockTicket = LockTicket; + type UnlockTicket = UnlockTicket; + type ReduceTicket = ReduceTicket; + + fn prepare_lock( + unlocker: MultiLocation, + asset: MultiAsset, + owner: MultiLocation, + ) -> Result, xcm_executor::traits::LockError> { + use xcm_executor::traits::LockError::*; + let sovereign_account = T::SovereignAccountOf::convert_location(&owner).ok_or(BadOwner)?; + let amount = T::CurrencyMatcher::matches_fungible(&asset).ok_or(UnknownAsset)?; + ensure!(T::Currency::free_balance(&sovereign_account) >= amount, AssetNotOwned); + let locks = LockedFungibles::::get(&sovereign_account).unwrap_or_default(); + let item_index = locks.iter().position(|x| x.1.try_as::<_>() == Ok(&unlocker)); + ensure!(item_index.is_some() || locks.len() < T::MaxLockers::get() as usize, NoResources); + Ok(LockTicket { sovereign_account, amount, unlocker, item_index }) + } + + fn prepare_unlock( + unlocker: MultiLocation, + asset: MultiAsset, + owner: MultiLocation, + ) -> Result, xcm_executor::traits::LockError> { + use xcm_executor::traits::LockError::*; + let sovereign_account = T::SovereignAccountOf::convert_location(&owner).ok_or(BadOwner)?; + let amount = T::CurrencyMatcher::matches_fungible(&asset).ok_or(UnknownAsset)?; + ensure!(T::Currency::free_balance(&sovereign_account) >= amount, AssetNotOwned); + let locks = LockedFungibles::::get(&sovereign_account).unwrap_or_default(); + let item_index = + locks.iter().position(|x| x.1.try_as::<_>() == Ok(&unlocker)).ok_or(NotLocked)?; + ensure!(locks[item_index].0 >= amount, NotLocked); + Ok(UnlockTicket { sovereign_account, amount, unlocker }) + } + + fn note_unlockable( + locker: MultiLocation, + asset: MultiAsset, + mut owner: MultiLocation, + ) -> Result<(), xcm_executor::traits::LockError> { + use xcm_executor::traits::LockError::*; + ensure!(T::TrustedLockers::contains(&locker, &asset), NotTrusted); + let amount = match asset.fun { + Fungible(a) => a, + NonFungible(_) => return Err(Unimplemented), + }; + owner.remove_network_id(); + let account = T::SovereignAccountOf::convert_location(&owner).ok_or(BadOwner)?; + let locker = locker.into(); + let owner = owner.into(); + let id: VersionedAssetId = asset.id.into(); + let key = (XCM_VERSION, account, id); + let mut record = + RemoteLockedFungibleRecord { amount, owner, locker, consumers: BoundedVec::default() }; + if let Some(old) = RemoteLockedFungibles::::get(&key) { + // Make sure that the new record wouldn't clobber any old data. + ensure!(old.locker == record.locker && old.owner == record.owner, WouldClobber); + record.consumers = old.consumers; + record.amount = record.amount.max(old.amount); + } + RemoteLockedFungibles::::insert(&key, record); + Ok(()) + } + + fn prepare_reduce_unlockable( + locker: MultiLocation, + asset: MultiAsset, + mut owner: MultiLocation, + ) -> Result { + use xcm_executor::traits::LockError::*; + let amount = match asset.fun { + Fungible(a) => a, + NonFungible(_) => return Err(Unimplemented), + }; + owner.remove_network_id(); + let sovereign_account = T::SovereignAccountOf::convert_location(&owner).ok_or(BadOwner)?; + let locker = locker.into(); + let owner = owner.into(); + let id: VersionedAssetId = asset.id.into(); + let key = (XCM_VERSION, sovereign_account, id); + + let record = RemoteLockedFungibles::::get(&key).ok_or(NotLocked)?; + // Make sure that the record contains what we expect and there's enough to unlock. + ensure!(locker == record.locker && owner == record.owner, WouldClobber); + ensure!(record.amount >= amount, NotEnoughLocked); + ensure!( + record.amount_held().map_or(true, |h| record.amount.saturating_sub(amount) >= h), + InUse + ); + Ok(ReduceTicket { key, amount, locker, owner }) + } +} + +impl WrapVersion for Pallet { + fn wrap_version( + dest: &MultiLocation, + xcm: impl Into>, + ) -> Result, ()> { + SupportedVersion::::get(XCM_VERSION, LatestVersionedMultiLocation(dest)) + .or_else(|| { + Self::note_unknown_version(dest); + SafeXcmVersion::::get() + }) + .ok_or_else(|| { + log::trace!( + target: "xcm::pallet_xcm::wrap_version", + "Could not determine a version to wrap XCM for destination: {:?}", + dest, + ); + () + }) + .and_then(|v| xcm.into().into_version(v.min(XCM_VERSION))) + } +} + +impl VersionChangeNotifier for Pallet { + /// Start notifying `location` should the XCM version of this chain change. + /// + /// When it does, this type should ensure a `QueryResponse` message is sent with the given + /// `query_id` & `max_weight` and with a `response` of `Response::Version`. This should happen + /// until/unless `stop` is called with the correct `query_id`. + /// + /// If the `location` has an ongoing notification and when this function is called, then an + /// error should be returned. + fn start( + dest: &MultiLocation, + query_id: QueryId, + max_weight: Weight, + _context: &XcmContext, + ) -> XcmResult { + let versioned_dest = LatestVersionedMultiLocation(dest); + let already = VersionNotifyTargets::::contains_key(XCM_VERSION, versioned_dest); + ensure!(!already, XcmError::InvalidLocation); + + let xcm_version = T::AdvertisedXcmVersion::get(); + let response = Response::Version(xcm_version); + let instruction = QueryResponse { query_id, response, max_weight, querier: None }; + let (message_id, cost) = send_xcm::(*dest, Xcm(vec![instruction]))?; + Self::deposit_event(Event::::VersionNotifyStarted { + destination: *dest, + cost, + message_id, + }); + + let value = (query_id, max_weight, xcm_version); + VersionNotifyTargets::::insert(XCM_VERSION, versioned_dest, value); + Ok(()) + } + + /// Stop notifying `location` should the XCM change. This is a no-op if there was never a + /// subscription. + fn stop(dest: &MultiLocation, _context: &XcmContext) -> XcmResult { + VersionNotifyTargets::::remove(XCM_VERSION, LatestVersionedMultiLocation(dest)); + Ok(()) + } + + /// Return true if a location is subscribed to XCM version changes. + fn is_subscribed(dest: &MultiLocation) -> bool { + let versioned_dest = LatestVersionedMultiLocation(dest); + VersionNotifyTargets::::contains_key(XCM_VERSION, versioned_dest) + } +} + +impl DropAssets for Pallet { + fn drop_assets(origin: &MultiLocation, assets: Assets, _context: &XcmContext) -> Weight { + if assets.is_empty() { + return Weight::zero() + } + let versioned = VersionedMultiAssets::from(MultiAssets::from(assets)); + let hash = BlakeTwo256::hash_of(&(&origin, &versioned)); + AssetTraps::::mutate(hash, |n| *n += 1); + Self::deposit_event(Event::AssetsTrapped { hash, origin: *origin, assets: versioned }); + // TODO #3735: Put the real weight in there. + Weight::zero() + } +} + +impl ClaimAssets for Pallet { + fn claim_assets( + origin: &MultiLocation, + ticket: &MultiLocation, + assets: &MultiAssets, + _context: &XcmContext, + ) -> bool { + let mut versioned = VersionedMultiAssets::from(assets.clone()); + match (ticket.parents, &ticket.interior) { + (0, X1(GeneralIndex(i))) => + versioned = match versioned.into_version(*i as u32) { + Ok(v) => v, + Err(()) => return false, + }, + (0, Here) => (), + _ => return false, + }; + let hash = BlakeTwo256::hash_of(&(origin, versioned.clone())); + match AssetTraps::::get(hash) { + 0 => return false, + 1 => AssetTraps::::remove(hash), + n => AssetTraps::::insert(hash, n - 1), + } + Self::deposit_event(Event::AssetsClaimed { hash, origin: *origin, assets: versioned }); + return true + } +} + +impl OnResponse for Pallet { + fn expecting_response( + origin: &MultiLocation, + query_id: QueryId, + querier: Option<&MultiLocation>, + ) -> bool { + match Queries::::get(query_id) { + Some(QueryStatus::Pending { responder, maybe_match_querier, .. }) => + MultiLocation::try_from(responder).map_or(false, |r| origin == &r) && + maybe_match_querier.map_or(true, |match_querier| { + MultiLocation::try_from(match_querier).map_or(false, |match_querier| { + querier.map_or(false, |q| q == &match_querier) + }) + }), + Some(QueryStatus::VersionNotifier { origin: r, .. }) => + MultiLocation::try_from(r).map_or(false, |r| origin == &r), + _ => false, + } + } + + fn on_response( + origin: &MultiLocation, + query_id: QueryId, + querier: Option<&MultiLocation>, + response: Response, + max_weight: Weight, + _context: &XcmContext, + ) -> Weight { + let origin = *origin; + match (response, Queries::::get(query_id)) { + ( + Response::Version(v), + Some(QueryStatus::VersionNotifier { origin: expected_origin, is_active }), + ) => { + let origin: MultiLocation = match expected_origin.try_into() { + Ok(o) if o == origin => o, + Ok(o) => { + Self::deposit_event(Event::InvalidResponder { + origin, + query_id, + expected_location: Some(o), + }); + return Weight::zero() + }, + _ => { + Self::deposit_event(Event::InvalidResponder { + origin, + query_id, + expected_location: None, + }); + // TODO #3735: Correct weight for this. + return Weight::zero() + }, + }; + // TODO #3735: Check max_weight is correct. + if !is_active { + Queries::::insert( + query_id, + QueryStatus::VersionNotifier { origin: origin.into(), is_active: true }, + ); + } + // We're being notified of a version change. + SupportedVersion::::insert( + XCM_VERSION, + LatestVersionedMultiLocation(&origin), + v, + ); + Self::deposit_event(Event::SupportedVersionChanged { + location: origin, + version: v, + }); + Weight::zero() + }, + ( + response, + Some(QueryStatus::Pending { responder, maybe_notify, maybe_match_querier, .. }), + ) => { + if let Some(match_querier) = maybe_match_querier { + let match_querier = match MultiLocation::try_from(match_querier) { + Ok(mq) => mq, + Err(_) => { + Self::deposit_event(Event::InvalidQuerierVersion { origin, query_id }); + return Weight::zero() + }, + }; + if querier.map_or(true, |q| q != &match_querier) { + Self::deposit_event(Event::InvalidQuerier { + origin, + query_id, + expected_querier: match_querier, + maybe_actual_querier: querier.cloned(), + }); + return Weight::zero() + } + } + let responder = match MultiLocation::try_from(responder) { + Ok(r) => r, + Err(_) => { + Self::deposit_event(Event::InvalidResponderVersion { origin, query_id }); + return Weight::zero() + }, + }; + if origin != responder { + Self::deposit_event(Event::InvalidResponder { + origin, + query_id, + expected_location: Some(responder), + }); + return Weight::zero() + } + return match maybe_notify { + Some((pallet_index, call_index)) => { + // This is a bit horrible, but we happen to know that the `Call` will + // be built by `(pallet_index: u8, call_index: u8, QueryId, Response)`. + // So we just encode that and then re-encode to a real Call. + let bare = (pallet_index, call_index, query_id, response); + if let Ok(call) = bare.using_encoded(|mut bytes| { + ::RuntimeCall::decode(&mut bytes) + }) { + Queries::::remove(query_id); + let weight = call.get_dispatch_info().weight; + if weight.any_gt(max_weight) { + let e = Event::NotifyOverweight { + query_id, + pallet_index, + call_index, + actual_weight: weight, + max_budgeted_weight: max_weight, + }; + Self::deposit_event(e); + return Weight::zero() + } + let dispatch_origin = Origin::Response(origin).into(); + match call.dispatch(dispatch_origin) { + Ok(post_info) => { + let e = Event::Notified { query_id, pallet_index, call_index }; + Self::deposit_event(e); + post_info.actual_weight + }, + Err(error_and_info) => { + let e = Event::NotifyDispatchError { + query_id, + pallet_index, + call_index, + }; + Self::deposit_event(e); + // Not much to do with the result as it is. It's up to the + // parachain to ensure that the message makes sense. + error_and_info.post_info.actual_weight + }, + } + .unwrap_or(weight) + } else { + let e = + Event::NotifyDecodeFailed { query_id, pallet_index, call_index }; + Self::deposit_event(e); + Weight::zero() + } + }, + None => { + let e = Event::ResponseReady { query_id, response: response.clone() }; + Self::deposit_event(e); + let at = frame_system::Pallet::::current_block_number(); + let response = response.into(); + Queries::::insert(query_id, QueryStatus::Ready { response, at }); + Weight::zero() + }, + } + }, + _ => { + let e = Event::UnexpectedResponse { origin, query_id }; + Self::deposit_event(e); + Weight::zero() + }, + } + } +} + +impl CheckSuspension for Pallet { + fn is_suspended( + _origin: &MultiLocation, + _instructions: &mut [Instruction], + _max_weight: Weight, + _properties: &mut Properties, + ) -> bool { + XcmExecutionSuspended::::get() + } +} + +/// Ensure that the origin `o` represents an XCM (`Transact`) origin. +/// +/// Returns `Ok` with the location of the XCM sender or an `Err` otherwise. +pub fn ensure_xcm(o: OuterOrigin) -> Result +where + OuterOrigin: Into>, +{ + match o.into() { + Ok(Origin::Xcm(location)) => Ok(location), + _ => Err(BadOrigin), + } +} + +/// Ensure that the origin `o` represents an XCM response origin. +/// +/// Returns `Ok` with the location of the responder or an `Err` otherwise. +pub fn ensure_response(o: OuterOrigin) -> Result +where + OuterOrigin: Into>, +{ + match o.into() { + Ok(Origin::Response(location)) => Ok(location), + _ => Err(BadOrigin), + } +} + +/// Filter for `MultiLocation` to find those which represent a strict majority approval of an +/// identified plurality. +/// +/// May reasonably be used with `EnsureXcm`. +pub struct IsMajorityOfBody(PhantomData<(Prefix, Body)>); +impl, Body: Get> Contains + for IsMajorityOfBody +{ + fn contains(l: &MultiLocation) -> bool { + let maybe_suffix = l.match_and_split(&Prefix::get()); + matches!(maybe_suffix, Some(Plurality { id, part }) if id == &Body::get() && part.is_majority()) + } +} + +/// Filter for `MultiLocation` to find those which represent a voice of an identified plurality. +/// +/// May reasonably be used with `EnsureXcm`. +pub struct IsVoiceOfBody(PhantomData<(Prefix, Body)>); +impl, Body: Get> Contains + for IsVoiceOfBody +{ + fn contains(l: &MultiLocation) -> bool { + let maybe_suffix = l.match_and_split(&Prefix::get()); + matches!(maybe_suffix, Some(Plurality { id, part }) if id == &Body::get() && part == &BodyPart::Voice) + } +} + +/// `EnsureOrigin` implementation succeeding with a `MultiLocation` value to recognize and filter +/// the `Origin::Xcm` item. +pub struct EnsureXcm(PhantomData); +impl, F: Contains> EnsureOrigin for EnsureXcm +where + O::PalletsOrigin: From + TryInto, +{ + type Success = MultiLocation; + + fn try_origin(outer: O) -> Result { + outer.try_with_caller(|caller| { + caller.try_into().and_then(|o| match o { + Origin::Xcm(location) if F::contains(&location) => Ok(location), + Origin::Xcm(location) => Err(Origin::Xcm(location).into()), + o => Err(o.into()), + }) + }) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + Ok(O::from(Origin::Xcm(Here.into()))) + } +} + +/// `EnsureOrigin` implementation succeeding with a `MultiLocation` value to recognize and filter +/// the `Origin::Response` item. +pub struct EnsureResponse(PhantomData); +impl, F: Contains> EnsureOrigin + for EnsureResponse +where + O::PalletsOrigin: From + TryInto, +{ + type Success = MultiLocation; + + fn try_origin(outer: O) -> Result { + outer.try_with_caller(|caller| { + caller.try_into().and_then(|o| match o { + Origin::Response(responder) => Ok(responder), + o => Err(o.into()), + }) + }) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + Ok(O::from(Origin::Response(Here.into()))) + } +} + +/// A simple passthrough where we reuse the `MultiLocation`-typed XCM origin as the inner value of +/// this crate's `Origin::Xcm` value. +pub struct XcmPassthrough(PhantomData); +impl> ConvertOrigin + for XcmPassthrough +{ + fn convert_origin( + origin: impl Into, + kind: OriginKind, + ) -> Result { + let origin = origin.into(); + match kind { + OriginKind::Xcm => Ok(crate::Origin::Xcm(origin).into()), + _ => Err(origin), + } + } +} diff --git a/pallet-xcm/src/migration.rs b/pallet-xcm/src/migration.rs new file mode 100644 index 000000000..08809f0d2 --- /dev/null +++ b/pallet-xcm/src/migration.rs @@ -0,0 +1,76 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use crate::{Config, Pallet, VersionNotifyTargets}; +use frame_support::{ + pallet_prelude::*, + traits::{OnRuntimeUpgrade, StorageVersion}, + weights::Weight, +}; + +const DEFAULT_PROOF_SIZE: u64 = 64 * 1024; + +pub mod v1 { + use super::*; + use crate::{CurrentMigration, VersionMigrationStage}; + + /// Named with the 'VersionUnchecked'-prefix because although this implements some version + /// checking, the version checking is not complete as it will begin failing after the upgrade is + /// enacted on-chain. + /// + /// Use experimental [`VersionCheckedMigrateToV1`] instead. + pub struct VersionUncheckedMigrateToV1(sp_std::marker::PhantomData); + impl OnRuntimeUpgrade for VersionUncheckedMigrateToV1 { + fn on_runtime_upgrade() -> Weight { + let mut weight = T::DbWeight::get().reads(1); + + if StorageVersion::get::>() != 0 { + log::warn!("skipping v1, should be removed"); + return weight + } + + weight.saturating_accrue(T::DbWeight::get().writes(1)); + CurrentMigration::::put(VersionMigrationStage::default()); + + let translate = |pre: (u64, u64, u32)| -> Option<(u64, Weight, u32)> { + weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); + let translated = (pre.0, Weight::from_parts(pre.1, DEFAULT_PROOF_SIZE), pre.2); + log::info!("Migrated VersionNotifyTarget {:?} to {:?}", pre, translated); + Some(translated) + }; + + VersionNotifyTargets::::translate_values(translate); + + log::info!("v1 applied successfully"); + weight.saturating_accrue(T::DbWeight::get().writes(1)); + StorageVersion::new(1).put::>(); + weight + } + } + + /// Version checked migration to v1. + /// + /// Wrapped in VersionedRuntimeUpgrade so the pre/post checks don't begin failing after the + /// upgrade is enacted on-chain. + #[cfg(feature = "experimental")] + pub type VersionCheckedMigrateToV1 = frame_support::migrations::VersionedRuntimeUpgrade< + 0, + 1, + VersionUncheckedMigrateToV1, + crate::pallet::Pallet, + ::DbWeight, + >; +} diff --git a/pallet-xcm/src/mock.rs b/pallet-xcm/src/mock.rs new file mode 100644 index 000000000..b56b1af82 --- /dev/null +++ b/pallet-xcm/src/mock.rs @@ -0,0 +1,399 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use codec::Encode; +use frame_support::{ + construct_runtime, parameter_types, + traits::{ConstU32, Everything, Nothing}, + weights::Weight, +}; +use frame_system::EnsureRoot; +use polkadot_parachain::primitives::Id as ParaId; +use polkadot_runtime_parachains::origin; +use sp_core::H256; +use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage}; +pub use sp_std::{cell::RefCell, fmt::Debug, marker::PhantomData}; +use xcm::prelude::*; +use xcm_builder::{ + AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, + AllowTopLevelPaidExecutionFrom, Case, ChildParachainAsNative, ChildParachainConvertsVia, + ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, + FixedWeightBounds, IsConcrete, SignedAccountId32AsNative, SignedToAccountId32, + SovereignSignedViaLocation, TakeWeightCredit, +}; +use xcm_executor::XcmExecutor; + +use crate::{self as pallet_xcm, TestWeightInfo}; + +pub type AccountId = AccountId32; +pub type Balance = u128; +type Block = frame_system::mocking::MockBlock; + +#[frame_support::pallet] +pub mod pallet_test_notifier { + use crate::{ensure_response, QueryId}; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + use sp_runtime::DispatchResult; + use xcm::latest::prelude::*; + use xcm_executor::traits::QueryHandler; + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::config] + pub trait Config: frame_system::Config + crate::Config { + type RuntimeEvent: IsType<::RuntimeEvent> + From>; + type RuntimeOrigin: IsType<::RuntimeOrigin> + + Into::RuntimeOrigin>>; + type RuntimeCall: IsType<::RuntimeCall> + From>; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + QueryPrepared(QueryId), + NotifyQueryPrepared(QueryId), + ResponseReceived(MultiLocation, QueryId, Response), + } + + #[pallet::error] + pub enum Error { + UnexpectedId, + BadAccountFormat, + } + + #[pallet::call] + impl Pallet { + #[pallet::call_index(0)] + #[pallet::weight(Weight::from_parts(1_000_000, 1_000_000))] + pub fn prepare_new_query(origin: OriginFor, querier: MultiLocation) -> DispatchResult { + let who = ensure_signed(origin)?; + let id = who + .using_encoded(|mut d| <[u8; 32]>::decode(&mut d)) + .map_err(|_| Error::::BadAccountFormat)?; + let qid = as QueryHandler>::new_query( + Junction::AccountId32 { network: None, id }, + 100u32.into(), + querier, + ); + Self::deposit_event(Event::::QueryPrepared(qid)); + Ok(()) + } + + #[pallet::call_index(1)] + #[pallet::weight(Weight::from_parts(1_000_000, 1_000_000))] + pub fn prepare_new_notify_query( + origin: OriginFor, + querier: MultiLocation, + ) -> DispatchResult { + let who = ensure_signed(origin)?; + let id = who + .using_encoded(|mut d| <[u8; 32]>::decode(&mut d)) + .map_err(|_| Error::::BadAccountFormat)?; + let call = + Call::::notification_received { query_id: 0, response: Default::default() }; + let qid = crate::Pallet::::new_notify_query( + Junction::AccountId32 { network: None, id }, + ::RuntimeCall::from(call), + 100u32.into(), + querier, + ); + Self::deposit_event(Event::::NotifyQueryPrepared(qid)); + Ok(()) + } + + #[pallet::call_index(2)] + #[pallet::weight(Weight::from_parts(1_000_000, 1_000_000))] + pub fn notification_received( + origin: OriginFor, + query_id: QueryId, + response: Response, + ) -> DispatchResult { + let responder = ensure_response(::RuntimeOrigin::from(origin))?; + Self::deposit_event(Event::::ResponseReceived(responder, query_id, response)); + Ok(()) + } + } +} + +construct_runtime!( + pub enum Test + { + System: frame_system::{Pallet, Call, Storage, Config, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + ParasOrigin: origin::{Pallet, Origin}, + XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config}, + TestNotifier: pallet_test_notifier::{Pallet, Call, Event}, + } +); + +thread_local! { + pub static SENT_XCM: RefCell)>> = RefCell::new(Vec::new()); +} +pub(crate) fn sent_xcm() -> Vec<(MultiLocation, Xcm<()>)> { + SENT_XCM.with(|q| (*q.borrow()).clone()) +} +pub(crate) fn take_sent_xcm() -> Vec<(MultiLocation, Xcm<()>)> { + SENT_XCM.with(|q| { + let mut r = Vec::new(); + std::mem::swap(&mut r, &mut *q.borrow_mut()); + r + }) +} +/// Sender that never returns error, always sends +pub struct TestSendXcm; +impl SendXcm for TestSendXcm { + type Ticket = (MultiLocation, Xcm<()>); + fn validate( + dest: &mut Option, + msg: &mut Option>, + ) -> SendResult<(MultiLocation, Xcm<()>)> { + let pair = (dest.take().unwrap(), msg.take().unwrap()); + Ok((pair, MultiAssets::new())) + } + fn deliver(pair: (MultiLocation, Xcm<()>)) -> Result { + let hash = fake_message_hash(&pair.1); + SENT_XCM.with(|q| q.borrow_mut().push(pair)); + Ok(hash) + } +} +/// Sender that returns error if `X8` junction and stops routing +pub struct TestSendXcmErrX8; +impl SendXcm for TestSendXcmErrX8 { + type Ticket = (MultiLocation, Xcm<()>); + fn validate( + dest: &mut Option, + msg: &mut Option>, + ) -> SendResult<(MultiLocation, Xcm<()>)> { + let (dest, msg) = (dest.take().unwrap(), msg.take().unwrap()); + if dest.len() == 8 { + Err(SendError::Transport("Destination location full")) + } else { + Ok(((dest, msg), MultiAssets::new())) + } + } + fn deliver(pair: (MultiLocation, Xcm<()>)) -> Result { + let hash = fake_message_hash(&pair.1); + SENT_XCM.with(|q| q.borrow_mut().push(pair)); + Ok(hash) + } +} + +parameter_types! { + pub const BlockHashCount: u64 = 250; +} + +impl frame_system::Config for Test { + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type Nonce = u64; + type Hash = H256; + type Hashing = ::sp_runtime::traits::BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type Block = Block; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type BlockWeights = (); + type BlockLength = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type DbWeight = (); + type BaseCallFilter = Everything; + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +parameter_types! { + pub ExistentialDeposit: Balance = 1; + pub const MaxLocks: u32 = 50; + pub const MaxReserves: u32 = 50; +} + +impl pallet_balances::Config for Test { + type MaxLocks = MaxLocks; + type Balance = Balance; + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); + type MaxReserves = MaxReserves; + type ReserveIdentifier = [u8; 8]; + type RuntimeHoldReason = RuntimeHoldReason; + type FreezeIdentifier = (); + type MaxHolds = ConstU32<0>; + type MaxFreezes = ConstU32<0>; +} + +parameter_types! { + pub const RelayLocation: MultiLocation = Here.into_location(); + pub const AnyNetwork: Option = None; + pub UniversalLocation: InteriorMultiLocation = Here; + pub UnitWeightCost: u64 = 1_000; +} + +pub type SovereignAccountOf = + (ChildParachainConvertsVia, AccountId32Aliases); + +pub type LocalAssetTransactor = + XcmCurrencyAdapter, SovereignAccountOf, AccountId, ()>; + +type LocalOriginConverter = ( + SovereignSignedViaLocation, + ChildParachainAsNative, + SignedAccountId32AsNative, + ChildSystemParachainAsSuperuser, +); + +parameter_types! { + pub const BaseXcmWeight: Weight = Weight::from_parts(1_000, 1_000); + pub CurrencyPerSecondPerByte: (AssetId, u128, u128) = (Concrete(RelayLocation::get()), 1, 1); + pub TrustedAssets: (MultiAssetFilter, MultiLocation) = (All.into(), Here.into()); + pub const MaxInstructions: u32 = 100; + pub const MaxAssetsIntoHolding: u32 = 64; +} + +pub type Barrier = ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + AllowKnownQueryResponses, + AllowSubscriptionsFrom, +); + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type RuntimeCall = RuntimeCall; + type XcmSender = TestSendXcm; + type AssetTransactor = LocalAssetTransactor; + type OriginConverter = LocalOriginConverter; + type IsReserve = (); + type IsTeleporter = Case; + type UniversalLocation = UniversalLocation; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + type Trader = FixedRateOfFungible; + type ResponseHandler = XcmPallet; + type AssetTrap = XcmPallet; + type AssetLocker = (); + type AssetExchanger = (); + type AssetClaims = XcmPallet; + type SubscriptionService = XcmPallet; + type PalletInstancesInfo = AllPalletsWithSystem; + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; + type Aliasers = Nothing; +} + +pub type LocalOriginToLocation = SignedToAccountId32; + +parameter_types! { + pub static AdvertisedXcmVersion: pallet_xcm::XcmVersion = 3; +} + +#[cfg(feature = "runtime-benchmarks")] +parameter_types! { + pub ReachableDest: Option = Some(Parachain(1000).into()); +} + +impl pallet_xcm::Config for Test { + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; + type XcmRouter = (TestSendXcmErrX8, TestSendXcm); + type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; + type XcmExecuteFilter = Everything; + type XcmExecutor = XcmExecutor; + type XcmTeleportFilter = Everything; + type XcmReserveTransferFilter = Everything; + type Weigher = FixedWeightBounds; + type UniversalLocation = UniversalLocation; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + type AdvertisedXcmVersion = AdvertisedXcmVersion; + type TrustedLockers = (); + type SovereignAccountOf = AccountId32Aliases<(), AccountId32>; + type Currency = Balances; + type CurrencyMatcher = IsConcrete; + type MaxLockers = frame_support::traits::ConstU32<8>; + type MaxRemoteLockConsumers = frame_support::traits::ConstU32<0>; + type RemoteLockConsumerIdentifier = (); + type WeightInfo = TestWeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; +} + +impl origin::Config for Test {} + +impl pallet_test_notifier::Config for Test { + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; +} + +pub(crate) fn last_event() -> RuntimeEvent { + System::events().pop().expect("RuntimeEvent expected").event +} + +pub(crate) fn last_events(n: usize) -> Vec { + System::events().into_iter().map(|e| e.event).rev().take(n).rev().collect() +} + +pub(crate) fn buy_execution(fees: impl Into) -> Instruction { + use xcm::latest::prelude::*; + BuyExecution { fees: fees.into(), weight_limit: Unlimited } +} + +pub(crate) fn buy_limited_execution( + fees: impl Into, + weight: Weight, +) -> Instruction { + use xcm::latest::prelude::*; + BuyExecution { fees: fees.into(), weight_limit: Limited(weight) } +} + +pub(crate) fn new_test_ext_with_balances( + balances: Vec<(AccountId, Balance)>, +) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); + + pallet_balances::GenesisConfig:: { balances } + .assimilate_storage(&mut t) + .unwrap(); + + pallet_xcm::GenesisConfig:: { safe_xcm_version: Some(2), ..Default::default() } + .assimilate_storage(&mut t) + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext +} + +pub(crate) fn fake_message_hash(message: &Xcm) -> XcmHash { + message.using_encoded(sp_io::hashing::blake2_256) +} diff --git a/pallet-xcm/src/tests.rs b/pallet-xcm/src/tests.rs new file mode 100644 index 000000000..6ff9f1d89 --- /dev/null +++ b/pallet-xcm/src/tests.rs @@ -0,0 +1,1216 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use crate::{ + mock::*, AssetTraps, CurrentMigration, Error, LatestVersionedMultiLocation, Queries, + QueryStatus, VersionDiscoveryQueue, VersionMigrationStage, VersionNotifiers, + VersionNotifyTargets, +}; +use frame_support::{ + assert_noop, assert_ok, + traits::{Currency, Hooks}, + weights::Weight, +}; +use polkadot_parachain::primitives::Id as ParaId; +use sp_runtime::traits::{AccountIdConversion, BlakeTwo256, Hash}; +use xcm::{latest::QueryResponseInfo, prelude::*}; +use xcm_builder::AllowKnownQueryResponses; +use xcm_executor::{ + traits::{Properties, QueryHandler, QueryResponseStatus, ShouldExecute}, + XcmExecutor, +}; + +const ALICE: AccountId = AccountId::new([0u8; 32]); +const BOB: AccountId = AccountId::new([1u8; 32]); +const PARA_ID: u32 = 2000; +const INITIAL_BALANCE: u128 = 100; +const SEND_AMOUNT: u128 = 10; + +#[test] +fn report_outcome_notify_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + let sender: MultiLocation = AccountId32 { network: None, id: ALICE.into() }.into(); + let mut message = + Xcm(vec![TransferAsset { assets: (Here, SEND_AMOUNT).into(), beneficiary: sender }]); + let call = pallet_test_notifier::Call::notification_received { + query_id: 0, + response: Default::default(), + }; + let notify = RuntimeCall::TestNotifier(call); + new_test_ext_with_balances(balances).execute_with(|| { + XcmPallet::report_outcome_notify( + &mut message, + Parachain(PARA_ID).into_location(), + notify, + 100, + ) + .unwrap(); + assert_eq!( + message, + Xcm(vec![ + SetAppendix(Xcm(vec![ReportError(QueryResponseInfo { + destination: Parent.into(), + query_id: 0, + max_weight: Weight::from_parts(1_000_000, 1_000_000), + })])), + TransferAsset { assets: (Here, SEND_AMOUNT).into(), beneficiary: sender }, + ]) + ); + let querier: MultiLocation = Here.into(); + let status = QueryStatus::Pending { + responder: MultiLocation::from(Parachain(PARA_ID)).into(), + maybe_notify: Some((4, 2)), + timeout: 100, + maybe_match_querier: Some(querier.into()), + }; + assert_eq!(crate::Queries::::iter().collect::>(), vec![(0, status)]); + + let message = Xcm(vec![QueryResponse { + query_id: 0, + response: Response::ExecutionResult(None), + max_weight: Weight::from_parts(1_000_000, 1_000_000), + querier: Some(querier), + }]); + let hash = fake_message_hash(&message); + let r = XcmExecutor::::execute_xcm( + Parachain(PARA_ID), + message, + hash, + Weight::from_parts(1_000_000_000, 1_000_000_000), + ); + assert_eq!(r, Outcome::Complete(Weight::from_parts(1_000, 1_000))); + assert_eq!( + last_events(2), + vec![ + RuntimeEvent::TestNotifier(pallet_test_notifier::Event::ResponseReceived( + Parachain(PARA_ID).into(), + 0, + Response::ExecutionResult(None), + )), + RuntimeEvent::XcmPallet(crate::Event::Notified { + query_id: 0, + pallet_index: 4, + call_index: 2 + }), + ] + ); + assert_eq!(crate::Queries::::iter().collect::>(), vec![]); + }); +} + +#[test] +fn report_outcome_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + let sender: MultiLocation = AccountId32 { network: None, id: ALICE.into() }.into(); + let mut message = + Xcm(vec![TransferAsset { assets: (Here, SEND_AMOUNT).into(), beneficiary: sender }]); + new_test_ext_with_balances(balances).execute_with(|| { + XcmPallet::report_outcome(&mut message, Parachain(PARA_ID).into_location(), 100).unwrap(); + assert_eq!( + message, + Xcm(vec![ + SetAppendix(Xcm(vec![ReportError(QueryResponseInfo { + destination: Parent.into(), + query_id: 0, + max_weight: Weight::zero(), + })])), + TransferAsset { assets: (Here, SEND_AMOUNT).into(), beneficiary: sender }, + ]) + ); + let querier: MultiLocation = Here.into(); + let status = QueryStatus::Pending { + responder: MultiLocation::from(Parachain(PARA_ID)).into(), + maybe_notify: None, + timeout: 100, + maybe_match_querier: Some(querier.into()), + }; + assert_eq!(crate::Queries::::iter().collect::>(), vec![(0, status)]); + + let message = Xcm(vec![QueryResponse { + query_id: 0, + response: Response::ExecutionResult(None), + max_weight: Weight::zero(), + querier: Some(querier), + }]); + let hash = fake_message_hash(&message); + let r = XcmExecutor::::execute_xcm( + Parachain(PARA_ID), + message, + hash, + Weight::from_parts(1_000_000_000, 1_000_000_000), + ); + assert_eq!(r, Outcome::Complete(Weight::from_parts(1_000, 1_000))); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::ResponseReady { + query_id: 0, + response: Response::ExecutionResult(None), + }) + ); + + let response = + QueryResponseStatus::Ready { response: Response::ExecutionResult(None), at: 1 }; + assert_eq!(XcmPallet::take_response(0), response); + }); +} + +#[test] +fn custom_querier_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + new_test_ext_with_balances(balances).execute_with(|| { + let querier: MultiLocation = + (Parent, AccountId32 { network: None, id: ALICE.into() }).into(); + + let r = TestNotifier::prepare_new_query(RuntimeOrigin::signed(ALICE), querier); + assert_eq!(r, Ok(())); + let status = QueryStatus::Pending { + responder: MultiLocation::from(AccountId32 { network: None, id: ALICE.into() }).into(), + maybe_notify: None, + timeout: 100, + maybe_match_querier: Some(querier.into()), + }; + assert_eq!(crate::Queries::::iter().collect::>(), vec![(0, status)]); + + // Supplying no querier when one is expected will fail + let message = Xcm(vec![QueryResponse { + query_id: 0, + response: Response::ExecutionResult(None), + max_weight: Weight::zero(), + querier: None, + }]); + let hash = fake_message_hash(&message); + let r = XcmExecutor::::execute_xcm_in_credit( + AccountId32 { network: None, id: ALICE.into() }, + message, + hash, + Weight::from_parts(1_000_000_000, 1_000_000_000), + Weight::from_parts(1_000, 1_000), + ); + assert_eq!(r, Outcome::Complete(Weight::from_parts(1_000, 1_000))); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::InvalidQuerier { + origin: AccountId32 { network: None, id: ALICE.into() }.into(), + query_id: 0, + expected_querier: querier, + maybe_actual_querier: None, + }), + ); + + // Supplying the wrong querier will also fail + let message = Xcm(vec![QueryResponse { + query_id: 0, + response: Response::ExecutionResult(None), + max_weight: Weight::zero(), + querier: Some(MultiLocation::here()), + }]); + let hash = fake_message_hash(&message); + let r = XcmExecutor::::execute_xcm_in_credit( + AccountId32 { network: None, id: ALICE.into() }, + message, + hash, + Weight::from_parts(1_000_000_000, 1_000_000_000), + Weight::from_parts(1_000, 1_000), + ); + assert_eq!(r, Outcome::Complete(Weight::from_parts(1_000, 1_000))); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::InvalidQuerier { + origin: AccountId32 { network: None, id: ALICE.into() }.into(), + query_id: 0, + expected_querier: querier, + maybe_actual_querier: Some(MultiLocation::here()), + }), + ); + + // Multiple failures should not have changed the query state + let message = Xcm(vec![QueryResponse { + query_id: 0, + response: Response::ExecutionResult(None), + max_weight: Weight::zero(), + querier: Some(querier), + }]); + let hash = fake_message_hash(&message); + let r = XcmExecutor::::execute_xcm( + AccountId32 { network: None, id: ALICE.into() }, + message, + hash, + Weight::from_parts(1_000_000_000, 1_000_000_000), + ); + assert_eq!(r, Outcome::Complete(Weight::from_parts(1_000, 1_000))); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::ResponseReady { + query_id: 0, + response: Response::ExecutionResult(None), + }) + ); + + let response = + QueryResponseStatus::Ready { response: Response::ExecutionResult(None), at: 1 }; + assert_eq!(XcmPallet::take_response(0), response); + }); +} + +/// Test sending an `XCM` message (`XCM::ReserveAssetDeposit`) +/// +/// Asserts that the expected message is sent and the event is emitted +#[test] +fn send_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + new_test_ext_with_balances(balances).execute_with(|| { + let sender: MultiLocation = AccountId32 { network: None, id: ALICE.into() }.into(); + let message = Xcm(vec![ + ReserveAssetDeposited((Parent, SEND_AMOUNT).into()), + ClearOrigin, + buy_execution((Parent, SEND_AMOUNT)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: sender }, + ]); + + let versioned_dest = Box::new(RelayLocation::get().into()); + let versioned_message = Box::new(VersionedXcm::from(message.clone())); + assert_ok!(XcmPallet::send( + RuntimeOrigin::signed(ALICE), + versioned_dest, + versioned_message + )); + let sent_message = Xcm(Some(DescendOrigin(sender.try_into().unwrap())) + .into_iter() + .chain(message.0.clone().into_iter()) + .collect()); + let id = fake_message_hash(&sent_message); + assert_eq!(sent_xcm(), vec![(Here.into(), sent_message)]); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::Sent { + origin: sender, + destination: RelayLocation::get(), + message, + message_id: id, + }) + ); + }); +} + +/// Test that sending an `XCM` message fails when the `XcmRouter` blocks the +/// matching message format +/// +/// Asserts that `send` fails with `Error::SendFailure` +#[test] +fn send_fails_when_xcm_router_blocks() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + new_test_ext_with_balances(balances).execute_with(|| { + let sender: MultiLocation = + Junction::AccountId32 { network: None, id: ALICE.into() }.into(); + let message = Xcm(vec![ + ReserveAssetDeposited((Parent, SEND_AMOUNT).into()), + buy_execution((Parent, SEND_AMOUNT)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: sender }, + ]); + assert_noop!( + XcmPallet::send( + RuntimeOrigin::signed(ALICE), + Box::new(MultiLocation::ancestor(8).into()), + Box::new(VersionedXcm::from(message.clone())), + ), + crate::Error::::SendFailure + ); + }); +} + +/// Test `teleport_assets` +/// +/// Asserts that the sender's balance is decreased as a result of execution of +/// local effects. +#[test] +fn teleport_assets_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + new_test_ext_with_balances(balances).execute_with(|| { + let weight = BaseXcmWeight::get() * 3; + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE); + let dest: MultiLocation = AccountId32 { network: None, id: BOB.into() }.into(); + assert_ok!(XcmPallet::teleport_assets( + RuntimeOrigin::signed(ALICE), + Box::new(RelayLocation::get().into()), + Box::new(dest.into()), + Box::new((Here, SEND_AMOUNT).into()), + 0, + )); + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); + assert_eq!( + sent_xcm(), + vec![( + RelayLocation::get().into(), + Xcm(vec![ + ReceiveTeleportedAsset((Here, SEND_AMOUNT).into()), + ClearOrigin, + buy_limited_execution((Here, SEND_AMOUNT), Weight::from_parts(4000, 4000)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, + ]), + )] + ); + let versioned_sent = VersionedXcm::from(sent_xcm().into_iter().next().unwrap().1); + let _check_v2_ok: xcm::v2::Xcm<()> = versioned_sent.try_into().unwrap(); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::Attempted { outcome: Outcome::Complete(weight) }) + ); + }); +} + +/// Test `limited_teleport_assets` +/// +/// Asserts that the sender's balance is decreased as a result of execution of +/// local effects. +#[test] +fn limited_teleport_assets_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + new_test_ext_with_balances(balances).execute_with(|| { + let weight = BaseXcmWeight::get() * 3; + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE); + let dest: MultiLocation = AccountId32 { network: None, id: BOB.into() }.into(); + assert_ok!(XcmPallet::limited_teleport_assets( + RuntimeOrigin::signed(ALICE), + Box::new(RelayLocation::get().into()), + Box::new(dest.into()), + Box::new((Here, SEND_AMOUNT).into()), + 0, + WeightLimit::Limited(Weight::from_parts(5000, 5000)), + )); + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); + assert_eq!( + sent_xcm(), + vec![( + RelayLocation::get().into(), + Xcm(vec![ + ReceiveTeleportedAsset((Here, SEND_AMOUNT).into()), + ClearOrigin, + buy_limited_execution((Here, SEND_AMOUNT), Weight::from_parts(5000, 5000)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, + ]), + )] + ); + let versioned_sent = VersionedXcm::from(sent_xcm().into_iter().next().unwrap().1); + let _check_v2_ok: xcm::v2::Xcm<()> = versioned_sent.try_into().unwrap(); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::Attempted { outcome: Outcome::Complete(weight) }) + ); + }); +} + +/// Test `limited_teleport_assets` with unlimited weight +/// +/// Asserts that the sender's balance is decreased as a result of execution of +/// local effects. +#[test] +fn unlimited_teleport_assets_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + new_test_ext_with_balances(balances).execute_with(|| { + let weight = BaseXcmWeight::get() * 3; + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE); + let dest: MultiLocation = AccountId32 { network: None, id: BOB.into() }.into(); + assert_ok!(XcmPallet::limited_teleport_assets( + RuntimeOrigin::signed(ALICE), + Box::new(RelayLocation::get().into()), + Box::new(dest.into()), + Box::new((Here, SEND_AMOUNT).into()), + 0, + WeightLimit::Unlimited, + )); + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); + assert_eq!( + sent_xcm(), + vec![( + RelayLocation::get().into(), + Xcm(vec![ + ReceiveTeleportedAsset((Here, SEND_AMOUNT).into()), + ClearOrigin, + buy_execution((Here, SEND_AMOUNT)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, + ]), + )] + ); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::Attempted { outcome: Outcome::Complete(weight) }) + ); + }); +} + +/// Test `reserve_transfer_assets` +/// +/// Asserts that the sender's balance is decreased and the beneficiary's balance +/// is increased. Verifies the correct message is sent and event is emitted. +#[test] +fn reserve_transfer_assets_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + new_test_ext_with_balances(balances).execute_with(|| { + let weight = BaseXcmWeight::get() * 2; + let dest: MultiLocation = Junction::AccountId32 { network: None, id: ALICE.into() }.into(); + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE); + assert_ok!(XcmPallet::reserve_transfer_assets( + RuntimeOrigin::signed(ALICE), + Box::new(Parachain(PARA_ID).into()), + Box::new(dest.into()), + Box::new((Here, SEND_AMOUNT).into()), + 0, + )); + // Alice spent amount + assert_eq!(Balances::free_balance(ALICE), INITIAL_BALANCE - SEND_AMOUNT); + // Destination account (parachain account) has amount + let para_acc: AccountId = ParaId::from(PARA_ID).into_account_truncating(); + assert_eq!(Balances::free_balance(para_acc), INITIAL_BALANCE + SEND_AMOUNT); + assert_eq!( + sent_xcm(), + vec![( + Parachain(PARA_ID).into(), + Xcm(vec![ + ReserveAssetDeposited((Parent, SEND_AMOUNT).into()), + ClearOrigin, + buy_limited_execution((Parent, SEND_AMOUNT), Weight::from_parts(4000, 4000)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, + ]), + )] + ); + let versioned_sent = VersionedXcm::from(sent_xcm().into_iter().next().unwrap().1); + let _check_v2_ok: xcm::v2::Xcm<()> = versioned_sent.try_into().unwrap(); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::Attempted { outcome: Outcome::Complete(weight) }) + ); + }); +} + +/// Test `limited_reserve_transfer_assets` +/// +/// Asserts that the sender's balance is decreased and the beneficiary's balance +/// is increased. Verifies the correct message is sent and event is emitted. +#[test] +fn limited_reserve_transfer_assets_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + new_test_ext_with_balances(balances).execute_with(|| { + let weight = BaseXcmWeight::get() * 2; + let dest: MultiLocation = Junction::AccountId32 { network: None, id: ALICE.into() }.into(); + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE); + assert_ok!(XcmPallet::limited_reserve_transfer_assets( + RuntimeOrigin::signed(ALICE), + Box::new(Parachain(PARA_ID).into()), + Box::new(dest.into()), + Box::new((Here, SEND_AMOUNT).into()), + 0, + WeightLimit::Limited(Weight::from_parts(5000, 5000)), + )); + // Alice spent amount + assert_eq!(Balances::free_balance(ALICE), INITIAL_BALANCE - SEND_AMOUNT); + // Destination account (parachain account) has amount + let para_acc: AccountId = ParaId::from(PARA_ID).into_account_truncating(); + assert_eq!(Balances::free_balance(para_acc), INITIAL_BALANCE + SEND_AMOUNT); + assert_eq!( + sent_xcm(), + vec![( + Parachain(PARA_ID).into(), + Xcm(vec![ + ReserveAssetDeposited((Parent, SEND_AMOUNT).into()), + ClearOrigin, + buy_limited_execution((Parent, SEND_AMOUNT), Weight::from_parts(5000, 5000)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, + ]), + )] + ); + let versioned_sent = VersionedXcm::from(sent_xcm().into_iter().next().unwrap().1); + let _check_v2_ok: xcm::v2::Xcm<()> = versioned_sent.try_into().unwrap(); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::Attempted { outcome: Outcome::Complete(weight) }) + ); + }); +} + +/// Test `limited_reserve_transfer_assets` with unlimited weight purchasing +/// +/// Asserts that the sender's balance is decreased and the beneficiary's balance +/// is increased. Verifies the correct message is sent and event is emitted. +#[test] +fn unlimited_reserve_transfer_assets_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + new_test_ext_with_balances(balances).execute_with(|| { + let weight = BaseXcmWeight::get() * 2; + let dest: MultiLocation = Junction::AccountId32 { network: None, id: ALICE.into() }.into(); + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE); + assert_ok!(XcmPallet::limited_reserve_transfer_assets( + RuntimeOrigin::signed(ALICE), + Box::new(Parachain(PARA_ID).into()), + Box::new(dest.into()), + Box::new((Here, SEND_AMOUNT).into()), + 0, + WeightLimit::Unlimited, + )); + // Alice spent amount + assert_eq!(Balances::free_balance(ALICE), INITIAL_BALANCE - SEND_AMOUNT); + // Destination account (parachain account) has amount + let para_acc: AccountId = ParaId::from(PARA_ID).into_account_truncating(); + assert_eq!(Balances::free_balance(para_acc), INITIAL_BALANCE + SEND_AMOUNT); + assert_eq!( + sent_xcm(), + vec![( + Parachain(PARA_ID).into(), + Xcm(vec![ + ReserveAssetDeposited((Parent, SEND_AMOUNT).into()), + ClearOrigin, + buy_execution((Parent, SEND_AMOUNT)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, + ]), + )] + ); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::Attempted { outcome: Outcome::Complete(weight) }) + ); + }); +} + +/// Test local execution of XCM +/// +/// Asserts that the sender's balance is decreased and the beneficiary's balance +/// is increased. Verifies the expected event is emitted. +#[test] +fn execute_withdraw_to_deposit_works() { + let balances = vec![ + (ALICE, INITIAL_BALANCE), + (ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE), + ]; + new_test_ext_with_balances(balances).execute_with(|| { + let weight = BaseXcmWeight::get() * 3; + let dest: MultiLocation = Junction::AccountId32 { network: None, id: BOB.into() }.into(); + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE); + assert_ok!(XcmPallet::execute( + RuntimeOrigin::signed(ALICE), + Box::new(VersionedXcm::from(Xcm(vec![ + WithdrawAsset((Here, SEND_AMOUNT).into()), + buy_execution((Here, SEND_AMOUNT)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, + ]))), + weight + )); + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); + assert_eq!(Balances::total_balance(&BOB), SEND_AMOUNT); + assert_eq!( + last_event(), + RuntimeEvent::XcmPallet(crate::Event::Attempted { outcome: Outcome::Complete(weight) }) + ); + }); +} + +/// Test drop/claim assets. +#[test] +fn trapped_assets_can_be_claimed() { + let balances = vec![(ALICE, INITIAL_BALANCE), (BOB, INITIAL_BALANCE)]; + new_test_ext_with_balances(balances).execute_with(|| { + let weight = BaseXcmWeight::get() * 6; + let dest: MultiLocation = Junction::AccountId32 { network: None, id: BOB.into() }.into(); + + assert_ok!(XcmPallet::execute( + RuntimeOrigin::signed(ALICE), + Box::new(VersionedXcm::from(Xcm(vec![ + WithdrawAsset((Here, SEND_AMOUNT).into()), + buy_execution((Here, SEND_AMOUNT)), + // Don't propagated the error into the result. + SetErrorHandler(Xcm(vec![ClearError])), + // This will make an error. + Trap(0), + // This would succeed, but we never get to it. + DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, + ]))), + weight + )); + let source: MultiLocation = + Junction::AccountId32 { network: None, id: ALICE.into() }.into(); + let trapped = AssetTraps::::iter().collect::>(); + let vma = VersionedMultiAssets::from(MultiAssets::from((Here, SEND_AMOUNT))); + let hash = BlakeTwo256::hash_of(&(source, vma.clone())); + assert_eq!( + last_events(2), + vec![ + RuntimeEvent::XcmPallet(crate::Event::AssetsTrapped { + hash, + origin: source, + assets: vma + }), + RuntimeEvent::XcmPallet(crate::Event::Attempted { + outcome: Outcome::Complete(BaseXcmWeight::get() * 5) + }), + ] + ); + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); + assert_eq!(Balances::total_balance(&BOB), INITIAL_BALANCE); + + let expected = vec![(hash, 1u32)]; + assert_eq!(trapped, expected); + + let weight = BaseXcmWeight::get() * 3; + assert_ok!(XcmPallet::execute( + RuntimeOrigin::signed(ALICE), + Box::new(VersionedXcm::from(Xcm(vec![ + ClaimAsset { assets: (Here, SEND_AMOUNT).into(), ticket: Here.into() }, + buy_execution((Here, SEND_AMOUNT)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, + ]))), + weight + )); + + assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); + assert_eq!(Balances::total_balance(&BOB), INITIAL_BALANCE + SEND_AMOUNT); + assert_eq!(AssetTraps::::iter().collect::>(), vec![]); + + let weight = BaseXcmWeight::get() * 3; + assert_ok!(XcmPallet::execute( + RuntimeOrigin::signed(ALICE), + Box::new(VersionedXcm::from(Xcm(vec![ + ClaimAsset { assets: (Here, SEND_AMOUNT).into(), ticket: Here.into() }, + buy_execution((Here, SEND_AMOUNT)), + DepositAsset { assets: AllCounted(1).into(), beneficiary: dest }, + ]))), + weight + )); + let outcome = Outcome::Incomplete(BaseXcmWeight::get(), XcmError::UnknownClaim); + assert_eq!(last_event(), RuntimeEvent::XcmPallet(crate::Event::Attempted { outcome })); + }); +} + +#[test] +fn fake_latest_versioned_multilocation_works() { + use codec::Encode; + let remote: MultiLocation = Parachain(1000).into(); + let versioned_remote = LatestVersionedMultiLocation(&remote); + assert_eq!(versioned_remote.encode(), remote.into_versioned().encode()); +} + +#[test] +fn basic_subscription_works() { + new_test_ext_with_balances(vec![]).execute_with(|| { + let remote: MultiLocation = Parachain(1000).into(); + assert_ok!(XcmPallet::force_subscribe_version_notify( + RuntimeOrigin::root(), + Box::new(remote.into()), + )); + + assert_eq!( + Queries::::iter().collect::>(), + vec![(0, QueryStatus::VersionNotifier { origin: remote.into(), is_active: false })] + ); + assert_eq!( + VersionNotifiers::::iter().collect::>(), + vec![(XCM_VERSION, remote.into(), 0)] + ); + + assert_eq!( + take_sent_xcm(), + vec![( + remote, + Xcm(vec![SubscribeVersion { query_id: 0, max_response_weight: Weight::zero() }]), + ),] + ); + + let weight = BaseXcmWeight::get(); + let mut message = Xcm::<()>(vec![ + // Remote supports XCM v2 + QueryResponse { + query_id: 0, + max_weight: Weight::zero(), + response: Response::Version(1), + querier: None, + }, + ]); + assert_ok!(AllowKnownQueryResponses::::should_execute( + &remote, + message.inner_mut(), + weight, + &mut Properties { weight_credit: Weight::zero(), message_id: None }, + )); + }); +} + +#[test] +fn subscriptions_increment_id() { + new_test_ext_with_balances(vec![]).execute_with(|| { + let remote: MultiLocation = Parachain(1000).into(); + assert_ok!(XcmPallet::force_subscribe_version_notify( + RuntimeOrigin::root(), + Box::new(remote.into()), + )); + + let remote2: MultiLocation = Parachain(1001).into(); + assert_ok!(XcmPallet::force_subscribe_version_notify( + RuntimeOrigin::root(), + Box::new(remote2.into()), + )); + + assert_eq!( + take_sent_xcm(), + vec![ + ( + remote, + Xcm(vec![SubscribeVersion { + query_id: 0, + max_response_weight: Weight::zero() + }]), + ), + ( + remote2, + Xcm(vec![SubscribeVersion { + query_id: 1, + max_response_weight: Weight::zero() + }]), + ), + ] + ); + }); +} + +#[test] +fn double_subscription_fails() { + new_test_ext_with_balances(vec![]).execute_with(|| { + let remote: MultiLocation = Parachain(1000).into(); + assert_ok!(XcmPallet::force_subscribe_version_notify( + RuntimeOrigin::root(), + Box::new(remote.into()), + )); + assert_noop!( + XcmPallet::force_subscribe_version_notify( + RuntimeOrigin::root(), + Box::new(remote.into()) + ), + Error::::AlreadySubscribed, + ); + }) +} + +#[test] +fn unsubscribe_works() { + new_test_ext_with_balances(vec![]).execute_with(|| { + let remote: MultiLocation = Parachain(1000).into(); + assert_ok!(XcmPallet::force_subscribe_version_notify( + RuntimeOrigin::root(), + Box::new(remote.into()), + )); + assert_ok!(XcmPallet::force_unsubscribe_version_notify( + RuntimeOrigin::root(), + Box::new(remote.into()) + )); + assert_noop!( + XcmPallet::force_unsubscribe_version_notify( + RuntimeOrigin::root(), + Box::new(remote.into()) + ), + Error::::NoSubscription, + ); + + assert_eq!( + take_sent_xcm(), + vec![ + ( + remote, + Xcm(vec![SubscribeVersion { + query_id: 0, + max_response_weight: Weight::zero() + }]), + ), + (remote, Xcm(vec![UnsubscribeVersion]),), + ] + ); + }); +} + +/// Parachain 1000 is asking us for a version subscription. +#[test] +fn subscription_side_works() { + new_test_ext_with_balances(vec![]).execute_with(|| { + AdvertisedXcmVersion::set(1); + + let remote: MultiLocation = Parachain(1000).into(); + let weight = BaseXcmWeight::get(); + let message = + Xcm(vec![SubscribeVersion { query_id: 0, max_response_weight: Weight::zero() }]); + let hash = fake_message_hash(&message); + let r = XcmExecutor::::execute_xcm(remote, message, hash, weight); + assert_eq!(r, Outcome::Complete(weight)); + + let instr = QueryResponse { + query_id: 0, + max_weight: Weight::zero(), + response: Response::Version(1), + querier: None, + }; + assert_eq!(take_sent_xcm(), vec![(remote, Xcm(vec![instr]))]); + + // A runtime upgrade which doesn't alter the version sends no notifications. + CurrentMigration::::put(VersionMigrationStage::default()); + XcmPallet::on_initialize(1); + assert_eq!(take_sent_xcm(), vec![]); + + // New version. + AdvertisedXcmVersion::set(2); + + // A runtime upgrade which alters the version does send notifications. + CurrentMigration::::put(VersionMigrationStage::default()); + XcmPallet::on_initialize(2); + let instr = QueryResponse { + query_id: 0, + max_weight: Weight::zero(), + response: Response::Version(2), + querier: None, + }; + assert_eq!(take_sent_xcm(), vec![(remote, Xcm(vec![instr]))]); + }); +} + +#[test] +fn subscription_side_upgrades_work_with_notify() { + new_test_ext_with_balances(vec![]).execute_with(|| { + AdvertisedXcmVersion::set(1); + + // An entry from a previous runtime with v2 XCM. + let v2_location = VersionedMultiLocation::V2(xcm::v2::Junction::Parachain(1001).into()); + VersionNotifyTargets::::insert(1, v2_location, (70, Weight::zero(), 2)); + let v3_location = Parachain(1003).into_versioned(); + VersionNotifyTargets::::insert(3, v3_location, (72, Weight::zero(), 2)); + + // New version. + AdvertisedXcmVersion::set(3); + + // A runtime upgrade which alters the version does send notifications. + CurrentMigration::::put(VersionMigrationStage::default()); + XcmPallet::on_initialize(1); + + let instr1 = QueryResponse { + query_id: 70, + max_weight: Weight::zero(), + response: Response::Version(3), + querier: None, + }; + let instr3 = QueryResponse { + query_id: 72, + max_weight: Weight::zero(), + response: Response::Version(3), + querier: None, + }; + let mut sent = take_sent_xcm(); + sent.sort_by_key(|k| match (k.1).0[0] { + QueryResponse { query_id: q, .. } => q, + _ => 0, + }); + assert_eq!( + sent, + vec![ + (Parachain(1001).into(), Xcm(vec![instr1])), + (Parachain(1003).into(), Xcm(vec![instr3])), + ] + ); + + let mut contents = VersionNotifyTargets::::iter().collect::>(); + contents.sort_by_key(|k| k.2 .0); + assert_eq!( + contents, + vec![ + (XCM_VERSION, Parachain(1001).into_versioned(), (70, Weight::zero(), 3)), + (XCM_VERSION, Parachain(1003).into_versioned(), (72, Weight::zero(), 3)), + ] + ); + }); +} + +#[test] +fn subscription_side_upgrades_work_without_notify() { + new_test_ext_with_balances(vec![]).execute_with(|| { + // An entry from a previous runtime with v2 XCM. + let v2_location = VersionedMultiLocation::V2(xcm::v2::Junction::Parachain(1001).into()); + VersionNotifyTargets::::insert(1, v2_location, (70, Weight::zero(), 2)); + let v3_location = Parachain(1003).into_versioned(); + VersionNotifyTargets::::insert(3, v3_location, (72, Weight::zero(), 2)); + + // A runtime upgrade which alters the version does send notifications. + CurrentMigration::::put(VersionMigrationStage::default()); + XcmPallet::on_initialize(1); + + let mut contents = VersionNotifyTargets::::iter().collect::>(); + contents.sort_by_key(|k| k.2 .0); + assert_eq!( + contents, + vec![ + (XCM_VERSION, Parachain(1001).into_versioned(), (70, Weight::zero(), 3)), + (XCM_VERSION, Parachain(1003).into_versioned(), (72, Weight::zero(), 3)), + ] + ); + }); +} + +#[test] +fn subscriber_side_subscription_works() { + new_test_ext_with_balances(vec![]).execute_with(|| { + let remote: MultiLocation = Parachain(1000).into(); + assert_ok!(XcmPallet::force_subscribe_version_notify( + RuntimeOrigin::root(), + Box::new(remote.into()), + )); + take_sent_xcm(); + + // Assume subscription target is working ok. + + let weight = BaseXcmWeight::get(); + let message = Xcm(vec![ + // Remote supports XCM v2 + QueryResponse { + query_id: 0, + max_weight: Weight::zero(), + response: Response::Version(1), + querier: None, + }, + ]); + let hash = fake_message_hash(&message); + let r = XcmExecutor::::execute_xcm(remote, message, hash, weight); + assert_eq!(r, Outcome::Complete(weight)); + assert_eq!(take_sent_xcm(), vec![]); + + // This message cannot be sent to a v2 remote. + let v2_msg = xcm::v2::Xcm::<()>(vec![xcm::v2::Instruction::Trap(0)]); + assert_eq!(XcmPallet::wrap_version(&remote, v2_msg.clone()), Err(())); + + let message = Xcm(vec![ + // Remote upgraded to XCM v2 + QueryResponse { + query_id: 0, + max_weight: Weight::zero(), + response: Response::Version(2), + querier: None, + }, + ]); + let hash = fake_message_hash(&message); + let r = XcmExecutor::::execute_xcm(remote, message, hash, weight); + assert_eq!(r, Outcome::Complete(weight)); + + // This message can now be sent to remote as it's v2. + assert_eq!( + XcmPallet::wrap_version(&remote, v2_msg.clone()), + Ok(VersionedXcm::from(v2_msg)) + ); + }); +} + +/// We should auto-subscribe when we don't know the remote's version. +#[test] +fn auto_subscription_works() { + new_test_ext_with_balances(vec![]).execute_with(|| { + let remote_v2: MultiLocation = Parachain(1000).into(); + let remote_v3: MultiLocation = Parachain(1001).into(); + + assert_ok!(XcmPallet::force_default_xcm_version(RuntimeOrigin::root(), Some(2))); + + // Wrapping a version for a destination we don't know elicits a subscription. + let msg_v2 = xcm::v2::Xcm::<()>(vec![xcm::v2::Instruction::Trap(0)]); + let msg_v3 = xcm::v3::Xcm::<()>(vec![xcm::v3::Instruction::ClearTopic]); + assert_eq!( + XcmPallet::wrap_version(&remote_v2, msg_v2.clone()), + Ok(VersionedXcm::from(msg_v2.clone())), + ); + assert_eq!(XcmPallet::wrap_version(&remote_v2, msg_v3.clone()), Err(())); + + let expected = vec![(remote_v2.into(), 2)]; + assert_eq!(VersionDiscoveryQueue::::get().into_inner(), expected); + + assert_eq!( + XcmPallet::wrap_version(&remote_v3, msg_v2.clone()), + Ok(VersionedXcm::from(msg_v2.clone())), + ); + assert_eq!(XcmPallet::wrap_version(&remote_v3, msg_v3.clone()), Err(())); + + let expected = vec![(remote_v2.into(), 2), (remote_v3.into(), 2)]; + assert_eq!(VersionDiscoveryQueue::::get().into_inner(), expected); + + XcmPallet::on_initialize(1); + assert_eq!( + take_sent_xcm(), + vec![( + remote_v3, + Xcm(vec![SubscribeVersion { query_id: 0, max_response_weight: Weight::zero() }]), + )] + ); + + // Assume remote_v3 is working ok and XCM version 3. + + let weight = BaseXcmWeight::get(); + let message = Xcm(vec![ + // Remote supports XCM v3 + QueryResponse { + query_id: 0, + max_weight: Weight::zero(), + response: Response::Version(3), + querier: None, + }, + ]); + let hash = fake_message_hash(&message); + let r = XcmExecutor::::execute_xcm(remote_v3, message, hash, weight); + assert_eq!(r, Outcome::Complete(weight)); + + // V2 messages can be sent to remote_v3 under XCM v3. + assert_eq!( + XcmPallet::wrap_version(&remote_v3, msg_v2.clone()), + Ok(VersionedXcm::from(msg_v2.clone()).into_version(3).unwrap()), + ); + // This message can now be sent to remote_v3 as it's v3. + assert_eq!( + XcmPallet::wrap_version(&remote_v3, msg_v3.clone()), + Ok(VersionedXcm::from(msg_v3.clone())) + ); + + XcmPallet::on_initialize(2); + assert_eq!( + take_sent_xcm(), + vec![( + remote_v2, + Xcm(vec![SubscribeVersion { query_id: 1, max_response_weight: Weight::zero() }]), + )] + ); + + // Assume remote_v2 is working ok and XCM version 2. + + let weight = BaseXcmWeight::get(); + let message = Xcm(vec![ + // Remote supports XCM v2 + QueryResponse { + query_id: 1, + max_weight: Weight::zero(), + response: Response::Version(2), + querier: None, + }, + ]); + let hash = fake_message_hash(&message); + let r = XcmExecutor::::execute_xcm(remote_v2, message, hash, weight); + assert_eq!(r, Outcome::Complete(weight)); + + // v3 messages cannot be sent to remote_v2... + assert_eq!( + XcmPallet::wrap_version(&remote_v2, msg_v2.clone()), + Ok(VersionedXcm::V2(msg_v2)) + ); + assert_eq!(XcmPallet::wrap_version(&remote_v2, msg_v3.clone()), Err(())); + }) +} + +#[test] +fn subscription_side_upgrades_work_with_multistage_notify() { + new_test_ext_with_balances(vec![]).execute_with(|| { + AdvertisedXcmVersion::set(1); + + // An entry from a previous runtime with v0 XCM. + let v2_location = VersionedMultiLocation::V2(xcm::v2::Junction::Parachain(1001).into()); + VersionNotifyTargets::::insert(1, v2_location, (70, Weight::zero(), 1)); + let v2_location = VersionedMultiLocation::V2(xcm::v2::Junction::Parachain(1002).into()); + VersionNotifyTargets::::insert(2, v2_location, (71, Weight::zero(), 1)); + let v3_location = Parachain(1003).into_versioned(); + VersionNotifyTargets::::insert(3, v3_location, (72, Weight::zero(), 1)); + + // New version. + AdvertisedXcmVersion::set(3); + + // A runtime upgrade which alters the version does send notifications. + CurrentMigration::::put(VersionMigrationStage::default()); + let mut maybe_migration = CurrentMigration::::take(); + let mut counter = 0; + while let Some(migration) = maybe_migration.take() { + counter += 1; + let (_, m) = XcmPallet::check_xcm_version_change(migration, Weight::zero()); + maybe_migration = m; + } + assert_eq!(counter, 4); + + let instr1 = QueryResponse { + query_id: 70, + max_weight: Weight::zero(), + response: Response::Version(3), + querier: None, + }; + let instr2 = QueryResponse { + query_id: 71, + max_weight: Weight::zero(), + response: Response::Version(3), + querier: None, + }; + let instr3 = QueryResponse { + query_id: 72, + max_weight: Weight::zero(), + response: Response::Version(3), + querier: None, + }; + let mut sent = take_sent_xcm(); + sent.sort_by_key(|k| match (k.1).0[0] { + QueryResponse { query_id: q, .. } => q, + _ => 0, + }); + assert_eq!( + sent, + vec![ + (Parachain(1001).into(), Xcm(vec![instr1])), + (Parachain(1002).into(), Xcm(vec![instr2])), + (Parachain(1003).into(), Xcm(vec![instr3])), + ] + ); + + let mut contents = VersionNotifyTargets::::iter().collect::>(); + contents.sort_by_key(|k| k.2 .0); + assert_eq!( + contents, + vec![ + (XCM_VERSION, Parachain(1001).into_versioned(), (70, Weight::zero(), 3)), + (XCM_VERSION, Parachain(1002).into_versioned(), (71, Weight::zero(), 3)), + (XCM_VERSION, Parachain(1003).into_versioned(), (72, Weight::zero(), 3)), + ] + ); + }); +} diff --git a/procedural/Cargo.toml b/procedural/Cargo.toml index dc5669504..a821a7366 100644 --- a/procedural/Cargo.toml +++ b/procedural/Cargo.toml @@ -2,6 +2,7 @@ name = "xcm-procedural" authors.workspace = true edition.workspace = true +license.workspace = true version.workspace = true [lib] diff --git a/src/double_encoded.rs b/src/double_encoded.rs index 2c8957d9e..c4c1276fa 100644 --- a/src/double_encoded.rs +++ b/src/double_encoded.rs @@ -73,7 +73,8 @@ impl DoubleEncoded { impl DoubleEncoded { /// Decode the inner encoded value and store it. - /// Returns a reference to the value in case of success and `Err(())` in case the decoding fails. + /// Returns a reference to the value in case of success and `Err(())` in case the decoding + /// fails. pub fn ensure_decoded(&mut self) -> Result<&T, ()> { if self.decoded.is_none() { self.decoded = @@ -92,8 +93,9 @@ impl DoubleEncoded { .ok_or(()) } - /// Provides an API similar to `TryInto` that allows fallible conversion to the inner value type. - /// `TryInto` implementation would collide with std blanket implementation based on `TryFrom`. + /// Provides an API similar to `TryInto` that allows fallible conversion to the inner value + /// type. `TryInto` implementation would collide with std blanket implementation based on + /// `TryFrom`. pub fn try_into(mut self) -> Result { self.ensure_decoded()?; self.decoded.ok_or(()) diff --git a/src/lib.rs b/src/lib.rs index 2e8ea78b5..a012c5f53 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -360,7 +360,8 @@ impl TryFrom> for v3::Xcm { } } -/// Convert an `Xcm` datum into a `VersionedXcm`, based on a destination `MultiLocation` which will interpret it. +/// Convert an `Xcm` datum into a `VersionedXcm`, based on a destination `MultiLocation` which will +/// interpret it. pub trait WrapVersion { fn wrap_version( dest: &latest::MultiLocation, @@ -368,7 +369,8 @@ pub trait WrapVersion { ) -> Result, ()>; } -/// `()` implementation does nothing with the XCM, just sending with whatever version it was authored as. +/// `()` implementation does nothing with the XCM, just sending with whatever version it was +/// authored as. impl WrapVersion for () { fn wrap_version( _: &latest::MultiLocation, @@ -378,7 +380,8 @@ impl WrapVersion for () { } } -/// `WrapVersion` implementation which attempts to always convert the XCM to version 2 before wrapping it. +/// `WrapVersion` implementation which attempts to always convert the XCM to version 2 before +/// wrapping it. pub struct AlwaysV2; impl WrapVersion for AlwaysV2 { fn wrap_version( @@ -389,7 +392,8 @@ impl WrapVersion for AlwaysV2 { } } -/// `WrapVersion` implementation which attempts to always convert the XCM to version 3 before wrapping it. +/// `WrapVersion` implementation which attempts to always convert the XCM to version 3 before +/// wrapping it. pub struct AlwaysV3; impl WrapVersion for AlwaysV3 { fn wrap_version( diff --git a/src/v2/junction.rs b/src/v2/junction.rs index be075a31f..73a502999 100644 --- a/src/v2/junction.rs +++ b/src/v2/junction.rs @@ -32,13 +32,13 @@ pub enum Junction { /// /// Generally used when the context is a Polkadot Relay-chain. Parachain(#[codec(compact)] u32), - /// A 32-byte identifier for an account of a specific network that is respected as a sovereign endpoint within - /// the context. + /// A 32-byte identifier for an account of a specific network that is respected as a sovereign + /// endpoint within the context. /// /// Generally used when the context is a Substrate-based chain. AccountId32 { network: NetworkId, id: [u8; 32] }, - /// An 8-byte index for an account of a specific network that is respected as a sovereign endpoint within - /// the context. + /// An 8-byte index for an account of a specific network that is respected as a sovereign + /// endpoint within the context. /// /// May be used when the context is a Frame-based chain and includes e.g. an indices pallet. AccountIndex64 { @@ -46,8 +46,8 @@ pub enum Junction { #[codec(compact)] index: u64, }, - /// A 20-byte identifier for an account of a specific network that is respected as a sovereign endpoint within - /// the context. + /// A 20-byte identifier for an account of a specific network that is respected as a sovereign + /// endpoint within the context. /// /// May be used when the context is an Ethereum or Bitcoin chain or smart-contract. AccountKey20 { network: NetworkId, key: [u8; 20] }, @@ -73,8 +73,8 @@ pub enum Junction { OnlyChild, /// A pluralistic body existing within consensus. /// - /// Typical to be used to represent a governance origin of a chain, but could in principle be used to represent - /// things such as multisigs also. + /// Typical to be used to represent a governance origin of a chain, but could in principle be + /// used to represent things such as multisigs also. Plurality { id: BodyId, part: BodyPart }, } diff --git a/src/v2/mod.rs b/src/v2/mod.rs index 014942d6b..8a67b771c 100644 --- a/src/v2/mod.rs +++ b/src/v2/mod.rs @@ -39,11 +39,10 @@ //! - `Order` is now obsolete and replaced entirely by `Instruction`. //! - `Xcm` is now a simple wrapper around a `Vec`. //! - During conversion from `Order` to `Instruction`, we do not handle `BuyExecution`s that have -//! nested XCMs, i.e. if the `instructions` field in the `BuyExecution` enum struct variant is -//! not empty, then the conversion will fail. To address this, rewrite the XCM using -//! `Instruction`s in chronological order. -//! - During conversion from `Xcm` to `Instruction`, we do not handle `RelayedFrom` messages at -//! all. +//! nested XCMs, i.e. if the `instructions` field in the `BuyExecution` enum struct variant is not +//! empty, then the conversion will fail. To address this, rewrite the XCM using `Instruction`s in +//! chronological order. +//! - During conversion from `Xcm` to `Instruction`, we do not handle `RelayedFrom` messages at all. //! //! ### XCM Pallet //! - The `Weigher` configuration item must have sensible weights defined for `BuyExecution` and @@ -153,20 +152,20 @@ pub enum BodyId { Executive, /// The unambiguous technical body (for Polkadot, this would be the Technical Committee). Technical, - /// The unambiguous legislative body (for Polkadot, this could be considered the opinion of a majority of - /// lock-voters). + /// The unambiguous legislative body (for Polkadot, this could be considered the opinion of a + /// majority of lock-voters). Legislative, - /// The unambiguous judicial body (this doesn't exist on Polkadot, but if it were to get a "grand oracle", it - /// may be considered as that). + /// The unambiguous judicial body (this doesn't exist on Polkadot, but if it were to get a + /// "grand oracle", it may be considered as that). Judicial, - /// The unambiguous defense body (for Polkadot, an opinion on the topic given via a public referendum - /// on the `staking_admin` track). + /// The unambiguous defense body (for Polkadot, an opinion on the topic given via a public + /// referendum on the `staking_admin` track). Defense, - /// The unambiguous administration body (for Polkadot, an opinion on the topic given via a public referendum - /// on the `general_admin` track). + /// The unambiguous administration body (for Polkadot, an opinion on the topic given via a + /// public referendum on the `general_admin` track). Administration, - /// The unambiguous treasury body (for Polkadot, an opinion on the topic given via a public referendum - /// on the `treasurer` track). + /// The unambiguous treasury body (for Polkadot, an opinion on the topic given via a public + /// referendum on the `treasurer` track). Treasury, } @@ -422,8 +421,8 @@ pub type Weight = u64; /// /// All messages are delivered from a known *origin*, expressed as a `MultiLocation`. /// -/// This is the inner XCM format and is version-sensitive. Messages are typically passed using the outer -/// XCM format, known as `VersionedXcm`. +/// This is the inner XCM format and is version-sensitive. Messages are typically passed using the +/// outer XCM format, known as `VersionedXcm`. #[derive(Derivative, Encode, Decode, TypeInfo, xcm_procedural::XcmWeightInfoTrait)] #[derivative(Clone(bound = ""), Eq(bound = ""), PartialEq(bound = ""), Debug(bound = ""))] #[codec(encode_bound())] @@ -435,7 +434,7 @@ pub enum Instruction { /// /// - `assets`: The asset(s) to be withdrawn into holding. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: WithdrawAsset(MultiAssets), @@ -493,7 +492,7 @@ pub enum Instruction { /// /// Safety: No concerns. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: TransferAsset { assets: MultiAssets, beneficiary: MultiLocation }, @@ -508,12 +507,12 @@ pub enum Instruction { /// - `dest`: The location whose sovereign account will own the assets and thus the effective /// beneficiary for the assets and the notification target for the reserve asset deposit /// message. - /// - `xcm`: The instructions that should follow the `ReserveAssetDeposited` - /// instruction, which is sent onwards to `dest`. + /// - `xcm`: The instructions that should follow the `ReserveAssetDeposited` instruction, which + /// is sent onwards to `dest`. /// /// Safety: No concerns. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: TransferReserveAsset { assets: MultiAssets, dest: MultiLocation, xcm: Xcm<()> }, @@ -528,7 +527,7 @@ pub enum Instruction { /// /// Safety: No concerns. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: Transact { @@ -538,10 +537,11 @@ pub enum Instruction { call: DoubleEncoded, }, - /// A message to notify about a new incoming HRMP channel. This message is meant to be sent by the - /// relay-chain to a para. + /// A message to notify about a new incoming HRMP channel. This message is meant to be sent by + /// the relay-chain to a para. /// - /// - `sender`: The sender in the to-be opened channel. Also, the initiator of the channel opening. + /// - `sender`: The sender in the to-be opened channel. Also, the initiator of the channel + /// opening. /// - `max_message_size`: The maximum size of a message proposed by the sender. /// - `max_capacity`: The maximum number of messages that can be queued in the channel. /// @@ -558,8 +558,8 @@ pub enum Instruction { }, /// A message to notify about that a previously sent open channel request has been accepted by - /// the recipient. That means that the channel will be opened during the next relay-chain session - /// change. This message is meant to be sent by the relay-chain to a para. + /// the recipient. That means that the channel will be opened during the next relay-chain + /// session change. This message is meant to be sent by the relay-chain to a para. /// /// Safety: The message should originate directly from the relay-chain. /// @@ -573,10 +573,10 @@ pub enum Instruction { recipient: u32, }, - /// A message to notify that the other party in an open channel decided to close it. In particular, - /// `initiator` is going to close the channel opened from `sender` to the `recipient`. The close - /// will be enacted at the next relay-chain session change. This message is meant to be sent by - /// the relay-chain to a para. + /// A message to notify that the other party in an open channel decided to close it. In + /// particular, `initiator` is going to close the channel opened from `sender` to the + /// `recipient`. The close will be enacted at the next relay-chain session change. This message + /// is meant to be sent by the relay-chain to a para. /// /// Safety: The message should originate directly from the relay-chain. /// @@ -600,14 +600,14 @@ pub enum Instruction { /// /// Safety: No concerns. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: ClearOrigin, /// Mutate the origin to some interior location. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: DescendOrigin(InteriorMultiLocation), @@ -623,7 +623,7 @@ pub enum Instruction { /// is sent as a reply may take to execute. NOTE: If this is unexpectedly large then the /// response may not execute at all. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: ReportError { @@ -639,11 +639,11 @@ pub enum Instruction { /// /// - `assets`: The asset(s) to remove from holding. /// - `max_assets`: The maximum number of unique assets/asset instances to remove from holding. - /// Only the first `max_assets` assets/instances of those matched by `assets` will be removed, - /// prioritized under standard asset ordering. Any others will remain in holding. + /// Only the first `max_assets` assets/instances of those matched by `assets` will be + /// removed, prioritized under standard asset ordering. Any others will remain in holding. /// - `beneficiary`: The new owner for the assets. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: DepositAsset { @@ -661,15 +661,15 @@ pub enum Instruction { /// /// - `assets`: The asset(s) to remove from holding. /// - `max_assets`: The maximum number of unique assets/asset instances to remove from holding. - /// Only the first `max_assets` assets/instances of those matched by `assets` will be removed, - /// prioritized under standard asset ordering. Any others will remain in holding. + /// Only the first `max_assets` assets/instances of those matched by `assets` will be + /// removed, prioritized under standard asset ordering. Any others will remain in holding. /// - `dest`: The location whose sovereign account will own the assets and thus the effective /// beneficiary for the assets and the notification target for the reserve asset deposit /// message. - /// - `xcm`: The orders that should follow the `ReserveAssetDeposited` instruction - /// which is sent onwards to `dest`. + /// - `xcm`: The orders that should follow the `ReserveAssetDeposited` instruction which is + /// sent onwards to `dest`. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: DepositReserveAsset { @@ -689,7 +689,7 @@ pub enum Instruction { /// - `give`: The asset(s) to remove from holding. /// - `receive`: The minimum amount of assets(s) which `give` should be exchanged for. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: ExchangeAsset { give: MultiAssetFilter, receive: MultiAssets }, @@ -699,13 +699,13 @@ pub enum Instruction { /// /// - `assets`: The asset(s) to remove from holding. /// - `reserve`: A valid location that acts as a reserve for all asset(s) in `assets`. The - /// sovereign account of this consensus system *on the reserve location* will have appropriate - /// assets withdrawn and `effects` will be executed on them. There will typically be only one - /// valid location on any given asset/chain combination. + /// sovereign account of this consensus system *on the reserve location* will have + /// appropriate assets withdrawn and `effects` will be executed on them. There will typically + /// be only one valid location on any given asset/chain combination. /// - `xcm`: The instructions to execute on the assets once withdrawn *on the reserve /// location*. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: InitiateReserveWithdraw { assets: MultiAssetFilter, reserve: MultiLocation, xcm: Xcm<()> }, @@ -718,10 +718,10 @@ pub enum Instruction { /// - `xcm`: The instructions to execute on the assets once arrived *on the destination /// location*. /// - /// NOTE: The `dest` location *MUST* respect this origin as a valid teleportation origin for all - /// `assets`. If it does not, then the assets may be lost. + /// NOTE: The `dest` location *MUST* respect this origin as a valid teleportation origin for + /// all `assets`. If it does not, then the assets may be lost. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: InitiateTeleport { assets: MultiAssetFilter, dest: MultiLocation, xcm: Xcm<()> }, @@ -739,7 +739,7 @@ pub enum Instruction { /// is sent as a reply may take to execute. NOTE: If this is unexpectedly large then the /// response may not execute at all. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: QueryHolding { @@ -759,14 +759,14 @@ pub enum Instruction { /// expected maximum weight of the total XCM to be executed for the /// `AllowTopLevelPaidExecutionFrom` barrier to allow the XCM be executed. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: BuyExecution { fees: MultiAsset, weight_limit: WeightLimit }, /// Refund any surplus weight previously bought with `BuyExecution`. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: None. RefundSurplus, @@ -782,7 +782,7 @@ pub enum Instruction { /// weight however includes only the difference between the previous handler and the new /// handler, which can reasonably be negative, which would result in a surplus. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: None. SetErrorHandler(Xcm), @@ -798,14 +798,14 @@ pub enum Instruction { /// weight however includes only the difference between the previous appendix and the new /// appendix, which can reasonably be negative, which would result in a surplus. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: None. SetAppendix(Xcm), /// Clear the Error Register. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: None. ClearError, @@ -817,14 +817,14 @@ pub enum Instruction { /// - `ticket`: The ticket of the asset; this is an abstract identifier to help locate the /// asset. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: ClaimAsset { assets: MultiAssets, ticket: MultiLocation }, /// Always throws an error of type `Trap`. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: /// - `Trap`: All circumstances, whose inner value is the same as this item's inner value. @@ -839,7 +839,7 @@ pub enum Instruction { /// is sent as a reply may take to execute. NOTE: If this is unexpectedly large then the /// response may not execute at all. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: *Fallible* SubscribeVersion { @@ -851,7 +851,7 @@ pub enum Instruction { /// Cancel the effect of a previous `SubscribeVersion` instruction. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: *Fallible* UnsubscribeVersion, diff --git a/src/v2/multiasset.rs b/src/v2/multiasset.rs index aae65dcbb..fdd7797a1 100644 --- a/src/v2/multiasset.rs +++ b/src/v2/multiasset.rs @@ -17,11 +17,14 @@ //! Cross-Consensus Message format asset data structures. //! //! This encompasses four types for representing assets: -//! - `MultiAsset`: A description of a single asset, either an instance of a non-fungible or some amount of a fungible. -//! - `MultiAssets`: A collection of `MultiAsset`s. These are stored in a `Vec` and sorted with fungibles first. -//! - `Wild`: A single asset wildcard, this can either be "all" assets, or all assets of a specific kind. -//! - `MultiAssetFilter`: A combination of `Wild` and `MultiAssets` designed for efficiently filtering an XCM holding -//! account. +//! - `MultiAsset`: A description of a single asset, either an instance of a non-fungible or some +//! amount of a fungible. +//! - `MultiAssets`: A collection of `MultiAsset`s. These are stored in a `Vec` and sorted with +//! fungibles first. +//! - `Wild`: A single asset wildcard, this can either be "all" assets, or all assets of a specific +//! kind. +//! - `MultiAssetFilter`: A combination of `Wild` and `MultiAssets` designed for efficiently +//! filtering an XCM holding account. use super::MultiLocation; use crate::v3::{ @@ -42,8 +45,8 @@ pub enum AssetInstance { /// Undefined - used if the non-fungible asset class has only one instance. Undefined, - /// A compact index. Technically this could be greater than `u128`, but this implementation supports only - /// values up to `2**128 - 1`. + /// A compact index. Technically this could be greater than `u128`, but this implementation + /// supports only values up to `2**128 - 1`. Index(#[codec(compact)] u128), /// A 4-byte fixed-length datum. @@ -165,19 +168,21 @@ impl AssetId { Ok(()) } - /// Use the value of `self` along with a `fun` fungibility specifier to create the corresponding `MultiAsset` value. + /// Use the value of `self` along with a `fun` fungibility specifier to create the corresponding + /// `MultiAsset` value. pub fn into_multiasset(self, fun: Fungibility) -> MultiAsset { MultiAsset { fun, id: self } } - /// Use the value of `self` along with a `fun` fungibility specifier to create the corresponding `WildMultiAsset` - /// wildcard (`AllOf`) value. + /// Use the value of `self` along with a `fun` fungibility specifier to create the corresponding + /// `WildMultiAsset` wildcard (`AllOf`) value. pub fn into_wild(self, fun: WildFungibility) -> WildMultiAsset { WildMultiAsset::AllOf { fun, id: self } } } -/// Classification of whether an asset is fungible or not, along with a mandatory amount or instance. +/// Classification of whether an asset is fungible or not, along with a mandatory amount or +/// instance. #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Encode, Decode, TypeInfo)] #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] pub enum Fungibility { @@ -300,7 +305,8 @@ impl TryFrom for MultiAsset { } } -/// A `Vec` of `MultiAsset`s. There may be no duplicate fungible items in here and when decoding, they must be sorted. +/// A `Vec` of `MultiAsset`s. There may be no duplicate fungible items in here and when decoding, +/// they must be sorted. #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Encode, TypeInfo)] #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] pub struct MultiAssets(Vec); @@ -370,11 +376,12 @@ impl MultiAssets { Self(Vec::new()) } - /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted and - /// which contain no duplicates. + /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted + /// and which contain no duplicates. /// - /// Returns `Ok` if the operation succeeds and `Err` if `r` is out of order or had duplicates. If you can't - /// guarantee that `r` is sorted and deduplicated, then use `From::>::from` which is infallible. + /// Returns `Ok` if the operation succeeds and `Err` if `r` is out of order or had duplicates. + /// If you can't guarantee that `r` is sorted and deduplicated, then use + /// `From::>::from` which is infallible. pub fn from_sorted_and_deduplicated(r: Vec) -> Result { if r.is_empty() { return Ok(Self(Vec::new())) @@ -389,20 +396,22 @@ impl MultiAssets { Ok(Self(r)) } - /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted and - /// which contain no duplicates. + /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted + /// and which contain no duplicates. /// - /// In release mode, this skips any checks to ensure that `r` is correct, making it a negligible-cost operation. - /// Generally though you should avoid using it unless you have a strict proof that `r` is valid. + /// In release mode, this skips any checks to ensure that `r` is correct, making it a + /// negligible-cost operation. Generally though you should avoid using it unless you have a + /// strict proof that `r` is valid. #[cfg(test)] pub fn from_sorted_and_deduplicated_skip_checks(r: Vec) -> Self { Self::from_sorted_and_deduplicated(r).expect("Invalid input r is not sorted/deduped") } - /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted and - /// which contain no duplicates. + /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted + /// and which contain no duplicates. /// - /// In release mode, this skips any checks to ensure that `r` is correct, making it a negligible-cost operation. - /// Generally though you should avoid using it unless you have a strict proof that `r` is valid. + /// In release mode, this skips any checks to ensure that `r` is correct, making it a + /// negligible-cost operation. Generally though you should avoid using it unless you have a + /// strict proof that `r` is valid. /// /// In test mode, this checks anyway and panics on fail. #[cfg(not(test))] @@ -410,7 +419,8 @@ impl MultiAssets { Self(r) } - /// Add some asset onto the list, saturating. This is quite a laborious operation since it maintains the ordering. + /// Add some asset onto the list, saturating. This is quite a laborious operation since it + /// maintains the ordering. pub fn push(&mut self, a: MultiAsset) { if let Fungibility::Fungible(ref amount) = a.fun { for asset in self.0.iter_mut().filter(|x| x.id == a.id) { @@ -489,19 +499,19 @@ impl TryFrom for WildFungibility { #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Encode, Decode, TypeInfo)] #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] pub enum WildMultiAsset { - /// All assets in the holding register, up to `usize` individual assets (different instances of non-fungibles could - /// be separate assets). + /// All assets in the holding register, up to `usize` individual assets (different instances of + /// non-fungibles could be separate assets). All, - /// All assets in the holding register of a given fungibility and ID. If operating on non-fungibles, then a limit - /// is provided for the maximum amount of matching instances. + /// All assets in the holding register of a given fungibility and ID. If operating on + /// non-fungibles, then a limit is provided for the maximum amount of matching instances. AllOf { id: AssetId, fun: WildFungibility }, } impl WildMultiAsset { /// Returns true if `self` is a super-set of the given `inner`. /// - /// Typically, any wildcard is never contained in anything else, and a wildcard can contain any other non-wildcard. - /// For more details, see the implementation and tests. + /// Typically, any wildcard is never contained in anything else, and a wildcard can contain any + /// other non-wildcard. For more details, see the implementation and tests. pub fn contains(&self, inner: &MultiAsset) -> bool { use WildMultiAsset::*; match self { @@ -565,8 +575,8 @@ impl From for MultiAssetFilter { impl MultiAssetFilter { /// Returns true if `self` is a super-set of the given `inner`. /// - /// Typically, any wildcard is never contained in anything else, and a wildcard can contain any other non-wildcard. - /// For more details, see the implementation and tests. + /// Typically, any wildcard is never contained in anything else, and a wildcard can contain any + /// other non-wildcard. For more details, see the implementation and tests. pub fn contains(&self, inner: &MultiAsset) -> bool { match self { MultiAssetFilter::Definite(ref assets) => assets.contains(inner), diff --git a/src/v2/multilocation.rs b/src/v2/multilocation.rs index 086a83277..9fb74e8af 100644 --- a/src/v2/multilocation.rs +++ b/src/v2/multilocation.rs @@ -174,8 +174,8 @@ impl MultiLocation { self.interior.push_front(new) } - /// Consumes `self` and returns a `MultiLocation` suffixed with `new`, or an `Err` with theoriginal value of - /// `self` in case of overflow. + /// Consumes `self` and returns a `MultiLocation` suffixed with `new`, or an `Err` with + /// theoriginal value of `self` in case of overflow. pub fn pushed_with_interior(self, new: Junction) -> result::Result { match self.interior.pushed_with(new) { Ok(i) => Ok(MultiLocation { interior: i, parents: self.parents }), @@ -183,8 +183,8 @@ impl MultiLocation { } } - /// Consumes `self` and returns a `MultiLocation` prefixed with `new`, or an `Err` with the original value of - /// `self` in case of overflow. + /// Consumes `self` and returns a `MultiLocation` prefixed with `new`, or an `Err` with the + /// original value of `self` in case of overflow. pub fn pushed_front_with_interior( self, new: Junction, @@ -430,7 +430,8 @@ impl From for MultiLocation { } } -/// A tuple struct which can be converted into a `MultiLocation` of `parents` value 1 with the inner interior. +/// A tuple struct which can be converted into a `MultiLocation` of `parents` value 1 with the inner +/// interior. #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)] pub struct ParentThen(pub Junctions); impl From for MultiLocation { @@ -448,7 +449,8 @@ impl From for MultiLocation { } } -/// A unit struct which can be converted into a `MultiLocation` of the inner `parents` value and the inner interior. +/// A unit struct which can be converted into a `MultiLocation` of the inner `parents` value and the +/// inner interior. #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)] pub struct AncestorThen(pub u8, pub Interior); impl> From> for MultiLocation { @@ -598,8 +600,8 @@ impl Junctions { } } - /// Splits off the first junction, returning the remaining suffix (first item in tuple) and the first element - /// (second item in tuple) or `None` if it was empty. + /// Splits off the first junction, returning the remaining suffix (first item in tuple) and the + /// first element (second item in tuple) or `None` if it was empty. pub fn split_first(self) -> (Junctions, Option) { match self { Junctions::Here => (Junctions::Here, None), @@ -614,8 +616,8 @@ impl Junctions { } } - /// Splits off the last junction, returning the remaining prefix (first item in tuple) and the last element - /// (second item in tuple) or `None` if it was empty. + /// Splits off the last junction, returning the remaining prefix (first item in tuple) and the + /// last element (second item in tuple) or `None` if it was empty. pub fn split_last(self) -> (Junctions, Option) { match self { Junctions::Here => (Junctions::Here, None), @@ -727,7 +729,8 @@ impl Junctions { } } - /// Returns the junction at index `i`, or `None` if the location doesn't contain that many elements. + /// Returns the junction at index `i`, or `None` if the location doesn't contain that many + /// elements. pub fn at(&self, i: usize) -> Option<&Junction> { Some(match (i, self) { (0, Junctions::X1(ref a)) => a, @@ -770,8 +773,8 @@ impl Junctions { }) } - /// Returns a mutable reference to the junction at index `i`, or `None` if the location doesn't contain that many - /// elements. + /// Returns a mutable reference to the junction at index `i`, or `None` if the location doesn't + /// contain that many elements. pub fn at_mut(&mut self, i: usize) -> Option<&mut Junction> { Some(match (i, self) { (0, Junctions::X1(ref mut a)) => a, diff --git a/src/v2/traits.rs b/src/v2/traits.rs index 524b659d5..ae03cf554 100644 --- a/src/v2/traits.rs +++ b/src/v2/traits.rs @@ -81,7 +81,8 @@ pub enum Error { /// Used by `Transact` when the functor cannot be decoded. #[codec(index = 17)] FailedToDecode, - /// Used by `Transact` to indicate that the given weight limit could be breached by the functor. + /// Used by `Transact` to indicate that the given weight limit could be breached by the + /// functor. #[codec(index = 18)] MaxWeightInvalid, /// Used by `BuyExecution` when the Holding Register does not contain payable fees. @@ -94,7 +95,8 @@ pub enum Error { #[codec(index = 21)] Trap(u64), - // Errors that happen prior to instructions being executed. These fall outside of the XCM spec. + // Errors that happen prior to instructions being executed. These fall outside of the XCM + // spec. /// XCM version not able to be handled. UnhandledXcmVersion, /// Execution of the XCM would potentially result in a greater weight used than weight limit. @@ -161,7 +163,8 @@ pub type Result = result::Result<(), Error>; pub enum Outcome { /// Execution completed successfully; given weight was used. Complete(Weight), - /// Execution started, but did not complete successfully due to the given error; given weight was used. + /// Execution started, but did not complete successfully due to the given error; given weight + /// was used. Incomplete(Weight, Error), /// Execution did not start due to the given error. Error(Error), @@ -194,9 +197,9 @@ impl Outcome { /// Type of XCM message executor. pub trait ExecuteXcm { - /// Execute some XCM `message` from `origin` using no more than `weight_limit` weight. The weight limit is - /// a basic hard-limit and the implementation may place further restrictions or requirements on weight and - /// other aspects. + /// Execute some XCM `message` from `origin` using no more than `weight_limit` weight. The + /// weight limit is a basic hard-limit and the implementation may place further restrictions or + /// requirements on weight and other aspects. fn execute_xcm( origin: impl Into, message: Xcm, @@ -215,8 +218,8 @@ pub trait ExecuteXcm { /// Execute some XCM `message` from `origin` using no more than `weight_limit` weight. /// - /// Some amount of `weight_credit` may be provided which, depending on the implementation, may allow - /// execution without associated payment. + /// Some amount of `weight_credit` may be provided which, depending on the implementation, may + /// allow execution without associated payment. fn execute_xcm_in_credit( origin: impl Into, message: Xcm, @@ -263,9 +266,9 @@ pub type SendResult = result::Result<(), SendError>; /// Utility for sending an XCM message. /// -/// These can be amalgamated in tuples to form sophisticated routing systems. In tuple format, each router might return -/// `NotApplicable` to pass the execution to the next sender item. Note that each `NotApplicable` -/// might alter the destination and the XCM message for to the next router. +/// These can be amalgamated in tuples to form sophisticated routing systems. In tuple format, each +/// router might return `NotApplicable` to pass the execution to the next sender item. Note that +/// each `NotApplicable` might alter the destination and the XCM message for to the next router. /// /// /// # Example @@ -330,9 +333,9 @@ pub type SendResult = result::Result<(), SendError>; pub trait SendXcm { /// Send an XCM `message` to a given `destination`. /// - /// If it is not a destination which can be reached with this type but possibly could by others, then it *MUST* - /// return `NotApplicable`. Any other error will cause the tuple implementation to exit early without - /// trying other type fields. + /// If it is not a destination which can be reached with this type but possibly could by others, + /// then it *MUST* return `NotApplicable`. Any other error will cause the tuple implementation + /// to exit early without trying other type fields. fn send_xcm(destination: impl Into, message: Xcm<()>) -> SendResult; } diff --git a/src/v3/junction.rs b/src/v3/junction.rs index 5fee8d1f8..b5dd5bc7c 100644 --- a/src/v3/junction.rs +++ b/src/v3/junction.rs @@ -127,20 +127,20 @@ pub enum BodyId { Executive, /// The unambiguous technical body (for Polkadot, this would be the Technical Committee). Technical, - /// The unambiguous legislative body (for Polkadot, this could be considered the opinion of a majority of - /// lock-voters). + /// The unambiguous legislative body (for Polkadot, this could be considered the opinion of a + /// majority of lock-voters). Legislative, - /// The unambiguous judicial body (this doesn't exist on Polkadot, but if it were to get a "grand oracle", it - /// may be considered as that). + /// The unambiguous judicial body (this doesn't exist on Polkadot, but if it were to get a + /// "grand oracle", it may be considered as that). Judicial, - /// The unambiguous defense body (for Polkadot, an opinion on the topic given via a public referendum - /// on the `staking_admin` track). + /// The unambiguous defense body (for Polkadot, an opinion on the topic given via a public + /// referendum on the `staking_admin` track). Defense, - /// The unambiguous administration body (for Polkadot, an opinion on the topic given via a public referendum - /// on the `general_admin` track). + /// The unambiguous administration body (for Polkadot, an opinion on the topic given via a + /// public referendum on the `general_admin` track). Administration, - /// The unambiguous treasury body (for Polkadot, an opinion on the topic given via a public referendum - /// on the `treasurer` track). + /// The unambiguous treasury body (for Polkadot, an opinion on the topic given via a public + /// referendum on the `treasurer` track). Treasury, } @@ -266,13 +266,13 @@ pub enum Junction { /// /// Generally used when the context is a Polkadot Relay-chain. Parachain(#[codec(compact)] u32), - /// A 32-byte identifier for an account of a specific network that is respected as a sovereign endpoint within - /// the context. + /// A 32-byte identifier for an account of a specific network that is respected as a sovereign + /// endpoint within the context. /// /// Generally used when the context is a Substrate-based chain. AccountId32 { network: Option, id: [u8; 32] }, - /// An 8-byte index for an account of a specific network that is respected as a sovereign endpoint within - /// the context. + /// An 8-byte index for an account of a specific network that is respected as a sovereign + /// endpoint within the context. /// /// May be used when the context is a Frame-based chain and includes e.g. an indices pallet. AccountIndex64 { @@ -280,14 +280,15 @@ pub enum Junction { #[codec(compact)] index: u64, }, - /// A 20-byte identifier for an account of a specific network that is respected as a sovereign endpoint within - /// the context. + /// A 20-byte identifier for an account of a specific network that is respected as a sovereign + /// endpoint within the context. /// /// May be used when the context is an Ethereum or Bitcoin chain or smart-contract. AccountKey20 { network: Option, key: [u8; 20] }, /// An instanced, indexed pallet that forms a constituent part of the context. /// /// Generally used when the context is a Frame-based chain. + // TODO XCMv4 inner should be `Compact`. PalletInstance(u8), /// A non-descript index within the context location. /// @@ -310,8 +311,8 @@ pub enum Junction { OnlyChild, /// A pluralistic body existing within consensus. /// - /// Typical to be used to represent a governance origin of a chain, but could in principle be used to represent - /// things such as multisigs also. + /// Typical to be used to represent a governance origin of a chain, but could in principle be + /// used to represent things such as multisigs also. Plurality { id: BodyId, part: BodyPart }, /// A global network capable of externalizing its own consensus. This is not generally /// meaningful outside of the universal level. @@ -413,7 +414,8 @@ impl Junction { /// Convert `self` into a `MultiLocation` containing `n` parents. /// - /// Similar to `Self::into_location`, with the added ability to specify the number of parent junctions. + /// Similar to `Self::into_location`, with the added ability to specify the number of parent + /// junctions. pub const fn into_exterior(self, n: u8) -> MultiLocation { MultiLocation { parents: n, interior: Junctions::X1(self) } } diff --git a/src/v3/junctions.rs b/src/v3/junctions.rs index da06cdbda..201a80fb7 100644 --- a/src/v3/junctions.rs +++ b/src/v3/junctions.rs @@ -137,7 +137,8 @@ impl Junctions { /// Convert `self` into a `MultiLocation` containing `n` parents. /// - /// Similar to `Self::into_location`, with the added ability to specify the number of parent junctions. + /// Similar to `Self::into_location`, with the added ability to specify the number of parent + /// junctions. pub const fn into_exterior(self, n: u8) -> MultiLocation { MultiLocation { parents: n, interior: self } } @@ -309,8 +310,8 @@ impl Junctions { } } - /// Splits off the first junction, returning the remaining suffix (first item in tuple) and the first element - /// (second item in tuple) or `None` if it was empty. + /// Splits off the first junction, returning the remaining suffix (first item in tuple) and the + /// first element (second item in tuple) or `None` if it was empty. pub fn split_first(self) -> (Junctions, Option) { match self { Junctions::Here => (Junctions::Here, None), @@ -325,8 +326,8 @@ impl Junctions { } } - /// Splits off the last junction, returning the remaining prefix (first item in tuple) and the last element - /// (second item in tuple) or `None` if it was empty. + /// Splits off the last junction, returning the remaining prefix (first item in tuple) and the + /// last element (second item in tuple) or `None` if it was empty. pub fn split_last(self) -> (Junctions, Option) { match self { Junctions::Here => (Junctions::Here, None), @@ -469,7 +470,8 @@ impl Junctions { } } - /// Returns the junction at index `i`, or `None` if the location doesn't contain that many elements. + /// Returns the junction at index `i`, or `None` if the location doesn't contain that many + /// elements. pub fn at(&self, i: usize) -> Option<&Junction> { Some(match (i, self) { (0, Junctions::X1(ref a)) => a, @@ -512,8 +514,8 @@ impl Junctions { }) } - /// Returns a mutable reference to the junction at index `i`, or `None` if the location doesn't contain that many - /// elements. + /// Returns a mutable reference to the junction at index `i`, or `None` if the location doesn't + /// contain that many elements. pub fn at_mut(&mut self, i: usize) -> Option<&mut Junction> { Some(match (i, self) { (0, Junctions::X1(ref mut a)) => a, diff --git a/src/v3/mod.rs b/src/v3/mod.rs index aac0b15d3..360867957 100644 --- a/src/v3/mod.rs +++ b/src/v3/mod.rs @@ -49,7 +49,7 @@ pub use multilocation::{ }; pub use traits::{ send_xcm, validate_send, Error, ExecuteXcm, Outcome, PreparedMessage, Result, SendError, - SendResult, SendXcm, Unwrappable, Weight, XcmHash, + SendResult, SendXcm, Weight, XcmHash, }; // These parts of XCM v2 are unchanged in XCM v3, and are re-imported here. pub use super::v2::OriginKind; @@ -184,7 +184,7 @@ pub mod prelude { NetworkId::{self, *}, OriginKind, Outcome, PalletInfo, Parent, ParentThen, PreparedMessage, QueryId, QueryResponseInfo, Response, Result as XcmResult, SendError, SendResult, SendXcm, - Unwrappable, Weight, + Weight, WeightLimit::{self, *}, WildFungibility::{self, Fungible as WildFungible, NonFungible as WildNonFungible}, WildMultiAsset::{self, *}, @@ -337,12 +337,12 @@ impl TryFrom for WeightLimit { /// Contextual data pertaining to a specific list of XCM instructions. #[derive(Clone, Eq, PartialEq, Encode, Decode, Debug)] pub struct XcmContext { - /// The current value of the Origin register of the XCVM. + /// The current value of the Origin register of the `XCVM`. pub origin: Option, /// The identity of the XCM; this may be a hash of its versioned encoding but could also be /// a high-level identity set by an appropriate barrier. pub message_id: XcmHash, - /// The current value of the Topic register of the XCVM. + /// The current value of the Topic register of the `XCVM`. pub topic: Option<[u8; 32]>, } @@ -367,8 +367,8 @@ impl XcmContext { /// /// All messages are delivered from a known *origin*, expressed as a `MultiLocation`. /// -/// This is the inner XCM format and is version-sensitive. Messages are typically passed using the outer -/// XCM format, known as `VersionedXcm`. +/// This is the inner XCM format and is version-sensitive. Messages are typically passed using the +/// outer XCM format, known as `VersionedXcm`. #[derive(Derivative, Encode, Decode, TypeInfo, xcm_procedural::XcmWeightInfoTrait)] #[derivative(Clone(bound = ""), Eq(bound = ""), PartialEq(bound = ""), Debug(bound = ""))] #[codec(encode_bound())] @@ -380,7 +380,7 @@ pub enum Instruction { /// /// - `assets`: The asset(s) to be withdrawn into holding. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: WithdrawAsset(MultiAssets), @@ -417,9 +417,8 @@ pub enum Instruction { /// - `response`: The message content. /// - `max_weight`: The maximum weight that handling this response should take. /// - `querier`: The location responsible for the initiation of the response, if there is one. - /// In general this will tend to be the same location as the receiver of this message. - /// NOTE: As usual, this is interpreted from the perspective of the receiving consensus - /// system. + /// In general this will tend to be the same location as the receiver of this message. NOTE: + /// As usual, this is interpreted from the perspective of the receiving consensus system. /// /// Safety: Since this is information only, there are no immediate concerns. However, it should /// be remembered that even if the Origin behaves reasonably, it can always be asked to make @@ -445,7 +444,7 @@ pub enum Instruction { /// /// Safety: No concerns. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: TransferAsset { assets: MultiAssets, beneficiary: MultiLocation }, @@ -460,12 +459,12 @@ pub enum Instruction { /// - `dest`: The location whose sovereign account will own the assets and thus the effective /// beneficiary for the assets and the notification target for the reserve asset deposit /// message. - /// - `xcm`: The instructions that should follow the `ReserveAssetDeposited` - /// instruction, which is sent onwards to `dest`. + /// - `xcm`: The instructions that should follow the `ReserveAssetDeposited` instruction, which + /// is sent onwards to `dest`. /// /// Safety: No concerns. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: TransferReserveAsset { assets: MultiAssets, dest: MultiLocation, xcm: Xcm<()> }, @@ -482,15 +481,16 @@ pub enum Instruction { /// /// Safety: No concerns. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: Transact { origin_kind: OriginKind, require_weight_at_most: Weight, call: DoubleEncoded }, - /// A message to notify about a new incoming HRMP channel. This message is meant to be sent by the - /// relay-chain to a para. + /// A message to notify about a new incoming HRMP channel. This message is meant to be sent by + /// the relay-chain to a para. /// - /// - `sender`: The sender in the to-be opened channel. Also, the initiator of the channel opening. + /// - `sender`: The sender in the to-be opened channel. Also, the initiator of the channel + /// opening. /// - `max_message_size`: The maximum size of a message proposed by the sender. /// - `max_capacity`: The maximum number of messages that can be queued in the channel. /// @@ -507,8 +507,8 @@ pub enum Instruction { }, /// A message to notify about that a previously sent open channel request has been accepted by - /// the recipient. That means that the channel will be opened during the next relay-chain session - /// change. This message is meant to be sent by the relay-chain to a para. + /// the recipient. That means that the channel will be opened during the next relay-chain + /// session change. This message is meant to be sent by the relay-chain to a para. /// /// Safety: The message should originate directly from the relay-chain. /// @@ -522,10 +522,10 @@ pub enum Instruction { recipient: u32, }, - /// A message to notify that the other party in an open channel decided to close it. In particular, - /// `initiator` is going to close the channel opened from `sender` to the `recipient`. The close - /// will be enacted at the next relay-chain session change. This message is meant to be sent by - /// the relay-chain to a para. + /// A message to notify that the other party in an open channel decided to close it. In + /// particular, `initiator` is going to close the channel opened from `sender` to the + /// `recipient`. The close will be enacted at the next relay-chain session change. This message + /// is meant to be sent by the relay-chain to a para. /// /// Safety: The message should originate directly from the relay-chain. /// @@ -549,14 +549,14 @@ pub enum Instruction { /// /// Safety: No concerns. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: ClearOrigin, /// Mutate the origin to some interior location. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: DescendOrigin(InteriorMultiLocation), @@ -567,7 +567,7 @@ pub enum Instruction { /// /// - `response_info`: Information for making the response. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: ReportError(QueryResponseInfo), @@ -578,7 +578,7 @@ pub enum Instruction { /// - `assets`: The asset(s) to remove from holding. /// - `beneficiary`: The new owner for the assets. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: DepositAsset { assets: MultiAssetFilter, beneficiary: MultiLocation }, @@ -593,10 +593,10 @@ pub enum Instruction { /// - `dest`: The location whose sovereign account will own the assets and thus the effective /// beneficiary for the assets and the notification target for the reserve asset deposit /// message. - /// - `xcm`: The orders that should follow the `ReserveAssetDeposited` instruction - /// which is sent onwards to `dest`. + /// - `xcm`: The orders that should follow the `ReserveAssetDeposited` instruction which is + /// sent onwards to `dest`. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: DepositReserveAsset { assets: MultiAssetFilter, dest: MultiLocation, xcm: Xcm<()> }, @@ -613,7 +613,7 @@ pub enum Instruction { /// and receive accordingly more. If `false`, then prefer to give as little as possible in /// order to receive as little as possible while receiving at least `want`. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: ExchangeAsset { give: MultiAssetFilter, want: MultiAssets, maximal: bool }, @@ -623,13 +623,13 @@ pub enum Instruction { /// /// - `assets`: The asset(s) to remove from holding. /// - `reserve`: A valid location that acts as a reserve for all asset(s) in `assets`. The - /// sovereign account of this consensus system *on the reserve location* will have appropriate - /// assets withdrawn and `effects` will be executed on them. There will typically be only one - /// valid location on any given asset/chain combination. + /// sovereign account of this consensus system *on the reserve location* will have + /// appropriate assets withdrawn and `effects` will be executed on them. There will typically + /// be only one valid location on any given asset/chain combination. /// - `xcm`: The instructions to execute on the assets once withdrawn *on the reserve /// location*. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: InitiateReserveWithdraw { assets: MultiAssetFilter, reserve: MultiLocation, xcm: Xcm<()> }, @@ -642,10 +642,10 @@ pub enum Instruction { /// - `xcm`: The instructions to execute on the assets once arrived *on the destination /// location*. /// - /// NOTE: The `dest` location *MUST* respect this origin as a valid teleportation origin for all - /// `assets`. If it does not, then the assets may be lost. + /// NOTE: The `dest` location *MUST* respect this origin as a valid teleportation origin for + /// all `assets`. If it does not, then the assets may be lost. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: InitiateTeleport { assets: MultiAssetFilter, dest: MultiLocation, xcm: Xcm<()> }, @@ -659,7 +659,7 @@ pub enum Instruction { /// will be, asset-wise, *the lesser of this value and the holding register*. No wildcards /// will be used when reporting assets back. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: ReportHolding { response_info: QueryResponseInfo, assets: MultiAssetFilter }, @@ -672,14 +672,14 @@ pub enum Instruction { /// expected maximum weight of the total XCM to be executed for the /// `AllowTopLevelPaidExecutionFrom` barrier to allow the XCM be executed. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: BuyExecution { fees: MultiAsset, weight_limit: WeightLimit }, /// Refund any surplus weight previously bought with `BuyExecution`. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: None. RefundSurplus, @@ -695,7 +695,7 @@ pub enum Instruction { /// weight however includes only the difference between the previous handler and the new /// handler, which can reasonably be negative, which would result in a surplus. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: None. SetErrorHandler(Xcm), @@ -711,14 +711,14 @@ pub enum Instruction { /// weight however includes only the difference between the previous appendix and the new /// appendix, which can reasonably be negative, which would result in a surplus. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: None. SetAppendix(Xcm), /// Clear the Error Register. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: None. ClearError, @@ -730,14 +730,14 @@ pub enum Instruction { /// - `ticket`: The ticket of the asset; this is an abstract identifier to help locate the /// asset. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: ClaimAsset { assets: MultiAssets, ticket: MultiLocation }, /// Always throws an error of type `Trap`. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: /// - `Trap`: All circumstances, whose inner value is the same as this item's inner value. @@ -752,7 +752,7 @@ pub enum Instruction { /// is sent as a reply may take to execute. NOTE: If this is unexpectedly large then the /// response may not execute at all. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: *Fallible* SubscribeVersion { @@ -763,7 +763,7 @@ pub enum Instruction { /// Cancel the effect of a previous `SubscribeVersion` instruction. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: *Fallible* UnsubscribeVersion, @@ -774,14 +774,14 @@ pub enum Instruction { /// error if the Holding does not contain the assets (to make this an error, use `ExpectAsset` /// prior). /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: *Infallible* BurnAsset(MultiAssets), /// Throw an error if Holding does not contain at least the given assets. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: /// - `ExpectationFalse`: If Holding Register does not contain the assets in the parameter. @@ -789,7 +789,7 @@ pub enum Instruction { /// Ensure that the Origin Register equals some given value and throw an error if not. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: /// - `ExpectationFalse`: If Origin Register is not equal to the parameter. @@ -797,7 +797,7 @@ pub enum Instruction { /// Ensure that the Error Register equals some given value and throw an error if not. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: /// - `ExpectationFalse`: If the value of the Error Register is not equal to the parameter. @@ -806,10 +806,11 @@ pub enum Instruction { /// Ensure that the Transact Status Register equals some given value and throw an error if /// not. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: - /// - `ExpectationFalse`: If the value of the Transact Status Register is not equal to the parameter. + /// - `ExpectationFalse`: If the value of the Transact Status Register is not equal to the + /// parameter. ExpectTransactStatus(MaybeErrorCode), /// Query the existence of a particular pallet type. @@ -823,22 +824,26 @@ pub enum Instruction { /// /// Safety: No concerns. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: *Fallible*. QueryPallet { module_name: Vec, response_info: QueryResponseInfo }, /// Ensure that a particular pallet with a particular version exists. /// - /// - `index: Compact`: The index which identifies the pallet. An error if no pallet exists at this index. + /// - `index: Compact`: The index which identifies the pallet. An error if no pallet exists at + /// this index. /// - `name: Vec`: Name which must be equal to the name of the pallet. - /// - `module_name: Vec`: Module name which must be equal to the name of the module in which the pallet exists. - /// - `crate_major: Compact`: Version number which must be equal to the major version of the crate which implements the pallet. - /// - `min_crate_minor: Compact`: Version number which must be at most the minor version of the crate which implements the pallet. + /// - `module_name: Vec`: Module name which must be equal to the name of the module in + /// which the pallet exists. + /// - `crate_major: Compact`: Version number which must be equal to the major version of the + /// crate which implements the pallet. + /// - `min_crate_minor: Compact`: Version number which must be at most the minor version of the + /// crate which implements the pallet. /// /// Safety: No concerns. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: /// - `ExpectationFalse`: In case any of the expectations are broken. @@ -861,7 +866,7 @@ pub enum Instruction { /// /// Safety: No concerns. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: *Fallible*. ReportTransactStatus(QueryResponseInfo), @@ -870,7 +875,7 @@ pub enum Instruction { /// /// Safety: No concerns. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: *Infallible*. ClearTransactStatus, @@ -885,7 +890,7 @@ pub enum Instruction { /// The `Junction` parameter should generally be a `GlobalConsensus` variant since it is only /// these which are children of the Universal Ancestor. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: *Fallible*. UniversalOrigin(Junction), @@ -906,7 +911,7 @@ pub enum Instruction { /// `destination: X1(Parachain(1000))`. Alternatively, to export a message for execution on /// Polkadot, you would call with `network: NetworkId:: Polkadot` and `destination: Here`. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: *Fallible*. ExportMessage { network: NetworkId, destination: InteriorMultiLocation, xcm: Xcm<()> }, @@ -922,7 +927,7 @@ pub enum Instruction { /// - `unlocker`: The value which the Origin must be for a corresponding `UnlockAsset` /// instruction to work. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: LockAsset { asset: MultiAsset, unlocker: MultiLocation }, @@ -935,7 +940,7 @@ pub enum Instruction { /// /// Safety: No concerns. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: UnlockAsset { asset: MultiAsset, target: MultiLocation }, @@ -961,43 +966,47 @@ pub enum Instruction { /// of course, if there is no record that the asset actually is locked. /// /// - `asset`: The asset(s) to be unlocked. - /// - `locker`: The location from which a previous `NoteUnlockable` was sent and to which - /// an `UnlockAsset` should be sent. + /// - `locker`: The location from which a previous `NoteUnlockable` was sent and to which an + /// `UnlockAsset` should be sent. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: RequestUnlock { asset: MultiAsset, locker: MultiLocation }, /// Sets the Fees Mode Register. /// - /// - `jit_withdraw`: The fees mode item; if set to `true` then fees for any instructions - /// are withdrawn as needed using the same mechanism as `WithdrawAssets`. + /// - `jit_withdraw`: The fees mode item; if set to `true` then fees for any instructions are + /// withdrawn as needed using the same mechanism as `WithdrawAssets`. /// - /// Kind: *Instruction*. + /// Kind: *Command*. /// /// Errors: SetFeesMode { jit_withdraw: bool }, /// Set the Topic Register. /// + /// The 32-byte array identifier in the parameter is not guaranteed to be + /// unique; if such a property is desired, it is up to the code author to + /// enforce uniqueness. + /// /// Safety: No concerns. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: SetTopic([u8; 32]), /// Clear the Topic Register. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: None. ClearTopic, /// Alter the current Origin to another given origin. /// - /// Kind: *Instruction* + /// Kind: *Command* /// /// Errors: If the existing state would not allow such a change. AliasOrigin(MultiLocation), diff --git a/src/v3/multiasset.rs b/src/v3/multiasset.rs index 06cd2c8b5..1668d1b87 100644 --- a/src/v3/multiasset.rs +++ b/src/v3/multiasset.rs @@ -17,11 +17,14 @@ //! Cross-Consensus Message format asset data structures. //! //! This encompasses four types for representing assets: -//! - `MultiAsset`: A description of a single asset, either an instance of a non-fungible or some amount of a fungible. -//! - `MultiAssets`: A collection of `MultiAsset`s. These are stored in a `Vec` and sorted with fungibles first. -//! - `Wild`: A single asset wildcard, this can either be "all" assets, or all assets of a specific kind. -//! - `MultiAssetFilter`: A combination of `Wild` and `MultiAssets` designed for efficiently filtering an XCM holding -//! account. +//! - `MultiAsset`: A description of a single asset, either an instance of a non-fungible or some +//! amount of a fungible. +//! - `MultiAssets`: A collection of `MultiAsset`s. These are stored in a `Vec` and sorted with +//! fungibles first. +//! - `Wild`: A single asset wildcard, this can either be "all" assets, or all assets of a specific +//! kind. +//! - `MultiAssetFilter`: A combination of `Wild` and `MultiAssets` designed for efficiently +//! filtering an XCM holding account. use super::{InteriorMultiLocation, MultiLocation}; use crate::v2::{ @@ -47,8 +50,8 @@ pub enum AssetInstance { /// Undefined - used if the non-fungible asset class has only one instance. Undefined, - /// A compact index. Technically this could be greater than `u128`, but this implementation supports only - /// values up to `2**128 - 1`. + /// A compact index. Technically this could be greater than `u128`, but this implementation + /// supports only values up to `2**128 - 1`. Index(#[codec(compact)] u128), /// A 4-byte fixed-length datum. @@ -234,7 +237,8 @@ impl TryFrom for u128 { } } -/// Classification of whether an asset is fungible or not, along with a mandatory amount or instance. +/// Classification of whether an asset is fungible or not, along with a mandatory amount or +/// instance. #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Encode, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] pub enum Fungibility { @@ -387,13 +391,14 @@ impl AssetId { Ok(()) } - /// Use the value of `self` along with a `fun` fungibility specifier to create the corresponding `MultiAsset` value. + /// Use the value of `self` along with a `fun` fungibility specifier to create the corresponding + /// `MultiAsset` value. pub fn into_multiasset(self, fun: Fungibility) -> MultiAsset { MultiAsset { fun, id: self } } - /// Use the value of `self` along with a `fun` fungibility specifier to create the corresponding `WildMultiAsset` - /// wildcard (`AllOf`) value. + /// Use the value of `self` along with a `fun` fungibility specifier to create the corresponding + /// `WildMultiAsset` wildcard (`AllOf`) value. pub fn into_wild(self, fun: WildFungibility) -> WildMultiAsset { WildMultiAsset::AllOf { fun, id: self } } @@ -406,7 +411,7 @@ pub struct MultiAsset { /// The overall asset identity (aka *class*, in the case of a non-fungible). pub id: AssetId, /// The fungibility of the asset, which contains either the amount (in the case of a fungible - /// asset) or the *insance ID`, the secondary asset identifier. + /// asset) or the *instance ID*, the secondary asset identifier. pub fun: Fungibility, } @@ -576,11 +581,12 @@ impl MultiAssets { Self(Vec::new()) } - /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted and - /// which contain no duplicates. + /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted + /// and which contain no duplicates. /// - /// Returns `Ok` if the operation succeeds and `Err` if `r` is out of order or had duplicates. If you can't - /// guarantee that `r` is sorted and deduplicated, then use `From::>::from` which is infallible. + /// Returns `Ok` if the operation succeeds and `Err` if `r` is out of order or had duplicates. + /// If you can't guarantee that `r` is sorted and deduplicated, then use + /// `From::>::from` which is infallible. pub fn from_sorted_and_deduplicated(r: Vec) -> Result { if r.is_empty() { return Ok(Self(Vec::new())) @@ -595,20 +601,22 @@ impl MultiAssets { Ok(Self(r)) } - /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted and - /// which contain no duplicates. + /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted + /// and which contain no duplicates. /// - /// In release mode, this skips any checks to ensure that `r` is correct, making it a negligible-cost operation. - /// Generally though you should avoid using it unless you have a strict proof that `r` is valid. + /// In release mode, this skips any checks to ensure that `r` is correct, making it a + /// negligible-cost operation. Generally though you should avoid using it unless you have a + /// strict proof that `r` is valid. #[cfg(test)] pub fn from_sorted_and_deduplicated_skip_checks(r: Vec) -> Self { Self::from_sorted_and_deduplicated(r).expect("Invalid input r is not sorted/deduped") } - /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted and - /// which contain no duplicates. + /// Create a new instance of `MultiAssets` from a `Vec` whose contents are sorted + /// and which contain no duplicates. /// - /// In release mode, this skips any checks to ensure that `r` is correct, making it a negligible-cost operation. - /// Generally though you should avoid using it unless you have a strict proof that `r` is valid. + /// In release mode, this skips any checks to ensure that `r` is correct, making it a + /// negligible-cost operation. Generally though you should avoid using it unless you have a + /// strict proof that `r` is valid. /// /// In test mode, this checks anyway and panics on fail. #[cfg(not(test))] @@ -616,7 +624,8 @@ impl MultiAssets { Self(r) } - /// Add some asset onto the list, saturating. This is quite a laborious operation since it maintains the ordering. + /// Add some asset onto the list, saturating. This is quite a laborious operation since it + /// maintains the ordering. pub fn push(&mut self, a: MultiAsset) { for asset in self.0.iter_mut().filter(|x| x.id == a.id) { match (&a.fun, &mut asset.fun) { diff --git a/src/v3/multilocation.rs b/src/v3/multilocation.rs index 09d547503..07f829d01 100644 --- a/src/v3/multilocation.rs +++ b/src/v3/multilocation.rs @@ -198,8 +198,8 @@ impl MultiLocation { self.interior.push_front(new) } - /// Consumes `self` and returns a `MultiLocation` suffixed with `new`, or an `Err` with theoriginal value of - /// `self` in case of overflow. + /// Consumes `self` and returns a `MultiLocation` suffixed with `new`, or an `Err` with + /// theoriginal value of `self` in case of overflow. pub fn pushed_with_interior( self, new: impl Into, @@ -210,8 +210,8 @@ impl MultiLocation { } } - /// Consumes `self` and returns a `MultiLocation` prefixed with `new`, or an `Err` with the original value of - /// `self` in case of overflow. + /// Consumes `self` and returns a `MultiLocation` prefixed with `new`, or an `Err` with the + /// original value of `self` in case of overflow. pub fn pushed_front_with_interior( self, new: impl Into, @@ -472,7 +472,8 @@ impl From for MultiLocation { } } -/// A tuple struct which can be converted into a `MultiLocation` of `parents` value 1 with the inner interior. +/// A tuple struct which can be converted into a `MultiLocation` of `parents` value 1 with the inner +/// interior. #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)] pub struct ParentThen(pub Junctions); impl From for MultiLocation { @@ -490,7 +491,8 @@ impl From for MultiLocation { } } -/// A unit struct which can be converted into a `MultiLocation` of the inner `parents` value and the inner interior. +/// A unit struct which can be converted into a `MultiLocation` of the inner `parents` value and the +/// inner interior. #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)] pub struct AncestorThen(pub u8, pub Interior); impl> From> for MultiLocation { diff --git a/src/v3/traits.rs b/src/v3/traits.rs index 0482c030e..128be42c2 100644 --- a/src/v3/traits.rs +++ b/src/v3/traits.rs @@ -86,7 +86,8 @@ pub enum Error { /// Used by `Transact` when the functor cannot be decoded. #[codec(index = 17)] FailedToDecode, - /// Used by `Transact` to indicate that the given weight limit could be breached by the functor. + /// Used by `Transact` to indicate that the given weight limit could be breached by the + /// functor. #[codec(index = 18)] MaxWeightInvalid, /// Used by `BuyExecution` when the Holding Register does not contain payable fees. @@ -138,7 +139,8 @@ pub enum Error { #[codec(index = 34)] NotDepositable, - // Errors that happen prior to instructions being executed. These fall outside of the XCM spec. + // Errors that happen prior to instructions being executed. These fall outside of the XCM + // spec. /// XCM version not able to be handled. UnhandledXcmVersion, /// Execution of the XCM would potentially result in a greater weight used than weight limit. @@ -263,7 +265,8 @@ impl From for Outcome { pub enum Outcome { /// Execution completed successfully; given weight was used. Complete(Weight), - /// Execution started, but did not complete successfully due to the given error; given weight was used. + /// Execution started, but did not complete successfully due to the given error; given weight + /// was used. Incomplete(Weight, Error), /// Execution did not start due to the given error. Error(Error), @@ -437,26 +440,6 @@ pub type XcmHash = [u8; 32]; /// Result value when attempting to send an XCM message. pub type SendResult = result::Result<(T, MultiAssets), SendError>; -pub trait Unwrappable { - type Inner; - fn none() -> Self; - fn some(i: Self::Inner) -> Self; - fn take(self) -> Option; -} - -impl Unwrappable for Option { - type Inner = T; - fn none() -> Self { - None - } - fn some(i: Self::Inner) -> Self { - Some(i) - } - fn take(self) -> Option { - self - } -} - /// Utility for sending an XCM message to a given location. /// /// These can be amalgamated in tuples to form sophisticated routing systems. In tuple format, each @@ -530,7 +513,7 @@ impl Unwrappable for Option { /// # } /// ``` pub trait SendXcm { - /// Intermediate value which connects the two phaases of the send operation. + /// Intermediate value which connects the two phases of the send operation. type Ticket; /// Check whether the given `_message` is deliverable to the given `_destination` and if so diff --git a/xcm-builder/Cargo.toml b/xcm-builder/Cargo.toml index 465d338fd..046b1e6df 100644 --- a/xcm-builder/Cargo.toml +++ b/xcm-builder/Cargo.toml @@ -3,55 +3,60 @@ name = "xcm-builder" description = "Tools & types for building with XCM and its executor." authors.workspace = true edition.workspace = true +license.workspace = true version.workspace = true [dependencies] impl-trait-for-tuples = "0.2.1" -parity-scale-codec = { version = "3.4.0", default-features = false, features = ["derive"] } +parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } xcm = { path = "..", default-features = false } xcm-executor = { path = "../xcm-executor", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-weights = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } log = { version = "0.4.17", default-features = false } # Polkadot dependencies -polkadot-parachain = { path = "../../parachain", default-features = false } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } [dev-dependencies] +assert_matches = "1.5.0" primitive-types = "0.12.1" -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } pallet-xcm = { path = "../pallet-xcm" } -polkadot-runtime-parachains = { path = "../../runtime/parachains" } -assert_matches = "1.5.0" -polkadot-test-runtime = { path = "../../runtime/test-runtime" } +pallet-salary = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +primitives = { package = "polkadot-primitives", git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-test-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } [features] default = ["std"] runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", "xcm-executor/runtime-benchmarks", ] std = [ + "frame-support/std", + "frame-system/std", "log/std", + "pallet-transaction-payment/std", "parity-scale-codec/std", + "polkadot-parachain/std", "scale-info/std", - "xcm/std", - "xcm-executor/std", - "sp-std/std", "sp-arithmetic/std", "sp-io/std", "sp-runtime/std", + "sp-std/std", "sp-weights/std", - "frame-support/std", - "frame-system/std", - "polkadot-parachain/std", - "pallet-transaction-payment/std", + "xcm-executor/std", + "xcm/std", ] diff --git a/xcm-builder/src/asset_conversion.rs b/xcm-builder/src/asset_conversion.rs index 583231d79..a246436a9 100644 --- a/xcm-builder/src/asset_conversion.rs +++ b/xcm-builder/src/asset_conversion.rs @@ -22,9 +22,9 @@ use sp_std::{marker::PhantomData, prelude::*, result}; use xcm::latest::prelude::*; use xcm_executor::traits::{Error as MatchError, MatchesFungibles, MatchesNonFungibles}; -/// Converter struct implementing `AssetIdConversion` converting a numeric asset ID (must be `TryFrom/TryInto`) into -/// a `GeneralIndex` junction, prefixed by some `MultiLocation` value. The `MultiLocation` value will typically be a -/// `PalletInstance` junction. +/// Converter struct implementing `AssetIdConversion` converting a numeric asset ID (must be +/// `TryFrom/TryInto`) into a `GeneralIndex` junction, prefixed by some `MultiLocation` value. +/// The `MultiLocation` value will typically be a `PalletInstance` junction. pub struct AsPrefixedGeneralIndex( PhantomData<(Prefix, AssetId, ConvertAssetId)>, ); @@ -286,11 +286,11 @@ mod tests { struct ClassInstanceIdConverter; impl MaybeEquivalence for ClassInstanceIdConverter { fn convert(value: &AssetInstance) -> Option { - value.clone().try_into().ok() + (*value).try_into().ok() } fn convert_back(value: &ClassInstanceId) -> Option { - Some(AssetInstance::from(value.clone())) + Some(AssetInstance::from(*value)) } } diff --git a/xcm-builder/src/barriers.rs b/xcm-builder/src/barriers.rs index c29dd6c68..353e111b8 100644 --- a/xcm-builder/src/barriers.rs +++ b/xcm-builder/src/barriers.rs @@ -52,6 +52,8 @@ impl ShouldExecute for TakeWeightCredit { } } +const MAX_ASSETS_FOR_BUY_EXECUTION: usize = 1; + /// Allows execution from `origin` if it is contained in `T` (i.e. `T::Contains(origin)`) taking /// payments into account. /// @@ -79,10 +81,10 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionFro instructions[..end] .matcher() .match_next_inst(|inst| match inst { - ReceiveTeleportedAsset(..) | - WithdrawAsset(..) | - ReserveAssetDeposited(..) | - ClaimAsset { .. } => Ok(()), + ReceiveTeleportedAsset(..) | ReserveAssetDeposited(..) => Ok(()), + WithdrawAsset(ref assets) if assets.len() <= MAX_ASSETS_FOR_BUY_EXECUTION => Ok(()), + ClaimAsset { ref assets, .. } if assets.len() <= MAX_ASSETS_FOR_BUY_EXECUTION => + Ok(()), _ => Err(ProcessMessageError::BadFormat), })? .skip_inst_while(|inst| matches!(inst, ClearOrigin))? @@ -207,6 +209,9 @@ impl< /// Sets the message ID to `t` using a `SetTopic(t)` in the last position if present. /// +/// Note that the message ID does not necessarily have to be unique; it is the +/// sender's responsibility to ensure uniqueness. +/// /// Requires some inner barrier to pass on the rest of the message. pub struct TrailingSetTopicAsId(PhantomData); impl ShouldExecute for TrailingSetTopicAsId { @@ -255,7 +260,7 @@ where /// Allows execution from any origin that is contained in `T` (i.e. `T::Contains(origin)`). /// -/// Use only for executions from completely trusted origins, from which no unpermissioned messages +/// Use only for executions from completely trusted origins, from which no permissionless messages /// can be sent. pub struct AllowUnpaidExecutionFrom(PhantomData); impl> ShouldExecute for AllowUnpaidExecutionFrom { diff --git a/xcm-builder/src/currency_adapter.rs b/xcm-builder/src/currency_adapter.rs index 32db84085..4dbd4fe8b 100644 --- a/xcm-builder/src/currency_adapter.rs +++ b/xcm-builder/src/currency_adapter.rs @@ -44,8 +44,8 @@ impl From for XcmError { } } -/// Simple adapter to use a currency as asset transactor. This type can be used as `type AssetTransactor` in -/// `xcm::Config`. +/// Simple adapter to use a currency as asset transactor. This type can be used as `type +/// AssetTransactor` in `xcm::Config`. /// /// # Example /// ``` diff --git a/xcm-builder/src/fungibles_adapter.rs b/xcm-builder/src/fungibles_adapter.rs index bcb0e9c87..d7fded01e 100644 --- a/xcm-builder/src/fungibles_adapter.rs +++ b/xcm-builder/src/fungibles_adapter.rs @@ -63,8 +63,8 @@ impl< /// The location which is allowed to mint a particular asset. #[derive(Copy, Clone, Eq, PartialEq)] pub enum MintLocation { - /// This chain is allowed to mint the asset. When we track teleports of the asset we ensure that - /// no more of the asset returns back to the chain than has been sent out. + /// This chain is allowed to mint the asset. When we track teleports of the asset we ensure + /// that no more of the asset returns back to the chain than has been sent out. Local, /// This chain is not allowed to mint the asset. When we track teleports of the asset we ensure /// that no more of the asset is sent out from the chain than has been previously received. diff --git a/xcm-builder/src/lib.rs b/xcm-builder/src/lib.rs index 984ace84d..e3f910409 100644 --- a/xcm-builder/src/lib.rs +++ b/xcm-builder/src/lib.rs @@ -33,8 +33,9 @@ pub use location_conversion::{ Account32Hash, AccountId32Aliases, AccountKey20Aliases, AliasesIntoAccountId32, ChildParachainConvertsVia, DescribeAccountId32Terminal, DescribeAccountIdTerminal, DescribeAccountKey20Terminal, DescribeAllTerminal, DescribeFamily, DescribeLocation, - DescribePalletTerminal, DescribeTerminus, GlobalConsensusParachainConvertsFor, - HashedDescription, ParentIsPreset, SiblingParachainConvertsVia, + DescribePalletTerminal, DescribeTerminus, GlobalConsensusConvertsFor, + GlobalConsensusParachainConvertsFor, HashedDescription, ParentIsPreset, + SiblingParachainConvertsVia, }; mod origin_conversion; diff --git a/xcm-builder/src/location_conversion.rs b/xcm-builder/src/location_conversion.rs index dc327c08d..26b48fc88 100644 --- a/xcm-builder/src/location_conversion.rs +++ b/xcm-builder/src/location_conversion.rs @@ -192,7 +192,7 @@ impl LegacyDescribeForeignChainAccount { } } -/// This is deprecated in favour of the more modular `HashedDescription` converter. If +/// This is deprecated in favor of the more modular `HashedDescription` converter. If /// your chain has previously used this, then you can retain backwards compatibility using /// `HashedDescription` and a tuple with `LegacyDescribeForeignChainAccount` as the first /// element. For example: @@ -235,12 +235,12 @@ impl LegacyDescribeForeignChainAccount { /// same plane. So, it is important which chain account A acts from. /// E.g. /// * From P1.2 A will act as -/// * hash(ParaPrefix, A, 1, 1) on P1.2 -/// * hash(ParaPrefix, A, 1, 0) on P1 +/// * hash(`ParaPrefix`, A, 1, 1) on P1.2 +/// * hash(`ParaPrefix`, A, 1, 0) on P1 /// * From P1 A will act as -/// * hash(RelayPrefix, A, 1) on P1.2 & P1.1 -/// * hash(ParaPrefix, A, 1, 1) on P2 -/// * hash(ParaPrefix, A, 1, 0) on R +/// * hash(`RelayPrefix`, A, 1) on P1.2 & P1.1 +/// * hash(`ParaPrefix`, A, 1, 1) on P2 +/// * hash(`ParaPrefix`, A, 1, 0) on R /// /// Note that the alias accounts have overlaps but never on the same /// chain when the sender comes from different chains. @@ -345,6 +345,43 @@ impl>, AccountId: From<[u8; 20]> + Into<[u8; 20]> } } +/// Converts a location which is a top-level relay chain (which provides its own consensus) into a +/// 32-byte `AccountId`. +/// +/// This will always result in the *same account ID* being returned for the same Relay-chain, +/// regardless of the relative security of this Relay-chain compared to the local chain. +/// +/// Note: No distinction is made between the cases when the given `UniversalLocation` lies within +/// the same consensus system (i.e. is itself or a parent) and when it is a foreign consensus +/// system. +pub struct GlobalConsensusConvertsFor( + PhantomData<(UniversalLocation, AccountId)>, +); +impl, AccountId: From<[u8; 32]> + Clone> + ConvertLocation for GlobalConsensusConvertsFor +{ + fn convert_location(location: &MultiLocation) -> Option { + let universal_source = UniversalLocation::get(); + log::trace!( + target: "xcm::location_conversion", + "GlobalConsensusConvertsFor universal_source: {:?}, location: {:?}", + universal_source, location, + ); + let (remote_network, remote_location) = + ensure_is_remote(universal_source, *location).ok()?; + + match remote_location { + Here => Some(AccountId::from(Self::from_params(&remote_network))), + _ => None, + } + } +} +impl GlobalConsensusConvertsFor { + fn from_params(network: &NetworkId) -> [u8; 32] { + (b"glblcnsnss_", network).using_encoded(blake2_256) + } +} + /// Converts a location which is a top-level parachain (i.e. a parachain held on a /// Relay-chain which provides its own consensus) into a 32-byte `AccountId`. /// @@ -473,6 +510,105 @@ mod tests { assert_eq!(inverted, Err(())); } + #[test] + fn global_consensus_converts_for_works() { + parameter_types! { + pub UniversalLocationInNetwork1: InteriorMultiLocation = X2(GlobalConsensus(ByGenesis([1; 32])), Parachain(1234)); + pub UniversalLocationInNetwork2: InteriorMultiLocation = X2(GlobalConsensus(ByGenesis([2; 32])), Parachain(1234)); + } + let network_1 = UniversalLocationInNetwork1::get().global_consensus().expect("NetworkId"); + let network_2 = UniversalLocationInNetwork2::get().global_consensus().expect("NetworkId"); + let network_3 = ByGenesis([3; 32]); + let network_4 = ByGenesis([4; 32]); + let network_5 = ByGenesis([5; 32]); + + let test_data = vec![ + (MultiLocation::parent(), false), + (MultiLocation::new(0, Here), false), + (MultiLocation::new(0, X1(GlobalConsensus(network_1))), false), + (MultiLocation::new(1, X1(GlobalConsensus(network_1))), false), + (MultiLocation::new(2, X1(GlobalConsensus(network_1))), false), + (MultiLocation::new(0, X1(GlobalConsensus(network_2))), false), + (MultiLocation::new(1, X1(GlobalConsensus(network_2))), false), + (MultiLocation::new(2, X1(GlobalConsensus(network_2))), true), + (MultiLocation::new(0, X2(GlobalConsensus(network_2), Parachain(1000))), false), + (MultiLocation::new(1, X2(GlobalConsensus(network_2), Parachain(1000))), false), + (MultiLocation::new(2, X2(GlobalConsensus(network_2), Parachain(1000))), false), + ]; + + for (location, expected_result) in test_data { + let result = + GlobalConsensusConvertsFor::::convert_location( + &location, + ); + match result { + Some(account) => { + assert_eq!( + true, expected_result, + "expected_result: {}, but conversion passed: {:?}, location: {:?}", + expected_result, account, location + ); + match &location { + MultiLocation { interior: X1(GlobalConsensus(network)), .. } => + assert_eq!( + account, + GlobalConsensusConvertsFor::::from_params(network), + "expected_result: {}, but conversion passed: {:?}, location: {:?}", expected_result, account, location + ), + _ => panic!("expected_result: {}, conversion passed: {:?}, but MultiLocation does not match expected pattern, location: {:?}", expected_result, account, location) + } + }, + None => { + assert_eq!( + false, expected_result, + "expected_result: {} - but conversion failed, location: {:?}", + expected_result, location + ); + }, + } + } + + // all success + let res_1_gc_network_3 = + GlobalConsensusConvertsFor::::convert_location( + &MultiLocation::new(2, X1(GlobalConsensus(network_3))), + ) + .expect("conversion is ok"); + let res_2_gc_network_3 = + GlobalConsensusConvertsFor::::convert_location( + &MultiLocation::new(2, X1(GlobalConsensus(network_3))), + ) + .expect("conversion is ok"); + let res_1_gc_network_4 = + GlobalConsensusConvertsFor::::convert_location( + &MultiLocation::new(2, X1(GlobalConsensus(network_4))), + ) + .expect("conversion is ok"); + let res_2_gc_network_4 = + GlobalConsensusConvertsFor::::convert_location( + &MultiLocation::new(2, X1(GlobalConsensus(network_4))), + ) + .expect("conversion is ok"); + let res_1_gc_network_5 = + GlobalConsensusConvertsFor::::convert_location( + &MultiLocation::new(2, X1(GlobalConsensus(network_5))), + ) + .expect("conversion is ok"); + let res_2_gc_network_5 = + GlobalConsensusConvertsFor::::convert_location( + &MultiLocation::new(2, X1(GlobalConsensus(network_5))), + ) + .expect("conversion is ok"); + + assert_ne!(res_1_gc_network_3, res_1_gc_network_4); + assert_ne!(res_1_gc_network_4, res_1_gc_network_5); + assert_ne!(res_1_gc_network_3, res_1_gc_network_5); + + assert_eq!(res_1_gc_network_3, res_2_gc_network_3); + assert_eq!(res_1_gc_network_4, res_2_gc_network_4); + assert_eq!(res_1_gc_network_5, res_2_gc_network_5); + } + #[test] fn global_consensus_parachain_converts_for_works() { parameter_types! { diff --git a/xcm-builder/src/origin_aliases.rs b/xcm-builder/src/origin_aliases.rs index d9e3ee3df..82c5f71b7 100644 --- a/xcm-builder/src/origin_aliases.rs +++ b/xcm-builder/src/origin_aliases.rs @@ -14,15 +14,16 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! Implementation for ContainsPair. +//! Implementation for `ContainsPair`. use frame_support::traits::{Contains, ContainsPair}; use sp_std::marker::PhantomData; use xcm::latest::prelude::*; -/// Alias a Foreign AccountId32 with a local AccountId32 if the Foreign AccountId32 matches the `Prefix` pattern. +/// Alias a Foreign `AccountId32` with a local `AccountId32` if the foreign `AccountId32` matches +/// the `Prefix` pattern. /// -/// Requires that the prefixed origin AccountId32 matches the target AccountId32. +/// Requires that the prefixed origin `AccountId32` matches the target `AccountId32`. pub struct AliasForeignAccountId32(PhantomData); impl> ContainsPair for AliasForeignAccountId32 diff --git a/xcm-builder/src/origin_conversion.rs b/xcm-builder/src/origin_conversion.rs index 0810b1ce2..112b26869 100644 --- a/xcm-builder/src/origin_conversion.rs +++ b/xcm-builder/src/origin_conversion.rs @@ -24,7 +24,8 @@ use sp_std::marker::PhantomData; use xcm::latest::{BodyId, BodyPart, Junction, Junctions::*, MultiLocation, NetworkId, OriginKind}; use xcm_executor::traits::{ConvertLocation, ConvertOrigin}; -/// Sovereign accounts use the system's `Signed` origin with an account ID derived from the `LocationConverter`. +/// Sovereign accounts use the system's `Signed` origin with an account ID derived from the +/// `LocationConverter`. pub struct SovereignSignedViaLocation( PhantomData<(LocationConverter, RuntimeOrigin)>, ); @@ -269,10 +270,11 @@ where } } -/// `Convert` implementation to convert from some a `Signed` (system) `Origin` into an `AccountId32`. +/// `Convert` implementation to convert from some a `Signed` (system) `Origin` into an +/// `AccountId32`. /// -/// Typically used when configuring `pallet-xcm` for allowing normal accounts to dispatch an XCM from an `AccountId32` -/// origin. +/// Typically used when configuring `pallet-xcm` for allowing normal accounts to dispatch an XCM +/// from an `AccountId32` origin. pub struct SignedToAccountId32( PhantomData<(RuntimeOrigin, AccountId, Network)>, ); @@ -296,11 +298,11 @@ where } } -/// `Convert` implementation to convert from some an origin which implements `Backing` into a corresponding `Plurality` -/// `MultiLocation`. +/// `Convert` implementation to convert from some an origin which implements `Backing` into a +/// corresponding `Plurality` `MultiLocation`. /// -/// Typically used when configuring `pallet-xcm` for allowing a collective's Origin to dispatch an XCM from a -/// `Plurality` origin. +/// Typically used when configuring `pallet-xcm` for allowing a collective's Origin to dispatch an +/// XCM from a `Plurality` origin. pub struct BackingToPlurality( PhantomData<(RuntimeOrigin, COrigin, Body)>, ); diff --git a/xcm-builder/src/pay.rs b/xcm-builder/src/pay.rs index 77c082e2f..e36d26e42 100644 --- a/xcm-builder/src/pay.rs +++ b/xcm-builder/src/pay.rs @@ -151,10 +151,10 @@ impl< } } -/// Specialization of the [PayOverXcm] trait to allow `[u8; 32]`-based `AccountId` values to be +/// Specialization of the [`PayOverXcm`] trait to allow `[u8; 32]`-based `AccountId` values to be /// paid on a remote chain. /// -/// Implementation of the [frame_support::traits::tokens::Pay] trait, to allow +/// Implementation of the [`frame_support::traits::tokens::Pay`] trait, to allow /// for XCM payments of a given `Balance` of `AssetKind` existing on a `DestinationChain` under /// ownership of some `Interior` location of the local chain to a particular `Beneficiary`. /// @@ -184,7 +184,7 @@ pub type PayAccountId32OnChainOverXcm< FixedLocation, >; -/// Simple struct which contains both an XCM `location` and `asset_id` to identift an asset which +/// Simple struct which contains both an XCM `location` and `asset_id` to identify an asset which /// exists on some chain. pub struct LocatableAssetId { /// The asset's ID. @@ -193,7 +193,7 @@ pub struct LocatableAssetId { pub location: MultiLocation, } -/// Adapter `struct` which implements a conversion from any `AssetKind` into a [LocatableAsset] +/// Adapter `struct` which implements a conversion from any `AssetKind` into a [`LocatableAsset`] /// value using a fixed `Location` for the `location` field. pub struct FixedLocation(sp_std::marker::PhantomData); impl, AssetKind: Into> Convert diff --git a/xcm-builder/src/process_xcm_message.rs b/xcm-builder/src/process_xcm_message.rs index 23fbb9d0c..8130d1732 100644 --- a/xcm-builder/src/process_xcm_message.rs +++ b/xcm-builder/src/process_xcm_message.rs @@ -26,7 +26,7 @@ use sp_std::{fmt::Debug, marker::PhantomData}; use sp_weights::{Weight, WeightMeter}; use xcm::prelude::*; -/// A message processor that delegates execution to an [XcmExecutor]. +/// A message processor that delegates execution to an [`XcmExecutor`]. pub struct ProcessXcmMessage( PhantomData<(MessageOrigin, XcmExecutor, Call)>, ); @@ -51,7 +51,7 @@ impl< .map_err(|_| ProcessMessageError::Unsupported)?; let pre = XcmExecutor::prepare(message).map_err(|_| ProcessMessageError::Unsupported)?; let required = pre.weight_of(); - ensure!(meter.can_accrue(required), ProcessMessageError::Overweight(required)); + ensure!(meter.can_consume(required), ProcessMessageError::Overweight(required)); let (consumed, result) = match XcmExecutor::execute(origin.into(), pre, id, Weight::zero()) { @@ -60,7 +60,7 @@ impl< // In the error-case we assume the worst case and consume all possible weight. Outcome::Error(_) => (required, Err(ProcessMessageError::Unsupported)), }; - meter.defensive_saturating_accrue(consumed); + meter.consume(consumed); result } } @@ -116,14 +116,14 @@ mod tests { Processor::process_message(msg, ORIGIN, meter, &mut id), Overweight(1000.into()) ); - assert_eq!(meter.consumed, 0.into()); + assert_eq!(meter.consumed(), 0.into()); } // Works with a limit of 1000. let meter = &mut WeightMeter::from_limit(1000.into()); let mut id = [0; 32]; assert_ok!(Processor::process_message(msg, ORIGIN, meter, &mut id)); - assert_eq!(meter.consumed, 1000.into()); + assert_eq!(meter.consumed(), 1000.into()); } } diff --git a/xcm-builder/src/routing.rs b/xcm-builder/src/routing.rs index c46e0ce78..39e9eab41 100644 --- a/xcm-builder/src/routing.rs +++ b/xcm-builder/src/routing.rs @@ -25,6 +25,11 @@ use xcm::prelude::*; /// appends one to the message filled with a universally unique ID. This ID is returned from a /// successful `deliver`. /// +/// If the message does already end with a `SetTopic` instruction, then it is the responsibility +/// of the code author to ensure that the ID supplied to `SetTopic` is universally unique. Due to +/// this property, consumers of the topic ID must be aware that a user-supplied ID may not be +/// unique. +/// /// This is designed to be at the top-level of any routers, since it will always mutate the /// passed `message` reference into a `None`. Don't try to combine it within a tuple except as the /// last element. diff --git a/xcm-builder/src/tests/assets.rs b/xcm-builder/src/tests/assets.rs index 9b8ba0e45..e1d61a9d1 100644 --- a/xcm-builder/src/tests/assets.rs +++ b/xcm-builder/src/tests/assets.rs @@ -147,10 +147,7 @@ fn reserve_transfer_should_work() { let message = Xcm(vec![TransferReserveAsset { assets: (Here, 100u128).into(), dest: Parachain(2).into(), - xcm: Xcm::<()>(vec![DepositAsset { - assets: AllCounted(1).into(), - beneficiary: three.clone(), - }]), + xcm: Xcm::<()>(vec![DepositAsset { assets: AllCounted(1).into(), beneficiary: three }]), }]); let hash = fake_message_hash(&message); let r = XcmExecutor::::execute_xcm( @@ -396,7 +393,8 @@ fn max_assets_limit_should_work() { ); assert_eq!(r, Outcome::Incomplete(Weight::from_parts(95, 95), XcmError::HoldingWouldOverflow)); - // Attempt to withdraw 4 different assets and then the same 4 and then a different 4 will succeed. + // Attempt to withdraw 4 different assets and then the same 4 and then a different 4 will + // succeed. let message = Xcm(vec![ WithdrawAsset(([1u8; 32], 100u128).into()), WithdrawAsset(([2u8; 32], 100u128).into()), diff --git a/xcm-builder/src/tests/bridging/local_para_para.rs b/xcm-builder/src/tests/bridging/local_para_para.rs index 77248e72e..406843a0f 100644 --- a/xcm-builder/src/tests/bridging/local_para_para.rs +++ b/xcm-builder/src/tests/bridging/local_para_para.rs @@ -25,7 +25,7 @@ parameter_types! { pub RemoteUniversalLocation: Junctions = X2(GlobalConsensus(Remote::get()), Parachain(1)); } type TheBridge = - TestBridge>; + TestBridge>; type Router = TestTopic, UniversalLocation>>; diff --git a/xcm-builder/src/tests/bridging/local_relay_relay.rs b/xcm-builder/src/tests/bridging/local_relay_relay.rs index ff2b71471..02c454bb2 100644 --- a/xcm-builder/src/tests/bridging/local_relay_relay.rs +++ b/xcm-builder/src/tests/bridging/local_relay_relay.rs @@ -25,7 +25,7 @@ parameter_types! { pub RemoteUniversalLocation: Junctions = X1(GlobalConsensus(Remote::get())); } type TheBridge = - TestBridge>; + TestBridge>; type Router = TestTopic, UniversalLocation>>; diff --git a/xcm-builder/src/tests/bridging/mod.rs b/xcm-builder/src/tests/bridging/mod.rs index 2b5de6297..45630dbfc 100644 --- a/xcm-builder/src/tests/bridging/mod.rs +++ b/xcm-builder/src/tests/bridging/mod.rs @@ -155,7 +155,7 @@ fn price( d: &InteriorMultiLocation, m: &Xcm<()>, ) -> Result { - Ok(validate_export::(n, c, s.clone(), d.clone(), m.clone())?.1) + Ok(validate_export::(n, c, *s, *d, m.clone())?.1) } fn deliver( @@ -205,7 +205,7 @@ impl, Remote: Get, RemoteExporter: ExportXcm> S // though it is `Remote`. ExecutorUniversalLocation::set(Remote::get()); let origin = Local::get().relative_to(&Remote::get()); - AllowUnpaidFrom::set(vec![origin.clone()]); + AllowUnpaidFrom::set(vec![origin]); set_exporter_override(price::, deliver::); // The we execute it: let mut id = fake_id(); @@ -255,7 +255,7 @@ impl, Remote: Get, RemoteExporter: ExportXcm> S // though it is `Remote`. ExecutorUniversalLocation::set(Remote::get()); let origin = Local::get().relative_to(&Remote::get()); - AllowPaidFrom::set(vec![origin.clone()]); + AllowPaidFrom::set(vec![origin]); set_exporter_override(price::, deliver::); // Then we execute it: let mut id = fake_id(); diff --git a/xcm-builder/src/tests/bridging/paid_remote_relay_relay.rs b/xcm-builder/src/tests/bridging/paid_remote_relay_relay.rs index 5472a3bd5..7593ea5f1 100644 --- a/xcm-builder/src/tests/bridging/paid_remote_relay_relay.rs +++ b/xcm-builder/src/tests/bridging/paid_remote_relay_relay.rs @@ -33,7 +33,7 @@ parameter_types! { // x (10 + 10) weight each). } type TheBridge = - TestBridge>; + TestBridge>; type RelayExporter = HaulBlobExporter; type LocalInnerRouter = ExecutingRouter; type LocalBridgeRouter = SovereignPaidRemoteExporter< @@ -80,7 +80,8 @@ fn sending_to_bridged_chain_works() { )]; assert_eq!(take_received_remote_messages(), expected); - // The export cost 50 ref time and 50 proof size weight units (and thus 100 units of balance). + // The export cost 50 ref time and 50 proof size weight units (and thus 100 units of + // balance). assert_eq!(asset_list(Parachain(100)), vec![(Here, 1000u128 - price).into()]); let entry = LogEntry { @@ -112,7 +113,7 @@ fn sending_to_bridged_chain_without_funds_fails() { let dest: MultiLocation = (Parent, Parent, Remote::get()).into(); // Routing won't work if we don't have enough funds. assert_eq!( - send_xcm::(dest.clone(), Xcm(vec![Trap(1)])), + send_xcm::(dest, Xcm(vec![Trap(1)])), Err(SendError::Transport("Error executing")), ); } @@ -154,7 +155,8 @@ fn sending_to_parachain_of_bridged_chain_works() { )]; assert_eq!(take_received_remote_messages(), expected); - // The export cost 50 ref time and 50 proof size weight units (and thus 100 units of balance). + // The export cost 50 ref time and 50 proof size weight units (and thus 100 units of + // balance). assert_eq!(asset_list(Parachain(100)), vec![(Here, 1000u128 - price).into()]); let entry = LogEntry { @@ -186,7 +188,7 @@ fn sending_to_parachain_of_bridged_chain_without_funds_fails() { let dest: MultiLocation = (Parent, Parent, Remote::get(), Parachain(100)).into(); // Routing won't work if we don't have enough funds. assert_eq!( - send_xcm::(dest.clone(), Xcm(vec![Trap(1)])), + send_xcm::(dest, Xcm(vec![Trap(1)])), Err(SendError::Transport("Error executing")), ); } diff --git a/xcm-builder/src/tests/bridging/remote_para_para.rs b/xcm-builder/src/tests/bridging/remote_para_para.rs index b760e6829..124a909bc 100644 --- a/xcm-builder/src/tests/bridging/remote_para_para.rs +++ b/xcm-builder/src/tests/bridging/remote_para_para.rs @@ -27,8 +27,9 @@ parameter_types! { pub BridgeTable: Vec<(NetworkId, MultiLocation, Option)> = vec![(Remote::get(), (Parent, Parachain(1)).into(), None)]; } -type TheBridge = - TestBridge>; +type TheBridge = TestBridge< + BridgeBlobDispatcher, +>; type RelayExporter = HaulBlobExporter; type LocalInnerRouter = UnpaidExecutingRouter; diff --git a/xcm-builder/src/tests/bridging/remote_para_para_via_relay.rs b/xcm-builder/src/tests/bridging/remote_para_para_via_relay.rs index 9dc94e27e..2ff1f9fb9 100644 --- a/xcm-builder/src/tests/bridging/remote_para_para_via_relay.rs +++ b/xcm-builder/src/tests/bridging/remote_para_para_via_relay.rs @@ -27,8 +27,9 @@ parameter_types! { pub BridgeTable: Vec<(NetworkId, MultiLocation, Option)> = vec![(Remote::get(), Parachain(1).into(), None)]; } -type TheBridge = - TestBridge>; +type TheBridge = TestBridge< + BridgeBlobDispatcher, +>; type RelayExporter = HaulBlobExporter; type LocalInnerRouter = UnpaidExecutingRouter; diff --git a/xcm-builder/src/tests/bridging/remote_relay_relay.rs b/xcm-builder/src/tests/bridging/remote_relay_relay.rs index 2b34c93c0..cdd6b89b7 100644 --- a/xcm-builder/src/tests/bridging/remote_relay_relay.rs +++ b/xcm-builder/src/tests/bridging/remote_relay_relay.rs @@ -28,7 +28,7 @@ parameter_types! { = vec![(Remote::get(), MultiLocation::parent(), None)]; } type TheBridge = - TestBridge>; + TestBridge>; type RelayExporter = HaulBlobExporter; type LocalInnerRouter = UnpaidExecutingRouter; diff --git a/xcm-builder/src/tests/mock.rs b/xcm-builder/src/tests/mock.rs index 66a676369..0e7b74810 100644 --- a/xcm-builder/src/tests/mock.rs +++ b/xcm-builder/src/tests/mock.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . +//! Mock implementations to test XCM builder configuration types. + use crate::{ barriers::{AllowSubscriptionsFrom, RespectSuspension, TrailingSetTopicAsId}, test_utils::*, @@ -42,7 +44,7 @@ pub use sp_std::{ marker::PhantomData, }; pub use xcm::latest::{prelude::*, Weight}; -use xcm_executor::traits::Properties; +use xcm_executor::traits::{Properties, QueryHandler, QueryResponseStatus}; pub use xcm_executor::{ traits::{ AssetExchange, AssetLock, CheckSuspension, ConvertOrigin, Enact, ExportXcm, FeeManager, @@ -60,8 +62,8 @@ pub enum TestOrigin { /// A dummy call. /// -/// Each item contains the amount of weight that it *wants* to consume as the first item, and the actual amount (if -/// different from the former) in the second option. +/// Each item contains the amount of weight that it *wants* to consume as the first item, and the +/// actual amount (if different from the former) in the second option. #[derive(Debug, Encode, Decode, Eq, PartialEq, Clone, Copy, scale_info::TypeInfo)] pub enum TestCall { OnlyRoot(Weight, Option), @@ -254,7 +256,7 @@ impl TransactAsset for TestAssetTransactor { who: &MultiLocation, _context: &XcmContext, ) -> Result<(), XcmError> { - add_asset(who.clone(), what.clone()); + add_asset(*who, what.clone()); Ok(()) } @@ -410,6 +412,63 @@ pub fn response(query_id: u64) -> Option { }) } +/// Mock implementation of the [`QueryHandler`] trait for creating XCM success queries and expecting +/// responses. +pub struct TestQueryHandler(core::marker::PhantomData<(T, BlockNumber)>); +impl QueryHandler + for TestQueryHandler +{ + type QueryId = u64; + type BlockNumber = BlockNumber; + type Error = XcmError; + type UniversalLocation = T::UniversalLocation; + + fn new_query( + responder: impl Into, + _timeout: Self::BlockNumber, + _match_querier: impl Into, + ) -> Self::QueryId { + let query_id = 1; + expect_response(query_id, responder.into()); + query_id + } + + fn report_outcome( + message: &mut Xcm<()>, + responder: impl Into, + timeout: Self::BlockNumber, + ) -> Result { + let responder = responder.into(); + let destination = Self::UniversalLocation::get() + .invert_target(&responder) + .map_err(|()| XcmError::LocationNotInvertible)?; + let query_id = Self::new_query(responder, timeout, Here); + let response_info = QueryResponseInfo { destination, query_id, max_weight: Weight::zero() }; + let report_error = Xcm(vec![ReportError(response_info)]); + message.0.insert(0, SetAppendix(report_error)); + Ok(query_id) + } + + fn take_response(query_id: Self::QueryId) -> QueryResponseStatus { + QUERIES + .with(|q| { + q.borrow().get(&query_id).and_then(|v| match v { + ResponseSlot::Received(r) => Some(QueryResponseStatus::Ready { + response: r.clone(), + at: Self::BlockNumber::zero(), + }), + _ => Some(QueryResponseStatus::NotFound), + }) + }) + .unwrap_or(QueryResponseStatus::NotFound) + } + + #[cfg(feature = "runtime-benchmarks")] + fn expect_response(_id: Self::QueryId, _response: xcm::latest::Response) { + // Unnecessary since it's only a test implementation + } +} + parameter_types! { pub static ExecutorUniversalLocation: InteriorMultiLocation = (ByGenesis([0; 32]), Parachain(42)).into(); @@ -515,7 +574,7 @@ pub fn disallow_unlock( pub fn unlock_allowed(unlocker: &MultiLocation, asset: &MultiAsset, owner: &MultiLocation) -> bool { ALLOWED_UNLOCKS.with(|l| { l.borrow_mut() - .get(&(owner.clone(), unlocker.clone())) + .get(&(*owner, *unlocker)) .map_or(false, |x| x.contains_asset(asset)) }) } @@ -550,7 +609,7 @@ pub fn request_unlock_allowed( ) -> bool { ALLOWED_REQUEST_UNLOCKS.with(|l| { l.borrow_mut() - .get(&(owner.clone(), locker.clone())) + .get(&(*owner, *locker)) .map_or(false, |x| x.contains_asset(asset)) }) } @@ -560,11 +619,11 @@ impl Enact for TestTicket { fn enact(self) -> Result<(), LockError> { match &self.0 { LockTraceItem::Lock { unlocker, asset, owner } => - allow_unlock(unlocker.clone(), asset.clone(), owner.clone()), + allow_unlock(*unlocker, asset.clone(), *owner), LockTraceItem::Unlock { unlocker, asset, owner } => - disallow_unlock(unlocker.clone(), asset.clone(), owner.clone()), + disallow_unlock(*unlocker, asset.clone(), *owner), LockTraceItem::Reduce { locker, asset, owner } => - disallow_request_unlock(locker.clone(), asset.clone(), owner.clone()), + disallow_request_unlock(*locker, asset.clone(), *owner), _ => {}, } LOCK_TRACE.with(move |l| l.borrow_mut().push(self.0)); @@ -583,7 +642,7 @@ impl AssetLock for TestAssetLock { asset: MultiAsset, owner: MultiLocation, ) -> Result { - ensure!(assets(owner.clone()).contains_asset(&asset), LockError::AssetNotOwned); + ensure!(assets(owner).contains_asset(&asset), LockError::AssetNotOwned); Ok(TestTicket(LockTraceItem::Lock { unlocker, asset, owner })) } @@ -601,7 +660,7 @@ impl AssetLock for TestAssetLock { asset: MultiAsset, owner: MultiLocation, ) -> Result<(), LockError> { - allow_request_unlock(locker.clone(), asset.clone(), owner.clone()); + allow_request_unlock(locker, asset.clone(), owner); let item = LockTraceItem::Note { locker, asset, owner }; LOCK_TRACE.with(move |l| l.borrow_mut().push(item)); Ok(()) diff --git a/xcm-builder/src/tests/mod.rs b/xcm-builder/src/tests/mod.rs index 6daf1872f..e11caf628 100644 --- a/xcm-builder/src/tests/mod.rs +++ b/xcm-builder/src/tests/mod.rs @@ -34,6 +34,7 @@ mod bridging; mod expecting; mod locking; mod origins; +mod pay; mod querying; mod transacting; mod version_subscriptions; diff --git a/xcm-builder/src/tests/pay/mock.rs b/xcm-builder/src/tests/pay/mock.rs new file mode 100644 index 000000000..c663b0a4d --- /dev/null +++ b/xcm-builder/src/tests/pay/mock.rs @@ -0,0 +1,336 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use super::*; + +use frame_support::traits::{AsEnsureOriginWithArg, Nothing}; + +use frame_support::derive_impl; + +use frame_support::{ + construct_runtime, parameter_types, + traits::{ConstU32, Everything}, +}; +use frame_system::{EnsureRoot, EnsureSigned}; +use polkadot_test_runtime::SignedExtra; +use primitives::{AccountIndex, BlakeTwo256, Signature}; +use sp_runtime::{generic, traits::MaybeEquivalence, AccountId32, BuildStorage}; +use xcm_executor::{traits::ConvertLocation, XcmExecutor}; + +pub type Address = sp_runtime::MultiAddress; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; +pub type Header = generic::Header; +pub type Block = generic::Block; + +pub type BlockNumber = u32; +pub type AccountId = AccountId32; + +construct_runtime!( + pub struct Test { + System: frame_system, + Balances: pallet_balances, + Assets: pallet_assets, + Salary: pallet_salary, + XcmPallet: pallet_xcm, + } +); + +parameter_types! { + pub const BlockHashCount: BlockNumber = 250; +} + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] +impl frame_system::Config for Test { + type Block = Block; + type BlockHashCount = BlockHashCount; + type BaseCallFilter = frame_support::traits::Everything; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type PalletInfo = PalletInfo; + type OnSetCode = (); + type AccountData = pallet_balances::AccountData; + type AccountId = AccountId; + type Lookup = sp_runtime::traits::IdentityLookup; +} + +pub type Balance = u128; + +parameter_types! { + pub const ExistentialDeposit: Balance = 1; +} + +impl pallet_balances::Config for Test { + type MaxLocks = ConstU32<0>; + type Balance = Balance; + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type RuntimeHoldReason = RuntimeHoldReason; + type FreezeIdentifier = (); + type MaxHolds = ConstU32<0>; + type MaxFreezes = ConstU32<0>; +} + +parameter_types! { + pub const AssetDeposit: u128 = 1_000_000; + pub const MetadataDepositBase: u128 = 1_000_000; + pub const MetadataDepositPerByte: u128 = 100_000; + pub const AssetAccountDeposit: u128 = 1_000_000; + pub const ApprovalDeposit: u128 = 1_000_000; + pub const AssetsStringLimit: u32 = 50; + pub const RemoveItemsLimit: u32 = 50; +} + +impl pallet_assets::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Balance = Balance; + type AssetId = AssetIdForAssets; + type Currency = Balances; + type CreateOrigin = AsEnsureOriginWithArg>; + type ForceOrigin = EnsureRoot; + type AssetDeposit = AssetDeposit; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type AssetAccountDeposit = AssetAccountDeposit; + type ApprovalDeposit = ApprovalDeposit; + type StringLimit = AssetsStringLimit; + type Freezer = (); + type Extra = (); + type WeightInfo = (); + type RemoveItemsLimit = RemoveItemsLimit; + type AssetIdParameter = AssetIdForAssets; + type CallbackHandle = (); + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = (); +} + +parameter_types! { + pub const RelayLocation: MultiLocation = Here.into_location(); + pub const AnyNetwork: Option = None; + pub UniversalLocation: InteriorMultiLocation = (ByGenesis([0; 32]), Parachain(42)).into(); + pub UnitWeightCost: u64 = 1_000; + pub static AdvertisedXcmVersion: u32 = 3; + pub const BaseXcmWeight: Weight = Weight::from_parts(1_000, 1_000); + pub CurrencyPerSecondPerByte: (AssetId, u128, u128) = (Concrete(RelayLocation::get()), 1, 1); + pub TrustedAssets: (MultiAssetFilter, MultiLocation) = (All.into(), Here.into()); + pub const MaxInstructions: u32 = 100; + pub const MaxAssetsIntoHolding: u32 = 64; + pub CheckingAccount: AccountId = XcmPallet::check_account(); +} + +type AssetIdForAssets = u128; + +pub struct FromMultiLocationToAsset( + core::marker::PhantomData<(MultiLocation, AssetId)>, +); +impl MaybeEquivalence + for FromMultiLocationToAsset +{ + fn convert(value: &MultiLocation) -> Option { + match value { + MultiLocation { parents: 0, interior: Here } => Some(0 as AssetIdForAssets), + MultiLocation { parents: 1, interior: Here } => Some(1 as AssetIdForAssets), + MultiLocation { parents: 0, interior: X2(PalletInstance(1), GeneralIndex(index)) } + if ![0, 1].contains(index) => + Some(*index as AssetIdForAssets), + _ => None, + } + } + + fn convert_back(value: &AssetIdForAssets) -> Option { + match value { + 0u128 => Some(MultiLocation { parents: 1, interior: Here }), + para_id @ 1..=1000 => + Some(MultiLocation { parents: 1, interior: X1(Parachain(*para_id as u32)) }), + _ => None, + } + } +} + +pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalAssetsTransactor = FungiblesAdapter< + Assets, + ConvertedConcreteId< + AssetIdForAssets, + Balance, + FromMultiLocationToAsset, + JustTry, + >, + SovereignAccountOf, + AccountId, + NoChecking, + CheckingAccount, +>; + +type OriginConverter = ( + pallet_xcm::XcmPassthrough, + SignedAccountId32AsNative, +); +type Barrier = AllowUnpaidExecutionFrom; + +pub struct DummyWeightTrader; +impl WeightTrader for DummyWeightTrader { + fn new() -> Self { + DummyWeightTrader + } + + fn buy_weight( + &mut self, + _weight: Weight, + _payment: xcm_executor::Assets, + _context: &XcmContext, + ) -> Result { + Ok(xcm_executor::Assets::default()) + } +} + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type RuntimeCall = RuntimeCall; + type XcmSender = TestMessageSender; + type AssetTransactor = LocalAssetsTransactor; + type OriginConverter = OriginConverter; + type IsReserve = (); + type IsTeleporter = (); + type UniversalLocation = UniversalLocation; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + type Trader = DummyWeightTrader; + type ResponseHandler = XcmPallet; + type AssetTrap = XcmPallet; + type AssetLocker = (); + type AssetExchanger = (); + type AssetClaims = XcmPallet; + type SubscriptionService = XcmPallet; + type PalletInstancesInfo = (); + type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = Everything; + type Aliasers = Nothing; +} + +parameter_types! { + pub TreasuryAccountId: AccountId = AccountId::new([42u8; 32]); +} + +pub struct TreasuryToAccount; +impl ConvertLocation for TreasuryToAccount { + fn convert_location(location: &MultiLocation) -> Option { + match location { + MultiLocation { + parents: 1, + interior: + X2(Parachain(42), Plurality { id: BodyId::Treasury, part: BodyPart::Voice }), + } => Some(TreasuryAccountId::get()), // Hardcoded test treasury account id + _ => None, + } + } +} + +type SovereignAccountOf = ( + AccountId32Aliases, + TreasuryToAccount, + HashedDescription>, +); + +#[cfg(feature = "runtime-benchmarks")] +parameter_types! { + pub ReachableDest: Option = Some(Parachain(1000).into()); +} + +impl pallet_xcm::Config for Test { + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; + type XcmRouter = TestMessageSender; + type ExecuteXcmOrigin = EnsureXcmOrigin; + type XcmExecuteFilter = Everything; + type XcmExecutor = XcmExecutor; + type XcmTeleportFilter = Everything; + type XcmReserveTransferFilter = Everything; + type Weigher = FixedWeightBounds; + type UniversalLocation = UniversalLocation; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + type AdvertisedXcmVersion = AdvertisedXcmVersion; + type TrustedLockers = (); + type SovereignAccountOf = SovereignAccountOf; + type Currency = Balances; + type CurrencyMatcher = IsConcrete; + type MaxLockers = frame_support::traits::ConstU32<8>; + type MaxRemoteLockConsumers = frame_support::traits::ConstU32<0>; + type RemoteLockConsumerIdentifier = (); + type WeightInfo = pallet_xcm::TestWeightInfo; + #[cfg(feature = "runtime-benchmarks")] + type ReachableDest = ReachableDest; + type AdminOrigin = EnsureRoot; +} + +pub const UNITS: Balance = 1_000_000_000_000; +pub const INITIAL_BALANCE: Balance = 100 * UNITS; +pub const MINIMUM_BALANCE: Balance = 1 * UNITS; + +pub fn sibling_chain_account_id(para_id: u32, account: [u8; 32]) -> AccountId { + let location: MultiLocation = + (Parent, Parachain(para_id), Junction::AccountId32 { id: account, network: None }).into(); + SovereignAccountOf::convert_location(&location).unwrap() +} + +pub fn new_test_ext() -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); + let admin_account: AccountId = AccountId::new([0u8; 32]); + pallet_assets::GenesisConfig:: { + assets: vec![ + (0, admin_account.clone(), true, MINIMUM_BALANCE), + (1, admin_account.clone(), true, MINIMUM_BALANCE), + (100, admin_account.clone(), true, MINIMUM_BALANCE), + ], + metadata: vec![ + (0, "Native token".encode(), "NTV".encode(), 12), + (1, "Relay token".encode(), "RLY".encode(), 12), + (100, "Test token".encode(), "TST".encode(), 12), + ], + accounts: vec![ + (0, sibling_chain_account_id(42, [3u8; 32]), INITIAL_BALANCE), + (1, TreasuryAccountId::get(), INITIAL_BALANCE), + (100, TreasuryAccountId::get(), INITIAL_BALANCE), + ], + } + .assimilate_storage(&mut t) + .unwrap(); + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext +} + +pub fn next_block() { + System::set_block_number(System::block_number() + 1); +} + +pub fn run_to(block_number: BlockNumber) { + while System::block_number() < block_number { + next_block(); + } +} diff --git a/xcm-builder/src/tests/pay/mod.rs b/xcm-builder/src/tests/pay/mod.rs new file mode 100644 index 000000000..8adf1ad2f --- /dev/null +++ b/xcm-builder/src/tests/pay/mod.rs @@ -0,0 +1,21 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +use super::*; + +mod mock; +mod pay; +mod salary; diff --git a/xcm-builder/src/tests/pay/pay.rs b/xcm-builder/src/tests/pay/pay.rs new file mode 100644 index 000000000..28b2feec0 --- /dev/null +++ b/xcm-builder/src/tests/pay/pay.rs @@ -0,0 +1,158 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Tests for making sure `PayOverXcm::pay` generates the correct message and sends it to the +//! correct destination + +use super::{mock::*, *}; +use frame_support::{assert_ok, traits::tokens::Pay}; + +/// Type representing both a location and an asset that is held at that location. +/// The id of the held asset is relative to the location where it is being held. +#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq)] +pub struct AssetKind { + destination: MultiLocation, + asset_id: AssetId, +} + +pub struct LocatableAssetKindConverter; +impl sp_runtime::traits::Convert for LocatableAssetKindConverter { + fn convert(value: AssetKind) -> LocatableAssetId { + LocatableAssetId { asset_id: value.asset_id, location: value.destination } + } +} + +parameter_types! { + pub SenderAccount: AccountId = AccountId::new([3u8; 32]); + pub InteriorAccount: InteriorMultiLocation = AccountId32 { id: SenderAccount::get().into(), network: None }.into(); + pub InteriorBody: InteriorMultiLocation = Plurality { id: BodyId::Treasury, part: BodyPart::Voice }.into(); + pub Timeout: BlockNumber = 5; // 5 blocks +} + +/// Scenario: +/// Account #3 on the local chain, parachain 42, controls an amount of funds on parachain 2. +/// [`PayOverXcm::pay`] creates the correct message for account #3 to pay another account, account +/// #5, on parachain 2, remotely, in its native token. +#[test] +fn pay_over_xcm_works() { + let recipient = AccountId::new([5u8; 32]); + let asset_kind = + AssetKind { destination: (Parent, Parachain(2)).into(), asset_id: Here.into() }; + let amount = 10 * UNITS; + + new_test_ext().execute_with(|| { + // Check starting balance + assert_eq!(mock::Assets::balance(0, &recipient), 0); + + assert_ok!(PayOverXcm::< + InteriorAccount, + TestMessageSender, + TestQueryHandler, + Timeout, + AccountId, + AssetKind, + LocatableAssetKindConverter, + AliasesIntoAccountId32, + >::pay(&recipient, asset_kind, amount)); + + let expected_message = Xcm(vec![ + DescendOrigin(AccountId32 { id: SenderAccount::get().into(), network: None }.into()), + UnpaidExecution { weight_limit: Unlimited, check_origin: None }, + SetAppendix(Xcm(vec![ReportError(QueryResponseInfo { + destination: (Parent, Parachain(42)).into(), + query_id: 1, + max_weight: Weight::zero(), + })])), + TransferAsset { + assets: (Here, amount).into(), + beneficiary: AccountId32 { id: recipient.clone().into(), network: None }.into(), + }, + ]); + let expected_hash = fake_message_hash(&expected_message); + + assert_eq!( + sent_xcm(), + vec![((Parent, Parachain(2)).into(), expected_message, expected_hash)] + ); + + let (_, message, hash) = sent_xcm()[0].clone(); + let message = + Xcm::<::RuntimeCall>::from(message.clone()); + + // Execute message in parachain 2 with parachain 42's origin + let origin = (Parent, Parachain(42)); + XcmExecutor::::execute_xcm(origin, message, hash, Weight::MAX); + assert_eq!(mock::Assets::balance(0, &recipient), amount); + }); +} + +/// Scenario: +/// A pluralistic body, a Treasury, on the local chain, parachain 42, controls an amount of funds +/// on parachain 2. [`PayOverXcm::pay`] creates the correct message for the treasury to pay +/// another account, account #7, on parachain 2, remotely, in the relay's token. +#[test] +fn pay_over_xcm_governance_body() { + let recipient = AccountId::new([7u8; 32]); + let asset_kind = + AssetKind { destination: (Parent, Parachain(2)).into(), asset_id: Parent.into() }; + let amount = 10 * UNITS; + + let relay_asset_index = 1; + + new_test_ext().execute_with(|| { + // Check starting balance + assert_eq!(mock::Assets::balance(relay_asset_index, &recipient), 0); + + assert_ok!(PayOverXcm::< + InteriorBody, + TestMessageSender, + TestQueryHandler, + Timeout, + AccountId, + AssetKind, + LocatableAssetKindConverter, + AliasesIntoAccountId32, + >::pay(&recipient, asset_kind, amount)); + + let expected_message = Xcm(vec![ + DescendOrigin(Plurality { id: BodyId::Treasury, part: BodyPart::Voice }.into()), + UnpaidExecution { weight_limit: Unlimited, check_origin: None }, + SetAppendix(Xcm(vec![ReportError(QueryResponseInfo { + destination: (Parent, Parachain(42)).into(), + query_id: 1, + max_weight: Weight::zero(), + })])), + TransferAsset { + assets: (Parent, amount).into(), + beneficiary: AccountId32 { id: recipient.clone().into(), network: None }.into(), + }, + ]); + let expected_hash = fake_message_hash(&expected_message); + assert_eq!( + sent_xcm(), + vec![((Parent, Parachain(2)).into(), expected_message, expected_hash)] + ); + + let (_, message, hash) = sent_xcm()[0].clone(); + let message = + Xcm::<::RuntimeCall>::from(message.clone()); + + // Execute message in parachain 2 with parachain 42's origin + let origin = (Parent, Parachain(42)); + XcmExecutor::::execute_xcm(origin, message, hash, Weight::MAX); + assert_eq!(mock::Assets::balance(relay_asset_index, &recipient), amount); + }); +} diff --git a/xcm-builder/src/tests/pay/salary.rs b/xcm-builder/src/tests/pay/salary.rs new file mode 100644 index 000000000..1d40345f3 --- /dev/null +++ b/xcm-builder/src/tests/pay/salary.rs @@ -0,0 +1,172 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Tests for the integration between `PayOverXcm` and the salary pallet + +use super::{mock::*, *}; + +use frame_support::{ + assert_ok, + traits::{tokens::GetSalary, RankedMembers}, +}; +use sp_runtime::{traits::ConvertToValue, DispatchResult}; + +parameter_types! { + pub Interior: InteriorMultiLocation = Plurality { id: BodyId::Treasury, part: BodyPart::Voice }.into(); + pub Timeout: BlockNumber = 5; + pub AssetHub: MultiLocation = (Parent, Parachain(1)).into(); + pub AssetIdGeneralIndex: u128 = 100; + pub AssetHubAssetId: AssetId = (PalletInstance(1), GeneralIndex(AssetIdGeneralIndex::get())).into(); + pub LocatableAsset: LocatableAssetId = LocatableAssetId { asset_id: AssetHubAssetId::get(), location: AssetHub::get() }; +} + +type SalaryPayOverXcm = PayOverXcm< + Interior, + TestMessageSender, + TestQueryHandler, + Timeout, + AccountId, + (), + ConvertToValue, + AliasesIntoAccountId32, +>; + +type Rank = u128; + +thread_local! { + pub static CLUB: RefCell> = RefCell::new(BTreeMap::new()); +} + +pub struct TestClub; +impl RankedMembers for TestClub { + type AccountId = AccountId; + type Rank = Rank; + + fn min_rank() -> Self::Rank { + 0 + } + fn rank_of(who: &Self::AccountId) -> Option { + CLUB.with(|club| club.borrow().get(who).cloned()) + } + fn induct(who: &Self::AccountId) -> DispatchResult { + CLUB.with(|club| club.borrow_mut().insert(who.clone(), 0)); + Ok(()) + } + fn promote(who: &Self::AccountId) -> DispatchResult { + CLUB.with(|club| { + club.borrow_mut().entry(who.clone()).and_modify(|rank| *rank += 1); + }); + Ok(()) + } + fn demote(who: &Self::AccountId) -> DispatchResult { + CLUB.with(|club| match club.borrow().get(who) { + None => Err(sp_runtime::DispatchError::Unavailable), + Some(&0) => { + club.borrow_mut().remove(&who); + Ok(()) + }, + Some(_) => { + club.borrow_mut().entry(who.clone()).and_modify(|rank| *rank += 1); + Ok(()) + }, + }) + } +} + +fn set_rank(who: AccountId, rank: u128) { + CLUB.with(|club| club.borrow_mut().insert(who, rank)); +} + +parameter_types! { + pub const RegistrationPeriod: BlockNumber = 2; + pub const PayoutPeriod: BlockNumber = 2; + pub const FixedSalaryAmount: Balance = 10 * UNITS; + pub static Budget: Balance = FixedSalaryAmount::get(); +} + +pub struct FixedSalary; +impl GetSalary for FixedSalary { + fn get_salary(_rank: Rank, _who: &AccountId) -> Balance { + FixedSalaryAmount::get() + } +} + +impl pallet_salary::Config for Test { + type WeightInfo = (); + type RuntimeEvent = RuntimeEvent; + type Paymaster = SalaryPayOverXcm; + type Members = TestClub; + type Salary = FixedSalary; + type RegistrationPeriod = RegistrationPeriod; + type PayoutPeriod = PayoutPeriod; + type Budget = Budget; +} + +/// Scenario: +/// The salary pallet is used to pay a member over XCM. +/// The correct XCM message is generated and when executed in the remote chain, +/// the member receives the salary. +#[test] +fn salary_pay_over_xcm_works() { + let recipient = AccountId::new([1u8; 32]); + + new_test_ext().execute_with(|| { + // Set the recipient as a member of a ranked collective + set_rank(recipient.clone(), 1); + + // Check starting balance + assert_eq!(mock::Assets::balance(AssetIdGeneralIndex::get(), &recipient.clone()), 0); + + // Use salary pallet to call `PayOverXcm::pay` + assert_ok!(Salary::init(RuntimeOrigin::signed(recipient.clone()))); + run_to(5); + assert_ok!(Salary::induct(RuntimeOrigin::signed(recipient.clone()))); + assert_ok!(Salary::bump(RuntimeOrigin::signed(recipient.clone()))); + assert_ok!(Salary::register(RuntimeOrigin::signed(recipient.clone()))); + run_to(7); + assert_ok!(Salary::payout(RuntimeOrigin::signed(recipient.clone()))); + + // Get message from mock transport layer + let (_, message, hash) = sent_xcm()[0].clone(); + // Change type from `Xcm<()>` to `Xcm` to be able to execute later + let message = + Xcm::<::RuntimeCall>::from(message.clone()); + + let expected_message: Xcm = Xcm::(vec![ + DescendOrigin(Plurality { id: BodyId::Treasury, part: BodyPart::Voice }.into()), + UnpaidExecution { weight_limit: Unlimited, check_origin: None }, + SetAppendix(Xcm(vec![ReportError(QueryResponseInfo { + destination: (Parent, Parachain(42)).into(), + query_id: 1, + max_weight: Weight::zero(), + })])), + TransferAsset { + assets: (AssetHubAssetId::get(), FixedSalaryAmount::get()).into(), + beneficiary: AccountId32 { id: recipient.clone().into(), network: None }.into(), + }, + ]); + assert_eq!(message, expected_message); + + // Execute message as the asset hub + XcmExecutor::::execute_xcm((Parent, Parachain(42)), message, hash, Weight::MAX); + + // Recipient receives the payment + assert_eq!( + mock::Assets::balance(AssetIdGeneralIndex::get(), &recipient), + FixedSalaryAmount::get() + ); + }); +} diff --git a/xcm-builder/src/tests/querying.rs b/xcm-builder/src/tests/querying.rs index be8edfe87..8fbb55eb2 100644 --- a/xcm-builder/src/tests/querying.rs +++ b/xcm-builder/src/tests/querying.rs @@ -95,7 +95,8 @@ fn pallet_query_with_results_should_work() { #[test] fn prepaid_result_of_query_should_get_free_execution() { let query_id = 33; - // We put this in manually here, but normally this would be done at the point of crafting the message. + // We put this in manually here, but normally this would be done at the point of crafting the + // message. expect_response(query_id, Parent.into()); let the_response = Response::Assets((Parent, 100u128).into()); diff --git a/xcm-builder/src/tests/transacting.rs b/xcm-builder/src/tests/transacting.rs index ccb2c23d1..743ad7039 100644 --- a/xcm-builder/src/tests/transacting.rs +++ b/xcm-builder/src/tests/transacting.rs @@ -66,11 +66,11 @@ fn transacting_should_refund_weight() { #[test] fn paid_transacting_should_refund_payment_for_unused_weight() { let one: MultiLocation = AccountIndex64 { index: 1, network: None }.into(); - AllowPaidFrom::set(vec![one.clone()]); + AllowPaidFrom::set(vec![one]); add_asset(AccountIndex64 { index: 1, network: None }, (Parent, 200u128)); WeightPrice::set((Parent.into(), 1_000_000_000_000, 1024 * 1024)); - let origin = one.clone(); + let origin = one; let fees = (Parent, 200u128).into(); let message = Xcm::(vec![ WithdrawAsset((Parent, 200u128).into()), // enough for 200 units of weight. @@ -84,7 +84,7 @@ fn paid_transacting_should_refund_payment_for_unused_weight() { .into(), }, RefundSurplus, - DepositAsset { assets: AllCounted(1).into(), beneficiary: one.clone() }, + DepositAsset { assets: AllCounted(1).into(), beneficiary: one }, ]); let hash = fake_message_hash(&message); let weight_limit = Weight::from_parts(100, 100); diff --git a/xcm-builder/src/tests/version_subscriptions.rs b/xcm-builder/src/tests/version_subscriptions.rs index 434c92202..44ab7d34c 100644 --- a/xcm-builder/src/tests/version_subscriptions.rs +++ b/xcm-builder/src/tests/version_subscriptions.rs @@ -59,7 +59,7 @@ fn version_subscription_instruction_should_work() { let hash = fake_message_hash(&message); let weight_limit = Weight::from_parts(20, 20); let r = XcmExecutor::::execute_xcm_in_credit( - origin.clone(), + origin, message, hash, weight_limit, @@ -124,7 +124,7 @@ fn version_unsubscription_instruction_should_work() { let hash = fake_message_hash(&message); let weight_limit = Weight::from_parts(20, 20); let r = XcmExecutor::::execute_xcm_in_credit( - origin.clone(), + origin, message, hash, weight_limit, diff --git a/xcm-builder/src/tests/weight.rs b/xcm-builder/src/tests/weight.rs index 99ef02919..a2fb26541 100644 --- a/xcm-builder/src/tests/weight.rs +++ b/xcm-builder/src/tests/weight.rs @@ -24,25 +24,42 @@ fn fixed_rate_of_fungible_should_work() { } let mut trader = FixedRateOfFungible::::new(); + let ctx = XcmContext { origin: None, message_id: XcmHash::default(), topic: None }; + // supplies 100 unit of asset, 80 still remains after purchasing weight assert_eq!( - trader - .buy_weight(Weight::from_parts(10, 10), fungible_multi_asset(Here.into(), 100).into()), + trader.buy_weight( + Weight::from_parts(10, 10), + fungible_multi_asset(Here.into(), 100).into(), + &ctx, + ), Ok(fungible_multi_asset(Here.into(), 80).into()), ); // should have nothing left, as 5 + 5 = 10, and we supplied 10 units of asset. assert_eq!( - trader.buy_weight(Weight::from_parts(5, 5), fungible_multi_asset(Here.into(), 10).into()), + trader.buy_weight( + Weight::from_parts(5, 5), + fungible_multi_asset(Here.into(), 10).into(), + &ctx, + ), Ok(vec![].into()), ); // should have 5 left, as there are no proof size components assert_eq!( - trader.buy_weight(Weight::from_parts(5, 0), fungible_multi_asset(Here.into(), 10).into()), + trader.buy_weight( + Weight::from_parts(5, 0), + fungible_multi_asset(Here.into(), 10).into(), + &ctx, + ), Ok(fungible_multi_asset(Here.into(), 5).into()), ); // not enough to purchase the combined weights assert_err!( - trader.buy_weight(Weight::from_parts(5, 5), fungible_multi_asset(Here.into(), 5).into()), + trader.buy_weight( + Weight::from_parts(5, 5), + fungible_multi_asset(Here.into(), 5).into(), + &ctx, + ), XcmError::TooExpensive, ); } @@ -149,35 +166,41 @@ fn weight_trader_tuple_should_work() { ); let mut traders = Traders::new(); + let ctx = XcmContext { origin: None, message_id: XcmHash::default(), topic: None }; + // trader one buys weight assert_eq!( - traders.buy_weight(Weight::from_parts(5, 5), fungible_multi_asset(Here.into(), 10).into()), + traders.buy_weight( + Weight::from_parts(5, 5), + fungible_multi_asset(Here.into(), 10).into(), + &ctx + ), Ok(vec![].into()), ); // trader one refunds assert_eq!( - traders.refund_weight(Weight::from_parts(2, 2)), + traders.refund_weight(Weight::from_parts(2, 2), &ctx), Some(fungible_multi_asset(Here.into(), 4)) ); let mut traders = Traders::new(); // trader one failed; trader two buys weight assert_eq!( - traders.buy_weight(Weight::from_parts(5, 5), fungible_multi_asset(para_1, 10).into()), + traders.buy_weight(Weight::from_parts(5, 5), fungible_multi_asset(para_1, 10).into(), &ctx), Ok(vec![].into()), ); // trader two refunds assert_eq!( - traders.refund_weight(Weight::from_parts(2, 2)), + traders.refund_weight(Weight::from_parts(2, 2), &ctx), Some(fungible_multi_asset(para_1, 4)) ); let mut traders = Traders::new(); // all traders fails assert_err!( - traders.buy_weight(Weight::from_parts(5, 5), fungible_multi_asset(para_2, 10).into()), + traders.buy_weight(Weight::from_parts(5, 5), fungible_multi_asset(para_2, 10).into(), &ctx), XcmError::TooExpensive, ); // and no refund - assert_eq!(traders.refund_weight(Weight::from_parts(2, 2)), None); + assert_eq!(traders.refund_weight(Weight::from_parts(2, 2), &ctx), None); } diff --git a/xcm-builder/src/universal_exports.rs b/xcm-builder/src/universal_exports.rs index 38795042d..0ee627e0e 100644 --- a/xcm-builder/src/universal_exports.rs +++ b/xcm-builder/src/universal_exports.rs @@ -300,7 +300,8 @@ pub trait HaulBlob { #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum HaulBlobError { - /// Represents point-to-point link failure with a human-readable explanation of the specific issue is provided. + /// Represents point-to-point link failure with a human-readable explanation of the specific + /// issue is provided. Transport(&'static str), } @@ -332,9 +333,14 @@ pub enum DispatchBlobError { WrongGlobal, } -pub struct BridgeBlobDispatcher(PhantomData<(Router, OurPlace)>); -impl> DispatchBlob - for BridgeBlobDispatcher +pub struct BridgeBlobDispatcher( + PhantomData<(Router, OurPlace, OurPlaceBridgeInstance)>, +); +impl< + Router: SendXcm, + OurPlace: Get, + OurPlaceBridgeInstance: Get>, + > DispatchBlob for BridgeBlobDispatcher { fn dispatch_blob(blob: Vec) -> Result<(), DispatchBlobError> { let our_universal = OurPlace::get(); @@ -352,8 +358,17 @@ impl> DispatchBlob .map_err(|()| DispatchBlobError::NonUniversalDestination)?; ensure!(intended_global == our_global, DispatchBlobError::WrongGlobal); let dest = universal_dest.relative_to(&our_universal); - let message: Xcm<()> = + let mut message: Xcm<()> = message.try_into().map_err(|_| DispatchBlobError::UnsupportedXcmVersion)?; + + // Prepend our bridge instance discriminator. + // Can be used for fine-grained control of origin on destination in case of multiple bridge + // instances, e.g. restrict `type UniversalAliases` and `UniversalOrigin` instruction to + // trust just particular bridge instance for `NetworkId`. + if let Some(bridge_instance) = OurPlaceBridgeInstance::get() { + message.0.insert(0, DescendOrigin(bridge_instance)); + } + let _ = send_xcm::(dest, message).map_err(|_| DispatchBlobError::RoutingError)?; Ok(()) } diff --git a/xcm-builder/src/weight.rs b/xcm-builder/src/weight.rs index 1473775ec..f1c14a4c6 100644 --- a/xcm-builder/src/weight.rs +++ b/xcm-builder/src/weight.rs @@ -114,8 +114,9 @@ where } } -/// Function trait for handling some revenue. Similar to a negative imbalance (credit) handler, but for a -/// `MultiAsset`. Sensible implementations will deposit the asset in some known treasury or block-author account. +/// Function trait for handling some revenue. Similar to a negative imbalance (credit) handler, but +/// for a `MultiAsset`. Sensible implementations will deposit the asset in some known treasury or +/// block-author account. pub trait TakeRevenue { /// Do something with the given `revenue`, which is a single non-wildcard `MultiAsset`. fn take_revenue(revenue: MultiAsset); @@ -140,11 +141,16 @@ impl, R: TakeRevenue> WeightTrader for FixedRateOf Self(Weight::zero(), 0, PhantomData) } - fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { + fn buy_weight( + &mut self, + weight: Weight, + payment: Assets, + context: &XcmContext, + ) -> Result { log::trace!( target: "xcm::weight", - "FixedRateOfFungible::buy_weight weight: {:?}, payment: {:?}", - weight, payment, + "FixedRateOfFungible::buy_weight weight: {:?}, payment: {:?}, context: {:?}", + weight, payment, context, ); let (id, units_per_second, units_per_mb) = T::get(); let amount = (units_per_second * (weight.ref_time() as u128) / @@ -160,8 +166,8 @@ impl, R: TakeRevenue> WeightTrader for FixedRateOf Ok(unused) } - fn refund_weight(&mut self, weight: Weight) -> Option { - log::trace!(target: "xcm::weight", "FixedRateOfFungible::refund_weight weight: {:?}", weight); + fn refund_weight(&mut self, weight: Weight, context: &XcmContext) -> Option { + log::trace!(target: "xcm::weight", "FixedRateOfFungible::refund_weight weight: {:?}, context: {:?}", weight, context); let (id, units_per_second, units_per_mb) = T::get(); let weight = weight.min(self.0); let amount = (units_per_second * (weight.ref_time() as u128) / @@ -210,8 +216,13 @@ impl< Self(Weight::zero(), Zero::zero(), PhantomData) } - fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { - log::trace!(target: "xcm::weight", "UsingComponents::buy_weight weight: {:?}, payment: {:?}", weight, payment); + fn buy_weight( + &mut self, + weight: Weight, + payment: Assets, + context: &XcmContext, + ) -> Result { + log::trace!(target: "xcm::weight", "UsingComponents::buy_weight weight: {:?}, payment: {:?}, context: {:?}", weight, payment, context); let amount = WeightToFee::weight_to_fee(&weight); let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; let required = (Concrete(AssetId::get()), u128_amount).into(); @@ -221,8 +232,8 @@ impl< Ok(unused) } - fn refund_weight(&mut self, weight: Weight) -> Option { - log::trace!(target: "xcm::weight", "UsingComponents::refund_weight weight: {:?}", weight); + fn refund_weight(&mut self, weight: Weight, context: &XcmContext) -> Option { + log::trace!(target: "xcm::weight", "UsingComponents::refund_weight weight: {:?}, context: {:?}", weight, context); let weight = weight.min(self.0); let amount = WeightToFee::weight_to_fee(&weight); self.0 -= weight; diff --git a/xcm-builder/tests/mock/mod.rs b/xcm-builder/tests/mock/mod.rs index 6c2c8f222..f799be7e4 100644 --- a/xcm-builder/tests/mock/mod.rs +++ b/xcm-builder/tests/mock/mod.rs @@ -22,7 +22,7 @@ use frame_support::{ use frame_system::EnsureRoot; use parity_scale_codec::Encode; use primitive_types::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; +use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage}; use sp_std::cell::RefCell; use polkadot_parachain::primitives::Id as ParaId; @@ -77,13 +77,12 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); @@ -244,16 +243,12 @@ impl pallet_xcm::Config for Runtime { impl origin::Config for Runtime {} -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, + System: frame_system::{Pallet, Call, Storage, Config, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, ParasOrigin: origin::{Pallet, Origin}, XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, @@ -261,7 +256,7 @@ construct_runtime!( ); pub fn kusama_like_with_balances(balances: Vec<(AccountId, Balance)>) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances } .assimilate_storage(&mut t) diff --git a/xcm-builder/tests/scenarios.rs b/xcm-builder/tests/scenarios.rs index e587c4118..3e735720a 100644 --- a/xcm-builder/tests/scenarios.rs +++ b/xcm-builder/tests/scenarios.rs @@ -101,8 +101,8 @@ fn transfer_asset_works() { /// A parachain wants to be notified that a transfer worked correctly. /// It includes a `QueryHolding` order after the deposit to get notified on success. /// This somewhat abuses `QueryHolding` as an indication of execution success. It works because -/// order execution halts on error (so no `QueryResponse` will be sent if the previous order failed). -/// The inner response sent due to the query is not used. +/// order execution halts on error (so no `QueryResponse` will be sent if the previous order +/// failed). The inner response sent due to the query is not used. /// /// Asserts that the balances are updated correctly and the expected XCM is sent. #[test] diff --git a/xcm-executor/Cargo.toml b/xcm-executor/Cargo.toml index f91626eec..9dc77fcf5 100644 --- a/xcm-executor/Cargo.toml +++ b/xcm-executor/Cargo.toml @@ -3,22 +3,23 @@ name = "xcm-executor" description = "An abstract and configurable XCM message executor." authors.workspace = true edition.workspace = true +license.workspace = true version.workspace = true [dependencies] impl-trait-for-tuples = "0.2.2" environmental = { version = "1.1.4", default-features = false } -parity-scale-codec = { version = "3.4.0", default-features = false, features = ["derive"] } +parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } xcm = { path = "..", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-weights = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } log = { version = "0.4.17", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false, optional = true } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" , default-features = false, optional = true } [features] default = ["std"] @@ -26,14 +27,15 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", ] std = [ + "frame-benchmarking/std", + "frame-support/std", + "log/std", "parity-scale-codec/std", - "xcm/std", - "sp-std/std", - "sp-io/std", "sp-arithmetic/std", "sp-core/std", + "sp-io/std", "sp-runtime/std", + "sp-std/std", "sp-weights/std", - "frame-support/std", - "log/std", + "xcm/std", ] diff --git a/xcm-executor/integration-tests/Cargo.toml b/xcm-executor/integration-tests/Cargo.toml index 4fff3952a..306f8b44f 100644 --- a/xcm-executor/integration-tests/Cargo.toml +++ b/xcm-executor/integration-tests/Cargo.toml @@ -3,28 +3,27 @@ name = "xcm-executor-integration-tests" description = "Integration tests for the XCM Executor" authors.workspace = true edition.workspace = true +license.workspace = true version.workspace = true +publish = false [dependencies] -frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } +codec = { package = "parity-scale-codec", version = "3.6.1" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } futures = "0.3.21" pallet-xcm = { path = "../../pallet-xcm" } -polkadot-test-client = { path = "../../../node/test/client" } -polkadot-test-runtime = { path = "../../../runtime/test-runtime" } -polkadot-test-service = { path = "../../../node/test/service" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" } +polkadot-test-client = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-test-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-test-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false } +sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } xcm = { path = "../..", default-features = false } xcm-executor = { path = ".." } -sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } [features] default = ["std"] -std = [ - "xcm/std", - "sp-runtime/std", - "frame-support/std", -] +std = ["frame-support/std", "sp-runtime/std", "xcm/std"] diff --git a/xcm-executor/integration-tests/src/lib.rs b/xcm-executor/integration-tests/src/lib.rs index 95138250c..d8c77f831 100644 --- a/xcm-executor/integration-tests/src/lib.rs +++ b/xcm-executor/integration-tests/src/lib.rs @@ -17,10 +17,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg(test)] -use frame_support::{codec::Encode, dispatch::GetDispatchInfo, weights::Weight}; +use codec::Encode; +use frame_support::{dispatch::GetDispatchInfo, weights::Weight}; use polkadot_test_client::{ - BlockBuilderExt, ClientBlockImportExt, DefaultTestClientBuilderExt, ExecutionStrategy, - InitPolkadotBlockBuilder, TestClientBuilder, TestClientBuilderExt, + BlockBuilderExt, ClientBlockImportExt, DefaultTestClientBuilderExt, InitPolkadotBlockBuilder, + TestClientBuilder, TestClientBuilderExt, }; use polkadot_test_runtime::{pallet_test_notifier, xcm_config::XcmConfig}; use polkadot_test_service::construct_extrinsic; @@ -32,9 +33,7 @@ use xcm_executor::traits::WeightBounds; #[test] fn basic_buy_fees_message_executes() { sp_tracing::try_init_simple(); - let mut client = TestClientBuilder::new() - .set_execution_strategy(ExecutionStrategy::AlwaysWasm) - .build(); + let mut client = TestClientBuilder::new().build(); let msg = Xcm(vec![ WithdrawAsset((Parent, 100).into()), @@ -75,9 +74,7 @@ fn basic_buy_fees_message_executes() { #[test] fn transact_recursion_limit_works() { sp_tracing::try_init_simple(); - let mut client = TestClientBuilder::new() - .set_execution_strategy(ExecutionStrategy::AlwaysWasm) - .build(); + let mut client = TestClientBuilder::new().build(); let mut msg = Xcm(vec![ClearOrigin]); let max_weight = ::Weigher::weight(&mut msg).unwrap(); @@ -132,9 +129,7 @@ fn query_response_fires() { use polkadot_test_runtime::RuntimeEvent::TestNotifier; sp_tracing::try_init_simple(); - let mut client = TestClientBuilder::new() - .set_execution_strategy(ExecutionStrategy::AlwaysWasm) - .build(); + let mut client = TestClientBuilder::new().build(); let mut block_builder = client.init_polkadot_block_builder(); @@ -216,9 +211,7 @@ fn query_response_elicits_handler() { use polkadot_test_runtime::RuntimeEvent::TestNotifier; sp_tracing::try_init_simple(); - let mut client = TestClientBuilder::new() - .set_execution_strategy(ExecutionStrategy::AlwaysWasm) - .build(); + let mut client = TestClientBuilder::new().build(); let mut block_builder = client.init_polkadot_block_builder(); diff --git a/xcm-executor/src/assets.rs b/xcm-executor/src/assets.rs index f5e065993..d8d8936df 100644 --- a/xcm-executor/src/assets.rs +++ b/xcm-executor/src/assets.rs @@ -132,15 +132,17 @@ impl Assets { /// Mutate `self` to contain all given `assets`, saturating if necessary. /// - /// NOTE: [`Assets`] are always sorted, allowing us to optimize this function from `O(n^2)` to `O(n)`. + /// NOTE: [`Assets`] are always sorted, allowing us to optimize this function from `O(n^2)` to + /// `O(n)`. pub fn subsume_assets(&mut self, mut assets: Assets) { let mut f_iter = assets.fungible.iter_mut(); let mut g_iter = self.fungible.iter_mut(); if let (Some(mut f), Some(mut g)) = (f_iter.next(), g_iter.next()) { loop { if f.0 == g.0 { - // keys are equal. in this case, we add `self`'s balance for the asset onto `assets`, balance, knowing - // that the `append` operation which follows will clobber `self`'s value and only use `assets`'s. + // keys are equal. in this case, we add `self`'s balance for the asset onto + // `assets`, balance, knowing that the `append` operation which follows will + // clobber `self`'s value and only use `assets`'s. (*f.1).saturating_accrue(*g.1); } if f.0 <= g.0 { @@ -186,8 +188,9 @@ impl Assets { /// Alter any concretely identified assets by prepending the given `MultiLocation`. /// - /// WARNING: For now we consider this infallible and swallow any errors. It is thus the caller's responsibility to - /// ensure that any internal asset IDs are able to be prepended without overflow. + /// WARNING: For now we consider this infallible and swallow any errors. It is thus the caller's + /// responsibility to ensure that any internal asset IDs are able to be prepended without + /// overflow. pub fn prepend_location(&mut self, prepend: &MultiLocation) { let mut fungible = Default::default(); mem::swap(&mut self.fungible, &mut fungible); @@ -269,8 +272,8 @@ impl Assets { self.non_fungible.is_superset(&assets.non_fungible) } - /// Returns an error unless all `assets` are contained in `self`. In the case of an error, the first asset in - /// `assets` which is not wholly in `self` is returned. + /// Returns an error unless all `assets` are contained in `self`. In the case of an error, the + /// first asset in `assets` which is not wholly in `self` is returned. pub fn ensure_contains(&self, assets: &MultiAssets) -> Result<(), TakeError> { for asset in assets.inner().iter() { match asset { @@ -292,16 +295,17 @@ impl Assets { /// Mutates `self` to its original value less `mask` and returns assets that were removed. /// - /// If `saturate` is `true`, then `self` is considered to be masked by `mask`, thereby avoiding any attempt at - /// reducing it by assets it does not contain. In this case, the function is infallible. If `saturate` is `false` - /// and `mask` references a definite asset which `self` does not contain then an error is returned. + /// If `saturate` is `true`, then `self` is considered to be masked by `mask`, thereby avoiding + /// any attempt at reducing it by assets it does not contain. In this case, the function is + /// infallible. If `saturate` is `false` and `mask` references a definite asset which `self` + /// does not contain then an error is returned. /// /// The number of unique assets which are removed will respect the `count` parameter in the /// counted wildcard variants. /// - /// Returns `Ok` with the definite assets token from `self` and mutates `self` to its value minus - /// `mask`. Returns `Err` in the non-saturating case where `self` did not contain (enough of) a definite asset to - /// be removed. + /// Returns `Ok` with the definite assets token from `self` and mutates `self` to its value + /// minus `mask`. Returns `Err` in the non-saturating case where `self` did not contain (enough + /// of) a definite asset to be removed. fn general_take( &mut self, mask: MultiAssetFilter, @@ -386,24 +390,27 @@ impl Assets { Ok(taken) } - /// Mutates `self` to its original value less `mask` and returns `true` iff it contains at least `mask`. + /// Mutates `self` to its original value less `mask` and returns `true` iff it contains at least + /// `mask`. /// - /// Returns `Ok` with the non-wildcard equivalence of `mask` taken and mutates `self` to its value minus - /// `mask` if `self` contains `asset`, and return `Err` otherwise. + /// Returns `Ok` with the non-wildcard equivalence of `mask` taken and mutates `self` to its + /// value minus `mask` if `self` contains `asset`, and return `Err` otherwise. pub fn saturating_take(&mut self, asset: MultiAssetFilter) -> Assets { self.general_take(asset, true) .expect("general_take never results in error when saturating") } - /// Mutates `self` to its original value less `mask` and returns `true` iff it contains at least `mask`. + /// Mutates `self` to its original value less `mask` and returns `true` iff it contains at least + /// `mask`. /// - /// Returns `Ok` with the non-wildcard equivalence of `asset` taken and mutates `self` to its value minus - /// `asset` if `self` contains `asset`, and return `Err` otherwise. + /// Returns `Ok` with the non-wildcard equivalence of `asset` taken and mutates `self` to its + /// value minus `asset` if `self` contains `asset`, and return `Err` otherwise. pub fn try_take(&mut self, mask: MultiAssetFilter) -> Result { self.general_take(mask, false) } - /// Consumes `self` and returns its original value excluding `asset` iff it contains at least `asset`. + /// Consumes `self` and returns its original value excluding `asset` iff it contains at least + /// `asset`. pub fn checked_sub(mut self, asset: MultiAsset) -> Result { match asset.fun { Fungible(amount) => { diff --git a/xcm-executor/src/lib.rs b/xcm-executor/src/lib.rs index 050d73837..a48cd3259 100644 --- a/xcm-executor/src/lib.rs +++ b/xcm-executor/src/lib.rs @@ -356,7 +356,8 @@ impl XcmExecutor { } /// Execute any final operations after having executed the XCM message. - /// This includes refunding surplus weight, trapping extra holding funds, and returning any errors during execution. + /// This includes refunding surplus weight, trapping extra holding funds, and returning any + /// errors during execution. pub fn post_process(mut self, xcm_weight: Weight) -> Outcome { // We silently drop any error from our attempt to refund the surplus as it's a charitable // thing so best-effort is all we will do. @@ -457,7 +458,7 @@ impl XcmExecutor { let current_surplus = self.total_surplus.saturating_sub(self.total_refunded); if current_surplus.any_gt(Weight::zero()) { self.total_refunded.saturating_accrue(current_surplus); - if let Some(w) = self.trader.refund_weight(current_surplus) { + if let Some(w) = self.trader.refund_weight(current_surplus, &self.context) { self.subsume_asset(w)?; } } @@ -533,9 +534,10 @@ impl XcmExecutor { Config::IsTeleporter::contains(asset, &origin), XcmError::UntrustedTeleportLocation ); - // We should check that the asset can actually be teleported in (for this to be in error, there - // would need to be an accounting violation by one of the trusted chains, so it's unlikely, but we - // don't want to punish a possibly innocent chain/user). + // We should check that the asset can actually be teleported in (for this to be + // in error, there would need to be an accounting violation by one of the + // trusted chains, so it's unlikely, but we don't want to punish a possibly + // innocent chain/user). Config::AssetTransactor::can_check_in(&origin, asset, &self.context)?; } for asset in assets.into_inner().into_iter() { @@ -603,8 +605,8 @@ impl XcmExecutor { Ok(()) }, ReportError(response_info) => { - // Report the given result by sending a QueryResponse XCM to a previously given outcome - // destination if one was registered. + // Report the given result by sending a QueryResponse XCM to a previously given + // outcome destination if one was registered. self.respond( self.cloned_origin(), Response::ExecutionResult(self.error), @@ -689,7 +691,7 @@ impl XcmExecutor { // pay for `weight` using up to `fees` of the holding register. let max_fee = self.holding.try_take(fees.into()).map_err(|_| XcmError::NotHoldingFees)?; - let unspent = self.trader.buy_weight(weight, max_fee)?; + let unspent = self.trader.buy_weight(weight, max_fee, &self.context)?; self.subsume_assets(unspent)?; } Ok(()) @@ -823,10 +825,12 @@ impl XcmExecutor { Ok(()) }, ExportMessage { network, destination, xcm } => { - // The actual message sent to the bridge for forwarding is prepended with `UniversalOrigin` - // and `DescendOrigin` in order to ensure that the message is executed with this Origin. + // The actual message sent to the bridge for forwarding is prepended with + // `UniversalOrigin` and `DescendOrigin` in order to ensure that the message is + // executed with this Origin. // - // Prepend the desired message with instructions which effectively rewrite the origin. + // Prepend the desired message with instructions which effectively rewrite the + // origin. // // This only works because the remote chain empowers the bridge // to speak for the local network. diff --git a/xcm-executor/src/traits/asset_exchange.rs b/xcm-executor/src/traits/asset_exchange.rs index 465468992..0cb188d34 100644 --- a/xcm-executor/src/traits/asset_exchange.rs +++ b/xcm-executor/src/traits/asset_exchange.rs @@ -24,8 +24,8 @@ pub trait AssetExchange { /// - `origin`: The location attempting the exchange; this should generally not matter. /// - `give`: The assets which have been removed from the caller. /// - `want`: The minimum amount of assets which should be given to the caller in case any - /// exchange happens. If more assets are provided, then they should generally be of the - /// same asset class if at all possible. + /// exchange happens. If more assets are provided, then they should generally be of the same + /// asset class if at all possible. /// - `maximal`: If `true`, then as much as possible should be exchanged. /// /// `Ok` is returned along with the new set of assets which have been exchanged for `give`. At diff --git a/xcm-executor/src/traits/asset_lock.rs b/xcm-executor/src/traits/asset_lock.rs index bb19e90b0..b5a2b22f5 100644 --- a/xcm-executor/src/traits/asset_lock.rs +++ b/xcm-executor/src/traits/asset_lock.rs @@ -69,8 +69,8 @@ pub trait AssetLock { /// unlock. type UnlockTicket: Enact; - /// `Enact` implementer for `prepare_reduce_unlockable`. This type may be dropped safely to avoid doing the - /// unlock. + /// `Enact` implementer for `prepare_reduce_unlockable`. This type may be dropped safely to + /// avoid doing the unlock. type ReduceTicket: Enact; /// Prepare to lock an asset. On success, a `Self::LockTicket` it returned, which can be used diff --git a/xcm-executor/src/traits/conversion.rs b/xcm-executor/src/traits/conversion.rs index 2f584a900..dac099ffa 100644 --- a/xcm-executor/src/traits/conversion.rs +++ b/xcm-executor/src/traits/conversion.rs @@ -40,9 +40,9 @@ impl ConvertLocation for Tuple { /// A converter `trait` for origin types. /// -/// Can be amalgamated into tuples. If any of the tuple elements returns `Ok(_)`, it short circuits. Else, the `Err(_)` -/// of the last tuple item is returned. Each intermediate `Err(_)` might return a different `origin` of type `Origin` -/// which is passed to the next convert item. +/// Can be amalgamated into tuples. If any of the tuple elements returns `Ok(_)`, it short circuits. +/// Else, the `Err(_)` of the last tuple item is returned. Each intermediate `Err(_)` might return a +/// different `origin` of type `Origin` which is passed to the next convert item. /// /// ```rust /// # use xcm::latest::{MultiLocation, Junctions, Junction, OriginKind}; diff --git a/xcm-executor/src/traits/export.rs b/xcm-executor/src/traits/export.rs index 39667cec4..7aeccd445 100644 --- a/xcm-executor/src/traits/export.rs +++ b/xcm-executor/src/traits/export.rs @@ -97,7 +97,7 @@ impl ExportXcm for Tuple { } } - fn deliver(one_ticket: Self::Ticket) -> Result { + fn deliver(mut one_ticket: Self::Ticket) -> Result { for_tuples!( #( if let Some(validated) = one_ticket.Tuple.take() { return Tuple::deliver(validated); diff --git a/xcm-executor/src/traits/filter_asset_location.rs b/xcm-executor/src/traits/filter_asset_location.rs index 7aeb26b28..b162a8b07 100644 --- a/xcm-executor/src/traits/filter_asset_location.rs +++ b/xcm-executor/src/traits/filter_asset_location.rs @@ -19,7 +19,8 @@ use xcm::latest::{MultiAsset, MultiLocation}; /// Filters assets/location pairs. /// -/// Can be amalgamated into tuples. If any item returns `true`, it short-circuits, else `false` is returned. +/// Can be amalgamated into tuples. If any item returns `true`, it short-circuits, else `false` is +/// returned. #[deprecated = "Use `frame_support::traits::ContainsPair` instead"] pub trait FilterAssetLocation { /// A filter to distinguish between asset/location pairs. diff --git a/xcm-executor/src/traits/on_response.rs b/xcm-executor/src/traits/on_response.rs index 34bb7eb95..b0f8b35bb 100644 --- a/xcm-executor/src/traits/on_response.rs +++ b/xcm-executor/src/traits/on_response.rs @@ -107,11 +107,14 @@ impl VersionChangeNotifier for () { /// The possible state of an XCM query response. #[derive(Debug, PartialEq, Eq)] pub enum QueryResponseStatus { - /// The response has arrived, and includes the inner Response and the block number it arrived at. + /// The response has arrived, and includes the inner Response and the block number it arrived + /// at. Ready { response: Response, at: BlockNumber }, - /// The response has not yet arrived, the XCM might still be executing or the response might be in transit. + /// The response has not yet arrived, the XCM might still be executing or the response might be + /// in transit. Pending { timeout: BlockNumber }, - /// No response with the given `QueryId` was found, or the response was already queried and removed from local storage. + /// No response with the given `QueryId` was found, or the response was already queried and + /// removed from local storage. NotFound, /// Got an unexpected XCM version. UnexpectedVersion, @@ -144,7 +147,8 @@ pub trait QueryHandler { /// /// - `message`: The message whose outcome should be reported. /// - `responder`: The origin from which a response should be expected. - /// - `timeout`: The block number after which it is permissible to return `NotFound` from `take_response`. + /// - `timeout`: The block number after which it is permissible to return `NotFound` from + /// `take_response`. /// /// `report_outcome` may return an error if the `responder` is not invertible. /// diff --git a/xcm-executor/src/traits/should_execute.rs b/xcm-executor/src/traits/should_execute.rs index 2b634e375..d85458b54 100644 --- a/xcm-executor/src/traits/should_execute.rs +++ b/xcm-executor/src/traits/should_execute.rs @@ -32,8 +32,8 @@ pub struct Properties { /// Trait to determine whether the execution engine should actually execute a given XCM. /// -/// Can be amalgamated into a tuple to have multiple trials. If any of the tuple elements returns `Ok()`, the -/// execution stops. Else, `Err(_)` is returned if all elements reject the message. +/// Can be amalgamated into a tuple to have multiple trials. If any of the tuple elements returns +/// `Ok()`, the execution stops. Else, `Err(_)` is returned if all elements reject the message. pub trait ShouldExecute { /// Returns `true` if the given `message` may be executed. /// diff --git a/xcm-executor/src/traits/transact_asset.rs b/xcm-executor/src/traits/transact_asset.rs index 832397a0f..34cdb0c71 100644 --- a/xcm-executor/src/traits/transact_asset.rs +++ b/xcm-executor/src/traits/transact_asset.rs @@ -20,11 +20,13 @@ use xcm::latest::{Error as XcmError, MultiAsset, MultiLocation, Result as XcmRes /// Facility for asset transacting. /// -/// This should work with as many asset/location combinations as possible. Locations to support may include non-account -/// locations such as a `MultiLocation::X1(Junction::Parachain)`. Different chains may handle them in different ways. +/// This should work with as many asset/location combinations as possible. Locations to support may +/// include non-account locations such as a `MultiLocation::X1(Junction::Parachain)`. Different +/// chains may handle them in different ways. /// -/// Can be amalgamated as a tuple of items that implement this trait. In such executions, if any of the transactors -/// returns `Ok(())`, then it will short circuit. Else, execution is passed to the next transactor. +/// Can be amalgamated as a tuple of items that implement this trait. In such executions, if any of +/// the transactors returns `Ok(())`, then it will short circuit. Else, execution is passed to the +/// next transactor. pub trait TransactAsset { /// Ensure that `check_in` will do as expected. /// @@ -37,19 +39,23 @@ pub trait TransactAsset { Err(XcmError::Unimplemented) } - /// An asset has been teleported in from the given origin. This should do whatever housekeeping is needed. + /// An asset has been teleported in from the given origin. This should do whatever housekeeping + /// is needed. /// - /// NOTE: This will make only a best-effort at bookkeeping. The caller should ensure that `can_check_in` has - /// returned with `Ok` in order to guarantee that this operation proceeds properly. + /// NOTE: This will make only a best-effort at bookkeeping. The caller should ensure that + /// `can_check_in` has returned with `Ok` in order to guarantee that this operation proceeds + /// properly. /// - /// Implementation note: In general this will do one of two things: On chains where the asset is native, - /// it will reduce the assets from a special "teleported" account so that a) total-issuance is preserved; - /// and b) to ensure that no more assets can be teleported in than were teleported out overall (this should - /// not be needed if the teleporting chains are to be trusted, but better to be safe than sorry). On chains - /// where the asset is not native then it will generally just be a no-op. + /// Implementation note: In general this will do one of two things: On chains where the asset is + /// native, it will reduce the assets from a special "teleported" account so that a) + /// total-issuance is preserved; and b) to ensure that no more assets can be teleported in than + /// were teleported out overall (this should not be needed if the teleporting chains are to be + /// trusted, but better to be safe than sorry). On chains where the asset is not native then it + /// will generally just be a no-op. /// - /// When composed as a tuple, all type-items are called. It is up to the implementer that there exists no - /// value for `_what` which can cause side-effects for more than one of the type-items. + /// When composed as a tuple, all type-items are called. It is up to the implementer that there + /// exists no value for `_what` which can cause side-effects for more than one of the + /// type-items. fn check_in(_origin: &MultiLocation, _what: &MultiAsset, _context: &XcmContext) {} /// Ensure that `check_out` will do as expected. @@ -63,16 +69,19 @@ pub trait TransactAsset { Err(XcmError::Unimplemented) } - /// An asset has been teleported out to the given destination. This should do whatever housekeeping is needed. + /// An asset has been teleported out to the given destination. This should do whatever + /// housekeeping is needed. /// - /// Implementation note: In general this will do one of two things: On chains where the asset is native, - /// it will increase the assets in a special "teleported" account so that a) total-issuance is preserved; and - /// b) to ensure that no more assets can be teleported in than were teleported out overall (this should not - /// be needed if the teleporting chains are to be trusted, but better to be safe than sorry). On chains where - /// the asset is not native then it will generally just be a no-op. + /// Implementation note: In general this will do one of two things: On chains where the asset is + /// native, it will increase the assets in a special "teleported" account so that a) + /// total-issuance is preserved; and b) to ensure that no more assets can be teleported in than + /// were teleported out overall (this should not be needed if the teleporting chains are to be + /// trusted, but better to be safe than sorry). On chains where the asset is not native then it + /// will generally just be a no-op. /// - /// When composed as a tuple, all type-items are called. It is up to the implementer that there exists no - /// value for `_what` which can cause side-effects for more than one of the type-items. + /// When composed as a tuple, all type-items are called. It is up to the implementer that there + /// exists no value for `_what` which can cause side-effects for more than one of the + /// type-items. fn check_out(_dest: &MultiLocation, _what: &MultiAsset, _context: &XcmContext) {} /// Deposit the `what` asset into the account of `who`. diff --git a/xcm-executor/src/traits/weight.rs b/xcm-executor/src/traits/weight.rs index 033614d4b..bc40c1007 100644 --- a/xcm-executor/src/traits/weight.rs +++ b/xcm-executor/src/traits/weight.rs @@ -49,13 +49,18 @@ pub trait WeightTrader: Sized { /// Purchase execution weight credit in return for up to a given `payment`. If less of the /// payment is required then the surplus is returned. If the `payment` cannot be used to pay /// for the `weight`, then an error is returned. - fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result; + fn buy_weight( + &mut self, + weight: Weight, + payment: Assets, + context: &XcmContext, + ) -> Result; - /// Attempt a refund of `weight` into some asset. The caller does not guarantee that the weight was - /// purchased using `buy_weight`. + /// Attempt a refund of `weight` into some asset. The caller does not guarantee that the weight + /// was purchased using `buy_weight`. /// /// Default implementation refunds nothing. - fn refund_weight(&mut self, _weight: Weight) -> Option { + fn refund_weight(&mut self, _weight: Weight, _context: &XcmContext) -> Option { None } } @@ -66,11 +71,16 @@ impl WeightTrader for Tuple { for_tuples!( ( #( Tuple::new() ),* ) ) } - fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { + fn buy_weight( + &mut self, + weight: Weight, + payment: Assets, + context: &XcmContext, + ) -> Result { let mut too_expensive_error_found = false; let mut last_error = None; for_tuples!( #( - match Tuple.buy_weight(weight, payment.clone()) { + match Tuple.buy_weight(weight, payment.clone(), context) { Ok(assets) => return Ok(assets), Err(e) => { if let XcmError::TooExpensive = e { @@ -83,8 +93,8 @@ impl WeightTrader for Tuple { log::trace!(target: "xcm::buy_weight", "last_error: {:?}, too_expensive_error_found: {}", last_error, too_expensive_error_found); - // if we have multiple traders, and first one returns `TooExpensive` and others fail e.g. `AssetNotFound` - // then it is more accurate to return `TooExpensive` then `AssetNotFound` + // if we have multiple traders, and first one returns `TooExpensive` and others fail e.g. + // `AssetNotFound` then it is more accurate to return `TooExpensive` then `AssetNotFound` Err(if too_expensive_error_found { XcmError::TooExpensive } else { @@ -92,9 +102,9 @@ impl WeightTrader for Tuple { }) } - fn refund_weight(&mut self, weight: Weight) -> Option { + fn refund_weight(&mut self, weight: Weight, context: &XcmContext) -> Option { for_tuples!( #( - if let Some(asset) = Tuple.refund_weight(weight) { + if let Some(asset) = Tuple.refund_weight(weight, context) { return Some(asset); } )* ); diff --git a/xcm-simulator/Cargo.toml b/xcm-simulator/Cargo.toml index 5a4589659..fac5ea62f 100644 --- a/xcm-simulator/Cargo.toml +++ b/xcm-simulator/Cargo.toml @@ -4,18 +4,20 @@ description = "Test kit to simulate cross-chain message passing and XCM executio version.workspace = true authors.workspace = true edition.workspace = true +license.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.4.0" } +codec = { package = "parity-scale-codec", version = "3.6.1" } paste = "1.0.7" -frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "master" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } + +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } xcm = { path = "../" } xcm-executor = { path = "../xcm-executor" } xcm-builder = { path = "../xcm-builder" } -polkadot-core-primitives = { path = "../../core-primitives"} -polkadot-parachain = { path = "../../parachain" } -polkadot-runtime-parachains = { path = "../../runtime/parachains" } diff --git a/xcm-simulator/example/Cargo.toml b/xcm-simulator/example/Cargo.toml index 47b7c8224..8e5a8fc7c 100644 --- a/xcm-simulator/example/Cargo.toml +++ b/xcm-simulator/example/Cargo.toml @@ -3,44 +3,46 @@ name = "xcm-simulator-example" description = "Examples of xcm-simulator usage." authors.workspace = true edition.workspace = true +license.workspace = true version.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.4.0" } +codec = { package = "parity-scale-codec", version = "3.6.1" } scale-info = { version = "2.5.0", features = ["derive"] } log = { version = "0.4.14", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master" } -pallet-message-queue = { git = "https://github.com/paritytech/substrate", branch = "master" } -pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +pallet-uniques = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } + +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } xcm = { path = "../../" } xcm-simulator = { path = "../" } xcm-executor = { path = "../../xcm-executor" } xcm-builder = { path = "../../xcm-builder" } pallet-xcm = { path = "../../pallet-xcm" } -polkadot-core-primitives = { path = "../../../core-primitives" } -polkadot-runtime-parachains = { path = "../../../runtime/parachains" } -polkadot-parachain = { path = "../../../parachain" } [features] default = [] runtime-benchmarks = [ - "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-message-queue/runtime-benchmarks", "pallet-uniques/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", + "polkadot-parachain/runtime-benchmarks", + "polkadot-runtime-parachains/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", - "polkadot-runtime-parachains/runtime-benchmarks", - "polkadot-parachain/runtime-benchmarks", ] diff --git a/xcm-simulator/example/src/lib.rs b/xcm-simulator/example/src/lib.rs index 704d24c3f..85b8ad1c5 100644 --- a/xcm-simulator/example/src/lib.rs +++ b/xcm-simulator/example/src/lib.rs @@ -17,7 +17,8 @@ mod parachain; mod relay_chain; -use frame_support::sp_tracing; +use sp_runtime::BuildStorage; +use sp_tracing; use xcm::prelude::*; use xcm_executor::traits::ConvertLocation; use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain, TestExt}; @@ -93,7 +94,7 @@ pub fn parent_account_account_id(who: sp_runtime::AccountId32) -> parachain::Acc pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { use parachain::{MsgQueue, Runtime, System}; - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: vec![(ALICE, INITIAL_BALANCE), (parent_account_id(), INITIAL_BALANCE)], @@ -113,7 +114,7 @@ pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { pub fn relay_ext() -> sp_io::TestExternalities { use relay_chain::{Runtime, RuntimeOrigin, System, Uniques}; - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: vec![ diff --git a/xcm-simulator/example/src/parachain.rs b/xcm-simulator/example/src/parachain.rs index 875904dde..9c4cbe8fc 100644 --- a/xcm-simulator/example/src/parachain.rs +++ b/xcm-simulator/example/src/parachain.rs @@ -27,7 +27,6 @@ use frame_support::{ use frame_system::EnsureRoot; use sp_core::{ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{Get, Hash, IdentityLookup}, AccountId32, }; @@ -67,13 +66,12 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); @@ -449,16 +447,12 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, + System: frame_system::{Pallet, Call, Storage, Config, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, MsgQueue: mock_msg_queue::{Pallet, Storage, Event}, PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin}, diff --git a/xcm-simulator/example/src/relay_chain.rs b/xcm-simulator/example/src/relay_chain.rs index 6f64249b4..6f0e92dc9 100644 --- a/xcm-simulator/example/src/relay_chain.rs +++ b/xcm-simulator/example/src/relay_chain.rs @@ -24,7 +24,7 @@ use frame_support::{ use frame_system::EnsureRoot; use sp_core::{ConstU32, H256}; -use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; +use sp_runtime::{traits::IdentityLookup, AccountId32}; use polkadot_parachain::primitives::Id as ParaId; use polkadot_runtime_parachains::{ @@ -52,13 +52,12 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); @@ -239,7 +238,6 @@ parameter_types! { impl origin::Config for Runtime {} -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -279,16 +277,14 @@ impl pallet_message_queue::Config for Runtime { type ServiceWeight = MessageQueueServiceWeight; type MessageProcessor = MessageProcessor; type QueueChangeHandler = (); + type QueuePausedQuery = (); type WeightInfo = (); } construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, + System: frame_system::{Pallet, Call, Storage, Config, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, ParasOrigin: origin::{Pallet, Origin}, XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, diff --git a/xcm-simulator/fuzzer/Cargo.toml b/xcm-simulator/fuzzer/Cargo.toml index f8cdfa942..34e61ccae 100644 --- a/xcm-simulator/fuzzer/Cargo.toml +++ b/xcm-simulator/fuzzer/Cargo.toml @@ -4,37 +4,39 @@ description = "Examples of xcm-simulator usage." version.workspace = true authors.workspace = true edition.workspace = true +license.workspace = true [dependencies] -codec = { package = "parity-scale-codec", version = "3.4.0" } +codec = { package = "parity-scale-codec", version = "3.6.1" } honggfuzz = "0.5.55" arbitrary = "1.2.0" scale-info = { version = "2.5.0", features = ["derive"] } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master" } -pallet-message-queue = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } + +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" } xcm = { path = "../../" } xcm-simulator = { path = "../" } xcm-executor = { path = "../../xcm-executor" } xcm-builder = { path = "../../xcm-builder" } pallet-xcm = { path = "../../pallet-xcm" } -polkadot-core-primitives = { path = "../../../core-primitives" } -polkadot-runtime-parachains = { path = "../../../runtime/parachains" } -polkadot-parachain = { path = "../../../parachain" } [features] runtime-benchmarks = [ - "pallet-xcm/runtime-benchmarks", - "pallet-message-queue/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "frame-support/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "pallet-message-queue/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", ] [[bin]] diff --git a/xcm-simulator/fuzzer/src/fuzz.rs b/xcm-simulator/fuzzer/src/fuzz.rs index b23386d79..441b9f4d2 100644 --- a/xcm-simulator/fuzzer/src/fuzz.rs +++ b/xcm-simulator/fuzzer/src/fuzz.rs @@ -20,7 +20,7 @@ mod relay_chain; use codec::DecodeLimit; use polkadot_core_primitives::AccountId; use polkadot_parachain::primitives::Id as ParaId; -use sp_runtime::traits::AccountIdConversion; +use sp_runtime::{traits::AccountIdConversion, BuildStorage}; use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain, TestExt}; use frame_support::assert_ok; @@ -111,7 +111,7 @@ pub fn para_account_id(id: u32) -> relay_chain::AccountId { pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { use parachain::{MsgQueue, Runtime, System}; - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: (0..6).map(|i| ([i; 32].into(), INITIAL_BALANCE)).collect(), @@ -130,7 +130,7 @@ pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { pub fn relay_ext() -> sp_io::TestExternalities { use relay_chain::{Runtime, System}; - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); let mut balances: Vec<(AccountId, u128)> = vec![]; balances.append(&mut (1..=3).map(|i| (para_account_id(i), INITIAL_BALANCE)).collect()); diff --git a/xcm-simulator/fuzzer/src/parachain.rs b/xcm-simulator/fuzzer/src/parachain.rs index 26438f02f..3d0b1c82f 100644 --- a/xcm-simulator/fuzzer/src/parachain.rs +++ b/xcm-simulator/fuzzer/src/parachain.rs @@ -26,7 +26,6 @@ use frame_support::{ use frame_system::EnsureRoot; use sp_core::{ConstU32, H256}; use sp_runtime::{ - testing::Header, traits::{Hash, IdentityLookup}, AccountId32, }; @@ -56,13 +55,12 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); @@ -240,7 +238,7 @@ pub mod mock_msg_queue { Ok(xcm) => { let location = MultiLocation::new(1, X1(Parachain(sender.into()))); match T::XcmExecutor::execute_xcm(location, xcm, message_hash, max_weight) { - Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), + Outcome::Error(e) => (Err(e), Event::Fail(Some(hash), e)), Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. @@ -264,7 +262,7 @@ pub mod mock_msg_queue { let _ = XcmpMessageFormat::decode(&mut data_ref) .expect("Simulator encodes with versioned xcm format; qed"); - let mut remaining_fragments = &data_ref[..]; + let mut remaining_fragments = data_ref; while !remaining_fragments.is_empty() { if let Ok(xcm) = VersionedXcm::::decode(&mut remaining_fragments) @@ -347,16 +345,12 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, + System: frame_system::{Pallet, Call, Storage, Config, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, MsgQueue: mock_msg_queue::{Pallet, Storage, Event}, PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin}, diff --git a/xcm-simulator/fuzzer/src/relay_chain.rs b/xcm-simulator/fuzzer/src/relay_chain.rs index 75b42e300..32f3b8aa8 100644 --- a/xcm-simulator/fuzzer/src/relay_chain.rs +++ b/xcm-simulator/fuzzer/src/relay_chain.rs @@ -24,7 +24,7 @@ use frame_support::{ use frame_system::EnsureRoot; use sp_core::{ConstU32, H256}; -use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; +use sp_runtime::{traits::IdentityLookup, AccountId32}; use polkadot_parachain::primitives::Id as ParaId; use polkadot_runtime_parachains::{ @@ -51,13 +51,12 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockWeights = (); @@ -203,7 +202,6 @@ parameter_types! { impl origin::Config for Runtime {} -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -247,16 +245,14 @@ impl pallet_message_queue::Config for Runtime { type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor; type QueueChangeHandler = (); + type QueuePausedQuery = (); type WeightInfo = (); } construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, + System: frame_system::{Pallet, Call, Storage, Config, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, ParasOrigin: origin::{Pallet, Origin}, XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, diff --git a/xcm-simulator/src/lib.rs b/xcm-simulator/src/lib.rs index f98eb6e57..cf56784f7 100644 --- a/xcm-simulator/src/lib.rs +++ b/xcm-simulator/src/lib.rs @@ -161,12 +161,12 @@ macro_rules! decl_test_relay_chain { /// /// ```ignore /// decl_test_parachain! { -/// pub struct ParaA { -/// Runtime = parachain::Runtime, -/// XcmpMessageHandler = parachain::MsgQueue, -/// DmpMessageHandler = parachain::MsgQueue, -/// new_ext = para_ext(), -/// } +/// pub struct ParaA { +/// Runtime = parachain::Runtime, +/// XcmpMessageHandler = parachain::MsgQueue, +/// DmpMessageHandler = parachain::MsgQueue, +/// new_ext = para_ext(), +/// } /// } /// ``` #[macro_export] @@ -272,13 +272,13 @@ thread_local! { /// /// ```ignore /// decl_test_network! { -/// pub struct ExampleNet { -/// relay_chain = Relay, -/// parachains = vec![ -/// (1, ParaA), -/// (2, ParaB), -/// ], -/// } +/// pub struct ExampleNet { +/// relay_chain = Relay, +/// parachains = vec![ +/// (1, ParaA), +/// (2, ParaB), +/// ], +/// } /// } /// ``` #[macro_export]