diff --git a/.github/workflow-templates/cargo-build/action.yml b/.github/workflow-templates/cargo-build/action.yml index 339b492665..efcb65a71b 100644 --- a/.github/workflow-templates/cargo-build/action.yml +++ b/.github/workflow-templates/cargo-build/action.yml @@ -27,7 +27,7 @@ runs: shell: bash run: | mkdir -p mold - curl -L --retry 10 --silent --show-error https://github.com/rui314/mold/releases/download/v1.1.1/mold-1.1.1-$(uname -m)-linux.tar.gz | tar -C $(realpath mold) --strip-components=1 -xzf - + curl -L --retry 10 --silent --show-error https://github.com/rui314/mold/releases/download/v2.30.0/mold-2.30.0-$(uname -m)-linux.tar.gz | tar -C $(realpath mold) --strip-components=1 -xzf - # With rustup's nice new toml format, we just need to run rustup show to install the toolchain # https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659 - name: Setup Rust toolchain diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37d43cc43e..091c400ed5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -330,7 +330,7 @@ jobs: shell: bash run: | mkdir -p mold - curl -L --retry 10 --silent --show-error https://github.com/rui314/mold/releases/download/v1.1.1/mold-1.1.1-$(uname -m)-linux.tar.gz | tar -C $(realpath mold) --strip-components=1 -xzf - + curl -L --retry 10 --silent --show-error https://github.com/rui314/mold/releases/download/v2.30.0/mold-2.30.0-$(uname -m)-linux.tar.gz | tar -C $(realpath mold) --strip-components=1 -xzf - # With rustup's nice new toml format, we just need to run rustup show to install the toolchain # https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659 - name: Setup Rust toolchain diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 55bcf9bffe..5b60feda22 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -3,10 +3,10 @@ on: workflow_dispatch: inputs: from: - description: "Polkadot version to bump from (ex: v0.9.40)" + description: "Polkadot version to bump from (ex: v1.3.0)" required: true to: - description: "Polkadot version to bump to (ex: v0.9.42)" + description: "Polkadot version to bump to (ex: v1.7.2)" required: true jobs: @@ -29,7 +29,7 @@ jobs: - name: Create version bump issue uses: peter-evans/create-issue-from-file@v3 with: - title: Update substrate/polkadot/cumulus from ${{ github.event.inputs.from }} to ${{ github.event.inputs.to }} + title: Update polkadot-sdk from ${{ github.event.inputs.from }} to ${{ github.event.inputs.to }} content-filepath: ./version-bump.md labels: | automated issue diff --git a/Cargo.lock b/Cargo.lock index 5f569db296..7fb490b76c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,25 +56,6 @@ 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" @@ -85,29 +66,6 @@ dependencies = [ "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" @@ -119,54 +77,20 @@ dependencies = [ "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 2.4.1", -] - [[package]] name = "aes-gcm" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "aead 0.5.2", - "aes 0.8.3", + "aead", + "aes", "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.0", + "ctr", + "ghash", "subtle 2.4.1", ] -[[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 = "affix" version = "0.1.2" @@ -247,9 +171,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -310,24 +234,18 @@ dependencies = [ [[package]] name = "aquamarine" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df752953c49ce90719c7bf1fc587bc8227aed04732ea0c0f85e5397d7fdbd1a1" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" dependencies = [ "include_dir", "itertools 0.10.5", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.53", ] -[[package]] -name = "arc-swap" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" - [[package]] name = "ark-bls12-377" version = "0.4.0" @@ -339,6 +257,18 @@ dependencies = [ "ark-std", ] +[[package]] +name = "ark-bls12-377-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20c7021f180a0cbea0380eba97c2af3c57074cdaffe0eef7e840e1c9f2841e55" +dependencies = [ + "ark-bls12-377", + "ark-ec", + "ark-models-ext", + "ark-std", +] + [[package]] name = "ark-bls12-381" version = "0.4.0" @@ -351,6 +281,45 @@ dependencies = [ "ark-std", ] +[[package]] +name = "ark-bls12-381-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1dc4b3d08f19e8ec06e949712f95b8361e43f1391d94f65e4234df03480631c" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-models-ext", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-bw6-761" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e0605daf0cc5aa2034b78d008aaf159f56901d92a52ee4f6ecdfdac4f426700" +dependencies = [ + "ark-bls12-377", + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-bw6-761-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccee5fba47266f460067588ee1bf070a9c760bf2050c1c509982c5719aadb4f2" +dependencies = [ + "ark-bw6-761", + "ark-ec", + "ark-ff", + "ark-models-ext", + "ark-std", +] + [[package]] name = "ark-ec" version = "0.4.2" @@ -365,9 +334,35 @@ dependencies = [ "hashbrown 0.13.2", "itertools 0.10.5", "num-traits", + "rayon", "zeroize", ] +[[package]] +name = "ark-ed-on-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b10d901b9ac4b38f9c32beacedfadcdd64e46f8d7f8e88c1ae1060022cf6f6c6" +dependencies = [ + "ark-bls12-377", + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ed-on-bls12-377-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524a4fb7540df2e1a8c2e67a83ba1d1e6c3947f4f9342cc2359fc2e789ad731d" +dependencies = [ + "ark-ec", + "ark-ed-on-bls12-377", + "ark-ff", + "ark-models-ext", + "ark-std", +] + [[package]] name = "ark-ed-on-bls12-381-bandersnatch" version = "0.4.0" @@ -380,6 +375,19 @@ dependencies = [ "ark-std", ] +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15185f1acb49a07ff8cbe5f11a1adc5a93b19e211e325d826ae98e98e124346" +dependencies = [ + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-models-ext", + "ark-std", +] + [[package]] name = "ark-ff" version = "0.4.2" @@ -423,6 +431,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-models-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e9eab5d4b5ff2f228b763d38442adc9b084b0a465409b059fac5c2308835ec2" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", +] + [[package]] name = "ark-poly" version = "0.4.2" @@ -438,9 +459,9 @@ dependencies = [ [[package]] name = "ark-scale" -version = "0.0.11" +version = "0.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51bd73bb6ddb72630987d37fa963e99196896c0d0ea81b7c894567e74a2f83af" +checksum = "5f69c00b3b529be29528a6f2fd5fa7b1790f8bed81b9cdca17e326538545a179" dependencies = [ "ark-ec", "ark-ff", @@ -453,7 +474,7 @@ dependencies = [ [[package]] name = "ark-secret-scalar" version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" dependencies = [ "ark-ec", "ark-ff", @@ -461,7 +482,7 @@ dependencies = [ "ark-std", "ark-transcript", "digest 0.10.7", - "rand_core 0.6.4", + "getrandom_or_panic", "zeroize", ] @@ -496,12 +517,13 @@ checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", "rand 0.8.5", + "rayon", ] [[package]] name = "ark-transcript" version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" dependencies = [ "ark-ff", "ark-serialize", @@ -550,29 +572,13 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "asn1-rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" -dependencies = [ - "asn1-rs-derive 0.1.0", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "asn1-rs" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive 0.4.0", + "asn1-rs-derive", "asn1-rs-impl", "displaydoc", "nom", @@ -582,18 +588,6 @@ dependencies = [ "time", ] -[[package]] -name = "asn1-rs-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "asn1-rs-derive" version = "0.4.0" @@ -641,7 +635,7 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-backing-primitives" version = "0.9.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "sp-api", "sp-consensus-slots", @@ -817,7 +811,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -854,17 +848,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "auto_impl" version = "1.1.0" @@ -900,8 +883,8 @@ dependencies = [ [[package]] name = "bandersnatch_vrfs" -version = "0.0.1" -source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +version = "0.0.4" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" dependencies = [ "ark-bls12-381", "ark-ec", @@ -916,6 +899,8 @@ dependencies = [ "rand_core 0.6.4", "ring 0.1.0", "sha2 0.10.8", + "sp-ark-bls12-381", + "sp-ark-ed-on-bls12-381-bandersnatch", "zeroize", ] @@ -925,12 +910,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -975,8 +954,8 @@ dependencies = [ [[package]] name = "binary-merkle-tree" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "13.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "hash-db 0.16.0", "log", @@ -1009,7 +988,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -1036,6 +1015,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ "bitcoin_hashes", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", ] [[package]] @@ -1064,6 +1047,7 @@ checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", + "serde", "tap", "wyz", ] @@ -1140,7 +1124,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -1164,16 +1148,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "block-modes" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" -dependencies = [ - "block-padding 0.2.1", - "cipher 0.2.5", -] - [[package]] name = "block-padding" version = "0.1.5" @@ -1183,12 +1157,6 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "blocking" version = "1.5.1" @@ -1207,9 +1175,9 @@ dependencies = [ [[package]] name = "bounded-collections" -version = "0.1.9" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" +checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" dependencies = [ "log", "parity-scale-codec", @@ -1228,8 +1196,8 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub-router" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.6.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "scale-info", @@ -1389,17 +1357,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ccm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" -dependencies = [ - "aead 0.3.2", - "cipher 0.2.5", - "subtle 2.4.1", -] - [[package]] name = "cexpr" version = "0.6.0" @@ -1457,7 +1414,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ - "aead 0.5.2", + "aead", "chacha20", "cipher 0.4.4", "poly1305", @@ -1486,7 +1443,7 @@ checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" dependencies = [ "core2", "multibase", - "multihash", + "multihash 0.17.0", "serde", "unsigned-varint", ] @@ -1500,15 +1457,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "cipher" version = "0.4.4" @@ -1542,9 +1490,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.8" +version = "4.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813" dependencies = [ "clap_builder", "clap_derive", @@ -1552,33 +1500,34 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", "clap_lex", "strsim", + "terminal_size", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "coarsetime" @@ -1652,15 +1601,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -1943,18 +1892,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "crypto-bigint" version = "0.5.4" @@ -2008,15 +1945,6 @@ dependencies = [ "subtle 2.4.1", ] -[[package]] -name = "ctr" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" -dependencies = [ - "cipher 0.3.0", -] - [[package]] name = "ctr" version = "0.9.2" @@ -2028,8 +1956,8 @@ dependencies = [ [[package]] name = "cumulus-client-cli" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "clap", "parity-scale-codec", @@ -2037,6 +1965,7 @@ dependencies = [ "sc-cli", "sc-client-api", "sc-service", + "sp-blockchain", "sp-core", "sp-runtime", "url", @@ -2044,13 +1973,13 @@ dependencies = [ [[package]] name = "cumulus-client-collator" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", - "futures 0.3.29", + "futures 0.3.30", "parity-scale-codec", "parking_lot 0.12.1", "polkadot-node-primitives", @@ -2067,15 +1996,15 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "cumulus-client-pov-recovery", "cumulus-primitives-core", "cumulus-relay-chain-interface", "dyn-clone", - "futures 0.3.29", + "futures 0.3.30", "log", "parity-scale-codec", "polkadot-primitives", @@ -2096,8 +2025,8 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "anyhow", "async-trait", @@ -2111,14 +2040,14 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-relay-chain" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "cumulus-client-consensus-common", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.29", + "futures 0.3.30", "parking_lot 0.12.1", "sc-consensus", "sp-api", @@ -2134,12 +2063,12 @@ dependencies = [ [[package]] name = "cumulus-client-network" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "cumulus-relay-chain-interface", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "parity-scale-codec", "parking_lot 0.12.1", @@ -2156,14 +2085,38 @@ dependencies = [ ] [[package]] -name = "cumulus-client-pov-recovery" +name = "cumulus-client-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-relay-chain-interface", + "cumulus-test-relay-sproof-builder", + "parity-scale-codec", + "sc-client-api", + "scale-info", + "sp-api", + "sp-crypto-hashing", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-storage", + "sp-trie", + "tracing", +] + +[[package]] +name = "cumulus-client-pov-recovery" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "parity-scale-codec", "polkadot-node-primitives", @@ -2181,8 +2134,8 @@ dependencies = [ [[package]] name = "cumulus-client-service" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -2190,10 +2143,11 @@ dependencies = [ "cumulus-client-network", "cumulus-client-pov-recovery", "cumulus-primitives-core", + "cumulus-primitives-proof-size-hostfunction", "cumulus-relay-chain-inprocess-interface", "cumulus-relay-chain-interface", "cumulus-relay-chain-minimal-node", - "futures 0.3.29", + "futures 0.3.30", "polkadot-primitives", "sc-client-api", "sc-consensus", @@ -2216,10 +2170,11 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "cumulus-primitives-core", + "frame-benchmarking", "frame-support", "frame-system", "log", @@ -2233,18 +2188,21 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", + "cumulus-primitives-proof-size-hostfunction", "environmental", + "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", "log", + "pallet-message-queue", "parity-scale-codec", "polkadot-parachain-primitives", "polkadot-runtime-parachains", @@ -2264,19 +2222,19 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.6.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "cumulus-pallet-xcm" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2291,19 +2249,20 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ + "bounded-collections", "bp-xcm-bridge-hub-router", "cumulus-primitives-core", "frame-benchmarking", "frame-support", "frame-system", "log", + "pallet-message-queue", "parity-scale-codec", "polkadot-runtime-common", "polkadot-runtime-parachains", - "rand_chacha 0.3.1", "scale-info", "sp-core", "sp-io", @@ -2315,8 +2274,8 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -2332,34 +2291,36 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "cumulus-primitives-core", - "cumulus-relay-chain-interface", - "cumulus-test-relay-sproof-builder", "parity-scale-codec", - "sc-client-api", "scale-info", - "sp-api", "sp-core", "sp-inherents", - "sp-runtime", - "sp-state-machine", "sp-std", - "sp-storage", "sp-trie", - "tracing", +] + +[[package]] +name = "cumulus-primitives-proof-size-hostfunction" +version = "0.2.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" +dependencies = [ + "sp-externalities", + "sp-runtime-interface", + "sp-trie", ] [[package]] name = "cumulus-primitives-timestamp" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "cumulus-primitives-core", - "futures 0.3.29", + "futures 0.3.30", "parity-scale-codec", "sp-inherents", "sp-std", @@ -2368,12 +2329,13 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "cumulus-primitives-core", "frame-support", "log", + "pallet-asset-conversion", "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-runtime-common", @@ -2388,13 +2350,13 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "polkadot-cli", "polkadot-service", @@ -2412,12 +2374,12 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "cumulus-primitives-core", - "futures 0.3.29", + "futures 0.3.30", "jsonrpsee-core", "parity-scale-codec", "polkadot-overseer", @@ -2430,49 +2392,55 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", "cumulus-relay-chain-rpc-interface", - "futures 0.3.29", + "futures 0.3.30", + "parking_lot 0.12.1", "polkadot-availability-recovery", "polkadot-collator-protocol", "polkadot-core-primitives", "polkadot-network-bridge", "polkadot-node-collation-generation", + "polkadot-node-core-chain-api", + "polkadot-node-core-prospective-parachains", "polkadot-node-core-runtime-api", "polkadot-node-network-protocol", "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", "sc-authority-discovery", + "sc-client-api", "sc-network", "sc-network-common", "sc-service", "sc-tracing", "sc-utils", "sp-api", + "sp-blockchain", "sp-consensus", "sp-consensus-babe", "sp-runtime", "substrate-prometheus-endpoint", + "tokio", "tracing", ] [[package]] name = "cumulus-relay-chain-rpc-interface" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", "either", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "jsonrpsee", "parity-scale-codec", @@ -2494,6 +2462,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-storage", + "sp-version", "thiserror", "tokio", "tokio-util", @@ -2503,8 +2472,8 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -2566,7 +2535,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -2606,7 +2575,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -2623,42 +2592,7 @@ checksum = "587663dd5fb3d10932c8aecfe7c844db1bcf0aee93eeab08fac13dc1212c2e7f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", -] - -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core", - "quote", - "syn 1.0.109", + "syn 2.0.53", ] [[package]] @@ -2687,17 +2621,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - [[package]] name = "der" version = "0.7.8" @@ -2708,27 +2631,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-parser" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" -dependencies = [ - "asn1-rs 0.3.1", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "der-parser" version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "displaydoc", "nom", "num-bigint", @@ -2767,37 +2676,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive_builder" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -2903,13 +2781,13 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "dleq_vrf" version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" dependencies = [ "ark-ec", "ark-ff", @@ -2919,7 +2797,6 @@ dependencies = [ "ark-std", "ark-transcript", "arrayvec 0.7.4", - "rand_core 0.6.4", "zeroize", ] @@ -2931,18 +2808,18 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "docify" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4235e9b248e2ba4b92007fe9c646f3adf0ffde16dc74713eacc92b8bc58d8d2f" +checksum = "7cc4fd38aaa9fb98ac70794c82a00360d1e165a87fbf96a8a91f9dfc602aaee2" dependencies = [ "docify_macros", ] [[package]] name = "docify_macros" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47020e12d7c7505670d1363dd53d6c23724f71a90a3ae32ff8eba40de8404626" +checksum = "63fa215f3a0d40fb2a221b3aa90d8e1fbb8379785a990cb60d62ac71ebdc6460" dependencies = [ "common-path", "derive-syn-parse", @@ -2950,9 +2827,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.39", + "syn 2.0.53", "termcolor", - "toml 0.7.8", + "toml 0.8.12", "walkdir", ] @@ -3007,30 +2884,18 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", -] - [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.7.8", + "der", "digest 0.10.7", - "elliptic-curve 0.13.7", - "rfc6979 0.4.0", + "elliptic-curve", + "rfc6979", "signature 2.2.0", - "spki 0.7.2", + "spki", ] [[package]] @@ -3048,7 +2913,7 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "pkcs8 0.10.2", + "pkcs8", "signature 2.2.0", ] @@ -3118,43 +2983,21 @@ dependencies = [ "serde", ] -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "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 2.4.1", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9775b22bc152ad86a0cf23f0f348b884b26add12bf741e7ffc4d4ab2ab4d205" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.4", + "base16ct", + "crypto-bigint", "digest 0.10.7", - "ff 0.13.0", + "ff", "generic-array 0.14.7", - "group 0.13.0", - "pkcs8 0.10.2", + "group", + "pkcs8", "rand_core 0.6.4", - "sec1 0.7.3", + "sec1", "subtle 2.4.1", "zeroize", ] @@ -3171,7 +3014,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 1.0.109", @@ -3194,7 +3037,7 @@ checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -3205,7 +3048,7 @@ checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -3260,20 +3103,20 @@ dependencies = [ [[package]] name = "ethereum" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" +checksum = "2e04d24d20b8ff2235cffbf242d5092de3aa45f77c5270ddbfadd2778ca13fea" dependencies = [ "bytes", "ethereum-types", - "hash-db 0.15.2", + "hash-db 0.16.0", "hash256-std-hasher", "parity-scale-codec", "rlp", "scale-info", "serde", "sha3", - "triehash", + "trie-root 0.18.0", ] [[package]] @@ -3321,8 +3164,8 @@ dependencies = [ [[package]] name = "evm" -version = "0.40.0" -source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkadot-v1.3.0#3b73337fe0495bc02259081a4004c74b5afbe52b" +version = "0.41.1" +source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkadot-v1.7.2#d8991ec727ad0fb64fe9957a3cd307387a6701e4" dependencies = [ "auto_impl", "environmental", @@ -3341,8 +3184,8 @@ dependencies = [ [[package]] name = "evm-core" -version = "0.40.0" -source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkadot-v1.3.0#3b73337fe0495bc02259081a4004c74b5afbe52b" +version = "0.41.0" +source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkadot-v1.7.2#d8991ec727ad0fb64fe9957a3cd307387a6701e4" dependencies = [ "parity-scale-codec", "primitive-types", @@ -3352,8 +3195,8 @@ dependencies = [ [[package]] name = "evm-gasometer" -version = "0.40.0" -source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkadot-v1.3.0#3b73337fe0495bc02259081a4004c74b5afbe52b" +version = "0.41.0" +source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkadot-v1.7.2#d8991ec727ad0fb64fe9957a3cd307387a6701e4" dependencies = [ "environmental", "evm-core", @@ -3363,8 +3206,8 @@ dependencies = [ [[package]] name = "evm-runtime" -version = "0.40.0" -source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkadot-v1.3.0#3b73337fe0495bc02259081a4004c74b5afbe52b" +version = "0.41.0" +source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkadot-v1.7.2#d8991ec727ad0fb64fe9957a3cd307387a6701e4" dependencies = [ "auto_impl", "environmental", @@ -3393,7 +3236,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", ] [[package]] @@ -3418,7 +3261,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -3472,7 +3315,7 @@ checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" dependencies = [ "expander 0.0.4", "indexmap 1.9.3", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -3482,7 +3325,7 @@ dependencies = [ [[package]] name = "fc-api" version = "1.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "async-trait", "fp-storage", @@ -3494,7 +3337,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "async-trait", "fp-consensus", @@ -3510,7 +3353,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "async-trait", "ethereum", @@ -3519,7 +3362,7 @@ dependencies = [ "fp-consensus", "fp-rpc", "fp-storage", - "futures 0.3.29", + "futures 0.3.30", "kvdb-rocksdb", "log", "parity-db", @@ -3541,13 +3384,13 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "fc-db", "fc-storage", "fp-consensus", "fp-rpc", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "log", "parking_lot 0.12.1", @@ -3564,7 +3407,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "ethereum", "ethereum-types", @@ -3576,7 +3419,7 @@ dependencies = [ "fp-evm", "fp-rpc", "fp-storage", - "futures 0.3.29", + "futures 0.3.30", "hex", "jsonrpsee", "libsecp256k1", @@ -3604,6 +3447,7 @@ dependencies = [ "sp-consensus", "sp-consensus-aura", "sp-core", + "sp-externalities", "sp-inherents", "sp-io", "sp-runtime", @@ -3618,20 +3462,22 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "ethereum", "ethereum-types", "jsonrpsee", + "rlp", "rustc-hex", "serde", "serde_json", + "sp-core-hashing", ] [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "ethereum", "ethereum-types", @@ -3648,21 +3494,12 @@ dependencies = [ [[package]] name = "fdlimit" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" +checksum = "e182f7dbc2ef73d9ef67351c5fbbea084729c48362d3ce9dd44c28e32e277fe5" 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 2.4.1", + "thiserror", ] [[package]] @@ -3723,7 +3560,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" dependencies = [ "either", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "log", "num-traits", @@ -3817,8 +3654,8 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" -version = "3.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "12.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", ] @@ -3835,7 +3672,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "hex", "impl-serde 0.4.0", @@ -3854,7 +3691,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "ethereum", "parity-scale-codec", @@ -3866,7 +3703,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "ethereum", "ethereum-types", @@ -3879,11 +3716,11 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "evm", "frame-support", - "num_enum 0.7.1", + "num_enum 0.7.2", "parity-scale-codec", "scale-info", "serde", @@ -3895,7 +3732,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "ethereum", "ethereum-types", @@ -3912,7 +3749,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "frame-support", "parity-scale-codec", @@ -3924,7 +3761,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "parity-scale-codec", "serde", @@ -3938,8 +3775,8 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-support-procedural", @@ -3963,8 +3800,8 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "32.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "Inflector", "array-bytes 6.2.0", @@ -4011,19 +3848,19 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "13.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "frame-election-provider-support" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -4039,8 +3876,8 @@ dependencies = [ [[package]] name = "frame-executive" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-system", @@ -4069,16 +3906,17 @@ dependencies = [ [[package]] name = "frame-remote-externalities" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.35.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "indicatif", "jsonrpsee", "log", "parity-scale-codec", "serde", "sp-core", + "sp-crypto-hashing", "sp-io", "sp-runtime", "sp-state-machine", @@ -4090,10 +3928,11 @@ dependencies = [ [[package]] name = "frame-support" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "aquamarine", + "array-bytes 6.2.0", "bitflags 1.3.2", "docify", "environmental", @@ -4112,7 +3951,7 @@ dependencies = [ "sp-api", "sp-arithmetic", "sp-core", - "sp-core-hashing-proc-macro", + "sp-crypto-hashing-proc-macro", "sp-debug-derive", "sp-genesis-builder", "sp-inherents", @@ -4130,8 +3969,8 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "23.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "Inflector", "cfg-expr", @@ -4143,38 +3982,39 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "sp-core-hashing", - "syn 2.0.39", + "sp-crypto-hashing", + "syn 2.0.53", ] [[package]] name = "frame-support-procedural-tools" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "10.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "frame-support-procedural-tools-derive" -version = "3.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "11.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "frame-system" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "cfg-if", + "docify", "frame-support", "log", "parity-scale-codec", @@ -4190,8 +4030,8 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -4205,8 +4045,8 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "sp-api", @@ -4214,8 +4054,8 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "parity-scale-codec", @@ -4245,9 +4085,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.6.6" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" +checksum = "29f9df8a11882c4e3335eb2d18a0137c505d9ca927470b0cac9c6f0ae07d28f7" dependencies = [ "rustix 0.38.24", "windows-sys 0.48.0", @@ -4267,9 +4107,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -4282,9 +4122,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -4292,15 +4132,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -4321,9 +4161,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -4352,13 +4192,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -4369,20 +4209,20 @@ checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", "rustls 0.20.9", - "webpki 0.22.4", + "webpki", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" @@ -4392,9 +4232,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures 0.1.31", "futures-channel", @@ -4480,19 +4320,10 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ + "rand 0.8.5", "rand_core 0.6.4", ] -[[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" @@ -4500,7 +4331,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ "opaque-debug 0.3.0", - "polyval 0.6.1", + "polyval", ] [[package]] @@ -4526,37 +4357,13 @@ 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 1.8.0", - "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 2.4.1", -] - [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", + "ff", "rand_core 0.6.4", "subtle 2.4.1", ] @@ -4663,13 +4470,10 @@ dependencies = [ ] [[package]] -name = "hermit-abi" -version = "0.1.19" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -4851,7 +4655,6 @@ dependencies = [ "rustls-native-certs", "tokio", "tokio-rustls", - "webpki-roots 0.25.2", ] [[package]] @@ -4877,12 +4680,6 @@ 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" @@ -4923,7 +4720,7 @@ dependencies = [ "async-io 1.13.0", "core-foundation", "fnv", - "futures 0.3.29", + "futures 0.3.30", "if-addrs", "ipnet", "log", @@ -5072,32 +4869,13 @@ 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.3", + "hermit-abi", "libc", "windows-sys 0.48.0", ] @@ -5132,7 +4910,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi", "rustix 0.38.24", "windows-sys 0.48.0", ] @@ -5190,9 +4968,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" +checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc" dependencies = [ "jsonrpsee-core", "jsonrpsee-http-client", @@ -5200,19 +4978,19 @@ dependencies = [ "jsonrpsee-server", "jsonrpsee-types", "jsonrpsee-ws-client", + "tokio", "tracing", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" +checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" dependencies = [ "futures-util", "http", "jsonrpsee-core", - "jsonrpsee-types", "pin-project", "rustls-native-certs", "soketto", @@ -5221,24 +4999,21 @@ dependencies = [ "tokio-rustls", "tokio-util", "tracing", - "webpki-roots 0.25.2", + "url", ] [[package]] name = "jsonrpsee-core" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" +checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" dependencies = [ "anyhow", - "arrayvec 0.7.4", "async-lock 2.8.0", "async-trait", "beef", - "futures-channel", "futures-timer", "futures-util", - "globset", "hyper", "jsonrpsee-types", "parking_lot 0.12.1", @@ -5254,31 +5029,32 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" +checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" dependencies = [ "async-trait", "hyper", "hyper-rustls", "jsonrpsee-core", "jsonrpsee-types", - "rustc-hash", "serde", "serde_json", "thiserror", "tokio", + "tower", "tracing", + "url", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" +checksum = "29110019693a4fa2dbda04876499d098fa16d70eba06b1e6e2b3f1b251419515" dependencies = [ - "heck", - "proc-macro-crate", + "heck 0.4.1", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -5286,19 +5062,20 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" +checksum = "82c39a00449c9ef3f50b84fc00fc4acba20ef8f559f07902244abf4c15c5ab9c" dependencies = [ - "futures-channel", "futures-util", "http", "hyper", "jsonrpsee-core", "jsonrpsee-types", + "route-recognizer", "serde", "serde_json", "soketto", + "thiserror", "tokio", "tokio-stream", "tokio-util", @@ -5308,9 +5085,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" +checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" dependencies = [ "anyhow", "beef", @@ -5322,14 +5099,15 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" +checksum = "bca9cb3933ccae417eb6b08c3448eb1cb46e39834e5b503e395e5e5bd08546c0" dependencies = [ "http", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", + "url", ] [[package]] @@ -5339,8 +5117,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" dependencies = [ "cfg-if", - "ecdsa 0.16.9", - "elliptic-curve 0.13.7", + "ecdsa", + "elliptic-curve", "once_cell", "sha2 0.10.8", ] @@ -5421,9 +5199,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" @@ -5443,12 +5221,12 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.51.3" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" +checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ "bytes", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "getrandom 0.2.11", "instant", @@ -5468,7 +5246,6 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-wasm-ext", - "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", "multiaddr", @@ -5507,13 +5284,13 @@ checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" dependencies = [ "either", "fnv", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "instant", "libp2p-identity", "log", "multiaddr", - "multihash", + "multihash 0.17.0", "multistream-select", "once_cell", "parking_lot 0.12.1", @@ -5533,7 +5310,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "libp2p-core", "log", "parking_lot 0.12.1", @@ -5549,7 +5326,7 @@ checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" dependencies = [ "asynchronous-codec", "either", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "libp2p-core", "libp2p-identity", @@ -5573,7 +5350,7 @@ dependencies = [ "ed25519-dalek 2.1.0", "log", "multiaddr", - "multihash", + "multihash 0.17.0", "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", @@ -5592,7 +5369,7 @@ dependencies = [ "bytes", "either", "fnv", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "instant", "libp2p-core", @@ -5616,7 +5393,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" dependencies = [ "data-encoding", - "futures 0.3.29", + "futures 0.3.30", "if-watch", "libp2p-core", "libp2p-identity", @@ -5652,7 +5429,7 @@ checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ "bytes", "curve25519-dalek 3.2.0", - "futures 0.3.29", + "futures 0.3.30", "libp2p-core", "libp2p-identity", "log", @@ -5674,7 +5451,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" dependencies = [ "either", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "instant", "libp2p-core", @@ -5691,7 +5468,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ "bytes", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "if-watch", "libp2p-core", @@ -5713,7 +5490,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "instant", "libp2p-core", "libp2p-identity", @@ -5730,7 +5507,7 @@ checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" dependencies = [ "either", "fnv", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "instant", "libp2p-core", @@ -5749,7 +5526,7 @@ version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" dependencies = [ - "heck", + "heck 0.4.1", "quote", "syn 1.0.109", ] @@ -5760,7 +5537,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "if-watch", "libc", @@ -5776,16 +5553,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "futures-rustls", "libp2p-core", "libp2p-identity", - "rcgen 0.10.0", + "rcgen", "ring 0.16.20", "rustls 0.20.9", "thiserror", - "webpki 0.22.4", - "x509-parser 0.14.0", + "webpki", + "x509-parser", "yasna", ] @@ -5795,7 +5572,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -5803,37 +5580,6 @@ dependencies = [ "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 0.3.29", - "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" @@ -5841,7 +5587,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "111273f7b3d3510524c752e8b7a5314b7f7a1fee7e68161c01a7d72cbb06db9f" dependencies = [ "either", - "futures 0.3.29", + "futures 0.3.30", "futures-rustls", "libp2p-core", "log", @@ -5850,7 +5596,7 @@ dependencies = [ "rw-stream-sink", "soketto", "url", - "webpki-roots 0.22.6", + "webpki-roots", ] [[package]] @@ -5859,7 +5605,7 @@ version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "libp2p-core", "log", "thiserror", @@ -5942,9 +5688,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" dependencies = [ "cc", "pkg-config", @@ -6037,9 +5783,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru" @@ -6103,7 +5849,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -6117,7 +5863,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -6128,7 +5874,7 @@ checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -6139,7 +5885,7 @@ checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -6163,7 +5909,7 @@ version = "0.1.0" dependencies = [ "cumulus-primitives-core", "flume 0.10.14", - "futures 0.3.29", + "futures 0.3.30", "hex-literal 0.3.4", "jsonrpsee", "parity-scale-codec", @@ -6209,16 +5955,6 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest 0.10.7", -] - [[package]] name = "memchr" version = "2.6.4" @@ -6243,6 +5979,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -6309,7 +6054,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "rand 0.8.5", "thrift", ] @@ -6367,10 +6112,10 @@ dependencies = [ [[package]] name = "mmr-gadget" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "29.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "log", "parity-scale-codec", "sc-client-api", @@ -6386,10 +6131,9 @@ dependencies = [ [[package]] name = "mmr-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "anyhow", "jsonrpsee", "parity-scale-codec", "serde", @@ -6540,7 +6284,7 @@ dependencies = [ "pallet-xcm", "pallet-xcm-benchmarks", "pallet-xcm-transactor", - "parachain-info", + "parachains-common", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain-primitives", @@ -6558,6 +6302,7 @@ dependencies = [ "sp-consensus-slots", "sp-core", "sp-debug-derive", + "sp-genesis-builder", "sp-inherents", "sp-io", "sp-offchain", @@ -6568,6 +6313,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "sp-weights", + "staging-parachain-info", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -6584,7 +6330,7 @@ name = "moonbeam" version = "0.12.3" dependencies = [ "assert_cmd", - "futures 0.3.29", + "futures 0.3.30", "hex", "moonbeam-cli", "moonbeam-service", @@ -6643,7 +6389,7 @@ dependencies = [ "primitive-types", "sha3", "sp-runtime", - "tiny-bip39 0.8.2", + "tiny-bip39", "url", ] @@ -6699,7 +6445,7 @@ dependencies = [ "fc-api", "fc-db", "fc-rpc", - "futures 0.3.29", + "futures 0.3.30", "jsonrpsee", "parity-scale-codec", "sp-api", @@ -6752,7 +6498,7 @@ name = "moonbeam-rpc-core-debug" version = "0.1.0" dependencies = [ "ethereum-types", - "futures 0.3.29", + "futures 0.3.30", "jsonrpsee", "moonbeam-client-evm-tracing", "moonbeam-rpc-core-types", @@ -6766,7 +6512,7 @@ name = "moonbeam-rpc-core-trace" version = "0.6.0" dependencies = [ "ethereum-types", - "futures 0.3.29", + "futures 0.3.30", "jsonrpsee", "moonbeam-client-evm-tracing", "moonbeam-rpc-core-types", @@ -6807,7 +6553,7 @@ dependencies = [ "fc-rpc", "fc-storage", "fp-rpc", - "futures 0.3.29", + "futures 0.3.30", "hex-literal 0.3.4", "jsonrpsee", "moonbeam-client-evm-tracing", @@ -6866,7 +6612,7 @@ dependencies = [ "fc-rpc-core", "fc-storage", "fp-rpc", - "futures 0.3.29", + "futures 0.3.30", "jsonrpsee", "log", "moonbeam-client-evm-tracing", @@ -7020,7 +6766,7 @@ dependencies = [ "pallet-xcm", "pallet-xcm-benchmarks", "pallet-xcm-transactor", - "parachain-info", + "parachains-common", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain-primitives", @@ -7037,6 +6783,7 @@ dependencies = [ "sp-block-builder", "sp-consensus-slots", "sp-core", + "sp-genesis-builder", "sp-inherents", "sp-io", "sp-offchain", @@ -7046,6 +6793,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "sp-weights", + "staging-parachain-info", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -7068,6 +6816,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "frame-try-runtime", "hex-literal 0.3.4", "impl-trait-for-tuples", "log", @@ -7111,7 +6860,7 @@ dependencies = [ "sp-api", "sp-consensus-slots", "sp-core", - "sp-io", + "sp-genesis-builder", "sp-runtime", "sp-std", "staging-xcm", @@ -7135,6 +6884,7 @@ dependencies = [ "cumulus-client-consensus-proposer", "cumulus-client-consensus-relay-chain", "cumulus-client-network", + "cumulus-client-parachain-inherent", "cumulus-client-service", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", @@ -7158,7 +6908,7 @@ dependencies = [ "frame-benchmarking", "frame-benchmarking-cli", "frame-system-rpc-runtime-api", - "futures 0.3.29", + "futures 0.3.30", "hex-literal 0.3.4", "jsonrpsee", "libsecp256k1", @@ -7250,7 +7000,7 @@ dependencies = [ "substrate-test-runtime", "substrate-test-runtime-client", "tempfile", - "tiny-bip39 0.8.2", + "tiny-bip39", "tokio", "trie-root 0.15.2", ] @@ -7262,7 +7012,7 @@ dependencies = [ "nimbus-primitives", "parity-scale-codec", "polkadot-primitives", - "schnorrkel 0.9.1", + "schnorrkel 0.11.4", "session-keys-primitives", "sp-api", "sp-application-crypto", @@ -7411,7 +7161,7 @@ dependencies = [ "pallet-xcm", "pallet-xcm-benchmarks", "pallet-xcm-transactor", - "parachain-info", + "parachains-common", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain-primitives", @@ -7429,6 +7179,7 @@ dependencies = [ "sp-consensus-slots", "sp-core", "sp-debug-derive", + "sp-genesis-builder", "sp-inherents", "sp-io", "sp-offchain", @@ -7438,6 +7189,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "sp-weights", + "staging-parachain-info", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -7460,7 +7212,7 @@ dependencies = [ "data-encoding", "log", "multibase", - "multihash", + "multihash 0.17.0", "percent-encoding", "serde", "static_assertions", @@ -7490,19 +7242,87 @@ dependencies = [ "blake3", "core2", "digest 0.10.7", - "multihash-derive", + "multihash-derive 0.8.0", "sha2 0.10.8", "sha3", "unsigned-varint", ] +[[package]] +name = "multihash" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" +dependencies = [ + "core2", + "digest 0.10.7", + "multihash-derive 0.8.0", + "sha2 0.10.8", + "unsigned-varint", +] + +[[package]] +name = "multihash" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" +dependencies = [ + "core2", + "unsigned-varint", +] + +[[package]] +name = "multihash-codetable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d815ecb3c8238d00647f8630ede7060a642c9f704761cd6082cb4028af6935" +dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.7", + "multihash-derive 0.9.0", + "ripemd", + "serde", + "sha1", + "sha2 0.10.8", + "sha3", + "strobe-rs", +] + [[package]] name = "multihash-derive" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "multihash-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "890e72cb7396cb99ed98c1246a97b243cc16394470d94e0bc8b0c2c11d84290e" +dependencies = [ + "core2", + "multihash 0.19.1", + "multihash-derive-impl", +] + +[[package]] +name = "multihash-derive-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38685e08adb338659871ecfc6ee47ba9b22dcc8abcf6975d379cc49145c3040" +dependencies = [ + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", @@ -7523,7 +7343,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" dependencies = [ "bytes", - "futures 0.3.29", + "futures 0.3.30", "log", "pin-project", "smallvec", @@ -7559,9 +7379,9 @@ dependencies = [ [[package]] name = "names" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146" +checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" dependencies = [ "rand 0.8.5", ] @@ -7638,7 +7458,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ "bytes", - "futures 0.3.29", + "futures 0.3.30", "log", "netlink-packet-core", "netlink-sys", @@ -7653,7 +7473,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ "bytes", - "futures 0.3.29", + "futures 0.3.30", "libc", "log", "tokio", @@ -7662,17 +7482,18 @@ dependencies = [ [[package]] name = "nimbus-consensus" version = "0.9.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "async-backing-primitives", "async-trait", "cumulus-client-collator", "cumulus-client-consensus-common", "cumulus-client-consensus-proposer", + "cumulus-client-parachain-inherent", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-interface", - "futures 0.3.29", + "futures 0.3.30", "log", "nimbus-primitives", "parity-scale-codec", @@ -7693,6 +7514,7 @@ dependencies = [ "sp-inherents", "sp-keystore", "sp-runtime", + "sp-version", "substrate-prometheus-endpoint", "tracing", ] @@ -7700,7 +7522,7 @@ dependencies = [ [[package]] name = "nimbus-primitives" version = "0.9.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "async-trait", "frame-benchmarking", @@ -7737,7 +7559,17 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "memoffset 0.6.5", +] + +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.4.1", + "cfg-if", + "libc", ] [[package]] @@ -7867,7 +7699,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi", "libc", ] @@ -7882,11 +7714,11 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683751d591e6d81200c39fb0d1032608b77724f34114db54f571ff1317b337c0" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive 0.7.1", + "num_enum_derive 0.7.2", ] [[package]] @@ -7902,14 +7734,14 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -7939,22 +7771,13 @@ dependencies = [ "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", + "asn1-rs", ] [[package]] @@ -7998,7 +7821,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -8027,13 +7850,13 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orchestra" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d78e1deb2a8d54fc1f063a544130db4da31dfe4d5d3b493186424910222a76" +checksum = "2356622ffdfe72362a45a1e5e87bb113b8327e596e39b91f11f0ef4395c8da79" dependencies = [ "async-trait", "dyn-clonable", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "orchestra-proc-macro", "pin-project", @@ -8044,15 +7867,15 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d035b1f968d91a826f2e34a9d6d02cb2af5aa7ca39ebd27922d850ab4b2dd2c6" +checksum = "eedb646674596266dc9bb2b5c7eea7c36b32ecc7777eba0d510196972d72c4fd" dependencies = [ "expander 2.0.0", "indexmap 2.1.0", "itertools 0.11.0", "petgraph", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -8069,8 +7892,8 @@ dependencies = [ [[package]] name = "orml-traits" -version = "0.6.1" -source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-v1.3.0#f5c743d972d4b94cdb2cd53c819adc002d1afafc" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-v1.7.2#f90f4de88986571e24ea3c027b9c09a4b732ee1f" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -8089,8 +7912,8 @@ dependencies = [ [[package]] name = "orml-utilities" -version = "0.6.1" -source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-v1.3.0#f5c743d972d4b94cdb2cd53c819adc002d1afafc" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-v1.7.2#f90f4de88986571e24ea3c027b9c09a4b732ee1f" dependencies = [ "frame-support", "parity-scale-codec", @@ -8104,8 +7927,8 @@ dependencies = [ [[package]] name = "orml-xcm-support" -version = "0.6.1" -source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-v1.3.0#f5c743d972d4b94cdb2cd53c819adc002d1afafc" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-v1.7.2#f90f4de88986571e24ea3c027b9c09a4b732ee1f" dependencies = [ "frame-support", "orml-traits", @@ -8118,10 +7941,9 @@ dependencies = [ [[package]] name = "orml-xtokens" -version = "0.6.1" -source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-v1.3.0#f5c743d972d4b94cdb2cd53c819adc002d1afafc" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/open-runtime-module-library?branch=moonbeam-polkadot-v1.7.2#f90f4de88986571e24ea3c027b9c09a4b732ee1f" dependencies = [ - "cumulus-primitives-core", "frame-support", "frame-system", "log", @@ -8139,25 +7961,21 @@ dependencies = [ ] [[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.8", -] - -[[package]] -name = "p384" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" +name = "pallet-asset-conversion" +version = "10.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -8182,23 +8000,41 @@ dependencies = [ [[package]] name = "pallet-asset-rate" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-asset-tx-payment" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "pallet-transaction-payment", "parity-scale-codec", "scale-info", + "serde", "sp-core", + "sp-io", "sp-runtime", "sp-std", ] [[package]] name = "pallet-assets" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "29.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8214,7 +8050,7 @@ dependencies = [ [[package]] name = "pallet-async-backing" version = "0.9.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -8234,7 +8070,7 @@ dependencies = [ [[package]] name = "pallet-author-inherent" version = "0.9.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "frame-benchmarking", "frame-support", @@ -8253,7 +8089,7 @@ dependencies = [ [[package]] name = "pallet-author-mapping" version = "2.0.5" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "frame-benchmarking", "frame-support", @@ -8271,7 +8107,7 @@ dependencies = [ [[package]] name = "pallet-author-slot-filter" version = "0.9.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "frame-benchmarking", "frame-support", @@ -8288,8 +8124,8 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-system", @@ -8304,8 +8140,8 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-system", @@ -8318,8 +8154,8 @@ dependencies = [ [[package]] name = "pallet-babe" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8342,8 +8178,8 @@ dependencies = [ [[package]] name = "pallet-bags-list" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "aquamarine", "docify", @@ -8364,9 +8200,10 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -8379,8 +8216,8 @@ dependencies = [ [[package]] name = "pallet-beefy" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-system", @@ -8399,8 +8236,8 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "binary-merkle-tree", @@ -8424,8 +8261,8 @@ dependencies = [ [[package]] name = "pallet-bounties" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8440,10 +8277,27 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-broker" +version = "0.6.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-child-bounties" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8459,10 +8313,29 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-collator-selection" +version = "9.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sp-runtime", + "sp-staking", + "sp-std", +] + [[package]] name = "pallet-collective" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8478,8 +8351,8 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8496,7 +8369,7 @@ dependencies = [ [[package]] name = "pallet-crowdloan-rewards" version = "0.6.0" -source = "git+https://github.com/moonbeam-foundation/crowdloan-rewards?branch=moonbeam-polkadot-v1.3.0#b0b477f2d176f95ea5099ba797d7060d0f09d40b" +source = "git+https://github.com/moonbeam-foundation/crowdloan-rewards?branch=moonbeam-polkadot-v1.7.2#0803fcfe6abdb966b989fd9ef8c22f007e24a232" dependencies = [ "ed25519-dalek 1.0.1", "frame-benchmarking", @@ -8517,8 +8390,8 @@ dependencies = [ [[package]] name = "pallet-democracy" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8535,8 +8408,8 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8558,8 +8431,8 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8572,8 +8445,8 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" -version = "5.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "29.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8615,7 +8488,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "environmental", "ethereum", @@ -8671,7 +8544,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "environmental", "evm", @@ -8697,7 +8570,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "frame-support", "frame-system", @@ -8791,7 +8664,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "fp-evm", ] @@ -8799,7 +8672,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "fp-evm", "sp-core", @@ -8911,6 +8784,7 @@ dependencies = [ "pallet-balances", "pallet-crowdloan-rewards", "pallet-evm", + "pallet-message-queue", "pallet-scheduler", "pallet-timestamp", "parity-scale-codec", @@ -8928,7 +8802,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-dispatch" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "fp-evm", "frame-support", @@ -9004,7 +8878,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "fp-evm", "num", @@ -9189,6 +9063,7 @@ dependencies = [ "orml-traits", "pallet-balances", "pallet-evm", + "pallet-message-queue", "pallet-staking", "pallet-timestamp", "pallet-xcm-transactor", @@ -9237,7 +9112,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "fp-evm", "tiny-keccak", @@ -9246,7 +9121,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.3.0#f55fd0733a8e50d81262de56d7f37d7f17293f66" +source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#58e15d000360c0ebecc201c8c56fd4768b350510" dependencies = [ "fp-evm", "ripemd", @@ -9384,8 +9259,8 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "docify", "frame-benchmarking", @@ -9403,8 +9278,8 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9426,13 +9301,14 @@ dependencies = [ [[package]] name = "pallet-identity" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "enumflags2", "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-io", @@ -9442,8 +9318,8 @@ dependencies = [ [[package]] name = "pallet-im-online" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9462,8 +9338,8 @@ dependencies = [ [[package]] name = "pallet-indices" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9480,7 +9356,7 @@ dependencies = [ [[package]] name = "pallet-maintenance-mode" version = "0.1.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -9495,8 +9371,8 @@ dependencies = [ [[package]] name = "pallet-membership" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9512,9 +9388,10 @@ dependencies = [ [[package]] name = "pallet-message-queue" -version = "7.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "31.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ + "environmental", "frame-benchmarking", "frame-support", "frame-system", @@ -9532,7 +9409,7 @@ dependencies = [ [[package]] name = "pallet-migrations" version = "0.1.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "frame-benchmarking", "frame-support", @@ -9550,8 +9427,8 @@ dependencies = [ [[package]] name = "pallet-mmr" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9607,8 +9484,8 @@ dependencies = [ [[package]] name = "pallet-multisig" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9623,8 +9500,8 @@ dependencies = [ [[package]] name = "pallet-nis" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9639,8 +9516,8 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "25.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-system", @@ -9658,8 +9535,8 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -9678,8 +9555,8 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" -version = "1.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "23.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -9689,8 +9566,8 @@ dependencies = [ [[package]] name = "pallet-offences" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-system", @@ -9706,8 +9583,8 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -9768,8 +9645,8 @@ dependencies = [ [[package]] name = "pallet-preimage" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9785,8 +9662,8 @@ dependencies = [ [[package]] name = "pallet-proxy" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9819,7 +9696,7 @@ dependencies = [ [[package]] name = "pallet-randomness" version = "0.1.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "environmental", "frame-benchmarking", @@ -9830,7 +9707,7 @@ dependencies = [ "nimbus-primitives", "parity-scale-codec", "scale-info", - "schnorrkel 0.9.1", + "schnorrkel 0.11.4", "serde", "session-keys-primitives", "sp-consensus-babe", @@ -9842,12 +9719,13 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", @@ -9860,8 +9738,8 @@ dependencies = [ [[package]] name = "pallet-recovery" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9875,8 +9753,8 @@ dependencies = [ [[package]] name = "pallet-referenda" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "assert_matches", "frame-benchmarking", @@ -9895,7 +9773,7 @@ dependencies = [ [[package]] name = "pallet-relay-storage-roots" version = "0.1.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -9917,8 +9795,8 @@ dependencies = [ [[package]] name = "pallet-root-testing" -version = "1.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "4.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-system", @@ -9932,8 +9810,8 @@ dependencies = [ [[package]] name = "pallet-scheduler" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "29.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "docify", "frame-benchmarking", @@ -9950,8 +9828,8 @@ dependencies = [ [[package]] name = "pallet-session" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-system", @@ -9972,8 +9850,8 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9989,8 +9867,8 @@ dependencies = [ [[package]] name = "pallet-society" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -10007,8 +9885,8 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -10030,19 +9908,19 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "11.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "pallet-staking-reward-fn" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "19.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "log", "sp-arithmetic", @@ -10050,17 +9928,18 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "14.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "sp-api", + "sp-staking", ] [[package]] name = "pallet-state-trie-migration" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "29.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -10076,8 +9955,8 @@ dependencies = [ [[package]] name = "pallet-sudo" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "docify", "frame-benchmarking", @@ -10092,8 +9971,8 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "docify", "frame-benchmarking", @@ -10112,8 +9991,8 @@ dependencies = [ [[package]] name = "pallet-tips" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -10131,8 +10010,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-system", @@ -10147,8 +10026,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "30.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -10163,8 +10042,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -10175,8 +10054,8 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "docify", "frame-benchmarking", @@ -10194,8 +10073,8 @@ dependencies = [ [[package]] name = "pallet-utility" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -10210,8 +10089,8 @@ dependencies = [ [[package]] name = "pallet-vesting" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -10225,8 +10104,8 @@ dependencies = [ [[package]] name = "pallet-whitelist" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -10240,14 +10119,15 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bounded-collections", "frame-benchmarking", "frame-support", "frame-system", "log", + "pallet-balances", "parity-scale-codec", "scale-info", "serde", @@ -10256,13 +10136,14 @@ dependencies = [ "sp-runtime", "sp-std", "staging-xcm", + "staging-xcm-builder", "staging-xcm-executor", ] [[package]] name = "pallet-xcm-benchmarks" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-benchmarking", "frame-support", @@ -10305,17 +10186,34 @@ dependencies = [ ] [[package]] -name = "parachain-info" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +name = "parachains-common" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "cumulus-primitives-core", + "cumulus-primitives-utility", "frame-support", "frame-system", + "log", + "pallet-asset-tx-payment", + "pallet-assets", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-message-queue", + "pallet-xcm", "parity-scale-codec", + "polkadot-primitives", "scale-info", + "sp-consensus-aura", + "sp-core", + "sp-io", "sp-runtime", "sp-std", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-executor", + "substrate-wasm-builder", ] [[package]] @@ -10331,7 +10229,7 @@ dependencies = [ "libc", "log", "lz4", - "memmap2", + "memmap2 0.5.10", "parking_lot 0.12.1", "rand 0.8.5", "siphasher", @@ -10359,7 +10257,7 @@ version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -10461,15 +10359,6 @@ 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 = "pbkdf2" version = "0.12.2" @@ -10495,15 +10384,6 @@ 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" @@ -10541,7 +10421,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -10582,7 +10462,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -10614,24 +10494,14 @@ dependencies = [ "futures-io", ] -[[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", + "der", + "spki", ] [[package]] @@ -10648,11 +10518,13 @@ checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] name = "polkadot-approval-distribution" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "bitvec", + "futures 0.3.30", "futures-timer", + "itertools 0.10.5", "polkadot-node-jaeger", "polkadot-node-metrics", "polkadot-node-network-protocol", @@ -10666,11 +10538,11 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "always-assert", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -10682,12 +10554,12 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "derive_more", "fatality", - "futures 0.3.29", + "futures 0.3.30", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -10705,12 +10577,12 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "fatality", - "futures 0.3.29", + "futures 0.3.30", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -10722,17 +10594,19 @@ dependencies = [ "sc-network", "schnellru", "thiserror", + "tokio", "tracing-gum", ] [[package]] name = "polkadot-cli" -version = "1.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ + "cfg-if", "clap", "frame-benchmarking-cli", - "futures 0.3.29", + "futures 0.3.30", "log", "polkadot-node-metrics", "polkadot-node-primitives", @@ -10754,12 +10628,12 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bitvec", "fatality", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -10776,8 +10650,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "scale-info", @@ -10788,14 +10662,14 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "derive_more", "fatality", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", - "indexmap 1.9.3", + "indexmap 2.1.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -10813,8 +10687,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -10827,10 +10701,10 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -10842,20 +10716,21 @@ dependencies = [ "sc-network-common", "sp-application-crypto", "sp-core", + "sp-crypto-hashing", "sp-keystore", "tracing-gum", ] [[package]] name = "polkadot-network-bridge" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "always-assert", "async-trait", "bytes", "fatality", - "futures 0.3.29", + "futures 0.3.30", "parity-scale-codec", "parking_lot 0.12.1", "polkadot-node-metrics", @@ -10871,10 +10746,10 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -10889,15 +10764,16 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bitvec", "derive_more", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", + "itertools 0.10.5", "kvdb", - "merlin 2.0.1", + "merlin 3.0.0", "parity-scale-codec", "polkadot-node-jaeger", "polkadot-node-primitives", @@ -10905,9 +10781,12 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", "sc-keystore", "schnellru", - "schnorrkel 0.9.1", + "schnorrkel 0.11.4", "sp-application-crypto", "sp-consensus", "sp-consensus-slots", @@ -10918,11 +10797,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bitvec", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "kvdb", "parity-scale-codec", @@ -10940,18 +10819,19 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bitvec", "fatality", - "futures 0.3.29", + "futures 0.3.30", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", "polkadot-statement-table", + "schnellru", "sp-keystore", "thiserror", "tracing-gum", @@ -10959,10 +10839,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -10974,11 +10854,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "parity-scale-codec", "polkadot-node-core-pvf", @@ -10995,25 +10875,24 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "polkadot-node-metrics", "polkadot-node-subsystem", - "polkadot-primitives", + "polkadot-node-subsystem-types", "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/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "kvdb", "parity-scale-codec", @@ -11027,11 +10906,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "fatality", - "futures 0.3.29", + "futures 0.3.30", "kvdb", "parity-scale-codec", "polkadot-node-primitives", @@ -11046,11 +10925,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "polkadot-node-subsystem", "polkadot-overseer", @@ -11063,12 +10942,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-prospective-parachains" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "6.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bitvec", "fatality", - "futures 0.3.29", + "futures 0.3.30", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -11080,12 +10959,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bitvec", "fatality", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -11097,12 +10976,14 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "always-assert", + "array-bytes 6.2.0", + "blake3", "cfg-if", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "is_executable", "libc", @@ -11112,6 +10993,7 @@ dependencies = [ "polkadot-node-core-pvf-common", "polkadot-node-metrics", "polkadot-node-primitives", + "polkadot-node-subsystem", "polkadot-parachain-primitives", "polkadot-primitives", "rand 0.8.5", @@ -11120,16 +11002,17 @@ dependencies = [ "sp-maybe-compressed-blob", "sp-wasm-interface", "tempfile", + "thiserror", "tokio", "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf-checker" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -11142,34 +11025,37 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "cfg-if", "cpu-time", - "futures 0.3.29", + "futures 0.3.30", "landlock", "libc", + "nix 0.27.1", "parity-scale-codec", "polkadot-parachain-primitives", "polkadot-primitives", "sc-executor", "sc-executor-common", "sc-executor-wasmtime", + "seccompiler", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-io", "sp-tracing", - "tokio", + "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-core-runtime-api" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "polkadot-node-metrics", "polkadot-node-subsystem", "polkadot-node-subsystem-types", @@ -11181,8 +11067,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "lazy_static", "log", @@ -11199,11 +11085,11 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bs58 0.5.0", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "log", "parity-scale-codec", @@ -11218,15 +11104,15 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-channel 1.9.0", "async-trait", "bitvec", "derive_more", "fatality", - "futures 0.3.29", + "futures 0.3.30", "hex", "parity-scale-codec", "polkadot-node-jaeger", @@ -11242,15 +11128,16 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ + "bitvec", "bounded-vec", - "futures 0.3.29", + "futures 0.3.30", "parity-scale-codec", "polkadot-parachain-primitives", "polkadot-primitives", - "schnorrkel 0.9.1", + "schnorrkel 0.11.4", "serde", "sp-application-crypto", "sp-consensus-babe", @@ -11264,8 +11151,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -11274,12 +11161,13 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", + "bitvec", "derive_more", - "futures 0.3.29", + "futures 0.3.30", "orchestra", "polkadot-node-jaeger", "polkadot-node-network-protocol", @@ -11292,26 +11180,28 @@ dependencies = [ "smallvec", "sp-api", "sp-authority-discovery", + "sp-blockchain", "sp-consensus-babe", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "polkadot-node-subsystem-util" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "derive_more", "fatality", - "futures 0.3.29", + "futures 0.3.30", "futures-channel", "itertools 0.10.5", "kvdb", "parity-db", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "pin-project", "polkadot-node-jaeger", "polkadot-node-metrics", @@ -11334,11 +11224,11 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "orchestra", "parking_lot 0.12.1", @@ -11356,12 +11246,11 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "6.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bounded-collections", "derive_more", - "frame-support", "parity-scale-codec", "polkadot-core-primitives", "scale-info", @@ -11369,15 +11258,17 @@ dependencies = [ "sp-core", "sp-runtime", "sp-std", + "sp-weights", ] [[package]] name = "polkadot-primitives" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bitvec", "hex-literal 0.4.1", + "log", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain-primitives", @@ -11399,8 +11290,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -11416,6 +11307,7 @@ dependencies = [ "sc-consensus-grandpa", "sc-consensus-grandpa-rpc", "sc-rpc", + "sc-rpc-spec-v2", "sc-sync-state-rpc", "sc-transaction-pool-api", "sp-api", @@ -11431,8 +11323,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bitvec", "frame-benchmarking", @@ -11446,8 +11338,10 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-balances", + "pallet-broker", "pallet-election-provider-multi-phase", "pallet-fast-unstake", + "pallet-identity", "pallet-session", "pallet-staking", "pallet-staking-reward-fn", @@ -11481,8 +11375,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bs58 0.5.0", "frame-benchmarking", @@ -11494,8 +11388,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -11509,6 +11403,7 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-balances", + "pallet-broker", "pallet-message-queue", "pallet-session", "pallet-staking", @@ -11526,6 +11421,7 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", + "sp-arithmetic", "sp-core", "sp-inherents", "sp-io", @@ -11541,8 +11437,8 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "frame-benchmarking", @@ -11550,7 +11446,7 @@ dependencies = [ "frame-support", "frame-system", "frame-system-rpc-runtime-api", - "futures 0.3.29", + "futures 0.3.30", "hex-literal 0.4.1", "is_executable", "kvdb", @@ -11564,6 +11460,7 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "parity-db", "parity-scale-codec", + "parking_lot 0.12.1", "polkadot-approval-distribution", "polkadot-availability-bitfield-distribution", "polkadot-availability-distribution", @@ -11659,20 +11556,19 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "arrayvec 0.7.4", "bitvec", "fatality", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", - "indexmap 1.9.3", + "indexmap 2.1.0", "parity-scale-codec", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", - "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-primitives", "sp-keystore", @@ -11683,12 +11579,13 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "polkadot-primitives", "sp-core", + "tracing-gum", ] [[package]] @@ -11729,19 +11626,7 @@ checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.5.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", + "universal-hash", ] [[package]] @@ -11753,7 +11638,7 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.5.1", + "universal-hash", ] [[package]] @@ -11909,7 +11794,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -11928,14 +11813,14 @@ dependencies = [ [[package]] name = "prioritized-metered-channel" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e99f0c89bd88f393aab44a4ab949351f7bc7e7e1179d11ecbfe50cbe4c47e342" +checksum = "a172e6cc603231f2cf004232eabcecccc0da53ba576ab286ef7baa0cfc7927ad" dependencies = [ "coarsetime", "crossbeam-queue", "derive_more", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "nanorand", "thiserror", @@ -11949,7 +11834,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", ] [[package]] @@ -11984,14 +11878,14 @@ checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -12030,7 +11924,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -12040,7 +11934,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive 0.12.3", ] [[package]] @@ -12050,14 +11954,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", - "heck", + "heck 0.4.1", "itertools 0.10.5", "lazy_static", "log", "multimap", "petgraph", "prettyplease 0.1.25", - "prost", + "prost 0.11.9", "prost-types", "regex", "syn 1.0.109", @@ -12079,12 +11983,25 @@ dependencies = [ ] [[package]] -name = "prost-types" -version = "0.11.9" +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "prost-types" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "prost", + "prost 0.11.9", ] [[package]] @@ -12150,14 +12067,14 @@ dependencies = [ "thiserror", "tinyvec", "tracing", - "webpki 0.22.4", + "webpki", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -12284,19 +12201,6 @@ dependencies = [ "crossbeam-utils", ] -[[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", - "x509-parser 0.13.2", - "yasna", -] - [[package]] name = "rcgen" version = "0.10.0" @@ -12349,13 +12253,12 @@ dependencies = [ [[package]] name = "reed-solomon-novelpoly" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58130877ca403ab42c864fbac74bb319a0746c07a634a92a5cfc7f54af272582" +checksum = "87413ebb313323d431e85d0afc5a68222aaed972843537cbfe5f061cf1b4bcab" dependencies = [ "derive_more", "fs-err", - "itertools 0.11.0", "static_init", "thiserror", ] @@ -12377,7 +12280,7 @@ checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -12446,17 +12349,6 @@ dependencies = [ "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" @@ -12555,8 +12447,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -12596,6 +12488,7 @@ dependencies = [ "pallet-ranked-collective", "pallet-recovery", "pallet-referenda", + "pallet-root-testing", "pallet-scheduler", "pallet-session", "pallet-society", @@ -12650,8 +12543,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "polkadot-primitives", @@ -12661,8 +12554,15 @@ dependencies = [ "sp-runtime", "sp-weights", "staging-xcm", + "staging-xcm-builder", ] +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + [[package]] name = "rpassword" version = "7.3.1" @@ -12674,24 +12574,13 @@ dependencies = [ "windows-sys 0.48.0", ] -[[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 0.3.29", + "futures 0.3.30", "log", "netlink-packet-route", "netlink-proto", @@ -12710,20 +12599,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[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" @@ -12801,19 +12676,6 @@ dependencies = [ "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.9" @@ -12822,8 +12684,8 @@ checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", "ring 0.16.20", - "sct 0.7.1", - "webpki 0.22.4", + "sct", + "webpki", ] [[package]] @@ -12835,7 +12697,7 @@ dependencies = [ "log", "ring 0.17.5", "rustls-webpki", - "sct 0.7.1", + "sct", ] [[package]] @@ -12892,7 +12754,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "pin-project", "static_assertions", ] @@ -12923,8 +12785,8 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "4.1.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "23.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "log", "sp-core", @@ -12934,18 +12796,19 @@ dependencies = [ [[package]] name = "sc-authority-discovery" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "ip_network", "libp2p", "log", - "multihash", + "multihash 0.18.1", + "multihash-codetable", "parity-scale-codec", - "prost", + "prost 0.12.3", "prost-build", "rand 0.8.5", "sc-client-api", @@ -12962,15 +12825,14 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "log", "parity-scale-codec", "sc-block-builder", - "sc-client-api", "sc-proposer-metrics", "sc-telemetry", "sc-transaction-pool-api", @@ -12985,25 +12847,29 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", - "sc-client-api", "sp-api", "sp-block-builder", "sp-blockchain", "sp-core", "sp-inherents", "sp-runtime", + "sp-trie", ] [[package]] name = "sc-chain-spec" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "memmap2", + "array-bytes 6.2.0", + "docify", + "log", + "memmap2 0.9.4", + "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", "sc-executor", @@ -13013,31 +12879,36 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-core", + "sp-crypto-hashing", + "sp-genesis-builder", + "sp-io", "sp-runtime", "sp-state-machine", ] [[package]] name = "sc-chain-spec-derive" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "11.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "sc-cli" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.36.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", + "bip39", "chrono", "clap", "fdlimit", - "futures 0.3.29", + "futures 0.3.30", + "itertools 0.10.5", "libp2p-identity", "log", "names", @@ -13067,17 +12938,16 @@ dependencies = [ "sp-storage", "sp-version", "thiserror", - "tiny-bip39 1.0.0", "tokio", ] [[package]] name = "sc-client-api" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "fnv", - "futures 0.3.29", + "futures 0.3.30", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -13100,8 +12970,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.35.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "hash-db 0.16.0", "kvdb", @@ -13126,11 +12996,11 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "libp2p-identity", "log", @@ -13151,11 +13021,11 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "log", "parity-scale-codec", "sc-block-builder", @@ -13180,12 +13050,12 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "fork-tree", - "futures 0.3.29", + "futures 0.3.30", "log", "num-bigint", "num-rational", @@ -13206,6 +13076,7 @@ dependencies = [ "sp-consensus-babe", "sp-consensus-slots", "sp-core", + "sp-crypto-hashing", "sp-inherents", "sp-keystore", "sp-runtime", @@ -13215,10 +13086,10 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "jsonrpsee", "sc-consensus-babe", "sc-consensus-epochs", @@ -13237,14 +13108,14 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "13.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "async-channel 1.9.0", "async-trait", "fnv", - "futures 0.3.29", + "futures 0.3.30", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -13261,20 +13132,22 @@ dependencies = [ "sp-consensus", "sp-consensus-beefy", "sp-core", + "sp-crypto-hashing", "sp-keystore", "sp-mmr-primitives", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "tokio", "wasm-timer", ] [[package]] name = "sc-consensus-beefy-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "13.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "jsonrpsee", "log", "parity-scale-codec", @@ -13290,8 +13163,8 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "fork-tree", "parity-scale-codec", @@ -13303,8 +13176,8 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.19.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "ahash 0.8.10", "array-bytes 6.2.0", @@ -13312,7 +13185,7 @@ dependencies = [ "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "log", "parity-scale-codec", @@ -13325,6 +13198,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-network-gossip", + "sc-network-sync", "sc-telemetry", "sc-transaction-pool-api", "sc-utils", @@ -13336,6 +13210,7 @@ dependencies = [ "sp-consensus", "sp-consensus-grandpa", "sp-core", + "sp-crypto-hashing", "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", @@ -13344,11 +13219,11 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.19.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "finality-grandpa", - "futures 0.3.29", + "futures 0.3.30", "jsonrpsee", "log", "parity-scale-codec", @@ -13364,12 +13239,12 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.35.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "assert_matches", "async-trait", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "jsonrpsee", "log", @@ -13399,11 +13274,11 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "log", "parity-scale-codec", @@ -13422,8 +13297,8 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.32.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "log", "parity-scale-codec", @@ -13445,8 +13320,8 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.29.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "sc-allocator", @@ -13458,8 +13333,8 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.29.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "anyhow", "cfg-if", @@ -13478,24 +13353,25 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "ansi_term", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "log", "sc-client-api", "sc-network", "sc-network-common", + "sc-network-sync", "sp-blockchain", "sp-runtime", ] [[package]] name = "sc-keystore" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "25.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "parking_lot 0.12.1", @@ -13508,13 +13384,14 @@ dependencies = [ [[package]] name = "sc-mixnet" -version = "0.1.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.4.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 4.2.0", "arrayvec 0.7.4", "blake2 0.10.6", - "futures 0.3.29", + "bytes", + "futures 0.3.30", "futures-timer", "libp2p-identity", "log", @@ -13536,8 +13413,8 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "async-channel 1.9.0", @@ -13546,7 +13423,7 @@ dependencies = [ "bytes", "either", "fnv", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "ip_network", "libp2p", @@ -13570,6 +13447,8 @@ dependencies = [ "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "tokio", + "tokio-stream", "unsigned-varint", "wasm-timer", "zeroize", @@ -13577,15 +13456,15 @@ dependencies = [ [[package]] name = "sc-network-bitswap" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-channel 1.9.0", "cid", - "futures 0.3.29", + "futures 0.3.30", "libp2p-identity", "log", - "prost", + "prost 0.12.3", "prost-build", "sc-client-api", "sc-network", @@ -13597,12 +13476,12 @@ dependencies = [ [[package]] name = "sc-network-common" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "bitflags 1.3.2", - "futures 0.3.29", + "futures 0.3.30", "libp2p-identity", "parity-scale-codec", "prost-build", @@ -13614,16 +13493,17 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "ahash 0.8.10", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "libp2p", "log", "sc-network", "sc-network-common", + "sc-network-sync", "schnellru", "sp-runtime", "substrate-prometheus-endpoint", @@ -13632,16 +13512,16 @@ dependencies = [ [[package]] name = "sc-network-light" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "async-channel 1.9.0", - "futures 0.3.29", + "futures 0.3.30", "libp2p-identity", "log", "parity-scale-codec", - "prost", + "prost 0.12.3", "prost-build", "sc-client-api", "sc-network", @@ -13653,20 +13533,20 @@ dependencies = [ [[package]] name = "sc-network-sync" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "async-channel 1.9.0", "async-trait", "fork-tree", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "libp2p", "log", "mockall", "parity-scale-codec", - "prost", + "prost 0.12.3", "prost-build", "sc-client-api", "sc-consensus", @@ -13683,21 +13563,23 @@ dependencies = [ "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "tokio", "tokio-stream", ] [[package]] name = "sc-network-transactions" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", - "futures 0.3.29", + "futures 0.3.30", "libp2p", "log", "parity-scale-codec", "sc-network", "sc-network-common", + "sc-network-sync", "sc-utils", "sp-consensus", "sp-runtime", @@ -13706,13 +13588,13 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "29.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "bytes", "fnv", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "hyper", "hyper-rustls", @@ -13740,8 +13622,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.17.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -13749,10 +13631,10 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "29.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "jsonrpsee", "log", "parity-scale-codec", @@ -13781,8 +13663,8 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -13801,8 +13683,8 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "11.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "http", "jsonrpsee", @@ -13816,11 +13698,11 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", - "futures 0.3.29", + "futures 0.3.30", "futures-util", "hex", "jsonrpsee", @@ -13829,12 +13711,14 @@ dependencies = [ "parking_lot 0.12.1", "sc-chain-spec", "sc-client-api", + "sc-rpc", "sc-transaction-pool-api", "sc-utils", "serde", "sp-api", "sp-blockchain", "sp-core", + "sp-rpc", "sp-runtime", "sp-version", "thiserror", @@ -13844,13 +13728,13 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.35.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "directories", "exit-future", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "jsonrpsee", "log", @@ -13858,7 +13742,6 @@ dependencies = [ "parking_lot 0.12.1", "pin-project", "rand 0.8.5", - "sc-block-builder", "sc-chain-spec", "sc-client-api", "sc-client-db", @@ -13908,8 +13791,8 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.30.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "log", "parity-scale-codec", @@ -13919,13 +13802,12 @@ dependencies = [ [[package]] name = "sc-storage-monitor" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.16.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "clap", "fs4", "log", - "sc-client-db", "sp-core", "thiserror", "tokio", @@ -13933,8 +13815,8 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -13952,10 +13834,11 @@ dependencies = [ [[package]] name = "sc-sysinfo" -version = "6.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "derive_more", + "futures 0.3.30", "libc", "log", "rand 0.8.5", @@ -13965,17 +13848,18 @@ dependencies = [ "serde", "serde_json", "sp-core", + "sp-crypto-hashing", "sp-io", "sp-std", ] [[package]] name = "sc-telemetry" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "15.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "chrono", - "futures 0.3.29", + "futures 0.3.30", "libp2p", "log", "parking_lot 0.12.1", @@ -13990,15 +13874,16 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "ansi_term", - "atty", "chrono", + "is-terminal", "lazy_static", "libc", "log", + "parity-scale-codec", "parking_lot 0.12.1", "regex", "rustc-hash", @@ -14019,22 +13904,22 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "11.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "sc-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "linked-hash-map", "log", @@ -14047,6 +13932,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-core", + "sp-crypto-hashing", "sp-runtime", "sp-tracing", "sp-transaction-pool", @@ -14056,11 +13942,11 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "log", "parity-scale-codec", "serde", @@ -14072,11 +13958,11 @@ dependencies = [ [[package]] name = "sc-utils" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "14.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-channel 1.9.0", - "futures 0.3.29", + "futures 0.3.30", "futures-timer", "lazy_static", "log", @@ -14105,7 +13991,7 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -14140,9 +14026,7 @@ 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 2.4.1", @@ -14165,6 +14049,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "schnorrkel" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +dependencies = [ + "aead", + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek 4.1.2", + "getrandom_or_panic", + "merlin 3.0.0", + "rand_core 0.6.4", + "serde_bytes", + "sha2 0.10.8", + "subtle 2.4.1", + "zeroize", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -14177,16 +14080,6 @@ 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 0.7.1", -] - [[package]] name = "sct" version = "0.7.1" @@ -14197,60 +14090,43 @@ dependencies = [ "untrusted 0.9.0", ] -[[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" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", + "base16ct", + "der", "generic-array 0.14.7", - "pkcs8 0.9.0", + "pkcs8", "subtle 2.4.1", "zeroize", ] [[package]] -name = "sec1" -version = "0.7.3" +name = "seccompiler" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +checksum = "345a3e4dddf721a478089d4697b83c6c0a8f5bf16086f6c13397e4534eb6e2e5" dependencies = [ - "base16ct 0.2.0", - "der 0.7.8", - "generic-array 0.14.7", - "pkcs8 0.10.2", - "subtle 2.4.1", - "zeroize", + "libc", ] [[package]] name = "secp256k1" -version = "0.24.3" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.6.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" dependencies = [ "cc", ] @@ -14313,29 +14189,38 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.192" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bytes" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -14344,9 +14229,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -14354,7 +14239,7 @@ dependencies = [ [[package]] name = "session-keys-primitives" version = "0.1.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "async-trait", "frame-support", @@ -14470,10 +14355,6 @@ 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" @@ -14518,6 +14399,11 @@ dependencies = [ "similar", ] +[[package]] +name = "simple-mermaid" +version = "0.1.0" +source = "git+https://github.com/kianenigma/simple-mermaid.git?rev=e48b187bcfd5cc75111acd9d241f1bd36604344b#e48b187bcfd5cc75111acd9d241f1bd36604344b" + [[package]] name = "siphasher" version = "0.3.11" @@ -14553,8 +14439,8 @@ dependencies = [ [[package]] name = "slot-range-helper" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "enumn", "parity-scale-codec", @@ -14574,9 +14460,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smol" @@ -14697,7 +14583,7 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58021967fd0a5eeeb23b08df6cc244a4d4a5b4aec1d27c9e02fad1a58b4cd74e" dependencies = [ - "aes-gcm 0.10.3", + "aes-gcm", "blake2 0.10.6", "chacha20poly1305", "curve25519-dalek 4.1.2", @@ -14737,7 +14623,7 @@ dependencies = [ "base64 0.13.1", "bytes", "flate2", - "futures 0.3.29", + "futures 0.3.30", "http", "httparse", "log", @@ -14747,8 +14633,8 @@ dependencies = [ [[package]] name = "sp-api" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "hash-db 0.16.0", "log", @@ -14768,22 +14654,22 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "15.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "Inflector", "blake2 0.10.6", "expander 2.0.0", - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "sp-application-crypto" -version = "23.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "30.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "scale-info", @@ -14795,8 +14681,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "16.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "23.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "integer-sqrt", "num-traits", @@ -14807,10 +14693,28 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "sp-ark-bls12-381" +version = "0.4.2" +source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" +dependencies = [ + "ark-bls12-381-ext", + "sp-crypto-ec-utils", +] + +[[package]] +name = "sp-ark-ed-on-bls12-381-bandersnatch" +version = "0.4.2" +source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" +dependencies = [ + "ark-ed-on-bls12-381-bandersnatch-ext", + "sp-crypto-ec-utils", +] + [[package]] name = "sp-authority-discovery" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "scale-info", @@ -14822,8 +14726,8 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "sp-api", "sp-inherents", @@ -14833,10 +14737,10 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -14851,11 +14755,11 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.32.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", - "futures 0.3.29", + "futures 0.3.30", "log", "sp-core", "sp-inherents", @@ -14866,8 +14770,8 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.32.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "parity-scale-codec", @@ -14883,8 +14787,8 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.32.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "parity-scale-codec", @@ -14902,8 +14806,8 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "13.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "lazy_static", "parity-scale-codec", @@ -14912,6 +14816,7 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-core", + "sp-crypto-hashing", "sp-io", "sp-mmr-primitives", "sp-runtime", @@ -14921,8 +14826,8 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "13.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "finality-grandpa", "log", @@ -14939,8 +14844,8 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.32.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "scale-info", @@ -14951,37 +14856,37 @@ dependencies = [ [[package]] name = "sp-core" -version = "21.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "bandersnatch_vrfs", + "bip39", "bitflags 1.3.2", "blake2 0.10.6", "bounded-collections", "bs58 0.5.0", "dyn-clonable", "ed25519-zebra 3.1.0", - "futures 0.3.29", + "futures 0.3.30", "hash-db 0.16.0", "hash256-std-hasher", "impl-serde 0.4.0", - "lazy_static", + "itertools 0.10.5", "libsecp256k1", "log", - "merlin 2.0.1", + "merlin 3.0.0", "parity-scale-codec", "parking_lot 0.12.1", "paste", "primitive-types", "rand 0.8.5", - "regex", "scale-info", - "schnorrkel 0.9.1", + "schnorrkel 0.11.4", "secp256k1", "secrecy", "serde", - "sp-core-hashing", + "sp-crypto-hashing", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", @@ -14990,7 +14895,6 @@ dependencies = [ "ss58-registry", "substrate-bip39", "thiserror", - "tiny-bip39 1.0.0", "tracing", "w3f-bls", "zeroize", @@ -14998,8 +14902,37 @@ dependencies = [ [[package]] name = "sp-core-hashing" -version = "9.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "15.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" +dependencies = [ + "sp-crypto-hashing", +] + +[[package]] +name = "sp-crypto-ec-utils" +version = "0.10.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" +dependencies = [ + "ark-bls12-377", + "ark-bls12-377-ext", + "ark-bls12-381", + "ark-bls12-381-ext", + "ark-bw6-761", + "ark-bw6-761-ext", + "ark-ec", + "ark-ed-on-bls12-377", + "ark-ed-on-bls12-377-ext", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ed-on-bls12-381-bandersnatch-ext", + "ark-scale", + "sp-runtime-interface", + "sp-std", +] + +[[package]] +name = "sp-crypto-hashing" +version = "0.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "blake2b_simd", "byteorder", @@ -15010,19 +14943,19 @@ dependencies = [ ] [[package]] -name = "sp-core-hashing-proc-macro" -version = "9.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +name = "sp-crypto-hashing-proc-macro" +version = "0.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "quote", - "sp-core-hashing", - "syn 2.0.39", + "sp-crypto-hashing", + "syn 2.0.53", ] [[package]] name = "sp-database" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "10.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -15030,18 +14963,18 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "8.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "14.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "sp-externalities" -version = "0.19.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.25.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "environmental", "parity-scale-codec", @@ -15051,8 +14984,8 @@ dependencies = [ [[package]] name = "sp-genesis-builder" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "serde_json", "sp-api", @@ -15062,8 +14995,8 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -15076,8 +15009,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "23.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "30.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bytes", "ed25519-dalek 2.1.0", @@ -15087,6 +15020,7 @@ dependencies = [ "rustversion", "secp256k1", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-keystore", "sp-runtime-interface", @@ -15100,10 +15034,9 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "24.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "31.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "lazy_static", "sp-core", "sp-runtime", "strum 0.24.1", @@ -15111,8 +15044,8 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.27.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.34.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -15123,8 +15056,8 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" -version = "4.1.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "11.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "thiserror", "zstd 0.12.4", @@ -15132,8 +15065,8 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.1.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.6.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -15143,8 +15076,8 @@ dependencies = [ [[package]] name = "sp-mixnet" -version = "0.1.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.4.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "scale-info", @@ -15155,8 +15088,8 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -15173,8 +15106,8 @@ dependencies = [ [[package]] name = "sp-npos-elections" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "scale-info", @@ -15187,8 +15120,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "sp-api", "sp-core", @@ -15197,8 +15130,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "8.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "13.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "backtrace", "lazy_static", @@ -15207,8 +15140,8 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "6.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "rustc-hash", "serde", @@ -15217,9 +15150,10 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "24.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "31.0.1" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ + "docify", "either", "hash256-std-hasher", "impl-trait-for-tuples", @@ -15229,6 +15163,7 @@ dependencies = [ "rand 0.8.5", "scale-info", "serde", + "simple-mermaid", "sp-application-crypto", "sp-arithmetic", "sp-core", @@ -15239,8 +15174,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "17.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "24.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -15257,20 +15192,21 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "11.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "17.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "Inflector", - "proc-macro-crate", + "expander 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "sp-session" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "scale-info", @@ -15284,8 +15220,8 @@ dependencies = [ [[package]] name = "sp-staking" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -15298,8 +15234,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.28.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.35.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "hash-db 0.16.0", "log", @@ -15319,10 +15255,10 @@ dependencies = [ [[package]] name = "sp-statement-store" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "10.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "aes-gcm 0.10.3", + "aes-gcm", "curve25519-dalek 4.1.2", "ed25519-dalek 2.1.0", "hkdf", @@ -15333,6 +15269,7 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-runtime", "sp-runtime-interface", @@ -15343,13 +15280,13 @@ dependencies = [ [[package]] name = "sp-std" -version = "8.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "14.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" [[package]] name = "sp-storage" -version = "13.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "19.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -15361,8 +15298,8 @@ dependencies = [ [[package]] name = "sp-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "parity-scale-codec", @@ -15374,8 +15311,8 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "10.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "16.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "sp-std", @@ -15386,8 +15323,8 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "sp-api", "sp-runtime", @@ -15395,8 +15332,8 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "26.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "parity-scale-codec", @@ -15410,12 +15347,11 @@ dependencies = [ [[package]] name = "sp-trie" -version = "22.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "29.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "ahash 0.8.10", "hash-db 0.16.0", - "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", @@ -15425,6 +15361,7 @@ dependencies = [ "scale-info", "schnellru", "sp-core", + "sp-externalities", "sp-std", "thiserror", "tracing", @@ -15434,15 +15371,15 @@ dependencies = [ [[package]] name = "sp-version" -version = "22.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "29.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", "parity-wasm", "scale-info", "serde", - "sp-core-hashing-proc-macro", + "sp-crypto-hashing-proc-macro", "sp-runtime", "sp-std", "sp-version-proc-macro", @@ -15451,19 +15388,19 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "8.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "13.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "sp-wasm-interface" -version = "14.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "20.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -15475,15 +15412,15 @@ dependencies = [ [[package]] name = "sp-weights" -version = "20.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ + "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", "sp-arithmetic", - "sp-core", "sp-debug-derive", "sp-std", ] @@ -15514,16 +15451,6 @@ dependencies = [ "strum 0.24.1", ] -[[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" @@ -15531,7 +15458,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.8", + "der", ] [[package]] @@ -15547,9 +15474,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e50c216e3624ec8e7ecd14c6a6a6370aad6ee5d8cfc3ab30b5162eeeef2ed33" +checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" dependencies = [ "sqlx-core", "sqlx-macros", @@ -15558,9 +15485,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6753e460c998bbd4cd8c6f0ed9a64346fcca0723d6e75e52fdc351c5d2169d" +checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" dependencies = [ "ahash 0.8.10", "atoi", @@ -15568,7 +15495,6 @@ dependencies = [ "bytes", "crc", "crossbeam-queue", - "dotenvy", "either", "event-listener 2.5.3", "futures-channel", @@ -15598,9 +15524,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a793bb3ba331ec8359c1853bd39eed32cdd7baaf22c35ccf5c92a7e8d1189ec" +checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" dependencies = [ "proc-macro2", "quote", @@ -15611,13 +15537,13 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4ee1e104e00dedb6aa5ffdd1343107b0a4702e862a84320ee7cc74782d96fc" +checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" dependencies = [ "dotenvy", "either", - "heck", + "heck 0.4.1", "hex", "once_cell", "proc-macro2", @@ -15635,9 +15561,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59dc83cf45d89c555a577694534fcd1b55c545a816c816ce51f20bbe56a4f3f" +checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" dependencies = [ "atoi", "flume 0.11.0", @@ -15653,6 +15579,7 @@ dependencies = [ "sqlx-core", "tracing", "url", + "urlencoding", ] [[package]] @@ -15676,11 +15603,26 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "staging-parachain-info" +version = "0.7.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + [[package]] name = "staging-xcm" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ + "array-bytes 6.2.0", "bounded-collections", "derivative", "environmental", @@ -15695,8 +15637,8 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "frame-system", @@ -15717,8 +15659,8 @@ dependencies = [ [[package]] name = "staging-xcm-executor" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "environmental", "frame-benchmarking", @@ -15726,6 +15668,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", + "scale-info", "sp-arithmetic", "sp-core", "sp-io", @@ -15784,11 +15727,24 @@ dependencies = [ "sp-trie", ] +[[package]] +name = "strobe-rs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabb238a1cccccfa4c4fb703670c0d157e1256c1ba695abf1b93bd2bb14bab2d" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "keccak", + "subtle 2.4.1", + "zeroize", +] + [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "strum" @@ -15811,7 +15767,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -15824,30 +15780,11 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn 2.0.39", -] - -[[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 2.4.1", - "thiserror", - "tokio", - "url", - "webrtc-util", + "syn 2.0.53", ] [[package]] @@ -15878,8 +15815,8 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" -version = "3.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "11.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" [[package]] name = "substrate-fixed" @@ -15893,11 +15830,11 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "28.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.29", + "futures 0.3.30", "jsonrpsee", "log", "parity-scale-codec", @@ -15912,8 +15849,8 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.17.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "hyper", "log", @@ -15924,8 +15861,8 @@ dependencies = [ [[package]] name = "substrate-rpc-client" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.33.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "jsonrpsee", @@ -15937,8 +15874,8 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "27.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -15955,11 +15892,11 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "async-trait", - "futures 0.3.29", + "futures 0.3.30", "parity-scale-codec", "sc-client-api", "sc-client-db", @@ -15976,12 +15913,13 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-state-machine", + "tokio", ] [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "array-bytes 6.2.0", "frame-executive", @@ -15995,8 +15933,6 @@ dependencies = [ "parity-scale-codec", "sc-service", "scale-info", - "serde", - "serde_json", "sp-api", "sp-application-crypto", "sp-block-builder", @@ -16004,6 +15940,7 @@ dependencies = [ "sp-consensus-babe", "sp-consensus-grandpa", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-genesis-builder", "sp-inherents", @@ -16024,9 +15961,9 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "sc-block-builder", "sc-client-api", "sc-consensus", @@ -16051,31 +15988,22 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "5.0.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "17.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ - "ansi_term", "build-helper", "cargo_metadata", + "console", "filetime", "parity-wasm", "sp-maybe-compressed-blob", "strum 0.24.1", "tempfile", - "toml 0.7.8", + "toml 0.8.12", "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 = "1.0.0" @@ -16119,9 +16047,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" dependencies = [ "proc-macro2", "quote", @@ -16195,6 +16123,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix 0.38.24", + "windows-sys 0.48.0", +] + [[package]] name = "termtree" version = "0.4.1" @@ -16238,7 +16176,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -16348,25 +16286,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "tiny-bip39" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" -dependencies = [ - "anyhow", - "hmac 0.12.1", - "once_cell", - "pbkdf2 0.11.0", - "rand 0.8.5", - "rustc-hash", - "sha2 0.10.8", - "thiserror", - "unicode-normalization", - "wasm-bindgen", - "zeroize", -] - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -16376,16 +16295,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -16403,9 +16312,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -16428,7 +16337,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -16490,14 +16399,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.22.8", ] [[package]] @@ -16514,12 +16423,34 @@ name = "toml_edit" version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow 0.5.19", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow 0.5.19", +] + +[[package]] +name = "toml_edit" +version = "0.22.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c12219811e0c1ba077867254e5ad62ee2c9c190b0d957110750ac0cda1ae96cd" dependencies = [ "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.5", ] [[package]] @@ -16528,6 +16459,10 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite 0.2.13", "tower-layer", "tower-service", "tracing", @@ -16583,7 +16518,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -16608,11 +16543,10 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "coarsetime", - "polkadot-node-jaeger", "polkadot-primitives", "tracing", "tracing-gum-proc-macro", @@ -16620,14 +16554,14 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "5.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "expander 2.0.0", - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -16705,16 +16639,6 @@ dependencies = [ "hash-db 0.16.0", ] -[[package]] -name = "triehash" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" -dependencies = [ - "hash-db 0.15.2", - "rlp", -] - [[package]] name = "trust-dns-proto" version = "0.22.0" @@ -16769,8 +16693,8 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" -version = "0.10.0-dev" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "0.38.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "async-trait", "clap", @@ -16824,25 +16748,6 @@ 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 0.3.29", - "log", - "md-5", - "rand 0.8.5", - "ring 0.16.20", - "stun", - "thiserror", - "tokio", - "webrtc-util", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -16924,16 +16829,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" -[[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 2.4.1", -] - [[package]] name = "universal-hash" version = "0.5.1" @@ -16980,19 +16875,16 @@ dependencies = [ ] [[package]] -name = "utf8parse" -version = "0.2.1" +name = "urlencoding" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] -name = "uuid" -version = "1.5.0" +name = "utf8parse" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" -dependencies = [ - "getrandom 0.2.11", -] +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "valuable" @@ -17051,15 +16943,6 @@ dependencies = [ "libc", ] -[[package]] -name = "waitgroup" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" -dependencies = [ - "atomic-waker", -] - [[package]] name = "waker-fn" version = "1.1.1" @@ -17118,7 +17001,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", "wasm-bindgen-shared", ] @@ -17152,7 +17035,7 @@ checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -17165,9 +17048,9 @@ checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-instrument" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" +checksum = "2a47ecb37b9734d1085eaa5ae1a81e60801fd8c28d4cabdd8aedb982021918bc" dependencies = [ "parity-wasm", ] @@ -17218,7 +17101,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "js-sys", "parking_lot 0.11.2", "pin-utils", @@ -17482,16 +17365,6 @@ dependencies = [ "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 0.7.1", -] - [[package]] name = "webpki" version = "0.22.4" @@ -17508,227 +17381,13 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.4", -] - -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - -[[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.8", - "stun", - "thiserror", - "time", - "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.3", - "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.8", - "signature 1.6.4", - "subtle 2.4.1", - "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.10", - "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 2.4.1", - "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 0.24.3", - "rand 0.8.5", - "thiserror", - "tokio", - "winapi", + "webpki", ] [[package]] name = "westend-runtime" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "binary-merkle-tree", "bitvec", @@ -17774,6 +17433,7 @@ dependencies = [ "pallet-proxy", "pallet-recovery", "pallet-referenda", + "pallet-root-testing", "pallet-scheduler", "pallet-session", "pallet-session-benchmarking", @@ -17832,8 +17492,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "polkadot-primitives", @@ -17843,6 +17503,7 @@ dependencies = [ "sp-runtime", "sp-weights", "staging-xcm", + "staging-xcm-builder", ] [[package]] @@ -17941,6 +17602,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -17971,6 +17641,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -17983,6 +17668,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -17995,6 +17686,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -18007,6 +17704,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -18019,6 +17722,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -18031,6 +17740,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -18043,6 +17758,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -18055,6 +17776,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + [[package]] name = "winnow" version = "0.5.19" @@ -18064,6 +17791,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -18106,38 +17842,19 @@ dependencies = [ "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", -] - [[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", + "asn1-rs", "base64 0.13.1", "data-encoding", - "der-parser 8.2.0", + "der-parser", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry", "rusticata-macros", "thiserror", "time", @@ -18146,7 +17863,7 @@ dependencies = [ [[package]] name = "xcm-primitives" version = "0.1.0" -source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.3.0#a34e9ba41e4411ebb806cc71ee5a15ad99de157a" +source = "git+https://github.com/Moonsong-Labs/moonkit?branch=moonbeam-polkadot-v1.7.2#8e4c4df71e15b9c8e1324795c711ddb126f4e28a" dependencies = [ "sp-runtime", ] @@ -18181,19 +17898,19 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] name = "xcm-simulator" -version = "1.0.0" -source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.3.0#771cd7512cf6c4efc9f01539acb797a6f1cbb623" +version = "7.0.0" +source = "git+https://github.com/moonbeam-foundation/polkadot-sdk?branch=moonbeam-polkadot-v1.7.2#b1a8ee89b52c15f3a8835d49232291b25c74e3f0" dependencies = [ "frame-support", "parity-scale-codec", @@ -18214,7 +17931,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "log", "nohash-hasher", "parking_lot 0.12.1", @@ -18248,7 +17965,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] @@ -18268,7 +17985,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.53", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index bc837a7731..49701f69dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,44 +1,44 @@ [workspace] exclude = ["bin/utils/moonkey"] members = [ - "bin/utils/moonkey", - "client/rpc/finality", - "client/rpc/manual-xcm", - "client/vrf", - "node", - "node/cli", - "node/service", - "pallets/erc20-xcm-bridge", - "pallets/moonbeam-orbiters", - "pallets/precompile-benchmarks", - "pallets/proxy-genesis-companion", - "pallets/moonbeam-lazy-migrations", - "precompiles/balances-erc20", - "precompiles/batch", - "precompiles/call-permit", - "precompiles/collective", - "precompiles/conviction-voting", - "precompiles/crowdloan-rewards", - "precompiles/gmp", - "precompiles/identity", - "precompiles/parachain-staking", - "precompiles/precompile-registry", - "precompiles/preimage", - "precompiles/proxy", - "precompiles/referenda", - "precompiles/relay-encoder", - "precompiles/relay-data-verifier", - "precompiles/utils", - "precompiles/utils/macro", - "precompiles/utils/tests-external", - "precompiles/xcm-transactor", - "precompiles/xtokens", - "primitives/storage-proof", - "runtime/moonbase", - "runtime/moonbeam", - "runtime/moonriver", - "runtime/relay-encoder", - "runtime/summarize-precompile-checks", + "bin/utils/moonkey", + "client/rpc/finality", + "client/rpc/manual-xcm", + "client/vrf", + "node", + "node/cli", + "node/service", + "pallets/erc20-xcm-bridge", + "pallets/moonbeam-orbiters", + "pallets/precompile-benchmarks", + "pallets/proxy-genesis-companion", + "pallets/moonbeam-lazy-migrations", + "precompiles/balances-erc20", + "precompiles/batch", + "precompiles/call-permit", + "precompiles/collective", + "precompiles/conviction-voting", + "precompiles/crowdloan-rewards", + "precompiles/gmp", + "precompiles/identity", + "precompiles/parachain-staking", + "precompiles/precompile-registry", + "precompiles/preimage", + "precompiles/proxy", + "precompiles/referenda", + "precompiles/relay-encoder", + "precompiles/relay-data-verifier", + "precompiles/utils", + "precompiles/utils/macro", + "precompiles/utils/tests-external", + "precompiles/xcm-transactor", + "precompiles/xtokens", + "primitives/storage-proof", + "runtime/moonbase", + "runtime/moonbeam", + "runtime/moonriver", + "runtime/relay-encoder", + "runtime/summarize-precompile-checks", ] resolver = "2" @@ -54,333 +54,337 @@ repository = "https://github.com/PureStake/moonbeam" # - "client" dependencies are only used in the client, and thus don't need to be no_std compatible. # Moonbeam (wasm) -account = {path = "primitives/account", default-features = false} -evm-tracing-events = {path = "primitives/rpc/evm-tracing-events", default-features = false} -moonbeam-core-primitives = {path = "core-primitives", default-features = false} -moonbeam-primitives-ext = {path = "primitives/ext", default-features = false} -moonbeam-rpc-primitives-debug = {path = "primitives/rpc/debug", default-features = false} -moonbeam-rpc-primitives-txpool = {path = "primitives/rpc/txpool", default-features = false} -storage-proof-primitives = {path = "primitives/storage-proof", default-features = false} +account = { path = "primitives/account", default-features = false } +evm-tracing-events = { path = "primitives/rpc/evm-tracing-events", default-features = false } +moonbeam-core-primitives = { path = "core-primitives", default-features = false } +moonbeam-primitives-ext = { path = "primitives/ext", default-features = false } +moonbeam-rpc-primitives-debug = { path = "primitives/rpc/debug", default-features = false, features = [ + "runtime-2900", +] } +moonbeam-rpc-primitives-txpool = { path = "primitives/rpc/txpool", default-features = false } +storage-proof-primitives = { path = "primitives/storage-proof", default-features = false } -moonbeam-evm-tracer = {path = "runtime/evm_tracer", default-features = false} -moonbeam-relay-encoder = {path = "runtime/relay-encoder", default-features = false} -moonbeam-runtime-common = {path = "runtime/common", default-features = false} +moonbeam-evm-tracer = { path = "runtime/evm_tracer", default-features = false } +moonbeam-relay-encoder = { path = "runtime/relay-encoder", default-features = false } +moonbeam-runtime-common = { path = "runtime/common", default-features = false } -moonbeam-xcm-benchmarks = {path = "pallets/moonbeam-xcm-benchmarks", default-features = false} -pallet-asset-manager = {path = "pallets/asset-manager", default-features = false} -pallet-erc20-xcm-bridge = {path = "pallets/erc20-xcm-bridge", default-features = false} -pallet-ethereum-xcm = {path = "pallets/ethereum-xcm", default-features = false} +moonbeam-xcm-benchmarks = { path = "pallets/moonbeam-xcm-benchmarks", default-features = false } +pallet-asset-manager = { path = "pallets/asset-manager", default-features = false } +pallet-erc20-xcm-bridge = { path = "pallets/erc20-xcm-bridge", default-features = false } +pallet-ethereum-xcm = { path = "pallets/ethereum-xcm", default-features = false } -pallet-evm-precompile-author-mapping = {path = "precompiles/author-mapping", default-features = false} -pallet-evm-precompile-balances-erc20 = {path = "precompiles/balances-erc20", default-features = false} -pallet-evm-precompile-batch = {path = "precompiles/batch", default-features = false} -pallet-evm-precompile-call-permit = {path = "precompiles/call-permit", default-features = false} -pallet-evm-precompile-collective = {path = "precompiles/collective", default-features = false} -pallet-evm-precompile-conviction-voting = {path = "precompiles/conviction-voting", default-features = false} -pallet-evm-precompile-crowdloan-rewards = {path = "precompiles/crowdloan-rewards", default-features = false} -pallet-evm-precompile-gmp = {path = "precompiles/gmp", default-features = false} -pallet-evm-precompile-identity = {path = "precompiles/identity", default-features = false} -pallet-evm-precompile-parachain-staking = {path = "precompiles/parachain-staking", default-features = false} -pallet-evm-precompile-preimage = {path = "precompiles/preimage", default-features = false} -pallet-evm-precompile-proxy = {path = "precompiles/proxy", default-features = false} -pallet-evm-precompile-randomness = {path = "precompiles/randomness", default-features = false} -pallet-evm-precompile-referenda = {path = "precompiles/referenda", default-features = false} -pallet-evm-precompile-registry = {path = "precompiles/precompile-registry", default-features = false} -pallet-evm-precompile-relay-encoder = {path = "precompiles/relay-encoder", default-features = false} -pallet-evm-precompile-relay-verifier = {path = "precompiles/relay-data-verifier", default-features = false} -pallet-evm-precompile-xcm-transactor = {path = "precompiles/xcm-transactor", default-features = false} -pallet-evm-precompile-xcm-utils = {path = "precompiles/xcm-utils", default-features = false} -pallet-evm-precompile-xtokens = {path = "precompiles/xtokens", default-features = false} -pallet-evm-precompileset-assets-erc20 = {path = "precompiles/assets-erc20", default-features = false} -pallet-moonbeam-lazy-migrations = {path = "pallets/moonbeam-lazy-migrations", default-features = false} -pallet-moonbeam-orbiters = {path = "pallets/moonbeam-orbiters", default-features = false} -pallet-parachain-staking = {path = "pallets/parachain-staking", default-features = false} -pallet-precompile-benchmarks = {path = "pallets/precompile-benchmarks", default-features = false} -pallet-proxy-genesis-companion = {path = "pallets/proxy-genesis-companion", default-features = false} -pallet-xcm-transactor = {path = "pallets/xcm-transactor", default-features = false} -precompile-utils = {path = "precompiles/utils", default-features = false} -xcm-primitives = {path = "primitives/xcm", default-features = false} +pallet-evm-precompile-author-mapping = { path = "precompiles/author-mapping", default-features = false } +pallet-evm-precompile-balances-erc20 = { path = "precompiles/balances-erc20", default-features = false } +pallet-evm-precompile-batch = { path = "precompiles/batch", default-features = false } +pallet-evm-precompile-call-permit = { path = "precompiles/call-permit", default-features = false } +pallet-evm-precompile-collective = { path = "precompiles/collective", default-features = false } +pallet-evm-precompile-conviction-voting = { path = "precompiles/conviction-voting", default-features = false } +pallet-evm-precompile-crowdloan-rewards = { path = "precompiles/crowdloan-rewards", default-features = false } +pallet-evm-precompile-gmp = { path = "precompiles/gmp", default-features = false } +pallet-evm-precompile-identity = { path = "precompiles/identity", default-features = false } +pallet-evm-precompile-parachain-staking = { path = "precompiles/parachain-staking", default-features = false } +pallet-evm-precompile-preimage = { path = "precompiles/preimage", default-features = false } +pallet-evm-precompile-proxy = { path = "precompiles/proxy", default-features = false } +pallet-evm-precompile-randomness = { path = "precompiles/randomness", default-features = false } +pallet-evm-precompile-referenda = { path = "precompiles/referenda", default-features = false } +pallet-evm-precompile-registry = { path = "precompiles/precompile-registry", default-features = false } +pallet-evm-precompile-relay-encoder = { path = "precompiles/relay-encoder", default-features = false } +pallet-evm-precompile-relay-verifier = { path = "precompiles/relay-data-verifier", default-features = false } +pallet-evm-precompile-xcm-transactor = { path = "precompiles/xcm-transactor", default-features = false } +pallet-evm-precompile-xcm-utils = { path = "precompiles/xcm-utils", default-features = false } +pallet-evm-precompile-xtokens = { path = "precompiles/xtokens", default-features = false } +pallet-evm-precompileset-assets-erc20 = { path = "precompiles/assets-erc20", default-features = false } +pallet-moonbeam-orbiters = { path = "pallets/moonbeam-orbiters", default-features = false } +pallet-parachain-staking = { path = "pallets/parachain-staking", default-features = false } +pallet-precompile-benchmarks = { path = "pallets/precompile-benchmarks", default-features = false } +pallet-proxy-genesis-companion = { path = "pallets/proxy-genesis-companion", default-features = false } +pallet-xcm-transactor = { path = "pallets/xcm-transactor", default-features = false } +pallet-moonbeam-lazy-migrations = { path = "pallets/moonbeam-lazy-migrations", default-features = false } +precompile-utils = { path = "precompiles/utils", default-features = false } +xcm-primitives = { path = "primitives/xcm", default-features = false } -pallet-crowdloan-rewards = {git = "https://github.com/moonbeam-foundation/crowdloan-rewards", branch = "moonbeam-polkadot-v1.3.0", default-features = false} +pallet-crowdloan-rewards = { git = "https://github.com/moonbeam-foundation/crowdloan-rewards", branch = "moonbeam-polkadot-v1.7.2", default-features = false } # Moonbeam (client) -moonbeam-cli = {path = "node/cli", default-features = false} -moonbeam-cli-opt = {path = "node/cli-opt", default-features = false} -moonbeam-service = {path = "node/service", default-features = false} +moonbeam-cli = { path = "node/cli", default-features = false } +moonbeam-cli-opt = { path = "node/cli-opt", default-features = false } +moonbeam-service = { path = "node/service", default-features = false } -manual-xcm-rpc = {path = "client/rpc/manual-xcm"} -moonbeam-client-evm-tracing = {path = "client/evm-tracing"} -moonbeam-finality-rpc = {path = "client/rpc/finality"} -moonbeam-rpc-core-debug = {path = "client/rpc-core/debug"} -moonbeam-rpc-core-trace = {path = "client/rpc-core/trace"} -moonbeam-rpc-core-txpool = {path = "client/rpc-core/txpool"} -moonbeam-rpc-core-types = {path = "client/rpc-core/types"} -moonbeam-rpc-debug = {path = "client/rpc/debug"} -moonbeam-rpc-trace = {path = "client/rpc/trace"} -moonbeam-rpc-txpool = {path = "client/rpc/txpool"} -moonbeam-vrf = {path = "client/vrf"} +manual-xcm-rpc = { path = "client/rpc/manual-xcm" } +moonbeam-client-evm-tracing = { path = "client/evm-tracing" } +moonbeam-finality-rpc = { path = "client/rpc/finality" } +moonbeam-rpc-core-debug = { path = "client/rpc-core/debug" } +moonbeam-rpc-core-trace = { path = "client/rpc-core/trace" } +moonbeam-rpc-core-txpool = { path = "client/rpc-core/txpool" } +moonbeam-rpc-core-types = { path = "client/rpc-core/types" } +moonbeam-rpc-debug = { path = "client/rpc/debug" } +moonbeam-rpc-trace = { path = "client/rpc/trace" } +moonbeam-rpc-txpool = { path = "client/rpc/txpool" } +moonbeam-vrf = { path = "client/vrf" } -moonbase-runtime = {path = "runtime/moonbase"} -moonbeam-runtime = {path = "runtime/moonbeam"} -moonriver-runtime = {path = "runtime/moonriver"} +moonbase-runtime = { path = "runtime/moonbase" } +moonbeam-runtime = { path = "runtime/moonbeam" } +moonriver-runtime = { path = "runtime/moonriver" } -# Substrate (wasm) -frame-benchmarking = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -frame-executive = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -frame-support = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -frame-system = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -frame-system-benchmarking = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -frame-system-rpc-runtime-api = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -frame-try-runtime = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-assets = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-balances = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-collective = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-conviction-voting = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-identity = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-message-queue = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -pallet-multisig = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-preimage = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-proxy = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-referenda = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-root-testing = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-scheduler = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-society = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-staking = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-sudo = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-timestamp = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-transaction-payment = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-transaction-payment-rpc-runtime-api = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-treasury = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-utility = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-whitelist = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -parity-scale-codec = {version = "3.2.2", default-features = false, features = [ - "derive", -]} -scale-info = {version = "2.0", default-features = false, features = [ - "derive", -]} -sp-api = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-application-crypto = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-block-builder = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-consensus-babe = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-consensus-slots = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-core = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-debug-derive = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-externalities = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-inherents = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-io = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-keystore = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-offchain = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-runtime = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-runtime-interface = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-session = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-state-machine = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-std = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-transaction-pool = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-trie = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-version = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -sp-weights = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -substrate-fixed = {git = "https://github.com/encointer/substrate-fixed", default-features = false} +frame-benchmarking = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +frame-executive = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +frame-support = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +frame-system = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +frame-system-benchmarking = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +frame-try-runtime = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-assets = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-balances = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-collective = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-conviction-voting = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-identity = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-message-queue = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-multisig = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-preimage = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-proxy = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-referenda = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-root-testing = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-scheduler = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-society = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-staking = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-sudo = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-timestamp = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-transaction-payment = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-treasury = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-utility = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-whitelist = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +parity-scale-codec = { version = "3.2.2", default-features = false, features = [ + "derive", +] } +scale-info = { version = "2.0", default-features = false, features = [ + "derive", +] } +sp-api = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-application-crypto = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-block-builder = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-consensus-babe = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-consensus-slots = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-core = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-debug-derive = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-externalities = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-inherents = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-io = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-keystore = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-offchain = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-runtime = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-runtime-interface = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-session = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-std = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-state-machine = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-transaction-pool = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-trie = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-version = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-weights = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +sp-genesis-builder = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } # Substrate (client) -frame-benchmarking-cli = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -pallet-transaction-payment-rpc = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-basic-authorship = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-block-builder = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-chain-spec = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-cli = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-client-api = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-client-db = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-consensus = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-consensus-grandpa = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-consensus-manual-seal = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-executor = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-informant = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-network = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-network-common = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-network-sync = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-offchain = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-rpc = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-rpc-api = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-service = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-sysinfo = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-telemetry = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-tracing = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-transaction-pool = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-transaction-pool-api = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sc-utils = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sp-blockchain = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sp-consensus = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sp-storage = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sp-timestamp = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -sp-wasm-interface = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -substrate-build-script-utils = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -substrate-frame-rpc-system = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -substrate-prometheus-endpoint = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -substrate-test-client = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -substrate-test-runtime = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -substrate-test-runtime-client = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -substrate-wasm-builder = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -try-runtime-cli = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} +frame-benchmarking-cli = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +pallet-transaction-payment-rpc = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-basic-authorship = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-block-builder = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-chain-spec = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-cli = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-client-api = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-client-db = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-consensus = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-consensus-grandpa = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-consensus-manual-seal = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-executor = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-informant = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-network = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-network-common = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-network-sync = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-offchain = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-rpc = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-rpc-api = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-service = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-sysinfo = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-telemetry = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-tracing = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-transaction-pool = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-transaction-pool-api = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sc-utils = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sp-blockchain = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sp-consensus = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sp-storage = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sp-timestamp = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +sp-wasm-interface = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +substrate-build-script-utils = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +substrate-frame-rpc-system = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +substrate-prometheus-endpoint = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +substrate-test-client = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +substrate-test-runtime = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +substrate-test-runtime-client = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +substrate-wasm-builder = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +try-runtime-cli = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } # Frontier (wasm) -ethereum = {version = "0.14.0", default-features = false, features = [ - "with-codec", -]} -ethereum-types = {version = "0.14", default-features = false} -evm = {git = "https://github.com/moonbeam-foundation/evm", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -evm-gasometer = {git = "https://github.com/moonbeam-foundation/evm", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -evm-runtime = {git = "https://github.com/moonbeam-foundation/evm", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -fp-ethereum = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -fp-evm = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -fp-rpc = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -fp-self-contained = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-ethereum = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false, features = [ - "forbid-evm-reentrancy", -]} -pallet-evm = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false, features = [ - "forbid-evm-reentrancy", -]} -pallet-evm-chain-id = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-evm-precompile-blake2 = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-evm-precompile-bn128 = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-evm-precompile-dispatch = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-evm-precompile-modexp = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-evm-precompile-sha3fips = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-evm-precompile-simple = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", default-features = false} +ethereum = { version = "0.15.0", default-features = false, features = [ + "with-codec", +] } +ethereum-types = { version = "0.14", default-features = false } +evm = { git = "https://github.com/moonbeam-foundation/evm", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +evm-gasometer = { git = "https://github.com/moonbeam-foundation/evm", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +evm-runtime = { git = "https://github.com/moonbeam-foundation/evm", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +fp-ethereum = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +fp-evm = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +fp-rpc = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +fp-self-contained = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-ethereum = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false, features = [ + "forbid-evm-reentrancy", +] } +pallet-evm = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false, features = [ + "forbid-evm-reentrancy", +] } +pallet-evm-chain-id = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-evm-precompile-dispatch = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-evm-precompile-modexp = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-evm-precompile-sha3fips = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-evm-precompile-simple = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } # Frontier (client) -fc-api = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0"} -fc-consensus = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0"} -fc-db = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0"} -fc-mapping-sync = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0"} -fc-rpc = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0", features = [ - "rpc-binary-search-estimate", -]} -fc-rpc-core = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0"} -fc-storage = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0"} -fp-consensus = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0"} -fp-storage = {git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.3.0"} +fc-consensus = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2" } +fc-db = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2" } +fc-api = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2" } +fc-mapping-sync = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2" } +fc-rpc = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", features = [ + "rpc-binary-search-estimate", +] } +fc-rpc-core = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2" } +fc-storage = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2" } +fp-consensus = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2" } +fp-storage = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2" } # Cumulus (wasm) -cumulus-pallet-dmp-queue = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -cumulus-pallet-parachain-system = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false, features = [ - "parameterized-consensus-hook", -]} -cumulus-pallet-xcm = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -cumulus-pallet-xcmp-queue = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -cumulus-primitives-core = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -cumulus-primitives-parachain-inherent = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -cumulus-primitives-timestamp = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -cumulus-primitives-utility = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -cumulus-test-relay-sproof-builder = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -parachain-info = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} +cumulus-pallet-dmp-queue = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false, features = [ + "parameterized-consensus-hook", +] } +cumulus-pallet-xcm = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +cumulus-primitives-core = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +cumulus-primitives-parachain-inherent = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +cumulus-primitives-timestamp = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +cumulus-test-relay-sproof-builder = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +parachain-info = { package = "staging-parachain-info", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +parachains-common = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } # Cumulus (client) -cumulus-client-cli = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -cumulus-client-collator = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -cumulus-client-consensus-common = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -cumulus-client-consensus-proposer = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -cumulus-client-consensus-relay-chain = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -cumulus-client-network = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -cumulus-client-service = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -cumulus-relay-chain-inprocess-interface = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -cumulus-relay-chain-interface = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -cumulus-relay-chain-minimal-node = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -cumulus-relay-chain-rpc-interface = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} +cumulus-client-cli = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-client-collator = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-client-consensus-common = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-client-consensus-proposer = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-client-consensus-relay-chain = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-client-network = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-client-service = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-client-parachain-inherent = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-relay-chain-inprocess-interface = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-relay-chain-interface = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-relay-chain-minimal-node = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +cumulus-relay-chain-rpc-interface = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } # Polkadot / XCM (wasm) -orml-traits = {git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -orml-xcm-support = {git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -orml-xtokens = {git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-xcm = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-xcm-benchmarks = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -polkadot-core-primitives = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -polkadot-parachain = {package = "polkadot-parachain-primitives", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -polkadot-runtime-common = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -polkadot-runtime-parachains = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -xcm = {package = "staging-xcm", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -xcm-builder = {package = "staging-xcm-builder", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -xcm-executor = {package = "staging-xcm-executor", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0", default-features = false} +orml-traits = { git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +orml-xcm-support = { git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +orml-xtokens = { git = "https://github.com/moonbeam-foundation/open-runtime-module-library", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-xcm = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-xcm-benchmarks = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +polkadot-core-primitives = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +polkadot-runtime-common = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +polkadot-runtime-parachains = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2", default-features = false } # Polkadot / XCM (client) -#kusama-runtime = { package = "staging-kusama-runtime", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0" } -polkadot-cli = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -polkadot-primitives = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -#polkadot-runtime = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0" } -polkadot-service = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -rococo-runtime = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -westend-runtime = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} -xcm-simulator = {git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.3.0"} +#kusama-runtime = { package = "staging-kusama-runtime", git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +polkadot-cli = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +polkadot-primitives = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +#polkadot-runtime = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +polkadot-service = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +rococo-runtime = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +westend-runtime = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } +xcm-simulator = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } # Moonkit (wasm) -async-backing-primitives = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -moonkit-xcm-primitives = {package = "xcm-primitives", git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -nimbus-primitives = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-async-backing = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-author-inherent = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-author-mapping = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-author-slot-filter = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-maintenance-mode = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-migrations = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-randomness = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -pallet-relay-storage-roots = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} -session-keys-primitives = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0", default-features = false} +async-backing-primitives = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +moonkit-xcm-primitives = { package = "xcm-primitives", git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +nimbus-primitives = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-async-backing = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-author-inherent = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-author-mapping = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-author-slot-filter = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-maintenance-mode = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-migrations = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-randomness = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +pallet-relay-storage-roots = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +session-keys-primitives = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2", default-features = false } # Moonkit (client) -nimbus-consensus = {git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.3.0"} +nimbus-consensus = { git = "https://github.com/Moonsong-Labs/moonkit", branch = "moonbeam-polkadot-v1.7.2" } # Other (wasm) affix = "0.1.2" -async-trait = {version = "0.1.42"} -blake2-rfc = {version = "0.2.18", default-features = false} +async-trait = { version = "0.1.42" } +blake2-rfc = { version = "0.2.18", default-features = false } derive_more = "0.99" -environmental = {version = "1.1.2", default-features = false} -frame-metadata = {version = "16.0.0", default-features = false, features = [ - "current", -]} -hex = {version = "0.4.3", default-features = false} -hex-literal = {version = "0.3.4"} -impl-serde = {version = "0.3.1", default-features = false} +environmental = { version = "1.1.2", default-features = false } +frame-metadata = { version = "16.0.0", default-features = false, features = [ + "current", +] } +hex = { version = "0.4.3", default-features = false } +hex-literal = { version = "0.3.4" } +impl-serde = { version = "0.3.1", default-features = false } impl-trait-for-tuples = "0.2.1" -libsecp256k1 = {version = "0.7", default-features = false} -log = {version = "0.4", default-features = false} -num_enum = {version = "0.5.3", default-features = false} +libsecp256k1 = { version = "0.7", default-features = false } +log = { version = "0.4", default-features = false } +num_enum = { version = "0.5.3", default-features = false } paste = "1.0.6" -rlp = {version = "0.5", default-features = false} -rustc-hex = {version = "2.0.1", default-features = false} -serde = {version = "1.0.101", default-features = false} -sha3 = {version = "0.10", default-features = false} +rlp = { version = "0.5", default-features = false } +rustc-hex = { version = "2.0.1", default-features = false } +serde = { version = "1.0.101", default-features = false } +sha3 = { version = "0.10", default-features = false } slices = "0.2.0" smallvec = "1.8.0" -strum = {version = "0.24", default-features = false, features = ["derive"]} +strum = { version = "0.24", default-features = false, features = ["derive"] } strum_macros = "0.24" # Other (client) + ansi_term = "0.12.1" assert_cmd = "2.0.10" async-io = "1.3" -bip32 = {version = "0.5.1", default-features = false, features = ["bip39"]} -clap = {version = "4.0.9", features = ["derive"]} +bip32 = { version = "0.5.1", default-features = false, features = ["bip39"] } +clap = { version = "4.0.9", features = ["derive"] } exit-future = "0.2" flume = "0.10.9" -futures = {version = "0.3.21"} -jsonrpsee = {version = "0.16.2", default-features = false} +futures = { version = "0.3.21" } +jsonrpsee = { version = "0.20.3", default-features = false } maplit = "1.0.2" nix = "0.23" parking_lot = "0.12.0" primitive-types = "0.12.0" -prometheus = {version = "0.13.0", default-features = false} +prometheus = { version = "0.13.0", default-features = false } rand = "0.7.3" -schnorrkel = {version = "0.9.1", default-features = false, features = [ - "preaudit_deprecated", - "u64_backend", -]} -serde_json = {version = "1.0"} +serde_json = { version = "1.0" } similar-asserts = "1.1.0" tempfile = "3.2.0" -tiny-bip39 = {version = "0.8", default-features = false} -tokio = {version = "1.13"} +tiny-bip39 = { version = "0.8", default-features = false } +schnorrkel = { version = "0.11.4", default-features = false, features = [ + "preaudit_deprecated", +] } +tokio = { version = "1.36" } tracing = "0.1.34" tracing-core = "0.1.29" trie-root = "0.15.2" @@ -402,49 +406,49 @@ url = "2.2.2" # # This list is ordered alphabetically. [profile.dev.package] -blake2 = {opt-level = 3} -blake2b_simd = {opt-level = 3} -chacha20poly1305 = {opt-level = 3} -cranelift-codegen = {opt-level = 3} -cranelift-wasm = {opt-level = 3} -crc32fast = {opt-level = 3} -crossbeam-deque = {opt-level = 3} -crypto-mac = {opt-level = 3} -curve25519-dalek = {opt-level = 3} -ed25519-zebra = {opt-level = 3} -flate2 = {opt-level = 3} -futures-channel = {opt-level = 3} -hash-db = {opt-level = 3} -hashbrown = {opt-level = 3} -hmac = {opt-level = 3} -httparse = {opt-level = 3} -integer-sqrt = {opt-level = 3} -k256 = {opt-level = 3} -keccak = {opt-level = 3} -libm = {opt-level = 3} -librocksdb-sys = {opt-level = 3} -libsecp256k1 = {opt-level = 3} -libz-sys = {opt-level = 3} -mio = {opt-level = 3} -nalgebra = {opt-level = 3} -num-bigint = {opt-level = 3} -parking_lot = {opt-level = 3} -parking_lot_core = {opt-level = 3} -percent-encoding = {opt-level = 3} -primitive-types = {opt-level = 3} -ring = {opt-level = 3} -rustls = {opt-level = 3} -secp256k1 = {opt-level = 3} -sha2 = {opt-level = 3} -sha3 = {opt-level = 3} -smallvec = {opt-level = 3} -snow = {opt-level = 3} -twox-hash = {opt-level = 3} -uint = {opt-level = 3} -wasmi = {opt-level = 3} -x25519-dalek = {opt-level = 3} -yamux = {opt-level = 3} -zeroize = {opt-level = 3} +blake2 = { opt-level = 3 } +blake2b_simd = { opt-level = 3 } +chacha20poly1305 = { opt-level = 3 } +cranelift-codegen = { opt-level = 3 } +cranelift-wasm = { opt-level = 3 } +crc32fast = { opt-level = 3 } +crossbeam-deque = { opt-level = 3 } +crypto-mac = { opt-level = 3 } +curve25519-dalek = { opt-level = 3 } +ed25519-zebra = { opt-level = 3 } +flate2 = { opt-level = 3 } +futures-channel = { opt-level = 3 } +hash-db = { opt-level = 3 } +hashbrown = { opt-level = 3 } +hmac = { opt-level = 3 } +httparse = { opt-level = 3 } +integer-sqrt = { opt-level = 3 } +k256 = { opt-level = 3 } +keccak = { opt-level = 3 } +libm = { opt-level = 3 } +librocksdb-sys = { opt-level = 3 } +libsecp256k1 = { opt-level = 3 } +libz-sys = { opt-level = 3 } +mio = { opt-level = 3 } +nalgebra = { opt-level = 3 } +num-bigint = { opt-level = 3 } +parking_lot = { opt-level = 3 } +parking_lot_core = { opt-level = 3 } +percent-encoding = { opt-level = 3 } +primitive-types = { opt-level = 3 } +ring = { opt-level = 3 } +rustls = { opt-level = 3 } +secp256k1 = { opt-level = 3 } +sha2 = { opt-level = 3 } +sha3 = { opt-level = 3 } +smallvec = { opt-level = 3 } +snow = { opt-level = 3 } +twox-hash = { opt-level = 3 } +uint = { opt-level = 3 } +wasmi = { opt-level = 3 } +x25519-dalek = { opt-level = 3 } +yamux = { opt-level = 3 } +zeroize = { opt-level = 3 } # make sure dev builds with backtrace do # not slow us down @@ -459,12 +463,15 @@ lto = true [profile.release] debug-assertions = true # Enable debug-assert! for non-production profiles -opt-level = 3 +opt-level = 3 # Moonbeam runtime requires unwinding. panic = "unwind" [profile.testnet] -debug = 1 # debug symbols are useful for profilers +debug = 1 # debug symbols are useful for profilers debug-assertions = true # Enable debug-assert! for non-production profiles -inherits = "release" +inherits = "release" overflow-checks = true + +[patch."https://github.com/paritytech/polkadot-sdk"] +sp-crypto-ec-utils = { git = "https://github.com/moonbeam-foundation/polkadot-sdk", branch = "moonbeam-polkadot-v1.7.2" } diff --git a/client/rpc-core/txpool/src/types/mod.rs b/client/rpc-core/txpool/src/types/mod.rs index 2a783eaa22..c6d6f7069e 100644 --- a/client/rpc-core/txpool/src/types/mod.rs +++ b/client/rpc-core/txpool/src/types/mod.rs @@ -27,7 +27,7 @@ pub use self::inspect::Summary; pub type TransactionMap = HashMap>; -#[derive(Debug, Serialize)] +#[derive(Debug, Clone, Serialize)] pub struct TxPoolResult { pub pending: T, pub queued: T, diff --git a/client/rpc/debug/src/lib.rs b/client/rpc/debug/src/lib.rs index 6b05126110..b5008fe650 100644 --- a/client/rpc/debug/src/lib.rs +++ b/client/rpc/debug/src/lib.rs @@ -30,12 +30,15 @@ use moonbeam_rpc_core_types::{RequestBlockId, RequestBlockTag}; use moonbeam_rpc_primitives_debug::{DebugRuntimeApi, TracerInput}; use sc_client_api::backend::{Backend, StateBackend, StorageProvider}; use sc_utils::mpsc::TracingUnboundedSender; -use sp_api::{ApiExt, BlockId, Core, HeaderT, ProvideRuntimeApi}; +use sp_api::{ApiExt, Core, ProvideRuntimeApi}; use sp_block_builder::BlockBuilder; use sp_blockchain::{ Backend as BlockchainBackend, Error as BlockChainError, HeaderBackend, HeaderMetadata, }; -use sp_runtime::traits::{BlakeTwo256, Block as BlockT, UniqueSaturatedInto}; +use sp_runtime::{ + generic::BlockId, + traits::{BlakeTwo256, Block as BlockT, Header as HeaderT, UniqueSaturatedInto}, +}; use std::{future::Future, marker::PhantomData, sync::Arc}; pub enum RequesterInput { @@ -359,13 +362,38 @@ where .map_err(|e| internal_err(format!("Fail to read blockchain db: {:?}", e)))? .unwrap_or_default(); + // Get DebugRuntimeApi version + let trace_api_version = if let Ok(Some(api_version)) = + api.api_version::>(parent_block_hash) + { + api_version + } else { + return Err(internal_err( + "Runtime api version call failed (trace)".to_string(), + )); + }; + // Trace the block. let f = || -> RpcResult<_> { - api.initialize_block(parent_block_hash, &header) - .map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))?; + let result = if trace_api_version >= 5 { + // The block is initialized inside "trace_block" + api.trace_block(parent_block_hash, exts, eth_tx_hashes, &header) + } else { + // Pre pallet-message-queue + + // Initialize block: calls the "on_initialize" hook on every pallet + // in AllPalletsWithSystem + // This was fine before pallet-message-queue because the XCM messages + // were processed by the "setValidationData" inherent call and not on an + // "on_initialize" hook, which runs before enabling XCM tracing + api.initialize_block(parent_block_hash, &header) + .map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))?; + + #[allow(deprecated)] + api.trace_block_before_version_5(parent_block_hash, exts, eth_tx_hashes) + }; - let _result = api - .trace_block(parent_block_hash, exts, eth_tx_hashes) + result .map_err(|e| { internal_err(format!( "Blockchain error when replaying block {} : {:?}", @@ -378,6 +406,7 @@ where reference_id, e )) })?; + Ok(moonbeam_rpc_primitives_debug::Response::Block) }; @@ -499,42 +528,58 @@ where let transactions = block.transactions; if let Some(transaction) = transactions.get(index) { let f = || -> RpcResult<_> { - api.initialize_block(parent_block_hash, &header) - .map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))?; - - if trace_api_version >= 4 { - let _result = api - .trace_transaction(parent_block_hash, exts, &transaction) - .map_err(|e| { - internal_err(format!( - "Runtime api access error (version {:?}): {:?}", - trace_api_version, e - )) - })? - .map_err(|e| internal_err(format!("DispatchError: {:?}", e)))?; + let result = if trace_api_version >= 5 { + // The block is initialized inside "trace_transaction" + api.trace_transaction(parent_block_hash, exts, &transaction, &header) } else { - // Pre-london update, legacy transactions. - let _result = match transaction { - ethereum::TransactionV2::Legacy(tx) => - { - #[allow(deprecated)] - api.trace_transaction_before_version_4(parent_block_hash, exts, &tx) - .map_err(|e| { - internal_err(format!( - "Runtime api access error (legacy): {:?}", - e - )) - })? - .map_err(|e| internal_err(format!("DispatchError: {:?}", e)))? - } - _ => { - return Err(internal_err( - "Bug: pre-london runtime expects legacy transactions" - .to_string(), - )) + // Initialize block: calls the "on_initialize" hook on every pallet + // in AllPalletsWithSystem + // This was fine before pallet-message-queue because the XCM messages + // were processed by the "setValidationData" inherent call and not on an + // "on_initialize" hook, which runs before enabling XCM tracing + api.initialize_block(parent_block_hash, &header) + .map_err(|e| { + internal_err(format!("Runtime api access error: {:?}", e)) + })?; + + if trace_api_version == 4 { + // Pre pallet-message-queue + #[allow(deprecated)] + api.trace_transaction_before_version_5( + parent_block_hash, + exts, + &transaction, + ) + } else { + // Pre-london update, legacy transactions. + match transaction { + ethereum::TransactionV2::Legacy(tx) => + { + #[allow(deprecated)] + api.trace_transaction_before_version_4( + parent_block_hash, + exts, + &tx, + ) + } + _ => { + return Err(internal_err( + "Bug: pre-london runtime expects legacy transactions" + .to_string(), + )) + } } - }; - } + } + }; + + result + .map_err(|e| { + internal_err(format!( + "Runtime api access error (version {:?}): {:?}", + trace_api_version, e + )) + })? + .map_err(|e| internal_err(format!("DispatchError: {:?}", e)))?; Ok(moonbeam_rpc_primitives_debug::Response::Single) }; diff --git a/client/rpc/manual-xcm/src/lib.rs b/client/rpc/manual-xcm/src/lib.rs index cd3899b473..6998c912b8 100644 --- a/client/rpc/manual-xcm/src/lib.rs +++ b/client/rpc/manual-xcm/src/lib.rs @@ -15,10 +15,17 @@ // along with Moonbeam. If not, see . use cumulus_primitives_core::ParaId; use cumulus_primitives_core::XcmpMessageFormat; -use jsonrpsee::{core::RpcResult, proc_macros::rpc}; +use jsonrpsee::{ + core::RpcResult, + proc_macros::rpc, + types::{ + error::{INTERNAL_ERROR_CODE, INTERNAL_ERROR_MSG}, + ErrorObjectOwned, + }, +}; use parity_scale_codec::Encode; -use xcm::latest::prelude::*; use xcm::opaque::lts::Weight; +use xcm::v4::prelude::*; use xcm_primitives::DEFAULT_PROOF_SIZE; /// This RPC interface is used to manually submit XCM messages that will be injected into a @@ -59,7 +66,7 @@ impl ManualXcmApiServer for ManualXcm { let downward_message_channel = self.downward_message_channel.clone(); // If no message is supplied, inject a default one. let msg = if msg.is_empty() { - xcm::VersionedXcm::<()>::V3(Xcm(vec![ + xcm::VersionedXcm::<()>::V4(Xcm(vec![ ReserveAssetDeposited((Parent, 10000000000000u128).into()), ClearOrigin, BuyExecution { @@ -68,12 +75,12 @@ impl ManualXcmApiServer for ManualXcm { }, DepositAsset { assets: AllCounted(1).into(), - beneficiary: MultiLocation::new( + beneficiary: Location::new( 0, - X1(AccountKey20 { + [AccountKey20 { network: None, key: hex_literal::hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"), - }), + }], ), }, ])) @@ -99,7 +106,7 @@ impl ManualXcmApiServer for ManualXcm { let msg = if msg.is_empty() { let mut mes = XcmpMessageFormat::ConcatenatedVersionedXcm.encode(); mes.append( - &mut (xcm::VersionedXcm::<()>::V3(Xcm(vec![ + &mut (xcm::VersionedXcm::<()>::V4(Xcm(vec![ ReserveAssetDeposited( ((Parent, Parachain(sender.into())), 10000000000000u128).into(), ), @@ -113,12 +120,12 @@ impl ManualXcmApiServer for ManualXcm { }, DepositAsset { assets: AllCounted(1).into(), - beneficiary: MultiLocation::new( + beneficiary: Location::new( 0, - X1(AccountKey20 { + [AccountKey20 { network: None, key: hex_literal::hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"), - }), + }], ), }, ])) @@ -141,13 +148,10 @@ impl ManualXcmApiServer for ManualXcm { } // This bit cribbed from frontier. -pub fn internal_err>(message: T) -> jsonrpsee::core::Error { - jsonrpsee::core::Error::Call(jsonrpsee::types::error::CallError::Custom( - jsonrpsee::types::error::ErrorObject::borrowed( - jsonrpsee::types::error::INTERNAL_ERROR_CODE, - &message, - None, - ) - .into_owned(), - )) +pub fn internal_err(message: T) -> ErrorObjectOwned { + ErrorObjectOwned::owned( + INTERNAL_ERROR_CODE, + INTERNAL_ERROR_MSG, + Some(message.to_string()), + ) } diff --git a/client/rpc/trace/src/lib.rs b/client/rpc/trace/src/lib.rs index f407dbfa7e..b7ccc00ecd 100644 --- a/client/rpc/trace/src/lib.rs +++ b/client/rpc/trace/src/lib.rs @@ -34,12 +34,12 @@ use tracing::{instrument, Instrument}; use sc_client_api::backend::{Backend, StateBackend, StorageProvider}; use sc_utils::mpsc::TracingUnboundedSender; -use sp_api::{ApiExt, Core, HeaderT, ProvideRuntimeApi}; +use sp_api::{ApiExt, Core, ProvideRuntimeApi}; use sp_block_builder::BlockBuilder; use sp_blockchain::{ Backend as BlockchainBackend, Error as BlockChainError, HeaderBackend, HeaderMetadata, }; -use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT, Header as HeaderT}; use substrate_prometheus_endpoint::{ register, Counter, PrometheusError, Registry as PrometheusRegistry, U64, }; @@ -846,13 +846,40 @@ where })? .ok_or_else(|| format!("Could not find block {} when fetching extrinsics.", height))?; + // Get DebugRuntimeApi version + let trace_api_version = if let Ok(Some(api_version)) = + api.api_version::>(substrate_parent_hash) + { + api_version + } else { + return Err(format!("Runtime api version call failed (trace)")); + }; + // Trace the block. let f = || -> Result<_, String> { - api.initialize_block(substrate_parent_hash, &block_header) - .map_err(|e| format!("Runtime api access error: {:?}", e))?; + let result = if trace_api_version >= 5 { + api.trace_block( + substrate_parent_hash, + extrinsics, + eth_tx_hashes, + &block_header, + ) + } else { + // Pre pallet-message-queue + + // Initialize block: calls the "on_initialize" hook on every pallet + // in AllPalletsWithSystem + // This was fine before pallet-message-queue because the XCM messages + // were processed by the "setValidationData" inherent call and not on an + // "on_initialize" hook, which runs before enabling XCM tracing + api.initialize_block(substrate_parent_hash, &block_header) + .map_err(|e| format!("Runtime api access error: {:?}", e))?; + + #[allow(deprecated)] + api.trace_block_before_version_5(substrate_parent_hash, extrinsics, eth_tx_hashes) + }; - let _result = api - .trace_block(substrate_parent_hash, extrinsics, eth_tx_hashes) + result .map_err(|e| format!("Blockchain error when replaying block {} : {:?}", height, e))? .map_err(|e| { tracing::warn!( @@ -865,6 +892,7 @@ where height, e ) })?; + Ok(moonbeam_rpc_primitives_debug::Response::Block) }; diff --git a/client/vrf/Cargo.toml b/client/vrf/Cargo.toml index ed22600ec5..ec2a2104e8 100644 --- a/client/vrf/Cargo.toml +++ b/client/vrf/Cargo.toml @@ -9,21 +9,23 @@ version = "0.1.0" [dependencies] # Substrate -parity-scale-codec = { workspace = true, features = [ "derive", "std" ] } -sp-api = { workspace = true, features = [ "std" ] } +parity-scale-codec = { workspace = true, features = ["derive", "std"] } +sp-api = { workspace = true, features = ["std"] } sp-application-crypto = { workspace = true } -sp-core = { workspace = true, features = [ "std" ] } +sp-core = { workspace = true, features = ["std"] } sp-keystore = { workspace = true } sp-runtime = { workspace = true } # Moonbeam -session-keys-primitives = { workspace = true, features = [ "std" ] } +session-keys-primitives = { workspace = true, features = ["std"] } # Nimbus -nimbus-primitives = { workspace = true, features = [ "std" ] } +nimbus-primitives = { workspace = true, features = ["std"] } # Polkadot polkadot-primitives = { workspace = true } # Other -schnorrkel = { workspace = true, default-features = false, features = [ "preaudit_deprecated", "u64_backend" ] } +schnorrkel = { workspace = true, default-features = false, features = [ + "preaudit_deprecated", +] } diff --git a/client/vrf/src/lib.rs b/client/vrf/src/lib.rs index aefcbe2c70..9140823805 100644 --- a/client/vrf/src/lib.rs +++ b/client/vrf/src/lib.rs @@ -61,7 +61,7 @@ fn sign_vrf(last_vrf_output: H256, key: VrfId, keystore: &KeystorePtr) -> Option if let Ok(Some(signature)) = try_sign { let public = PublicKey::from_bytes(&key.to_raw_vec()).ok()?; if signature - .output + .pre_output .0 .attach_input_hash(&public, transcript.0.clone()) .is_err() @@ -70,7 +70,7 @@ fn sign_vrf(last_vrf_output: H256, key: VrfId, keystore: &KeystorePtr) -> Option return None; } Some(PreDigest { - vrf_output: signature.output, + vrf_output: signature.pre_output, vrf_proof: signature.proof, }) } else { diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index cd6d10a3ff..82903928e8 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -63,6 +63,10 @@ runtime-benchmarks = [ "moonbeam-service/runtime-benchmarks", "polkadot-service/runtime-benchmarks", ] -try-runtime = ["moonbeam-service/try-runtime", "try-runtime-cli/try-runtime"] +try-runtime = [ + "moonbeam-service/try-runtime", + "try-runtime-cli/try-runtime", + "polkadot-service/try-runtime", +] moonbase-runtime-benchmarks = ["moonbeam-service/moonbase-runtime-benchmarks"] diff --git a/node/cli/src/cli.rs b/node/cli/src/cli.rs index 33f2a1d0be..200b1476b2 100644 --- a/node/cli/src/cli.rs +++ b/node/cli/src/cli.rs @@ -30,7 +30,7 @@ use std::path::PathBuf; pub enum Subcommand { /// Export the genesis state of the parachain. #[clap(name = "export-genesis-state")] - ExportGenesisState(ExportGenesisStateCommand), + ExportGenesisHead(ExportGenesisHeadCommand), /// Export the genesis wasm of the parachain. #[clap(name = "export-genesis-wasm")] @@ -91,7 +91,7 @@ pub struct BuildSpecCommand { /// Command for exporting the genesis state of the parachain #[derive(Debug, Parser)] -pub struct ExportGenesisStateCommand { +pub struct ExportGenesisHeadCommand { /// Output file name or stdout if unspecified. #[clap(value_parser)] pub output: Option, diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 90f514b211..d1cf4395c5 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -17,7 +17,7 @@ //! This module constructs and executes the appropriate service components for the given subcommand use crate::cli::{Cli, RelayChainCli, RunCmd, Subcommand}; -use cumulus_client_cli::{extract_genesis_wasm, generate_genesis_block}; +use cumulus_client_cli::extract_genesis_wasm; use cumulus_primitives_core::ParaId; use frame_benchmarking_cli::BenchmarkCmd; use log::{info, warn}; @@ -35,7 +35,10 @@ use sc_service::{ DatabaseSource, PartialComponents, }; use sp_core::hexdisplay::HexDisplay; -use sp_runtime::traits::{AccountIdConversion, Block as _}; +use sp_runtime::{ + traits::{AccountIdConversion, Block as BlockT, Hash as HashT, Header as HeaderT, Zero}, + StateVersion, +}; use std::{io::Write, net::SocketAddr}; fn load_spec( @@ -352,7 +355,7 @@ pub fn run() -> Result<()> { spec if spec.is_moonriver() => runner.async_run(|mut config| { let params = moonbeam_service::new_partial::< moonbeam_service::moonriver_runtime::RuntimeApi, - moonbeam_service::MoonriverExecutor, + moonbeam_service::MoonriverCustomizations, >(&mut config, &rpc_config, false)?; Ok(( @@ -364,7 +367,7 @@ pub fn run() -> Result<()> { spec if spec.is_moonbeam() => runner.async_run(|mut config| { let params = moonbeam_service::new_partial::< moonbeam_service::moonbeam_runtime::RuntimeApi, - moonbeam_service::MoonbeamExecutor, + moonbeam_service::MoonbeamCustomizations, >(&mut config, &rpc_config, false)?; Ok(( @@ -376,7 +379,7 @@ pub fn run() -> Result<()> { _ => runner.async_run(|mut config| { let params = moonbeam_service::new_partial::< moonbeam_service::moonbase_runtime::RuntimeApi, - moonbeam_service::MoonbaseExecutor, + moonbeam_service::MoonbaseCustomizations, >(&mut config, &rpc_config, false)?; Ok(( @@ -388,7 +391,7 @@ pub fn run() -> Result<()> { _ => panic!("invalid chain spec"), } } - Some(Subcommand::ExportGenesisState(params)) => { + Some(Subcommand::ExportGenesisHead(params)) => { let mut builder = sc_cli::LoggerBuilder::new(""); builder.with_profiling(sc_tracing::TracingReceiver::Log, ""); let _ = builder.init(); @@ -529,7 +532,7 @@ pub fn run() -> Result<()> { return runner.sync_run(|mut config| { let params = moonbeam_service::new_partial::< moonbeam_service::moonriver_runtime::RuntimeApi, - moonbeam_service::MoonriverExecutor, + moonbeam_service::MoonriverCustomizations, >(&mut config, &rpc_config, false)?; cmd.run(params.client) @@ -540,7 +543,7 @@ pub fn run() -> Result<()> { return runner.sync_run(|mut config| { let params = moonbeam_service::new_partial::< moonbeam_service::moonbeam_runtime::RuntimeApi, - moonbeam_service::MoonbeamExecutor, + moonbeam_service::MoonbeamCustomizations, >(&mut config, &rpc_config, false)?; cmd.run(params.client) @@ -551,7 +554,7 @@ pub fn run() -> Result<()> { return runner.sync_run(|mut config| { let params = moonbeam_service::new_partial::< moonbeam_service::moonbase_runtime::RuntimeApi, - moonbeam_service::MoonbaseExecutor, + moonbeam_service::MoonbaseCustomizations, >(&mut config, &rpc_config, false)?; cmd.run(params.client) @@ -576,7 +579,7 @@ pub fn run() -> Result<()> { return runner.sync_run(|mut config| { let params = moonbeam_service::new_partial::< moonbeam_service::moonriver_runtime::RuntimeApi, - moonbeam_service::MoonriverExecutor, + moonbeam_service::MoonriverCustomizations, >(&mut config, &rpc_config, false)?; let db = params.backend.expose_db(); @@ -590,7 +593,7 @@ pub fn run() -> Result<()> { return runner.sync_run(|mut config| { let params = moonbeam_service::new_partial::< moonbeam_service::moonbeam_runtime::RuntimeApi, - moonbeam_service::MoonbeamExecutor, + moonbeam_service::MoonbeamCustomizations, >(&mut config, &rpc_config, false)?; let db = params.backend.expose_db(); @@ -604,7 +607,7 @@ pub fn run() -> Result<()> { return runner.sync_run(|mut config| { let params = moonbeam_service::new_partial::< moonbeam_service::moonbase_runtime::RuntimeApi, - moonbeam_service::MoonbaseExecutor, + moonbeam_service::MoonbaseCustomizations, >(&mut config, &rpc_config, false)?; let db = params.backend.expose_db(); @@ -647,7 +650,7 @@ pub fn run() -> Result<()> { .. } = moonbeam_service::new_partial::< moonbeam_service::moonriver_runtime::RuntimeApi, - moonbeam_service::MoonriverExecutor, + moonbeam_service::MoonriverCustomizations, >(&mut config, &rpc_config, false)?; Ok((cmd.run(backend, config.chain_spec), task_manager)) @@ -660,7 +663,7 @@ pub fn run() -> Result<()> { .. } = moonbeam_service::new_partial::< moonbeam_service::moonbeam_runtime::RuntimeApi, - moonbeam_service::MoonbeamExecutor, + moonbeam_service::MoonbeamCustomizations, >(&mut config, &rpc_config, false)?; Ok((cmd.run(backend, config.chain_spec), task_manager)) @@ -673,7 +676,7 @@ pub fn run() -> Result<()> { .. } = moonbeam_service::new_partial::< moonbeam_service::moonbase_runtime::RuntimeApi, - moonbeam_service::MoonbaseExecutor, + moonbeam_service::MoonbaseCustomizations, >(&mut config, &rpc_config, false)?; Ok((cmd.run(backend, config.chain_spec), task_manager)) @@ -724,21 +727,21 @@ pub fn run() -> Result<()> { #[cfg(feature = "moonriver-native")] spec if spec.is_moonriver() => moonbeam_service::new_dev::< moonbeam_service::moonriver_runtime::RuntimeApi, - moonbeam_service::MoonriverExecutor, + moonbeam_service::MoonriverCustomizations, >(config, author_id, cli.run.sealing, rpc_config, hwbench) .await .map_err(Into::into), #[cfg(feature = "moonbeam-native")] spec if spec.is_moonbeam() => moonbeam_service::new_dev::< moonbeam_service::moonbeam_runtime::RuntimeApi, - moonbeam_service::MoonbeamExecutor, + moonbeam_service::MoonbeamCustomizations, >(config, author_id, cli.run.sealing, rpc_config, hwbench) .await .map_err(Into::into), #[cfg(feature = "moonbase-native")] _ => moonbeam_service::new_dev::< moonbeam_service::moonbase_runtime::RuntimeApi, - moonbeam_service::MoonbaseExecutor, + moonbeam_service::MoonbaseCustomizations, >(config, author_id, cli.run.sealing, rpc_config, hwbench) .await .map_err(Into::into), @@ -784,7 +787,7 @@ pub fn run() -> Result<()> { #[cfg(feature = "moonriver-native")] spec if spec.is_moonriver() => moonbeam_service::start_node::< moonbeam_service::moonriver_runtime::RuntimeApi, - moonbeam_service::MoonriverExecutor, + moonbeam_service::MoonriverCustomizations, >( config, polkadot_config, @@ -800,7 +803,7 @@ pub fn run() -> Result<()> { #[cfg(feature = "moonbeam-native")] spec if spec.is_moonbeam() => moonbeam_service::start_node::< moonbeam_service::moonbeam_runtime::RuntimeApi, - moonbeam_service::MoonbeamExecutor, + moonbeam_service::MoonbeamCustomizations, >( config, polkadot_config, @@ -816,7 +819,7 @@ pub fn run() -> Result<()> { #[cfg(feature = "moonbase-native")] _ => moonbeam_service::start_node::< moonbeam_service::moonbase_runtime::RuntimeApi, - moonbeam_service::MoonbaseExecutor, + moonbeam_service::MoonbaseCustomizations, >( config, polkadot_config, @@ -956,3 +959,39 @@ impl CliConfiguration for RelayChainCli { self.base.base.announce_block() } } + +/// Generate the genesis block from a given ChainSpec. +pub fn generate_genesis_block( + chain_spec: &dyn ChainSpec, + genesis_state_version: StateVersion, +) -> std::result::Result { + let storage = chain_spec.build_storage()?; + + let child_roots = storage.children_default.iter().map(|(sk, child_content)| { + let state_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root( + child_content.data.clone().into_iter().collect(), + genesis_state_version, + ); + (sk.clone(), state_root.encode()) + }); + let state_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root( + storage.top.clone().into_iter().chain(child_roots).collect(), + genesis_state_version, + ); + + let extrinsics_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root( + Vec::new(), + genesis_state_version, + ); + + Ok(Block::new( + <::Header as HeaderT>::new( + Zero::zero(), + extrinsics_root, + state_root, + Default::default(), + Default::default(), + ), + Default::default(), + )) +} diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 916674958b..3fd850ed11 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -128,6 +128,7 @@ cumulus-client-network = { workspace = true } cumulus-client-service = { workspace = true } cumulus-primitives-core = { workspace = true } cumulus-primitives-parachain-inherent = { workspace = true } +cumulus-client-parachain-inherent = { workspace = true } cumulus-relay-chain-inprocess-interface = { workspace = true } cumulus-relay-chain-interface = { workspace = true } cumulus-relay-chain-minimal-node = { workspace = true } @@ -199,7 +200,11 @@ runtime-benchmarks = [ "pallet-ethereum/runtime-benchmarks", ] -try-runtime = ["moonbase-runtime", "moonbase-runtime/try-runtime"] +try-runtime = [ + "moonbase-runtime", + "moonbase-runtime/try-runtime", + "polkadot-service/try-runtime", +] moonbase-runtime-benchmarks = [ "moonbase-native", diff --git a/node/service/src/chain_spec/moonbase.rs b/node/service/src/chain_spec/moonbase.rs index e957ecd54b..4a4e86b537 100644 --- a/node/service/src/chain_spec/moonbase.rs +++ b/node/service/src/chain_spec/moonbase.rs @@ -29,7 +29,7 @@ use moonbase_runtime::{ CrowdloanRewardsConfig, EVMConfig, EligibilityValue, EthereumChainIdConfig, EthereumConfig, GenesisAccount, InflationInfo, MaintenanceModeConfig, MoonbeamOrbitersConfig, OpenTechCommitteeCollectiveConfig, ParachainInfoConfig, ParachainStakingConfig, - PolkadotXcmConfig, Precompiles, Range, RuntimeGenesisConfig, SudoConfig, SystemConfig, + PolkadotXcmConfig, Precompiles, Range, RuntimeGenesisConfig, SudoConfig, TransactionPaymentConfig, TreasuryCouncilCollectiveConfig, XcmTransactorConfig, HOURS, WASM_BINARY, }; @@ -41,7 +41,8 @@ use sp_core::ecdsa; use sp_runtime::{traits::One, Perbill, Percent}; /// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type. -pub type ChainSpec = sc_service::GenericChainSpec; +pub type ChainSpec = + sc_service::GenericChainSpec; /// Generate a chain spec for use with the development service. pub fn development_chain_spec(mnemonic: Option, num_accounts: Option) -> ChainSpec { @@ -61,130 +62,110 @@ pub fn development_chain_spec(mnemonic: Option, num_accounts: Option Alith - vec![( - accounts[0], - get_from_seed::("Alice"), - 1_000 * UNIT, - )], - // Delegations - vec![], - accounts.clone(), - 3_000_000 * UNIT, - Default::default(), // para_id - 1281, //ChainId - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Fork ID - None, - // Properties - Some( - serde_json::from_str( - "{\"tokenDecimals\": 18, \"tokenSymbol\": \"UNIT\", \"SS58Prefix\": 1287}", - ) - .expect("Provided valid json map"), - ), - // Extensions + ChainSpec::builder( + WASM_BINARY.expect("WASM binary was not build, please build it!"), Extensions { relay_chain: "dev-service".into(), para_id: Default::default(), }, ) + .with_name("Moonbase Development Testnet") + .with_id("moonbase_dev") + .with_chain_type(ChainType::Development) + .with_properties( + serde_json::from_str( + "{\"tokenDecimals\": 18, \"tokenSymbol\": \"UNIT\", \"SS58Prefix\": 1287}", + ) + .expect("Provided valid json map"), + ) + .with_genesis_config(testnet_genesis( + // Alith is Sudo + accounts[0], + // Treasury Council members: Baltathar, Charleth and Dorothy + vec![accounts[1], accounts[2], accounts[3]], + // Open Tech committee members: Alith, Baltathar and Charleth + vec![accounts[0], accounts[1], accounts[2]], + // Collator Candidate: Alice -> Alith + vec![( + accounts[0], + get_from_seed::("Alice"), + 1_000 * UNIT, + )], + // Delegations + vec![], + accounts.clone(), + 3_000_000 * UNIT, + Default::default(), // para_id + 1281, //ChainId + )) + .build() } /// Generate a default spec for the parachain service. Use this as a starting point when launching /// a custom chain. pub fn get_chain_spec(para_id: ParaId) -> ChainSpec { - ChainSpec::from_genesis( - // TODO Apps depends on this string to determine whether the chain is an ethereum compat - // or not. We should decide the proper strings, and update Apps accordingly. - // Or maybe Apps can be smart enough to say if the string contains "moonbeam" at all... - "Moonbase Local Testnet", - "moonbase_local", - ChainType::Local, - move || { - testnet_genesis( - // Alith is Sudo - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - // Treasury Council members: Baltathar, Charleth and Dorothy - vec![ - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), - AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), - ], - // Open Tech committee members: Alith and Baltathar - vec![ - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - ], - // Collator Candidates - vec![ - // Alice -> Alith - ( - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - get_from_seed::("Alice"), - 1_000 * UNIT, - ), - // Bob -> Baltathar - ( - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - get_from_seed::("Bob"), - 1_000 * UNIT, - ), - ], - // Delegations - vec![], - // Endowed: Alith, Baltathar, Charleth and Dorothy - vec![ - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), - AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), - ], - 3_000_000 * UNIT, - para_id, - 1280, //ChainId - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Fork ID - None, - // Properties - Some( - serde_json::from_str( - "{\"tokenDecimals\": 18, \"tokenSymbol\": \"UNIT\", \"SS58Prefix\": 1287}", - ) - .expect("Provided valid json map"), - ), - // Extensions + ChainSpec::builder( + WASM_BINARY.expect("WASM binary was not build, please build it!"), Extensions { relay_chain: "westend-local".into(), para_id: para_id.into(), }, ) + // TODO Apps depends on this string to determine whether the chain is an ethereum compat + // or not. We should decide the proper strings, and update Apps accordingly. + // Or maybe Apps can be smart enough to say if the string contains "moonbeam" at all... + .with_name("Moonbase Local Testnet") + .with_id("moonbase_local") + .with_chain_type(ChainType::Local) + .with_properties( + serde_json::from_str( + "{\"tokenDecimals\": 18, \"tokenSymbol\": \"UNIT\", \"SS58Prefix\": 1287}", + ) + .expect("Provided valid json map"), + ) + .with_genesis_config(testnet_genesis( + // Alith is Sudo + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + // Treasury Council members: Baltathar, Charleth and Dorothy + vec![ + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), + AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), + ], + // Open Tech committee members: Alith and Baltathar + vec![ + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + ], + // Collator Candidates + vec![ + // Alice -> Alith + ( + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + get_from_seed::("Alice"), + 1_000 * UNIT, + ), + // Bob -> Baltathar + ( + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + get_from_seed::("Bob"), + 1_000 * UNIT, + ), + ], + // Delegations + vec![], + // Endowed: Alith, Baltathar, Charleth and Dorothy + vec![ + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), + AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), + ], + 3_000_000 * UNIT, + para_id, + 1280, //ChainId + )) + .build() } const COLLATOR_COMMISSION: Perbill = Perbill::from_percent(20); @@ -229,20 +210,15 @@ pub fn testnet_genesis( crowdloan_fund_pot: Balance, para_id: ParaId, chain_id: u64, -) -> RuntimeGenesisConfig { +) -> serde_json::Value { // This is the simplest bytecode to revert without returning any data. // We will pre-deploy it under all of our precompiles to ensure they can be called from // within contracts. // (PUSH1 0x00 PUSH1 0x00 REVERT) let revert_bytecode = vec![0x60, 0x00, 0x60, 0x00, 0xFD]; - RuntimeGenesisConfig { - system: SystemConfig { - code: WASM_BINARY - .expect("WASM binary was not build, please build it!") - .to_vec(), - ..Default::default() - }, + let config = RuntimeGenesisConfig { + system: Default::default(), balances: BalancesConfig { balances: endowed_accounts .iter() @@ -337,7 +313,9 @@ pub fn testnet_genesis( relay_indices: moonbeam_relay_encoder::westend::WESTEND_RELAY_INDICES, ..Default::default() }, - } + }; + + serde_json::to_value(&config).expect("Could not build genesis config.") } #[cfg(test)] diff --git a/node/service/src/chain_spec/moonbeam.rs b/node/service/src/chain_spec/moonbeam.rs index ef89ad49ef..234f861c16 100644 --- a/node/service/src/chain_spec/moonbeam.rs +++ b/node/service/src/chain_spec/moonbeam.rs @@ -30,8 +30,8 @@ use moonbeam_runtime::{ Balance, BalancesConfig, CrowdloanRewardsConfig, EVMConfig, EthereumChainIdConfig, EthereumConfig, GenesisAccount, InflationInfo, MaintenanceModeConfig, OpenTechCommitteeCollectiveConfig, ParachainInfoConfig, ParachainStakingConfig, - PolkadotXcmConfig, Precompiles, Range, RuntimeGenesisConfig, SystemConfig, - TransactionPaymentConfig, TreasuryCouncilCollectiveConfig, HOURS, WASM_BINARY, + PolkadotXcmConfig, Precompiles, Range, RuntimeGenesisConfig, TransactionPaymentConfig, + TreasuryCouncilCollectiveConfig, HOURS, WASM_BINARY, }; use nimbus_primitives::NimbusId; use pallet_transaction_payment::Multiplier; @@ -54,126 +54,107 @@ pub fn development_chain_spec(mnemonic: Option, num_accounts: Option Alith - vec![( - accounts[0], - get_from_seed::("Alice"), - 20_000 * GLMR * SUPPLY_FACTOR, - )], - // Delegations - vec![], - accounts.clone(), - 1_500_000 * GLMR * SUPPLY_FACTOR, - Default::default(), // para_id - 1281, //ChainId - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Fork ID - None, - // Properties - Some( - serde_json::from_str( - "{\"tokenDecimals\": 18, \"tokenSymbol\": \"GLMR\", \"SS58Prefix\": 1284}", - ) - .expect("Provided valid json map"), - ), - // Extensions + + ChainSpec::builder( + WASM_BINARY.expect("WASM binary was not build, please build it!"), Extensions { relay_chain: "dev-service".into(), para_id: Default::default(), }, ) + .with_name("Moonbeam Development Testnet") + .with_id("moonbeam_dev") + .with_chain_type(ChainType::Development) + .with_properties( + serde_json::from_str( + "{\"tokenDecimals\": 18, \"tokenSymbol\": \"GLMR\", \"SS58Prefix\": 1284}", + ) + .expect("Provided valid json map"), + ) + .with_genesis_config(testnet_genesis( + // Treasury Council members: Baltathar, Charleth and Dorothy + vec![accounts[1], accounts[2], accounts[3]], + // Open Tech committee members: Alith and Baltathar + vec![accounts[0], accounts[1]], + // Collator Candidate: Alice -> Alith + vec![( + accounts[0], + get_from_seed::("Alice"), + 20_000 * GLMR * SUPPLY_FACTOR, + )], + // Delegations + vec![], + accounts.clone(), + 1_500_000 * GLMR * SUPPLY_FACTOR, + Default::default(), // para_id + 1281, //ChainId + )) + .build() } /// Generate a default spec for the parachain service. Use this as a starting point when launching /// a custom chain. pub fn get_chain_spec(para_id: ParaId) -> ChainSpec { - ChainSpec::from_genesis( - // TODO Apps depends on this string to determine whether the chain is an ethereum compat - // or not. We should decide the proper strings, and update Apps accordingly. - // Or maybe Apps can be smart enough to say if the string contains "moonbeam" at all... - "Moonbeam Local Testnet", - "moonbeam_local", - ChainType::Local, - move || { - testnet_genesis( - // Treasury Council members: Baltathar, Charleth and Dorothy - vec![ - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), - AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), - ], - // Open Tech committee members: Alith and Baltathar - vec![ - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - ], - // Collator Candidates - vec![ - // Alice -> Alith - ( - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - get_from_seed::("Alice"), - 20_000 * GLMR * SUPPLY_FACTOR, - ), - // Bob -> Baltathar - ( - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - get_from_seed::("Bob"), - 20_000 * GLMR * SUPPLY_FACTOR, - ), - ], - // Delegations - vec![], - // Endowed: Alith, Baltathar, Charleth and Dorothy - vec![ - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), - AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), - ], - 1_500_000 * GLMR * SUPPLY_FACTOR, - para_id, - 1280, //ChainId - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Fork ID - None, - // Properties - Some( - serde_json::from_str( - "{\"tokenDecimals\": 18, \"tokenSymbol\": \"GLMR\", \"SS58Prefix\": 1284}", - ) - .expect("Provided valid json map"), - ), - // Extensions + ChainSpec::builder( + WASM_BINARY.expect("WASM binary was not build, please build it!"), Extensions { relay_chain: "polkadot-local".into(), para_id: para_id.into(), }, ) + // TODO Apps depends on this string to determine whether the chain is an ethereum compat + // or not. We should decide the proper strings, and update Apps accordingly. + // Or maybe Apps can be smart enough to say if the string contains "moonbeam" at all... + .with_name("Moonbeam Local Testnet") + .with_id("moonbeam_local") + .with_chain_type(ChainType::Local) + .with_properties( + serde_json::from_str( + "{\"tokenDecimals\": 18, \"tokenSymbol\": \"GLMR\", \"SS58Prefix\": 1284}", + ) + .expect("Provided valid json map"), + ) + .with_genesis_config(testnet_genesis( + // Treasury Council members: Baltathar, Charleth and Dorothy + vec![ + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), + AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), + ], + // Open Tech committee members: Alith and Baltathar + vec![ + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + ], + // Collator Candidates + vec![ + // Alice -> Alith + ( + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + get_from_seed::("Alice"), + 20_000 * GLMR * SUPPLY_FACTOR, + ), + // Bob -> Baltathar + ( + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + get_from_seed::("Bob"), + 20_000 * GLMR * SUPPLY_FACTOR, + ), + ], + // Delegations + vec![], + // Endowed: Alith, Baltathar, Charleth and Dorothy + vec![ + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), + AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), + ], + 1_500_000 * GLMR * SUPPLY_FACTOR, + para_id, + 1280, //ChainId + )) + .build() } const COLLATOR_COMMISSION: Perbill = Perbill::from_percent(20); @@ -217,20 +198,15 @@ pub fn testnet_genesis( crowdloan_fund_pot: Balance, para_id: ParaId, chain_id: u64, -) -> RuntimeGenesisConfig { +) -> serde_json::Value { // This is the simplest bytecode to revert without returning any data. // We will pre-deploy it under all of our precompiles to ensure they can be called from // within contracts. // (PUSH1 0x00 PUSH1 0x00 REVERT) let revert_bytecode = vec![0x60, 0x00, 0x60, 0x00, 0xFD]; - RuntimeGenesisConfig { - system: SystemConfig { - code: WASM_BINARY - .expect("WASM binary was not build, please build it!") - .to_vec(), - ..Default::default() - }, + let config = RuntimeGenesisConfig { + system: Default::default(), balances: BalancesConfig { balances: endowed_accounts .iter() @@ -315,7 +291,9 @@ pub fn testnet_genesis( multiplier: Multiplier::from(8u128), ..Default::default() }, - } + }; + + serde_json::to_value(&config).expect("Could not build genesis config.") } #[cfg(test)] diff --git a/node/service/src/chain_spec/moonriver.rs b/node/service/src/chain_spec/moonriver.rs index 15b47bc089..e6f4f642ac 100644 --- a/node/service/src/chain_spec/moonriver.rs +++ b/node/service/src/chain_spec/moonriver.rs @@ -30,7 +30,7 @@ use moonriver_runtime::{ CrowdloanRewardsConfig, EVMConfig, EthereumChainIdConfig, EthereumConfig, GenesisAccount, InflationInfo, MaintenanceModeConfig, OpenTechCommitteeCollectiveConfig, ParachainInfoConfig, ParachainStakingConfig, PolkadotXcmConfig, Precompiles, Range, RuntimeGenesisConfig, - SystemConfig, TransactionPaymentConfig, TreasuryCouncilCollectiveConfig, HOURS, WASM_BINARY, + TransactionPaymentConfig, TreasuryCouncilCollectiveConfig, HOURS, WASM_BINARY, }; use nimbus_primitives::NimbusId; use pallet_transaction_payment::Multiplier; @@ -53,126 +53,107 @@ pub fn development_chain_spec(mnemonic: Option, num_accounts: Option Alith - vec![( - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - get_from_seed::("Alice"), - 100_000 * MOVR, - )], - // Delegations - vec![], - accounts.clone(), - 3_000_000 * MOVR, - Default::default(), // para_id - 1281, //ChainId - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Fork ID - None, - // Properties - Some( - serde_json::from_str( - "{\"tokenDecimals\": 18, \"tokenSymbol\": \"MOVR\", \"SS58Prefix\": 1285}", - ) - .expect("Provided valid json map"), - ), - // Extensions + + ChainSpec::builder( + WASM_BINARY.expect("WASM binary was not build, please build it!"), Extensions { relay_chain: "dev-service".into(), para_id: Default::default(), }, ) + .with_name("Moonriver Development Testnet") + .with_id("moonriver_dev") + .with_chain_type(ChainType::Development) + .with_properties( + serde_json::from_str( + "{\"tokenDecimals\": 18, \"tokenSymbol\": \"MOVR\", \"SS58Prefix\": 1285}", + ) + .expect("Provided valid json map"), + ) + .with_genesis_config(testnet_genesis( + // Treasury Council members: Baltathar, Charleth and Dorothy + vec![accounts[1], accounts[2], accounts[3]], + // Open Tech committee members: Alith and Baltathar + vec![accounts[0], accounts[1]], + // Collator Candidate: Alice -> Alith + vec![( + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + get_from_seed::("Alice"), + 100_000 * MOVR, + )], + // Delegations + vec![], + accounts.clone(), + 3_000_000 * MOVR, + Default::default(), // para_id + 1281, //ChainId + )) + .build() } /// Generate a default spec for the parachain service. Use this as a starting point when launching /// a custom chain. pub fn get_chain_spec(para_id: ParaId) -> ChainSpec { - ChainSpec::from_genesis( - // TODO Apps depends on this string to determine whether the chain is an ethereum compat - // or not. We should decide the proper strings, and update Apps accordingly. - // Or maybe Apps can be smart enough to say if the string contains "moonbeam" at all... - "Moonriver Local Testnet", - "moonriver_local", - ChainType::Local, - move || { - testnet_genesis( - // Treasury Council members: Baltathar, Charleth and Dorothy - vec![ - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), - AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), - ], - // Open Tech committee members: Alith and Baltathar - vec![ - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - ], - // Collator Candidates - vec![ - // Alice -> Alith - ( - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - get_from_seed::("Alice"), - 100_000 * MOVR, - ), - // Bob -> Baltathar - ( - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - get_from_seed::("Bob"), - 100_000 * MOVR, - ), - ], - // Delegations - vec![], - // Endowed: Alith, Baltathar, Charleth and Dorothy - vec![ - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), - AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), - ], - 3_000_000 * MOVR, - para_id, - 1280, //ChainId - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Fork ID - None, - // Properties - Some( - serde_json::from_str( - "{\"tokenDecimals\": 18, \"tokenSymbol\": \"MOVR\", \"SS58Prefix\": 1285}", - ) - .expect("Provided valid json map"), - ), - // Extensions + ChainSpec::builder( + WASM_BINARY.expect("WASM binary was not build, please build it!"), Extensions { relay_chain: "kusama-local".into(), para_id: para_id.into(), }, ) + // TODO Apps depends on this string to determine whether the chain is an ethereum compat + // or not. We should decide the proper strings, and update Apps accordingly. + // Or maybe Apps can be smart enough to say if the string contains "moonbeam" at all... + .with_name("Moonriver Local Testnet") + .with_id("moonriver_local") + .with_chain_type(ChainType::Local) + .with_properties( + serde_json::from_str( + "{\"tokenDecimals\": 18, \"tokenSymbol\": \"MOVR\", \"SS58Prefix\": 1285}", + ) + .expect("Provided valid json map"), + ) + .with_genesis_config(testnet_genesis( + // Treasury Council members: Baltathar, Charleth and Dorothy + vec![ + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), + AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), + ], + // Open Tech committee members: Alith and Baltathar + vec![ + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + ], + // Collator Candidates + vec![ + // Alice -> Alith + ( + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + get_from_seed::("Alice"), + 100_000 * MOVR, + ), + // Bob -> Baltathar + ( + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + get_from_seed::("Bob"), + 100_000 * MOVR, + ), + ], + // Delegations + vec![], + // Endowed: Alith, Baltathar, Charleth and Dorothy + vec![ + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), + AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), + ], + 3_000_000 * MOVR, + para_id, + 1280, //ChainId + )) + .build() } const COLLATOR_COMMISSION: Perbill = Perbill::from_percent(20); @@ -216,20 +197,15 @@ pub fn testnet_genesis( crowdloan_fund_pot: Balance, para_id: ParaId, chain_id: u64, -) -> RuntimeGenesisConfig { +) -> serde_json::Value { // This is the simplest bytecode to revert without returning any data. // We will pre-deploy it under all of our precompiles to ensure they can be called from // within contracts. // (PUSH1 0x00 PUSH1 0x00 REVERT) let revert_bytecode = vec![0x60, 0x00, 0x60, 0x00, 0xFD]; - RuntimeGenesisConfig { - system: SystemConfig { - code: WASM_BINARY - .expect("WASM binary was not build, please build it!") - .to_vec(), - ..Default::default() - }, + let config = RuntimeGenesisConfig { + system: Default::default(), balances: BalancesConfig { balances: endowed_accounts .iter() @@ -314,7 +290,9 @@ pub fn testnet_genesis( multiplier: Multiplier::from(10u128), ..Default::default() }, - } + }; + + serde_json::to_value(&config).expect("Could not build genesis config.") } #[cfg(test)] diff --git a/node/service/src/chain_spec/test_spec.rs b/node/service/src/chain_spec/test_spec.rs index 17e65959c8..19bb7c0706 100644 --- a/node/service/src/chain_spec/test_spec.rs +++ b/node/service/src/chain_spec/test_spec.rs @@ -19,79 +19,71 @@ use crate::chain_spec::moonbase::{testnet_genesis, ChainSpec}; use crate::chain_spec::{get_from_seed, Extensions}; use cumulus_primitives_core::ParaId; use hex_literal::hex; -use moonbase_runtime::{currency::UNIT, AccountId}; +use moonbase_runtime::{currency::UNIT, AccountId, WASM_BINARY}; use nimbus_primitives::NimbusId; use sc_service::ChainType; /// Generate testing chain_spec for staking integration tests with accounts initialized for /// collating and nominating. pub fn staking_spec(para_id: ParaId) -> ChainSpec { - ChainSpec::from_genesis( - "Moonbase Development Testnet", - "staking", - ChainType::Local, - move || { - testnet_genesis( - // Root - AccountId::from(hex!("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b")), - // Treasury Council members: Baltathar, Charleth and Dorothy - vec![ - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), - AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), - ], - // Open Tech Committee members: Alith and Baltathar - vec![ - AccountId::from(hex!("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b")), - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - ], - // Collators - vec![ - ( - AccountId::from(hex!("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b")), - get_from_seed::("Alice"), - 1_000 * UNIT, - ), - ( - AccountId::from(hex!("C0F0f4ab324C46e55D02D0033343B4Be8A55532d")), - get_from_seed::("Faith"), - 1_000 * UNIT, - ), - ], - // Delegations - vec![], - // Endowed accounts (each minted 1 << 80 balance) - vec![ - // Alith, Baltathar, Charleth, Dorothy and Faith - AccountId::from(hex!("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b")), - AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), - AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), - AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), - AccountId::from(hex!("C0F0f4ab324C46e55D02D0033343B4Be8A55532d")), - // Additional accounts - AccountId::from(hex!("Ff64d3F6efE2317EE2807d223a0Bdc4c0c49dfDB")), - AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), - ], - 3_000_000 * UNIT, - para_id, - // Chain ID - 1280, - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Fork ID - None, - // Properties - Some(serde_json::from_str("{\"tokenDecimals\": 18}").expect("Provided valid json map")), - // Extensions + ChainSpec::builder( + WASM_BINARY.expect("WASM binary was not build, please build it!"), Extensions { relay_chain: "westend_local".into(), para_id: para_id.into(), }, ) + .with_name("Moonbase Development Testnet") + .with_id("staking") + .with_chain_type(ChainType::Local) + .with_properties( + serde_json::from_str("{\"tokenDecimals\": 18}").expect("Provided valid json map"), + ) + .with_genesis_config(testnet_genesis( + // Root + AccountId::from(hex!("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b")), + // Treasury Council members: Baltathar, Charleth and Dorothy + vec![ + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), + AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), + ], + // Open Tech Committee members: Alith and Baltathar + vec![ + AccountId::from(hex!("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b")), + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + ], + // Collators + vec![ + ( + AccountId::from(hex!("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b")), + get_from_seed::("Alice"), + 1_000 * UNIT, + ), + ( + AccountId::from(hex!("C0F0f4ab324C46e55D02D0033343B4Be8A55532d")), + get_from_seed::("Faith"), + 1_000 * UNIT, + ), + ], + // Delegations + vec![], + // Endowed accounts (each minted 1 << 80 balance) + vec![ + // Alith, Baltathar, Charleth, Dorothy and Faith + AccountId::from(hex!("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b")), + AccountId::from(hex!("3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")), + AccountId::from(hex!("798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")), + AccountId::from(hex!("773539d4Ac0e786233D90A233654ccEE26a613D9")), + AccountId::from(hex!("C0F0f4ab324C46e55D02D0033343B4Be8A55532d")), + // Additional accounts + AccountId::from(hex!("Ff64d3F6efE2317EE2807d223a0Bdc4c0c49dfDB")), + AccountId::from(hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")), + ], + 3_000_000 * UNIT, + para_id, + // Chain ID + 1280, + )) + .build() } diff --git a/node/service/src/client.rs b/node/service/src/client.rs index 9af24eb753..bb6d634c97 100644 --- a/node/service/src/client.rs +++ b/node/service/src/client.rs @@ -15,12 +15,12 @@ // along with Moonbeam. If not, see . pub use moonbeam_core_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Header, Index}; use sc_client_api::{Backend as BackendT, BlockchainEvents, KeysIter, MerkleValue, PairsIter}; -use sp_api::{CallApiAt, NumberFor, ProvideRuntimeApi}; +use sp_api::{CallApiAt, ProvideRuntimeApi}; use sp_blockchain::HeaderBackend; use sp_consensus::BlockStatus; use sp_runtime::{ generic::SignedBlock, - traits::{BlakeTwo256, Block as BlockT}, + traits::{BlakeTwo256, Block as BlockT, NumberFor}, Justifications, }; use sp_storage::{ChildInfo, StorageData, StorageKey}; @@ -84,7 +84,7 @@ pub trait AbstractClient: where Block: BlockT, Backend: BackendT, - Backend::State: sp_api::StateBackend, + Backend::State: sc_client_api::backend::StateBackend, Self::Api: RuntimeApiCollection, { } @@ -93,7 +93,7 @@ impl AbstractClient for Client where Block: BlockT, Backend: BackendT, - Backend::State: sp_api::StateBackend, + Backend::State: sc_client_api::backend::StateBackend, Client: BlockchainEvents + ProvideRuntimeApi + HeaderBackend @@ -126,7 +126,7 @@ pub trait ExecuteWithClient { fn execute_with_client(self, client: Arc) -> Self::Output where Backend: sc_client_api::Backend, - Backend::State: sp_api::StateBackend, + Backend::State: sc_client_api::backend::StateBackend, Api: crate::RuntimeApiCollection, Client: AbstractClient + 'static; } @@ -147,42 +147,30 @@ pub trait ClientHandle { #[derive(Clone)] pub enum Client { #[cfg(feature = "moonbeam-native")] - Moonbeam(Arc>), + Moonbeam(Arc>), #[cfg(feature = "moonriver-native")] - Moonriver(Arc>), + Moonriver(Arc>), #[cfg(feature = "moonbase-native")] - Moonbase(Arc>), + Moonbase(Arc>), } #[cfg(feature = "moonbeam-native")] -impl From>> - for Client -{ - fn from( - client: Arc>, - ) -> Self { +impl From>> for Client { + fn from(client: Arc>) -> Self { Self::Moonbeam(client) } } #[cfg(feature = "moonriver-native")] -impl From>> - for Client -{ - fn from( - client: Arc>, - ) -> Self { +impl From>> for Client { + fn from(client: Arc>) -> Self { Self::Moonriver(client) } } #[cfg(feature = "moonbase-native")] -impl From>> - for Client -{ - fn from( - client: Arc>, - ) -> Self { +impl From>> for Client { + fn from(client: Arc>) -> Self { Self::Moonbase(client) } } diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 2675817e6c..2159bf4228 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -28,15 +28,13 @@ use cumulus_client_cli::CollatorOptions; use cumulus_client_collator::service::CollatorService; use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport; use cumulus_client_consensus_proposer::Proposer; +use cumulus_client_parachain_inherent::{MockValidationDataInherentDataProvider, MockXcmConfig}; use cumulus_client_service::{ prepare_node_config, start_relay_chain_tasks, CollatorSybilResistance, DARecoveryProfile, StartRelayChainTasksParams, }; use cumulus_primitives_core::relay_chain::CollatorPair; use cumulus_primitives_core::ParaId; -use cumulus_primitives_parachain_inherent::{ - MockValidationDataInherentDataProvider, MockXcmConfig, -}; use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface, RelayChainResult}; use cumulus_relay_chain_minimal_node::build_minimal_relay_chain_node_with_rpc; @@ -60,9 +58,7 @@ use sc_client_api::{ ExecutorProvider, }; use sc_consensus::ImportQueue; -use sc_executor::{ - HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY, -}; +use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; use sc_network::{config::FullNetworkConfiguration, NetworkBlock}; use sc_service::config::PrometheusConfig; use sc_service::{ @@ -85,30 +81,23 @@ pub use client::*; pub mod chain_spec; mod client; -type FullClient = - TFullClient>; +type FullClient = TFullClient>; type FullBackend = TFullBackend; type MaybeSelectChain = Option>; -type FrontierBlockImport = TFrontierBlockImport< - Block, - Arc>, - FullClient, ->; -type ParachainBlockImport = - TParachainBlockImport, FullBackend>; -type PartialComponentsResult = Result< +type FrontierBlockImport = + TFrontierBlockImport>, FullClient>; +type ParachainBlockImport = + TParachainBlockImport, FullBackend>; +type PartialComponentsResult = Result< PartialComponents< - FullClient, + FullClient, FullBackend, MaybeSelectChain, sc_consensus::DefaultImportQueue, - sc_transaction_pool::FullPool>, + sc_transaction_pool::FullPool>, ( - BlockImportPipeline< - FrontierBlockImport, - ParachainBlockImport, - >, + BlockImportPipeline, ParachainBlockImport>, Option, Option, Option, @@ -119,8 +108,15 @@ type PartialComponentsResult = Result< ServiceError, >; +#[cfg(feature = "runtime-benchmarks")] pub type HostFunctions = ( frame_benchmarking::benchmarking::HostFunctions, + sp_io::SubstrateHostFunctions, + moonbeam_primitives_ext::moonbeam_ext::HostFunctions, +); +#[cfg(not(feature = "runtime-benchmarks"))] +pub type HostFunctions = ( + sp_io::SubstrateHostFunctions, moonbeam_primitives_ext::moonbeam_ext::HostFunctions, ); @@ -138,7 +134,7 @@ pub enum BlockImportPipeline { /// of network. /// For the moment, this feature is only used to specify the first block compatible with /// ed25519-zebra, but it could be used for other things in the future. -pub trait ExecutorT: sc_executor::NativeExecutionDispatch { +pub trait ClientCustomizations { /// The host function ed25519_verify has changed its behavior in the substrate history, /// because of the change from lib ed25519-dalek to lib ed25519-zebra. /// Some networks may have old blocks that are not compatible with ed25519-zebra, @@ -151,69 +147,27 @@ pub trait ExecutorT: sc_executor::NativeExecutionDispatch { } #[cfg(feature = "moonbeam-native")] -pub struct MoonbeamExecutor; - -#[cfg(feature = "moonbeam-native")] -impl sc_executor::NativeExecutionDispatch for MoonbeamExecutor { - type ExtendHostFunctions = HostFunctions; - - fn dispatch(method: &str, data: &[u8]) -> Option> { - moonbeam_runtime::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - moonbeam_runtime::native_version() - } -} - +pub struct MoonbeamCustomizations; #[cfg(feature = "moonbeam-native")] -impl ExecutorT for MoonbeamExecutor { +impl ClientCustomizations for MoonbeamCustomizations { fn first_block_number_compatible_with_ed25519_zebra() -> Option { Some(2_000_000) } } #[cfg(feature = "moonriver-native")] -pub struct MoonriverExecutor; - +pub struct MoonriverCustomizations; #[cfg(feature = "moonriver-native")] -impl sc_executor::NativeExecutionDispatch for MoonriverExecutor { - type ExtendHostFunctions = HostFunctions; - - fn dispatch(method: &str, data: &[u8]) -> Option> { - moonriver_runtime::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - moonriver_runtime::native_version() - } -} - -#[cfg(feature = "moonriver-native")] -impl ExecutorT for MoonriverExecutor { +impl ClientCustomizations for MoonriverCustomizations { fn first_block_number_compatible_with_ed25519_zebra() -> Option { Some(3_000_000) } } #[cfg(feature = "moonbase-native")] -pub struct MoonbaseExecutor; - +pub struct MoonbaseCustomizations; #[cfg(feature = "moonbase-native")] -impl sc_executor::NativeExecutionDispatch for MoonbaseExecutor { - type ExtendHostFunctions = HostFunctions; - - fn dispatch(method: &str, data: &[u8]) -> Option> { - moonbase_runtime::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - moonbase_runtime::native_version() - } -} - -#[cfg(feature = "moonbase-native")] -impl ExecutorT for MoonbaseExecutor { +impl ClientCustomizations for MoonbaseCustomizations { fn first_block_number_compatible_with_ed25519_zebra() -> Option { Some(3_000_000) } @@ -383,16 +337,15 @@ pub fn new_chain_ops( #[cfg(feature = "moonriver-native")] spec if spec.is_moonriver() => new_chain_ops_inner::< moonriver_runtime::RuntimeApi, - MoonriverExecutor, + MoonriverCustomizations, >(config, rpc_config), #[cfg(feature = "moonbeam-native")] - spec if spec.is_moonbeam() => { - new_chain_ops_inner::( - config, rpc_config, - ) - } + spec if spec.is_moonbeam() => new_chain_ops_inner::< + moonbeam_runtime::RuntimeApi, + MoonbeamCustomizations, + >(config, rpc_config), #[cfg(feature = "moonbase-native")] - _ => new_chain_ops_inner::( + _ => new_chain_ops_inner::( config, rpc_config, ), #[cfg(not(feature = "moonbase-native"))] @@ -401,7 +354,7 @@ pub fn new_chain_ops( } #[allow(clippy::type_complexity)] -fn new_chain_ops_inner( +fn new_chain_ops_inner( config: &mut Configuration, rpc_config: &RpcConfig, ) -> Result< @@ -414,11 +367,10 @@ fn new_chain_ops_inner( ServiceError, > where - Client: From>>, - RuntimeApi: - ConstructRuntimeApi> + Send + Sync + 'static, + Client: From>>, + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, RuntimeApi::RuntimeApi: RuntimeApiCollection, - Executor: ExecutorT + 'static, + Customizations: ClientCustomizations + 'static, { config.keystore = sc_service::config::KeystoreConfig::InMemory; let PartialComponents { @@ -427,7 +379,7 @@ where import_queue, task_manager, .. - } = new_partial::(config, rpc_config, config.chain_spec.is_dev())?; + } = new_partial::(config, rpc_config, config.chain_spec.is_dev())?; Ok(( Arc::new(Client::from(client)), backend, @@ -462,16 +414,15 @@ fn set_prometheus_registry( /// Use this function if you don't actually need the full service, but just the partial in order to /// be able to perform chain operations. #[allow(clippy::type_complexity)] -pub fn new_partial( +pub fn new_partial( config: &mut Configuration, rpc_config: &RpcConfig, dev_service: bool, -) -> PartialComponentsResult +) -> PartialComponentsResult where - RuntimeApi: - ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, RuntimeApi::RuntimeApi: RuntimeApiCollection, - Executor: ExecutorT + 'static, + Customizations: ClientCustomizations + 'static, { set_prometheus_registry(config, rpc_config.no_prometheus_prefix)?; @@ -506,9 +457,7 @@ where wasm_builder = wasm_builder.with_wasmtime_precompiled_path(wasmtime_precompiled_path); } - let wasm_executor = wasm_builder.build(); - - let executor = NativeElseWasmExecutor::::new_with_wasm_executor(wasm_executor); + let executor = wasm_builder.build(); let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( @@ -517,7 +466,7 @@ where executor, )?; - if let Some(block_number) = Executor::first_block_number_compatible_with_ed25519_zebra() { + if let Some(block_number) = Customizations::first_block_number_compatible_with_ed25519_zebra() { client .execution_extensions() .set_extensions_factory(sc_client_api::execution_extensions::ExtensionBeforeBlock::< @@ -575,8 +524,10 @@ where BlockImportPipeline::Dev(frontier_block_import), ) } else { - let parachain_block_import = - ParachainBlockImport::new(frontier_block_import, backend.clone()); + let parachain_block_import = ParachainBlockImport::new_with_delayed_best_block( + frontier_block_import, + backend.clone(), + ); ( nimbus_consensus::import_queue( client.clone(), @@ -640,7 +591,7 @@ async fn build_relay_chain_interface( /// /// This is the actual implementation that is abstract over the executor and the runtime api. #[sc_tracing::logging::prefix_logs_with("🌗")] -async fn start_node_impl( +async fn start_node_impl( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, @@ -648,16 +599,16 @@ async fn start_node_impl( rpc_config: RpcConfig, async_backing: bool, hwbench: Option, -) -> sc_service::error::Result<(TaskManager, Arc>)> +) -> sc_service::error::Result<(TaskManager, Arc>)> where - RuntimeApi: - ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, RuntimeApi::RuntimeApi: RuntimeApiCollection, - Executor: ExecutorT + 'static, + Customizations: ClientCustomizations + 'static, { let mut parachain_config = prepare_node_config(parachain_config); - let params = new_partial(&mut parachain_config, &rpc_config, false)?; + let params = + new_partial::(&mut parachain_config, &rpc_config, false)?; let ( block_import, filter_pool, @@ -916,7 +867,7 @@ where }; if collator { - start_consensus::( + start_consensus::( async_backing, backend.clone(), client.clone(), @@ -978,16 +929,16 @@ where Ok((task_manager, client)) } -fn start_consensus( +fn start_consensus( async_backing: bool, backend: Arc, - client: Arc>, - block_import: ParachainBlockImport, + client: Arc>, + block_import: ParachainBlockImport, prometheus_registry: Option<&Registry>, telemetry: Option, task_manager: &TaskManager, relay_chain_interface: Arc, - transaction_pool: Arc>>, + transaction_pool: Arc>>, keystore: KeystorePtr, para_id: ParaId, collator_key: CollatorPair, @@ -998,11 +949,10 @@ fn start_consensus( sync_oracle: SO, ) -> Result<(), sc_service::Error> where - RuntimeApi: - ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, RuntimeApi::RuntimeApi: RuntimeApiCollection, - sc_client_api::StateBackendFor, Block>: sp_api::StateBackend, - Executor: sc_executor::NativeExecutionDispatch + 'static, + sc_client_api::StateBackendFor, Block>: + sc_client_api::StateBackend, SO: SyncOracle + Send + Sync + Clone + 'static, { let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( @@ -1036,7 +986,7 @@ where let keystore_clone = keystore.clone(); let maybe_provide_vrf_digest = move |nimbus_id: NimbusId, parent: Hash| -> Option { - moonbeam_vrf::vrf_pre_digest::>( + moonbeam_vrf::vrf_pre_digest::>( &client_clone, &keystore_clone, nimbus_id, @@ -1091,6 +1041,7 @@ where relay_client: relay_chain_interface, slot_duration: None, sync_oracle, + reinitialize: false, }), ); } else { @@ -1127,7 +1078,7 @@ where /// Start a normal parachain node. // Rustfmt wants to format the closure with space identation. #[rustfmt::skip] -pub async fn start_node( +pub async fn start_node( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, @@ -1135,15 +1086,15 @@ pub async fn start_node( rpc_config: RpcConfig, async_backing: bool, hwbench: Option, -) -> sc_service::error::Result<(TaskManager, Arc>)> +) -> sc_service::error::Result<(TaskManager, Arc>)> where RuntimeApi: - ConstructRuntimeApi> + Send + Sync + 'static, + ConstructRuntimeApi> + Send + Sync + 'static, RuntimeApi::RuntimeApi: RuntimeApiCollection, - Executor: ExecutorT + 'static, + Customizations: ClientCustomizations + 'static, { - start_node_impl( + start_node_impl::( parachain_config, polkadot_config, collator_options, @@ -1157,7 +1108,7 @@ where /// Builds a new development service. This service uses manual seal, and mocks /// the parachain inherent. -pub async fn new_dev( +pub async fn new_dev( mut config: Configuration, _author_id: Option, sealing: moonbeam_cli_opt::Sealing, @@ -1165,10 +1116,9 @@ pub async fn new_dev( hwbench: Option, ) -> Result where - RuntimeApi: - ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, RuntimeApi::RuntimeApi: RuntimeApiCollection, - Executor: ExecutorT + 'static, + Customizations: ClientCustomizations + 'static, { use async_io::Timer; use futures::Stream; @@ -1191,7 +1141,7 @@ where frontier_backend, fee_history_cache, ), - } = new_partial::(&mut config, &rpc_config, true)?; + } = new_partial::(&mut config, &rpc_config, true)?; let block_import = if let BlockImportPipeline::Dev(block_import) = block_import_pipeline { block_import @@ -1312,7 +1262,7 @@ where let keystore_clone = keystore_container.keystore().clone(); let maybe_provide_vrf_digest = move |nimbus_id: NimbusId, parent: Hash| -> Option { - moonbeam_vrf::vrf_pre_digest::>( + moonbeam_vrf::vrf_pre_digest::>( &client_clone, &keystore_clone, nimbus_id, @@ -1651,7 +1601,7 @@ mod tests { #[test] fn dalek_does_not_panic() { use futures::executor::block_on; - use sc_block_builder::BlockBuilderProvider; + use sc_block_builder::BlockBuilderBuilder; use sc_client_db::{Backend, BlocksPruning, DatabaseSettings, DatabaseSource, PruningMode}; use sp_api::ProvideRuntimeApi; use sp_consensus::BlockOrigin; @@ -1701,12 +1651,17 @@ mod tests { sp_io::UseDalekExt, >::new(1)); - let a1 = client - .new_block_at(client.chain_info().genesis_hash, Default::default(), false) + let a1 = BlockBuilderBuilder::new(&client) + .on_parent_block(client.chain_info().genesis_hash) + .with_parent_block_number(0) + // Enable proof recording if required. This call is optional. + .enable_proof_recording() + .build() .unwrap() .build() .unwrap() .block; + block_on(client.import(BlockOrigin::NetworkInitialSync, a1.clone())).unwrap(); // On block zero it will use dalek @@ -1725,30 +1680,22 @@ mod tests { fn test_config(chain_id: &str) -> Configuration { let network_config = NetworkConfiguration::new("", "", Default::default(), None); let runtime = tokio::runtime::Runtime::new().expect("failed creating tokio runtime"); - let spec = ChainSpec::from_genesis( - "test", - chain_id, - ChainType::Local, - move || { - testnet_genesis( - AccountId::from_str("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b").unwrap(), - vec![], - vec![], - vec![], - vec![], - vec![], - 1000 * UNIT, - ParaId::new(0), - 0, - ) - }, - vec![], - None, - None, - None, - None, - Extensions::default(), - ); + let spec = ChainSpec::builder(&[0u8], Extensions::default()) + .with_name("test") + .with_id(chain_id) + .with_chain_type(ChainType::Local) + .with_genesis_config(testnet_genesis( + AccountId::from_str("6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b").unwrap(), + vec![], + vec![], + vec![], + vec![], + vec![], + 1000 * UNIT, + ParaId::new(0), + 0, + )) + .build(); Configuration { impl_name: String::from("test-impl"), @@ -1780,6 +1727,7 @@ mod tests { rpc_max_subs_per_conn: Default::default(), rpc_addr: None, rpc_port: Default::default(), + rpc_message_buffer_capacity: Default::default(), data_path: Default::default(), prometheus_config: None, telemetry_endpoints: None, @@ -1800,34 +1748,29 @@ mod tests { } } -struct PendingConsensusDataProvider +struct PendingConsensusDataProvider where RuntimeApi: Send + Sync, - Executor: ExecutorT + 'static, { - client: Arc>, + client: Arc>, keystore: Arc, } -impl PendingConsensusDataProvider +impl PendingConsensusDataProvider where - RuntimeApi: - ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, RuntimeApi::RuntimeApi: RuntimeApiCollection, - Executor: ExecutorT + 'static, { - pub fn new(client: Arc>, keystore: Arc) -> Self { + pub fn new(client: Arc>, keystore: Arc) -> Self { Self { client, keystore } } } -impl fc_rpc::pending::ConsensusDataProvider - for PendingConsensusDataProvider +impl fc_rpc::pending::ConsensusDataProvider + for PendingConsensusDataProvider where - RuntimeApi: - ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, RuntimeApi::RuntimeApi: RuntimeApiCollection, - Executor: ExecutorT + 'static, { fn create_digest( &self, diff --git a/node/service/src/rpc.rs b/node/service/src/rpc.rs index d83175663d..d7c771f134 100644 --- a/node/service/src/rpc.rs +++ b/node/service/src/rpc.rs @@ -52,12 +52,12 @@ use sc_rpc_api::DenyUnsafe; use sc_service::TaskManager; use sc_transaction_pool::{ChainApi, Pool}; use sc_transaction_pool_api::TransactionPool; -use sp_api::{CallApiAt, HeaderT, ProvideRuntimeApi}; +use sp_api::{CallApiAt, ProvideRuntimeApi}; use sp_blockchain::{ Backend as BlockchainBackend, Error as BlockChainError, HeaderBackend, HeaderMetadata, }; use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT, Header as HeaderT}; use std::collections::BTreeMap; pub struct MoonbeamEGA; diff --git a/pallets/asset-manager/src/benchmarks.rs b/pallets/asset-manager/src/benchmarks.rs index 3cee04b8ca..c3ca585faf 100644 --- a/pallets/asset-manager/src/benchmarks.rs +++ b/pallets/asset-manager/src/benchmarks.rs @@ -20,7 +20,7 @@ use crate::{pallet::LocalAssetIdCreator, Call, Config, DepositBalanceOf, Pallet} use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite}; use frame_support::traits::{Currency, Get}; use frame_system::RawOrigin; -use xcm::latest::prelude::*; +use xcm::v3::prelude::*; ///RLocal asset deposit amount fn min_candidate_stk() -> DepositBalanceOf { @@ -45,7 +45,7 @@ fn create_funded_user( benchmarks! { // This where clause allows us to create ForeignAssetTypes - where_clause { where T::ForeignAssetType: From } + where_clause { where T::ForeignAssetType: From } register_foreign_asset { // does not really matter what we register let asset_type = T::ForeignAssetType::default(); @@ -62,7 +62,7 @@ benchmarks! { // We make it dependent on the number of existing assets already let x in 5..100; for i in 0..x { - let asset_type: T::ForeignAssetType = MultiLocation::new( + let asset_type: T::ForeignAssetType = Location::new( 0, X1(GeneralIndex(i as u128)) ).into(); @@ -101,7 +101,7 @@ benchmarks! { // We make it dependent on the number of existing assets already let x in 5..100; for i in 0..x { - let asset_type: T::ForeignAssetType = MultiLocation::new(0, X1(GeneralIndex(i as u128))).into(); + let asset_type: T::ForeignAssetType = Location::new(0, X1(GeneralIndex(i as u128))).into(); let metadata = T::AssetRegistrarMetadata::default(); let amount = 1u32.into(); Pallet::::register_foreign_asset( @@ -115,7 +115,7 @@ benchmarks! { } let new_asset_type = T::ForeignAssetType::default(); - let asset_type_to_be_changed: T::ForeignAssetType = MultiLocation::new( + let asset_type_to_be_changed: T::ForeignAssetType = Location::new( 0, X1(GeneralIndex((x-1) as u128)) ).into(); @@ -131,7 +131,7 @@ benchmarks! { // We make it dependent on the number of existing assets already let x in 5..100; for i in 0..x { - let asset_type: T::ForeignAssetType = MultiLocation::new(0, X1(GeneralIndex(i as u128))).into(); + let asset_type: T::ForeignAssetType = Location::new(0, X1(GeneralIndex(i as u128))).into(); let metadata = T::AssetRegistrarMetadata::default(); let amount = 1u32.into(); Pallet::::register_foreign_asset( @@ -143,7 +143,7 @@ benchmarks! { )?; Pallet::::set_asset_units_per_second(RawOrigin::Root.into(), asset_type.clone(), 1, i)?; } - let asset_type_to_be_removed: T::ForeignAssetType = MultiLocation::new( + let asset_type_to_be_removed: T::ForeignAssetType = Location::new( 0, X1(GeneralIndex((x-1) as u128)) ).into(); @@ -179,7 +179,7 @@ benchmarks! { // Worst case is we need to remove it from SupportedAAssetsFeePayment too let x in 5..100; for i in 0..x { - let asset_type: T::ForeignAssetType = MultiLocation::new(0, X1(GeneralIndex(i as u128))).into(); + let asset_type: T::ForeignAssetType = Location::new(0, X1(GeneralIndex(i as u128))).into(); let metadata = T::AssetRegistrarMetadata::default(); let amount = 1u32.into(); Pallet::::register_foreign_asset( @@ -192,7 +192,7 @@ benchmarks! { Pallet::::set_asset_units_per_second(RawOrigin::Root.into(), asset_type.clone(), 1, i)?; } - let asset_type_to_be_removed: T::ForeignAssetType = MultiLocation::new( + let asset_type_to_be_removed: T::ForeignAssetType = Location::new( 0, X1(GeneralIndex((x-1) as u128)) ).into(); diff --git a/pallets/asset-manager/src/mock.rs b/pallets/asset-manager/src/mock.rs index e3c18cf59d..c324c480ad 100644 --- a/pallets/asset-manager/src/mock.rs +++ b/pallets/asset-manager/src/mock.rs @@ -25,7 +25,7 @@ use sp_core::{RuntimeDebug, H256}; use sp_runtime::traits::Hash as THash; use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; use sp_runtime::{BuildStorage, DispatchError}; -use xcm::latest::prelude::*; +use xcm::v3::prelude::*; type Block = frame_system::mocking::MockBlock; @@ -50,6 +50,7 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -86,7 +87,6 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -107,7 +107,7 @@ parameter_types! { pub type AssetId = u128; #[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, TypeInfo)] pub enum MockAssetType { - Xcm(MultiLocation), + Xcm(Location), MockAsset(AssetId), } @@ -131,14 +131,14 @@ impl From for AssetId { } } -impl From for MockAssetType { - fn from(location: MultiLocation) -> Self { +impl From for MockAssetType { + fn from(location: Location) -> Self { Self::Xcm(location) } } -impl Into> for MockAssetType { - fn into(self) -> Option { +impl Into> for MockAssetType { + fn into(self) -> Option { match self { Self::Xcm(location) => Some(location), _ => None, diff --git a/pallets/erc20-xcm-bridge/src/erc20_matcher.rs b/pallets/erc20-xcm-bridge/src/erc20_matcher.rs index 799eabd600..1dc7e20c86 100644 --- a/pallets/erc20-xcm-bridge/src/erc20_matcher.rs +++ b/pallets/erc20-xcm-bridge/src/erc20_matcher.rs @@ -18,19 +18,19 @@ use sp_core::{Get, H160, U256}; use xcm::latest::prelude::*; -use xcm::latest::{Junction, MultiLocation}; +use xcm::latest::{Junction, Location}; use xcm_executor::traits::{Error as MatchError, MatchesFungibles}; pub(crate) struct Erc20Matcher( core::marker::PhantomData, ); -impl> MatchesFungibles +impl> MatchesFungibles for Erc20Matcher { - fn matches_fungibles(multiasset: &MultiAsset) -> Result<(H160, U256), MatchError> { + fn matches_fungibles(multiasset: &Asset) -> Result<(H160, U256), MatchError> { let (amount, id) = match (&multiasset.fun, &multiasset.id) { - (Fungible(ref amount), Concrete(ref id)) => (amount, id), + (Fungible(ref amount), AssetId(ref id)) => (amount, id), _ => return Err(MatchError::AssetNotHandled), }; let contract_address = Self::matches_erc20_multilocation(id) @@ -41,14 +41,14 @@ impl> MatchesFungibles } } -impl> Erc20Matcher { - pub(crate) fn is_erc20_asset(multiasset: &MultiAsset) -> bool { +impl> Erc20Matcher { + pub(crate) fn is_erc20_asset(multiasset: &Asset) -> bool { match (&multiasset.fun, &multiasset.id) { - (Fungible(_), Concrete(ref id)) => Self::matches_erc20_multilocation(id).is_ok(), + (Fungible(_), AssetId(ref id)) => Self::matches_erc20_multilocation(id).is_ok(), _ => false, } } - fn matches_erc20_multilocation(multilocation: &MultiLocation) -> Result { + fn matches_erc20_multilocation(multilocation: &Location) -> Result { let prefix = Erc20MultilocationPrefix::get(); if prefix.parent_count() != multilocation.parent_count() || prefix @@ -84,29 +84,28 @@ mod tests { } frame_support::parameter_types! { - pub const Erc20MultilocationPrefix: MultiLocation = MultiLocation { + pub Erc20MultilocationPrefix: Location = Location { parents:0, - interior: Junctions::X1( - PalletInstance(42u8) - ) + interior: [PalletInstance(42u8)].into() }; } #[test] fn should_match_valid_erc20_location() { - let location = MultiLocation { + let location = Location { parents: 0, - interior: Junctions::X2( + interior: [ PalletInstance(42u8), AccountKey20 { key: [0; 20], network: None, }, - ), + ] + .into(), }; assert_ok!( - Erc20Matcher::::matches_fungibles(&MultiAsset::from(( + Erc20Matcher::::matches_fungibles(&Asset::from(( location, 100u128 ))), (H160([0; 20]), U256([100, 0, 0, 0])) @@ -115,19 +114,20 @@ mod tests { #[test] fn should_match_valid_erc20_location_with_amount_greater_than_u64() { - let location = MultiLocation { + let location = Location { parents: 0, - interior: Junctions::X2( + interior: [ PalletInstance(42u8), AccountKey20 { key: [0; 20], network: None, }, - ), + ] + .into(), }; assert_ok!( - Erc20Matcher::::matches_fungibles(&MultiAsset::from(( + Erc20Matcher::::matches_fungibles(&Asset::from(( location, 100000000000000000u128 ))), @@ -137,13 +137,13 @@ mod tests { #[test] fn should_not_match_invalid_erc20_location() { - let invalid_location = MultiLocation { + let invalid_location = Location { parents: 0, - interior: Junctions::X2(PalletInstance(42u8), GeneralIndex(0)), + interior: [PalletInstance(42u8), GeneralIndex(0)].into(), }; assert!( - Erc20Matcher::::matches_fungibles(&MultiAsset::from(( + Erc20Matcher::::matches_fungibles(&Asset::from(( invalid_location, 100u128 ))) diff --git a/pallets/erc20-xcm-bridge/src/erc20_trap.rs b/pallets/erc20-xcm-bridge/src/erc20_trap.rs index 93359ec459..cde38b0583 100644 --- a/pallets/erc20-xcm-bridge/src/erc20_trap.rs +++ b/pallets/erc20-xcm-bridge/src/erc20_trap.rs @@ -24,8 +24,8 @@ pub struct AssetTrapWrapper(core::marker::PhantomData<(AssetTrap, // Morph a given `DropAssets` implementation into one which filter out erc20 assets. impl DropAssets for AssetTrapWrapper { fn drop_assets( - origin: &xcm::latest::MultiLocation, - mut assets: xcm_executor::Assets, + origin: &xcm::latest::Location, + mut assets: xcm_executor::AssetsInHolding, context: &XcmContext, ) -> xcm::latest::Weight { // Remove all erc20 assets @@ -36,8 +36,8 @@ impl DropAssets for AssetTrapWrapper; - type Erc20MultilocationPrefix: Get; + type Erc20MultilocationPrefix: Get; type Erc20TransferGasLimit: Get; type EvmRunner: Runner; } impl Pallet { - pub fn is_erc20_asset(asset: &MultiAsset) -> bool { + pub fn is_erc20_asset(asset: &Asset) -> bool { Erc20Matcher::::is_erc20_asset(asset) } pub fn gas_limit_of_erc20_transfer(asset_id: &AssetId) -> u64 { - if let AssetId::Concrete(multilocation) = asset_id { - if let Some(Junction::GeneralKey { - length: _, - ref data, - }) = multilocation.interior().into_iter().next_back() - { - // As GeneralKey definition might change in future versions of XCM, this is meant - // to throw a compile error as a warning that data type has changed. - // If that happens, a new check is needed to ensure that data has at least 18 - // bytes (size of b"gas_limit:" + u64) - let data: &[u8; 32] = &data; - if let Ok(content) = core::str::from_utf8(&data[0..10]) { - if content == "gas_limit:" { - let mut bytes: [u8; 8] = Default::default(); - bytes.copy_from_slice(&data[10..18]); - return u64::from_le_bytes(bytes); - } + let location = &asset_id.0; + if let Some(Junction::GeneralKey { + length: _, + ref data, + }) = location.interior().into_iter().next_back() + { + // As GeneralKey definition might change in future versions of XCM, this is meant + // to throw a compile error as a warning that data type has changed. + // If that happens, a new check is needed to ensure that data has at least 18 + // bytes (size of b"gas_limit:" + u64) + let data: &[u8; 32] = &data; + if let Ok(content) = core::str::from_utf8(&data[0..10]) { + if content == "gas_limit:" { + let mut bytes: [u8; 8] = Default::default(); + bytes.copy_from_slice(&data[10..18]); + return u64::from_le_bytes(bytes); } } - }; + } T::Erc20TransferGasLimit::get() } pub fn weight_of_erc20_transfer(asset_id: &AssetId) -> Weight { @@ -159,11 +157,7 @@ pub mod pallet { // For optimization reasons, the asset we want to deposit has not really been withdrawn, // we have just traced from which account it should have been withdrawn. // So we will retrieve these information and make the transfer from the origin account. - fn deposit_asset( - what: &MultiAsset, - who: &MultiLocation, - _context: Option<&XcmContext>, - ) -> XcmResult { + fn deposit_asset(what: &Asset, who: &Location, _context: Option<&XcmContext>) -> XcmResult { let (contract_address, amount) = Erc20Matcher::::matches_fungibles(what)?; @@ -206,11 +200,11 @@ pub mod pallet { } fn internal_transfer_asset( - asset: &MultiAsset, - from: &MultiLocation, - to: &MultiLocation, + asset: &Asset, + from: &Location, + to: &Location, _context: &XcmContext, - ) -> Result { + ) -> Result { let (contract_address, amount) = Erc20Matcher::::matches_fungibles(asset)?; @@ -239,10 +233,10 @@ pub mod pallet { // In order to perform only one evm call, we just trace the origin of the asset, // and then the transfer will only really be performed in the deposit instruction. fn withdraw_asset( - what: &MultiAsset, - who: &MultiLocation, + what: &Asset, + who: &Location, _context: Option<&XcmContext>, - ) -> Result { + ) -> Result { let (contract_address, amount) = Erc20Matcher::::matches_fungibles(what)?; let who = T::AccountIdConverter::convert_location(who) diff --git a/pallets/erc20-xcm-bridge/src/mock.rs b/pallets/erc20-xcm-bridge/src/mock.rs index 2d3089680c..7175eca3a2 100644 --- a/pallets/erc20-xcm-bridge/src/mock.rs +++ b/pallets/erc20-xcm-bridge/src/mock.rs @@ -47,6 +47,7 @@ impl frame_system::Config for Test { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -84,7 +85,6 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/pallets/erc20-xcm-bridge/src/xcm_holding_ext.rs b/pallets/erc20-xcm-bridge/src/xcm_holding_ext.rs index 4611e3db8c..eee75baf98 100644 --- a/pallets/erc20-xcm-bridge/src/xcm_holding_ext.rs +++ b/pallets/erc20-xcm-bridge/src/xcm_holding_ext.rs @@ -20,6 +20,7 @@ use core::marker::PhantomData; use sp_core::{H160, U256}; use sp_std::collections::btree_map::BTreeMap; use sp_std::vec::Vec; +use xcm_executor::traits::XcmAssetTransfers; environmental::environmental!(XCM_HOLDING_ERC20_ORIGINS: XcmHoldingErc20sOrigins); @@ -95,24 +96,23 @@ impl XcmHoldingErc20sOrigins { } /// Xcm executor wrapper that inject xcm holding extension "XcmHoldingErc20sOrigins" -pub struct XcmExecutorWrapper( - PhantomData<(RuntimeCall, InnerXcmExecutor)>, -); -impl xcm::latest::ExecuteXcm - for XcmExecutorWrapper +pub struct XcmExecutorWrapper(PhantomData<(Config, InnerXcmExecutor)>); +impl xcm::latest::ExecuteXcm + for XcmExecutorWrapper where - InnerXcmExecutor: xcm::latest::ExecuteXcm, + Config: xcm_executor::Config, + InnerXcmExecutor: xcm::latest::ExecuteXcm, { type Prepared = InnerXcmExecutor::Prepared; fn prepare( - message: xcm::latest::Xcm, - ) -> Result> { + message: xcm::latest::Xcm, + ) -> Result> { InnerXcmExecutor::prepare(message) } fn execute( - origin: impl Into, + origin: impl Into, pre: Self::Prepared, hash: &mut xcm::latest::XcmHash, weight_credit: xcm::latest::Weight, @@ -124,13 +124,22 @@ where } fn charge_fees( - location: impl Into, - fees: xcm::latest::MultiAssets, + location: impl Into, + fees: xcm::latest::Assets, ) -> Result<(), xcm::latest::Error> { InnerXcmExecutor::charge_fees(location, fees) } } +impl XcmAssetTransfers for XcmExecutorWrapper +where + Config: xcm_executor::Config, +{ + type IsReserve = Config::IsReserve; + type IsTeleporter = Config::IsTeleporter; + type AssetTransactor = Config::AssetTransactor; +} + #[cfg(test)] mod tests { use super::*; diff --git a/pallets/ethereum-xcm/src/mock.rs b/pallets/ethereum-xcm/src/mock.rs index d82c90de0b..1c029f702e 100644 --- a/pallets/ethereum-xcm/src/mock.rs +++ b/pallets/ethereum-xcm/src/mock.rs @@ -68,6 +68,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -107,7 +108,6 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/pallets/moonbeam-lazy-migrations/src/mock.rs b/pallets/moonbeam-lazy-migrations/src/mock.rs index 65630ab6c6..988ee0ba04 100644 --- a/pallets/moonbeam-lazy-migrations/src/mock.rs +++ b/pallets/moonbeam-lazy-migrations/src/mock.rs @@ -58,6 +58,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -95,7 +96,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/pallets/moonbeam-orbiters/src/mock.rs b/pallets/moonbeam-orbiters/src/mock.rs index 9a633a2e36..57e071d81c 100644 --- a/pallets/moonbeam-orbiters/src/mock.rs +++ b/pallets/moonbeam-orbiters/src/mock.rs @@ -58,6 +58,7 @@ impl frame_system::Config for Test { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -98,7 +99,6 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/pallets/moonbeam-xcm-benchmarks/src/generic/benchmarking.rs b/pallets/moonbeam-xcm-benchmarks/src/generic/benchmarking.rs index 486dfd18a3..a16d6b6a1d 100644 --- a/pallets/moonbeam-xcm-benchmarks/src/generic/benchmarking.rs +++ b/pallets/moonbeam-xcm-benchmarks/src/generic/benchmarking.rs @@ -30,7 +30,7 @@ benchmarks! { let mut executor = new_executor::(Default::default()); executor.set_holding(holding); - let fee_asset = Concrete(MultiLocation::parent()); + let fee_asset = AssetId(Location::parent()); let instruction = Instruction::>::BuyExecution { fees: (fee_asset, 100_000_000u128).into(), // should be something inside of holding diff --git a/pallets/moonbeam-xcm-benchmarks/src/generic/mock.rs b/pallets/moonbeam-xcm-benchmarks/src/generic/mock.rs index e4c70c7584..800a0676b6 100644 --- a/pallets/moonbeam-xcm-benchmarks/src/generic/mock.rs +++ b/pallets/moonbeam-xcm-benchmarks/src/generic/mock.rs @@ -50,7 +50,7 @@ frame_support::construct_runtime!( parameter_types! { pub const BlockHashCount: u64 = 250; - pub UniversalLocation: InteriorMultiLocation = Here; + pub UniversalLocation: InteriorLocation = Here; } impl frame_system::Config for Test { @@ -59,6 +59,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -91,7 +92,6 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -99,19 +99,15 @@ impl pallet_balances::Config for Test { /// 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, - _: Option<&XcmContext>, - ) -> Result<(), XcmError> { + fn deposit_asset(_: &Asset, _: &Location, _: Option<&XcmContext>) -> Result<(), XcmError> { unreachable!(); } fn withdraw_asset( - _: &MultiAsset, - _: &MultiLocation, + _: &Asset, + _: &Location, _: Option<&XcmContext>, - ) -> Result { + ) -> Result { unreachable!(); } } @@ -148,14 +144,16 @@ impl xcm_executor::Config for XcmConfig { type CallDispatcher = RuntimeCall; type SafeCallFilter = Everything; type Aliasers = (); + + type TransactionalProcessor = (); } impl pallet_xcm_benchmarks::Config for Test { type XcmConfig = XcmConfig; type AccountIdConverter = AccountIdConverter; type DeliveryHelper = (); - fn valid_destination() -> Result { - let valid_destination: MultiLocation = Junction::AccountId32 { + fn valid_destination() -> Result { + let valid_destination: Location = Junction::AccountId32 { network: None, id: [0u8; 32], } @@ -163,7 +161,7 @@ impl pallet_xcm_benchmarks::Config for Test { Ok(valid_destination) } - fn worst_case_holding(_depositable_count: u32) -> MultiAssets { + fn worst_case_holding(_depositable_count: u32) -> Assets { crate::mock::mock_worst_case_holding() } } @@ -173,48 +171,52 @@ impl pallet_xcm_benchmarks::generic::Config for Test { type TransactAsset = Balances; fn worst_case_response() -> (u64, Response) { - let assets: MultiAssets = (Concrete(Here.into()), 100).into(); + let assets: Assets = (AssetId(Here.into()), 100).into(); (0, Response::Assets(assets)) } - fn worst_case_asset_exchange() -> Result<(MultiAssets, MultiAssets), BenchmarkError> { + fn worst_case_asset_exchange() -> Result<(Assets, Assets), BenchmarkError> { + Err(BenchmarkError::Skip) + } + + fn universal_alias() -> Result<(Location, Junction), BenchmarkError> { Err(BenchmarkError::Skip) } - fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> { + fn fee_asset() -> Result { Err(BenchmarkError::Skip) } fn export_message_origin_and_destination( - ) -> Result<(MultiLocation, NetworkId, Junctions), BenchmarkError> { + ) -> Result<(Location, NetworkId, Junctions), BenchmarkError> { Err(BenchmarkError::Skip) } - fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> { + fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { Ok(( Default::default(), frame_system::Call::remark_with_event { remark: vec![] }.into(), )) } - fn subscribe_origin() -> Result { + 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 { + fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> { + let assets: Assets = (AssetId(Here.into()), 100).into(); + let ticket = Location { parents: 0, - interior: X1(GeneralIndex(0)), + interior: [GeneralIndex(0)].into(), }; Ok((Default::default(), ticket, assets)) } - fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> { + fn unlockable_asset() -> Result<(Location, Location, Asset), BenchmarkError> { Err(BenchmarkError::Skip) } - fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> { + fn alias_origin() -> Result<(Location, Location), BenchmarkError> { Ok((Default::default(), Default::default())) } } @@ -237,10 +239,7 @@ where Origin: OriginTrait, ::AccountId: Decode, { - fn convert_origin( - _origin: impl Into, - _kind: OriginKind, - ) -> Result { + fn convert_origin(_origin: impl Into, _kind: OriginKind) -> Result { Ok(Origin::signed( ::AccountId::decode(&mut TrailingZeroInput::zeroes()) .expect("infinite length input; no invalid inputs for type; qed"), diff --git a/pallets/moonbeam-xcm-benchmarks/src/mock.rs b/pallets/moonbeam-xcm-benchmarks/src/mock.rs index f1e3e2aa4c..9a75c0f64d 100644 --- a/pallets/moonbeam-xcm-benchmarks/src/mock.rs +++ b/pallets/moonbeam-xcm-benchmarks/src/mock.rs @@ -24,10 +24,10 @@ impl SendXcm for DevNull { type Ticket = (); fn validate( - _destination: &mut Option, + _destination: &mut Option, _message: &mut Option, ) -> SendResult { - Ok(((), MultiAssets::new())) + Ok(((), Assets::new())) } fn deliver(_: Self::Ticket) -> Result { @@ -36,13 +36,13 @@ impl SendXcm for DevNull { } impl xcm_executor::traits::OnResponse for DevNull { - fn expecting_response(_: &MultiLocation, _: u64, _: Option<&MultiLocation>) -> bool { + fn expecting_response(_: &Location, _: u64, _: Option<&Location>) -> bool { false } fn on_response( - _: &MultiLocation, + _: &Location, _: u64, - _: Option<&MultiLocation>, + _: Option<&Location>, _: Response, _: Weight, _: &XcmContext, @@ -53,34 +53,33 @@ impl xcm_executor::traits::OnResponse for DevNull { pub struct AccountIdConverter; impl 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()), + fn convert_location(ml: &Location) -> Option { + match ml.unpack() { + (0, [Junction::AccountId32 { id, .. }]) => { + Some(::decode(&mut &*id.to_vec()).unwrap()) + } _ => None, } } } parameter_types! { - pub Ancestry: MultiLocation = Junction::Parachain(101).into(); + pub Ancestry: Location = Junction::Parachain(101).into(); pub UnitWeightCost: u64 = 10; - pub WeightPrice: (AssetId, u128, u128) = (Concrete(MultiLocation::parent()), 1_000_000, 1024); + pub WeightPrice: (AssetId, u128, u128) = (AssetId(Location::parent()), 1_000_000, 1024); } pub struct AllAssetLocationsPass; -impl ContainsPair for AllAssetLocationsPass { - fn contains(_: &MultiAsset, _: &MultiLocation) -> bool { +impl ContainsPair for AllAssetLocationsPass { + fn contains(_: &Asset, _: &Location) -> bool { true } } #[cfg(feature = "runtime-benchmarks")] -pub fn mock_worst_case_holding() -> MultiAssets { - let assets: Vec = vec![MultiAsset { - id: Concrete(MultiLocation::parent()), +pub fn mock_worst_case_holding() -> Assets { + let assets: Vec = vec![Asset { + id: AssetId(Location::parent()), fun: Fungible(u128::MAX), }]; assets.into() diff --git a/pallets/moonbeam-xcm-benchmarks/src/weights/fungible.rs b/pallets/moonbeam-xcm-benchmarks/src/weights/fungible.rs index 9ceb1f6c9e..7147dd2bd1 100644 --- a/pallets/moonbeam-xcm-benchmarks/src/weights/fungible.rs +++ b/pallets/moonbeam-xcm-benchmarks/src/weights/fungible.rs @@ -20,7 +20,7 @@ use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; -use xcm::latest::MultiAsset; +use xcm::latest::Asset; // Values copied from statemint benchmarks const ASSET_BURN_MAX_PROOF_SIZE: u64 = 7242; @@ -30,7 +30,7 @@ const ASSET_TRANSFER_MAX_PROOF_SIZE: u64 = 13412; /// Weights for `pallet_xcm_benchmarks::fungible`. pub struct WeightInfo(PhantomData); impl WeightInfo { - pub(crate) fn withdraw_asset(asset: &MultiAsset) -> Weight { + pub(crate) fn withdraw_asset(asset: &Asset) -> Weight { if pallet_erc20_xcm_bridge::Pallet::::is_erc20_asset(asset) { pallet_erc20_xcm_bridge::Pallet::::weight_of_erc20_transfer(&asset.id) @@ -38,14 +38,14 @@ impl WeightInfo { Weight::from_parts(200_000_000 as u64, ASSET_BURN_MAX_PROOF_SIZE) } } - pub(crate) fn transfer_asset(asset: &MultiAsset) -> Weight { + pub(crate) fn transfer_asset(asset: &Asset) -> Weight { if pallet_erc20_xcm_bridge::Pallet::::is_erc20_asset(asset) { pallet_erc20_xcm_bridge::Pallet::::weight_of_erc20_transfer(&asset.id) } else { Weight::from_parts(200_000_000 as u64, ASSET_TRANSFER_MAX_PROOF_SIZE) } } - pub(crate) fn transfer_reserve_asset(asset: &MultiAsset) -> Weight { + pub(crate) fn transfer_reserve_asset(asset: &Asset) -> Weight { if pallet_erc20_xcm_bridge::Pallet::::is_erc20_asset(asset) { pallet_erc20_xcm_bridge::Pallet::::weight_of_erc20_transfer(&asset.id) } else { diff --git a/pallets/moonbeam-xcm-benchmarks/src/weights/mod.rs b/pallets/moonbeam-xcm-benchmarks/src/weights/mod.rs index be27df8b83..42aec6af23 100644 --- a/pallets/moonbeam-xcm-benchmarks/src/weights/mod.rs +++ b/pallets/moonbeam-xcm-benchmarks/src/weights/mod.rs @@ -37,7 +37,7 @@ trait WeighMultiAssetsFilter { fn weigh_multi_assets_filter(&self, weight: Weight) -> XCMWeight; } -impl WeighMultiAssetsFilter for MultiAssetFilter { +impl WeighMultiAssetsFilter for AssetFilter { fn weigh_multi_assets_filter(&self, weight: Weight) -> XCMWeight { match self { Self::Definite(assets) => { @@ -51,7 +51,7 @@ impl WeighMultiAssetsFilter for MultiAssetFilter { } } -impl WeighMultiAssets for MultiAssets { +impl WeighMultiAssets for Assets { fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { weight.saturating_mul(self.inner().into_iter().count() as u64) } @@ -62,36 +62,32 @@ impl XcmWeightInfo for XcmWeight where Runtime: frame_system::Config + pallet_erc20_xcm_bridge::Config, { - fn withdraw_asset(assets: &MultiAssets) -> XCMWeight { + fn withdraw_asset(assets: &Assets) -> XCMWeight { assets.inner().iter().fold(Weight::zero(), |acc, asset| { acc.saturating_add(XcmFungibleWeight::::withdraw_asset(&asset)) }) } // Currently there is no trusted reserve - fn reserve_asset_deposited(_assets: &MultiAssets) -> XCMWeight { + fn reserve_asset_deposited(_assets: &Assets) -> XCMWeight { XcmFungibleWeight::::reserve_asset_deposited() } - fn receive_teleported_asset(assets: &MultiAssets) -> XCMWeight { + fn receive_teleported_asset(assets: &Assets) -> XCMWeight { assets.weigh_multi_assets(XcmFungibleWeight::::receive_teleported_asset()) } fn query_response( _query_id: &u64, _response: &Response, _max_weight: &Weight, - _querier: &Option, + _querier: &Option, ) -> XCMWeight { XcmGeneric::::query_response() } - fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> XCMWeight { + fn transfer_asset(assets: &Assets, _dest: &Location) -> XCMWeight { assets.inner().iter().fold(Weight::zero(), |acc, asset| { acc.saturating_add(XcmFungibleWeight::::transfer_asset(&asset)) }) } - fn transfer_reserve_asset( - assets: &MultiAssets, - _dest: &MultiLocation, - _xcm: &Xcm<()>, - ) -> XCMWeight { + fn transfer_reserve_asset(assets: &Assets, _dest: &Location, _xcm: &Xcm<()>) -> XCMWeight { assets.inner().iter().fold(Weight::zero(), |acc, asset| { acc.saturating_add(XcmFungibleWeight::::transfer_reserve_asset(&asset)) }) @@ -122,32 +118,24 @@ where fn clear_origin() -> XCMWeight { XcmGeneric::::clear_origin() } - fn descend_origin(_who: &InteriorMultiLocation) -> XCMWeight { + fn descend_origin(_who: &InteriorLocation) -> XCMWeight { XcmGeneric::::descend_origin() } fn report_error(_query_response_info: &QueryResponseInfo) -> XCMWeight { XcmGeneric::::report_error() } - fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> XCMWeight { + fn deposit_asset(assets: &AssetFilter, _dest: &Location) -> XCMWeight { assets.weigh_multi_assets_filter(XcmFungibleWeight::::deposit_asset()) } - fn deposit_reserve_asset( - assets: &MultiAssetFilter, - _dest: &MultiLocation, - _xcm: &Xcm<()>, - ) -> XCMWeight { + fn deposit_reserve_asset(assets: &AssetFilter, _dest: &Location, _xcm: &Xcm<()>) -> XCMWeight { assets.weigh_multi_assets_filter(XcmFungibleWeight::::deposit_reserve_asset()) } - fn exchange_asset( - _give: &MultiAssetFilter, - _receive: &MultiAssets, - _maximal: &bool, - ) -> XCMWeight { + fn exchange_asset(_give: &AssetFilter, _receive: &Assets, _maximal: &bool) -> XCMWeight { Weight::MAX } fn initiate_reserve_withdraw( - _assets: &MultiAssetFilter, - _reserve: &MultiLocation, + _assets: &AssetFilter, + _reserve: &Location, _xcm: &Xcm<()>, ) -> XCMWeight { // This is not correct. initiate reserve withdraw does not to that many db reads @@ -155,17 +143,13 @@ where //assets.weigh_multi_assets(XcmGeneric::::initiate_reserve_withdraw()) XcmGeneric::::initiate_reserve_withdraw() } - fn initiate_teleport( - _assets: &MultiAssetFilter, - _dest: &MultiLocation, - _xcm: &Xcm<()>, - ) -> XCMWeight { + fn initiate_teleport(_assets: &AssetFilter, _dest: &Location, _xcm: &Xcm<()>) -> XCMWeight { XcmFungibleWeight::::initiate_teleport() } - fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> Weight { + fn report_holding(_response_info: &QueryResponseInfo, _assets: &AssetFilter) -> Weight { XcmGeneric::::report_holding() } - fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> XCMWeight { + fn buy_execution(_fees: &Asset, _weight_limit: &WeightLimit) -> XCMWeight { XcmGeneric::::buy_execution() } fn refund_surplus() -> XCMWeight { @@ -180,7 +164,7 @@ where fn clear_error() -> XCMWeight { XcmGeneric::::clear_error() } - fn claim_asset(_assets: &MultiAssets, _ticket: &MultiLocation) -> XCMWeight { + fn claim_asset(_assets: &Assets, _ticket: &Location) -> XCMWeight { XcmGeneric::::claim_asset() } fn trap(_code: &u64) -> XCMWeight { @@ -192,13 +176,13 @@ where fn unsubscribe_version() -> XCMWeight { XcmGeneric::::unsubscribe_version() } - fn burn_asset(assets: &MultiAssets) -> Weight { + fn burn_asset(assets: &Assets) -> Weight { assets.weigh_multi_assets(XcmGeneric::::burn_asset()) } - fn expect_asset(assets: &MultiAssets) -> Weight { + fn expect_asset(assets: &Assets) -> Weight { assets.weigh_multi_assets(XcmGeneric::::expect_asset()) } - fn expect_origin(_origin: &Option) -> Weight { + fn expect_origin(_origin: &Option) -> Weight { XcmGeneric::::expect_origin() } fn expect_error(_error: &Option<(u32, XcmError)>) -> Weight { @@ -231,16 +215,16 @@ where fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight { Weight::MAX } - fn lock_asset(_: &MultiAsset, _: &MultiLocation) -> Weight { + fn lock_asset(_: &Asset, _: &Location) -> Weight { Weight::MAX } - fn unlock_asset(_: &MultiAsset, _: &MultiLocation) -> Weight { + fn unlock_asset(_: &Asset, _: &Location) -> Weight { Weight::MAX } - fn note_unlockable(_: &MultiAsset, _: &MultiLocation) -> Weight { + fn note_unlockable(_: &Asset, _: &Location) -> Weight { Weight::MAX } - fn request_unlock(_: &MultiAsset, _: &MultiLocation) -> Weight { + fn request_unlock(_: &Asset, _: &Location) -> Weight { Weight::MAX } fn set_fees_mode(_: &bool) -> Weight { @@ -252,11 +236,11 @@ where fn clear_topic() -> Weight { XcmGeneric::::clear_topic() } - fn alias_origin(_: &MultiLocation) -> Weight { + fn alias_origin(_: &Location) -> Weight { // XCM Executor does not currently support alias origin operations Weight::MAX } - fn unpaid_execution(_: &WeightLimit, _: &Option) -> Weight { + fn unpaid_execution(_: &WeightLimit, _: &Option) -> Weight { XcmGeneric::::unpaid_execution() } } diff --git a/pallets/parachain-staking/src/lib.rs b/pallets/parachain-staking/src/lib.rs index acadf403a1..30169489fe 100644 --- a/pallets/parachain-staking/src/lib.rs +++ b/pallets/parachain-staking/src/lib.rs @@ -460,7 +460,7 @@ pub mod pallet { let mut weight = ::WeightInfo::base_on_initialize(); let mut round = >::get(); - if round.should_update(n.into()) { + if round.should_update(n) { // fetch current slot number let current_slot: u64 = T::SlotProvider::get().into(); @@ -472,7 +472,7 @@ pub mod pallet { .saturating_mul(T::SlotDuration::get()); // mutate round - round.update(n.into(), current_slot); + round.update(n, current_slot); // notify that new round begin weight = weight.saturating_add(T::OnNewRound::on_new_round(round.current)); // pay all stakers for T::RewardPaymentDelay rounds ago diff --git a/pallets/parachain-staking/src/migrations.rs b/pallets/parachain-staking/src/migrations.rs index 3971d6e87a..fb3e89e587 100644 --- a/pallets/parachain-staking/src/migrations.rs +++ b/pallets/parachain-staking/src/migrations.rs @@ -171,7 +171,7 @@ where #[cfg(feature = "try-runtime")] fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { - let round = crate::Round::::get(); // Should panic if SCALE decode fail + let _round = crate::Round::::get(); // Should panic if SCALE decode fail Ok(()) } } diff --git a/pallets/parachain-staking/src/mock.rs b/pallets/parachain-staking/src/mock.rs index 8e2f1baaa3..79c6acb8b9 100644 --- a/pallets/parachain-staking/src/mock.rs +++ b/pallets/parachain-staking/src/mock.rs @@ -64,6 +64,7 @@ impl frame_system::Config for Test { type BaseCallFilter = Everything; type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -100,7 +101,6 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/pallets/precompile-benchmarks/Cargo.toml b/pallets/precompile-benchmarks/Cargo.toml index 9686467581..8d0ccd908a 100644 --- a/pallets/precompile-benchmarks/Cargo.toml +++ b/pallets/precompile-benchmarks/Cargo.toml @@ -12,7 +12,7 @@ storage-proof-primitives = { workspace = true } cumulus-primitives-core = { workspace = true } frame-support = { workspace = true } frame-system = { workspace = true } -parity-scale-codec = { workspace = true, features = [ "derive" ] } +parity-scale-codec = { workspace = true, features = ["derive"] } scale-info = { workspace = true } sp-core = { workspace = true } sp-std = { workspace = true } @@ -24,7 +24,7 @@ pallet-relay-storage-roots = { workspace = true } frame-benchmarking = { workspace = true, optional = true } [features] -default = [ "std" ] +default = ["std"] std = [ "cumulus-primitives-core/std", "frame-benchmarking/std", @@ -42,3 +42,4 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/proxy-genesis-companion/src/mock.rs b/pallets/proxy-genesis-companion/src/mock.rs index 61237c8019..09c04b6881 100644 --- a/pallets/proxy-genesis-companion/src/mock.rs +++ b/pallets/proxy-genesis-companion/src/mock.rs @@ -57,6 +57,7 @@ impl frame_system::Config for Test { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -94,7 +95,6 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/pallets/xcm-transactor/src/benchmarks.rs b/pallets/xcm-transactor/src/benchmarks.rs index eaa5f2c01b..8d0febe19b 100644 --- a/pallets/xcm-transactor/src/benchmarks.rs +++ b/pallets/xcm-transactor/src/benchmarks.rs @@ -25,7 +25,7 @@ use sp_std::vec; use xcm::latest::prelude::*; benchmarks! { - where_clause { where T::Transactor: Default, T::CurrencyId: From} + where_clause { where T::Transactor: Default, T::CurrencyId: From} register { let user: T::AccountId = account("account id", 0u32, 0u32); @@ -48,10 +48,10 @@ benchmarks! { let extra_weight: Weight = Weight::from_parts(300000000u64, 0); let fee_per_second = 1; let max_weight: Weight = Weight::from_parts(20000000000u64, 0); - let location = MultiLocation::parent(); + let location = Location::parent(); }: _( RawOrigin::Root, - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), extra_weight, max_weight, None @@ -67,25 +67,25 @@ benchmarks! { remove_transact_info { let extra_weight: Weight = Weight::from_parts(300000000u64, 0); let max_weight: Weight = Weight::from_parts(20000000000u64, u64::MAX); - let location = MultiLocation::parent(); + let location = Location::parent(); Pallet::::set_transact_info( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), extra_weight, max_weight, None ).expect("must succeed"); - }: _(RawOrigin::Root, Box::new(xcm::VersionedMultiLocation::V3(location.clone()))) + }: _(RawOrigin::Root, Box::new(xcm::VersionedLocation::V4(location.clone()))) verify { assert!(Pallet::::transact_info(&location).is_none()); } set_fee_per_second { let fee_per_second = 1; - let location = MultiLocation::parent(); + let location = Location::parent(); }: _( RawOrigin::Root, - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), fee_per_second ) verify { @@ -98,21 +98,21 @@ benchmarks! { let fee_per_second = 1; let extra_weight: Weight = Weight::from_parts(300000000u64, 0); let max_weight: Weight = Weight::from_parts(20000000000u64, u64::MAX); - let location = MultiLocation::parent(); + let location = Location::parent(); let call = vec![1u8]; let dest_weight: Weight = Weight::from_parts(100u64, 0); let currency: T::CurrencyId = location.clone().into(); let user: T::AccountId = account("account id", 0u32, 0u32); Pallet::::set_transact_info( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), extra_weight, max_weight, Some(extra_weight) ).expect("must succeed"); Pallet::::set_fee_per_second( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), fee_per_second ).expect("must succeed"); Pallet::::register( @@ -155,28 +155,28 @@ benchmarks! { let fee_per_second = 1; let extra_weight: Weight = Weight::from_parts(300000000u64, 0); let max_weight: Weight = Weight::from_parts(20000000000u64, u64::MAX); - let location = MultiLocation::parent(); + let location = Location::parent(); let currency: T::CurrencyId = location.clone().into(); let call = vec![1u8]; let dest_weight: Weight = Weight::from_parts(100u64, 0); let user: T::AccountId = account("account id", 0u32, 0u32); Pallet::::set_transact_info( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), extra_weight, max_weight, Some(extra_weight) ).expect("must succeed"); Pallet::::set_fee_per_second( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), fee_per_second ).expect("must succeed"); }: { let result = Pallet::::transact_through_sovereign( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), user.clone(), CurrencyPayment { // This might involve a db Read when translating, therefore worst case @@ -208,26 +208,26 @@ benchmarks! { let fee_per_second = 1; let extra_weight: Weight = Weight::from_parts(300000000u64, 0); let max_weight: Weight = Weight::from_parts(20000000000u64, u64::MAX); - let location = MultiLocation::parent(); + let location = Location::parent(); let currency: T::CurrencyId = location.clone().into(); let call = vec![1u8]; let dest_weight: Weight = Weight::from_parts(100u64, 0); let user: T::AccountId = account("account id", 0u32, 0u32); Pallet::::set_transact_info( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), extra_weight, max_weight, Some(extra_weight) ).expect("must succeed"); Pallet::::set_fee_per_second( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), fee_per_second ).expect("must succeed"); }: _( RawOrigin::Signed(user.clone()), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), CurrencyPayment { // This might involve a db Read when translating, therefore worst case currency: Currency::AsCurrencyId(currency), @@ -247,21 +247,21 @@ benchmarks! { let fee_per_second = 1; let extra_weight: Weight = Weight::from_parts(300000000u64, 0); let max_weight: Weight = Weight::from_parts(20000000000u64, u64::MAX); - let location = MultiLocation::parent(); + let location = Location::parent(); let currency: T::CurrencyId = location.clone().into(); let call = vec![1u8]; let dest_weight: Weight = Weight::from_parts(100u64, 0); let user: T::AccountId = account("account id", 0u32, 0u32); Pallet::::set_transact_info( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), extra_weight, max_weight, Some(extra_weight) ).expect("must succeed"); Pallet::::set_fee_per_second( RawOrigin::Root.into(), - Box::new(xcm::VersionedMultiLocation::V3(location.clone())), + Box::new(xcm::VersionedLocation::V4(location.clone())), fee_per_second ).expect("must succeed"); }: _( diff --git a/pallets/xcm-transactor/src/lib.rs b/pallets/xcm-transactor/src/lib.rs index a96e7793e2..f17d10c16c 100644 --- a/pallets/xcm-transactor/src/lib.rs +++ b/pallets/xcm-transactor/src/lib.rs @@ -103,7 +103,7 @@ pub mod pallet { use sp_std::convert::TryFrom; use sp_std::prelude::*; use sp_std::vec::Vec; - use xcm::{latest::prelude::*, VersionedMultiLocation}; + use xcm::{latest::prelude::*, VersionedLocation}; use xcm_executor::traits::{TransactAsset, WeightBounds}; use xcm_primitives::{ FilterMaxAssetFee, HrmpAvailableCalls, HrmpEncodeCall, UtilityAvailableCalls, @@ -129,8 +129,8 @@ pub mod pallet { /// Currency Id. type CurrencyId: Parameter + Member + Clone; - /// Convert `T::CurrencyId` to `MultiLocation`. - type CurrencyIdToMultiLocation: Convert>; + /// Convert `T::CurrencyId` to `Location`. + type CurrencyIdToLocation: Convert>; // XcmTransact needs to be implemented. This type needs to implement // utility call encoding and multilocation gathering @@ -146,18 +146,18 @@ pub mod pallet { // The origin that is allowed to register derivative address indices type HrmpManipulatorOrigin: EnsureOrigin; - /// Convert `T::AccountId` to `MultiLocation`. - type AccountIdToMultiLocation: Convert; + /// Convert `T::AccountId` to `Location`. + type AccountIdToLocation: Convert; /// Means of measuring the weight consumed by an XCM message locally. type Weigher: WeightBounds; /// This chain's Universal Location. - type UniversalLocation: Get; + type UniversalLocation: Get; /// Self chain location. #[pallet::constant] - type SelfLocation: Get; + type SelfLocation: Get; // The origin that is allowed to dispatch calls from the sovereign account directly type SovereignAccountDispatcherOrigin: EnsureOrigin; @@ -172,7 +172,7 @@ pub mod pallet { #[pallet::constant] type BaseXcmWeight: Get; - /// The way to retrieve the reserve of a MultiAsset. This can be + /// The way to retrieve the reserve of a Asset. This can be /// configured to accept absolute or relative paths for self tokens type ReserveProvider: Reserve; @@ -217,12 +217,12 @@ pub mod pallet { // Express the Currency as a CurrencyId AsCurrencyId(CurrencyId), // Express the Currency as its MultiLOcation - AsMultiLocation(Box), + AsMultiLocation(Box), } impl Default for Currency { fn default() -> Currency { - Currency::::AsMultiLocation(Box::new(MultiLocation::default().into())) + Currency::::AsMultiLocation(Box::new(Location::default().into())) } } @@ -262,7 +262,7 @@ pub mod pallet { /// Struct that defines how to express the payment in a particular currency /// currency is defined by the Currency enum, which can be expressed as: /// - CurrencyId - /// - MultiLocation + /// - Location /// /// The fee_amount is an option. In case of None, the fee will be tried to /// be calculated from storage. If the storage item for the currency is not @@ -302,20 +302,19 @@ pub mod pallet { #[pallet::getter(fn index_to_account)] pub type IndexToAccount = StorageMap<_, Blake2_128Concat, u16, T::AccountId>; - /// Stores the transact info of a MultiLocation. This defines how much extra weight we need to + /// Stores the transact info of a Location. This defines how much extra weight we need to /// add when we want to transact in the destination chain and maximum amount of weight allowed /// by the destination chain #[pallet::storage] #[pallet::getter(fn transact_info)] pub type TransactInfoWithWeightLimit = - StorageMap<_, Blake2_128Concat, MultiLocation, RemoteTransactInfoWithMaxWeight>; + StorageMap<_, Blake2_128Concat, Location, RemoteTransactInfoWithMaxWeight>; /// Stores the fee per second for an asset in its reserve chain. This allows us to convert /// from weight to fee #[pallet::storage] #[pallet::getter(fn dest_asset_fee_per_second)] - pub type DestinationAssetFeePerSecond = - StorageMap<_, Twox64Concat, MultiLocation, u128>; + pub type DestinationAssetFeePerSecond = StorageMap<_, Twox64Concat, Location, u128>; /// Stores the indices of relay chain pallets #[pallet::storage] @@ -360,20 +359,20 @@ pub mod pallet { /// Transacted the inner call through a derivative account in a destination chain. TransactedDerivative { account_id: T::AccountId, - dest: MultiLocation, + dest: Location, call: Vec, index: u16, }, /// Transacted the call through the sovereign account in a destination chain. TransactedSovereign { fee_payer: T::AccountId, - dest: MultiLocation, + dest: Location, call: Vec, }, /// Transacted the call through a signed account in a destination chain. TransactedSigned { fee_payer: T::AccountId, - dest: MultiLocation, + dest: Location, call: Vec, }, /// Registered a derivative index for an account id. @@ -390,21 +389,21 @@ pub mod pallet { }, /// Changed the transact info of a location TransactInfoChanged { - location: MultiLocation, + location: Location, remote_info: RemoteTransactInfoWithMaxWeight, }, /// Removed the transact info of a location TransactInfoRemoved { - location: MultiLocation, + location: Location, }, /// Set dest fee per second DestFeePerSecondChanged { - location: MultiLocation, + location: Location, fee_per_second: u128, }, /// Remove dest fee per second DestFeePerSecondRemoved { - location: MultiLocation, + location: Location, }, /// HRMP manage action succesfully sent HrmpManagementSent { @@ -597,7 +596,7 @@ pub mod pallet { pub fn transact_through_sovereign( origin: OriginFor, // destination to which the message should be sent - dest: Box, + dest: Box, // account paying for fees fee_payer: T::AccountId, // fee to be used @@ -616,7 +615,7 @@ pub mod pallet { let fee_location = Self::currency_to_multilocation(fee.currency) .ok_or(Error::::NotCrossChainTransferableCurrency)?; - let dest = MultiLocation::try_from(*dest).map_err(|()| Error::::BadVersion)?; + let dest = Location::try_from(*dest).map_err(|()| Error::::BadVersion)?; // Calculate the total weight that the xcm message is going to spend in the // destination chain @@ -682,14 +681,13 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::set_transact_info())] pub fn set_transact_info( origin: OriginFor, - location: Box, + location: Box, transact_extra_weight: Weight, max_weight: Weight, transact_extra_weight_signed: Option, ) -> DispatchResult { T::DerivativeAddressRegistrationOrigin::ensure_origin(origin)?; - let location = - MultiLocation::try_from(*location).map_err(|()| Error::::BadVersion)?; + let location = Location::try_from(*location).map_err(|()| Error::::BadVersion)?; let remote_info = RemoteTransactInfoWithMaxWeight { transact_extra_weight, max_weight, @@ -710,11 +708,10 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::remove_transact_info())] pub fn remove_transact_info( origin: OriginFor, - location: Box, + location: Box, ) -> DispatchResult { T::DerivativeAddressRegistrationOrigin::ensure_origin(origin)?; - let location = - MultiLocation::try_from(*location).map_err(|()| Error::::BadVersion)?; + let location = Location::try_from(*location).map_err(|()| Error::::BadVersion)?; // Remove transact info TransactInfoWithWeightLimit::::remove(&location); @@ -733,7 +730,7 @@ pub mod pallet { pub fn transact_through_signed( origin: OriginFor, // destination to which the message should be sent - dest: Box, + dest: Box, // fee to be used fee: CurrencyPayment>, // call to be executed in destination @@ -745,7 +742,7 @@ pub mod pallet { ) -> DispatchResult { let who = ensure_signed(origin)?; - let dest = MultiLocation::try_from(*dest).map_err(|()| Error::::BadVersion)?; + let dest = Location::try_from(*dest).map_err(|()| Error::::BadVersion)?; let fee_location = Self::currency_to_multilocation(fee.currency) .ok_or(Error::::NotCrossChainTransferableCurrency)?; @@ -780,7 +777,7 @@ pub mod pallet { // If refund is true, the appendix instruction will be a deposit back to the sender let appendix = refund .then(|| -> Result<_, DispatchError> { - let sender = T::AccountIdToMultiLocation::convert(who.clone()); + let sender = T::AccountIdToLocation::convert(who.clone()); Ok(vec![ RefundSurplus, Self::deposit_instruction(sender, &dest, 1u32)?, @@ -815,12 +812,12 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::set_fee_per_second())] pub fn set_fee_per_second( origin: OriginFor, - asset_location: Box, + asset_location: Box, fee_per_second: u128, ) -> DispatchResult { T::DerivativeAddressRegistrationOrigin::ensure_origin(origin)?; let asset_location = - MultiLocation::try_from(*asset_location).map_err(|()| Error::::BadVersion)?; + Location::try_from(*asset_location).map_err(|()| Error::::BadVersion)?; DestinationAssetFeePerSecond::::insert(&asset_location, &fee_per_second); @@ -836,11 +833,11 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::set_fee_per_second())] pub fn remove_fee_per_second( origin: OriginFor, - asset_location: Box, + asset_location: Box, ) -> DispatchResult { T::DerivativeAddressRegistrationOrigin::ensure_origin(origin)?; let asset_location = - MultiLocation::try_from(*asset_location).map_err(|()| Error::::BadVersion)?; + Location::try_from(*asset_location).map_err(|()| Error::::BadVersion)?; DestinationAssetFeePerSecond::::remove(&asset_location); @@ -895,7 +892,7 @@ pub mod pallet { // Grab the destination // For hrmp, it is always parent - let destination = MultiLocation::parent(); + let destination = Location::parent(); // Calculate the total weight that the xcm message is going to spend in the // destination chain @@ -951,9 +948,9 @@ pub mod pallet { impl Pallet { fn transact_in_dest_chain_asset_non_signed( - dest: MultiLocation, + dest: Location, fee_payer: Option, - fee: MultiAsset, + fee: Asset, call: Vec, origin_kind: OriginKind, total_weight: WeightLimit, @@ -962,7 +959,7 @@ pub mod pallet { ) -> DispatchResult { if let Some(fee_payer) = fee_payer { // Convert origin to multilocation - let origin_as_mult = T::AccountIdToMultiLocation::convert(fee_payer); + let origin_as_mult = T::AccountIdToLocation::convert(fee_payer); // Construct the local withdraw message with the previous calculated amount // This message deducts and burns "amount" from the caller when executed @@ -996,9 +993,9 @@ pub mod pallet { } fn transact_in_dest_chain_asset_signed( - dest: MultiLocation, + dest: Location, fee_payer: T::AccountId, - fee: MultiAsset, + fee: Asset, call: Vec, origin_kind: OriginKind, total_weight: WeightLimit, @@ -1006,7 +1003,7 @@ pub mod pallet { with_appendix: Option>>, ) -> DispatchResult { // Convert origin to multilocation - let origin_as_mult = T::AccountIdToMultiLocation::convert(fee_payer); + let origin_as_mult = T::AccountIdToLocation::convert(fee_payer); // Construct the transact message. This is composed of WithdrawAsset||BuyExecution|| // Transact. @@ -1045,11 +1042,11 @@ pub mod pallet { /// Calculate the amount of fee based on the multilocation of the fee asset and /// the total weight to be spent fn calculate_fee( - fee_location: MultiLocation, + fee_location: Location, fee_amount: Option, - destination: MultiLocation, + destination: Location, total_weight: Weight, - ) -> Result { + ) -> Result { // If amount is provided, just use it // Else, multiply weight*destination_units_per_second to see how much we should charge for // this weight execution @@ -1064,17 +1061,17 @@ pub mod pallet { |v| Ok(v), )?; - // Construct MultiAsset - Ok(MultiAsset { - id: Concrete(fee_location), + // Construct Asset + Ok(Asset { + id: AssetId(fee_location), fun: Fungible(amount), }) } /// Construct the transact xcm message with the provided parameters fn transact_message( - dest: MultiLocation, - asset: MultiAsset, + dest: Location, + asset: Asset, dest_weight: WeightLimit, call: Vec, dispatch_weight: Weight, @@ -1098,13 +1095,13 @@ pub mod pallet { /// Construct a buy execution xcm order with the provided parameters fn buy_execution( - asset: MultiAsset, - at: &MultiLocation, + asset: Asset, + at: &Location, weight: WeightLimit, ) -> Result, DispatchError> { let universal_location = T::UniversalLocation::get(); let fees = asset - .reanchored(at, universal_location) + .reanchored(at, &universal_location) .map_err(|_| Error::::CannotReanchor)?; Ok(BuyExecution { @@ -1115,12 +1112,12 @@ pub mod pallet { /// Construct a withdraw instruction from a sovereign account fn withdraw_instruction( - asset: MultiAsset, - at: &MultiLocation, + asset: Asset, + at: &Location, ) -> Result, DispatchError> { let universal_location = T::UniversalLocation::get(); let fees = asset - .reanchored(at, universal_location) + .reanchored(at, &universal_location) .map_err(|_| Error::::CannotReanchor)?; Ok(WithdrawAsset(fees.into())) @@ -1128,13 +1125,13 @@ pub mod pallet { /// Construct a deposit instruction to a sovereign account fn deposit_instruction( - mut beneficiary: MultiLocation, - at: &MultiLocation, + mut beneficiary: Location, + at: &Location, max_assets: u32, ) -> Result, DispatchError> { let universal_location = T::UniversalLocation::get(); beneficiary - .reanchor(at, universal_location) + .reanchor(at, &universal_location) .map_err(|_| Error::::CannotReanchor)?; Ok(DepositAsset { assets: Wild(AllCounted(max_assets)), @@ -1150,7 +1147,7 @@ pub mod pallet { } /// Ensure `dest` has chain part and none recipient part. - fn ensure_valid_dest(dest: &MultiLocation) -> Result { + fn ensure_valid_dest(dest: &Location) -> Result { if let (Some(dest), None) = (dest.chain_part(), dest.non_chain_part()) { Ok(dest) } else { @@ -1162,10 +1159,7 @@ pub mod pallet { /// /// Returns `Err` if `asset` is not a reserved asset of `dest`, /// else returns `dest`, parachain or relay chain location. - fn transfer_allowed( - asset: &MultiAsset, - dest: &MultiLocation, - ) -> Result { + fn transfer_allowed(asset: &Asset, dest: &Location) -> Result { let dest = Self::ensure_valid_dest(dest)?; let self_location = T::SelfLocation::get(); @@ -1182,21 +1176,21 @@ pub mod pallet { /// Returns weight of `weight_of_initiate_reserve_withdraw` call. fn weight_of_initiate_reserve_withdraw() -> Weight { - let dest = MultiLocation::parent(); + let dest = Location::parent(); // We can use whatever asset here - let asset = MultiLocation::parent(); + let asset = Location::parent(); - // Construct MultiAsset - let fee = MultiAsset { - id: Concrete(asset.clone()), + // Construct Asset + let fee = Asset { + id: AssetId(asset.clone()), fun: Fungible(0), }; let xcm: Xcm<()> = Xcm(vec![ WithdrawAsset(fee.into()), InitiateReserveWithdraw { - assets: MultiAssetFilter::Wild(All), + assets: AssetFilter::Wild(All), reserve: dest.clone(), xcm: Xcm(vec![]), }, @@ -1223,7 +1217,7 @@ pub mod pallet { /// Returns the weight information for a destination from storage /// it returns the weight to be used in non-signed cases pub fn take_weight_from_transact_info( - dest: MultiLocation, + dest: Location, dest_weight: Weight, refund: bool, ) -> Result { @@ -1248,7 +1242,7 @@ pub mod pallet { /// Returns the weight information for a destination from storage /// it returns the weight to be used in signed cases pub fn take_weight_from_transact_info_signed( - dest: MultiLocation, + dest: Location, dest_weight: Weight, refund: bool, ) -> Result { @@ -1279,8 +1273,8 @@ pub mod pallet { /// Returns the fee per second charged by a reserve chain for an asset /// it takes this information from storage pub fn take_fee_per_second_from_storage( - fee_location: MultiLocation, - destination: MultiLocation, + fee_location: Location, + destination: Location, total_weight: Weight, ) -> Result { let fee_per_second = DestinationAssetFeePerSecond::::get(&fee_location) @@ -1295,12 +1289,10 @@ pub mod pallet { } /// Converts Currency to multilocation - pub fn currency_to_multilocation( - currency: Currency>, - ) -> Option { + pub fn currency_to_multilocation(currency: Currency>) -> Option { match currency { - Currency::AsCurrencyId(id) => T::CurrencyIdToMultiLocation::convert(id), - Currency::AsMultiLocation(multiloc) => MultiLocation::try_from(*multiloc).ok(), + Currency::AsCurrencyId(id) => T::CurrencyIdToLocation::convert(id), + Currency::AsMultiLocation(multiloc) => Location::try_from(*multiloc).ok(), } } } diff --git a/pallets/xcm-transactor/src/mock.rs b/pallets/xcm-transactor/src/mock.rs index c63f47b8a6..cc55c474aa 100644 --- a/pallets/xcm-transactor/src/mock.rs +++ b/pallets/xcm-transactor/src/mock.rs @@ -18,7 +18,7 @@ use super::*; use crate as pallet_xcm_transactor; -use cumulus_primitives_core::MultiAssets; +use cumulus_primitives_core::Assets; use frame_support::traits::PalletInfo as PalletInfoTrait; use frame_support::{construct_runtime, parameter_types, weights::Weight}; use frame_system::EnsureRoot; @@ -29,10 +29,10 @@ use sp_io; use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; use sp_runtime::BuildStorage; use xcm::latest::{ - opaque, Error as XcmError, Instruction, InteriorMultiLocation, + opaque, Asset, Error as XcmError, Instruction, InteriorLocation, Junction::{AccountKey20, GlobalConsensus, PalletInstance, Parachain}, - Junctions, MultiAsset, MultiLocation, NetworkId, Result as XcmResult, SendError, SendResult, - SendXcm, Xcm, XcmContext, XcmHash, + Location, NetworkId, Result as XcmResult, SendError, SendResult, SendXcm, Xcm, XcmContext, + XcmHash, }; use xcm::{IntoVersion, VersionedXcm, WrapVersion}; use xcm_primitives::{UtilityAvailableCalls, UtilityEncodeCall, XcmTransact}; @@ -40,7 +40,7 @@ use xcm_primitives::{UtilityAvailableCalls, UtilityEncodeCall, XcmTransact}; use sp_std::cell::RefCell; use xcm_executor::{ traits::{TransactAsset, WeightBounds, WeightTrader}, - Assets, + AssetsInHolding, }; type Block = frame_system::mocking::MockBlock; @@ -74,6 +74,7 @@ impl frame_system::Config for Test { type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Block = Block; type Hash = H256; type Hashing = BlakeTwo256; @@ -107,7 +108,6 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -128,7 +128,7 @@ const XCM_VERSION_ROOT_KEY: &'static [u8] = b"XCM_VERSION_ROOT_KEY"; pub struct CustomVersionWrapper; impl WrapVersion for CustomVersionWrapper { fn wrap_version( - _dest: &xcm::latest::MultiLocation, + _dest: &xcm::latest::Location, xcm: impl Into>, ) -> Result, ()> { let xcm_version: u32 = @@ -149,10 +149,10 @@ impl SendXcm for DoNothingRouter { type Ticket = (); fn validate( - _destination: &mut Option, + _destination: &mut Option, _message: &mut Option, ) -> SendResult { - Ok(((), MultiAssets::new())) + Ok(((), Assets::new())) } fn deliver(_: Self::Ticket) -> Result { @@ -162,20 +162,16 @@ impl SendXcm for DoNothingRouter { pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { - fn deposit_asset( - _what: &MultiAsset, - _who: &MultiLocation, - _context: Option<&XcmContext>, - ) -> XcmResult { + fn deposit_asset(_what: &Asset, _who: &Location, _context: Option<&XcmContext>) -> XcmResult { Ok(()) } fn withdraw_asset( - _what: &MultiAsset, - _who: &MultiLocation, + _what: &Asset, + _who: &Location, _context: Option<&XcmContext>, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } @@ -188,10 +184,10 @@ impl WeightTrader for DummyWeightTrader { fn buy_weight( &mut self, _weight: Weight, - _payment: Assets, + _payment: AssetsInHolding, _context: &XcmContext, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } @@ -207,40 +203,40 @@ impl WeightBounds for DummyWeigher { } } -pub struct AccountIdToMultiLocation; -impl sp_runtime::traits::Convert for AccountIdToMultiLocation { - fn convert(_account: u64) -> MultiLocation { +pub struct AccountIdToLocation; +impl sp_runtime::traits::Convert for AccountIdToLocation { + fn convert(_account: u64) -> Location { let as_h160: H160 = H160::repeat_byte(0xAA); - MultiLocation::new( + Location::new( 0, - Junctions::X1(AccountKey20 { + [AccountKey20 { network: None, key: as_h160.as_fixed_bytes().clone(), - }), + }], ) } } parameter_types! { - pub Ancestry: MultiLocation = Parachain(ParachainId::get().into()).into(); + pub Ancestry: Location = Parachain(ParachainId::get().into()).into(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub SelfLocation: MultiLocation = MultiLocation::here(); + pub SelfLocation: Location = Location::here(); - pub SelfReserve: MultiLocation = MultiLocation::new( + pub SelfReserve: Location = Location::new( 1, - Junctions::X2( + [ Parachain(ParachainId::get().into()), PalletInstance( ::PalletInfo::index::().unwrap() as u8 ) - )); + ]); pub MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = - Junctions::X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainId::get().into())); + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(ParachainId::get().into())].into(); } #[derive(Encode, Decode)] @@ -285,9 +281,9 @@ impl Default for Transactors { } impl XcmTransact for Transactors { - fn destination(self) -> MultiLocation { + fn destination(self) -> Location { match self { - Transactors::Relay => MultiLocation::parent(), + Transactors::Relay => Location::parent(), } } } @@ -314,21 +310,21 @@ pub enum CurrencyId { OtherReserve(AssetId), } -pub struct CurrencyIdToMultiLocation; +pub struct CurrencyIdToLocation; -impl sp_runtime::traits::Convert> for CurrencyIdToMultiLocation { - fn convert(currency: CurrencyId) -> Option { +impl sp_runtime::traits::Convert> for CurrencyIdToLocation { + fn convert(currency: CurrencyId) -> Option { match currency { CurrencyId::SelfReserve => { - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } // To distinguish between relay and others, specially for reserve asset CurrencyId::OtherReserve(asset) => { if asset == 0 { - Some(MultiLocation::parent()) + Some(Location::parent()) } else { - Some(MultiLocation::new(1, Junctions::X1(Parachain(2)))) + Some(Location::new(1, [Parachain(2)])) } } } @@ -336,11 +332,11 @@ impl sp_runtime::traits::Convert> for Currency } #[cfg(feature = "runtime-benchmarks")] -impl From for CurrencyId { - fn from(location: MultiLocation) -> CurrencyId { +impl From for CurrencyId { + fn from(location: Location) -> CurrencyId { if location == SelfReserve::get() { CurrencyId::SelfReserve - } else if location == MultiLocation::parent() { + } else if location == Location::parent() { CurrencyId::OtherReserve(0) } else { CurrencyId::OtherReserve(1) @@ -350,9 +346,9 @@ impl From for CurrencyId { // Simulates sending a XCM message thread_local! { - pub static SENT_XCM: RefCell> = RefCell::new(Vec::new()); + pub static SENT_XCM: RefCell> = RefCell::new(Vec::new()); } -pub fn sent_xcm() -> Vec<(MultiLocation, opaque::Xcm)> { +pub fn sent_xcm() -> Vec<(Location, opaque::Xcm)> { SENT_XCM.with(|q| (*q.borrow()).clone()) } pub struct TestSendXcm; @@ -360,16 +356,16 @@ impl SendXcm for TestSendXcm { type Ticket = (); fn validate( - destination: &mut Option, + destination: &mut Option, message: &mut Option, ) -> SendResult { SENT_XCM.with(|q| { q.borrow_mut() .push((destination.clone().unwrap(), message.clone().unwrap())) }); - CustomVersionWrapper::wrap_version(&destination.unwrap(), message.clone().unwrap()) + CustomVersionWrapper::wrap_version(&destination.clone().unwrap(), message.clone().unwrap()) .map_err(|()| SendError::DestinationUnsupported)?; - Ok(((), MultiAssets::new())) + Ok(((), Assets::new())) } fn deliver(_: Self::Ticket) -> Result { @@ -378,7 +374,7 @@ impl SendXcm for TestSendXcm { } parameter_types! { - pub MaxFee: MultiAsset = (MultiLocation::parent(), 1_000_000_000_000u128).into(); + pub MaxFee: Asset = (Location::parent(), 1_000_000_000_000u128).into(); } pub type MaxHrmpRelayFee = xcm_builder::Case; @@ -390,8 +386,8 @@ impl Config for Test { type SovereignAccountDispatcherOrigin = EnsureRoot; type AssetTransactor = DummyAssetTransactor; type CurrencyId = CurrencyId; - type CurrencyIdToMultiLocation = CurrencyIdToMultiLocation; - type AccountIdToMultiLocation = AccountIdToMultiLocation; + type CurrencyIdToLocation = CurrencyIdToLocation; + type AccountIdToLocation = AccountIdToLocation; type SelfLocation = SelfLocation; type Weigher = DummyWeigher; type UniversalLocation = UniversalLocation; diff --git a/pallets/xcm-transactor/src/tests.rs b/pallets/xcm-transactor/src/tests.rs index 9224e4dab7..bb55624d8c 100644 --- a/pallets/xcm-transactor/src/tests.rs +++ b/pallets/xcm-transactor/src/tests.rs @@ -62,9 +62,9 @@ fn test_transact_through_derivative_errors() { Transactors::Relay, 1, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![0u8], @@ -87,9 +87,9 @@ fn test_transact_through_derivative_errors() { Transactors::Relay, 1, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![0u8], @@ -105,7 +105,7 @@ fn test_transact_through_derivative_errors() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), None @@ -118,9 +118,9 @@ fn test_transact_through_derivative_errors() { Transactors::Relay, 1, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![0u8], @@ -136,9 +136,9 @@ fn test_transact_through_derivative_errors() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::new( + Box::new(xcm::VersionedLocation::V4(Location::new( 1, - Junctions::X1(Junction::Parachain(1000)) + [Junction::Parachain(1000)] ))), 1 )); @@ -150,12 +150,9 @@ fn test_transact_through_derivative_errors() { Transactors::Relay, 1, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::new( - 1, - Junctions::X1(Junction::Parachain(1000)) - )) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::new(1, [Junction::Parachain(1000)]) + ))), fee_amount: None }, vec![0u8], @@ -171,7 +168,7 @@ fn test_transact_through_derivative_errors() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -182,9 +179,9 @@ fn test_transact_through_derivative_errors() { Transactors::Relay, 1, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![0u8], @@ -209,11 +206,11 @@ fn test_transact_through_signed_errors() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![0u8], @@ -229,7 +226,7 @@ fn test_transact_through_signed_errors() { // Root can set transact info without extra_signed being None assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), None @@ -239,11 +236,11 @@ fn test_transact_through_signed_errors() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![0u8], @@ -259,7 +256,7 @@ fn test_transact_through_signed_errors() { // Root can set transact info, with extra signed assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 15000.into(), Some(12000.into()) @@ -269,11 +266,11 @@ fn test_transact_through_signed_errors() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![0u8], @@ -289,9 +286,9 @@ fn test_transact_through_signed_errors() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::new( + Box::new(xcm::VersionedLocation::V4(Location::new( 1, - Junctions::X1(Junction::Parachain(1000)) + [Junction::Parachain(1000)] ))), 1 )); @@ -300,14 +297,11 @@ fn test_transact_through_signed_errors() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::new( - 1, - Junctions::X1(Junction::Parachain(1000)) - )) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::new(1, [Junction::Parachain(1000)]) + ))), fee_amount: None }, vec![0u8], @@ -334,7 +328,7 @@ fn test_transact_through_derivative_multilocation_success() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), None @@ -343,7 +337,7 @@ fn test_transact_through_derivative_multilocation_success() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -353,8 +347,8 @@ fn test_transact_through_derivative_multilocation_success() { Transactors::Relay, 1, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -371,7 +365,7 @@ fn test_transact_through_derivative_multilocation_success() { index: 1, }, crate::Event::TransactInfoChanged { - location: MultiLocation::parent(), + location: Location::parent(), remote_info: RemoteTransactInfoWithMaxWeight { transact_extra_weight: 0.into(), max_weight: 10000.into(), @@ -379,12 +373,12 @@ fn test_transact_through_derivative_multilocation_success() { }, }, crate::Event::DestFeePerSecondChanged { - location: MultiLocation::parent(), + location: Location::parent(), fee_per_second: 1, }, crate::Event::TransactedDerivative { account_id: 1u64, - dest: MultiLocation::parent(), + dest: Location::parent(), call: Transactors::Relay .encode_call(UtilityAvailableCalls::AsDerivative(1, vec![1u8])), index: 1, @@ -406,7 +400,7 @@ fn test_transact_through_derivative_success() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), None @@ -415,7 +409,7 @@ fn test_transact_through_derivative_success() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -441,7 +435,7 @@ fn test_transact_through_derivative_success() { index: 1, }, crate::Event::TransactInfoChanged { - location: MultiLocation::parent(), + location: Location::parent(), remote_info: RemoteTransactInfoWithMaxWeight { transact_extra_weight: 0.into(), max_weight: 10000.into(), @@ -449,12 +443,12 @@ fn test_transact_through_derivative_success() { }, }, crate::Event::DestFeePerSecondChanged { - location: MultiLocation::parent(), + location: Location::parent(), fee_per_second: 1, }, crate::Event::TransactedDerivative { account_id: 1u64, - dest: MultiLocation::parent(), + dest: Location::parent(), call: Transactors::Relay .encode_call(UtilityAvailableCalls::AsDerivative(1, vec![1u8])), index: 1, @@ -469,9 +463,9 @@ fn test_transact_through_derivative_success() { RefundSurplus, DepositAsset { assets: Wild(AllCounted(1u32)), - beneficiary: MultiLocation { + beneficiary: Location { parents: 0, - interior: X1(Junction::Parachain(100)) + interior: [Junction::Parachain(100)].into() } } ])))); @@ -488,12 +482,12 @@ fn test_root_can_transact_through_sovereign() { assert_noop!( XcmTransactor::transact_through_sovereign( RuntimeOrigin::signed(1), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1u64, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![1u8], @@ -510,7 +504,7 @@ fn test_root_can_transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), None @@ -519,18 +513,18 @@ fn test_root_can_transact_through_sovereign() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); // fee as destination are the same, this time it should work assert_ok!(XcmTransactor::transact_through_sovereign( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1u64, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -545,7 +539,7 @@ fn test_root_can_transact_through_sovereign() { let expected = vec![ crate::Event::TransactInfoChanged { - location: MultiLocation::parent(), + location: Location::parent(), remote_info: RemoteTransactInfoWithMaxWeight { transact_extra_weight: 0.into(), max_weight: 10000.into(), @@ -553,12 +547,12 @@ fn test_root_can_transact_through_sovereign() { }, }, crate::Event::DestFeePerSecondChanged { - location: MultiLocation::parent(), + location: Location::parent(), fee_per_second: 1, }, crate::Event::TransactedSovereign { fee_payer: 1u64, - dest: MultiLocation::parent(), + dest: Location::parent(), call: vec![1u8], }, ]; @@ -634,7 +628,7 @@ fn removing_transact_info_works() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), None @@ -643,14 +637,14 @@ fn removing_transact_info_works() { // Root can remove transact info assert_ok!(XcmTransactor::remove_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), )); - assert!(XcmTransactor::transact_info(MultiLocation::parent()).is_none()); + assert!(XcmTransactor::transact_info(Location::parent()).is_none()); let expected = vec![ crate::Event::TransactInfoChanged { - location: MultiLocation::parent(), + location: Location::parent(), remote_info: RemoteTransactInfoWithMaxWeight { transact_extra_weight: 0.into(), max_weight: 10000.into(), @@ -658,7 +652,7 @@ fn removing_transact_info_works() { }, }, crate::Event::TransactInfoRemoved { - location: MultiLocation::parent(), + location: Location::parent(), }, ]; assert_eq!(events(), expected); @@ -675,7 +669,7 @@ fn test_transact_through_signed_fails_if_transact_info_not_set_at_all() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None @@ -701,7 +695,7 @@ fn test_transact_through_signed_fails_if_weight_is_not_set() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), None @@ -711,7 +705,7 @@ fn test_transact_through_signed_fails_if_weight_is_not_set() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None @@ -737,7 +731,7 @@ fn test_transact_through_signed_fails_if_weight_overflows() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), Some(Weight::MAX) @@ -747,7 +741,7 @@ fn test_transact_through_signed_fails_if_weight_overflows() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None @@ -773,7 +767,7 @@ fn test_transact_through_signed_fails_if_weight_is_bigger_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), Some(1.into()) @@ -783,7 +777,7 @@ fn test_transact_through_signed_fails_if_weight_is_bigger_than_max_weight() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None @@ -809,7 +803,7 @@ fn test_transact_through_signed_fails_if_fee_per_second_not_set() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), Some(1.into()) @@ -819,7 +813,7 @@ fn test_transact_through_signed_fails_if_fee_per_second_not_set() { assert_noop!( XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None @@ -845,7 +839,7 @@ fn test_transact_through_signed_works() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), Some(1.into()) @@ -854,7 +848,7 @@ fn test_transact_through_signed_works() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -862,7 +856,7 @@ fn test_transact_through_signed_works() { // this time it should work assert_ok!(XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None @@ -877,7 +871,7 @@ fn test_transact_through_signed_works() { let expected = vec![ crate::Event::TransactInfoChanged { - location: MultiLocation::parent(), + location: Location::parent(), remote_info: RemoteTransactInfoWithMaxWeight { transact_extra_weight: 0.into(), max_weight: 10000.into(), @@ -885,12 +879,12 @@ fn test_transact_through_signed_works() { }, }, crate::Event::DestFeePerSecondChanged { - location: MultiLocation::parent(), + location: Location::parent(), fee_per_second: 1, }, crate::Event::TransactedSigned { fee_payer: 1u64, - dest: MultiLocation::parent(), + dest: Location::parent(), call: vec![1u8], }, ]; @@ -938,7 +932,7 @@ fn test_send_through_derivative_with_custom_weight_and_fee() { }, crate::Event::TransactedDerivative { account_id: 1u64, - dest: MultiLocation::parent(), + dest: Location::parent(), call: Transactors::Relay .encode_call(UtilityAvailableCalls::AsDerivative(1, vec![1u8])), index: 1, @@ -950,9 +944,9 @@ fn test_send_through_derivative_with_custom_weight_and_fee() { // Lets make sure the message is as expected assert!(sent_message .0 - .contains(&WithdrawAsset((MultiLocation::here(), total_fee).into()))); + .contains(&WithdrawAsset((Location::here(), total_fee).into()))); assert!(sent_message.0.contains(&BuyExecution { - fees: (MultiLocation::here(), total_fee).into(), + fees: (Location::here(), total_fee).into(), weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { @@ -987,11 +981,11 @@ fn test_send_through_sovereign_with_custom_weight_and_fee() { // fee as destination are the same, this time it should work assert_ok!(XcmTransactor::transact_through_sovereign( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1u64, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -1011,7 +1005,7 @@ fn test_send_through_sovereign_with_custom_weight_and_fee() { }, crate::Event::TransactedSovereign { fee_payer: 1u64, - dest: MultiLocation::parent(), + dest: Location::parent(), call: vec![1u8], }, ]; @@ -1021,9 +1015,9 @@ fn test_send_through_sovereign_with_custom_weight_and_fee() { // Lets make sure the message is as expected assert!(sent_message .0 - .contains(&WithdrawAsset((MultiLocation::here(), total_fee).into()))); + .contains(&WithdrawAsset((Location::here(), total_fee).into()))); assert!(sent_message.0.contains(&BuyExecution { - fees: (MultiLocation::here(), total_fee).into(), + fees: (Location::here(), total_fee).into(), weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { @@ -1053,10 +1047,10 @@ fn test_send_through_signed_with_custom_weight_and_fee() { // fee as destination are the same, this time it should work assert_ok!(XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -1070,7 +1064,7 @@ fn test_send_through_signed_with_custom_weight_and_fee() { let expected = vec![crate::Event::TransactedSigned { fee_payer: 1u64, - dest: MultiLocation::parent(), + dest: Location::parent(), call: vec![1u8], }]; assert_eq!(events(), expected); @@ -1079,9 +1073,9 @@ fn test_send_through_signed_with_custom_weight_and_fee() { // Lets make sure the message is as expected assert!(sent_message .0 - .contains(&WithdrawAsset((MultiLocation::here(), total_fee).into()))); + .contains(&WithdrawAsset((Location::here(), total_fee).into()))); assert!(sent_message.0.contains(&BuyExecution { - fees: (MultiLocation::here(), total_fee).into(), + fees: (Location::here(), total_fee).into(), weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { @@ -1112,8 +1106,8 @@ fn test_hrmp_manipulator_init() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -1128,9 +1122,9 @@ fn test_hrmp_manipulator_init() { // Lets make sure the message is as expected assert!(sent_message .0 - .contains(&WithdrawAsset((MultiLocation::here(), total_fee).into()))); + .contains(&WithdrawAsset((Location::here(), total_fee).into()))); assert!(sent_message.0.contains(&BuyExecution { - fees: (MultiLocation::here(), total_fee).into(), + fees: (Location::here(), total_fee).into(), weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { @@ -1164,8 +1158,8 @@ fn test_hrmp_manipulator_init_v2_convert_works() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -1180,9 +1174,9 @@ fn test_hrmp_manipulator_init_v2_convert_works() { // Lets make sure the message is as expected assert!(sent_message .0 - .contains(&WithdrawAsset((MultiLocation::here(), total_fee).into()))); + .contains(&WithdrawAsset((Location::here(), total_fee).into()))); assert!(sent_message.0.contains(&BuyExecution { - fees: (MultiLocation::here(), total_fee).into(), + fees: (Location::here(), total_fee).into(), weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { @@ -1196,9 +1190,9 @@ fn test_hrmp_manipulator_init_v2_convert_works() { RefundSurplus, DepositAsset { assets: Wild(AllCounted(1)), - beneficiary: MultiLocation { + beneficiary: Location { parents: 0, - interior: X1(Junction::Parachain(100)) + interior: [Junction::Parachain(100)].into() } } ])))); @@ -1228,8 +1222,8 @@ fn test_hrmp_manipulator_init_v3_convert_works() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -1244,9 +1238,9 @@ fn test_hrmp_manipulator_init_v3_convert_works() { // Lets make sure the message is as expected assert!(sent_message .0 - .contains(&WithdrawAsset((MultiLocation::here(), total_fee).into()))); + .contains(&WithdrawAsset((Location::here(), total_fee).into()))); assert!(sent_message.0.contains(&BuyExecution { - fees: (MultiLocation::here(), total_fee).into(), + fees: (Location::here(), total_fee).into(), weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { @@ -1260,9 +1254,9 @@ fn test_hrmp_manipulator_init_v3_convert_works() { RefundSurplus, DepositAsset { assets: Wild(AllCounted(1)), - beneficiary: MultiLocation { + beneficiary: Location { parents: 0, - interior: X1(Junction::Parachain(100)) + interior: [Junction::Parachain(100)].into() } } ])))); @@ -1270,7 +1264,7 @@ fn test_hrmp_manipulator_init_v3_convert_works() { } #[test] -fn test_hrmp_manipulator_init_v4_convert_fails() { +fn test_hrmp_manipulator_init_v5_convert_fails() { ExtBuilder::default() .with_balances(vec![]) .build() @@ -1282,7 +1276,7 @@ fn test_hrmp_manipulator_init_v4_convert_fails() { let total_fee = 100u128; // Change xcm version - CustomVersionWrapper::set_version(4); + CustomVersionWrapper::set_version(5); assert_noop!( XcmTransactor::hrmp_manage( @@ -1293,9 +1287,9 @@ fn test_hrmp_manipulator_init_v4_convert_fails() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: Some(total_fee) }, TransactWeights { @@ -1327,9 +1321,9 @@ fn test_hrmp_max_fee_errors() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: Some(total_fee) }, TransactWeights { @@ -1360,8 +1354,8 @@ fn test_hrmp_manipulator_accept() { para_id: 1u32.into() }, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -1376,9 +1370,9 @@ fn test_hrmp_manipulator_accept() { // Lets make sure the message is as expected assert!(sent_message .0 - .contains(&WithdrawAsset((MultiLocation::here(), total_fee).into()))); + .contains(&WithdrawAsset((Location::here(), total_fee).into()))); assert!(sent_message.0.contains(&BuyExecution { - fees: (MultiLocation::here(), total_fee).into(), + fees: (Location::here(), total_fee).into(), weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { @@ -1413,8 +1407,8 @@ fn test_hrmp_manipulator_cancel() { open_requests }, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -1429,9 +1423,9 @@ fn test_hrmp_manipulator_cancel() { // Lets make sure the message is as expected assert!(sent_message .0 - .contains(&WithdrawAsset((MultiLocation::here(), total_fee).into()))); + .contains(&WithdrawAsset((Location::here(), total_fee).into()))); assert!(sent_message.0.contains(&BuyExecution { - fees: (MultiLocation::here(), total_fee).into(), + fees: (Location::here(), total_fee).into(), weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { @@ -1461,8 +1455,8 @@ fn test_hrmp_manipulator_close() { recipient: 1u32.into() }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -1477,9 +1471,9 @@ fn test_hrmp_manipulator_close() { // Lets make sure the message is as expected assert!(sent_message .0 - .contains(&WithdrawAsset((MultiLocation::here(), total_fee).into()))); + .contains(&WithdrawAsset((Location::here(), total_fee).into()))); assert!(sent_message.0.contains(&BuyExecution { - fees: (MultiLocation::here(), total_fee).into(), + fees: (Location::here(), total_fee).into(), weight_limit: Limited(total_weight), })); assert!(sent_message.0.contains(&Transact { @@ -1502,7 +1496,7 @@ fn test_transact_through_derivative_with_refund_works() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), None @@ -1511,7 +1505,7 @@ fn test_transact_through_derivative_with_refund_works() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -1537,7 +1531,7 @@ fn test_transact_through_derivative_with_refund_works() { index: 1, }, crate::Event::TransactInfoChanged { - location: MultiLocation::parent(), + location: Location::parent(), remote_info: RemoteTransactInfoWithMaxWeight { transact_extra_weight: 0.into(), max_weight: 10000.into(), @@ -1545,12 +1539,12 @@ fn test_transact_through_derivative_with_refund_works() { }, }, crate::Event::DestFeePerSecondChanged { - location: MultiLocation::parent(), + location: Location::parent(), fee_per_second: 1, }, crate::Event::TransactedDerivative { account_id: 1u64, - dest: MultiLocation::parent(), + dest: Location::parent(), call: Transactors::Relay .encode_call(UtilityAvailableCalls::AsDerivative(1, vec![1u8])), index: 1, @@ -1565,9 +1559,9 @@ fn test_transact_through_derivative_with_refund_works() { RefundSurplus, DepositAsset { assets: Wild(AllCounted(1u32)), - beneficiary: MultiLocation { + beneficiary: Location { parents: 0, - interior: X1(Junction::Parachain(100)) + interior: [Junction::Parachain(100)].into() } } ])))); @@ -1586,7 +1580,7 @@ fn test_transact_through_derivative_with_refund_fails_overall_weight_not_set() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 0.into(), 10000.into(), None @@ -1595,7 +1589,7 @@ fn test_transact_through_derivative_with_refund_fails_overall_weight_not_set() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -1630,7 +1624,7 @@ fn test_transact_through_signed_with_refund_works() { // Set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -1638,7 +1632,7 @@ fn test_transact_through_signed_with_refund_works() { let total_weight: Weight = 10_100u64.into(); assert_ok!(XcmTransactor::transact_through_signed( RuntimeOrigin::signed(1u64), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { currency: Currency::AsCurrencyId(CurrencyId::OtherReserve(0)), fee_amount: None @@ -1653,12 +1647,12 @@ fn test_transact_through_signed_with_refund_works() { let expected = vec![ crate::Event::DestFeePerSecondChanged { - location: MultiLocation::parent(), + location: Location::parent(), fee_per_second: 1, }, crate::Event::TransactedSigned { fee_payer: 1u64, - dest: MultiLocation::parent(), + dest: Location::parent(), call: vec![1u8], }, ]; @@ -1671,15 +1665,16 @@ fn test_transact_through_signed_with_refund_works() { RefundSurplus, DepositAsset { assets: Wild(AllCounted(1u32)), - beneficiary: MultiLocation { + beneficiary: Location { parents: 0, - interior: X2( + interior: [ Junction::Parachain(100), - AccountIdToMultiLocation::convert(1) + AccountIdToLocation::convert(1) .interior .take_first() .unwrap() - ) + ] + .into() } } ])))); diff --git a/precompiles/assets-erc20/src/mock.rs b/precompiles/assets-erc20/src/mock.rs index 57ea8659eb..cc6f459521 100644 --- a/precompiles/assets-erc20/src/mock.rs +++ b/precompiles/assets-erc20/src/mock.rs @@ -85,6 +85,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -134,7 +135,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/author-mapping/src/mock.rs b/precompiles/author-mapping/src/mock.rs index 44ea0abca3..5cf6d14a7b 100644 --- a/precompiles/author-mapping/src/mock.rs +++ b/precompiles/author-mapping/src/mock.rs @@ -56,6 +56,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -92,7 +93,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/balances-erc20/src/mock.rs b/precompiles/balances-erc20/src/mock.rs index 447aa76a65..866563bf14 100644 --- a/precompiles/balances-erc20/src/mock.rs +++ b/precompiles/balances-erc20/src/mock.rs @@ -40,6 +40,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -89,7 +90,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/balances-erc20/src/tests.rs b/precompiles/balances-erc20/src/tests.rs index 47a1fb2099..e644f75144 100644 --- a/precompiles/balances-erc20/src/tests.rs +++ b/precompiles/balances-erc20/src/tests.rs @@ -280,7 +280,7 @@ fn transfer() { value: 400.into(), }, ) - .expect_cost(184118756) // 1 weight => 1 gas in mock + .expect_cost(172298756) // 1 weight => 1 gas in mock .expect_log(log3( Precompile1, SELECTOR_LOG_TRANSFER, @@ -370,7 +370,7 @@ fn transfer_from() { value: 400.into(), }, ) - .expect_cost(184118756) // 1 weight => 1 gas in mock + .expect_cost(172298756) // 1 weight => 1 gas in mock .expect_log(log3( Precompile1, SELECTOR_LOG_TRANSFER, @@ -466,7 +466,7 @@ fn transfer_from_self() { value: 400.into(), }, ) - .expect_cost(184118756) // 1 weight => 1 gas in mock + .expect_cost(172298756) // 1 weight => 1 gas in mock .expect_log(log3( Precompile1, SELECTOR_LOG_TRANSFER, diff --git a/precompiles/batch/src/mock.rs b/precompiles/batch/src/mock.rs index 37fcb1f0e9..6f22ed5e81 100644 --- a/precompiles/batch/src/mock.rs +++ b/precompiles/batch/src/mock.rs @@ -54,6 +54,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -90,7 +91,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/call-permit/src/mock.rs b/precompiles/call-permit/src/mock.rs index fa52607944..82a6df48b5 100644 --- a/precompiles/call-permit/src/mock.rs +++ b/precompiles/call-permit/src/mock.rs @@ -54,6 +54,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -90,7 +91,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/collective/src/mock.rs b/precompiles/collective/src/mock.rs index e240c0d533..2510220457 100644 --- a/precompiles/collective/src/mock.rs +++ b/precompiles/collective/src/mock.rs @@ -65,6 +65,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -103,7 +104,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/conviction-voting/src/mock.rs b/precompiles/conviction-voting/src/mock.rs index 411a99f3ee..56bd64ee08 100644 --- a/precompiles/conviction-voting/src/mock.rs +++ b/precompiles/conviction-voting/src/mock.rs @@ -61,6 +61,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -97,7 +98,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/crowdloan-rewards/Cargo.toml b/precompiles/crowdloan-rewards/Cargo.toml index 0dbc39a4bb..9b691e0d78 100644 --- a/precompiles/crowdloan-rewards/Cargo.toml +++ b/precompiles/crowdloan-rewards/Cargo.toml @@ -23,7 +23,7 @@ sp-runtime = { workspace = true } # Frontier fp-evm = { workspace = true } -pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] } +pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] } [dev-dependencies] derive_more = { workspace = true } @@ -31,25 +31,26 @@ serde = { workspace = true } sha3 = { workspace = true } # Moonbeam -precompile-utils = { workspace = true, features = [ "std", "testing" ] } +precompile-utils = { workspace = true, features = ["std", "testing"] } # Substrate -pallet-balances = { workspace = true, features = [ "std" ] } -pallet-scheduler = { workspace = true, features = [ "std" ] } -pallet-timestamp = { workspace = true, features = [ "std" ] } -parity-scale-codec = { workspace = true, features = [ "max-encoded-len", "std" ] } -scale-info = { workspace = true, features = [ "derive", "std" ] } +pallet-balances = { workspace = true, features = ["std"] } +pallet-scheduler = { workspace = true, features = ["std"] } +pallet-timestamp = { workspace = true, features = ["std"] } +parity-scale-codec = { workspace = true, features = ["max-encoded-len", "std"] } +scale-info = { workspace = true, features = ["derive", "std"] } sp-io = { workspace = true } -sp-runtime = { workspace = true, features = [ "std" ] } +sp-runtime = { workspace = true, features = ["std"] } +pallet-message-queue = { workspace = true, features = ["std"] } # Cumulus -cumulus-pallet-parachain-system = { workspace = true, features = [ "std" ] } -cumulus-primitives-core = { workspace = true, features = [ "std" ] } -cumulus-primitives-parachain-inherent = { workspace = true, features = [ "std" ] } -cumulus-test-relay-sproof-builder = { workspace = true, features = [ "std" ] } +cumulus-pallet-parachain-system = { workspace = true, features = ["std"] } +cumulus-primitives-core = { workspace = true, features = ["std"] } +cumulus-primitives-parachain-inherent = { workspace = true, features = ["std"] } +cumulus-test-relay-sproof-builder = { workspace = true, features = ["std"] } [features] -default = [ "std" ] +default = ["std"] std = [ "cumulus-pallet-parachain-system/std", "cumulus-primitives-core/std", diff --git a/precompiles/crowdloan-rewards/src/mock.rs b/precompiles/crowdloan-rewards/src/mock.rs index 72eae184be..197c959558 100644 --- a/precompiles/crowdloan-rewards/src/mock.rs +++ b/precompiles/crowdloan-rewards/src/mock.rs @@ -17,7 +17,8 @@ //! Test utilities use super::*; use cumulus_primitives_core::{ - relay_chain::BlockNumber as RelayChainBlockNumber, PersistedValidationData, + relay_chain::BlockNumber as RelayChainBlockNumber, AggregateMessageOrigin, + PersistedValidationData, }; use cumulus_primitives_parachain_inherent::ParachainInherentData; use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; @@ -53,11 +54,13 @@ construct_runtime!( Timestamp: pallet_timestamp, ParachainSystem: cumulus_pallet_parachain_system, Crowdloan: pallet_crowdloan_rewards, + MessageQueue: pallet_message_queue, } ); parameter_types! { pub ParachainId: cumulus_primitives_core::ParaId = 100.into(); + pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; } impl cumulus_pallet_parachain_system::Config for Runtime { @@ -67,10 +70,30 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type OutboundXcmpMessageSource = (); type XcmpMessageHandler = (); type ReservedXcmpWeight = (); - type DmpMessageHandler = (); + type DmpQueue = frame_support::traits::EnqueueWithOrigin; type ReservedDmpWeight = (); type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; type ConsensusHook = cumulus_pallet_parachain_system::ExpectParentIncluded; + type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight; +} + +parameter_types! { + pub MessageQueueServiceWeight: Weight = Weight::from_parts(1_000_000_000, 1_000_000); + pub const MessageQueueHeapSize: u32 = 65_536; + pub const MessageQueueMaxStale: u32 = 16; +} + +impl pallet_message_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Size = u32; + type HeapSize = MessageQueueHeapSize; + type MaxStale = MessageQueueMaxStale; + type ServiceWeight = MessageQueueServiceWeight; + type MessageProcessor = + pallet_message_queue::mock_helpers::NoopMessageProcessor; + type QueueChangeHandler = (); + type WeightInfo = (); + type QueuePausedQuery = (); } parameter_types! { @@ -81,6 +104,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -117,7 +141,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/gmp/src/mock.rs b/precompiles/gmp/src/mock.rs index e4093c6e89..f90e4b878c 100644 --- a/precompiles/gmp/src/mock.rs +++ b/precompiles/gmp/src/mock.rs @@ -35,7 +35,7 @@ use xcm::latest::{prelude::*, Error as XcmError}; use xcm_builder::{AllowUnpaidExecutionFrom, FixedWeightBounds}; use xcm_executor::{ traits::{TransactAsset, WeightTrader}, - Assets, XcmExecutor, + AssetsInHolding, XcmExecutor, }; use xcm_primitives::XcmV2Weight; @@ -60,7 +60,7 @@ mock_account!(SelfReserveAccount, |_| MockAccount::from_u64(2)); parameter_types! { pub ParachainId: cumulus_primitives_core::ParaId = 100.into(); - pub UniversalLocation: InteriorMultiLocation = RelayNetwork::get().into(); + pub UniversalLocation: InteriorLocation = RelayNetwork::get().into(); } parameter_types! { @@ -75,6 +75,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -111,25 +112,19 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - pub struct DoNothingRouter; impl SendXcm for DoNothingRouter { type Ticket = (); fn validate( - _destination: &mut Option, + _destination: &mut Option, _message: &mut Option>, ) -> SendResult { - Ok(((), MultiAssets::new())) + Ok(((), Assets::new())) } fn deliver(_: Self::Ticket) -> Result { @@ -161,8 +156,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; } parameter_types! { @@ -195,6 +188,8 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + + type TransactionalProcessor = (); } pub type Precompiles = PrecompileSetBuilder< @@ -209,20 +204,16 @@ pub type Barrier = AllowUnpaidExecutionFrom; pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { - fn deposit_asset( - _what: &MultiAsset, - _who: &MultiLocation, - _context: Option<&XcmContext>, - ) -> XcmResult { + fn deposit_asset(_what: &Asset, _who: &Location, _context: Option<&XcmContext>) -> XcmResult { Ok(()) } fn withdraw_asset( - _what: &MultiAsset, - _who: &MultiLocation, + _what: &Asset, + _who: &Location, _maybe_context: Option<&XcmContext>, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } @@ -235,10 +226,10 @@ impl WeightTrader for DummyWeightTrader { fn buy_weight( &mut self, _weight: Weight, - _payment: Assets, + _payment: AssetsInHolding, _context: &XcmContext, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } @@ -302,10 +293,10 @@ impl pallet_timestamp::Config for Runtime { pub struct ConvertOriginToLocal; impl EnsureOrigin for ConvertOriginToLocal { - type Success = MultiLocation; + type Success = Location; - fn try_origin(_: Origin) -> Result { - Ok(MultiLocation::here()) + fn try_origin(_: Origin) -> Result { + Ok(Location::here()) } #[cfg(feature = "runtime-benchmarks")] @@ -333,65 +324,62 @@ impl AccountIdToCurrencyId for Runtime { } } -pub struct AccountIdToMultiLocation; -impl sp_runtime::traits::Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { +pub struct AccountIdToLocation; +impl sp_runtime::traits::Convert for AccountIdToLocation { + fn convert(account: AccountId) -> Location { let as_h160: H160 = account.into(); - MultiLocation::new( + Location::new( 1, - Junctions::X1(AccountKey20 { + [AccountKey20 { network: None, key: as_h160.as_fixed_bytes().clone(), - }), + }], ) } } parameter_types! { - pub Ancestry: MultiLocation = Parachain(ParachainId::get().into()).into(); + pub Ancestry: Location = Parachain(ParachainId::get().into()).into(); pub const BaseXcmWeight: XcmV2Weight = 1000; pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub const MaxAssetsForTransfer: usize = 2; - pub SelfLocation: MultiLocation = - MultiLocation::new(1, Junctions::X1(Parachain(ParachainId::get().into()))); + pub SelfLocation: Location = + Location::new(1, [Parachain(ParachainId::get().into())]); - pub SelfReserve: MultiLocation = MultiLocation::new( + pub SelfReserve: Location = Location::new( 1, - Junctions::X2( + [ Parachain(ParachainId::get().into()), PalletInstance( ::PalletInfo::index::().unwrap() as u8 ) - )); + ]); pub MaxInstructions: u32 = 100; } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } pub struct CurrencyIdToMultiLocation; -impl sp_runtime::traits::Convert> for CurrencyIdToMultiLocation { - fn convert(currency: CurrencyId) -> Option { +impl sp_runtime::traits::Convert> for CurrencyIdToMultiLocation { + fn convert(currency: CurrencyId) -> Option { match currency { CurrencyId::SelfReserve => { - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } // To distinguish between relay and others, specially for reserve asset CurrencyId::OtherReserve(asset) => { if asset == 0 { - Some(MultiLocation::parent()) + Some(Location::parent()) } else { - Some(MultiLocation::new( - 1, - Junctions::X2(Parachain(2), GeneralIndex(asset)), - )) + Some(Location::new(1, [Parachain(2), GeneralIndex(asset)])) } } } @@ -402,7 +390,7 @@ impl orml_xtokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = AccountIdToMultiLocation; + type AccountIdToLocation = AccountIdToLocation; type CurrencyIdConvert = CurrencyIdToMultiLocation; type XcmExecutor = XcmExecutor; type SelfLocation = SelfLocation; @@ -410,7 +398,7 @@ impl orml_xtokens::Config for Runtime { type BaseXcmWeight = BaseXcmWeight; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = AbsoluteReserveProvider; type UniversalLocation = UniversalLocation; } diff --git a/precompiles/gmp/src/types.rs b/precompiles/gmp/src/types.rs index 90e5318b5e..835c4adacd 100644 --- a/precompiles/gmp/src/types.rs +++ b/precompiles/gmp/src/types.rs @@ -20,21 +20,21 @@ use parity_scale_codec::{Decode, Encode}; use precompile_utils::prelude::*; use sp_core::{H256, U256}; use sp_std::vec::Vec; -use xcm::VersionedMultiLocation; +use xcm::VersionedLocation; // A user action which will attempt to route the transferred assets to the account/chain specified -// by the given MultiLocation. Recall that a MultiLocation can contain both a chain and an account +// by the given Location. Recall that a Location can contain both a chain and an account // on that chain, as this one should. #[derive(Encode, Decode, Debug)] pub struct XcmRoutingUserAction { - pub destination: VersionedMultiLocation, + pub destination: VersionedLocation, } // A user action which is the same as XcmRoutingUserAction but also allows a fee to be paid. The // fee is paid in the same asset being transferred, and must be <= the amount being sent. #[derive(Encode, Decode, Debug)] pub struct XcmRoutingUserActionWithFee { - pub destination: VersionedMultiLocation, + pub destination: VersionedLocation, pub fee: U256, } diff --git a/precompiles/identity/src/lib.rs b/precompiles/identity/src/lib.rs index 740cc5fd3b..74ba4e7f2d 100644 --- a/precompiles/identity/src/lib.rs +++ b/precompiles/identity/src/lib.rs @@ -20,13 +20,12 @@ extern crate alloc; -use enumflags2::BitFlags; use fp_evm::PrecompileHandle; use frame_support::dispatch::{GetDispatchInfo, PostDispatchInfo}; use frame_support::sp_runtime::traits::StaticLookup; use frame_support::traits::Currency; use pallet_evm::AddressMapping; -use pallet_identity::simple::IdentityField; +use pallet_identity::legacy::IdentityField; use parity_scale_codec::MaxEncodedLen; use precompile_utils::prelude::*; use sp_core::{ConstU32, Get, H160, H256, U256}; @@ -45,8 +44,7 @@ type BalanceOf = <::Currency as Currency< >>::Balance; type IdentityFieldOf = <::IdentityInformation - as pallet_identity::IdentityInformationProvider>::IdentityField; -type MaxAdditionalFieldsOf = ::MaxAdditionalFields; + as pallet_identity::IdentityInformationProvider>::FieldsIdentifier; /// Solidity selector of the Vote log, which is the Keccak of the Log signature. pub(crate) const SELECTOR_LOG_IDENTITY_SET: [u8; 32] = keccak256!("IdentitySet(address)"); @@ -65,17 +63,18 @@ pub(crate) const SELECTOR_LOG_SUB_IDENTITY_REVOKED: [u8; 32] = keccak256!("SubIdentityRevoked(address)"); /// A precompile to wrap the functionality from pallet-identity -pub struct IdentityPrecompile(PhantomData); +pub struct IdentityPrecompile( + PhantomData<(Runtime, MaxAdditionalFields)>, +); #[precompile_utils::precompile] -#[precompile::test_concrete_types(mock::Runtime)] -impl IdentityPrecompile +#[precompile::test_concrete_types(mock::Runtime, mock::MaxAdditionalFields)] +impl IdentityPrecompile where + MaxAdditionalFields: Get + 'static, Runtime: pallet_evm::Config + pallet_identity::Config< - IdentityInformation = pallet_identity::simple::IdentityInfo< - MaxAdditionalFieldsOf, - >, + IdentityInformation = pallet_identity::legacy::IdentityInfo, >, Runtime::AccountId: Into, Runtime::Hash: From, @@ -91,7 +90,7 @@ where #[precompile::public("setIdentity((((bool,bytes),(bool,bytes))[],(bool,bytes),(bool,bytes),(bool,bytes),(bool,bytes),(bool,bytes),bool,bytes,(bool,bytes),(bool,bytes)))")] fn set_identity( handle: &mut impl PrecompileHandle, - info: IdentityInfo, + info: IdentityInfo, ) -> EvmResult { // editorconfig-checker-enable let caller = handle.context().caller; @@ -103,9 +102,9 @@ where ); handle.record_log_costs(&[&event])?; - let call = pallet_identity::Call::::set_identity { - info: Self::identity_to_input(info)?, - }; + let info: Box = Self::identity_to_input(info)?; + + let call = pallet_identity::Call::::set_identity { info }; let origin = Runtime::AddressMapping::into_account_id(caller); RuntimeHelper::::try_dispatch(handle, Some(origin).into(), call, 0)?; @@ -237,8 +236,7 @@ where index: u32, fields: IdentityFields, ) -> EvmResult { - let fields = Self::identity_fields_to_input(fields) - .map_err(|_| RevertReason::custom("invalid flag").in_field("fields"))?; + let fields = Self::identity_fields_to_input(fields); let call = pallet_identity::Call::::set_fields { index, fields }; let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); @@ -371,7 +369,7 @@ where fn identity( handle: &mut impl PrecompileHandle, who: Address, - ) -> EvmResult> { + ) -> EvmResult> { // Storage item: IdentityOf -> // Registration, T::MaxRegistrars, T::MaxAdditionalFields> handle.record_db_read::(pallet_identity::Registration::< @@ -454,20 +452,29 @@ where .enumerate() .map(|(index, maybe_reg)| { if let Some(reg) = maybe_reg { + let fields: u64 = reg.fields.into(); Registrar { is_valid: true, index: index as u32, account: Address(reg.account.into()), fee: reg.fee.into(), fields: IdentityFields { - display: reg.fields.0.contains(IdentityField::Display), - legal: reg.fields.0.contains(IdentityField::Legal), - web: reg.fields.0.contains(IdentityField::Web), - riot: reg.fields.0.contains(IdentityField::Riot), - email: reg.fields.0.contains(IdentityField::Email), - pgp_fingerprint: reg.fields.0.contains(IdentityField::PgpFingerprint), - image: reg.fields.0.contains(IdentityField::Image), - twitter: reg.fields.0.contains(IdentityField::Twitter), + display: fields & (IdentityField::Display as u64) + == (IdentityField::Display as u64), + legal: fields & (IdentityField::Legal as u64) + == (IdentityField::Legal as u64), + web: fields & (IdentityField::Web as u64) + == (IdentityField::Web as u64), + riot: fields & (IdentityField::Riot as u64) + == (IdentityField::Riot as u64), + email: fields & (IdentityField::Email as u64) + == (IdentityField::Email as u64), + pgp_fingerprint: fields & (IdentityField::PgpFingerprint as u64) + == (IdentityField::PgpFingerprint as u64), + image: fields & (IdentityField::Image as u64) + == (IdentityField::Image as u64), + twitter: fields & (IdentityField::Twitter as u64) + == (IdentityField::Twitter as u64), }, } } else { @@ -483,12 +490,7 @@ where Ok(registrars) } - fn identity_fields_to_input( - fields: IdentityFields, - ) -> Result< - pallet_identity::IdentityFields>, - enumflags2::FromBitsError>, - > { + fn identity_fields_to_input(fields: IdentityFields) -> IdentityFieldOf { let mut field_bits = 0u64; if fields.display { field_bits = field_bits | IdentityField::Display as u64; @@ -515,18 +517,16 @@ where field_bits = field_bits | IdentityField::Twitter as u64; } - let bit_flags = BitFlags::>::from_bits(field_bits)?; - - Ok(pallet_identity::IdentityFields(bit_flags)) + IdentityFieldOf::::from(field_bits) } fn identity_to_input( - info: IdentityInfo, - ) -> MayRevert>> { + info: IdentityInfo, + ) -> MayRevert>> { // let additional: Vec<(pallet_identity::Data, pallet_identity::Data)> = info.additional.into(); let mut additional: sp_runtime::BoundedVec< (pallet_identity::Data, pallet_identity::Data), - Runtime::MaxAdditionalFields, + MaxAdditionalFields, > = Default::default(); let iter: Vec<_> = info.additional.into(); for (i, (k, v)) in iter.into_iter().enumerate() { @@ -550,7 +550,7 @@ where } else { None }; - let identity_info = pallet_identity::simple::IdentityInfo:: { + let identity_info = pallet_identity::legacy::IdentityInfo:: { additional, display: info .display @@ -587,20 +587,26 @@ where } fn identity_to_output( - registration: Option< + registration: Option<( pallet_identity::Registration< BalanceOf, Runtime::MaxRegistrars, Runtime::IdentityInformation, >, - >, - ) -> MayRevert> { + Option< + frame_support::BoundedVec< + u8, + ::MaxUsernameLength, + >, + >, + )>, + ) -> MayRevert> { if registration.is_none() { - return Ok(Registration::::default()); + return Ok(Registration::::default()); } - let registration = registration.expect("none case checked above; qed"); - let mut identity_info = IdentityInfo:: { + let registration = registration.expect("none case checked above; qed").0; + let mut identity_info = IdentityInfo:: { additional: Default::default(), display: Self::data_to_output(registration.info.display), legal: Self::data_to_output(registration.info.legal), @@ -632,7 +638,7 @@ where judgements.push((index, Self::judgement_to_output(judgement))); } - let reg = Registration:: { + let reg = Registration:: { is_valid: true, judgements: judgements.into(), deposit: registration.deposit.into(), diff --git a/precompiles/identity/src/mock.rs b/precompiles/identity/src/mock.rs index e1f84193f8..f6cbd57717 100644 --- a/precompiles/identity/src/mock.rs +++ b/precompiles/identity/src/mock.rs @@ -23,9 +23,12 @@ use frame_support::{ }; use frame_system::{EnsureRoot, EnsureSignedBy}; use pallet_evm::{EnsureAddressNever, EnsureAddressRoot}; -use pallet_identity::simple::IdentityInfo; +use pallet_identity::legacy::IdentityInfo; use precompile_utils::mock_account; -use precompile_utils::{precompile_set::*, testing::MockAccount}; +use precompile_utils::{ + precompile_set::*, + testing::{MockAccount, MockSignature}, +}; use sp_core::{H256, U256}; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, @@ -59,6 +62,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -95,7 +99,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -118,10 +121,12 @@ parameter_types! { }; } -pub type Precompiles = - PrecompileSetBuilder, IdentityPrecompile>,)>; +pub type Precompiles = PrecompileSetBuilder< + R, + (PrecompileAt, IdentityPrecompile>,), +>; -pub type PCall = IdentityPrecompileCall; +pub type PCall = IdentityPrecompileCall; impl pallet_evm::Config for Runtime { type FeeCalculator = (); @@ -172,7 +177,7 @@ type EnsureRegistrarAndForceOriginOrRoot = parameter_types! { pub const BasicDeposit: u64 = 10; - pub const FieldDeposit: u64 = 10; + pub const ByteDeposit: u64 = 10; pub const SubAccountDeposit: u64 = 10; pub const MaxSubAccounts: u32 = 2; pub const MaxAdditionalFields: u32 = 2; @@ -187,16 +192,21 @@ impl pallet_identity::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type BasicDeposit = BasicDeposit; - type FieldDeposit = FieldDeposit; + type ByteDeposit = ByteDeposit; type SubAccountDeposit = SubAccountDeposit; type MaxSubAccounts = MaxSubAccounts; - type MaxAdditionalFields = MaxAdditionalFields; + type IdentityInformation = IdentityInfo; type MaxRegistrars = MaxRegistrars; type Slashed = (); type RegistrarOrigin = EnsureRegistrarAndForceOriginOrRoot; type ForceOrigin = EnsureRegistrarAndForceOriginOrRoot; + type OffchainSignature = MockSignature; + type SigningPublicKey = ::Signer; + type UsernameAuthorityOrigin = EnsureRoot; + type PendingUsernameExpiration = ConstU32<100>; + type MaxSuffixLength = ConstU32<7>; + type MaxUsernameLength = ConstU32<32>; type WeightInfo = (); - type IdentityInformation = IdentityInfo; } pub(crate) struct ExtBuilder { diff --git a/precompiles/identity/src/tests.rs b/precompiles/identity/src/tests.rs index 7139da182b..4641c1ef59 100644 --- a/precompiles/identity/src/tests.rs +++ b/precompiles/identity/src/tests.rs @@ -26,8 +26,9 @@ use crate::{ use frame_support::assert_ok; use pallet_evm::{Call as EvmCall, Event as EvmEvent}; use pallet_identity::{ - simple::IdentityField, Event as IdentityEvent, Pallet as IdentityPallet, RegistrarInfo, + legacy::IdentityField, Event as IdentityEvent, Pallet as IdentityPallet, RegistrarInfo, }; +use parity_scale_codec::Encode; use precompile_utils::prelude::*; use precompile_utils::testing::*; use sp_core::{H160, U256}; @@ -82,7 +83,7 @@ fn test_set_fee_on_existing_registrar_index_succeeds() { vec![Some(RegistrarInfo { account: Bob.into(), fee: 100, - fields: pallet_identity::IdentityFields::default(), + fields: Default::default(), })] ); }) @@ -132,7 +133,7 @@ fn test_set_account_id_on_existing_registrar_index_succeeds() { vec![Some(RegistrarInfo { account: Charlie.into(), fee: 0, - fields: pallet_identity::IdentityFields::default(), + fields: Default::default(), })] ); }) @@ -186,9 +187,7 @@ fn test_set_fields_on_existing_registrar_index_succeeds() { vec![Some(RegistrarInfo { account: Bob.into(), fee: 0, - fields: pallet_identity::IdentityFields( - IdentityField::Display | IdentityField::Web - ), + fields: IdentityField::Display as u64 | IdentityField::Web as u64, })] ); }) @@ -302,12 +301,16 @@ fn test_set_identity_works() { .into() )); + let identity = + >::identity(AccountId::from(Bob)).expect("exists"); + let encoded_byte_size = identity.0.info.encoded_size() as u32; + let byte_deposit = ByteDeposit::get().saturating_mul(encoded_byte_size as u64); assert_eq!( - >::identity(AccountId::from(Bob)), - Some(pallet_identity::Registration:: { + identity.0, + pallet_identity::Registration:: { judgements: Default::default(), - deposit: BasicDeposit::get() as u128 + FieldDeposit::get() as u128 * 2, - info: pallet_identity::simple::IdentityInfo:: { + deposit: (BasicDeposit::get() + byte_deposit).into(), + info: pallet_identity::legacy::IdentityInfo:: { additional: vec![ ( pallet_identity::Data::Raw( @@ -341,7 +344,7 @@ fn test_set_identity_works() { vec![0x08].try_into().expect("succeeds") ), } - }), + }, ); }) } @@ -409,12 +412,16 @@ fn test_set_identity_works_for_already_set_identity() { .into() )); + let identity = + >::identity(AccountId::from(Bob)).expect("exists"); + let encoded_byte_size = identity.0.info.encoded_size() as u32; + let byte_deposit = ByteDeposit::get().saturating_mul(encoded_byte_size as u64); assert_eq!( - >::identity(AccountId::from(Bob)), - Some(pallet_identity::Registration:: { + identity.0, + pallet_identity::Registration:: { judgements: Default::default(), - deposit: BasicDeposit::get() as u128, - info: pallet_identity::simple::IdentityInfo:: { + deposit: (BasicDeposit::get() + byte_deposit) as u128, + info: pallet_identity::legacy::IdentityInfo:: { additional: Default::default(), display: pallet_identity::Data::Raw( vec![0x01].try_into().expect("succeeds") @@ -429,7 +436,7 @@ fn test_set_identity_works_for_already_set_identity() { vec![0x08].try_into().expect("succeeds") ), } - }), + }, ); assert_ok!(RuntimeCall::Evm(evm_call( @@ -447,12 +454,16 @@ fn test_set_identity_works_for_already_set_identity() { )) .dispatch(RuntimeOrigin::root())); + let identity = + >::identity(AccountId::from(Bob)).expect("exists"); + let encoded_byte_size = identity.0.info.encoded_size() as u32; + let byte_deposit = ByteDeposit::get().saturating_mul(encoded_byte_size as u64); assert_eq!( - >::identity(AccountId::from(Bob)), - Some(pallet_identity::Registration:: { + identity.0, + pallet_identity::Registration:: { judgements: Default::default(), - deposit: BasicDeposit::get() as u128, - info: pallet_identity::simple::IdentityInfo:: { + deposit: (BasicDeposit::get() + byte_deposit).into(), + info: pallet_identity::legacy::IdentityInfo:: { additional: Default::default(), display: pallet_identity::Data::Raw( vec![0xff].try_into().expect("succeeds") @@ -465,7 +476,7 @@ fn test_set_identity_works_for_already_set_identity() { image: pallet_identity::Data::None, twitter: pallet_identity::Data::None, } - }), + }, ); }) } @@ -491,12 +502,16 @@ fn test_set_subs_works_if_identity_set() { )) .dispatch(RuntimeOrigin::root())); + let identity = + >::identity(AccountId::from(Bob)).expect("exists"); + let encoded_byte_size = identity.0.info.encoded_size() as u32; + let byte_deposit = ByteDeposit::get().saturating_mul(encoded_byte_size as u64); assert_eq!( - >::identity(AccountId::from(Bob)), - Some(pallet_identity::Registration:: { + identity.0, + pallet_identity::Registration:: { judgements: Default::default(), - deposit: BasicDeposit::get() as u128, - info: pallet_identity::simple::IdentityInfo:: { + deposit: (BasicDeposit::get() + byte_deposit).into(), + info: pallet_identity::legacy::IdentityInfo:: { additional: Default::default(), display: pallet_identity::Data::Raw( vec![0x01].try_into().expect("succeeds") @@ -509,7 +524,7 @@ fn test_set_subs_works_if_identity_set() { image: pallet_identity::Data::None, twitter: pallet_identity::Data::None, } - }), + }, ); assert_ok!(RuntimeCall::Evm(evm_call( @@ -610,12 +625,16 @@ fn test_clear_identity_works_if_identity_set() { )) .dispatch(RuntimeOrigin::root())); + let identity = + >::identity(AccountId::from(Bob)).expect("exists"); + let encoded_byte_size = identity.0.info.encoded_size() as u32; + let byte_deposit = ByteDeposit::get().saturating_mul(encoded_byte_size as u64); assert_eq!( - >::identity(AccountId::from(Bob)), - Some(pallet_identity::Registration:: { + identity.0, + pallet_identity::Registration:: { judgements: Default::default(), - deposit: BasicDeposit::get() as u128, - info: pallet_identity::simple::IdentityInfo:: { + deposit: (BasicDeposit::get() + byte_deposit).into(), + info: pallet_identity::legacy::IdentityInfo:: { additional: Default::default(), display: pallet_identity::Data::Raw( vec![0x01].try_into().expect("succeeds") @@ -628,7 +647,7 @@ fn test_clear_identity_works_if_identity_set() { image: pallet_identity::Data::None, twitter: pallet_identity::Data::None, } - }), + }, ); assert_ok!( @@ -639,7 +658,7 @@ fn test_clear_identity_works_if_identity_set() { assert!(events().contains(&Into::::into( IdentityEvent::IdentityCleared { who: Bob.into(), - deposit: BasicDeposit::get() as u128, + deposit: (BasicDeposit::get() + byte_deposit).into(), } ))); assert!(events().contains( @@ -752,6 +771,7 @@ fn test_request_judgement_works_if_identity_set() { assert_eq!( >::identity(AccountId::from(Bob)) .expect("exists") + .0 .judgements .to_vec(), vec![(0, pallet_identity::Judgement::FeePaid(100))], @@ -836,6 +856,7 @@ fn test_cancel_request_works_if_identity_judgement_requested() { assert_eq!( >::identity(AccountId::from(Bob)) .expect("exists") + .0 .judgements .to_vec(), vec![], @@ -894,7 +915,7 @@ fn test_provide_judgement_works_if_identity_judgement_requested() { let identity = pallet_identity::Registration:: { judgements: Default::default(), deposit: BasicDeposit::get() as u128, - info: pallet_identity::simple::IdentityInfo:: { + info: pallet_identity::legacy::IdentityInfo:: { additional: Default::default(), display: pallet_identity::Data::Raw(vec![0x01].try_into().expect("succeeds")), legal: pallet_identity::Data::None, @@ -909,7 +930,8 @@ fn test_provide_judgement_works_if_identity_judgement_requested() { assert_eq!( >::identity(AccountId::from(Bob)) - .expect("") + .expect("exists") + .0 .info, identity.info ); @@ -952,6 +974,7 @@ fn test_provide_judgement_works_if_identity_judgement_requested() { assert_eq!( >::identity(AccountId::from(Bob)) .expect("exists") + .0 .judgements .to_vec(), vec![(0, pallet_identity::Judgement::Reasonable)], @@ -1247,46 +1270,35 @@ fn test_identity_returns_valid_data_for_identity_info() { .with_balances(vec![(Alice.into(), 100_000), (Bob.into(), 100_000)]) .build() .execute_with(|| { + let identity = pallet_identity::legacy::IdentityInfo:: { + additional: vec![ + ( + pallet_identity::Data::Raw(vec![0xa1].try_into().expect("succeeds")), + pallet_identity::Data::Raw(vec![0xb1].try_into().expect("succeeds")), + ), + ( + pallet_identity::Data::Raw(vec![0xa2].try_into().expect("succeeds")), + pallet_identity::Data::Raw(vec![0xb2].try_into().expect("succeeds")), + ), + ] + .try_into() + .expect("succeeds"), + display: pallet_identity::Data::Raw(vec![0x01].try_into().expect("succeeds")), + legal: pallet_identity::Data::Raw(vec![0x02].try_into().expect("succeeds")), + web: pallet_identity::Data::Raw(vec![0x03].try_into().expect("succeeds")), + riot: pallet_identity::Data::Raw(vec![0x04].try_into().expect("succeeds")), + email: pallet_identity::Data::Raw(vec![0x05].try_into().expect("succeeds")), + pgp_fingerprint: Some([0x06; 20].try_into().expect("succeeds")), + image: pallet_identity::Data::Raw(vec![0x07].try_into().expect("succeeds")), + twitter: pallet_identity::Data::Raw(vec![0x08].try_into().expect("succeeds")), + }; assert_ok!(Identity::set_identity( RuntimeOrigin::signed(Bob.into()), - Box::new( - pallet_identity::simple::IdentityInfo:: { - additional: vec![ - ( - pallet_identity::Data::Raw( - vec![0xa1].try_into().expect("succeeds") - ), - pallet_identity::Data::Raw( - vec![0xb1].try_into().expect("succeeds") - ) - ), - ( - pallet_identity::Data::Raw( - vec![0xa2].try_into().expect("succeeds") - ), - pallet_identity::Data::Raw( - vec![0xb2].try_into().expect("succeeds") - ) - ), - ] - .try_into() - .expect("succeeds"), - display: pallet_identity::Data::Raw( - vec![0x01].try_into().expect("succeeds") - ), - legal: pallet_identity::Data::Raw(vec![0x02].try_into().expect("succeeds")), - web: pallet_identity::Data::Raw(vec![0x03].try_into().expect("succeeds")), - riot: pallet_identity::Data::Raw(vec![0x04].try_into().expect("succeeds")), - email: pallet_identity::Data::Raw(vec![0x05].try_into().expect("succeeds")), - pgp_fingerprint: Some([0x06; 20].try_into().expect("succeeds")), - image: pallet_identity::Data::Raw(vec![0x07].try_into().expect("succeeds")), - twitter: pallet_identity::Data::Raw( - vec![0x08].try_into().expect("succeeds") - ), - } - ) + Box::new(identity.clone()) )); + let encoded_byte_size = identity.encoded_size() as u32; + let byte_deposit = ByteDeposit::get().saturating_mul(encoded_byte_size as u64); precompiles() .prepare_test( Bob, @@ -1299,7 +1311,7 @@ fn test_identity_returns_valid_data_for_identity_info() { .execute_returns(Registration { is_valid: true, judgements: vec![], - deposit: (BasicDeposit::get() + FieldDeposit::get() * 2).into(), + deposit: (BasicDeposit::get() + byte_deposit).into(), info: IdentityInfo:: { additional: vec![ ( @@ -1375,23 +1387,22 @@ fn test_identity_returns_valid_data_for_requested_judgement() { 0, 100, )); + + let identity = pallet_identity::legacy::IdentityInfo:: { + additional: Default::default(), + display: pallet_identity::Data::Raw(vec![0x01].try_into().expect("succeeds")), + legal: pallet_identity::Data::None, + web: pallet_identity::Data::None, + riot: pallet_identity::Data::None, + email: pallet_identity::Data::None, + pgp_fingerprint: None, + image: pallet_identity::Data::None, + twitter: pallet_identity::Data::None, + }; + assert_ok!(Identity::set_identity( RuntimeOrigin::signed(Bob.into()), - Box::new( - pallet_identity::simple::IdentityInfo:: { - additional: Default::default(), - display: pallet_identity::Data::Raw( - vec![0x01].try_into().expect("succeeds") - ), - legal: pallet_identity::Data::None, - web: pallet_identity::Data::None, - riot: pallet_identity::Data::None, - email: pallet_identity::Data::None, - pgp_fingerprint: None, - image: pallet_identity::Data::None, - twitter: pallet_identity::Data::None, - } - ), + Box::new(identity.clone()), )); assert_ok!(Identity::request_judgement( RuntimeOrigin::signed(Bob.into()), @@ -1399,6 +1410,8 @@ fn test_identity_returns_valid_data_for_requested_judgement() { 1000, )); + let encoded_byte_size = identity.encoded_size() as u32; + let byte_deposit = ByteDeposit::get().saturating_mul(encoded_byte_size as u64); precompiles() .prepare_test( Bob, @@ -1418,7 +1431,7 @@ fn test_identity_returns_valid_data_for_requested_judgement() { ..Default::default() }, )], - deposit: BasicDeposit::get().into(), + deposit: (BasicDeposit::get() + byte_deposit).into(), info: IdentityInfo:: { additional: Default::default(), display: Data { @@ -1498,7 +1511,7 @@ fn test_identity_returns_valid_data_for_judged_identity() { RuntimeOrigin::signed(RegistrarAndForceOrigin.into()), Alice.into(), )); - let identity = pallet_identity::simple::IdentityInfo:: { + let identity = pallet_identity::legacy::IdentityInfo:: { additional: Default::default(), display: pallet_identity::Data::Raw(vec![0x01].try_into().expect("succeeds")), legal: pallet_identity::Data::None, @@ -1513,7 +1526,7 @@ fn test_identity_returns_valid_data_for_judged_identity() { assert_ok!(Identity::set_identity( RuntimeOrigin::signed(Bob.into()), - Box::new(identity), + Box::new(identity.clone()), )); assert_ok!(Identity::request_judgement( RuntimeOrigin::signed(Bob.into()), @@ -1528,6 +1541,8 @@ fn test_identity_returns_valid_data_for_judged_identity() { identity_hash, )); + let encoded_byte_size = identity.encoded_size() as u32; + let byte_deposit = ByteDeposit::get().saturating_mul(encoded_byte_size as u64); precompiles() .prepare_test( Bob, @@ -1540,7 +1555,7 @@ fn test_identity_returns_valid_data_for_judged_identity() { .execute_returns(Registration { is_valid: true, judgements: vec![(0, test_case.expected_judgement)], - deposit: BasicDeposit::get().into(), + deposit: (BasicDeposit::get() + byte_deposit).into(), info: IdentityInfo:: { additional: Default::default(), display: Data { @@ -1570,7 +1585,7 @@ fn test_super_of_returns_empty_if_not_set() { assert_ok!(Identity::set_identity( RuntimeOrigin::signed(Bob.into()), Box::new( - pallet_identity::simple::IdentityInfo:: { + pallet_identity::legacy::IdentityInfo:: { additional: Default::default(), display: pallet_identity::Data::Raw( vec![0x01].try_into().expect("succeeds") @@ -1611,7 +1626,7 @@ fn test_super_of_returns_account_if_set() { assert_ok!(Identity::set_identity( RuntimeOrigin::signed(Bob.into()), Box::new( - pallet_identity::simple::IdentityInfo:: { + pallet_identity::legacy::IdentityInfo:: { additional: Default::default(), display: pallet_identity::Data::Raw( vec![0x01].try_into().expect("succeeds") @@ -1661,7 +1676,7 @@ fn test_subs_of_returns_empty_if_not_set() { assert_ok!(Identity::set_identity( RuntimeOrigin::signed(Bob.into()), Box::new( - pallet_identity::simple::IdentityInfo:: { + pallet_identity::legacy::IdentityInfo:: { additional: Default::default(), display: pallet_identity::Data::Raw( vec![0x01].try_into().expect("succeeds") @@ -1702,7 +1717,7 @@ fn test_subs_of_returns_account_if_set() { assert_ok!(Identity::set_identity( RuntimeOrigin::signed(Bob.into()), Box::new( - pallet_identity::simple::IdentityInfo:: { + pallet_identity::legacy::IdentityInfo:: { additional: Default::default(), display: pallet_identity::Data::Raw( vec![0x01].try_into().expect("succeeds") diff --git a/precompiles/parachain-staking/src/mock.rs b/precompiles/parachain-staking/src/mock.rs index 0dcb75d292..af20411be7 100644 --- a/precompiles/parachain-staking/src/mock.rs +++ b/precompiles/parachain-staking/src/mock.rs @@ -64,6 +64,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -101,7 +102,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/precompile-registry/src/mock.rs b/precompiles/precompile-registry/src/mock.rs index 3dd055f062..4caeaa6b5b 100644 --- a/precompiles/precompile-registry/src/mock.rs +++ b/precompiles/precompile-registry/src/mock.rs @@ -54,6 +54,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -90,7 +91,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/preimage/src/mock.rs b/precompiles/preimage/src/mock.rs index f573a0e537..5dc9ceada4 100644 --- a/precompiles/preimage/src/mock.rs +++ b/precompiles/preimage/src/mock.rs @@ -53,6 +53,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -89,7 +90,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/proxy/src/mock.rs b/precompiles/proxy/src/mock.rs index fc1a9a8898..a8b4038ef5 100644 --- a/precompiles/proxy/src/mock.rs +++ b/precompiles/proxy/src/mock.rs @@ -61,6 +61,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -97,7 +98,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/randomness/src/mock.rs b/precompiles/randomness/src/mock.rs index 889c4178d7..06e6c9aa9f 100644 --- a/precompiles/randomness/src/mock.rs +++ b/precompiles/randomness/src/mock.rs @@ -56,6 +56,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -93,7 +94,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/referenda/src/mock.rs b/precompiles/referenda/src/mock.rs index 978cc92bd5..20b9f97de3 100644 --- a/precompiles/referenda/src/mock.rs +++ b/precompiles/referenda/src/mock.rs @@ -64,6 +64,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -101,7 +102,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/relay-data-verifier/src/mock.rs b/precompiles/relay-data-verifier/src/mock.rs index a8dc67ea93..c8c0b8465c 100644 --- a/precompiles/relay-data-verifier/src/mock.rs +++ b/precompiles/relay-data-verifier/src/mock.rs @@ -55,6 +55,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -93,7 +94,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/relay-encoder/Cargo.toml b/precompiles/relay-encoder/Cargo.toml index 89783c6ba2..47fa06593c 100644 --- a/precompiles/relay-encoder/Cargo.toml +++ b/precompiles/relay-encoder/Cargo.toml @@ -19,14 +19,14 @@ xcm-primitives = { workspace = true } frame-support = { workspace = true } frame-system = { workspace = true } pallet-staking = { workspace = true } -parity-scale-codec = { workspace = true, features = [ "derive" ] } +parity-scale-codec = { workspace = true, features = ["derive"] } sp-core = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } # Frontier fp-evm = { workspace = true } -pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] } +pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] } # Cumulus cumulus-primitives-core = { workspace = true } @@ -38,32 +38,34 @@ serde = { workspace = true } sha3 = { workspace = true } # Moonbeam -precompile-utils = { workspace = true, features = [ "testing" ] } +precompile-utils = { workspace = true, features = ["std", "testing"] } # Substrate -pallet-balances = { workspace = true } -pallet-timestamp = { workspace = true } -scale-info = { workspace = true, features = [ "derive" ] } -sp-io = { workspace = true } +pallet-balances = { workspace = true, features = ["std"] } +pallet-timestamp = { workspace = true, features = ["std"] } +pallet-message-queue = { workspace = true, features = ["std"] } +scale-info = { workspace = true, features = ["std", "derive"] } +sp-io = { workspace = true, features = ["std"] } # Cumulus -cumulus-pallet-parachain-system = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true, features = ["std"] } # Polkadot -xcm = { workspace = true } -xcm-builder = { workspace = true } -xcm-executor = { workspace = true } +xcm = { workspace = true, features = ["std"] } +xcm-builder = { workspace = true, features = ["std"] } +xcm-executor = { workspace = true, features = ["std"] } # ORML -orml-traits = { workspace = true } +orml-traits = { workspace = true, features = ["std"] } [features] -default = [ "std" ] +default = ["std"] std = [ "cumulus-primitives-core/std", "fp-evm/std", "frame-support/std", "frame-system/std", + "sp-core/std", "pallet-evm/std", "pallet-staking/std", "pallet-xcm-transactor/std", diff --git a/precompiles/relay-encoder/src/lib.rs b/precompiles/relay-encoder/src/lib.rs index 9f529f4942..ea06db0f9b 100644 --- a/precompiles/relay-encoder/src/lib.rs +++ b/precompiles/relay-encoder/src/lib.rs @@ -417,6 +417,8 @@ impl solidity::Codec for RewardDestinationWrapper { match enum_selector[0] { 0u8 => Ok(RewardDestinationWrapper(RewardDestination::Staked)), 1u8 => Ok(RewardDestinationWrapper(RewardDestination::Stash)), + // Deprecated in https://github.com/paritytech/polkadot-sdk/pull/2380 + #[allow(deprecated)] 2u8 => Ok(RewardDestinationWrapper(RewardDestination::Controller)), 3u8 => { let address = encoded_reward_destination.read::()?; @@ -440,6 +442,8 @@ impl solidity::Codec for RewardDestinationWrapper { encoded.push(1); encoded.as_slice().into() } + // Deprecated in https://github.com/paritytech/polkadot-sdk/pull/2380 + #[allow(deprecated)] RewardDestination::Controller => { encoded.push(2); encoded.as_slice().into() diff --git a/precompiles/relay-encoder/src/mock.rs b/precompiles/relay-encoder/src/mock.rs index c3c8c8d110..15bfc3a0ba 100644 --- a/precompiles/relay-encoder/src/mock.rs +++ b/precompiles/relay-encoder/src/mock.rs @@ -17,6 +17,7 @@ //! Test utilities use super::*; +use cumulus_primitives_core::AggregateMessageOrigin; use frame_support::{ construct_runtime, parameter_types, traits::{Everything, PalletInfo as PalletInfoTrait}, @@ -33,7 +34,7 @@ use sp_runtime::{ }; use xcm::latest::{prelude::*, Error as XcmError}; use xcm_builder::FixedWeightBounds; -use xcm_executor::{traits::TransactAsset, Assets}; +use xcm_executor::{traits::TransactAsset, AssetsInHolding}; pub type AccountId = MockAccount; pub type Balance = u128; @@ -49,6 +50,7 @@ construct_runtime!( ParachainSystem: cumulus_pallet_parachain_system, Timestamp: pallet_timestamp, XcmTransactor: pallet_xcm_transactor, + MessageQueue: pallet_message_queue, } ); @@ -60,6 +62,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -84,6 +87,7 @@ impl frame_system::Config for Runtime { parameter_types! { pub ParachainId: cumulus_primitives_core::ParaId = 100.into(); + pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; } impl cumulus_pallet_parachain_system::Config for Runtime { @@ -93,10 +97,30 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type OutboundXcmpMessageSource = (); type XcmpMessageHandler = (); type ReservedXcmpWeight = (); - type DmpMessageHandler = (); + type DmpQueue = frame_support::traits::EnqueueWithOrigin; type ReservedDmpWeight = (); type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; type ConsensusHook = cumulus_pallet_parachain_system::ExpectParentIncluded; + type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight; +} + +parameter_types! { + pub MessageQueueServiceWeight: Weight = Weight::from_parts(1_000_000_000, 1_000_000); + pub const MessageQueueHeapSize: u32 = 65_536; + pub const MessageQueueMaxStale: u32 = 16; +} + +impl pallet_message_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Size = u32; + type HeapSize = MessageQueueHeapSize; + type MaxStale = MessageQueueMaxStale; + type ServiceWeight = MessageQueueServiceWeight; + type MessageProcessor = + pallet_message_queue::mock_helpers::NoopMessageProcessor; + type QueueChangeHandler = (); + type WeightInfo = (); + type QueuePausedQuery = (); } parameter_types! { @@ -114,7 +138,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -132,10 +155,10 @@ impl SendXcm for DoNothingRouter { type Ticket = (); fn validate( - _destination: &mut Option, + _destination: &mut Option, _message: &mut Option>, ) -> SendResult { - Ok(((), MultiAssets::new())) + Ok(((), Assets::new())) } fn deliver(_: Self::Ticket) -> Result { @@ -144,59 +167,56 @@ impl SendXcm for DoNothingRouter { } parameter_types! { - pub Ancestry: MultiLocation = Parachain(ParachainId::get().into()).into(); + pub Ancestry: Location = Parachain(ParachainId::get().into()).into(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub SelfLocation: MultiLocation = - MultiLocation::new(1, Junctions::X1(Parachain(ParachainId::get().into()))); + pub SelfLocation: Location = + Location::new(1, [Parachain(ParachainId::get().into())]); - pub SelfReserve: MultiLocation = MultiLocation::new( + pub SelfReserve: Location = Location::new( 1, - Junctions::X2( + [ Parachain(ParachainId::get().into()), PalletInstance( ::PalletInfo::index::().unwrap() as u8 ) - )); + ]); pub MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = Here; + pub UniversalLocation: InteriorLocation = Here; } -pub struct AccountIdToMultiLocation; -impl sp_runtime::traits::Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { +pub struct AccountIdToLocation; +impl sp_runtime::traits::Convert for AccountIdToLocation { + fn convert(account: AccountId) -> Location { let as_h160: H160 = account.into(); - MultiLocation::new( + Location::new( 0, - Junctions::X1(AccountKey20 { + [AccountKey20 { network: None, key: as_h160.as_fixed_bytes().clone(), - }), + }], ) } } -pub struct CurrencyIdToMultiLocation; +pub struct CurrencyIdToLocation; -impl sp_runtime::traits::Convert> for CurrencyIdToMultiLocation { - fn convert(currency: CurrencyId) -> Option { +impl sp_runtime::traits::Convert> for CurrencyIdToLocation { + fn convert(currency: CurrencyId) -> Option { match currency { CurrencyId::SelfReserve => { - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } // To distinguish between relay and others, specially for reserve asset CurrencyId::OtherReserve(asset) => { if asset == 0 { - Some(MultiLocation::parent()) + Some(Location::parent()) } else { - Some(MultiLocation::new( - 1, - Junctions::X2(Parachain(2), GeneralIndex(asset)), - )) + Some(Location::new(1, [Parachain(2), GeneralIndex(asset)])) } } } @@ -249,29 +269,25 @@ impl xcm_primitives::UtilityEncodeCall for MockTransactors { } impl xcm_primitives::XcmTransact for MockTransactors { - fn destination(self) -> MultiLocation { + fn destination(self) -> Location { match self { - MockTransactors::Relay => MultiLocation::parent(), + MockTransactors::Relay => Location::parent(), } } } pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { - fn deposit_asset( - _what: &MultiAsset, - _who: &MultiLocation, - _context: Option<&XcmContext>, - ) -> XcmResult { + fn deposit_asset(_what: &Asset, _who: &Location, _context: Option<&XcmContext>) -> XcmResult { Ok(()) } fn withdraw_asset( - _what: &MultiAsset, - _who: &MultiLocation, + _what: &Asset, + _who: &Location, _maybe_context: Option<&XcmContext>, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } @@ -282,8 +298,8 @@ impl pallet_xcm_transactor::Config for Runtime { type DerivativeAddressRegistrationOrigin = frame_system::EnsureRoot; type SovereignAccountDispatcherOrigin = frame_system::EnsureRoot; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type CurrencyIdToMultiLocation = CurrencyIdToMultiLocation; + type AccountIdToLocation = AccountIdToLocation; + type CurrencyIdToLocation = CurrencyIdToLocation; type SelfLocation = SelfLocation; type Weigher = FixedWeightBounds; type UniversalLocation = UniversalLocation; diff --git a/precompiles/relay-encoder/src/tests.rs b/precompiles/relay-encoder/src/tests.rs index 2d49a64d41..41929bddd4 100644 --- a/precompiles/relay-encoder/src/tests.rs +++ b/precompiles/relay-encoder/src/tests.rs @@ -80,6 +80,7 @@ fn no_selector_exists_but_length_is_right() { #[test] fn test_encode_bond() { + let controller = sp_runtime::AccountId32::from([0; 32]); ExtBuilder::default() .with_balances(vec![(Alice.into(), 1000)]) .build() @@ -90,7 +91,9 @@ fn test_encode_bond() { Precompile1, PCall::encode_bond { amount: 100.into(), - reward_destination: RewardDestinationWrapper(RewardDestination::Controller), + reward_destination: RewardDestinationWrapper(RewardDestination::Account( + controller.clone(), + )), }, ) .expect_cost(1000) @@ -98,7 +101,7 @@ fn test_encode_bond() { .execute_returns(UnboundedBytes::from( TestEncoder::encode_call(AvailableStakeCalls::Bond( 100u32.into(), - RewardDestination::Controller, + RewardDestination::Account(controller), )) .as_slice(), )); @@ -206,6 +209,7 @@ fn test_encode_set_controller() { #[test] fn test_encode_set_payee() { + let controller = sp_runtime::AccountId32::from([0; 32]); ExtBuilder::default() .with_balances(vec![(Alice.into(), 1000)]) .build() @@ -215,14 +219,16 @@ fn test_encode_set_payee() { Alice, Precompile1, PCall::encode_set_payee { - reward_destination: RewardDestinationWrapper(RewardDestination::Controller), + reward_destination: RewardDestinationWrapper(RewardDestination::Account( + controller.clone(), + )), }, ) .expect_cost(1000) .expect_no_logs() .execute_returns(UnboundedBytes::from( TestEncoder::encode_call(AvailableStakeCalls::SetPayee( - RewardDestination::Controller, + RewardDestination::Account(controller), )) .as_slice(), )); diff --git a/precompiles/utils/src/solidity/codec/xcm.rs b/precompiles/utils/src/solidity/codec/xcm.rs index 58b2b064fc..a02f128175 100644 --- a/precompiles/utils/src/solidity/codec/xcm.rs +++ b/precompiles/utils/src/solidity/codec/xcm.rs @@ -26,7 +26,7 @@ use { sp_core::H256, sp_std::vec::Vec, sp_weights::Weight, - xcm::latest::{Junction, Junctions, MultiLocation, NetworkId}, + xcm::latest::{Junction, Junctions, Location, NetworkId}, }; pub const JUNCTION_SIZE_LIMIT: u32 = 2u32.pow(16); @@ -38,7 +38,7 @@ pub const JUNCTION_SIZE_LIMIT: u32 = 2u32.pow(16); // The first byte represents the enum variant to be used. // - Indexes 0,2,3 represent XCM V2 variants // - Index 1 changes name in V3 (`ByGenesis`), but is compatible with V2 `Named` -// - Indexes 4~10 represent new XCM V3 variants +// - Indexes 4~11 represent new XCM V3 variants // The rest of the bytes (if any), represent the additional data that such enum variant requires // In such a case, since NetworkIds will be appended at the end, we will read the buffer until the // end to recover the name @@ -106,6 +106,11 @@ pub(crate) fn network_id_to_bytes(network_id: Option) -> Vec { encoded.push(9u8); encoded } + Some(NetworkId::PolkadotBulletin) => { + encoded.push(11u8); + encoded.push(10u8); + encoded + } } } @@ -349,12 +354,12 @@ impl Codec for Junctions { } // Cannot used derive macro since it is a foreign struct. -impl Codec for MultiLocation { +impl Codec for Location { fn read(reader: &mut Reader) -> MayRevert { let (parents, interior) = reader .read() .map_in_tuple_to_field(&["parents", "interior"])?; - Ok(MultiLocation { parents, interior }) + Ok(Location { parents, interior }) } fn write(writer: &mut Writer, value: Self) { diff --git a/precompiles/utils/src/testing/account.rs b/precompiles/utils/src/testing/account.rs index acc0010ab2..af6ce14b92 100644 --- a/precompiles/utils/src/testing/account.rs +++ b/precompiles/utils/src/testing/account.rs @@ -105,6 +105,78 @@ impl sp_runtime::traits::Convert for MockAccount { } } +#[derive( + Eq, PartialEq, Clone, Encode, Decode, sp_core::RuntimeDebug, TypeInfo, Serialize, Deserialize, +)] +pub struct MockSignature(sp_core::ecdsa::Signature); + +impl From for MockSignature { + fn from(x: sp_core::ecdsa::Signature) -> Self { + MockSignature(x) + } +} + +impl From for MockSignature { + fn from(signature: sp_runtime::MultiSignature) -> Self { + match signature { + sp_runtime::MultiSignature::Ed25519(_) => { + panic!("Ed25519 not supported for MockSignature") + } + sp_runtime::MultiSignature::Sr25519(_) => { + panic!("Sr25519 not supported for MockSignature") + } + sp_runtime::MultiSignature::Ecdsa(sig) => Self(sig), + } + } +} + +impl sp_runtime::traits::Verify for MockSignature { + type Signer = MockSigner; + fn verify>(&self, mut msg: L, signer: &MockAccount) -> bool { + let mut m = [0u8; 32]; + m.copy_from_slice(::digest(msg.get()).as_slice()); + match sp_io::crypto::secp256k1_ecdsa_recover(self.0.as_ref(), &m) { + Ok(pubkey) => { + MockAccount(sp_core::H160::from_slice( + &::digest(pubkey).as_slice()[12..32], + )) == *signer + } + Err(sp_io::EcdsaVerifyError::BadRS) => { + log::error!(target: "evm", "Error recovering: Incorrect value of R or S"); + false + } + Err(sp_io::EcdsaVerifyError::BadV) => { + log::error!(target: "evm", "Error recovering: Incorrect value of V"); + false + } + Err(sp_io::EcdsaVerifyError::BadSignature) => { + log::error!(target: "evm", "Error recovering: Invalid signature"); + false + } + } + } +} + +/// Public key for an Ethereum / Moonbeam compatible account +#[derive( + Eq, PartialEq, Ord, PartialOrd, Clone, Encode, Decode, sp_core::RuntimeDebug, TypeInfo, +)] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] +pub struct MockSigner([u8; 20]); + +impl sp_runtime::traits::IdentifyAccount for MockSigner { + type AccountId = MockAccount; + fn into_account(self) -> MockAccount { + MockAccount(self.0.into()) + } +} + +impl From<[u8; 20]> for MockSigner { + fn from(x: [u8; 20]) -> Self { + MockSigner(x) + } +} + #[macro_export] macro_rules! mock_account { ($name:ident, $convert:expr) => { diff --git a/precompiles/utils/src/tests.rs b/precompiles/utils/src/tests.rs index 8f0739358a..93bcfd3e60 100644 --- a/precompiles/utils/src/tests.rs +++ b/precompiles/utils/src/tests.rs @@ -650,7 +650,7 @@ fn read_vec_of_bytes() { // // It also provides an example on how to impl `solidity::Codec` for Solidity structs. // -// struct MultiLocation { +// struct Location { // uint8 parents; // bytes [] interior; // } @@ -658,12 +658,12 @@ fn read_vec_of_bytes() { // function transfer( // address currency_address, // uint256 amount, -// MultiLocation memory destination, +// Location memory destination, // uint64 weight // ) external; #[derive(Clone, Debug, Eq, PartialEq, solidity::Codec)] -struct MultiLocation { +struct Location { parents: u8, interior: Vec, } @@ -702,8 +702,8 @@ fn read_complex_solidity_function() { assert_eq!(selector, Some(0xb38c60fa)); // asset assert_eq!( - reader.read::().unwrap(), - MultiLocation { + reader.read::().unwrap(), + Location { parents: 1, interior: vec![ UnboundedBytes::from(&hex!("00000003e8")[..]), @@ -717,8 +717,8 @@ fn read_complex_solidity_function() { // destination assert_eq!( - reader.read::().unwrap(), - MultiLocation { + reader.read::().unwrap(), + Location { parents: 1, interior: vec![UnboundedBytes::from( &hex!("01010101010101010101010101010101010101010101010101010101010101010100")[..] @@ -732,38 +732,33 @@ fn read_complex_solidity_function() { #[test] fn junctions_decoder_works() { - let writer_output = Writer::new() - .write(Junctions::X1(Junction::OnlyChild)) - .build(); + let junctions: Junctions = [(Junction::OnlyChild)].into(); + let writer_output = Writer::new().write(junctions).build(); let mut reader = Reader::new(&writer_output); let parsed: Junctions = reader .read::() .expect("to correctly parse Junctions"); - assert_eq!(parsed, Junctions::X1(Junction::OnlyChild)); + assert_eq!(parsed, [Junction::OnlyChild]); - let writer_output = Writer::new() - .write(Junctions::X2(Junction::OnlyChild, Junction::OnlyChild)) - .build(); + let junctions: Junctions = [Junction::OnlyChild, Junction::OnlyChild].into(); + let writer_output = Writer::new().write(junctions).build(); let mut reader = Reader::new(&writer_output); let parsed: Junctions = reader .read::() .expect("to correctly parse Junctions"); - assert_eq!( - parsed, - Junctions::X2(Junction::OnlyChild, Junction::OnlyChild) - ); + assert_eq!(parsed, [Junction::OnlyChild, Junction::OnlyChild]); - let writer_output = Writer::new() - .write(Junctions::X3( - Junction::OnlyChild, - Junction::OnlyChild, - Junction::OnlyChild, - )) - .build(); + let junctions: Junctions = [ + Junction::OnlyChild, + Junction::OnlyChild, + Junction::OnlyChild, + ] + .into(); + let writer_output = Writer::new().write(junctions).build(); let mut reader = Reader::new(&writer_output); let parsed: Junctions = reader @@ -772,11 +767,11 @@ fn junctions_decoder_works() { assert_eq!( parsed, - Junctions::X3( + [ Junction::OnlyChild, Junction::OnlyChild, Junction::OnlyChild - ), + ], ); } @@ -1117,5 +1112,5 @@ fn evm_data_solidity_types() { ); // Struct encode like tuples - assert_eq!(MultiLocation::signature(), "(uint8,bytes[])"); + assert_eq!(Location::signature(), "(uint8,bytes[])"); } diff --git a/precompiles/utils/tests-external/lib.rs b/precompiles/utils/tests-external/lib.rs index cfb9eab388..ca32c4e41a 100644 --- a/precompiles/utils/tests-external/lib.rs +++ b/precompiles/utils/tests-external/lib.rs @@ -64,6 +64,7 @@ mod tests { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -100,7 +101,6 @@ mod tests { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } diff --git a/precompiles/xcm-transactor/src/functions.rs b/precompiles/xcm-transactor/src/functions.rs index 6316543bfe..aa944afa0f 100644 --- a/precompiles/xcm-transactor/src/functions.rs +++ b/precompiles/xcm-transactor/src/functions.rs @@ -36,7 +36,7 @@ use sp_std::{ }; use sp_weights::Weight; use xcm::latest::prelude::*; -use xcm::latest::MultiLocation; +use xcm::latest::Location; use xcm_primitives::{ AccountIdToCurrencyId, UtilityAvailableCalls, UtilityEncodeCall, DEFAULT_PROOF_SIZE, }; @@ -77,22 +77,21 @@ where pub(crate) fn transact_info( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + multilocation: Location, ) -> EvmResult<(u64, U256, u64)> { // fetch data from pallet - // storage item: TransactInfoWithWeightLimit: Blake2_128(16) + MultiLocation + // storage item: TransactInfoWithWeightLimit: Blake2_128(16) + Location // + RemoteTransactInfoWithMaxWeight handle.record_db_read::( - 16 + MultiLocation::max_encoded_len() - + RemoteTransactInfoWithMaxWeight::max_encoded_len(), + 16 + Location::max_encoded_len() + RemoteTransactInfoWithMaxWeight::max_encoded_len(), )?; let remote_transact_info: RemoteTransactInfoWithMaxWeight = pallet_xcm_transactor::Pallet::::transact_info(&multilocation) .ok_or(revert("Transact Info not set"))?; // fetch data from pallet - // storage item: AssetTypeUnitsPerSecond: Blake2_128(16) + MultiLocation + u128(16) - handle.record_db_read::(32 + MultiLocation::max_encoded_len())?; + // storage item: AssetTypeUnitsPerSecond: Blake2_128(16) + Location + u128(16) + handle.record_db_read::(32 + Location::max_encoded_len())?; let fee_per_second: u128 = pallet_xcm_transactor::Pallet::::dest_asset_fee_per_second(&multilocation) .ok_or(revert("Fee Per Second not set"))?; @@ -106,14 +105,13 @@ where pub(crate) fn transact_info_with_signed( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + multilocation: Location, ) -> EvmResult<(u64, u64, u64)> { // fetch data from pallet - // storage item: TransactInfoWithWeightLimit: Blake2_128(16) + MultiLocation + // storage item: TransactInfoWithWeightLimit: Blake2_128(16) + Location // + RemoteTransactInfoWithMaxWeight handle.record_db_read::( - 16 + MultiLocation::max_encoded_len() - + RemoteTransactInfoWithMaxWeight::max_encoded_len(), + 16 + Location::max_encoded_len() + RemoteTransactInfoWithMaxWeight::max_encoded_len(), )?; let remote_transact_info: RemoteTransactInfoWithMaxWeight = pallet_xcm_transactor::Pallet::::transact_info(multilocation) @@ -132,13 +130,13 @@ where pub(crate) fn fee_per_second( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + location: Location, ) -> EvmResult { // fetch data from pallet - // storage item: AssetTypeUnitsPerSecond: Blake2_128(16) + MultiLocation + u128(16) - handle.record_db_read::(32 + MultiLocation::max_encoded_len())?; + // storage item: AssetTypeUnitsPerSecond: Blake2_128(16) + Location + u128(16) + handle.record_db_read::(32 + Location::max_encoded_len())?; let fee_per_second: u128 = - pallet_xcm_transactor::Pallet::::dest_asset_fee_per_second(multilocation) + pallet_xcm_transactor::Pallet::::dest_asset_fee_per_second(location) .ok_or(revert("Fee Per Second not set"))?; Ok(fee_per_second.into()) @@ -148,7 +146,7 @@ where handle: &mut impl PrecompileHandle, transactor: u8, index: u16, - fee_asset: MultiLocation, + fee_asset: Location, weight: u64, inner_call: BoundedBytes, ) -> EvmResult { @@ -164,7 +162,7 @@ where dest: transactor, index, fee: CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( fee_asset, ))), fee_amount: None, @@ -193,7 +191,7 @@ where handle: &mut impl PrecompileHandle, transactor: u8, index: u16, - fee_asset: MultiLocation, + fee_asset: Location, weight: u64, inner_call: BoundedBytes, fee_amount: u128, @@ -212,7 +210,7 @@ where dest: transactor, index, fee: CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( fee_asset, ))), fee_amount: Some(fee_amount), @@ -344,8 +342,8 @@ where pub(crate) fn transact_through_signed_multilocation( handle: &mut impl PrecompileHandle, - dest: MultiLocation, - fee_asset: MultiLocation, + dest: Location, + fee_asset: Location, weight: u64, call: BoundedBytes, ) -> EvmResult { @@ -355,9 +353,9 @@ where // moonbeam, as we are using IdentityMapping let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let call = pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V3(dest)), + dest: Box::new(xcm::VersionedLocation::V4(dest)), fee: CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( fee_asset, ))), fee_amount: None, @@ -380,8 +378,8 @@ where pub(crate) fn transact_through_signed_multilocation_fee_weight( handle: &mut impl PrecompileHandle, - dest: MultiLocation, - fee_asset: MultiLocation, + dest: Location, + fee_asset: Location, weight: u64, call: BoundedBytes, fee_amount: u128, @@ -393,9 +391,9 @@ where // moonbeam, as we are using IdentityMapping let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let call = pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V3(dest)), + dest: Box::new(xcm::VersionedLocation::V4(dest)), fee: CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( fee_asset, ))), fee_amount: Some(fee_amount), @@ -421,7 +419,7 @@ where pub(crate) fn transact_through_signed( handle: &mut impl PrecompileHandle, - dest: MultiLocation, + dest: Location, fee_asset: Address, weight: u64, call: BoundedBytes, @@ -444,7 +442,7 @@ where // moonbeam, as we are using IdentityMapping let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let call = pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V3(dest)), + dest: Box::new(xcm::VersionedLocation::V4(dest)), fee: CurrencyPayment { currency: Currency::AsCurrencyId(currency_id), fee_amount: None, @@ -467,7 +465,7 @@ where pub(crate) fn transact_through_signed_fee_weight( handle: &mut impl PrecompileHandle, - dest: MultiLocation, + dest: Location, fee_asset: Address, weight: u64, call: BoundedBytes, @@ -492,7 +490,7 @@ where // moonbeam, as we are using IdentityMapping let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let call = pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V3(dest)), + dest: Box::new(xcm::VersionedLocation::V4(dest)), fee: CurrencyPayment { currency: Currency::AsCurrencyId(currency_id), fee_amount: Some(fee_amount), @@ -542,14 +540,13 @@ where pub(crate) fn transact_info_with_signed_v3( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + multilocation: Location, ) -> EvmResult<(Weight, Weight, Weight)> { // fetch data from pallet - // storage item: TransactInfoWithWeightLimit: Blake2_128(16) + MultiLocation + // storage item: TransactInfoWithWeightLimit: Blake2_128(16) + Location // + RemoteTransactInfoWithMaxWeight handle.record_db_read::( - 16 + MultiLocation::max_encoded_len() - + RemoteTransactInfoWithMaxWeight::max_encoded_len(), + 16 + Location::max_encoded_len() + RemoteTransactInfoWithMaxWeight::max_encoded_len(), )?; let remote_transact_info: RemoteTransactInfoWithMaxWeight = @@ -571,7 +568,7 @@ where handle: &mut impl PrecompileHandle, transactor: u8, index: u16, - fee_asset: MultiLocation, + fee_asset: Location, weight: Weight, inner_call: BoundedBytes, fee_amount: u128, @@ -596,7 +593,7 @@ where dest: transactor, index, fee: CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( fee_asset, ))), fee_amount: Some(fee_amount), @@ -672,8 +669,8 @@ where pub(crate) fn transact_through_signed_multilocation_v3( handle: &mut impl PrecompileHandle, - dest: MultiLocation, - fee_asset: MultiLocation, + dest: Location, + fee_asset: Location, weight: Weight, call: BoundedBytes, fee_amount: u128, @@ -691,9 +688,9 @@ where // moonbeam, as we are using IdentityMapping let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let call = pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V3(dest)), + dest: Box::new(xcm::VersionedLocation::V4(dest)), fee: CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( fee_asset, ))), fee_amount: Some(fee_amount), @@ -713,7 +710,7 @@ where pub(crate) fn transact_through_signed_v3( handle: &mut impl PrecompileHandle, - dest: MultiLocation, + dest: Location, fee_asset: Address, weight: Weight, call: BoundedBytes, @@ -744,7 +741,7 @@ where // moonbeam, as we are using IdentityMapping let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let call = pallet_xcm_transactor::Call::::transact_through_signed { - dest: Box::new(xcm::VersionedMultiLocation::V3(dest)), + dest: Box::new(xcm::VersionedLocation::V4(dest)), fee: CurrencyPayment { currency: Currency::AsCurrencyId(currency_id), fee_amount: Some(fee_amount), diff --git a/precompiles/xcm-transactor/src/mock.rs b/precompiles/xcm-transactor/src/mock.rs index 1adb818ec9..83e100478a 100644 --- a/precompiles/xcm-transactor/src/mock.rs +++ b/precompiles/xcm-transactor/src/mock.rs @@ -38,7 +38,7 @@ use xcm::latest::{prelude::*, Error as XcmError}; use xcm_builder::FixedWeightBounds; use xcm_executor::{ traits::{TransactAsset, WeightTrader}, - Assets, + AssetsInHolding, }; use xcm_primitives::AccountIdToCurrencyId; @@ -58,16 +58,16 @@ construct_runtime!( } ); -pub struct AccountIdToMultiLocation; -impl sp_runtime::traits::Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { +pub struct AccountIdToLocation; +impl sp_runtime::traits::Convert for AccountIdToLocation { + fn convert(account: AccountId) -> Location { let as_h160: H160 = account.into(); - MultiLocation::new( + Location::new( 0, - Junctions::X1(AccountKey20 { + [AccountKey20 { network: None, key: as_h160.as_fixed_bytes().clone(), - }), + }], ) } } @@ -91,6 +91,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = MockDbWeight; type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -127,7 +128,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -229,10 +229,10 @@ impl pallet_timestamp::Config for Runtime { } pub struct ConvertOriginToLocal; impl EnsureOrigin for ConvertOriginToLocal { - type Success = MultiLocation; + type Success = Location; - fn try_origin(_: Origin) -> Result { - Ok(MultiLocation::here()) + fn try_origin(_: Origin) -> Result { + Ok(Location::here()) } #[cfg(feature = "runtime-benchmarks")] @@ -246,10 +246,10 @@ impl SendXcm for DoNothingRouter { type Ticket = (); fn validate( - _destination: &mut Option, + _destination: &mut Option, _message: &mut Option>, ) -> SendResult { - Ok(((), MultiAssets::new())) + Ok(((), Assets::new())) } fn deliver(_: Self::Ticket) -> Result { @@ -259,20 +259,16 @@ impl SendXcm for DoNothingRouter { pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { - fn deposit_asset( - _what: &MultiAsset, - _who: &MultiLocation, - _context: Option<&XcmContext>, - ) -> XcmResult { + fn deposit_asset(_what: &Asset, _who: &Location, _context: Option<&XcmContext>) -> XcmResult { Ok(()) } fn withdraw_asset( - _what: &MultiAsset, - _who: &MultiLocation, + _what: &Asset, + _who: &Location, _maybe_context: Option<&XcmContext>, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } @@ -285,10 +281,10 @@ impl WeightTrader for DummyWeightTrader { fn buy_weight( &mut self, _weight: Weight, - _payment: Assets, + _payment: AssetsInHolding, _context: &XcmContext, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } @@ -299,25 +295,25 @@ pub enum CurrencyId { } parameter_types! { - pub Ancestry: MultiLocation = Parachain(ParachainId::get().into()).into(); + pub Ancestry: Location = Parachain(ParachainId::get().into()).into(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub SelfLocation: MultiLocation = - MultiLocation::new(1, Junctions::X1(Parachain(ParachainId::get().into()))); + pub SelfLocation: Location = + Location::new(1, [Parachain(ParachainId::get().into())]); - pub SelfReserve: MultiLocation = MultiLocation::new( + pub SelfReserve: Location = Location::new( 1, - Junctions::X2( + [ Parachain(ParachainId::get().into()), PalletInstance( ::PalletInfo::index::().unwrap() as u8 ) - )); + ]); pub MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = Here; + pub UniversalLocation: InteriorLocation = Here; } impl pallet_xcm_transactor::Config for Runtime { @@ -327,8 +323,8 @@ impl pallet_xcm_transactor::Config for Runtime { type DerivativeAddressRegistrationOrigin = frame_system::EnsureRoot; type SovereignAccountDispatcherOrigin = frame_system::EnsureRoot; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type CurrencyIdToMultiLocation = CurrencyIdToMultiLocation; + type AccountIdToLocation = AccountIdToLocation; + type CurrencyIdToLocation = CurrencyIdToLocation; type SelfLocation = SelfLocation; type Weigher = FixedWeightBounds; type UniversalLocation = UniversalLocation; @@ -372,9 +368,9 @@ impl TryFrom for MockTransactors { } impl xcm_primitives::XcmTransact for MockTransactors { - fn destination(self) -> MultiLocation { + fn destination(self) -> Location { match self { - MockTransactors::Relay => MultiLocation::parent(), + MockTransactors::Relay => Location::parent(), } } } @@ -407,24 +403,21 @@ impl AccountIdToCurrencyId for Runtime { } } -pub struct CurrencyIdToMultiLocation; +pub struct CurrencyIdToLocation; -impl sp_runtime::traits::Convert> for CurrencyIdToMultiLocation { - fn convert(currency: CurrencyId) -> Option { +impl sp_runtime::traits::Convert> for CurrencyIdToLocation { + fn convert(currency: CurrencyId) -> Option { match currency { CurrencyId::SelfReserve => { - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } // To distinguish between relay and others, specially for reserve asset CurrencyId::OtherReserve(asset) => { if asset == 0 { - Some(MultiLocation::parent()) + Some(Location::parent()) } else { - Some(MultiLocation::new( - 1, - Junctions::X2(Parachain(2), GeneralIndex(asset)), - )) + Some(Location::new(1, [Parachain(2), GeneralIndex(asset)])) } } } diff --git a/precompiles/xcm-transactor/src/tests.rs b/precompiles/xcm-transactor/src/tests.rs index b96dd4a8fe..8bf3825612 100644 --- a/precompiles/xcm-transactor/src/tests.rs +++ b/precompiles/xcm-transactor/src/tests.rs @@ -22,7 +22,7 @@ use frame_support::{assert_ok, weights::Weight}; use precompile_utils::{prelude::*, testing::*}; use sp_core::H160; use sp_std::boxed::Box; -use xcm::latest::MultiLocation; +use xcm::latest::Location; fn precompiles() -> Precompiles { PrecompilesValue::get() @@ -138,7 +138,7 @@ fn take_transact_info() { .build() .execute_with(|| { let input: Vec<_> = PCallV1::transact_info { - multilocation: MultiLocation::parent(), + location: Location::parent(), } .into(); @@ -150,7 +150,7 @@ fn take_transact_info() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), Weight::zero(), 10000u64.into(), None @@ -159,7 +159,7 @@ fn take_transact_info() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -177,7 +177,7 @@ fn take_transact_info_with_signed() { .build() .execute_with(|| { let input: Vec<_> = PCallV1::transact_info_with_signed { - multilocation: MultiLocation::parent(), + multilocation: Location::parent(), } .into(); @@ -189,7 +189,7 @@ fn take_transact_info_with_signed() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), Weight::zero(), 10000u64.into(), Some(1.into()) @@ -198,7 +198,7 @@ fn take_transact_info_with_signed() { // Root can set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -217,7 +217,7 @@ fn take_fee_per_second() { .build() .execute_with(|| { let input: Vec<_> = PCallV1::fee_per_second { - multilocation: MultiLocation::parent(), + multilocation: Location::parent(), } .into(); @@ -229,7 +229,7 @@ fn take_fee_per_second() { // Root can set fee per secnd assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); precompiles() @@ -254,7 +254,7 @@ fn test_transact_derivative_multilocation_v2() { )); // we pay with our current self reserve. - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -294,7 +294,7 @@ fn test_transact_derivative_multilocation_v3() { )); // we pay with our current self reserve. - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -330,7 +330,7 @@ fn take_transact_info_with_signed_v3() { .build() .execute_with(|| { let input: Vec<_> = PCallV3::transact_info_with_signed { - multilocation: MultiLocation::parent(), + multilocation: Location::parent(), } .into(); @@ -342,7 +342,7 @@ fn take_transact_info_with_signed_v3() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), Weight::zero(), 10000u64.into(), Some(1.into()) @@ -351,7 +351,7 @@ fn take_transact_info_with_signed_v3() { // Root can set fee per second assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -387,7 +387,7 @@ fn test_transact_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), Weight::zero(), 10000000.into(), None @@ -396,12 +396,12 @@ fn test_transact_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); // we pay with our current self reserve. - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -440,7 +440,7 @@ fn test_transact_derivative() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), Weight::zero(), 10000000.into(), None @@ -449,7 +449,7 @@ fn test_transact_derivative() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -562,7 +562,7 @@ fn test_transact_signed() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), Weight::zero(), 10000000.into(), Some(1.into()) @@ -571,12 +571,12 @@ fn test_transact_signed() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); // Destination - let dest = MultiLocation::parent(); + let dest = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -605,7 +605,7 @@ fn test_transact_signed_v2() { .build() .execute_with(|| { // Destination - let dest = MultiLocation::parent(); + let dest = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -654,7 +654,7 @@ fn test_transact_signed_v3() { Alice, TransactorV3, PCallV3::transact_through_signed { - dest: MultiLocation::parent(), + dest: Location::parent(), fee_asset: Address(AssetAddress(0).into()), weight: require_weight_at_most, call: bytes.into(), @@ -678,7 +678,7 @@ fn test_transact_signed_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), Weight::zero(), 10000000.into(), Some(1.into()) @@ -687,14 +687,14 @@ fn test_transact_signed_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); // Destination - let dest = MultiLocation::parent(); + let dest = Location::parent(); - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -723,9 +723,9 @@ fn test_transact_signed_multilocation_v2() { .build() .execute_with(|| { // Destination - let dest = MultiLocation::parent(); + let dest = Location::parent(); - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -765,7 +765,7 @@ fn test_transact_through_signed_multilocation_v3() { )); // we pay with our current self reserve. - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -777,7 +777,7 @@ fn test_transact_through_signed_multilocation_v3() { Alice, TransactorV3, PCallV3::transact_through_signed_multilocation { - dest: MultiLocation::parent(), + dest: Location::parent(), fee_asset: fee_payer_asset, weight: require_weight_at_most, call: bytes.into(), diff --git a/precompiles/xcm-transactor/src/v1/mod.rs b/precompiles/xcm-transactor/src/v1/mod.rs index 853b834a30..e92ac40df5 100644 --- a/precompiles/xcm-transactor/src/v1/mod.rs +++ b/precompiles/xcm-transactor/src/v1/mod.rs @@ -24,7 +24,7 @@ use precompile_utils::prelude::*; use sp_core::{H160, U256}; use sp_runtime::traits::Dispatchable; use sp_std::{convert::TryFrom, marker::PhantomData}; -use xcm::latest::MultiLocation; +use xcm::latest::Location; use xcm_primitives::AccountIdToCurrencyId; /// A precompile to wrap the functionality from xcm transactor @@ -53,9 +53,9 @@ where #[precompile::view] fn transact_info( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + location: Location, ) -> EvmResult<(u64, U256, u64)> { - XcmTransactorWrapper::::transact_info(handle, multilocation) + XcmTransactorWrapper::::transact_info(handle, location) } #[precompile::public("transactInfoWithSigned((uint8,bytes[]))")] @@ -63,7 +63,7 @@ where #[precompile::view] fn transact_info_with_signed( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + multilocation: Location, ) -> EvmResult<(u64, u64, u64)> { XcmTransactorWrapper::::transact_info_with_signed(handle, multilocation) } @@ -73,7 +73,7 @@ where #[precompile::view] fn fee_per_second( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + multilocation: Location, ) -> EvmResult { XcmTransactorWrapper::::fee_per_second(handle, multilocation) } @@ -98,7 +98,7 @@ where handle: &mut impl PrecompileHandle, transactor: u8, index: u16, - fee_asset: MultiLocation, + fee_asset: Location, weight: u64, inner_call: BoundedBytes, ) -> EvmResult { @@ -143,8 +143,8 @@ where )] fn transact_through_signed_multilocation( handle: &mut impl PrecompileHandle, - dest: MultiLocation, - fee_asset: MultiLocation, + dest: Location, + fee_asset: Location, weight: u64, call: BoundedBytes, ) -> EvmResult { @@ -157,7 +157,7 @@ where #[precompile::public("transact_through_signed((uint8,bytes[]),address,uint64,bytes)")] fn transact_through_signed( handle: &mut impl PrecompileHandle, - dest: MultiLocation, + dest: Location, fee_asset: Address, weight: u64, call: BoundedBytes, diff --git a/precompiles/xcm-transactor/src/v2/mod.rs b/precompiles/xcm-transactor/src/v2/mod.rs index 83bd5e9f8d..63586675d7 100644 --- a/precompiles/xcm-transactor/src/v2/mod.rs +++ b/precompiles/xcm-transactor/src/v2/mod.rs @@ -23,7 +23,7 @@ use precompile_utils::prelude::*; use sp_core::{H160, U256}; use sp_runtime::traits::Dispatchable; use sp_std::{convert::TryFrom, marker::PhantomData}; -use xcm::latest::MultiLocation; +use xcm::latest::Location; use xcm_primitives::AccountIdToCurrencyId; /// A precompile to wrap the functionality from xcm transactor @@ -50,7 +50,7 @@ where #[precompile::view] fn transact_info_with_signed( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + multilocation: Location, ) -> EvmResult<(u64, u64, u64)> { XcmTransactorWrapper::::transact_info_with_signed(handle, multilocation) } @@ -59,7 +59,7 @@ where #[precompile::view] fn fee_per_second( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + multilocation: Location, ) -> EvmResult { XcmTransactorWrapper::::fee_per_second(handle, multilocation) } @@ -77,7 +77,7 @@ where handle: &mut impl PrecompileHandle, transactor: u8, index: u16, - fee_asset: MultiLocation, + fee_asset: Location, weight: u64, inner_call: BoundedBytes, fee_amount: Convert, @@ -138,8 +138,8 @@ where )] fn transact_through_signed_multilocation( handle: &mut impl PrecompileHandle, - dest: MultiLocation, - fee_asset: MultiLocation, + dest: Location, + fee_asset: Location, weight: u64, call: BoundedBytes, fee_amount: Convert, @@ -161,7 +161,7 @@ where )] fn transact_through_signed( handle: &mut impl PrecompileHandle, - dest: MultiLocation, + dest: Location, fee_asset: Address, weight: u64, call: BoundedBytes, diff --git a/precompiles/xcm-transactor/src/v3/mod.rs b/precompiles/xcm-transactor/src/v3/mod.rs index 90e9a50ff8..9575e0175b 100644 --- a/precompiles/xcm-transactor/src/v3/mod.rs +++ b/precompiles/xcm-transactor/src/v3/mod.rs @@ -24,7 +24,7 @@ use sp_core::{H160, U256}; use sp_runtime::traits::Dispatchable; use sp_std::{convert::TryFrom, marker::PhantomData}; use sp_weights::Weight; -use xcm::latest::MultiLocation; +use xcm::latest::Location; use xcm_primitives::AccountIdToCurrencyId; /// A precompile to wrap the functionality from xcm transactor @@ -51,7 +51,7 @@ where #[precompile::view] fn transact_info_with_signed( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + multilocation: Location, ) -> EvmResult<(Weight, Weight, Weight)> { XcmTransactorWrapper::::transact_info_with_signed_v3(handle, multilocation) } @@ -60,7 +60,7 @@ where #[precompile::view] fn fee_per_second( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + multilocation: Location, ) -> EvmResult { XcmTransactorWrapper::::fee_per_second(handle, multilocation) } @@ -80,7 +80,7 @@ where handle: &mut impl PrecompileHandle, transactor: u8, index: u16, - fee_asset: MultiLocation, + fee_asset: Location, weight: Weight, inner_call: BoundedBytes, fee_amount: Convert, @@ -147,8 +147,8 @@ where )] fn transact_through_signed_multilocation( handle: &mut impl PrecompileHandle, - dest: MultiLocation, - fee_asset: MultiLocation, + dest: Location, + fee_asset: Location, weight: Weight, call: BoundedBytes, fee_amount: Convert, @@ -179,7 +179,7 @@ where )] fn transact_through_signed( handle: &mut impl PrecompileHandle, - dest: MultiLocation, + dest: Location, fee_asset: Address, weight: Weight, call: BoundedBytes, diff --git a/precompiles/xcm-utils/src/lib.rs b/precompiles/xcm-utils/src/lib.rs index b2bc90d62a..f187a983e7 100644 --- a/precompiles/xcm-utils/src/lib.rs +++ b/precompiles/xcm-utils/src/lib.rs @@ -107,14 +107,14 @@ where #[precompile::view] fn multilocation_to_address( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + location: Location, ) -> EvmResult
{ // storage item: AssetTypeUnitsPerSecond // max encoded len: hash (16) + Multilocation + u128 (16) - handle.record_db_read::(32 + MultiLocation::max_encoded_len())?; + handle.record_db_read::(32 + Location::max_encoded_len())?; let origin = - XcmConfig::OriginConverter::convert_origin(multilocation, OriginKind::SovereignAccount) + XcmConfig::OriginConverter::convert_origin(location, OriginKind::SovereignAccount) .map_err(|_| { RevertReason::custom("Failed multilocation conversion") .in_field("multilocation") @@ -133,21 +133,21 @@ where #[precompile::view] fn get_units_per_second( handle: &mut impl PrecompileHandle, - multilocation: MultiLocation, + location: Location, ) -> EvmResult { // storage item: AssetTypeUnitsPerSecond // max encoded len: hash (16) + Multilocation + u128 (16) - handle.record_db_read::(32 + MultiLocation::max_encoded_len())?; + handle.record_db_read::(32 + Location::max_encoded_len())?; // We will construct an asset with the max amount, and check how much we // get in return to substract - let multiasset: xcm::latest::MultiAsset = (multilocation.clone(), u128::MAX).into(); + let multiasset: xcm::latest::Asset = (location.clone(), u128::MAX).into(); let weight_per_second = 1_000_000_000_000u64; let mut trader = ::Trader::new(); let ctx = XcmContext { - origin: Some(multilocation), + origin: Some(location), message_id: XcmHash::default(), topic: None, }; @@ -233,7 +233,7 @@ where #[precompile::public("xcmSend((uint8,bytes[]),bytes)")] fn xcm_send( handle: &mut impl PrecompileHandle, - dest: MultiLocation, + dest: Location, message: BoundedBytes, ) -> EvmResult { let message: Vec = message.into(); diff --git a/precompiles/xcm-utils/src/mock.rs b/precompiles/xcm-utils/src/mock.rs index 26b9ca4308..2098470bd1 100644 --- a/precompiles/xcm-utils/src/mock.rs +++ b/precompiles/xcm-utils/src/mock.rs @@ -38,7 +38,7 @@ use xcm_builder::IsConcrete; use xcm_builder::SovereignSignedViaLocation; use xcm_executor::{ traits::{ConvertLocation, TransactAsset, WeightTrader}, - Assets, + AssetsInHolding, }; use Junctions::Here; @@ -70,13 +70,13 @@ use frame_system::RawOrigin as SystemRawOrigin; use xcm::latest::Junction; pub struct MockAccountToAccountKey20(PhantomData<(Origin, AccountId)>); -impl> TryConvert +impl> TryConvert for MockAccountToAccountKey20 where Origin::PalletsOrigin: From> + TryInto, Error = Origin::PalletsOrigin>, { - fn try_convert(o: Origin) -> Result { + fn try_convert(o: Origin) -> Result { o.try_with_caller(|caller| match caller.try_into() { Ok(SystemRawOrigin::Signed(who)) => { let account_h160: H160 = who.into(); @@ -94,9 +94,9 @@ where pub struct MockParentMultilocationToAccountConverter; impl ConvertLocation for MockParentMultilocationToAccountConverter { - fn convert_location(location: &MultiLocation) -> Option { + fn convert_location(location: &Location) -> Option { match location { - MultiLocation { + Location { parents: 1, interior: Here, } => Some(ParentAccount.into()), @@ -107,12 +107,9 @@ impl ConvertLocation for MockParentMultilocationToAccountConverter { pub struct MockParachainMultilocationToAccountConverter; impl ConvertLocation for MockParachainMultilocationToAccountConverter { - fn convert_location(location: &MultiLocation) -> Option { - match location { - MultiLocation { - parents: 1, - interior: Junctions::X1(Parachain(id)), - } => Some(SiblingParachainAccount(*id).into()), + fn convert_location(location: &Location) -> Option { + match location.unpack() { + (1, [Parachain(id)]) => Some(SiblingParachainAccount(*id).into()), _ => None, } } @@ -124,16 +121,16 @@ pub type LocationToAccountId = ( xcm_builder::AccountKey20Aliases, ); -pub struct AccountIdToMultiLocation; -impl sp_runtime::traits::Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { +pub struct AccountIdToLocation; +impl sp_runtime::traits::Convert for AccountIdToLocation { + fn convert(account: AccountId) -> Location { let as_h160: H160 = account.into(); - MultiLocation::new( + Location::new( 0, - Junctions::X1(AccountKey20 { + [AccountKey20 { network: None, key: as_h160.as_fixed_bytes().clone(), - }), + }], ) } } @@ -156,6 +153,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = MockDbWeight; type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -192,18 +190,12 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } -#[cfg(feature = "runtime-benchmarks")] parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - -parameter_types! { - pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub MatcherLocation: Location = Location::here(); } pub type LocalOriginToLocation = MockAccountToAccountKey20; impl pallet_xcm::Config for Runtime { @@ -232,8 +224,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; } pub type Precompiles = PrecompileSetBuilder< R, @@ -316,10 +306,10 @@ pub type Barrier = AllowUnpaidExecutionFrom; pub struct ConvertOriginToLocal; impl EnsureOrigin for ConvertOriginToLocal { - type Success = MultiLocation; + type Success = Location; - fn try_origin(_: Origin) -> Result { - Ok(MultiLocation::here()) + fn try_origin(_: Origin) -> Result { + Ok(Location::here()) } #[cfg(feature = "runtime-benchmarks")] @@ -332,9 +322,9 @@ use sp_std::cell::RefCell; use xcm::latest::opaque; // Simulates sending a XCM message thread_local! { - pub static SENT_XCM: RefCell> = RefCell::new(Vec::new()); + pub static SENT_XCM: RefCell> = RefCell::new(Vec::new()); } -pub fn sent_xcm() -> Vec<(MultiLocation, opaque::Xcm)> { +pub fn sent_xcm() -> Vec<(Location, opaque::Xcm)> { SENT_XCM.with(|q| (*q.borrow()).clone()) } pub struct TestSendXcm; @@ -342,14 +332,14 @@ impl SendXcm for TestSendXcm { type Ticket = (); fn validate( - destination: &mut Option, + destination: &mut Option, message: &mut Option, ) -> SendResult { SENT_XCM.with(|q| { q.borrow_mut() .push((destination.clone().unwrap(), message.clone().unwrap())) }); - Ok(((), MultiAssets::new())) + Ok(((), Assets::new())) } fn deliver(_: Self::Ticket) -> Result { @@ -359,20 +349,16 @@ impl SendXcm for TestSendXcm { pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { - fn deposit_asset( - _what: &MultiAsset, - _who: &MultiLocation, - _context: Option<&XcmContext>, - ) -> XcmResult { + fn deposit_asset(_what: &Asset, _who: &Location, _context: Option<&XcmContext>) -> XcmResult { Ok(()) } fn withdraw_asset( - _what: &MultiAsset, - _who: &MultiLocation, + _what: &Asset, + _who: &Location, _maybe_context: Option<&XcmContext>, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } @@ -385,11 +371,10 @@ impl WeightTrader for DummyWeightTrader { fn buy_weight( &mut self, weight: Weight, - payment: Assets, + payment: AssetsInHolding, _context: &XcmContext, - ) -> Result { - let asset_to_charge: MultiAsset = - (MultiLocation::parent(), weight.ref_time() as u128).into(); + ) -> Result { + let asset_to_charge: Asset = (Location::parent(), weight.ref_time() as u128).into(); let unused = payment .checked_sub(asset_to_charge) .map_err(|_| XcmError::TooExpensive)?; @@ -402,20 +387,20 @@ parameter_types! { pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 0u64); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub SelfLocation: MultiLocation = - MultiLocation::new(1, Junctions::X1(Parachain(ParachainId::get().into()))); + pub SelfLocation: Location = + Location::new(1, [Parachain(ParachainId::get().into())]); - pub SelfReserve: MultiLocation = MultiLocation::new( + pub SelfReserve: Location = Location::new( 1, - Junctions::X2( + [ Parachain(ParachainId::get().into()), PalletInstance(::PalletInfo::index::().unwrap() as u8) - )); + ]); pub MaxInstructions: u32 = 100; - pub UniversalLocation: InteriorMultiLocation = Here; - pub Ancestry: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainId::get().into()).into()); + pub UniversalLocation: InteriorLocation = Here; + pub Ancestry: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(ParachainId::get().into())].into(); pub const MaxAssetsIntoHolding: u32 = 64; } @@ -452,6 +437,8 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + + type TransactionalProcessor = (); } pub(crate) struct ExtBuilder { diff --git a/precompiles/xcm-utils/src/tests.rs b/precompiles/xcm-utils/src/tests.rs index 7eee70e843..3ed4178420 100644 --- a/precompiles/xcm-utils/src/tests.rs +++ b/precompiles/xcm-utils/src/tests.rs @@ -50,7 +50,7 @@ fn modifiers() { fn test_get_account_parent() { ExtBuilder::default().build().execute_with(|| { let input = PCall::multilocation_to_address { - multilocation: MultiLocation::parent(), + location: Location::parent(), }; let expected_address: H160 = ParentAccount.into(); @@ -67,9 +67,9 @@ fn test_get_account_parent() { fn test_get_account_sibling() { ExtBuilder::default().build().execute_with(|| { let input = PCall::multilocation_to_address { - multilocation: MultiLocation { + location: Location { parents: 1, - interior: Junctions::X1(Junction::Parachain(2000u32)), + interior: [Junction::Parachain(2000u32)].into(), }, }; @@ -86,7 +86,7 @@ fn test_get_account_sibling() { #[test] fn test_weight_message() { ExtBuilder::default().build().execute_with(|| { - let message: Vec = xcm::VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); + let message: Vec = xcm::VersionedXcm::<()>::V4(Xcm(vec![ClearOrigin])).encode(); let input = PCall::weight_message { message: message.into(), @@ -104,7 +104,7 @@ fn test_weight_message() { fn test_get_units_per_second() { ExtBuilder::default().build().execute_with(|| { let input = PCall::get_units_per_second { - multilocation: MultiLocation::parent(), + location: Location::parent(), }; precompiles() @@ -118,7 +118,7 @@ fn test_get_units_per_second() { #[test] fn test_executor_clear_origin() { ExtBuilder::default().build().execute_with(|| { - let xcm_to_execute = VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); + let xcm_to_execute = VersionedXcm::<()>::V4(Xcm(vec![ClearOrigin])).encode(); let input = PCall::xcm_execute { message: xcm_to_execute.into(), @@ -136,12 +136,12 @@ fn test_executor_clear_origin() { #[test] fn test_executor_send() { ExtBuilder::default().build().execute_with(|| { - let withdrawn_asset: MultiAsset = (MultiLocation::parent(), 1u128).into(); - let xcm_to_execute = VersionedXcm::<()>::V3(Xcm(vec![ + let withdrawn_asset: Asset = (Location::parent(), 1u128).into(); + let xcm_to_execute = VersionedXcm::<()>::V4(Xcm(vec![ WithdrawAsset(vec![withdrawn_asset].into()), InitiateReserveWithdraw { - assets: MultiAssetFilter::Wild(All), - reserve: MultiLocation::parent(), + assets: AssetFilter::Wild(All), + reserve: Location::parent(), xcm: Xcm(vec![]), }, ])) @@ -184,7 +184,7 @@ fn test_executor_transact() { } .encode(); encoded.append(&mut call_bytes); - let xcm_to_execute = VersionedXcm::<()>::V3(Xcm(vec![Transact { + let xcm_to_execute = VersionedXcm::<()>::V4(Xcm(vec![Transact { origin_kind: OriginKind::SovereignAccount, require_weight_at_most: Weight::from_parts(1_000_000_000u64, 5206u64), call: encoded.into(), @@ -211,10 +211,10 @@ fn test_executor_transact() { #[test] fn test_send_clear_origin() { ExtBuilder::default().build().execute_with(|| { - let xcm_to_send = VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); + let xcm_to_send = VersionedXcm::<()>::V4(Xcm(vec![ClearOrigin])).encode(); let input = PCall::xcm_send { - dest: MultiLocation::parent(), + dest: Location::parent(), message: xcm_to_send.into(), }; @@ -244,7 +244,7 @@ fn execute_fails_if_called_by_smart_contract() { // Set code to Alice address as it if was a smart contract. pallet_evm::AccountCodes::::insert(H160::from(Alice), vec![10u8]); - let xcm_to_execute = VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); + let xcm_to_execute = VersionedXcm::<()>::V4(Xcm(vec![ClearOrigin])).encode(); let input = PCall::xcm_execute { message: xcm_to_execute.into(), diff --git a/precompiles/xtokens/src/lib.rs b/precompiles/xtokens/src/lib.rs index c75540b8a3..5d3fd5f82a 100644 --- a/precompiles/xtokens/src/lib.rs +++ b/precompiles/xtokens/src/lib.rs @@ -35,8 +35,8 @@ use sp_std::{ }; use sp_weights::Weight; use xcm::{ - latest::{AssetId, Fungibility, MultiAsset, MultiAssets, MultiLocation, WeightLimit}, - VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation, + latest::{Asset, AssetId, Assets, Fungibility, Location, WeightLimit}, + VersionedAsset, VersionedAssets, VersionedLocation, }; use xcm_primitives::{AccountIdToCurrencyId, DEFAULT_PROOF_SIZE}; @@ -80,7 +80,7 @@ where handle: &mut impl PrecompileHandle, currency_address: Address, amount: U256, - destination: MultiLocation, + destination: Location, weight: u64, ) -> EvmResult { let to_address: H160 = currency_address.into(); @@ -105,7 +105,7 @@ where let call = orml_xtokens::Call::::transfer { currency_id, amount, - dest: Box::new(VersionedMultiLocation::V3(destination)), + dest: Box::new(VersionedLocation::V4(destination)), dest_weight_limit, }; @@ -126,7 +126,7 @@ where currency_address: Address, amount: U256, fee: U256, - destination: MultiLocation, + destination: Location, weight: u64, ) -> EvmResult { let to_address: H160 = currency_address.into(); @@ -160,7 +160,7 @@ where currency_id, amount, fee, - dest: Box::new(VersionedMultiLocation::V3(destination)), + dest: Box::new(VersionedLocation::V4(destination)), dest_weight_limit, }; @@ -178,9 +178,9 @@ where #[precompile::public("transfer_multiasset((uint8,bytes[]),uint256,(uint8,bytes[]),uint64)")] fn transfer_multiasset( handle: &mut impl PrecompileHandle, - asset: MultiLocation, + asset: Location, amount: U256, - destination: MultiLocation, + destination: Location, weight: u64, ) -> EvmResult { let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); @@ -195,11 +195,11 @@ where }; let call = orml_xtokens::Call::::transfer_multiasset { - asset: Box::new(VersionedMultiAsset::V3(MultiAsset { - id: AssetId::Concrete(asset), + asset: Box::new(VersionedAsset::V4(Asset { + id: AssetId(asset), fun: Fungibility::Fungible(to_balance), })), - dest: Box::new(VersionedMultiLocation::V3(destination)), + dest: Box::new(VersionedLocation::V4(destination)), dest_weight_limit, }; @@ -221,10 +221,10 @@ where )] fn transfer_multiasset_with_fee( handle: &mut impl PrecompileHandle, - asset: MultiLocation, + asset: Location, amount: U256, fee: U256, - destination: MultiLocation, + destination: Location, weight: u64, ) -> EvmResult { let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); @@ -242,15 +242,15 @@ where }; let call = orml_xtokens::Call::::transfer_multiasset_with_fee { - asset: Box::new(VersionedMultiAsset::V3(MultiAsset { - id: AssetId::Concrete(asset.clone()), + asset: Box::new(VersionedAsset::V4(Asset { + id: AssetId(asset.clone()), fun: Fungibility::Fungible(amount), })), - fee: Box::new(VersionedMultiAsset::V3(MultiAsset { - id: AssetId::Concrete(asset), + fee: Box::new(VersionedAsset::V4(Asset { + id: AssetId(asset), fun: Fungibility::Fungible(fee), })), - dest: Box::new(VersionedMultiLocation::V3(destination)), + dest: Box::new(VersionedLocation::V4(destination)), dest_weight_limit, }; @@ -274,7 +274,7 @@ where handle: &mut impl PrecompileHandle, currencies: BoundedVec>, fee_item: u32, - destination: MultiLocation, + destination: Location, weight: u64, ) -> EvmResult { let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); @@ -315,7 +315,7 @@ where let call = orml_xtokens::Call::::transfer_multicurrencies { currencies, fee_item, - dest: Box::new(VersionedMultiLocation::V3(destination)), + dest: Box::new(VersionedLocation::V4(destination)), dest_weight_limit, }; @@ -337,15 +337,15 @@ where )] fn transfer_multi_assets( handle: &mut impl PrecompileHandle, - assets: BoundedVec>, + assets: BoundedVec>, fee_item: u32, - destination: MultiLocation, + destination: Location, weight: u64, ) -> EvmResult { let origin = Runtime::AddressMapping::into_account_id(handle.context().caller); let assets: Vec<_> = assets.into(); - let multiasset_vec: EvmResult> = assets + let multiasset_vec: EvmResult> = assets .into_iter() .enumerate() .map(|(index, evm_multiasset)| { @@ -360,11 +360,10 @@ where // Since multiassets sorts them, we need to check whether the index is still correct, // and error otherwise as there is not much we can do other than that - let multiassets = - MultiAssets::from_sorted_and_deduplicated(multiasset_vec?).map_err(|_| { - RevertReason::custom("Provided assets either not sorted nor deduplicated") - .in_field("assets") - })?; + let assets = Assets::from_sorted_and_deduplicated(multiasset_vec?).map_err(|_| { + RevertReason::custom("Provided assets either not sorted nor deduplicated") + .in_field("assets") + })?; let dest_weight_limit = if weight == u64::MAX { WeightLimit::Unlimited @@ -373,9 +372,9 @@ where }; let call = orml_xtokens::Call::::transfer_multiassets { - assets: Box::new(VersionedMultiAssets::V3(multiassets)), + assets: Box::new(VersionedAssets::V4(assets)), fee_item, - dest: Box::new(VersionedMultiLocation::V3(destination)), + dest: Box::new(VersionedLocation::V4(destination)), dest_weight_limit, }; @@ -407,14 +406,14 @@ impl From<(Address, U256)> for Currency { } #[derive(solidity::Codec)] -pub struct EvmMultiAsset { - location: MultiLocation, +pub struct EvmAsset { + location: Location, amount: U256, } -impl From<(MultiLocation, U256)> for EvmMultiAsset { - fn from(tuple: (MultiLocation, U256)) -> Self { - EvmMultiAsset { +impl From<(Location, U256)> for EvmAsset { + fn from(tuple: (Location, U256)) -> Self { + EvmAsset { location: tuple.0, amount: tuple.1, } diff --git a/precompiles/xtokens/src/mock.rs b/precompiles/xtokens/src/mock.rs index dcd017aba1..17ea747d82 100644 --- a/precompiles/xtokens/src/mock.rs +++ b/precompiles/xtokens/src/mock.rs @@ -37,7 +37,7 @@ use xcm::latest::{prelude::*, Error as XcmError}; use xcm_builder::{AllowUnpaidExecutionFrom, FixedWeightBounds, IsConcrete}; use xcm_executor::{ traits::{TransactAsset, WeightTrader}, - Assets, XcmExecutor, + AssetsInHolding, XcmExecutor, }; pub type AccountId = MockAccount; @@ -76,6 +76,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type RuntimeCall = RuntimeCall; @@ -112,7 +113,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -186,10 +186,10 @@ impl pallet_timestamp::Config for Runtime { } pub struct ConvertOriginToLocal; impl EnsureOrigin for ConvertOriginToLocal { - type Success = MultiLocation; + type Success = Location; - fn try_origin(_: Origin) -> Result { - Ok(MultiLocation::here()) + fn try_origin(_: Origin) -> Result { + Ok(Location::here()) } #[cfg(feature = "runtime-benchmarks")] @@ -203,10 +203,10 @@ impl SendXcm for DoNothingRouter { type Ticket = (); fn validate( - _destination: &mut Option, + _destination: &mut Option, _message: &mut Option>, ) -> SendResult { - Ok(((), MultiAssets::new())) + Ok(((), Assets::new())) } fn deliver(_: Self::Ticket) -> Result { @@ -218,20 +218,16 @@ pub type Barrier = AllowUnpaidExecutionFrom; pub struct DummyAssetTransactor; impl TransactAsset for DummyAssetTransactor { - fn deposit_asset( - _what: &MultiAsset, - _who: &MultiLocation, - _context: Option<&XcmContext>, - ) -> XcmResult { + fn deposit_asset(_what: &Asset, _who: &Location, _context: Option<&XcmContext>) -> XcmResult { Ok(()) } fn withdraw_asset( - _what: &MultiAsset, - _who: &MultiLocation, + _what: &Asset, + _who: &Location, _maybe_context: Option<&XcmContext>, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } @@ -244,17 +240,16 @@ impl WeightTrader for DummyWeightTrader { fn buy_weight( &mut self, _weight: Weight, - _payment: Assets, + _payment: AssetsInHolding, _context: &XcmContext, - ) -> Result { - Ok(Assets::default()) + ) -> Result { + Ok(AssetsInHolding::default()) } } parameter_types! { - pub UniversalLocation: InteriorMultiLocation = Here; - pub MatcherLocation: MultiLocation = MultiLocation::here(); - pub ReachableDest: Option = Some(MultiLocation::here()); + pub UniversalLocation: InteriorLocation = Here; + pub MatcherLocation: Location = Location::here(); pub const MaxAssetsIntoHolding: u32 = 64; } @@ -284,8 +279,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; } pub struct XcmConfig; @@ -314,6 +307,8 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + + type TransactionalProcessor = (); } #[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)] @@ -337,65 +332,62 @@ impl AccountIdToCurrencyId for Runtime { pub struct CurrencyIdToMultiLocation; -impl sp_runtime::traits::Convert> for CurrencyIdToMultiLocation { - fn convert(currency: CurrencyId) -> Option { +impl sp_runtime::traits::Convert> for CurrencyIdToMultiLocation { + fn convert(currency: CurrencyId) -> Option { match currency { CurrencyId::SelfReserve => { - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } // To distinguish between relay and others, specially for reserve asset CurrencyId::OtherReserve(asset) => { if asset == 0 { - Some(MultiLocation::parent()) + Some(Location::parent()) } else { - Some(MultiLocation::new( - 1, - Junctions::X2(Parachain(2), GeneralIndex(asset)), - )) + Some(Location::new(1, [Parachain(2), GeneralIndex(asset)])) } } } } } -pub struct AccountIdToMultiLocation; -impl sp_runtime::traits::Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { +pub struct AccountIdToLocation; +impl sp_runtime::traits::Convert for AccountIdToLocation { + fn convert(account: AccountId) -> Location { let as_h160: H160 = account.into(); - MultiLocation::new( + Location::new( 1, - Junctions::X1(AccountKey20 { + [AccountKey20 { network: None, key: as_h160.as_fixed_bytes().clone(), - }), + }], ) } } parameter_types! { - pub Ancestry: MultiLocation = Parachain(ParachainId::get().into()).into(); + pub Ancestry: Location = Parachain(ParachainId::get().into()).into(); pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub const MaxAssetsForTransfer: usize = 2; - pub SelfLocation: MultiLocation = - MultiLocation::new(1, Junctions::X1(Parachain(ParachainId::get().into()))); + pub SelfLocation: Location = + Location::new(1, [Parachain(ParachainId::get().into())]); - pub SelfReserve: MultiLocation = MultiLocation::new( + pub SelfReserve: Location = Location::new( 1, - Junctions::X2( + [ Parachain(ParachainId::get().into()), PalletInstance( ::PalletInfo::index::().unwrap() as u8 ) - )); + ]); pub MaxInstructions: u32 = 100; } parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { + pub ParachainMinFee: |_location: Location| -> Option { Some(u128::MAX) }; } @@ -404,7 +396,7 @@ impl orml_xtokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = AccountIdToMultiLocation; + type AccountIdToLocation = AccountIdToLocation; type CurrencyIdConvert = CurrencyIdToMultiLocation; type XcmExecutor = XcmExecutor; type SelfLocation = SelfLocation; @@ -413,7 +405,7 @@ impl orml_xtokens::Config for Runtime { type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = AbsoluteReserveProvider; } diff --git a/precompiles/xtokens/src/tests.rs b/precompiles/xtokens/src/tests.rs index 29bffdef3c..3240504d0e 100644 --- a/precompiles/xtokens/src/tests.rs +++ b/precompiles/xtokens/src/tests.rs @@ -18,14 +18,12 @@ use crate::mock::{ events, AssetAccount, CurrencyId, CurrencyIdToMultiLocation, ExtBuilder, PCall, Precompiles, PrecompilesValue, Runtime, SelfReserveAccount, }; -use crate::{Currency, EvmMultiAsset}; +use crate::{Currency, EvmAsset}; use orml_xtokens::Event as XtokensEvent; use precompile_utils::{prelude::*, testing::*}; use sp_core::U256; use sp_runtime::traits::Convert; -use xcm::latest::{ - AssetId, Fungibility, Junction, Junctions, MultiAsset, MultiAssets, MultiLocation, -}; +use xcm::latest::{Asset, AssetId, Assets, Fungibility, Junction, Location}; fn precompiles() -> Precompiles { PrecompilesValue::get() @@ -77,12 +75,12 @@ fn transfer_self_reserve_works() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); precompiles() @@ -100,13 +98,11 @@ fn transfer_self_reserve_works() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete( - CurrencyIdToMultiLocation::convert(CurrencyId::SelfReserve).unwrap(), - ), + let expected_asset: Asset = Asset { + id: AssetId(CurrencyIdToMultiLocation::convert(CurrencyId::SelfReserve).unwrap()), fun: Fungibility::Fungible(500), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone()].into(), fee: expected_asset, @@ -124,12 +120,12 @@ fn transfer_to_reserve_works() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // We are transferring asset 0, which we have instructed to be the relay asset precompiles() @@ -147,13 +143,13 @@ fn transfer_to_reserve_works() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete( + let expected_asset: Asset = Asset { + id: AssetId( CurrencyIdToMultiLocation::convert(CurrencyId::OtherReserve(0u128)).unwrap(), ), fun: Fungibility::Fungible(500), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone()].into(), fee: expected_asset, @@ -171,12 +167,12 @@ fn transfer_to_reserve_with_unlimited_weight_works() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // We are transferring asset 0, which we have instructed to be the relay asset precompiles() @@ -194,13 +190,13 @@ fn transfer_to_reserve_with_unlimited_weight_works() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete( + let expected_asset: Asset = Asset { + id: AssetId( CurrencyIdToMultiLocation::convert(CurrencyId::OtherReserve(0u128)).unwrap(), ), fun: Fungibility::Fungible(500), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone()].into(), fee: expected_asset, @@ -218,12 +214,12 @@ fn transfer_to_reserve_with_fee_works() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // We are transferring asset 0, which we have instructed to be the relay asset // Fees are not trully charged, so no worries @@ -243,19 +239,19 @@ fn transfer_to_reserve_with_fee_works() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete( + let expected_asset: Asset = Asset { + id: AssetId( CurrencyIdToMultiLocation::convert(CurrencyId::OtherReserve(0u128)).unwrap(), ), fun: Fungibility::Fungible(500), }; - let expected_fee: MultiAsset = MultiAsset { - id: AssetId::Concrete( + let expected_fee: Asset = Asset { + id: AssetId( CurrencyIdToMultiLocation::convert(CurrencyId::OtherReserve(0u128)).unwrap(), ), fun: Fungibility::Fungible(50), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone(), expected_fee.clone()].into(), fee: expected_fee, @@ -274,12 +270,12 @@ fn transfer_non_reserve_to_non_reserve_works() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // We are transferring asset 1, which corresponds to another parachain Id asset @@ -298,13 +294,13 @@ fn transfer_non_reserve_to_non_reserve_works() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete( + let expected_asset: Asset = Asset { + id: AssetId( CurrencyIdToMultiLocation::convert(CurrencyId::OtherReserve(1u128)).unwrap(), ), fun: Fungibility::Fungible(500), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone()].into(), fee: expected_asset, @@ -322,12 +318,12 @@ fn transfer_non_reserve_to_non_reserve_with_fee_works() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // We are transferring asset 1, which corresponds to another parachain Id asset @@ -347,19 +343,19 @@ fn transfer_non_reserve_to_non_reserve_with_fee_works() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete( + let expected_asset: Asset = Asset { + id: AssetId( CurrencyIdToMultiLocation::convert(CurrencyId::OtherReserve(1u128)).unwrap(), ), fun: Fungibility::Fungible(500), }; - let expected_fee: MultiAsset = MultiAsset { - id: AssetId::Concrete( + let expected_fee: Asset = Asset { + id: AssetId( CurrencyIdToMultiLocation::convert(CurrencyId::OtherReserve(1u128)).unwrap(), ), fun: Fungibility::Fungible(50), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone(), expected_fee.clone()].into(), fee: expected_fee, @@ -377,15 +373,15 @@ fn transfer_multi_asset_to_reserve_works() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); - let asset = MultiLocation::parent(); + let asset = Location::parent(); precompiles() .prepare_test( @@ -402,11 +398,11 @@ fn transfer_multi_asset_to_reserve_works() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete(asset), + let expected_asset: Asset = Asset { + id: AssetId(asset), fun: Fungibility::Fungible(500), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone()].into(), fee: expected_asset, @@ -425,12 +421,12 @@ fn transfer_multi_asset_self_reserve_works() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); let self_reserve = crate::mock::SelfReserve::get(); @@ -450,11 +446,11 @@ fn transfer_multi_asset_self_reserve_works() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete(self_reserve), + let expected_asset: Asset = Asset { + id: AssetId(self_reserve), fun: Fungibility::Fungible(500), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone()].into(), fee: expected_asset, @@ -472,12 +468,12 @@ fn transfer_multi_asset_self_reserve_with_fee_works() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); let self_reserve = crate::mock::SelfReserve::get(); @@ -498,15 +494,15 @@ fn transfer_multi_asset_self_reserve_with_fee_works() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete(self_reserve.clone()), + let expected_asset: Asset = Asset { + id: AssetId(self_reserve.clone()), fun: Fungibility::Fungible(500), }; - let expected_fee: MultiAsset = MultiAsset { - id: AssetId::Concrete(self_reserve), + let expected_fee: Asset = Asset { + id: AssetId(self_reserve), fun: Fungibility::Fungible(50), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone(), expected_fee.clone()].into(), fee: expected_fee, @@ -524,18 +520,16 @@ fn transfer_multi_asset_non_reserve_to_non_reserve() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); - let asset_location = MultiLocation::new( - 1, - Junctions::X2(Junction::Parachain(2), Junction::GeneralIndex(5u128)), - ); + let asset_location = + Location::new(1, [Junction::Parachain(2), Junction::GeneralIndex(5u128)]); precompiles() .prepare_test( @@ -552,11 +546,11 @@ fn transfer_multi_asset_non_reserve_to_non_reserve() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete(asset_location), + let expected_asset: Asset = Asset { + id: AssetId(asset_location), fun: Fungibility::Fungible(500), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone()].into(), fee: expected_asset, @@ -574,18 +568,16 @@ fn transfer_multi_asset_non_reserve_to_non_reserve_with_fee() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); - let asset_location = MultiLocation::new( - 1, - Junctions::X2(Junction::Parachain(2), Junction::GeneralIndex(5u128)), - ); + let asset_location = + Location::new(1, [Junction::Parachain(2), Junction::GeneralIndex(5u128)]); precompiles() .prepare_test( @@ -603,15 +595,15 @@ fn transfer_multi_asset_non_reserve_to_non_reserve_with_fee() { .expect_no_logs() .execute_returns(()); - let expected_asset: MultiAsset = MultiAsset { - id: AssetId::Concrete(asset_location.clone()), + let expected_asset: Asset = Asset { + id: AssetId(asset_location.clone()), fun: Fungibility::Fungible(500), }; - let expected_fee: MultiAsset = MultiAsset { - id: AssetId::Concrete(asset_location), + let expected_fee: Asset = Asset { + id: AssetId(asset_location), fun: Fungibility::Fungible(50), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset.clone(), expected_fee.clone()].into(), fee: expected_fee, @@ -629,12 +621,12 @@ fn transfer_multi_currencies() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); let currencies: Vec = vec![ (Address(AssetAccount(1u128).into()), U256::from(500)).into(), @@ -657,19 +649,19 @@ fn transfer_multi_currencies() { .expect_no_logs() .execute_returns(()); - let expected_asset_1: MultiAsset = MultiAsset { - id: AssetId::Concrete( + let expected_asset_1: Asset = Asset { + id: AssetId( CurrencyIdToMultiLocation::convert(CurrencyId::OtherReserve(1u128)).unwrap(), ), fun: Fungibility::Fungible(500), }; - let expected_asset_2: MultiAsset = MultiAsset { - id: AssetId::Concrete( + let expected_asset_2: Asset = Asset { + id: AssetId( CurrencyIdToMultiLocation::convert(CurrencyId::OtherReserve(2u128)).unwrap(), ), fun: Fungibility::Fungible(500), }; - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: vec![expected_asset_1.clone(), expected_asset_2].into(), fee: expected_asset_1, @@ -687,32 +679,28 @@ fn transfer_multi_assets() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X2( + [ Junction::Parachain(2), Junction::AccountId32 { network: None, id: [1u8; 32], }, - ), + ], ); - let asset_1_location = MultiLocation::new( - 1, - Junctions::X2(Junction::Parachain(2), Junction::GeneralIndex(0u128)), - ); - let asset_2_location = MultiLocation::new( - 1, - Junctions::X2(Junction::Parachain(2), Junction::GeneralIndex(1u128)), - ); + let asset_1_location = + Location::new(1, [Junction::Parachain(2), Junction::GeneralIndex(0u128)]); + let asset_2_location = + Location::new(1, [Junction::Parachain(2), Junction::GeneralIndex(1u128)]); - let assets: Vec = vec![ + let assets: Vec = vec![ (asset_1_location.clone(), U256::from(500)).into(), (asset_2_location.clone(), U256::from(500)).into(), ]; - let multiassets = MultiAssets::from_sorted_and_deduplicated(vec![ + let multiassets = Assets::from_sorted_and_deduplicated(vec![ (asset_1_location.clone(), 500).into(), (asset_2_location, 500).into(), ]) @@ -734,7 +722,7 @@ fn transfer_multi_assets() { .expect_no_logs() .execute_returns(()); - let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredMultiAssets { + let expected: crate::mock::RuntimeEvent = XtokensEvent::TransferredAssets { sender: Alice.into(), assets: multiassets, fee: (asset_1_location, 500).into(), @@ -754,12 +742,12 @@ fn transfer_multi_currencies_cannot_insert_more_than_max() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); let currencies: Vec = vec![ (Address(AssetAccount(1u128).into()), U256::from(500)).into(), @@ -789,32 +777,26 @@ fn transfer_multi_assets_cannot_insert_more_than_max() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X2( + [ Junction::Parachain(2), Junction::AccountId32 { network: None, id: [1u8; 32], }, - ), + ], ); - let asset_1_location = MultiLocation::new( - 1, - Junctions::X2(Junction::Parachain(2), Junction::GeneralIndex(0u128)), - ); - let asset_2_location = MultiLocation::new( - 1, - Junctions::X2(Junction::Parachain(2), Junction::GeneralIndex(1u128)), - ); + let asset_1_location = + Location::new(1, [Junction::Parachain(2), Junction::GeneralIndex(0u128)]); + let asset_2_location = + Location::new(1, [Junction::Parachain(2), Junction::GeneralIndex(1u128)]); - let asset_3_location = MultiLocation::new( - 1, - Junctions::X2(Junction::Parachain(2), Junction::GeneralIndex(2u128)), - ); + let asset_3_location = + Location::new(1, [Junction::Parachain(2), Junction::GeneralIndex(2u128)]); - let assets: Vec = vec![ + let assets: Vec = vec![ (asset_1_location.clone(), U256::from(500)).into(), (asset_2_location.clone(), U256::from(500)).into(), (asset_3_location.clone(), U256::from(500)).into(), @@ -842,28 +824,24 @@ fn transfer_multi_assets_is_not_sorted_error() { .with_balances(vec![(Alice.into(), 1000)]) .build() .execute_with(|| { - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X2( + [ Junction::Parachain(2), Junction::AccountId32 { network: None, id: [1u8; 32], }, - ), + ], ); // Disordered vec creation - let asset_1_location = MultiLocation::new( - 1, - Junctions::X2(Junction::Parachain(2), Junction::GeneralIndex(1u128)), - ); - let asset_2_location = MultiLocation::new( - 1, - Junctions::X2(Junction::Parachain(2), Junction::GeneralIndex(0u128)), - ); + let asset_1_location = + Location::new(1, [Junction::Parachain(2), Junction::GeneralIndex(1u128)]); + let asset_2_location = + Location::new(1, [Junction::Parachain(2), Junction::GeneralIndex(0u128)]); - let assets: Vec = vec![ + let assets: Vec = vec![ (asset_1_location.clone(), U256::from(500)).into(), (asset_2_location.clone(), U256::from(500)).into(), ]; diff --git a/primitives/account/Cargo.toml b/primitives/account/Cargo.toml index 92ffb618b4..4865ca9f0e 100644 --- a/primitives/account/Cargo.toml +++ b/primitives/account/Cargo.toml @@ -8,14 +8,14 @@ repository = { workspace = true } version = "0.1.1" [package.metadata.docs.rs] -targets = [ "x86_64-unknown-linux-gnu" ] +targets = ["x86_64-unknown-linux-gnu"] [dependencies] blake2-rfc = { workspace = true, optional = true } impl-serde = { workspace = true } -libsecp256k1 = { workspace = true, features = [ "hmac" ] } +libsecp256k1 = { workspace = true, features = ["hmac"] } log = { workspace = true } -serde = { workspace = true, features = [ "derive" ] } +serde = { workspace = true, features = ["derive"] } sha3 = { workspace = true } # Substrate @@ -31,7 +31,7 @@ sp-std = { workspace = true } hex = { workspace = true } [features] -default = [ "std" ] +default = ["std"] std = [ "full_crypto", "hex/std", diff --git a/primitives/account/src/lib.rs b/primitives/account/src/lib.rs index 84f6e121c7..1a1d6a916a 100644 --- a/primitives/account/src/lib.rs +++ b/primitives/account/src/lib.rs @@ -82,6 +82,12 @@ impl From<[u8; 32]> for AccountId20 { Self(buffer) } } +impl From for AccountId20 { + fn from(account: sp_runtime::AccountId32) -> Self { + let bytes: &[u8; 32] = account.as_ref(); + Self::from(*bytes) + } +} impl From for AccountId20 { fn from(h160: H160) -> Self { @@ -116,6 +122,20 @@ impl From for EthereumSignature { } } +impl From for EthereumSignature { + fn from(signature: sp_runtime::MultiSignature) -> Self { + match signature { + sp_runtime::MultiSignature::Ed25519(_) => { + panic!("Ed25519 not supported for EthereumSignature") + } + sp_runtime::MultiSignature::Sr25519(_) => { + panic!("Sr25519 not supported for EthereumSignature") + } + sp_runtime::MultiSignature::Ecdsa(sig) => Self(sig), + } + } +} + impl sp_runtime::traits::Verify for EthereumSignature { type Signer = EthereumSigner; fn verify>(&self, mut msg: L, signer: &AccountId20) -> bool { diff --git a/primitives/rpc/debug/Cargo.toml b/primitives/rpc/debug/Cargo.toml index a7f36de138..4c27999b32 100644 --- a/primitives/rpc/debug/Cargo.toml +++ b/primitives/rpc/debug/Cargo.toml @@ -37,3 +37,4 @@ std = [ "sp-runtime/std", "sp-std/std", ] +runtime-2900 = [] diff --git a/primitives/rpc/debug/src/lib.rs b/primitives/rpc/debug/src/lib.rs index 5e019ea431..abc4c19314 100644 --- a/primitives/rpc/debug/src/lib.rs +++ b/primitives/rpc/debug/src/lib.rs @@ -22,7 +22,7 @@ use parity_scale_codec::{Decode, Encode}; use sp_std::vec::Vec; sp_api::decl_runtime_apis! { - // Api version is virtually 4. + // Api version is virtually 5. // // We realized that even using runtime overrides, using the ApiExt interface reads the api // versions from the state runtime, meaning we cannot just reset the versioning as we see fit. @@ -30,8 +30,14 @@ sp_api::decl_runtime_apis! { // In order to be able to use ApiExt as part of the RPC handler logic we need to be always // above the version that exists on chain for this Api, even if this Api is only meant // to be used overridden. - #[api_version(4)] + #[api_version(5)] pub trait DebugRuntimeApi { + #[changed_in(5)] + fn trace_transaction( + extrinsics: Vec, + transaction: &Transaction, + ) -> Result<(), sp_runtime::DispatchError>; + #[changed_in(4)] fn trace_transaction( extrinsics: Vec, @@ -41,11 +47,19 @@ sp_api::decl_runtime_apis! { fn trace_transaction( extrinsics: Vec, transaction: &Transaction, + header: &Block::Header, + ) -> Result<(), sp_runtime::DispatchError>; + + #[changed_in(5)] + fn trace_block( + extrinsics: Vec, + known_transactions: Vec, ) -> Result<(), sp_runtime::DispatchError>; fn trace_block( extrinsics: Vec, known_transactions: Vec, + header: &Block::Header, ) -> Result<(), sp_runtime::DispatchError>; } } diff --git a/primitives/xcm/src/asset_id_conversions.rs b/primitives/xcm/src/asset_id_conversions.rs index 539f9aa02d..3b7a5ca932 100644 --- a/primitives/xcm/src/asset_id_conversions.rs +++ b/primitives/xcm/src/asset_id_conversions.rs @@ -16,40 +16,58 @@ use sp_runtime::traits::MaybeEquivalence; use sp_std::marker::PhantomData; -use xcm::latest::MultiLocation; +use xcm::v3::Location; use xcm_executor::traits::ConvertLocation; /// Converter struct implementing `AssetIdConversion` converting a numeric asset ID -/// (must be `TryFrom/TryInto`) into a MultiLocation Value and vice versa through +/// (must be `TryFrom/TryInto`) into a Location Value and vice versa through /// an intermediate generic type AssetType. /// The trait bounds enforce is that the AssetTypeGetter trait is also implemented for /// AssetIdInfoGetter pub struct AsAssetType( PhantomData<(AssetId, AssetType, AssetIdInfoGetter)>, ); -impl MaybeEquivalence +impl MaybeEquivalence for AsAssetType where AssetId: Clone, - AssetType: From + Into> + Clone, + AssetType: From + Into> + Clone, AssetIdInfoGetter: AssetTypeGetter, { - fn convert(id: &MultiLocation) -> Option { + fn convert(id: &Location) -> Option { AssetIdInfoGetter::get_asset_id(id.clone().into()) } - fn convert_back(what: &AssetId) -> Option { + fn convert_back(what: &AssetId) -> Option { AssetIdInfoGetter::get_asset_type(what.clone()).and_then(Into::into) } } +impl MaybeEquivalence + for AsAssetType +where + AssetId: Clone, + AssetType: From + Into> + Clone, + AssetIdInfoGetter: AssetTypeGetter, +{ + fn convert(id: &xcm::v4::Location) -> Option { + let v3_location = xcm_builder::V4V3LocationConverter::convert(id)?; + AssetIdInfoGetter::get_asset_id(v3_location.clone().into()) + } + fn convert_back(what: &AssetId) -> Option { + let v3_location: Location = + AssetIdInfoGetter::get_asset_type(what.clone()).and_then(Into::into)?; + xcm_builder::V4V3LocationConverter::convert_back(&v3_location) + } +} impl ConvertLocation for AsAssetType where AssetId: Clone, - AssetType: From + Into> + Clone, + AssetType: From + Into> + Clone, AssetIdInfoGetter: AssetTypeGetter, { - fn convert_location(id: &MultiLocation) -> Option { - AssetIdInfoGetter::get_asset_id(id.clone().into()) + fn convert_location(id: &xcm::v4::Location) -> Option { + let v3_location = xcm_builder::V4V3LocationConverter::convert(id)?; + AssetIdInfoGetter::get_asset_id(v3_location.clone().into()) } } diff --git a/primitives/xcm/src/fee_handlers.rs b/primitives/xcm/src/fee_handlers.rs index e4cfadbfc1..c496bc37c9 100644 --- a/primitives/xcm/src/fee_handlers.rs +++ b/primitives/xcm/src/fee_handlers.rs @@ -28,24 +28,22 @@ use frame_support::{ }; use sp_runtime::traits::Zero; use sp_std::marker::PhantomData; -use xcm::latest::{ - AssetId as xcmAssetId, Error as XcmError, Fungibility, MultiAsset, MultiLocation, -}; +use xcm::latest::{Asset, AssetId as xcmAssetId, Error as XcmError, Fungibility, Location}; use xcm_builder::TakeRevenue; use xcm_executor::traits::{MatchesFungibles, WeightTrader}; pub struct FirstAssetTrader< - AssetType: From + Clone, + AssetType: TryFrom + Clone, AssetIdInfoGetter: UnitsToWeightRatio, R: TakeRevenue, >( Weight, - Option<(MultiLocation, u128, u128)>, // id, amount, units_per_second + Option<(Location, u128, u128)>, // id, amount, units_per_second PhantomData<(AssetType, AssetIdInfoGetter, R)>, ); impl< - AssetType: From + Clone, + AssetType: TryFrom + Clone, AssetIdInfoGetter: UnitsToWeightRatio, R: TakeRevenue, > WeightTrader for FirstAssetTrader @@ -56,9 +54,9 @@ impl< fn buy_weight( &mut self, weight: Weight, - payment: xcm_executor::Assets, + payment: xcm_executor::AssetsInHolding, _context: &XcmContext, - ) -> Result { + ) -> Result { // can only call one time if self.1.is_some() { // TODO: better error @@ -75,8 +73,11 @@ impl< // We are only going to check first asset for now. This should be sufficient for simple token // transfers. We will see later if we change this. match (first_asset.id, first_asset.fun) { - (xcmAssetId::Concrete(id), Fungibility::Fungible(_)) => { - let asset_type: AssetType = id.clone().into(); + (xcmAssetId(location), Fungibility::Fungible(_)) => { + let asset_type: AssetType = location + .clone() + .try_into() + .map_err(|_| XcmError::InvalidLocation)?; // Shortcut if we know the asset is not supported // This involves the same db read per block, mitigating any attack based on // non-supported assets @@ -96,16 +97,16 @@ impl< return Ok(payment); } - let required = MultiAsset { + let required = Asset { fun: Fungibility::Fungible(amount), - id: xcmAssetId::Concrete(id.clone()), + id: xcmAssetId(location.clone()), }; let unused = payment .checked_sub(required) .map_err(|_| XcmError::TooExpensive)?; self.0 = weight; - self.1 = Some((id, amount, units_per_second)); + self.1 = Some((location, amount, units_per_second)); return Ok(unused); } else { @@ -117,21 +118,21 @@ impl< } // Refund weight. We will refund in whatever asset is stored in self. - fn refund_weight(&mut self, weight: Weight, _context: &XcmContext) -> Option { - if let Some((id, prev_amount, units_per_second)) = self.1.clone() { + fn refund_weight(&mut self, weight: Weight, _context: &XcmContext) -> Option { + if let Some((location, prev_amount, units_per_second)) = self.1.clone() { let weight = weight.min(self.0); self.0 -= weight; let amount = units_per_second * (weight.ref_time() as u128) / (WEIGHT_REF_TIME_PER_SECOND as u128); let amount = amount.min(prev_amount); self.1 = Some(( - id.clone(), + location.clone(), prev_amount.saturating_sub(amount), units_per_second, )); - Some(MultiAsset { + Some(Asset { fun: Fungibility::Fungible(amount), - id: xcmAssetId::Concrete(id.clone()), + id: xcmAssetId(location.clone()), }) } else { None @@ -141,7 +142,7 @@ impl< /// Deal with spent fees, deposit them as dictated by R impl< - AssetType: From + Clone, + AssetType: TryFrom + Clone, AssetIdInfoGetter: UnitsToWeightRatio, R: TakeRevenue, > Drop for FirstAssetTrader @@ -156,7 +157,7 @@ impl< } /// XCM fee depositor to which we implement the TakeRevenue trait -/// It receives a fungibles::Mutate implemented argument, a matcher to convert MultiAsset into +/// It receives a fungibles::Mutate implemented argument, a matcher to convert Asset into /// AssetId and amount, and the fee receiver account pub struct XcmFeesToAccount( PhantomData<(Assets, Matcher, AccountId, ReceiverAccount)>, @@ -168,7 +169,7 @@ impl< ReceiverAccount: Get, > TakeRevenue for XcmFeesToAccount { - fn take_revenue(revenue: MultiAsset) { + fn take_revenue(revenue: Asset) { match Matcher::matches_fungibles(&revenue) { Ok((asset_id, amount)) => { let ok = Assets::mint_into(asset_id, &ReceiverAccount::get(), amount).is_ok(); @@ -198,19 +199,19 @@ mod test { use super::*; use cumulus_primitives_core::XcmHash; use xcm::latest::{AssetId, Fungibility, Junction, Junctions}; - use xcm_executor::Assets; + use xcm_executor::AssetsInHolding; - const ARBITRARY_ML: MultiLocation = MultiLocation { + const ARBITRARY_ML: Location = Location { parents: 0u8, interior: Junctions::Here, }; - const ARBITRARY_ID: AssetId = AssetId::Concrete(ARBITRARY_ML); + const ARBITRARY_ID: AssetId = AssetId(ARBITRARY_ML); - impl UnitsToWeightRatio for () { - fn payment_is_supported(_asset_type: MultiLocation) -> bool { + impl UnitsToWeightRatio for () { + fn payment_is_supported(_asset_type: Location) -> bool { true } - fn get_units_per_second(_asset_type: MultiLocation) -> Option { + fn get_units_per_second(_asset_type: Location) -> Option { // return WEIGHT_REF_TIME_PER_SECOND to cancel the division out in buy_weight() // this should make weight and payment amounts directly comparable Some(WEIGHT_REF_TIME_PER_SECOND as u128) @@ -221,19 +222,19 @@ mod test { fn test_buy_weight_accounts_weight_properly() { let amount = 1000u128; - let mut payment = Assets::new(); - let multilocation = MultiLocation { + let mut payment = AssetsInHolding::new(); + let location = Location { parents: 0u8, interior: Junctions::Here, }; - payment.subsume(MultiAsset { - id: AssetId::Concrete(multilocation), + payment.subsume(Asset { + id: AssetId(location.clone()), fun: Fungibility::Fungible(amount), }); - let mut trader: FirstAssetTrader = FirstAssetTrader::new(); + let mut trader: FirstAssetTrader = FirstAssetTrader::new(); let ctx = XcmContext { - origin: Some(multilocation), + origin: Some(location), message_id: XcmHash::default(), topic: None, }; @@ -246,20 +247,20 @@ mod test { #[test] fn cant_call_buy_weight_twice() { - let mut trader: FirstAssetTrader = FirstAssetTrader::new(); + let mut trader: FirstAssetTrader = FirstAssetTrader::new(); // should be able to buy once - let mut asset_one_payment = Assets::new(); - let multilocation = MultiLocation { + let mut asset_one_payment = AssetsInHolding::new(); + let location = Location { parents: 0u8, - interior: Junctions::X1(Junction::Parachain(1000)), + interior: [Junction::Parachain(1000)].into(), }; - asset_one_payment.subsume(MultiAsset { - id: AssetId::Concrete(multilocation), + asset_one_payment.subsume(Asset { + id: AssetId(location.clone()), fun: Fungibility::Fungible(100u128), }); let ctx = XcmContext { - origin: Some(multilocation), + origin: Some(location), message_id: XcmHash::default(), topic: None, }; @@ -271,9 +272,9 @@ mod test { assert_eq!( trader.1, Some(( - MultiLocation { + Location { parents: 0u8, - interior: Junctions::X1(Junction::Parachain(1000)) + interior: [Junction::Parachain(1000)].into() }, 100, WEIGHT_REF_TIME_PER_SECOND as u128 @@ -281,17 +282,17 @@ mod test { ); // but not twice - let mut asset_two_payment = xcm_executor::Assets::new(); - let multi_location = MultiLocation { + let mut asset_two_payment = xcm_executor::AssetsInHolding::new(); + let location = Location { parents: 0u8, - interior: Junctions::X1(Junction::Parachain(1001)), + interior: [Junction::Parachain(1001)].into(), }; - asset_two_payment.subsume(MultiAsset { - id: AssetId::Concrete(multi_location), + asset_two_payment.subsume(Asset { + id: AssetId(location.clone()), fun: Fungibility::Fungible(10_000u128), }); let ctx = XcmContext { - origin: Some(multi_location), + origin: Some(location), message_id: XcmHash::default(), topic: None, }; @@ -305,9 +306,9 @@ mod test { assert_eq!( trader.1, Some(( - MultiLocation { + Location { parents: 0u8, - interior: Junctions::X1(Junction::Parachain(1000)) + interior: [Junction::Parachain(1000)].into() }, 100, WEIGHT_REF_TIME_PER_SECOND as u128 @@ -319,13 +320,13 @@ mod test { fn can_call_refund_weight_with_all_weight() { let amount = 1000u128; - let mut payment = Assets::new(); - payment.subsume(MultiAsset { + let mut payment = AssetsInHolding::new(); + payment.subsume(Asset { id: ARBITRARY_ID, fun: Fungibility::Fungible(amount), }); - let mut trader: FirstAssetTrader = FirstAssetTrader::new(); + let mut trader: FirstAssetTrader = FirstAssetTrader::new(); let ctx = XcmContext { origin: Some(ARBITRARY_ML), message_id: XcmHash::default(), @@ -339,7 +340,7 @@ mod test { assert_eq!( trader.refund_weight(1000u64.into(), &ctx), - Some(MultiAsset { + Some(Asset { fun: Fungibility::Fungible(1000), id: ARBITRARY_ID, }) @@ -350,13 +351,13 @@ mod test { fn can_call_refund_multiple_times() { let amount = 1000u128; - let mut payment = Assets::new(); - payment.subsume(MultiAsset { + let mut payment = AssetsInHolding::new(); + payment.subsume(Asset { id: ARBITRARY_ID, fun: Fungibility::Fungible(amount), }); - let mut trader: FirstAssetTrader = FirstAssetTrader::new(); + let mut trader: FirstAssetTrader = FirstAssetTrader::new(); let ctx = XcmContext { origin: Some(ARBITRARY_ML), message_id: XcmHash::default(), @@ -370,7 +371,7 @@ mod test { assert_eq!( trader.refund_weight(100u64.into(), &ctx), - Some(MultiAsset { + Some(Asset { fun: Fungibility::Fungible(100), id: ARBITRARY_ID, }) @@ -383,7 +384,7 @@ mod test { // can call again assert_eq!( trader.refund_weight(200u64.into(), &ctx), - Some(MultiAsset { + Some(Asset { fun: Fungibility::Fungible(200), id: ARBITRARY_ID, }) @@ -398,8 +399,8 @@ mod test { fn refund_weight_caps_weight() { let amount = 1000u128; - let mut payment = Assets::new(); - payment.subsume(MultiAsset { + let mut payment = AssetsInHolding::new(); + payment.subsume(Asset { id: ARBITRARY_ID, fun: Fungibility::Fungible(amount), }); @@ -408,7 +409,7 @@ mod test { message_id: XcmHash::default(), topic: None, }; - let mut trader: FirstAssetTrader = FirstAssetTrader::new(); + let mut trader: FirstAssetTrader = FirstAssetTrader::new(); let unused = trader .buy_weight((amount as u64).into(), payment.clone(), &ctx) .expect("can buy weight once"); @@ -418,7 +419,7 @@ mod test { // can't call with more weight assert_eq!( trader.refund_weight(9999u64.into(), &ctx), - Some(MultiAsset { + Some(Asset { fun: Fungibility::Fungible(1000), id: ARBITRARY_ID, }) @@ -430,8 +431,8 @@ mod test { fn refund_weight_caps_currency() { let amount = 1000u128; - let mut payment = Assets::new(); - payment.subsume(MultiAsset { + let mut payment = AssetsInHolding::new(); + payment.subsume(Asset { id: ARBITRARY_ID, fun: Fungibility::Fungible(amount), }); @@ -441,7 +442,7 @@ mod test { message_id: XcmHash::default(), topic: None, }; - let mut trader: FirstAssetTrader = FirstAssetTrader::new(); + let mut trader: FirstAssetTrader = FirstAssetTrader::new(); let unused = trader .buy_weight((amount as u64).into(), payment.clone(), &ctx) .expect("can buy weight once"); @@ -455,7 +456,7 @@ mod test { // can't call with more weight assert_eq!( trader.refund_weight(1500u64.into(), &ctx), - Some(MultiAsset { + Some(Asset { fun: Fungibility::Fungible(1000), id: ARBITRARY_ID, }) diff --git a/primitives/xcm/src/filter_asset_max_fee.rs b/primitives/xcm/src/filter_asset_max_fee.rs index af7bc2d64e..93668b6b74 100644 --- a/primitives/xcm/src/filter_asset_max_fee.rs +++ b/primitives/xcm/src/filter_asset_max_fee.rs @@ -15,7 +15,7 @@ // along with Moonbeam. If not, see . use frame_support::traits::Get; -use xcm::latest::MultiAsset; +use xcm::latest::Asset; use xcm_builder::Case; /// Filters max fee for a given multiasset. @@ -24,12 +24,12 @@ use xcm_builder::Case; /// If any item returns `true`, it short-circuits, else `false` is returned. pub trait FilterMaxAssetFee { /// A filter to be able to compare against a max asset. - fn filter_max_asset_fee(asset: &MultiAsset) -> bool; + fn filter_max_asset_fee(asset: &Asset) -> bool; } #[impl_trait_for_tuples::impl_for_tuples(30)] impl FilterMaxAssetFee for Tuple { - fn filter_max_asset_fee(what: &MultiAsset) -> bool { + fn filter_max_asset_fee(what: &Asset) -> bool { for_tuples!( #( if Tuple::filter_max_asset_fee(what) { return true } )* ); @@ -42,8 +42,8 @@ impl FilterMaxAssetFee for Tuple { } } -impl> FilterMaxAssetFee for Case { - fn filter_max_asset_fee(asset: &MultiAsset) -> bool { +impl> FilterMaxAssetFee for Case { + fn filter_max_asset_fee(asset: &Asset) -> bool { log::trace!(target: "xcm::filter_max_asset_fee", "Case asset: {:?}", asset); let max = T::get(); max.contains(asset) diff --git a/primitives/xcm/src/origin_conversion.rs b/primitives/xcm/src/origin_conversion.rs index 39400bb62e..8f47727079 100644 --- a/primitives/xcm/src/origin_conversion.rs +++ b/primitives/xcm/src/origin_conversion.rs @@ -16,23 +16,24 @@ use frame_support::traits::{Get, OriginTrait}; use orml_traits::location::{RelativeReserveProvider, Reserve}; +use sp_runtime::traits::TryConvert; use sp_std::{convert::TryInto, marker::PhantomData}; -use xcm::latest::{Junction::AccountKey20, Junctions::*, MultiAsset, MultiLocation, NetworkId}; +use xcm::latest::{Asset, Junction::AccountKey20, Location, NetworkId}; -/// Instructs how to convert a 20 byte accountId into a MultiLocation -pub struct AccountIdToMultiLocation(sp_std::marker::PhantomData); -impl sp_runtime::traits::Convert - for AccountIdToMultiLocation +/// Instructs how to convert a 20 byte accountId into a Location +pub struct AccountIdToLocation(sp_std::marker::PhantomData); +impl sp_runtime::traits::Convert for AccountIdToLocation where AccountId: Into<[u8; 20]>, { - fn convert(account: AccountId) -> MultiLocation { - MultiLocation { + fn convert(account: AccountId) -> Location { + Location { parents: 0, - interior: X1(AccountKey20 { + interior: [AccountKey20 { network: None, key: account.into(), - }), + }] + .into(), } } } @@ -42,13 +43,12 @@ pub struct SignedToAccountId20( sp_std::marker::PhantomData<(Origin, AccountId, Network)>, ); impl, Network: Get> - sp_runtime::traits::TryConvert - for SignedToAccountId20 + TryConvert for SignedToAccountId20 where Origin::PalletsOrigin: From> + TryInto, Error = Origin::PalletsOrigin>, { - fn try_convert(o: Origin) -> Result { + fn try_convert(o: Origin) -> Result { o.try_with_caller(|caller| match caller.try_into() { Ok(frame_system::RawOrigin::Signed(who)) => Ok(AccountKey20 { key: who.into(), @@ -62,20 +62,20 @@ where } /// This struct offers uses RelativeReserveProvider to output relative views of multilocations -/// However, additionally accepts a MultiLocation that aims at representing the chain part +/// However, additionally accepts a Location that aims at representing the chain part /// (parent: 1, Parachain(paraId)) of the absolute representation of our chain. -/// If a token reserve matches against this absolute view, we return Some(MultiLocation::here()) +/// If a token reserve matches against this absolute view, we return Some(Location::here()) /// This helps users by preventing errors when they try to transfer a token through xtokens /// to our chain (either inserting the relative or the absolute value). pub struct AbsoluteAndRelativeReserve(PhantomData); impl Reserve for AbsoluteAndRelativeReserve where - AbsoluteMultiLocation: Get, + AbsoluteMultiLocation: Get, { - fn reserve(asset: &MultiAsset) -> Option { + fn reserve(asset: &Asset) -> Option { RelativeReserveProvider::reserve(asset).map(|relative_reserve| { if relative_reserve == AbsoluteMultiLocation::get() { - MultiLocation::here() + Location::here() } else { relative_reserve } diff --git a/primitives/xcm/src/transactor_traits.rs b/primitives/xcm/src/transactor_traits.rs index d2243a6c70..5a50350e94 100644 --- a/primitives/xcm/src/transactor_traits.rs +++ b/primitives/xcm/src/transactor_traits.rs @@ -18,7 +18,7 @@ use cumulus_primitives_core::{ ParaId, }; use sp_std::vec::Vec; -use xcm::latest::{Error as XcmError, MultiLocation}; +use xcm::latest::{Error as XcmError, Location}; // The utility calls that need to be implemented as part of // using a derivative account from a certain account @@ -63,7 +63,7 @@ impl HrmpEncodeCall for () { // It must implement UtilityEncodeCall pub trait XcmTransact: UtilityEncodeCall { /// Encode call from the relay. - fn destination(self) -> MultiLocation; + fn destination(self) -> Location; } pub enum AvailableStakeCalls { diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index c87a4f7d7e..309b670079 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,5 +1,5 @@ [package] -authors = {workspace = true} +authors = { workspace = true } description = "Common code shared between runtimes" edition = "2021" homepage = "https://moonbeam.network" @@ -13,131 +13,134 @@ impl-trait-for-tuples = "0.2.1" log = "0.4" # Moonbeam -moonbeam-xcm-benchmarks = {workspace = true} -pallet-asset-manager = {workspace = true} -pallet-author-mapping = {workspace = true} -pallet-conviction-voting = {workspace = true} -pallet-ethereum-xcm = {workspace = true} -pallet-migrations = {workspace = true} -pallet-moonbeam-lazy-migrations = {workspace = true} -pallet-parachain-staking = {workspace = true} -pallet-precompile-benchmarks = {workspace = true} -pallet-randomness = {workspace = true} -pallet-relay-storage-roots = {workspace = true} -pallet-xcm-transactor = {workspace = true} -precompile-utils = {workspace = true} -xcm-primitives = {workspace = true} +moonbeam-xcm-benchmarks = { workspace = true } +pallet-asset-manager = { workspace = true } +pallet-author-mapping = { workspace = true } +pallet-conviction-voting = { workspace = true } +pallet-ethereum-xcm = { workspace = true } +pallet-migrations = { workspace = true } +pallet-moonbeam-lazy-migrations = { workspace = true } +pallet-parachain-staking = { workspace = true } +pallet-precompile-benchmarks = { workspace = true } +pallet-randomness = { workspace = true } +pallet-relay-storage-roots = { workspace = true } +pallet-xcm-transactor = { workspace = true } +precompile-utils = { workspace = true } +xcm-primitives = { workspace = true } # Substrate -cumulus-pallet-xcmp-queue = {workspace = true} -frame-benchmarking = {workspace = true} -frame-support = {workspace = true} -frame-system = {workspace = true} -pallet-assets = {workspace = true} -pallet-balances = {workspace = true} -pallet-collective = {workspace = true} -pallet-crowdloan-rewards = {workspace = true} -pallet-identity = {workspace = true} -pallet-moonbeam-orbiters = {workspace = true} -pallet-multisig = {workspace = true} -pallet-preimage = {workspace = true} -pallet-proxy = {workspace = true} -pallet-referenda = {workspace = true} -pallet-scheduler = {workspace = true} -pallet-sudo = {workspace = true} -pallet-timestamp = {workspace = true} -pallet-treasury = {workspace = true} -pallet-utility = {workspace = true} -pallet-whitelist = {workspace = true} -pallet-xcm = {workspace = true} -sp-api = {workspace = true} -sp-consensus-slots = {workspace = true} -sp-core = {workspace = true} -sp-io = {workspace = true} -sp-runtime = {workspace = true} -sp-std = {workspace = true} +cumulus-pallet-xcmp-queue = { workspace = true } +frame-benchmarking = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +pallet-assets = { workspace = true } +pallet-balances = { workspace = true } +pallet-collective = { workspace = true } +pallet-crowdloan-rewards = { workspace = true } +pallet-identity = { workspace = true } +pallet-moonbeam-orbiters = { workspace = true } +pallet-multisig = { workspace = true } +pallet-preimage = { workspace = true } +pallet-proxy = { workspace = true } +pallet-referenda = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-treasury = { workspace = true } +pallet-utility = { workspace = true } +pallet-whitelist = { workspace = true } +pallet-xcm = { workspace = true } +sp-api = { workspace = true } +sp-consensus-slots = { workspace = true } +sp-core = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } +sp-genesis-builder = { workspace = true } +frame-try-runtime = { workspace = true } # Frontier -fp-ethereum = {workspace = true} -fp-evm = {workspace = true} -pallet-evm = {workspace = true, features = ["forbid-evm-reentrancy"]} -pallet-evm-chain-id = {workspace = true} +fp-ethereum = { workspace = true } +fp-evm = { workspace = true } +pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] } +pallet-evm-chain-id = { workspace = true } # Moonkit -nimbus-primitives = {workspace = true} -pallet-async-backing = {workspace = true} -pallet-author-inherent = {workspace = true} -pallet-author-slot-filter = {workspace = true} +nimbus-primitives = { workspace = true } +pallet-async-backing = { workspace = true } +pallet-author-inherent = { workspace = true } +pallet-author-slot-filter = { workspace = true } # Polkadot -xcm = {workspace = true} -xcm-builder = {workspace = true} -xcm-executor = {workspace = true} +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Parity -parity-scale-codec = {workspace = true} +parity-scale-codec = { workspace = true } -account = {workspace = true} +account = { workspace = true } [features] -runtime-benchmarks = [ - "cumulus-pallet-xcmp-queue/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "pallet-asset-manager/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", - "pallet-author-inherent/runtime-benchmarks", - "pallet-author-mapping/runtime-benchmarks", - "pallet-author-slot-filter/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-conviction-voting/runtime-benchmarks", - "pallet-crowdloan-rewards/runtime-benchmarks", - "pallet-ethereum-xcm/runtime-benchmarks", - "pallet-evm/runtime-benchmarks", - "pallet-identity/runtime-benchmarks", - "pallet-moonbeam-orbiters/runtime-benchmarks", - "pallet-multisig/runtime-benchmarks", - "pallet-parachain-staking/runtime-benchmarks", - "pallet-preimage/runtime-benchmarks", - "pallet-proxy/runtime-benchmarks", - "pallet-randomness/runtime-benchmarks", - "pallet-referenda/runtime-benchmarks", - "pallet-referenda/runtime-benchmarks", - "pallet-scheduler/runtime-benchmarks", - "pallet-sudo/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-treasury/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-whitelist/runtime-benchmarks", - "pallet-xcm-transactor/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "pallet-moonbeam-lazy-migrations/runtime-benchmarks", - "moonbeam-xcm-benchmarks/runtime-benchmarks", -] std = [ - "fp-ethereum/std", - "fp-evm/std", - "frame-support/std", - "pallet-asset-manager/std", - "pallet-async-backing/std", - "pallet-author-inherent/std", - "pallet-author-mapping/std", - "pallet-ethereum-xcm/std", - "pallet-evm/std", - "pallet-migrations/std", - "pallet-parachain-staking/std", - "pallet-randomness/std", - "pallet-referenda/std", - "pallet-scheduler/std", - "pallet-xcm-transactor/std", - "pallet-moonbeam-lazy-migrations/std", - "parity-scale-codec/std", - "precompile-utils/std", - "sp-consensus-slots/std", - "sp-core/std", - "sp-runtime/std", - "sp-std/std", - "xcm-executor/std", - "xcm/std", - "account/std", + "fp-ethereum/std", + "fp-evm/std", + "frame-support/std", + "pallet-asset-manager/std", + "pallet-async-backing/std", + "pallet-author-inherent/std", + "pallet-author-mapping/std", + "pallet-ethereum-xcm/std", + "pallet-evm/std", + "pallet-migrations/std", + "pallet-parachain-staking/std", + "pallet-randomness/std", + "pallet-referenda/std", + "pallet-scheduler/std", + "pallet-xcm-transactor/std", + "pallet-moonbeam-lazy-migrations/std", + "pallet-identity/std", + "parity-scale-codec/std", + "precompile-utils/std", + "sp-consensus-slots/std", + "sp-core/std", + "sp-runtime/std", + "sp-std/std", + "sp-genesis-builder/std", + "xcm-executor/std", + "xcm/std", + "account/std", +] +runtime-benchmarks = [ + "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "pallet-asset-manager/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", + "pallet-author-inherent/runtime-benchmarks", + "pallet-author-mapping/runtime-benchmarks", + "pallet-author-slot-filter/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-conviction-voting/runtime-benchmarks", + "pallet-crowdloan-rewards/runtime-benchmarks", + "pallet-ethereum-xcm/runtime-benchmarks", + "pallet-evm/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-moonbeam-orbiters/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-parachain-staking/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-randomness/runtime-benchmarks", + "pallet-referenda/runtime-benchmarks", + "pallet-referenda/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-whitelist/runtime-benchmarks", + "pallet-xcm-transactor/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "pallet-moonbeam-lazy-migrations/runtime-benchmarks", + "moonbeam-xcm-benchmarks/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime", "pallet-migrations/try-runtime"] diff --git a/runtime/common/src/apis.rs b/runtime/common/src/apis.rs index 368c97f53f..eef538c2b0 100644 --- a/runtime/common/src/apis.rs +++ b/runtime/common/src/apis.rs @@ -27,6 +27,7 @@ macro_rules! impl_runtime_apis_plus_common { // to replay only on_idle, so we need to copy here some code inside frame executive. fn replay_on_idle() { use frame_system::pallet_prelude::BlockNumberFor; + use frame_support::traits::OnIdle; let weight = >::block_weight(); let max_weight = < @@ -114,6 +115,16 @@ macro_rules! impl_runtime_apis_plus_common { } } + impl sp_genesis_builder::GenesisBuilder for Runtime { + fn create_default_config() -> Vec { + frame_support::genesis_builder_helper::create_default_config::() + } + + fn build_config(config: Vec) -> sp_genesis_builder::Result { + frame_support::genesis_builder_helper::build_config::(config) + } + } + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Index { System::account_nonce(account) @@ -124,6 +135,7 @@ macro_rules! impl_runtime_apis_plus_common { fn trace_transaction( extrinsics: Vec<::Extrinsic>, traced_transaction: &EthereumTransaction, + header: &::Header, ) -> Result< (), sp_runtime::DispatchError, @@ -144,6 +156,13 @@ macro_rules! impl_runtime_apis_plus_common { &EthereumXcmTracingStatus::Transaction(traced_transaction.hash()), ); + // Initialize block: calls the "on_initialize" hook on every pallet + // in AllPalletsWithSystem. + // After pallet message queue was introduced, this must be done only after + // enabling XCM tracing by setting ETHEREUM_XCM_TRACING_STORAGE_KEY + // in the storage + Executive::initialize_block(header); + // Apply the a subset of extrinsics: all the substrate-specific or ethereum // transactions that preceded the requested transaction. for ext in extrinsics.into_iter() { @@ -194,6 +213,7 @@ macro_rules! impl_runtime_apis_plus_common { fn trace_block( extrinsics: Vec<::Extrinsic>, known_transactions: Vec, + header: &::Header, ) -> Result< (), sp_runtime::DispatchError, @@ -213,6 +233,13 @@ macro_rules! impl_runtime_apis_plus_common { let mut config = ::config().clone(); config.estimate = true; + // Initialize block: calls the "on_initialize" hook on every pallet + // in AllPalletsWithSystem. + // After pallet message queue was introduced, this must be done only after + // enabling XCM tracing by setting ETHEREUM_XCM_TRACING_STORAGE_KEY + // in the storage + Executive::initialize_block(header); + // Apply all extrinsics. Ethereum extrinsics are traced. for ext in extrinsics.into_iter() { match &ext.0.function { @@ -489,7 +516,7 @@ macro_rules! impl_runtime_apis_plus_common { fn gas_limit_multiplier_support() {} fn pending_block( - xts: Vec<::Extrinsic> + xts: Vec<::Extrinsic> ) -> ( Option, Option> ) { @@ -635,6 +662,8 @@ macro_rules! impl_runtime_apis_plus_common { use frame_support::traits::StorageInfoTrait; use MoonbeamXcmBenchmarks::XcmGenericBenchmarks as MoonbeamXcmGenericBench; + use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsiscsBenchmark; + let mut list = Vec::::new(); list_benchmarks!(list, extra); @@ -648,8 +677,12 @@ macro_rules! impl_runtime_apis_plus_common { ) -> Result, sp_runtime::RuntimeString> { use frame_benchmarking::{add_benchmark, BenchmarkBatch, Benchmarking}; use frame_support::traits::TrackedStorageKey; + use cumulus_primitives_core::ParaId; - use xcm::latest::prelude::*; + use xcm::latest::prelude::{ + GeneralIndex, Junction, Junctions, Location, Response, NetworkId, AssetId, + Assets as XcmAssets, Fungible, Asset, ParentThen, Parachain, Parent + }; use frame_benchmarking::BenchmarkError; use frame_system_benchmarking::Pallet as SystemBench; @@ -659,29 +692,64 @@ macro_rules! impl_runtime_apis_plus_common { impl moonbeam_xcm_benchmarks::generic::Config for Runtime {} use pallet_asset_manager::Config as PalletAssetManagerConfig; + + use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsiscsBenchmark; + type ExistentialDeposit = ConstU128<0>; + parameter_types! { + pub const RandomParaId: ParaId = ParaId::new(43211234); + } + + impl pallet_xcm::benchmarking::Config for Runtime { + fn reachable_dest() -> Option { + Some(Parent.into()) + } + + fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { + // Relay/native token can be teleported between AH and Relay. + Some(( + Asset { + fun: Fungible(ExistentialDeposit::get()), + id: AssetId(Parent.into()) + }, + Parent.into(), + )) + } + + fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> { + Some(( + Asset { + fun: Fungible(ExistentialDeposit::get()), + id: AssetId(Parent.into()) + }, + // AH can reserve transfer native token to some random parachain. + ParentThen(Parachain(RandomParaId::get().into()).into()).into(), + )) + } + } + impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = xcm_config::XcmExecutorConfig; type AccountIdConverter = xcm_config::LocationToAccountId; type DeliveryHelper = (); - fn valid_destination() -> Result { - Ok(MultiLocation::parent()) + fn valid_destination() -> Result { + Ok(Location::parent()) } - fn worst_case_holding(_depositable_count: u32) -> MultiAssets { + fn worst_case_holding(_depositable_count: u32) -> XcmAssets { // 100 fungibles const HOLDING_FUNGIBLES: u32 = 100; let fungibles_amount: u128 = 100; let assets = (0..HOLDING_FUNGIBLES).map(|i| { - let location: MultiLocation = GeneralIndex(i as u128).into(); - MultiAsset { - id: Concrete(location), + let location: Location = GeneralIndex(i as u128).into(); + Asset { + id: AssetId(location), fun: Fungible(fungibles_amount * i as u128), } .into() }) .chain( core::iter::once( - MultiAsset { - id: Concrete(MultiLocation::parent()), + Asset { + id: AssetId(Location::parent()), fun: Fungible(u128::MAX) } ) @@ -690,22 +758,22 @@ macro_rules! impl_runtime_apis_plus_common { for (i, asset) in assets.iter().enumerate() { - if let MultiAsset { - id: Concrete(location), + if let Asset { + id: AssetId(location), fun: Fungible(_) } = asset { ::AssetId, ::ForeignAssetType> >::set_asset_type_asset_id( - location.clone().into(), + location.clone().try_into().expect("convert to v3"), i as u128 ); // set 1-1 ::ForeignAssetType> >::set_units_per_second( - location.clone().into(), + location.clone().try_into().expect("convert to v3"), 1_000_000_000_000u128 ); } @@ -723,45 +791,49 @@ macro_rules! impl_runtime_apis_plus_common { } fn worst_case_asset_exchange() - -> Result<(MultiAssets, MultiAssets), BenchmarkError> { + -> Result<(XcmAssets, XcmAssets), BenchmarkError> { Err(BenchmarkError::Skip) } - fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> { + fn universal_alias() -> Result<(Location, Junction), BenchmarkError> { Err(BenchmarkError::Skip) } fn export_message_origin_and_destination() - -> Result<(MultiLocation, NetworkId, Junctions), BenchmarkError> { + -> Result<(Location, NetworkId, Junctions), BenchmarkError> { Err(BenchmarkError::Skip) } fn transact_origin_and_runtime_call() - -> Result<(MultiLocation, RuntimeCall), BenchmarkError> { - Ok((MultiLocation::parent(), frame_system::Call::remark_with_event { + -> Result<(Location, RuntimeCall), BenchmarkError> { + Ok((Location::parent(), frame_system::Call::remark_with_event { remark: vec![] }.into())) } - fn subscribe_origin() -> Result { - Ok(MultiLocation::parent()) + fn subscribe_origin() -> Result { + Ok(Location::parent()) } fn claimable_asset() - -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> { - let origin = MultiLocation::parent(); - let assets: MultiAssets = (Concrete(MultiLocation::parent()), 1_000u128) + -> Result<(Location, Location, XcmAssets), BenchmarkError> { + let origin = Location::parent(); + let assets: XcmAssets = (AssetId(Location::parent()), 1_000u128) .into(); - let ticket = MultiLocation { parents: 0, interior: Here }; + let ticket = Location { parents: 0, interior: [].into() /* Here */ }; Ok((origin, ticket, assets)) } + fn fee_asset() -> Result { + Err(BenchmarkError::Skip) + } + fn unlockable_asset() - -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> { + -> Result<(Location, Location, Asset), BenchmarkError> { Err(BenchmarkError::Skip) } - fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> { + fn alias_origin() -> Result<(Location, Location), BenchmarkError> { Err(BenchmarkError::Skip) } } diff --git a/runtime/common/src/migrations.rs b/runtime/common/src/migrations.rs index e3a7f12d5f..46cc6a4b28 100644 --- a/runtime/common/src/migrations.rs +++ b/runtime/common/src/migrations.rs @@ -19,10 +19,6 @@ //! This module acts as a registry where each migration is defined. Each migration should implement //! the "Migration" trait declared in the pallet-migrations crate. -#[cfg(feature = "try-runtime")] -use frame_support::ensure; -#[cfg(feature = "try-runtime")] -use frame_support::migration::get_storage_value; use frame_support::{ parameter_types, storage::unhashed::contains_prefixed_key, traits::OnRuntimeUpgrade, weights::Weight, @@ -92,7 +88,7 @@ where #[cfg(feature = "try-runtime")] fn pre_upgrade(&self) -> Result, sp_runtime::DispatchError> { - frame_support::migrations::RemovePallet::< + let _ = frame_support::migrations::RemovePallet::< DemocracyPalletName, ::DbWeight, >::pre_upgrade(); @@ -102,7 +98,7 @@ where #[cfg(feature = "try-runtime")] fn post_upgrade(&self, _state: Vec) -> Result<(), sp_runtime::DispatchError> { - frame_support::migrations::RemovePallet::< + let _ = frame_support::migrations::RemovePallet::< DemocracyPalletName, ::DbWeight, >::post_upgrade(_state); @@ -110,6 +106,30 @@ where } } +pub struct MigrateToLatestXcmVersion(PhantomData); +impl Migration for MigrateToLatestXcmVersion +where + pallet_xcm::migration::MigrateToLatestXcmVersion: OnRuntimeUpgrade, +{ + fn friendly_name(&self) -> &str { + "MM_MigrateToLatestXcmVersion" + } + + fn migrate(&self, _available_weight: Weight) -> Weight { + pallet_xcm::migration::MigrateToLatestXcmVersion::::on_runtime_upgrade() + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade(&self) -> Result, sp_runtime::DispatchError> { + pallet_xcm::migration::MigrateToLatestXcmVersion::::pre_upgrade() + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(&self, state: Vec) -> Result<(), sp_runtime::DispatchError> { + pallet_xcm::migration::MigrateToLatestXcmVersion::::post_upgrade(state) + } +} + pub struct CommonMigrations(PhantomData); impl GetMigrations for CommonMigrations @@ -120,11 +140,11 @@ where Runtime: AuthorSlotFilterConfig, Runtime: pallet_preimage::Config, Runtime: pallet_asset_manager::Config, - ::ForeignAssetType: From, Runtime: pallet_xcm_transactor::Config, Runtime: pallet_moonbeam_orbiters::Config, Runtime: pallet_balances::Config, Runtime: pallet_referenda::Config, + Runtime: pallet_xcm::Config, Runtime::AccountId: Default, BlockNumberFor: Into, { @@ -264,6 +284,8 @@ where // Box::new(pallet_collective_drop_gov_v1_collectives), // completed in runtime 2900 Box::new(remove_pallet_democracy), + // permanent migrations + Box::new(MigrateToLatestXcmVersion::(Default::default())), ] } } diff --git a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs index 509739e662..26abb12c14 100644 --- a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs @@ -57,9 +57,29 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:1) + /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn set_config_with_weight() -> Weight { + /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) + /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) + /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `MessageQueue::Pages` (r:0 w:1) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) + fn enqueue_xcmp_message() -> Weight { + // Proof Size summary in bytes: + // Measured: `148` + // Estimated: `3517` + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(12_000_000, 0) + .saturating_add(Weight::from_parts(0, 3517)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn suspend_channel() -> Weight { // Proof Size summary in bytes: // Measured: `142` // Estimated: `1627` @@ -69,4 +89,62 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn resume_channel() -> Weight { + // Proof Size summary in bytes: + // Measured: `177` + // Estimated: `1662` + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) + .saturating_add(Weight::from_parts(0, 1662)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + fn take_first_concatenated_xcm() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) + /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) + /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) + /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) + /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) + /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `MessageQueue::Pages` (r:0 w:1) + /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) + fn on_idle_good_msg() -> Weight { + // Proof Size summary in bytes: + // Measured: `65777` + // Estimated: `69242` + // Minimum execution time: 44_000_000 picoseconds. + Weight::from_parts(45_000_000, 0) + .saturating_add(Weight::from_parts(0, 69242)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) + fn on_idle_large_msg() -> Weight { + // Proof Size summary in bytes: + // Measured: `65776` + // Estimated: `69241` + // Minimum execution time: 28_000_000 picoseconds. + Weight::from_parts(30_000_000, 0) + .saturating_add(Weight::from_parts(0, 69241)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } } diff --git a/runtime/common/src/weights/pallet_balances.rs b/runtime/common/src/weights/pallet_balances.rs index e4d532c9b2..afe11d96d2 100644 --- a/runtime/common/src/weights/pallet_balances.rs +++ b/runtime/common/src/weights/pallet_balances.rs @@ -145,4 +145,15 @@ impl pallet_balances::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2591).saturating_mul(u.into())) } + /// Storage: `Balances::InactiveIssuance` (r:1 w:0) + /// Proof: `Balances::InactiveIssuance` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + fn force_adjust_total_issuance() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `1501` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) + .saturating_add(Weight::from_parts(0, 1501)) + .saturating_add(T::DbWeight::get().reads(1)) + } } diff --git a/runtime/common/src/weights/pallet_identity.rs b/runtime/common/src/weights/pallet_identity.rs index d07315afe0..cf46431bb3 100644 --- a/runtime/common/src/weights/pallet_identity.rs +++ b/runtime/common/src/weights/pallet_identity.rs @@ -64,7 +64,7 @@ impl pallet_identity::WeightInfo for WeightInfo { /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7526), added: 10001, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 20]`. /// The range of component `x` is `[0, 100]`. - fn set_identity(r: u32, x: u32, ) -> Weight { + fn set_identity(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `430 + r * (5 ±0)` // Estimated: `10991` @@ -73,8 +73,6 @@ impl pallet_identity::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 10991)) // Standard Error: 3_785 .saturating_add(Weight::from_parts(150_588, 0).saturating_mul(r.into())) - // Standard Error: 738 - .saturating_add(Weight::from_parts(514_331, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -129,7 +127,7 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 20]`. /// The range of component `s` is `[0, 100]`. /// The range of component `x` is `[0, 100]`. - fn clear_identity(r: u32, s: u32, x: u32, ) -> Weight { + fn clear_identity(r: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `445 + r * (5 ±0) + s * (20 ±0) + x * (66 ±0)` // Estimated: `10991` @@ -140,8 +138,6 @@ impl pallet_identity::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(275_001, 0).saturating_mul(r.into())) // Standard Error: 1_382 .saturating_add(Weight::from_parts(1_492_955, 0).saturating_mul(s.into())) - // Standard Error: 1_382 - .saturating_add(Weight::from_parts(283_758, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -152,7 +148,7 @@ impl pallet_identity::WeightInfo for WeightInfo { /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7526), added: 10001, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 20]`. /// The range of component `x` is `[0, 100]`. - fn request_judgement(r: u32, x: u32, ) -> Weight { + fn request_judgement(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `355 + r * (45 ±0) + x * (66 ±0)` // Estimated: `10991` @@ -161,8 +157,6 @@ impl pallet_identity::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 10991)) // Standard Error: 3_421 .saturating_add(Weight::from_parts(109_577, 0).saturating_mul(r.into())) - // Standard Error: 667 - .saturating_add(Weight::from_parts(537_126, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -170,7 +164,7 @@ impl pallet_identity::WeightInfo for WeightInfo { /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7526), added: 10001, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 20]`. /// The range of component `x` is `[0, 100]`. - fn cancel_request(r: u32, x: u32, ) -> Weight { + fn cancel_request(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `386 + x * (66 ±0)` // Estimated: `10991` @@ -179,8 +173,6 @@ impl pallet_identity::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 10991)) // Standard Error: 3_232 .saturating_add(Weight::from_parts(84_735, 0).saturating_mul(r.into())) - // Standard Error: 630 - .saturating_add(Weight::from_parts(531_372, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -235,7 +227,7 @@ impl pallet_identity::WeightInfo for WeightInfo { /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7526), added: 10001, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 19]`. /// The range of component `x` is `[0, 100]`. - fn provide_judgement(r: u32, x: u32, ) -> Weight { + fn provide_judgement(r: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `421 + r * (45 ±0) + x * (66 ±0)` // Estimated: `10991` @@ -244,8 +236,6 @@ impl pallet_identity::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 10991)) // Standard Error: 4_037 .saturating_add(Weight::from_parts(77_912, 0).saturating_mul(r.into())) - // Standard Error: 747 - .saturating_add(Weight::from_parts(883_021, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -260,7 +250,7 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 20]`. /// The range of component `s` is `[0, 100]`. /// The range of component `x` is `[0, 100]`. - fn kill_identity(r: u32, s: u32, x: u32, ) -> Weight { + fn kill_identity(r: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `712 + r * (5 ±0) + s * (20 ±0) + x * (66 ±0)` // Estimated: `10991` @@ -271,8 +261,6 @@ impl pallet_identity::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(283_613, 0).saturating_mul(r.into())) // Standard Error: 1_430 .saturating_add(Weight::from_parts(1_493_205, 0).saturating_mul(s.into())) - // Standard Error: 1_430 - .saturating_add(Weight::from_parts(282_393, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -351,4 +339,101 @@ impl pallet_identity::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } -} + /// Storage: `Identity::UsernameAuthorities` (r:0 w:1) + /// Proof: `Identity::UsernameAuthorities` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + fn add_username_authority() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 6_000_000 picoseconds. + Weight::from_parts(7_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Identity::UsernameAuthorities` (r:1 w:1) + /// Proof: `Identity::UsernameAuthorities` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + fn remove_username_authority() -> Weight { + // Proof Size summary in bytes: + // Measured: `67` + // Estimated: `3505` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) + .saturating_add(Weight::from_parts(0, 3505)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Identity::UsernameAuthorities` (r:1 w:1) + /// Proof: `Identity::UsernameAuthorities` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Identity::AccountOfUsername` (r:1 w:1) + /// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) + /// Storage: `Identity::PendingUsernames` (r:1 w:0) + /// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) + /// Storage: `Identity::IdentityOf` (r:1 w:1) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7560), added: 10035, mode: `MaxEncodedLen`) + fn set_username_for() -> Weight { + // Proof Size summary in bytes: + // Measured: `67` + // Estimated: `11025` + // Minimum execution time: 21_000_000 picoseconds. + Weight::from_parts(23_000_000, 0) + .saturating_add(Weight::from_parts(0, 11025)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Identity::PendingUsernames` (r:1 w:1) + /// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) + /// Storage: `Identity::IdentityOf` (r:1 w:1) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7560), added: 10035, mode: `MaxEncodedLen`) + /// Storage: `Identity::AccountOfUsername` (r:0 w:1) + /// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) + fn accept_username() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `11025` + // Minimum execution time: 19_000_000 picoseconds. + Weight::from_parts(20_000_000, 0) + .saturating_add(Weight::from_parts(0, 11025)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Identity::PendingUsernames` (r:1 w:1) + /// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) + fn remove_expired_approval() -> Weight { + // Proof Size summary in bytes: + // Measured: `101` + // Estimated: `3538` + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(30_000_000, 0) + .saturating_add(Weight::from_parts(0, 3538)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Identity::AccountOfUsername` (r:1 w:0) + /// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) + /// Storage: `Identity::IdentityOf` (r:1 w:1) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7560), added: 10035, mode: `MaxEncodedLen`) + fn set_primary_username() -> Weight { + // Proof Size summary in bytes: + // Measured: `232` + // Estimated: `11025` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 0) + .saturating_add(Weight::from_parts(0, 11025)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Identity::AccountOfUsername` (r:1 w:1) + /// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) + /// Storage: `Identity::IdentityOf` (r:1 w:0) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7560), added: 10035, mode: `MaxEncodedLen`) + fn remove_dangling_username() -> Weight { + // Proof Size summary in bytes: + // Measured: `86` + // Estimated: `11025` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) + .saturating_add(Weight::from_parts(0, 11025)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} \ No newline at end of file diff --git a/runtime/common/src/weights/pallet_sudo.rs b/runtime/common/src/weights/pallet_sudo.rs index 58c4f8adb8..fce6e127cb 100644 --- a/runtime/common/src/weights/pallet_sudo.rs +++ b/runtime/common/src/weights/pallet_sudo.rs @@ -79,4 +79,16 @@ impl pallet_sudo::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 1505)) .saturating_add(T::DbWeight::get().reads(1)) } + /// Storage: `Sudo::Key` (r:1 w:1) + /// Proof: `Sudo::Key` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) + fn remove_key() -> Weight { + // Proof Size summary in bytes: + // Measured: `153` + // Estimated: `1505` + // Minimum execution time: 7_000_000 picoseconds. + Weight::from_parts(8_000_000, 0) + .saturating_add(Weight::from_parts(0, 1505)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } } diff --git a/runtime/common/src/weights/pallet_xcm.rs b/runtime/common/src/weights/pallet_xcm.rs index f871268f7e..80d9f5f9c8 100644 --- a/runtime/common/src/weights/pallet_xcm.rs +++ b/runtime/common/src/weights/pallet_xcm.rs @@ -279,4 +279,40 @@ impl pallet_xcm::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(4)) } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn transfer_assets() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn new_query() -> Weight { + // Proof Size summary in bytes: + // Measured: `69` + // Estimated: `1554` + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(5_000_000, 0) + .saturating_add(Weight::from_parts(0, 1554)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PolkadotXcm::Queries` (r:1 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn take_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `7706` + // Estimated: `11171` + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(31_000_000, 0) + .saturating_add(Weight::from_parts(0, 11171)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } } diff --git a/runtime/moonbase/Cargo.toml b/runtime/moonbase/Cargo.toml index 4b0f51527b..6a4a8baaed 100644 --- a/runtime/moonbase/Cargo.toml +++ b/runtime/moonbase/Cargo.toml @@ -1,5 +1,5 @@ [package] -authors = {workspace = true} +authors = { workspace = true } build = "build.rs" description = "Moonbase Runtime" edition = "2021" @@ -9,293 +9,298 @@ name = "moonbase-runtime" version = "0.8.4" [dependencies] -hex-literal = {workspace = true, optional = true} -log = {workspace = true} -num_enum = {workspace = true} -rlp = {workspace = true, optional = true} -serde = {workspace = true, features = ["derive"]} -sha3 = {workspace = true, optional = true} -smallvec = {workspace = true} -strum = {workspace = true} -strum_macros = {workspace = true} +hex-literal = { workspace = true, optional = true } +log = { workspace = true } +num_enum = { workspace = true } +rlp = { workspace = true, optional = true } +serde = { workspace = true, features = ["derive"] } +sha3 = { workspace = true, optional = true } +smallvec = { workspace = true } +strum = { workspace = true } +strum_macros = { workspace = true } # Moonbeam -account = {workspace = true} -moonbeam-core-primitives = {workspace = true} -moonbeam-relay-encoder = {workspace = true} -moonbeam-runtime-common = {workspace = true} -precompile-utils = {workspace = true} -session-keys-primitives = {workspace = true} -xcm-primitives = {workspace = true} +account = { workspace = true } +moonbeam-core-primitives = { workspace = true } +moonbeam-relay-encoder = { workspace = true } +moonbeam-runtime-common = { workspace = true } +precompile-utils = { workspace = true } +session-keys-primitives = { workspace = true } +xcm-primitives = { workspace = true } # Moonbeam pallets -moonbeam-xcm-benchmarks = {workspace = true} -pallet-asset-manager = {workspace = true} -pallet-author-mapping = {workspace = true} -pallet-crowdloan-rewards = {workspace = true} -pallet-erc20-xcm-bridge = {workspace = true} -pallet-ethereum-xcm = {workspace = true} -pallet-evm-chain-id = {workspace = true} -pallet-maintenance-mode = {workspace = true, features = ["xcm-support"]} -pallet-migrations = {workspace = true} -pallet-moonbeam-lazy-migrations = {workspace = true} -pallet-moonbeam-orbiters = {workspace = true} -pallet-parachain-staking = {workspace = true} -pallet-precompile-benchmarks = {workspace = true} -pallet-proxy-genesis-companion = {workspace = true} -pallet-randomness = {workspace = true} -pallet-xcm-transactor = {workspace = true} +moonbeam-xcm-benchmarks = { workspace = true } +pallet-asset-manager = { workspace = true } +pallet-author-mapping = { workspace = true } +pallet-crowdloan-rewards = { workspace = true } +pallet-erc20-xcm-bridge = { workspace = true } +pallet-ethereum-xcm = { workspace = true } +pallet-evm-chain-id = { workspace = true } +pallet-maintenance-mode = { workspace = true, features = ["xcm-support"] } +pallet-migrations = { workspace = true } +pallet-moonbeam-lazy-migrations = { workspace = true } +pallet-moonbeam-orbiters = { workspace = true } +pallet-parachain-staking = { workspace = true } +pallet-precompile-benchmarks = { workspace = true } +pallet-proxy-genesis-companion = { workspace = true } +pallet-randomness = { workspace = true } +pallet-xcm-transactor = { workspace = true } # Moonbeam precompiles -pallet-evm-precompile-author-mapping = {workspace = true} -pallet-evm-precompile-balances-erc20 = {workspace = true} -pallet-evm-precompile-batch = {workspace = true} -pallet-evm-precompile-call-permit = {workspace = true} -pallet-evm-precompile-collective = {workspace = true} -pallet-evm-precompile-conviction-voting = {workspace = true} -pallet-evm-precompile-crowdloan-rewards = {workspace = true} -pallet-evm-precompile-gmp = {workspace = true} -pallet-evm-precompile-identity = {workspace = true} -pallet-evm-precompile-parachain-staking = {workspace = true} -pallet-evm-precompile-preimage = {workspace = true} -pallet-evm-precompile-proxy = {workspace = true} -pallet-evm-precompile-randomness = {workspace = true} -pallet-evm-precompile-referenda = {workspace = true} -pallet-evm-precompile-registry = {workspace = true} -pallet-evm-precompile-relay-encoder = {workspace = true} -pallet-evm-precompile-relay-verifier = {workspace = true} -pallet-evm-precompile-xcm-transactor = {workspace = true} -pallet-evm-precompile-xcm-utils = {workspace = true} -pallet-evm-precompile-xtokens = {workspace = true} -pallet-evm-precompileset-assets-erc20 = {workspace = true} +pallet-evm-precompile-author-mapping = { workspace = true } +pallet-evm-precompile-balances-erc20 = { workspace = true } +pallet-evm-precompile-batch = { workspace = true } +pallet-evm-precompile-call-permit = { workspace = true } +pallet-evm-precompile-collective = { workspace = true } +pallet-evm-precompile-conviction-voting = { workspace = true } +pallet-evm-precompile-crowdloan-rewards = { workspace = true } +pallet-evm-precompile-gmp = { workspace = true } +pallet-evm-precompile-identity = { workspace = true } +pallet-evm-precompile-parachain-staking = { workspace = true } +pallet-evm-precompile-preimage = { workspace = true } +pallet-evm-precompile-proxy = { workspace = true } +pallet-evm-precompile-randomness = { workspace = true } +pallet-evm-precompile-referenda = { workspace = true } +pallet-evm-precompile-registry = { workspace = true } +pallet-evm-precompile-relay-encoder = { workspace = true } +pallet-evm-precompile-relay-verifier = { workspace = true } +pallet-evm-precompile-xcm-transactor = { workspace = true } +pallet-evm-precompile-xcm-utils = { workspace = true } +pallet-evm-precompile-xtokens = { workspace = true } +pallet-evm-precompileset-assets-erc20 = { workspace = true } # Moonbeam tracing -evm-tracing-events = {workspace = true, optional = true} -moonbeam-evm-tracer = {workspace = true, optional = true} -moonbeam-rpc-primitives-debug = {workspace = true} -moonbeam-rpc-primitives-txpool = {workspace = true} +evm-tracing-events = { workspace = true, optional = true } +moonbeam-evm-tracer = { workspace = true, optional = true } +moonbeam-rpc-primitives-debug = { workspace = true } +moonbeam-rpc-primitives-txpool = { workspace = true } # Substrate -frame-executive = {workspace = true} -frame-support = {workspace = true} -frame-system = {workspace = true} -frame-system-rpc-runtime-api = {workspace = true} -pallet-assets = {workspace = true} -pallet-balances = {workspace = true, features = ["insecure_zero_ed"]} -pallet-collective = {workspace = true} -pallet-conviction-voting = {workspace = true} -pallet-identity = {workspace = true} -pallet-multisig = {workspace = true} -pallet-preimage = {workspace = true} -pallet-proxy = {workspace = true} -pallet-referenda = {workspace = true} -pallet-root-testing = {workspace = true} -pallet-scheduler = {workspace = true} -pallet-society = {workspace = true} -pallet-sudo = {workspace = true} -pallet-timestamp = {workspace = true} -pallet-transaction-payment = {workspace = true} -pallet-transaction-payment-rpc-runtime-api = {workspace = true} -pallet-treasury = {workspace = true} -pallet-utility = {workspace = true} -pallet-whitelist = {workspace = true} -parity-scale-codec = {workspace = true, features = [ - "derive", - "max-encoded-len", - "chain-error", -]} -scale-info = {workspace = true, features = ["derive"]} -sp-api = {workspace = true} -sp-block-builder = {workspace = true} -sp-consensus-slots = {workspace = true} -sp-core = {workspace = true} -sp-debug-derive = {workspace = true} -sp-inherents = {workspace = true} -sp-io = {workspace = true, features = ["improved_panic_error_reporting"]} -sp-offchain = {workspace = true} -sp-runtime = {workspace = true} -sp-session = {workspace = true} -sp-std = {workspace = true} -sp-transaction-pool = {workspace = true} -sp-version = {workspace = true} -sp-weights = {workspace = true} +frame-executive = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +frame-system-rpc-runtime-api = { workspace = true } +pallet-assets = { workspace = true } +pallet-balances = { workspace = true, features = ["insecure_zero_ed"] } +pallet-collective = { workspace = true } +pallet-conviction-voting = { workspace = true } +pallet-identity = { workspace = true } +pallet-multisig = { workspace = true } +pallet-preimage = { workspace = true } +pallet-proxy = { workspace = true } +pallet-referenda = { workspace = true } +pallet-root-testing = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-society = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +pallet-treasury = { workspace = true } +pallet-utility = { workspace = true } +pallet-whitelist = { workspace = true } +parity-scale-codec = { workspace = true, features = [ + "derive", + "max-encoded-len", + "chain-error", +] } +scale-info = { workspace = true, features = ["derive"] } +sp-api = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-slots = { workspace = true } +sp-core = { workspace = true } +sp-debug-derive = { workspace = true } +sp-inherents = { workspace = true } +sp-io = { workspace = true, features = ["improved_panic_error_reporting"] } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } +sp-weights = { workspace = true } +sp-genesis-builder = { workspace = true } # Frontier -fp-evm = {workspace = true} -fp-rpc = {workspace = true} -fp-self-contained = {workspace = true, features = ["serde"]} -pallet-ethereum = {workspace = true, features = ["forbid-evm-reentrancy"]} -pallet-evm = {workspace = true, features = ["forbid-evm-reentrancy"]} -pallet-evm-precompile-blake2 = {workspace = true} -pallet-evm-precompile-bn128 = {workspace = true} -pallet-evm-precompile-dispatch = {workspace = true} -pallet-evm-precompile-modexp = {workspace = true} -pallet-evm-precompile-sha3fips = {workspace = true} -pallet-evm-precompile-simple = {workspace = true} +fp-evm = { workspace = true } +fp-rpc = { workspace = true } +fp-self-contained = { workspace = true, features = ["serde"] } +pallet-ethereum = { workspace = true, features = ["forbid-evm-reentrancy"] } +pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] } +pallet-evm-precompile-blake2 = { workspace = true } +pallet-evm-precompile-bn128 = { workspace = true } +pallet-evm-precompile-dispatch = { workspace = true } +pallet-evm-precompile-modexp = { workspace = true } +pallet-evm-precompile-sha3fips = { workspace = true } +pallet-evm-precompile-simple = { workspace = true } # Polkadot / XCM -orml-traits = {workspace = true} -orml-xcm-support = {workspace = true} -orml-xtokens = {workspace = true} -pallet-xcm = {workspace = true} -pallet-xcm-benchmarks = {workspace = true, optional = true} -polkadot-core-primitives = {workspace = true} -polkadot-parachain = {workspace = true} -polkadot-runtime-common = {workspace = true} -xcm = {workspace = true} -xcm-builder = {workspace = true} -xcm-executor = {workspace = true} +orml-traits = { workspace = true } +orml-xcm-support = { workspace = true } +orml-xtokens = { workspace = true } +pallet-xcm = { workspace = true } +pallet-xcm-benchmarks = { workspace = true, optional = true } +pallet-message-queue = { workspace = true } +polkadot-core-primitives = { workspace = true } +polkadot-parachain = { workspace = true } +polkadot-runtime-common = { workspace = true } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus -cumulus-pallet-dmp-queue = {workspace = true} -cumulus-pallet-parachain-system = {workspace = true} -cumulus-pallet-xcm = {workspace = true} -cumulus-pallet-xcmp-queue = {workspace = true} -cumulus-primitives-core = {workspace = true} -cumulus-primitives-timestamp = {workspace = true} -cumulus-primitives-utility = {workspace = true} -parachain-info = {workspace = true} +cumulus-pallet-dmp-queue = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } +cumulus-pallet-xcm = { workspace = true } +cumulus-pallet-xcmp-queue = { workspace = true } +cumulus-primitives-core = { workspace = true } +cumulus-primitives-timestamp = { workspace = true } +cumulus-primitives-utility = { workspace = true } +parachain-info = { workspace = true } +parachains-common = { workspace = true } # Moonkit -async-backing-primitives = {workspace = true} -moonkit-xcm-primitives = {workspace = true} -nimbus-primitives = {workspace = true} -pallet-async-backing = {workspace = true} -pallet-author-inherent = {workspace = true} -pallet-author-slot-filter = {workspace = true} -pallet-relay-storage-roots = {workspace = true} +async-backing-primitives = { workspace = true } +moonkit-xcm-primitives = { workspace = true } +nimbus-primitives = { workspace = true } +pallet-async-backing = { workspace = true } +pallet-author-inherent = { workspace = true } +pallet-author-slot-filter = { workspace = true } +pallet-relay-storage-roots = { workspace = true } # Benchmarking -frame-benchmarking = {workspace = true, optional = true} -frame-system-benchmarking = {workspace = true, optional = true} -frame-try-runtime = {workspace = true, optional = true} +frame-benchmarking = { workspace = true, optional = true } +frame-system-benchmarking = { workspace = true, optional = true } +frame-try-runtime = { workspace = true, optional = true } [dev-dependencies] -ethereum = {workspace = true} -hex = {workspace = true, features = ["std"]} -sha3 = {workspace = true, features = ["std"]} +ethereum = { workspace = true } +hex = { workspace = true, features = ["std"] } +sha3 = { workspace = true, features = ["std"] } -cumulus-primitives-parachain-inherent = {workspace = true} -cumulus-test-relay-sproof-builder = {workspace = true} +cumulus-primitives-parachain-inherent = { workspace = true } +cumulus-test-relay-sproof-builder = { workspace = true } -frame-metadata = {workspace = true} -pallet-message-queue = {workspace = true} -polkadot-runtime-parachains = {workspace = true} -sp-timestamp = {workspace = true} -xcm-simulator = {workspace = true} +frame-metadata = { workspace = true } +polkadot-runtime-parachains = { workspace = true } +sp-timestamp = { workspace = true } +xcm-simulator = { workspace = true } -precompile-utils = {workspace = true, features = ["std", "testing"]} +precompile-utils = { workspace = true, features = ["std", "testing"] } [build-dependencies] -substrate-wasm-builder = {workspace = true} +substrate-wasm-builder = { workspace = true } [features] default = ["std"] std = [ - "account/std", - "async-backing-primitives/std", - "cumulus-pallet-dmp-queue/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-core/std", - "cumulus-primitives-timestamp/std", - "evm-tracing-events/std", - "fp-evm/std", - "fp-rpc/std", - "fp-self-contained/std", - "frame-benchmarking/std", - "frame-executive/std", - "frame-support/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "moonbeam-core-primitives/std", - "moonbeam-evm-tracer/std", - "moonbeam-relay-encoder/std", - "moonbeam-rpc-primitives-debug/std", - "moonbeam-rpc-primitives-txpool/std", - "moonbeam-runtime-common/std", - "moonkit-xcm-primitives/std", - "nimbus-primitives/std", - "orml-xtokens/std", - "pallet-asset-manager/std", - "pallet-assets/std", - "pallet-async-backing/std", - "pallet-author-inherent/std", - "pallet-author-mapping/std", - "pallet-author-slot-filter/std", - "pallet-balances/std", - "pallet-collective/std", - "pallet-conviction-voting/std", - "pallet-crowdloan-rewards/std", - "pallet-erc20-xcm-bridge/std", - "pallet-evm-chain-id/std", - "pallet-ethereum-xcm/std", - "pallet-ethereum/std", - "pallet-evm-precompile-author-mapping/std", - "pallet-evm-precompile-balances-erc20/std", - "pallet-evm-precompile-batch/std", - "pallet-evm-precompile-call-permit/std", - "pallet-evm-precompile-collective/std", - "pallet-evm-precompile-conviction-voting/std", - "pallet-evm-precompile-parachain-staking/std", - "pallet-evm-precompile-preimage/std", - "pallet-evm-precompile-randomness/std", - "pallet-evm-precompile-referenda/std", - "pallet-evm-precompile-registry/std", - "pallet-evm-precompile-xcm-transactor/std", - "pallet-evm-precompile-xcm-utils/std", - "pallet-evm-precompile-xtokens/std", - "pallet-evm-precompileset-assets-erc20/std", - "pallet-evm/std", - "pallet-identity/std", - "pallet-maintenance-mode/std", - "pallet-migrations/std", - "pallet-moonbeam-lazy-migrations/std", - "pallet-moonbeam-orbiters/std", - "pallet-multisig/std", - "pallet-parachain-staking/std", - "pallet-precompile-benchmarks/std", - "pallet-preimage/std", - "pallet-proxy-genesis-companion/std", - "pallet-proxy/std", - "pallet-randomness/std", - "pallet-referenda/std", - "pallet-relay-storage-roots/std", - "pallet-root-testing/std", - "pallet-scheduler/std", - "pallet-society/std", - "pallet-sudo/std", - "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - "pallet-treasury/std", - "pallet-utility/std", - "pallet-whitelist/std", - "pallet-xcm-transactor/std", - "pallet-xcm/std", - "parachain-info/std", - "parity-scale-codec/std", - "precompile-utils/std", - "scale-info/std", - "session-keys-primitives/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-slots/std", - "sp-core/std", - "sp-inherents/std", - "sp-io/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-std/std", - "sp-transaction-pool/std", - "sp-version/std", - "strum/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm-primitives/std", - "xcm/std", + "account/std", + "async-backing-primitives/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "evm-tracing-events/std", + "fp-evm/std", + "fp-rpc/std", + "fp-self-contained/std", + "frame-benchmarking/std", + "frame-executive/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "moonbeam-core-primitives/std", + "moonbeam-evm-tracer/std", + "moonbeam-relay-encoder/std", + "moonbeam-rpc-primitives-debug/std", + "moonbeam-rpc-primitives-txpool/std", + "moonbeam-runtime-common/std", + "moonkit-xcm-primitives/std", + "nimbus-primitives/std", + "orml-xtokens/std", + "pallet-asset-manager/std", + "pallet-assets/std", + "pallet-async-backing/std", + "pallet-author-inherent/std", + "pallet-author-mapping/std", + "pallet-author-slot-filter/std", + "pallet-balances/std", + "pallet-collective/std", + "pallet-conviction-voting/std", + "pallet-crowdloan-rewards/std", + "pallet-erc20-xcm-bridge/std", + "pallet-evm-chain-id/std", + "pallet-ethereum-xcm/std", + "pallet-ethereum/std", + "pallet-evm-precompile-author-mapping/std", + "pallet-evm-precompile-balances-erc20/std", + "pallet-evm-precompile-batch/std", + "pallet-evm-precompile-call-permit/std", + "pallet-evm-precompile-collective/std", + "pallet-evm-precompile-conviction-voting/std", + "pallet-evm-precompile-parachain-staking/std", + "pallet-evm-precompile-preimage/std", + "pallet-evm-precompile-randomness/std", + "pallet-evm-precompile-referenda/std", + "pallet-evm-precompile-registry/std", + "pallet-evm-precompile-xcm-transactor/std", + "pallet-evm-precompile-xcm-utils/std", + "pallet-evm-precompile-xtokens/std", + "pallet-evm-precompileset-assets-erc20/std", + "pallet-evm/std", + "pallet-identity/std", + "pallet-maintenance-mode/std", + "pallet-migrations/std", + "pallet-moonbeam-lazy-migrations/std", + "pallet-moonbeam-orbiters/std", + "pallet-multisig/std", + "pallet-parachain-staking/std", + "pallet-precompile-benchmarks/std", + "pallet-preimage/std", + "pallet-proxy-genesis-companion/std", + "pallet-proxy/std", + "pallet-randomness/std", + "pallet-referenda/std", + "pallet-relay-storage-roots/std", + "pallet-root-testing/std", + "pallet-scheduler/std", + "pallet-society/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "pallet-utility/std", + "pallet-whitelist/std", + "pallet-xcm-transactor/std", + "pallet-xcm/std", + "parachain-info/std", + "parachains-common/std", + "parity-scale-codec/std", + "precompile-utils/std", + "scale-info/std", + "session-keys-primitives/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-slots/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "sp-genesis-builder/std", + "strum/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm-primitives/std", + "xcm/std", ] # Must be enabled for tracing runtimes only @@ -313,79 +318,111 @@ runtime-wasm = [] on-chain-release-build = ["sp-api/disable-logging"] runtime-benchmarks = [ - "cumulus-pallet-parachain-system/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "hex-literal", - "moonbeam-relay-encoder/runtime-benchmarks", - "moonbeam-runtime-common/runtime-benchmarks", - "moonbeam-xcm-benchmarks/runtime-benchmarks", - "pallet-asset-manager/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", - "pallet-author-inherent/runtime-benchmarks", - "pallet-author-mapping/runtime-benchmarks", - "pallet-author-slot-filter/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-collective/runtime-benchmarks", - "pallet-conviction-voting/runtime-benchmarks", - "pallet-crowdloan-rewards/runtime-benchmarks", - "pallet-ethereum-xcm/runtime-benchmarks", - "pallet-ethereum/runtime-benchmarks", - "pallet-evm/runtime-benchmarks", - "pallet-identity/runtime-benchmarks", - "pallet-migrations/runtime-benchmarks", - "pallet-moonbeam-lazy-migrations/runtime-benchmarks", - "pallet-moonbeam-orbiters/runtime-benchmarks", - "pallet-multisig/runtime-benchmarks", - "pallet-parachain-staking/runtime-benchmarks", - "pallet-precompile-benchmarks/runtime-benchmarks", - "pallet-preimage/runtime-benchmarks", - "pallet-proxy/runtime-benchmarks", - "pallet-randomness/runtime-benchmarks", - "pallet-referenda/runtime-benchmarks", - "pallet-relay-storage-roots/runtime-benchmarks", - "pallet-scheduler/runtime-benchmarks", - "pallet-society/runtime-benchmarks", - "pallet-sudo/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-treasury/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-whitelist/runtime-benchmarks", - "pallet-xcm-benchmarks", - "pallet-xcm-transactor/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "session-keys-primitives/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", + "cumulus-pallet-parachain-system/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "hex-literal", + "moonbeam-relay-encoder/runtime-benchmarks", + "moonbeam-runtime-common/runtime-benchmarks", + "moonbeam-xcm-benchmarks/runtime-benchmarks", + "parachains-common/runtime-benchmarks", + "pallet-asset-manager/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", + "pallet-author-inherent/runtime-benchmarks", + "pallet-author-mapping/runtime-benchmarks", + "pallet-author-slot-filter/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-conviction-voting/runtime-benchmarks", + "pallet-crowdloan-rewards/runtime-benchmarks", + "pallet-ethereum-xcm/runtime-benchmarks", + "pallet-ethereum/runtime-benchmarks", + "pallet-evm/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-migrations/runtime-benchmarks", + "pallet-moonbeam-lazy-migrations/runtime-benchmarks", + "pallet-moonbeam-orbiters/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-parachain-staking/runtime-benchmarks", + "pallet-precompile-benchmarks/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-randomness/runtime-benchmarks", + "pallet-referenda/runtime-benchmarks", + "pallet-relay-storage-roots/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-society/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-whitelist/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", + "pallet-xcm-transactor/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "session-keys-primitives/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", ] try-runtime = [ - "fp-self-contained/try-runtime", - "frame-executive/try-runtime", - "frame-system/try-runtime", - "frame-try-runtime", - "moonbeam-runtime-common/try-runtime", - "pallet-asset-manager/try-runtime", - "pallet-author-mapping/try-runtime", - "pallet-author-slot-filter/try-runtime", - "pallet-balances/try-runtime", - "pallet-collective/try-runtime", - "pallet-conviction-voting/try-runtime", - "pallet-maintenance-mode/try-runtime", - "pallet-maintenance-mode/try-runtime", - "pallet-migrations/try-runtime", - "pallet-moonbeam-lazy-migrations/try-runtime", - "pallet-parachain-staking/try-runtime", - "pallet-preimage/try-runtime", - "pallet-referenda/try-runtime", - "pallet-relay-storage-roots/try-runtime", - "pallet-root-testing/try-runtime", - "pallet-scheduler/try-runtime", - "pallet-society/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-xcm-transactor/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "fp-self-contained/try-runtime", + "frame-executive/try-runtime", + "frame-system/try-runtime", + "frame-try-runtime", + "moonbeam-runtime-common/try-runtime", + "pallet-asset-manager/try-runtime", + "pallet-author-mapping/try-runtime", + "pallet-author-slot-filter/try-runtime", + "pallet-balances/try-runtime", + "pallet-collective/try-runtime", + "pallet-conviction-voting/try-runtime", + "pallet-maintenance-mode/try-runtime", + "pallet-migrations/try-runtime", + "pallet-moonbeam-lazy-migrations/try-runtime", + "pallet-parachain-staking/try-runtime", + "pallet-preimage/try-runtime", + "pallet-referenda/try-runtime", + "pallet-relay-storage-roots/try-runtime", + "pallet-root-testing/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-society/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-xcm-transactor/try-runtime", + "pallet-xcm/try-runtime", + "pallet-message-queue/try-runtime", + "pallet-utility/try-runtime", + "pallet-sudo/try-runtime", + "pallet-transaction-payment/try-runtime", + "parachain-info/try-runtime", + "pallet-evm-chain-id/try-runtime", + "parachain-info/try-runtime", + "pallet-evm/try-runtime", + "pallet-ethereum/try-runtime", + "pallet-treasury/try-runtime", + "pallet-author-inherent/try-runtime", + "pallet-crowdloan-rewards/try-runtime", + "pallet-proxy/try-runtime", + "pallet-identity/try-runtime", + "orml-xtokens/try-runtime", + "pallet-assets/try-runtime", + "pallet-xcm-transactor/try-runtime", + "pallet-proxy-genesis-companion/try-runtime", + "pallet-moonbeam-orbiters/try-runtime", + "pallet-ethereum-xcm/try-runtime", + "pallet-randomness/try-runtime", + "pallet-whitelist/try-runtime", + "pallet-erc20-xcm-bridge/try-runtime", + "pallet-multisig/try-runtime", + "pallet-async-backing/try-runtime", + "pallet-precompile-benchmarks/try-runtime", ] moonbase-runtime-benchmarks = [] diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 70c81dd552..3a9fc78bd8 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -54,7 +54,7 @@ use account::AccountId20; use cumulus_pallet_parachain_system::{ RelayChainStateProof, RelayNumberMonotonicallyIncreases, RelaychainDataProvider, }; -use cumulus_primitives_core::relay_chain; +use cumulus_primitives_core::{relay_chain, AggregateMessageOrigin}; use fp_rpc::TransactionStatus; use frame_support::{ construct_runtime, @@ -67,8 +67,8 @@ use frame_support::{ tokens::imbalance::ResolveTo, tokens::{PayFromAccount, UnityAssetBalanceConversion}, ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, - EqualPrivilegeOnly, FindAuthor, Imbalance, InstanceFilter, LinearStoragePrice, - OffchainWorker, OnFinalize, OnIdle, OnInitialize, OnRuntimeUpgrade, OnUnbalanced, + EqualPrivilegeOnly, FindAuthor, Imbalance, InstanceFilter, LinearStoragePrice, OnFinalize, + OnUnbalanced, }, weights::{ constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND}, @@ -97,8 +97,6 @@ use scale_info::TypeInfo; use sp_api::impl_runtime_apis; use sp_consensus_slots::Slot; use sp_core::{OpaqueMetadata, H160, H256, U256}; -#[cfg(feature = "try-runtime")] -use sp_runtime::TryRuntimeError; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ @@ -156,7 +154,7 @@ pub mod currency { // TODO: multiply MAXIMUM_BLOCK_WEIGHT times 4 when async backing will be definitly enabled pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, u64::MAX) .saturating_div(2) - .set_proof_size(cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64); + .set_proof_size(relay_chain::MAX_POV_SIZE as u64); pub const MILLISECS_PER_BLOCK: u64 = 6_000; pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); @@ -262,6 +260,8 @@ impl frame_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. type RuntimeOrigin = RuntimeOrigin; + /// The aggregated RuntimeTask type. + type RuntimeTask = RuntimeTask; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = ConstU32<256>; /// Maximum weight of each block. With a default weight system of 1byte == 1weight, 4mb is ok. @@ -313,7 +313,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = ConstU32<0>; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = ConstU32<1>; type WeightInfo = moonbeam_weights::pallet_balances::WeightInfo; } @@ -608,6 +607,15 @@ impl pallet_treasury::Config for Runtime { type BenchmarkHelper = BenchmarkHelper; } +parameter_types! { + pub const MaxSubAccounts: u32 = 100; + pub const MaxAdditionalFields: u32 = 100; + pub const MaxRegistrars: u32 = 20; + pub const PendingUsernameExpiration: u32 = 7 * DAYS; + pub const MaxSuffixLength: u32 = 7; + pub const MaxUsernameLength: u32 = 32; +} + type IdentityForceOrigin = EitherOfDiverse, governance::custom_origins::GeneralAdmin>; type IdentityRegistrarOrigin = @@ -618,17 +626,22 @@ impl pallet_identity::Config for Runtime { type Currency = Balances; // Add one item in storage and take 258 bytes type BasicDeposit = ConstU128<{ currency::deposit(1, 258) }>; - // Not add any item to the storage but takes 66 bytes - type FieldDeposit = ConstU128<{ currency::deposit(0, 66) }>; + // Does not add any item to the storage but takes 1 bytes + type ByteDeposit = ConstU128<{ currency::deposit(0, 1) }>; // Add one item in storage and take 53 bytes type SubAccountDeposit = ConstU128<{ currency::deposit(1, 53) }>; - type MaxSubAccounts = ConstU32<100>; - type MaxAdditionalFields = ConstU32<100>; - type IdentityInformation = pallet_identity::simple::IdentityInfo; - type MaxRegistrars = ConstU32<20>; + type MaxSubAccounts = MaxSubAccounts; + type IdentityInformation = pallet_identity::legacy::IdentityInfo; + type MaxRegistrars = MaxRegistrars; type Slashed = Treasury; type ForceOrigin = IdentityForceOrigin; type RegistrarOrigin = IdentityRegistrarOrigin; + type OffchainSignature = Signature; + type SigningPublicKey = ::Signer; + type UsernameAuthorityOrigin = EnsureRoot; + type PendingUsernameExpiration = PendingUsernameExpiration; + type MaxSuffixLength = MaxSuffixLength; + type MaxUsernameLength = MaxUsernameLength; type WeightInfo = moonbeam_weights::pallet_identity::WeightInfo; } @@ -696,6 +709,7 @@ impl pallet_ethereum_xcm::Config for Runtime { parameter_types! { pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; } /// Maximum number of blocks simultaneously accepted by the Runtime, not yet included @@ -715,13 +729,14 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = ParachainInfo; - type DmpMessageHandler = MaintenanceMode; type ReservedDmpWeight = ReservedDmpWeight; type OutboundXcmpMessageSource = XcmpQueue; type XcmpMessageHandler = XcmpQueue; type ReservedXcmpWeight = ReservedXcmpWeight; type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; type ConsensusHook = crate::timestamp::ConsensusHookWrapperForRelayTimestamp; + type DmpQueue = frame_support::traits::EnqueueWithOrigin; + type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight; } impl parachain_info::Config for Runtime {} @@ -863,6 +878,7 @@ impl pallet_author_slot_filter::Config for Runtime { impl pallet_async_backing::Config for Runtime { type AllowMultipleBlocksPerSlot = ConstBool; type GetAndVerifySlot = pallet_async_backing::RelaySlot; + type ExpectedBlockTime = ConstU64<6>; } parameter_types! { @@ -885,7 +901,7 @@ impl pallet_crowdloan_rewards::Config for Runtime { type RewardAddressChangeOrigin = EnsureSigned; type RewardAddressRelayVoteThreshold = RelaySignaturesThreshold; type SignatureNetworkIdentifier = SignatureNetworkIdentifier; - type VestingBlockNumber = cumulus_primitives_core::relay_chain::BlockNumber; + type VestingBlockNumber = relay_chain::BlockNumber; type VestingBlockProvider = RelaychainDataProvider; type WeightInfo = moonbeam_weights::pallet_crowdloan_rewards::WeightInfo; } @@ -1189,8 +1205,6 @@ impl Contains for NormalFilter { } } -use cumulus_primitives_core::{relay_chain::BlockNumber as RelayBlockNumber, DmpMessageHandler}; - pub struct XcmExecutionManager; impl moonkit_xcm_primitives::PauseXcmExecution for XcmExecutionManager { fn suspend_xcm_execution() -> DispatchResult { @@ -1201,78 +1215,6 @@ impl moonkit_xcm_primitives::PauseXcmExecution for XcmExecutionManager { } } -pub struct NormalDmpHandler; -impl DmpMessageHandler for NormalDmpHandler { - // This implementation makes messages be queued - // Since the limit is 0, messages are queued for next iteration - fn handle_dmp_messages( - iter: impl Iterator)>, - limit: Weight, - ) -> Weight { - (if Migrations::should_pause_xcm() { - DmpQueue::handle_dmp_messages(iter, Weight::zero()) - } else { - DmpQueue::handle_dmp_messages(iter, limit) - }) + ::DbWeight::get().reads(1) - } -} - -pub struct MaintenanceDmpHandler; -impl DmpMessageHandler for MaintenanceDmpHandler { - // This implementation makes messages be queued - // Since the limit is 0, messages are queued for next iteration - fn handle_dmp_messages( - iter: impl Iterator)>, - _limit: Weight, - ) -> Weight { - DmpQueue::handle_dmp_messages(iter, Weight::zero()) - } -} - -/// The hooks we wnat to run in Maintenance Mode -pub struct MaintenanceHooks; - -impl OnInitialize for MaintenanceHooks { - fn on_initialize(n: BlockNumber) -> Weight { - AllPalletsWithSystem::on_initialize(n) - } -} - -// return 0 -// For some reason using empty tuple () isnt working -// There exist only two pallets that use onIdle and these are xcmp and dmp queues -// For some reason putting an empty tumple does not work (transaction never finishes) -// We use an empty onIdle, if on the future we want one of the pallets to execute it -// we need to provide it here -impl OnIdle for MaintenanceHooks { - fn on_idle(_n: BlockNumber, _max_weight: Weight) -> Weight { - Weight::zero() - } -} - -impl OnRuntimeUpgrade for MaintenanceHooks { - fn on_runtime_upgrade() -> Weight { - AllPalletsWithSystem::on_runtime_upgrade() - } - - #[cfg(feature = "try-runtime")] - fn try_on_runtime_upgrade(checks: bool) -> Result { - AllPalletsWithSystem::try_on_runtime_upgrade(checks) - } -} - -impl OnFinalize for MaintenanceHooks { - fn on_finalize(n: BlockNumber) { - AllPalletsWithSystem::on_finalize(n) - } -} - -impl OffchainWorker for MaintenanceHooks { - fn offchain_worker(n: BlockNumber) { - AllPalletsWithSystem::offchain_worker(n) - } -} - impl pallet_maintenance_mode::Config for Runtime { type RuntimeEvent = RuntimeEvent; type NormalCallFilter = NormalFilter; @@ -1280,12 +1222,6 @@ impl pallet_maintenance_mode::Config for Runtime { type MaintenanceOrigin = pallet_collective::EnsureProportionAtLeast; type XcmExecutionManager = XcmExecutionManager; - type NormalDmpHandler = NormalDmpHandler; - type MaintenanceDmpHandler = MaintenanceDmpHandler; - // We use AllPalletsWithSystem because we dont want to change the hooks in normal - // operation - type NormalExecutiveHooks = AllPalletsWithSystem; - type MaintenanceExecutiveHooks = MaintenanceHooks; } impl pallet_proxy_genesis_companion::Config for Runtime { @@ -1376,7 +1312,9 @@ impl pallet_randomness::Config for Runtime { type WeightInfo = moonbeam_weights::pallet_randomness::WeightInfo; } -impl pallet_root_testing::Config for Runtime {} +impl pallet_root_testing::Config for Runtime { + type RuntimeEvent = RuntimeEvent; +} parameter_types! { // One storage item; key size is 32 + 20; value is size 4+4+16+20 bytes = 44 bytes. @@ -1448,6 +1386,7 @@ construct_runtime! { Migrations: pallet_migrations::{Pallet, Storage, Config, Event} = 32, XcmTransactor: pallet_xcm_transactor::{Pallet, Call, Config, Storage, Event} = 33, ProxyGenesisCompanion: pallet_proxy_genesis_companion::{Pallet, Config} = 34, + // Previously 35: BaseFee // Previously 36: pallet_assets:: MoonbeamOrbiters: pallet_moonbeam_orbiters::{Pallet, Call, Storage, Event, Config} = 37, EthereumXcm: pallet_ethereum_xcm::{Pallet, Call, Storage, Origin} = 38, @@ -1461,13 +1400,14 @@ construct_runtime! { Whitelist: pallet_whitelist::{Pallet, Call, Storage, Event} = 45, OpenTechCommitteeCollective: pallet_collective::::{Pallet, Call, Storage, Event, Origin, Config} = 46, - RootTesting: pallet_root_testing::{Pallet, Call, Storage} = 47, + RootTesting: pallet_root_testing::{Pallet, Call, Storage, Event} = 47, Erc20XcmBridge: pallet_erc20_xcm_bridge::{Pallet} = 48, Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 49, AsyncBacking: pallet_async_backing::{Pallet, Storage} = 50, MoonbeamLazyMigrations: pallet_moonbeam_lazy_migrations::{Pallet, Call, Storage} = 51, RelayStorageRoots: pallet_relay_storage_roots::{Pallet, Storage} = 52, PrecompileBenchmarks: pallet_precompile_benchmarks::{Pallet} = 53, + MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 54, } } @@ -1501,7 +1441,7 @@ pub type Executive = frame_executive::Executive< Block, frame_system::ChainContext, Runtime, - pallet_maintenance_mode::ExecutiveHooks, + AllPalletsWithSystem, >; #[cfg(feature = "runtime-benchmarks")] @@ -1529,7 +1469,7 @@ mod benches { [pallet_proxy, Proxy] [pallet_identity, Identity] [cumulus_pallet_xcmp_queue, XcmpQueue] - [pallet_xcm, PolkadotXcm] + [pallet_xcm, PalletXcmExtrinsiscsBenchmark::] [pallet_asset_manager, AssetManager] [pallet_xcm_transactor, XcmTransactor] [pallet_moonbeam_orbiters, MoonbeamOrbiters] @@ -1741,8 +1681,8 @@ mod tests { Balance::from(1 * UNIT + 25800 * MICROUNIT) ); assert_eq!( - get!(pallet_identity, FieldDeposit, u128), - Balance::from(6600 * MICROUNIT) + get!(pallet_identity, ByteDeposit, u128), + Balance::from(100 * MICROUNIT) ); assert_eq!( get!(pallet_identity, SubAccountDeposit, u128), diff --git a/runtime/moonbase/src/precompiles.rs b/runtime/moonbase/src/precompiles.rs index a951e6d29f..f68fb11962 100644 --- a/runtime/moonbase/src/precompiles.rs +++ b/runtime/moonbase/src/precompiles.rs @@ -230,7 +230,7 @@ type MoonbasePrecompilesAt = ( >, PrecompileAt< AddressU64<2072>, - IdentityPrecompile, + IdentityPrecompile, (CallableByContract, CallableByPrecompile), >, PrecompileAt< diff --git a/runtime/moonbase/src/xcm_config.rs b/runtime/moonbase/src/xcm_config.rs index f4cb860d32..fd34bd6d8c 100644 --- a/runtime/moonbase/src/xcm_config.rs +++ b/runtime/moonbase/src/xcm_config.rs @@ -18,9 +18,9 @@ //! use super::{ - governance, AccountId, AssetId, AssetManager, Assets, Balance, Balances, DealWithFees, - Erc20XcmBridge, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, - RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, + governance, AccountId, AssetId, AssetManager, Balance, Balances, DealWithFees, Erc20XcmBridge, + MaintenanceMode, MessageQueue, ParachainInfo, ParachainSystem, Perbill, PolkadotXcm, Runtime, + RuntimeBlockWeights, RuntimeCall, RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, }; use moonbeam_runtime_common::weights as moonbeam_weights; use pallet_evm_precompileset_assets_erc20::AccountIdAssetIdConversion; @@ -31,7 +31,7 @@ use sp_runtime::{ use frame_support::{ parameter_types, - traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess}, + traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess, TransformOrigin}, }; use frame_system::{EnsureRoot, RawOrigin}; @@ -39,25 +39,32 @@ use sp_core::{ConstU32, H160, H256}; use sp_weights::Weight; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, - DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FungiblesAdapter, HashedDescription, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, DescribeAllTerminal, DescribeFamily, + EnsureXcmOrigin, FungibleAdapter as XcmCurrencyAdapter, FungiblesAdapter, HashedDescription, NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; -use xcm::latest::prelude::*; +use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; + +use xcm::latest::prelude::{ + Asset, GlobalConsensus, InteriorLocation, Junction, Location, NetworkId, PalletInstance, + Parachain, +}; use xcm_executor::traits::{CallDispatcher, ConvertLocation, JustTry}; +use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use orml_xcm_support::MultiNativeAsset; use xcm_primitives::{ - AbsoluteAndRelativeReserve, AccountIdToCurrencyId, AccountIdToMultiLocation, AsAssetType, + AbsoluteAndRelativeReserve, AccountIdToCurrencyId, AccountIdToLocation, AsAssetType, FirstAssetTrader, SignedToAccountId20, UtilityAvailableCalls, UtilityEncodeCall, XcmTransact, }; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; +use sp_core::Get; use sp_std::{ convert::{From, Into, TryFrom}, prelude::*, @@ -73,23 +80,23 @@ parameter_types! { // The relay chain Origin type pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); // The universal location within the global consensus system - pub UniversalLocation: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())].into(); // Self Reserve location, defines the multilocation identifiying the self-reserve currency // This is used to match it also against our Balances pallet when we receive such - // a MultiLocation: (Self Balances pallet index) + // a Location: (Self Balances pallet index) // We use the RELATIVE multilocation - pub SelfReserve: MultiLocation = MultiLocation { - parents:0, - interior: Junctions::X1( + pub SelfReserve: Location = Location { + parents: 0, + interior: [ PalletInstance(::index() as u8) - ) + ].into() }; } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( @@ -97,7 +104,7 @@ pub type LocationToAccountId = ( ParentIsPreset, // Sibling parachain origins convert to AccountId via the `ParaId::into`. SiblingParachainConvertsVia, - // If we receive a MultiLocation of type AccountKey20, just generate a native account + // If we receive a Location of type AccountKey20, just generate a native account AccountKey20Aliases, // Generate remote accounts according to polkadot standards HashedDescription>, @@ -106,7 +113,7 @@ pub type LocationToAccountId = ( /// Wrapper type around `LocationToAccountId` to convert an `AccountId` to type `H160`. pub struct LocationToH160; impl ConvertLocation for LocationToH160 { - fn convert_location(location: &MultiLocation) -> Option { + fn convert_location(location: &Location) -> Option { >::convert_location(location) .map(Into::into) } @@ -117,7 +124,7 @@ impl ConvertLocation for LocationToH160 { // This is intended to match FOREIGN ASSETS pub type ForeignFungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: - Assets, + super::Assets, // Use this currency when it is a fungible asset matching the given location or name: ( ConvertedConcreteId< @@ -127,7 +134,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< JustTry, >, ), - // Do a simple punn to convert an AccountId20 MultiLocation into a native chain account ID: + // Do a simple punn to convert an AccountId20 Location into a native chain account ID: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -225,7 +232,7 @@ parameter_types! { /// We do not burn anything because we want to mimic exactly what /// the sovereign account has pub type XcmFeesToAccount = xcm_primitives::XcmFeesToAccount< - Assets, + super::Assets, ( ConvertedConcreteId< AssetId, @@ -304,9 +311,10 @@ impl xcm_executor::Config for XcmExecutorConfig { type UniversalAliases = Nothing; type SafeCallFilter = SafeCallFilter; type Aliasers = Nothing; + type TransactionalProcessor = xcm_builder::FrameTransactionalProcessor; } -// Converts a Signed Local Origin into a MultiLocation +// Converts a Signed Local Origin into a Location pub type LocalOriginToLocation = SignedToAccountId20; /// The means for routing XCM messages which are not for local execution into the right message @@ -319,15 +327,10 @@ pub type XcmRouter = ( ); type XcmExecutor = pallet_erc20_xcm_bridge::XcmExecutorWrapper< - RuntimeCall, + XcmExecutorConfig, xcm_executor::XcmExecutor, >; -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -352,8 +355,6 @@ impl pallet_xcm::Config for Runtime { type RemoteLockConsumerIdentifier = (); // TODO pallet-xcm weights type WeightInfo = moonbeam_weights::pallet_xcm::WeightInfo; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; } @@ -364,10 +365,10 @@ impl cumulus_pallet_xcm::Config for Runtime { impl cumulus_pallet_xcmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; - type ExecuteOverweightOrigin = EnsureRoot; + type XcmpQueue = TransformOrigin; + type MaxInboundSuspended = sp_core::ConstU32<1_000>; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = moonbeam_weights::cumulus_pallet_xcmp_queue::WeightInfo; @@ -376,37 +377,100 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { >; } +parameter_types! { + pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; +} + +// TODO: This pallet can be removed after the lazy migration is done and +// event `Completed` is emitted. +// https://github.com/paritytech/polkadot-sdk/pull/1246 impl cumulus_pallet_dmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; - type ExecuteOverweightOrigin = EnsureRoot; + type DmpSink = frame_support::traits::EnqueueWithOrigin; + type WeightInfo = cumulus_pallet_dmp_queue::weights::SubstrateWeight; +} + +parameter_types! { + /// The amount of weight (if any) which should be provided to the message queue for + /// servicing enqueued items. + /// + /// This may be legitimately `None` in the case that you will call + /// `ServiceQueues::service_queues` manually. + pub MessageQueueServiceWeight: Weight = + Perbill::from_percent(25) * RuntimeBlockWeights::get().max_block; + /// The maximum number of stale pages (i.e. of overweight messages) allowed before culling + /// can happen. Once there are more stale pages than this, then historical pages may be + /// dropped, even if they contain unprocessed overweight messages. + pub const MessageQueueMaxStale: u32 = 8; + /// The size of the page; this implies the maximum message size which can be sent. + /// + /// A good value depends on the expected message sizes, their weights, the weight that is + /// available for processing them and the maximal needed message size. The maximal message + /// size is slightly lower than this as defined by [`MaxMessageLenOf`]. + pub const MessageQueueHeapSize: u32 = 128 * 1048; +} + +impl pallet_message_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + #[cfg(feature = "runtime-benchmarks")] + type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor< + cumulus_primitives_core::AggregateMessageOrigin, + >; + #[cfg(not(feature = "runtime-benchmarks"))] + type MessageProcessor = + xcm_builder::ProcessXcmMessage; + type Size = u32; + type HeapSize = MessageQueueHeapSize; + type MaxStale = MessageQueueMaxStale; + type ServiceWeight = MessageQueueServiceWeight; + // The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin: + type QueueChangeHandler = NarrowOriginToSibling; + // NarrowOriginToSibling calls XcmpQueue's is_paused if Origin is sibling. Allows all other origins + type QueuePausedQuery = (MaintenanceMode, NarrowOriginToSibling); + type WeightInfo = pallet_message_queue::weights::SubstrateWeight; } // Our AssetType. For now we only handle Xcm Assets #[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)] pub enum AssetType { - Xcm(MultiLocation), + Xcm(xcm::v3::Location), } impl Default for AssetType { fn default() -> Self { - Self::Xcm(MultiLocation::here()) + Self::Xcm(xcm::v3::Location::here()) } } -impl From for AssetType { - fn from(location: MultiLocation) -> Self { +impl From for AssetType { + fn from(location: xcm::v3::Location) -> Self { Self::Xcm(location) } } -impl Into> for AssetType { - fn into(self) -> Option { +// This can be removed once we fully adopt xcm::v4 everywhere +impl TryFrom for AssetType { + type Error = (); + fn try_from(location: Location) -> Result { + Ok(Self::Xcm(location.try_into()?)) + } +} + +impl Into> for AssetType { + fn into(self) -> Option { match self { Self::Xcm(location) => Some(location), } } } +impl Into> for AssetType { + fn into(self) -> Option { + match self { + Self::Xcm(location) => xcm_builder::V4V3LocationConverter::convert_back(&location), + } + } +} + // Implementation on how to retrieve the AssetId from an AssetType // We take it impl From for AssetId { @@ -454,17 +518,17 @@ impl AccountIdToCurrencyId for Runtime { } } -// How to convert from CurrencyId to MultiLocation -pub struct CurrencyIdtoMultiLocation(sp_std::marker::PhantomData); -impl sp_runtime::traits::Convert> - for CurrencyIdtoMultiLocation +// How to convert from CurrencyId to Location +pub struct CurrencyIdToLocation(sp_std::marker::PhantomData); +impl sp_runtime::traits::Convert> + for CurrencyIdToLocation where - AssetXConverter: MaybeEquivalence, + AssetXConverter: MaybeEquivalence, { - fn convert(currency: CurrencyId) -> Option { + fn convert(currency: CurrencyId) -> Option { match currency { CurrencyId::SelfReserve => { - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), @@ -489,20 +553,20 @@ parameter_types! { pub const MaxAssetsForTransfer: usize = 2; // This is how we are going to detect whether the asset is a Reserve asset // This however is the chain part only - pub SelfLocation: MultiLocation = MultiLocation::here(); + pub SelfLocation: Location = Location::here(); // We need this to be able to catch when someone is trying to execute a non- // cross-chain transfer in xtokens through the absolute path way - pub SelfLocationAbsolute: MultiLocation = MultiLocation { + pub SelfLocationAbsolute: Location = Location { parents:1, - interior: Junctions::X1( + interior: [ Parachain(ParachainInfo::parachain_id().into()) - ) + ].into() }; } parameter_type_with_key! { - pub ParachainMinFee: |location: MultiLocation| -> Option { + pub ParachainMinFee: |location: Location| -> Option { match (location.parents, location.first_interior()) { // AssetHub fee (1, Some(Parachain(1001u32))) => Some(50_000_000u128), @@ -515,9 +579,8 @@ impl orml_xtokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type CurrencyIdConvert = - CurrencyIdtoMultiLocation>; + type AccountIdToLocation = AccountIdToLocation; + type CurrencyIdConvert = CurrencyIdToLocation>; type XcmExecutor = XcmExecutor; type SelfLocation = SelfLocation; type Weigher = XcmWeigher; @@ -525,13 +588,13 @@ impl orml_xtokens::Config for Runtime { type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = AbsoluteAndRelativeReserve; } // 1 WND/ROC should be enough parameter_types! { - pub MaxHrmpRelayFee: MultiAsset = (MultiLocation::parent(), 1_000_000_000_000u128).into(); + pub MaxHrmpRelayFee: Asset = (Location::parent(), 1_000_000_000_000u128).into(); } // For now we only allow to transact in the relay, although this might change in the future @@ -572,9 +635,9 @@ impl UtilityEncodeCall for Transactors { } impl XcmTransact for Transactors { - fn destination(self) -> MultiLocation { + fn destination(self) -> Location { match self { - Transactors::Relay => MultiLocation::parent(), + Transactors::Relay => Location::parent(), } } } @@ -589,9 +652,8 @@ impl pallet_xcm_transactor::Config for Runtime { type DerivativeAddressRegistrationOrigin = DerivativeAddressRegistrationOrigin; type SovereignAccountDispatcherOrigin = EnsureRoot; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type CurrencyIdToMultiLocation = - CurrencyIdtoMultiLocation>; + type AccountIdToLocation = AccountIdToLocation; + type CurrencyIdToLocation = CurrencyIdToLocation>; type XcmSender = XcmRouter; type SelfLocation = SelfLocation; type Weigher = XcmWeigher; @@ -608,11 +670,11 @@ parameter_types! { // This is the relative view of erc20 assets. // Identified by this prefix + AccountKey20(contractAddress) // We use the RELATIVE multilocation - pub Erc20XcmBridgePalletLocation: MultiLocation = MultiLocation { + pub Erc20XcmBridgePalletLocation: Location = Location { parents:0, - interior: Junctions::X1( + interior: [ PalletInstance(::index() as u8) - ) + ].into() }; // To be able to support almost all erc20 implementations, @@ -630,12 +692,12 @@ impl pallet_erc20_xcm_bridge::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] mod testing { use super::*; - use xcm_executor::traits::ConvertLocation; + use xcm_builder::V4V3LocationConverter; /// This From exists for benchmarking purposes. It has the potential side-effect of calling /// AssetManager::set_asset_type_asset_id() and should NOT be used in any production code. - impl From for CurrencyId { - fn from(location: MultiLocation) -> CurrencyId { + impl From for CurrencyId { + fn from(location: Location) -> CurrencyId { use xcm_primitives::AssetTypeGetter; // If it does not exist, for benchmarking purposes, we create the association @@ -644,7 +706,9 @@ mod testing { { asset_id } else { - let asset_type = AssetType::Xcm(location); + let asset_type = AssetType::Xcm( + V4V3LocationConverter::convert(&location).expect("convert to v3"), + ); let asset_id: AssetId = asset_type.clone().into(); AssetManager::set_asset_type_asset_id(asset_type, asset_id); asset_id diff --git a/runtime/moonbase/tests/evm_tracing.rs b/runtime/moonbase/tests/evm_tracing.rs index 89106ec6c7..6c8b4c79c7 100644 --- a/runtime/moonbase/tests/evm_tracing.rs +++ b/runtime/moonbase/tests/evm_tracing.rs @@ -52,9 +52,17 @@ mod tests { ); let transaction = ethereum_transaction(VALID_ETH_TX); let eth_uxt = unchecked_eth_tx(VALID_ETH_TX); + let block = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 1, + parent_hash: Default::default(), + state_root: Default::default(), + }; assert!(Runtime::trace_transaction( vec![non_eth_uxt.clone(), eth_uxt, non_eth_uxt.clone()], - &transaction + &transaction, + &block ) .is_ok()); }); @@ -84,10 +92,17 @@ mod tests { let eth_uxt = unchecked_eth_tx(VALID_ETH_TX); let eth_tx = ethereum_transaction(VALID_ETH_TX); let eth_extrinsic_hash = eth_tx.hash(); - + let block = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 1, + parent_hash: Default::default(), + state_root: Default::default(), + }; assert!(Runtime::trace_block( vec![non_eth_uxt.clone(), eth_uxt.clone(), non_eth_uxt, eth_uxt], - vec![eth_extrinsic_hash, eth_extrinsic_hash] + vec![eth_extrinsic_hash, eth_extrinsic_hash], + &block ) .is_ok()); }); diff --git a/runtime/moonbase/tests/integration_test.rs b/runtime/moonbase/tests/integration_test.rs index 7c2346b2ef..2947dee799 100644 --- a/runtime/moonbase/tests/integration_test.rs +++ b/runtime/moonbase/tests/integration_test.rs @@ -1242,7 +1242,7 @@ fn update_reward_address_via_precompile() { #[test] fn asset_can_be_registered() { ExtBuilder::default().build().execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); let source_id: moonbase_runtime::AssetId = source_location.clone().into(); let asset_metadata = AssetRegistrarMetadata { name: b"RelayToken".to_vec(), @@ -1265,7 +1265,7 @@ fn asset_can_be_registered() { fn xcm_asset_erc20_precompiles_supply_and_balance() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1282,7 +1282,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { .build() .execute_with(|| { // We have the assetId that corresponds to the relay chain registered - let relay_asset_id: AssetId = AssetType::Xcm(MultiLocation::parent()).into(); + let relay_asset_id: AssetId = AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1323,7 +1323,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { fn xcm_asset_erc20_precompiles_transfer() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1340,7 +1340,7 @@ fn xcm_asset_erc20_precompiles_transfer() { .build() .execute_with(|| { // We have the assetId that corresponds to the relay chain registered - let relay_asset_id: AssetId = AssetType::Xcm(MultiLocation::parent()).into(); + let relay_asset_id: AssetId = AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1387,7 +1387,7 @@ fn xcm_asset_erc20_precompiles_transfer() { fn xcm_asset_erc20_precompiles_approve() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1404,7 +1404,7 @@ fn xcm_asset_erc20_precompiles_approve() { .build() .execute_with(|| { // We have the assetId that corresponds to the relay chain registered - let relay_asset_id: AssetId = AssetType::Xcm(MultiLocation::parent()).into(); + let relay_asset_id: AssetId = AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1472,7 +1472,7 @@ fn xcm_asset_erc20_precompiles_approve() { fn xtokens_precompiles_transfer() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1492,7 +1492,7 @@ fn xtokens_precompiles_transfer() { let xtokens_precompile_address = H160::from_low_u64_be(2052); // We have the assetId that corresponds to the relay chain registered - let relay_asset_id: AssetId = AssetType::Xcm(MultiLocation::parent()).into(); + let relay_asset_id: AssetId = AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1501,12 +1501,12 @@ fn xtokens_precompiles_transfer() { ); // Alice has 1000 tokens. She should be able to send through precompile - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // We use the address of the asset as an identifier of the asset we want to transfer @@ -1531,7 +1531,7 @@ fn xtokens_precompiles_transfer() { fn xtokens_precompiles_transfer_multiasset() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1551,12 +1551,12 @@ fn xtokens_precompiles_transfer_multiasset() { let xtokens_precompile_address = H160::from_low_u64_be(2052); // Alice has 1000 tokens. She should be able to send through precompile - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // This time we transfer it through TransferMultiAsset @@ -1567,7 +1567,7 @@ fn xtokens_precompiles_transfer_multiasset() { xtokens_precompile_address, XtokensPCall::transfer_multiasset { // We want to transfer the relay token - asset: MultiLocation::parent(), + asset: Location::parent(), amount: 500_000_000_000_000u128.into(), destination, weight: 4_000_000, @@ -1595,12 +1595,12 @@ fn xtokens_precompiles_transfer_native() { let asset_precompile_address = H160::from_low_u64_be(2050); // Alice has 1000 tokens. She should be able to send through precompile - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // We use the address of the asset as an identifier of the asset we want to transfer @@ -1927,7 +1927,7 @@ fn root_can_change_default_xcm_vers() { (AccountId::from(BOB), 1_000 * UNIT), ]) .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1939,13 +1939,14 @@ fn root_can_change_default_xcm_vers() { }]) .build() .execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); - let dest = MultiLocation { + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: [1u8; 32], - }), + }] + .into(), }; let source_id: moonbase_runtime::AssetId = source_location.clone().into(); // Default XCM version is not set yet, so xtokens should fail because it does not @@ -1955,7 +1956,7 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), moonbase_runtime::xcm_config::CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V3(dest.clone())), + Box::new(xcm::VersionedLocation::V4(dest.clone())), WeightLimit::Limited(4000000000.into()) ), orml_xtokens::Error::::XcmExecutionFailed @@ -1972,7 +1973,7 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), moonbase_runtime::xcm_config::CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), WeightLimit::Limited(4000000000.into()) )); }) @@ -1986,7 +1987,7 @@ fn transactor_cannot_use_more_than_max_weight() { (AccountId::from(BOB), 1_000 * UNIT), ]) .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1998,7 +1999,7 @@ fn transactor_cannot_use_more_than_max_weight() { }]) .build() .execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); let source_id: moonbase_runtime::AssetId = source_location.clone().into(); assert_ok!(XcmTransactor::register( root_origin(), @@ -2009,7 +2010,7 @@ fn transactor_cannot_use_more_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000.into(), @@ -2018,7 +2019,7 @@ fn transactor_cannot_use_more_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1, )); @@ -2028,9 +2029,9 @@ fn transactor_cannot_use_more_than_max_weight() { moonbase_runtime::xcm_config::Transactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![], @@ -2085,9 +2086,9 @@ fn root_can_use_hrmp_manage() { para_id: 2000u32.into() }, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: Some(10000) }, // 20000 is the max @@ -2112,9 +2113,9 @@ fn transact_through_signed_precompile_works_v1() { .build() .execute_with(|| { // Destination - let dest = MultiLocation::parent(); + let dest = Location::parent(); - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -2123,7 +2124,7 @@ fn transact_through_signed_precompile_works_v1() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), Weight::from_parts(200_000, (xcm_primitives::DEFAULT_PROOF_SIZE) + 4000), @@ -2132,7 +2133,7 @@ fn transact_through_signed_precompile_works_v1() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1, )); @@ -2164,9 +2165,9 @@ fn transact_through_signed_precompile_works_v2() { .build() .execute_with(|| { // Destination - let dest = MultiLocation::parent(); + let dest = Location::parent(); - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -2204,9 +2205,9 @@ fn transact_through_signed_cannot_send_to_local_chain() { .build() .execute_with(|| { // Destination - let dest = MultiLocation::here(); + let dest = Location::here(); - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -2399,7 +2400,7 @@ fn test_xcm_utils_ml_tp_account() { ExtBuilder::default().build().execute_with(|| { let xcm_utils_precompile_address = H160::from_low_u64_be(2060); let expected_address_parent: H160 = - ParentIsPreset::::convert_location(&MultiLocation::parent()) + ParentIsPreset::::convert_location(&Location::parent()) .unwrap() .into(); @@ -2408,14 +2409,14 @@ fn test_xcm_utils_ml_tp_account() { ALICE, xcm_utils_precompile_address, XcmUtilsPCall::multilocation_to_address { - multilocation: MultiLocation::parent(), + location: Location::parent(), }, ) .expect_cost(1000) .expect_no_logs() .execute_returns(Address(expected_address_parent)); - let parachain_2000_multilocation = MultiLocation::new(1, X1(Parachain(2000))); + let parachain_2000_multilocation = Location::new(1, [Parachain(2000)]); let expected_address_parachain: H160 = SiblingParachainConvertsVia::::convert_location( ¶chain_2000_multilocation, @@ -2428,27 +2429,28 @@ fn test_xcm_utils_ml_tp_account() { ALICE, xcm_utils_precompile_address, XcmUtilsPCall::multilocation_to_address { - multilocation: parachain_2000_multilocation, + location: parachain_2000_multilocation, }, ) .expect_cost(1000) .expect_no_logs() .execute_returns(Address(expected_address_parachain)); - let alice_in_parachain_2000_multilocation = MultiLocation::new( + let alice_in_parachain_2000_multilocation = Location::new( 1, - X2( + [ Parachain(2000), AccountKey20 { network: None, key: ALICE, }, - ), + ], ); - let expected_address_alice_in_parachain_2000: H160 = - xcm_builder::HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &alice_in_parachain_2000_multilocation, - ) + let expected_address_alice_in_parachain_2000 = + xcm_builder::HashedDescription::< + AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&alice_in_parachain_2000_multilocation) .unwrap() .into(); @@ -2457,7 +2459,7 @@ fn test_xcm_utils_ml_tp_account() { ALICE, xcm_utils_precompile_address, XcmUtilsPCall::multilocation_to_address { - multilocation: alice_in_parachain_2000_multilocation, + location: alice_in_parachain_2000_multilocation, }, ) .expect_cost(1000) @@ -2473,7 +2475,7 @@ fn test_xcm_utils_weight_message() { let expected_weight = XcmWeight::::clear_origin().ref_time(); - let message: Vec = xcm::VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); + let message: Vec = xcm::VersionedXcm::<()>::V4(Xcm(vec![ClearOrigin])).encode(); let input = XcmUtilsPCall::weight_message { message: message.into(), @@ -2491,9 +2493,9 @@ fn test_xcm_utils_weight_message() { fn test_xcm_utils_get_units_per_second() { ExtBuilder::default().build().execute_with(|| { let xcm_utils_precompile_address = H160::from_low_u64_be(2060); - let multilocation = SelfReserve::get(); + let location = SelfReserve::get(); - let input = XcmUtilsPCall::get_units_per_second { multilocation }; + let input = XcmUtilsPCall::get_units_per_second { location }; let expected_units = WEIGHT_REF_TIME_PER_SECOND as u128 * moonbase_runtime::currency::WEIGHT_FEE; diff --git a/runtime/moonbase/tests/xcm_mock/parachain.rs b/runtime/moonbase/tests/xcm_mock/parachain.rs index f442a3618f..10c384737e 100644 --- a/runtime/moonbase/tests/xcm_mock/parachain.rs +++ b/runtime/moonbase/tests/xcm_mock/parachain.rs @@ -46,18 +46,19 @@ use polkadot_parachain::primitives::{Id as ParaId, Sibling}; use xcm::latest::{ AssetId as XcmAssetId, Error as XcmError, ExecuteXcm, Junction::{PalletInstance, Parachain}, - Junctions, MultiLocation, NetworkId, Outcome, Xcm, + Location, NetworkId, Outcome, Xcm, }; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, - EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, FungiblesAdapter, IsConcrete, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, EnsureXcmOrigin, FixedRateOfFungible, + FixedWeightBounds, FungibleAdapter as XcmCurrencyAdapter, FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, }; use xcm_executor::{traits::JustTry, Config, XcmExecutor}; +pub use moonbase_runtime::xcm_config::AssetType; #[cfg(feature = "runtime-benchmarks")] use moonbeam_runtime_common::benchmarking::BenchmarkHelper as ArgumentsBenchmarkHelper; use scale_info::TypeInfo; @@ -78,6 +79,7 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -119,7 +121,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -197,7 +198,7 @@ impl pallet_assets::Config for Runtime { } } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( @@ -207,7 +208,10 @@ pub type LocationToAccountId = ( SiblingParachainConvertsVia, AccountKey20Aliases, // The rest of multilocations convert via hashing it - xcm_builder::HashedDescriptionDescribeFamilyAllTerminal, + xcm_builder::HashedDescription< + AccountId, + xcm_builder::DescribeFamily, + >, ); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, @@ -251,7 +255,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< JustTry, >, ), - // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: + // Do a simple punn to convert an AccountId32 Location into a native chain account ID: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -268,7 +272,7 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< // Use this currency when it is a fungible asset matching any of the locations in // SelfReserveRepresentations IsConcrete, - // We can convert the MultiLocations with our converter above: + // We can convert the Locations with our converter above: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -324,7 +328,7 @@ parameter_types! { // a native trader that charges same number of units as weight // We use both the old and new anchoring logics pub ParaTokensPerSecond: (XcmAssetId, u128, u128) = ( - Concrete(SelfReserve::get()), + AssetId(SelfReserve::get()), 1000000000000, 0, ); @@ -333,17 +337,17 @@ parameter_types! { parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())].into(); // New Self Reserve location, defines the multilocation identifiying the self-reserve currency // This is used to match it also against our Balances pallet when we receive such - // a MultiLocation: (Self Balances pallet index) - pub SelfReserve: MultiLocation = MultiLocation { + // a Location: (Self Balances pallet index) + pub SelfReserve: Location = Location { parents:0, - interior: Junctions::X1( + interior: [ PalletInstance(::index() as u8) - ) + ].into() }; pub const MaxAssetsIntoHolding: u32 = 64; } @@ -390,6 +394,8 @@ impl Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + + type TransactionalProcessor = (); } impl cumulus_pallet_xcm::Config for Runtime { @@ -404,14 +410,14 @@ pub enum CurrencyId { ForeignAsset(AssetId), } -// How to convert from CurrencyId to MultiLocation -pub struct CurrencyIdtoMultiLocation(sp_std::marker::PhantomData); -impl sp_runtime::traits::Convert> - for CurrencyIdtoMultiLocation +// How to convert from CurrencyId to Location +pub struct CurrencyIdToLocation(sp_std::marker::PhantomData); +impl sp_runtime::traits::Convert> + for CurrencyIdToLocation where - AssetXConverter: MaybeEquivalence, + AssetXConverter: MaybeEquivalence, { - fn convert(currency: CurrencyId) -> Option { + fn convert(currency: CurrencyId) -> Option { match currency { CurrencyId::SelfReserve => { // For now and until Xtokens is adapted to handle 0.9.16 version we use @@ -419,7 +425,7 @@ where // This is not a problem in either cases, since the view of the destination // chain does not change // TODO! change this to NewAnchoringSelfReserve once xtokens is adapted for it - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), @@ -430,17 +436,17 @@ where parameter_types! { pub const BaseXcmWeight: Weight = Weight::from_parts(100u64, 100u64); pub const MaxAssetsForTransfer: usize = 2; - pub SelfLocation: MultiLocation = MultiLocation::here(); - pub SelfLocationAbsolute: MultiLocation = MultiLocation { + pub SelfLocation: Location = Location::here(); + pub SelfLocationAbsolute: Location = Location { parents:1, - interior: Junctions::X1( + interior: [ Parachain(MsgQueue::parachain_id().into()) - ) + ].into() }; } parameter_type_with_key! { - pub ParachainMinFee: |location: MultiLocation| -> Option { + pub ParachainMinFee: |location: Location| -> Option { match (location.parents, location.first_interior()) { (1, Some(Parachain(4u32))) => Some(50u128), _ => None, @@ -453,9 +459,9 @@ impl orml_xtokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = xcm_primitives::AccountIdToMultiLocation; + type AccountIdToLocation = xcm_primitives::AccountIdToLocation; type CurrencyIdConvert = - CurrencyIdtoMultiLocation>; + CurrencyIdToLocation>; type XcmExecutor = XcmExecutor; type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; @@ -463,7 +469,7 @@ impl orml_xtokens::Config for Runtime { type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = xcm_primitives::AbsoluteAndRelativeReserve; } @@ -568,15 +574,25 @@ pub mod mock_msg_queue { let hash = Encode::using_encoded(&xcm, T::Hashing::hash); let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { - let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); + let location = Location::new(1, [Parachain(sender.into())]); let mut id = [0u8; 32]; id.copy_from_slice(hash.as_ref()); - match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { - Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), + match T::XcmExecutor::prepare_and_execute( + location, + xcm, + &mut id, + max_weight, + Weight::zero(), + ) { + Outcome::Error { error } => { + (Err(error.clone()), Event::Fail(Some(hash), error)) + } + Outcome::Complete { used } => (Ok(used), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), + Outcome::Incomplete { used, error } => { + (Ok(used), Event::Fail(Some(hash), error)) + } } } Err(()) => ( @@ -620,7 +636,7 @@ pub mod mock_msg_queue { limit: Weight, ) -> Weight { for (_i, (_sent_at, data)) in iter.enumerate() { - let id = sp_io::hashing::blake2_256(&data[..]); + let mut id = sp_io::hashing::blake2_256(&data[..]); let maybe_msg = VersionedXcm::::decode(&mut &data[..]) .map(Xcm::::try_from); match maybe_msg { @@ -631,7 +647,13 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); + let outcome = T::XcmExecutor::prepare_and_execute( + Parent, + x, + &mut id, + limit, + Weight::zero(), + ); Self::deposit_event(Event::ExecutedDownward(id, outcome)); } @@ -698,12 +720,7 @@ pub type LocalOriginToLocation = xcm_primitives::SignedToAccountId20; parameter_types! { - pub MatcherLocation: MultiLocation = MultiLocation::here(); -} - -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub MatcherLocation: Location = Location::here(); } impl pallet_xcm::Config for Runtime { @@ -732,48 +749,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; -} - -// Our AssetType. For now we only handle Xcm Assets -#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)] -pub enum AssetType { - Xcm(MultiLocation), -} -impl Default for AssetType { - fn default() -> Self { - Self::Xcm(MultiLocation::here()) - } -} - -impl From for AssetType { - fn from(location: MultiLocation) -> Self { - Self::Xcm(location) - } -} - -impl Into> for AssetType { - fn into(self) -> Option { - match self { - Self::Xcm(location) => Some(location), - } - } -} - -// Implementation on how to retrieve the AssetId from an AssetType -// We simply hash the AssetType and take the lowest 128 bits -impl From for AssetId { - fn from(asset: AssetType) -> AssetId { - match asset { - AssetType::Xcm(id) => { - let mut result: [u8; 16] = [0u8; 16]; - let hash: H256 = id.using_encoded(::Hashing::hash); - result.copy_from_slice(&hash.as_fixed_bytes()[0..16]); - u128::from_le_bytes(result) - } - } - } } // We instruct how to register the Assets @@ -860,7 +835,7 @@ impl pallet_asset_manager::Config for Runtime { // 1 ROC/WND should be enough parameter_types! { - pub MaxHrmpRelayFee: MultiAsset = (MultiLocation::parent(), 1_000_000_000_000u128).into(); + pub MaxHrmpRelayFee: Asset = (Location::parent(), 1_000_000_000_000u128).into(); } impl pallet_xcm_transactor::Config for Runtime { @@ -870,9 +845,9 @@ impl pallet_xcm_transactor::Config for Runtime { type DerivativeAddressRegistrationOrigin = EnsureRoot; type SovereignAccountDispatcherOrigin = frame_system::EnsureRoot; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = xcm_primitives::AccountIdToMultiLocation; - type CurrencyIdToMultiLocation = - CurrencyIdtoMultiLocation>; + type AccountIdToLocation = xcm_primitives::AccountIdToLocation; + type CurrencyIdToLocation = + CurrencyIdToLocation>; type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; type UniversalLocation = UniversalLocation; @@ -985,9 +960,9 @@ pub enum MockTransactors { } impl xcm_primitives::XcmTransact for MockTransactors { - fn destination(self) -> MultiLocation { + fn destination(self) -> Location { match self { - MockTransactors::Relay => MultiLocation::parent(), + MockTransactors::Relay => Location::parent(), } } } diff --git a/runtime/moonbase/tests/xcm_mock/relay_chain.rs b/runtime/moonbase/tests/xcm_mock/relay_chain.rs index 31fb79a3a1..40bff5e1ae 100644 --- a/runtime/moonbase/tests/xcm_mock/relay_chain.rs +++ b/runtime/moonbase/tests/xcm_mock/relay_chain.rs @@ -40,9 +40,10 @@ use xcm::latest::prelude::*; use xcm_builder::{ Account32Hash, AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, - ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, - FixedWeightBounds, IsConcrete, ProcessXcmMessage, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, + ChildSystemParachainAsSuperuser, FixedRateOfFungible, FixedWeightBounds, + FungibleAdapter as XcmCurrencyAdapter, IsConcrete, ProcessXcmMessage, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + WithComputedOrigin, }; use xcm_executor::{Config, XcmExecutor}; pub type AccountId = AccountId32; @@ -56,6 +57,7 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -97,7 +99,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -109,17 +110,19 @@ impl pallet_utility::Config for Runtime { type PalletsOrigin = OriginCaller; } -impl shared::Config for Runtime {} +impl shared::Config for Runtime { + type DisabledValidators = (); +} impl configuration::Config for Runtime { type WeightInfo = configuration::TestWeightInfo; } parameter_types! { - pub KsmLocation: MultiLocation = Here.into(); + pub KsmLocation: Location = Here.into(); pub const KusamaNetwork: NetworkId = NetworkId::Kusama; pub const AnyNetwork: Option = None; - pub UniversalLocation: InteriorMultiLocation = Here; + pub UniversalLocation: InteriorLocation = Here; } pub type SovereignAccountOf = ( @@ -142,10 +145,10 @@ type LocalOriginConverter = ( parameter_types! { pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); - pub KsmPerSecond: (AssetId, u128, u128) = (Concrete(KsmLocation::get()), 1, 1); + pub KsmPerSecond: (AssetId, u128, u128) = (AssetId(KsmLocation::get()), 1, 1); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; - pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub MatcherLocation: Location = Location::here(); } pub type XcmRouter = super::RelayChainXcmRouter; @@ -168,9 +171,9 @@ pub type XcmBarrier = ( ); parameter_types! { - pub Kusama: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(KsmLocation::get()) }); - pub Statemine: MultiLocation = Parachain(4).into(); - pub KusamaForStatemine: (MultiAssetFilter, MultiLocation) = (Kusama::get(), Statemine::get()); + pub Kusama: AssetFilter = Wild(AllOf { fun: WildFungible, id: AssetId(KsmLocation::get()) }); + pub Statemine: Location = Parachain(4).into(); + pub KusamaForStatemine: (AssetFilter, Location) = (Kusama::get(), Statemine::get()); } pub type TrustedTeleporters = xcm_builder::Case; @@ -201,15 +204,11 @@ impl Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + type TransactionalProcessor = (); } pub type LocalOriginToLocation = SignedToAccountId32; -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; @@ -235,8 +234,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; } parameter_types! { @@ -272,6 +269,7 @@ impl paras::Config for Runtime { type NextSessionRotation = TestNextSessionRotation; type QueueFootprinter = (); type OnNewHead = (); + type AssignCoretime = (); } impl dmp::Config for Runtime {} diff --git a/runtime/moonbase/tests/xcm_mock/statemint_like.rs b/runtime/moonbase/tests/xcm_mock/statemint_like.rs index 7348b799e4..a3da2c2160 100644 --- a/runtime/moonbase/tests/xcm_mock/statemint_like.rs +++ b/runtime/moonbase/tests/xcm_mock/statemint_like.rs @@ -17,8 +17,8 @@ //! Relay chain runtime mock. use frame_support::{ - construct_runtime, match_types, parameter_types, - traits::{AsEnsureOriginWithArg, Everything, Nothing}, + construct_runtime, parameter_types, + traits::{AsEnsureOriginWithArg, Contains, Everything, Nothing}, weights::Weight, }; use frame_system::{EnsureRoot, EnsureSigned}; @@ -39,7 +39,7 @@ use xcm::VersionedXcm; use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex, - ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, + ConvertedConcreteId, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, FungibleAdapter, FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, @@ -60,6 +60,7 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -101,7 +102,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -156,18 +156,18 @@ impl pallet_assets::Config for Runtime { } parameter_types! { - pub const KsmLocation: MultiLocation = MultiLocation::parent(); + pub const KsmLocation: Location = Location::parent(); pub const RelayNetwork: NetworkId = NetworkId::Kusama; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); - pub Local: MultiLocation = Here.into(); + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())].into(); + pub Local: Location = Here.into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); pub KsmPerSecond: (xcm::latest::prelude::AssetId, u128, u128) = - (Concrete(KsmLocation::get()), 1, 1); + (AssetId(KsmLocation::get()), 1, 1); } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( @@ -180,12 +180,12 @@ pub type LocationToAccountId = ( ); /// Means for transacting the native currency on this chain. -pub type CurrencyTransactor = CurrencyAdapter< +pub type CurrencyTransactor = FungibleAdapter< // Use this currency: Balances, // Use this currency when it is a fungible asset matching the given location or name: IsConcrete, - // Convert an XCM MultiLocation into a local account id: + // Convert an XCM Location into a local account id: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -204,7 +204,7 @@ pub type FungiblesTransactor = FungiblesAdapter< AsPrefixedGeneralIndex, JustTry, >, - // Convert an XCM MultiLocation into a local account id: + // Convert an XCM Location into a local account id: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -235,7 +235,7 @@ pub type XcmOriginToTransactDispatchOrigin = ( // transaction from the Root origin. ParentAsSuperuser, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. + // `RuntimeOrigin::signed` origin of the same 32-byte value. SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. pallet_xcm::XcmPassthrough, @@ -247,17 +247,28 @@ parameter_types! { pub const MaxInstructions: u32 = 100; } -match_types! { - pub type ParentOrParentsExecutivePlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; +pub struct ParentOrParentsExecutivePlurality; +impl Contains for ParentOrParentsExecutivePlurality { + fn contains(location: &Location) -> bool { + matches!( + location.unpack(), + (1, []) + | ( + 1, + [Plurality { + id: BodyId::Executive, + .. + }] + ) + ) + } } -match_types! { - pub type ParentOrSiblings: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(_) } - }; + +pub struct ParentOrSiblings; +impl Contains for ParentOrSiblings { + fn contains(location: &Location) -> bool { + matches!(location.unpack(), (1, []) | (1, [_])) + } } pub type Barrier = ( @@ -272,7 +283,7 @@ pub type Barrier = ( ); parameter_types! { - pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub MatcherLocation: Location = Location::here(); pub const MaxAssetsIntoHolding: u32 = 64; } @@ -303,6 +314,8 @@ impl Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + + type TransactionalProcessor = (); } /// No local origins on this chain are allowed to dispatch XCM sends/executions. @@ -310,11 +323,6 @@ pub type LocalOriginToLocation = SignedToAccountId32; -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -339,8 +347,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; } impl cumulus_pallet_xcm::Config for Runtime { @@ -413,15 +419,25 @@ pub mod mock_msg_queue { let hash = Encode::using_encoded(&xcm, T::Hashing::hash); let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { - let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); + let location = Location::new(1, [Parachain(sender.into())]); let mut id = [0u8; 32]; id.copy_from_slice(hash.as_ref()); - match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { - Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), + match T::XcmExecutor::prepare_and_execute( + location, + xcm, + &mut id, + max_weight, + Weight::zero(), + ) { + Outcome::Error { error } => { + (Err(error.clone()), Event::Fail(Some(hash), error)) + } + Outcome::Complete { used } => (Ok(used), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), + Outcome::Incomplete { used, error } => { + (Ok(used), Event::Fail(Some(hash), error)) + } } } Err(()) => ( @@ -465,7 +481,7 @@ pub mod mock_msg_queue { limit: Weight, ) -> Weight { for (_i, (_sent_at, data)) in iter.enumerate() { - let id = sp_io::hashing::blake2_256(&data[..]); + let mut id = sp_io::hashing::blake2_256(&data[..]); let maybe_msg = VersionedXcm::::decode(&mut &data[..]) .map(Xcm::::try_from); match maybe_msg { @@ -476,7 +492,13 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); + let outcome = T::XcmExecutor::prepare_and_execute( + Parent, + x, + &mut id, + limit, + Weight::zero(), + ); Self::deposit_event(Event::ExecutedDownward(id, outcome)); } @@ -511,10 +533,10 @@ pub mod mock_statemint_prefix { #[pallet::storage] #[pallet::getter(fn current_prefix)] - pub(super) type CurrentPrefix = StorageValue<_, MultiLocation, ValueQuery>; + pub(super) type CurrentPrefix = StorageValue<_, Location, ValueQuery>; - impl Get for Pallet { - fn get() -> MultiLocation { + impl Get for Pallet { + fn get() -> Location { Self::current_prefix() } } @@ -523,11 +545,11 @@ pub mod mock_statemint_prefix { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { // Changed Prefix - PrefixChanged(MultiLocation), + PrefixChanged(Location), } impl Pallet { - pub fn set_prefix(prefix: MultiLocation) { + pub fn set_prefix(prefix: Location) { CurrentPrefix::::put(&prefix); Self::deposit_event(Event::PrefixChanged(prefix)); } diff --git a/runtime/moonbase/tests/xcm_tests.rs b/runtime/moonbase/tests/xcm_tests.rs index ca0b9fa5a1..eca9ba91dd 100644 --- a/runtime/moonbase/tests/xcm_tests.rs +++ b/runtime/moonbase/tests/xcm_tests.rs @@ -27,10 +27,14 @@ use frame_support::{ use pallet_xcm_transactor::{ Currency, CurrencyPayment, HrmpInitParams, HrmpOperation, TransactWeights, }; +use sp_runtime::traits::MaybeEquivalence; use sp_std::boxed::Box; -use xcm::latest::prelude::*; -use xcm::{VersionedMultiLocation, WrapVersion}; -use xcm_builder::HashedDescriptionDescribeFamilyAllTerminal; +use xcm::latest::prelude::{ + AccountId32, AccountKey20, All, BuyExecution, ClearOrigin, DepositAsset, GeneralIndex, + Junction, Junctions, Limited, Location, OriginKind, PalletInstance, Parachain, QueryResponse, + Reanchorable, Response, WeightLimit, WithdrawAsset, Xcm, +}; +use xcm::{VersionedLocation, WrapVersion}; use xcm_executor::traits::ConvertLocation; use xcm_mock::*; use xcm_primitives::{UtilityEncodeCall, DEFAULT_PROOF_SIZE}; @@ -42,7 +46,7 @@ use cumulus_primitives_core::relay_chain::HrmpChannelId; fn receive_relay_asset_from_relay() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -67,7 +71,7 @@ fn receive_relay_asset_from_relay() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -76,8 +80,8 @@ fn receive_relay_asset_from_relay() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 123).into()), 0, )); }); @@ -94,7 +98,7 @@ fn receive_relay_asset_from_relay() { fn send_relay_asset_to_relay() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -121,7 +125,7 @@ fn send_relay_asset_to_relay() { )); }); - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -132,8 +136,8 @@ fn send_relay_asset_to_relay() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 123).into()), 0, )); }); @@ -150,12 +154,13 @@ fn send_relay_asset_to_relay() { }); // We now send back some money to the relay - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: RELAYALICE.into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -164,7 +169,7 @@ fn send_relay_asset_to_relay() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 123, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -185,7 +190,7 @@ fn send_relay_asset_to_relay() { fn send_relay_asset_to_para_b() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -229,7 +234,7 @@ fn send_relay_asset_to_para_b() { }); // First send relay chain asset to Parachain A like in previous test - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -238,8 +243,8 @@ fn send_relay_asset_to_para_b() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 123).into()), 0, )); }); @@ -250,15 +255,16 @@ fn send_relay_asset_to_para_b() { }); // Now send relay asset from para A to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { @@ -266,7 +272,7 @@ fn send_relay_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -287,8 +293,10 @@ fn send_para_a_asset_to_para_b() { MockNet::reset(); // this represents the asset in paraA - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -315,15 +323,16 @@ fn send_para_a_asset_to_para_b() { }); // Send para A asset from para A to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { @@ -332,7 +341,7 @@ fn send_para_a_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -356,8 +365,10 @@ fn send_para_a_asset_from_para_b_to_para_c() { MockNet::reset(); // Represents para A asset - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -401,15 +412,16 @@ fn send_para_a_asset_from_para_b_to_para_c() { }); // Send para A asset to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { // free execution, full amount received @@ -417,7 +429,7 @@ fn send_para_a_asset_from_para_b_to_para_c() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -436,15 +448,16 @@ fn send_para_a_asset_from_para_b_to_para_c() { }); // Send para A asset from para B to para C - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(3), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaB::execute_with(|| { @@ -452,7 +465,7 @@ fn send_para_a_asset_from_para_b_to_para_c() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -468,8 +481,10 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { MockNet::reset(); // Para A asset - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -496,22 +511,23 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { }); // Send para A asset to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { assert_ok!(XTokens::transfer( parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -530,22 +546,23 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { }); // Send back para A asset to para A - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(1), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaB::execute_with(|| { assert_ok!(XTokens::transfer( parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -563,8 +580,10 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { MockNet::reset(); - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -589,22 +608,23 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { )); }); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { assert_ok!(XTokens::transfer( parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -625,14 +645,14 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { // This time we will force the new reanchoring by manually sending the // Message through polkadotXCM pallet - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(Parachain(1)), + interior: [Parachain(1)].into(), }; - let reanchored_para_a_balances = MultiLocation::new(0, X1(PalletInstance(1u8))); + let reanchored_para_a_balances = Location::new(0, [PalletInstance(1u8)]); - let message = xcm::VersionedXcm::<()>::V3(Xcm(vec![ + let message = xcm::VersionedXcm::<()>::V4(Xcm(vec![ WithdrawAsset((reanchored_para_a_balances.clone(), 100).into()), ClearOrigin, BuyExecution { @@ -641,12 +661,12 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { }, DepositAsset { assets: All.into(), - beneficiary: MultiLocation::new( + beneficiary: Location::new( 0, - X1(AccountKey20 { + [AccountKey20 { network: None, key: PARAALICE, - }), + }], ), }, ])); @@ -673,7 +693,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { fn receive_relay_asset_with_trader() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -701,7 +721,7 @@ fn receive_relay_asset_with_trader() { )); }); - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -716,8 +736,8 @@ fn receive_relay_asset_with_trader() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 100).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 100).into()), 0, )); }); @@ -734,8 +754,10 @@ fn receive_relay_asset_with_trader() { fn send_para_a_asset_to_para_b_with_trader() { MockNet::reset(); - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -760,15 +782,16 @@ fn send_para_a_asset_to_para_b_with_trader() { )); }); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; // In destination chain, we only need 4 weight @@ -778,7 +801,7 @@ fn send_para_a_asset_to_para_b_with_trader() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(10u64, DEFAULT_PROOF_SIZE)) )); }); @@ -808,8 +831,10 @@ fn send_para_a_asset_to_para_b_with_trader() { fn send_para_a_asset_to_para_b_with_trader_and_fee() { MockNet::reset(); - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -835,15 +860,16 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { )); }); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; // we use transfer_with_fee @@ -853,7 +879,7 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { parachain::CurrencyId::SelfReserve, 100, 1, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -876,7 +902,7 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { fn error_when_not_paying_enough() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -885,7 +911,7 @@ fn error_when_not_paying_enough() { decimals: 12, }; - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -916,8 +942,8 @@ fn error_when_not_paying_enough() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 5).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 5).into()), 0, )); }); @@ -932,7 +958,7 @@ fn error_when_not_paying_enough() { fn transact_through_derivative_multilocation() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -959,7 +985,7 @@ fn transact_through_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000000000.into(), @@ -968,14 +994,14 @@ fn transact_through_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); // Let's construct the call to know how much weight it is going to require - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -985,8 +1011,8 @@ fn transact_through_derivative_multilocation() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 4000003100u128).into()), 0, )); }); @@ -1008,12 +1034,13 @@ fn transact_through_derivative_multilocation() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1022,7 +1049,7 @@ fn transact_through_derivative_multilocation() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1063,8 +1090,8 @@ fn transact_through_derivative_multilocation() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -1100,7 +1127,7 @@ fn transact_through_derivative_multilocation() { fn transact_through_derivative_with_custom_fee_weight() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1127,7 +1154,7 @@ fn transact_through_derivative_with_custom_fee_weight() { // Let's construct the call to know how much weight it is going to require - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1137,8 +1164,8 @@ fn transact_through_derivative_with_custom_fee_weight() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 4000003100u128).into()), 0, )); }); @@ -1160,12 +1187,13 @@ fn transact_through_derivative_with_custom_fee_weight() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1174,7 +1202,7 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1216,8 +1244,8 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee weight mapping fee_amount: Some(overall_weight as u128) @@ -1254,7 +1282,7 @@ fn transact_through_derivative_with_custom_fee_weight() { fn transact_through_derivative_with_custom_fee_weight_refund() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1281,7 +1309,7 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { // Let's construct the call to know how much weight it is going to require - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1291,8 +1319,8 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000009100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 4000009100u128).into()), 0, )); }); @@ -1314,12 +1342,13 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1328,7 +1357,7 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1370,8 +1399,8 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee weight mapping fee_amount: Some(overall_weight as u128) @@ -1407,7 +1436,7 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { fn transact_through_sovereign() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1434,7 +1463,7 @@ fn transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000000000.into(), @@ -1443,12 +1472,12 @@ fn transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1457,8 +1486,8 @@ fn transact_through_sovereign() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 4000003100u128).into()), 0, )); }); @@ -1479,12 +1508,13 @@ fn transact_through_sovereign() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1493,7 +1523,7 @@ fn transact_through_sovereign() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1512,9 +1542,9 @@ fn transact_through_sovereign() { }); // We send the xcm transact operation to parent - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: Here, + interior: [].into(), }; // Encode the call. Balances transact to para_a_account @@ -1543,11 +1573,11 @@ fn transact_through_sovereign() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -1573,7 +1603,7 @@ fn transact_through_sovereign() { fn transact_through_sovereign_with_custom_fee_weight() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1598,7 +1628,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { )); }); - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1607,8 +1637,8 @@ fn transact_through_sovereign_with_custom_fee_weight() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 4000003100u128).into()), 0, )); }); @@ -1629,12 +1659,13 @@ fn transact_through_sovereign_with_custom_fee_weight() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1643,7 +1674,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1662,9 +1693,9 @@ fn transact_through_sovereign_with_custom_fee_weight() { }); // We send the xcm transact operation to parent - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: Here, + interior: [].into(), }; // Encode the call. Balances transact to para_a_account @@ -1694,11 +1725,11 @@ fn transact_through_sovereign_with_custom_fee_weight() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee-weight mapping fee_amount: Some(total_weight as u128) @@ -1725,7 +1756,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { fn transact_through_sovereign_with_custom_fee_weight_refund() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1750,7 +1781,7 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { )); }); - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1759,8 +1790,8 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000009100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 4000009100u128).into()), 0, )); }); @@ -1781,12 +1812,13 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1795,7 +1827,7 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1814,9 +1846,9 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { }); // We send the xcm transact operation to parent - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: Here, + interior: [].into(), }; // Encode the call. Balances transact to para_a_account @@ -1846,11 +1878,11 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee-weight mapping fee_amount: Some(total_weight as u128) @@ -1878,7 +1910,7 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { fn test_automatic_versioning_on_runtime_upgrade_with_relay() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1903,7 +1935,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { }); let response = Response::Version(2); - let querier: MultiLocation = Here.into(); + let querier: Location = [].into(); // This is irrelevant, nothing will be done with this message, // but we need to pass a message as an argument to trigger the storage change @@ -1916,7 +1948,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { // The router is mocked, and we cannot use WrapVersion in ChildParachainRouter. So we will force // it directly here // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1941,8 +1973,8 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 123).into()), 0, )); @@ -1955,9 +1987,9 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { let expected_supported_version: relay_chain::RuntimeEvent = pallet_xcm::Event::SupportedVersionChanged { - location: MultiLocation { + location: Location { parents: 0, - interior: X1(Parachain(1)), + interior: [Parachain(1)].into(), }, version: 1, } @@ -1990,9 +2022,9 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { // This event should have been seen in the relay let expected_supported_version_2: relay_chain::RuntimeEvent = pallet_xcm::Event::SupportedVersionChanged { - location: MultiLocation { + location: Location { parents: 0, - interior: X1(Parachain(1)), + interior: [Parachain(1)].into(), }, version: 2, } @@ -2008,8 +2040,10 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { MockNet::reset(); - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -2018,7 +2052,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { decimals: 18, }; let response = Response::Version(2); - let querier: MultiLocation = Here.into(); + let querier: Location = [].into(); // This is irrelevant, nothing will be done with this message, // but we need to pass a message as an argument to trigger the storage change @@ -2061,7 +2095,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { )); // Wrap version, which sets VersionedStorage assert_ok!(::wrap_version( - &MultiLocation::new(1, X1(Parachain(2))).into(), + &Location::new(1, [Parachain(2)]).into(), mock_message )); @@ -2073,9 +2107,9 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { let expected_supported_version: parachain::RuntimeEvent = pallet_xcm::Event::SupportedVersionChanged { - location: MultiLocation { + location: Location { parents: 1, - interior: X1(Parachain(2)), + interior: [Parachain(2)].into(), }, version: 0, } @@ -2087,23 +2121,25 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { }); // Let's ensure talking in v0 works - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), - }; + ] + .into(), + } + .into(); ParaA::execute_with(|| { // free execution, full amount received assert_ok!(XTokens::transfer( parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); // free execution, full amount received @@ -2140,9 +2176,9 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { // This event should have been seen in para A let expected_supported_version_2: parachain::RuntimeEvent = pallet_xcm::Event::SupportedVersionChanged { - location: MultiLocation { + location: Location { parents: 1, - interior: X1(Parachain(2)), + interior: [Parachain(2)].into(), }, version: 2, } @@ -2160,7 +2196,7 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { MockNet::reset(); let fresh_account = [2u8; 20]; - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -2185,7 +2221,7 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: fresh_account, } @@ -2194,8 +2230,8 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([], 123).into()), 0, )); }); @@ -2220,8 +2256,8 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([], 123).into()), 0, )); }); @@ -2238,7 +2274,7 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass MockNet::reset(); let fresh_account = [2u8; 20]; - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -2263,7 +2299,7 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: fresh_account, } @@ -2272,8 +2308,8 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([], 123).into()), 0, )); }); @@ -2299,7 +2335,7 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { assert_eq!(parachain::System::account(evm_account_id).sufficients, 1); }); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -2323,7 +2359,7 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: sufficient_account, } @@ -2332,8 +2368,8 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([], 123).into()), 0, )); }); @@ -2367,7 +2403,7 @@ fn empty_account_should_not_be_reset() { let evm_account_id = parachain::AccountId::from(sufficient_account); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -2401,7 +2437,7 @@ fn empty_account_should_not_be_reset() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: sufficient_account, } @@ -2410,8 +2446,8 @@ fn empty_account_should_not_be_reset() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([], 123).into()), 0, )); }); @@ -2463,7 +2499,7 @@ fn empty_account_should_not_be_reset() { fn test_statemint_like() { MockNet::reset(); - let dest_para = MultiLocation::new(1, X1(Parachain(1))); + let dest_para = Location::new(1, [Parachain(1)]); let sov = xcm_builder::SiblingParachainConvertsVia::< polkadot_parachain::primitives::Sibling, @@ -2471,15 +2507,18 @@ fn test_statemint_like() { >::convert_location(&dest_para) .unwrap(); - let statemint_asset_a_balances = MultiLocation::new( + let statemint_asset_a_balances = Location::new( 1, - X3( + [ Parachain(4), PalletInstance(5), xcm::latest::prelude::GeneralIndex(0u128), - ), + ], + ); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(&statemint_asset_a_balances) + .expect("convert to v3"), ); - let source_location = parachain::AssetType::Xcm(statemint_asset_a_balances); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -2531,7 +2570,7 @@ fn test_statemint_like() { )); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -2540,16 +2579,16 @@ fn test_statemint_like() { // Send asset with previous prefix assert_ok!(StatemintChainPalletXcm::reserve_transfer_assets( statemint_like::RuntimeOrigin::signed(RELAYALICE), - Box::new(MultiLocation::new(1, X1(Parachain(1))).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new(Location::new(1, [Parachain(1)]).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), Box::new( ( - X2( + [ xcm::latest::prelude::PalletInstance( ::index() as u8 ), xcm::latest::prelude::GeneralIndex(0), - ), + ], 123 ) .into() @@ -2568,7 +2607,7 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { MockNet::reset(); // Relay asset - let relay_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let relay_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_relay_id: parachain::AssetId = relay_location.clone().into(); let relay_asset_metadata = parachain::AssetMetadata { @@ -2578,11 +2617,13 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { }; // Statemint asset - let statemint_asset = MultiLocation::new( + let statemint_asset = Location::new( 1, - X3(Parachain(4u32), PalletInstance(5u8), GeneralIndex(10u128)), + [Parachain(4u32), PalletInstance(5u8), GeneralIndex(10u128)], + ); + let statemint_location_asset = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(&statemint_asset).expect("convert to v3"), ); - let statemint_location_asset = parachain::AssetType::Xcm(statemint_asset); let source_statemint_asset_id: parachain::AssetId = statemint_location_asset.clone().into(); let asset_metadata_statemint_asset = parachain::AssetMetadata { @@ -2591,7 +2632,7 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { decimals: 12, }; - let dest_para = MultiLocation::new(1, X1(Parachain(1))); + let dest_para = Location::new(1, [Parachain(1)]); let sov = xcm_builder::SiblingParachainConvertsVia::< polkadot_parachain::primitives::Sibling, @@ -2629,7 +2670,7 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { )); }); - let parachain_beneficiary_from_relay: MultiLocation = Junction::AccountKey20 { + let parachain_beneficiary_from_relay: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -2641,11 +2682,11 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), Box::new( - VersionedMultiLocation::V3(parachain_beneficiary_from_relay) + VersionedLocation::V4(parachain_beneficiary_from_relay) .clone() .into() ), - Box::new((Here, 200).into()), + Box::new(([], 200).into()), 0, )); }); @@ -2679,7 +2720,7 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { )); // Send statemint USDC asset to Alice in Parachain A - let parachain_beneficiary_from_statemint: MultiLocation = AccountKey20 { + let parachain_beneficiary_from_statemint: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -2688,20 +2729,20 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { // Send with new prefix assert_ok!(StatemintChainPalletXcm::reserve_transfer_assets( statemint_like::RuntimeOrigin::signed(RELAYALICE), - Box::new(MultiLocation::new(1, X1(Parachain(1))).into()), + Box::new(Location::new(1, [Parachain(1)]).into()), Box::new( - VersionedMultiLocation::V3(parachain_beneficiary_from_statemint) + VersionedLocation::V4(parachain_beneficiary_from_statemint) .clone() .into() ), Box::new( ( - X2( + [ xcm::latest::prelude::PalletInstance( ::index() as u8 ), GeneralIndex(10), - ), + ], 125 ) .into() @@ -2710,15 +2751,16 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { )); }); - let statemint_beneficiary = MultiLocation { + let statemint_beneficiary = Location { parents: 1, - interior: X2( + interior: [ Parachain(4), AccountId32 { network: None, id: RELAYBOB.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { @@ -2749,7 +2791,7 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { (parachain::CurrencyId::ForeignAsset(source_relay_id), 100) ], 1, - Box::new(VersionedMultiLocation::V3(statemint_beneficiary)), + Box::new(VersionedLocation::V4(statemint_beneficiary)), WeightLimit::Limited(Weight::from_parts(80_000_000u64, 100_000u64)) )); }); @@ -2774,13 +2816,13 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { #[test] fn transact_through_signed_multilocation() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000000000.into(), @@ -2790,17 +2832,18 @@ fn transact_through_signed_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -2809,7 +2852,7 @@ fn transact_through_signed_multilocation() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), ancestry.interior) + .reanchor(&Location::parent(), &ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2853,10 +2896,10 @@ fn transact_through_signed_multilocation() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -2880,17 +2923,18 @@ fn transact_through_signed_multilocation() { #[test] fn transact_through_signed_multilocation_custom_fee_and_weight() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); ParaA::execute_with(|| { ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -2899,7 +2943,7 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), ancestry.interior) + .reanchor(&Location::parent(), &ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2944,10 +2988,10 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_weight as u128) }, @@ -2971,17 +3015,18 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { #[test] fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); ParaA::execute_with(|| { ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -2990,7 +3035,7 @@ fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), ancestry.interior) + .reanchor(&Location::parent(), &ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -3035,10 +3080,10 @@ fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_weight as u128) }, @@ -3064,18 +3109,18 @@ fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { #[test] fn transact_through_signed_multilocation_para_to_para() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3085,17 +3130,18 @@ fn transact_through_signed_multilocation_para_to_para() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -3104,14 +3150,14 @@ fn transact_through_signed_multilocation_para_to_para() { // To convert it to what the paraB will see instead of us descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_multilocation) + .unwrap(); ParaB::execute_with(|| { // free execution, full amount received @@ -3147,9 +3193,9 @@ fn transact_through_signed_multilocation_para_to_para() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3175,26 +3221,27 @@ fn transact_through_signed_multilocation_para_to_para() { #[test] fn transact_through_signed_multilocation_para_to_para_refund() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -3203,14 +3250,14 @@ fn transact_through_signed_multilocation_para_to_para_refund() { // To convert it to what the paraB will see instead of us descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_multilocation) + .unwrap(); ParaB::execute_with(|| { // free execution, full amount received @@ -3247,9 +3294,9 @@ fn transact_through_signed_multilocation_para_to_para_refund() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: Some(overall_weight as u128) @@ -3276,18 +3323,18 @@ fn transact_through_signed_multilocation_para_to_para_refund() { #[test] fn transact_through_signed_multilocation_para_to_para_ethereum() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3297,17 +3344,18 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -3316,14 +3364,14 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { // To convert it to what the paraB will see instead of us descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_multilocation) + .unwrap(); let mut parachain_b_alice_balances_before = 0; ParaB::execute_with(|| { @@ -3374,9 +3422,9 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3404,18 +3452,18 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { #[test] fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3425,17 +3473,18 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -3444,14 +3493,14 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() // To convert it to what the paraB will see instead of us descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_multilocation) + .unwrap(); let mut parachain_b_alice_balances_before = 0; ParaB::execute_with(|| { @@ -3503,9 +3552,9 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3528,18 +3577,18 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() #[test] fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3549,17 +3598,18 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -3568,14 +3618,14 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() // To convert it to what the paraB will see instead of us descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_multilocation) + .unwrap(); let transfer_recipient = evm_account(); let mut transfer_recipient_balance_before = 0; @@ -3635,9 +3685,9 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3690,8 +3740,8 @@ fn hrmp_init_accept_through_root() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -3723,8 +3773,8 @@ fn hrmp_init_accept_through_root() { para_id: 1u32.into() }, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -3780,8 +3830,8 @@ fn hrmp_close_works() { recipient: 2u32.into() }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, diff --git a/runtime/moonbeam/Cargo.toml b/runtime/moonbeam/Cargo.toml index d881934db9..b17dcb8d78 100644 --- a/runtime/moonbeam/Cargo.toml +++ b/runtime/moonbeam/Cargo.toml @@ -1,5 +1,5 @@ [package] -authors = {workspace = true} +authors = { workspace = true } build = "build.rs" description = "Moonbeam Runtime" edition = "2021" @@ -9,285 +9,290 @@ name = "moonbeam-runtime" version = "0.8.4" [dependencies] -hex-literal = {workspace = true, optional = true} -log = {workspace = true} -num_enum = {workspace = true} -rlp = {workspace = true, optional = true} -serde = {workspace = true, features = ["derive"]} -sha3 = {workspace = true, optional = true} -smallvec = {workspace = true} -strum = {workspace = true} -strum_macros = {workspace = true} +hex-literal = { workspace = true, optional = true } +log = { workspace = true } +num_enum = { workspace = true } +rlp = { workspace = true, optional = true } +serde = { workspace = true, features = ["derive"] } +sha3 = { workspace = true, optional = true } +smallvec = { workspace = true } +strum = { workspace = true } +strum_macros = { workspace = true } # Moonbeam -account = {workspace = true} -moonbeam-core-primitives = {workspace = true} -moonbeam-relay-encoder = {workspace = true} -moonbeam-runtime-common = {workspace = true} -precompile-utils = {workspace = true} -session-keys-primitives = {workspace = true} -xcm-primitives = {workspace = true} +account = { workspace = true } +moonbeam-core-primitives = { workspace = true } +moonbeam-relay-encoder = { workspace = true } +moonbeam-runtime-common = { workspace = true } +precompile-utils = { workspace = true } +session-keys-primitives = { workspace = true } +xcm-primitives = { workspace = true } # Moonbeam pallets -moonbeam-xcm-benchmarks = {workspace = true} -pallet-asset-manager = {workspace = true} -pallet-author-mapping = {workspace = true} -pallet-crowdloan-rewards = {workspace = true} -pallet-erc20-xcm-bridge = {workspace = true} -pallet-ethereum-xcm = {workspace = true} -pallet-evm-chain-id = {workspace = true} -pallet-maintenance-mode = {workspace = true, features = ["xcm-support"]} -pallet-migrations = {workspace = true} -pallet-moonbeam-lazy-migrations = {workspace = true} -pallet-moonbeam-orbiters = {workspace = true} -pallet-parachain-staking = {workspace = true} -pallet-proxy-genesis-companion = {workspace = true} -pallet-randomness = {workspace = true} -pallet-xcm-transactor = {workspace = true} +moonbeam-xcm-benchmarks = { workspace = true } +pallet-asset-manager = { workspace = true } +pallet-author-mapping = { workspace = true } +pallet-crowdloan-rewards = { workspace = true } +pallet-erc20-xcm-bridge = { workspace = true } +pallet-ethereum-xcm = { workspace = true } +pallet-evm-chain-id = { workspace = true } +pallet-maintenance-mode = { workspace = true, features = ["xcm-support"] } +pallet-migrations = { workspace = true } +pallet-moonbeam-lazy-migrations = { workspace = true } +pallet-moonbeam-orbiters = { workspace = true } +pallet-parachain-staking = { workspace = true } +pallet-proxy-genesis-companion = { workspace = true } +pallet-randomness = { workspace = true } +pallet-xcm-transactor = { workspace = true } # Moonbeam precompiles -pallet-evm-precompile-author-mapping = {workspace = true} -pallet-evm-precompile-balances-erc20 = {workspace = true} -pallet-evm-precompile-batch = {workspace = true} -pallet-evm-precompile-call-permit = {workspace = true} -pallet-evm-precompile-collective = {workspace = true} -pallet-evm-precompile-conviction-voting = {workspace = true} -pallet-evm-precompile-crowdloan-rewards = {workspace = true} -pallet-evm-precompile-gmp = {workspace = true} -pallet-evm-precompile-identity = {workspace = true} -pallet-evm-precompile-parachain-staking = {workspace = true} -pallet-evm-precompile-preimage = {workspace = true} -pallet-evm-precompile-proxy = {workspace = true} -pallet-evm-precompile-randomness = {workspace = true} -pallet-evm-precompile-referenda = {workspace = true} -pallet-evm-precompile-registry = {workspace = true} -pallet-evm-precompile-relay-encoder = {workspace = true} -pallet-evm-precompile-xcm-transactor = {workspace = true} -pallet-evm-precompile-xcm-utils = {workspace = true} -pallet-evm-precompile-xtokens = {workspace = true} -pallet-evm-precompileset-assets-erc20 = {workspace = true} +pallet-evm-precompile-author-mapping = { workspace = true } +pallet-evm-precompile-balances-erc20 = { workspace = true } +pallet-evm-precompile-batch = { workspace = true } +pallet-evm-precompile-call-permit = { workspace = true } +pallet-evm-precompile-collective = { workspace = true } +pallet-evm-precompile-conviction-voting = { workspace = true } +pallet-evm-precompile-crowdloan-rewards = { workspace = true } +pallet-evm-precompile-gmp = { workspace = true } +pallet-evm-precompile-identity = { workspace = true } +pallet-evm-precompile-parachain-staking = { workspace = true } +pallet-evm-precompile-preimage = { workspace = true } +pallet-evm-precompile-proxy = { workspace = true } +pallet-evm-precompile-randomness = { workspace = true } +pallet-evm-precompile-referenda = { workspace = true } +pallet-evm-precompile-registry = { workspace = true } +pallet-evm-precompile-relay-encoder = { workspace = true } +pallet-evm-precompile-xcm-transactor = { workspace = true } +pallet-evm-precompile-xcm-utils = { workspace = true } +pallet-evm-precompile-xtokens = { workspace = true } +pallet-evm-precompileset-assets-erc20 = { workspace = true } # Moonbeam tracing -evm-tracing-events = {workspace = true, optional = true} -moonbeam-evm-tracer = {workspace = true, optional = true} -moonbeam-rpc-primitives-debug = {workspace = true} -moonbeam-rpc-primitives-txpool = {workspace = true} +evm-tracing-events = { workspace = true, optional = true } +moonbeam-evm-tracer = { workspace = true, optional = true } +moonbeam-rpc-primitives-debug = { workspace = true } +moonbeam-rpc-primitives-txpool = { workspace = true } # Substrate -frame-executive = {workspace = true} -frame-support = {workspace = true} -frame-system = {workspace = true} -frame-system-rpc-runtime-api = {workspace = true} -pallet-assets = {workspace = true} -pallet-balances = {workspace = true, features = ["insecure_zero_ed"]} -pallet-collective = {workspace = true} -pallet-conviction-voting = {workspace = true} -pallet-identity = {workspace = true} -pallet-multisig = {workspace = true} -pallet-preimage = {workspace = true} -pallet-proxy = {workspace = true} -pallet-referenda = {workspace = true} -pallet-root-testing = {workspace = true} -pallet-scheduler = {workspace = true} -pallet-society = {workspace = true} -pallet-timestamp = {workspace = true} -pallet-transaction-payment = {workspace = true} -pallet-transaction-payment-rpc-runtime-api = {workspace = true} -pallet-treasury = {workspace = true} -pallet-utility = {workspace = true} -pallet-whitelist = {workspace = true} -parity-scale-codec = {workspace = true, features = [ - "derive", - "max-encoded-len", - "chain-error", -]} -scale-info = {workspace = true, features = ["derive"]} -sp-api = {workspace = true} -sp-block-builder = {workspace = true} -sp-consensus-slots = {workspace = true} -sp-core = {workspace = true} -sp-inherents = {workspace = true} -sp-io = {workspace = true, features = ["improved_panic_error_reporting"]} -sp-offchain = {workspace = true} -sp-runtime = {workspace = true} -sp-session = {workspace = true} -sp-std = {workspace = true} -sp-transaction-pool = {workspace = true} -sp-version = {workspace = true} -sp-weights = {workspace = true} +frame-executive = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +frame-system-rpc-runtime-api = { workspace = true } +pallet-assets = { workspace = true } +pallet-balances = { workspace = true, features = ["insecure_zero_ed"] } +pallet-collective = { workspace = true } +pallet-conviction-voting = { workspace = true } +pallet-identity = { workspace = true } +pallet-multisig = { workspace = true } +pallet-preimage = { workspace = true } +pallet-proxy = { workspace = true } +pallet-referenda = { workspace = true } +pallet-root-testing = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-society = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +pallet-treasury = { workspace = true } +pallet-utility = { workspace = true } +pallet-whitelist = { workspace = true } +parity-scale-codec = { workspace = true, features = [ + "derive", + "max-encoded-len", + "chain-error", +] } +scale-info = { workspace = true, features = ["derive"] } +sp-api = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-slots = { workspace = true } +sp-core = { workspace = true } +sp-inherents = { workspace = true } +sp-io = { workspace = true, features = ["improved_panic_error_reporting"] } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } +sp-weights = { workspace = true } +sp-genesis-builder = { workspace = true } # Frontier -fp-evm = {workspace = true} -fp-rpc = {workspace = true} -fp-self-contained = {workspace = true, features = ["serde"]} -pallet-ethereum = {workspace = true, features = ["forbid-evm-reentrancy"]} -pallet-evm = {workspace = true, features = ["forbid-evm-reentrancy"]} -pallet-evm-precompile-blake2 = {workspace = true} -pallet-evm-precompile-bn128 = {workspace = true} -pallet-evm-precompile-dispatch = {workspace = true} -pallet-evm-precompile-modexp = {workspace = true} -pallet-evm-precompile-sha3fips = {workspace = true} -pallet-evm-precompile-simple = {workspace = true} +fp-evm = { workspace = true } +fp-rpc = { workspace = true } +fp-self-contained = { workspace = true, features = ["serde"] } +pallet-ethereum = { workspace = true, features = ["forbid-evm-reentrancy"] } +pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] } +pallet-evm-precompile-blake2 = { workspace = true } +pallet-evm-precompile-bn128 = { workspace = true } +pallet-evm-precompile-dispatch = { workspace = true } +pallet-evm-precompile-modexp = { workspace = true } +pallet-evm-precompile-sha3fips = { workspace = true } +pallet-evm-precompile-simple = { workspace = true } # Polkadot / XCM -orml-traits = {workspace = true} -orml-xcm-support = {workspace = true} -orml-xtokens = {workspace = true} -pallet-xcm = {workspace = true} -pallet-xcm-benchmarks = {workspace = true, optional = true} -polkadot-core-primitives = {workspace = true} -polkadot-parachain = {workspace = true} -polkadot-runtime-common = {workspace = true} -xcm = {workspace = true} -xcm-builder = {workspace = true} -xcm-executor = {workspace = true} +orml-traits = { workspace = true } +orml-xcm-support = { workspace = true } +orml-xtokens = { workspace = true } +pallet-xcm = { workspace = true } +pallet-xcm-benchmarks = { workspace = true, optional = true } +pallet-message-queue = { workspace = true } +polkadot-core-primitives = { workspace = true } +polkadot-runtime-common = { workspace = true } +polkadot-parachain = { workspace = true } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus -cumulus-pallet-dmp-queue = {workspace = true} -cumulus-pallet-parachain-system = {workspace = true} -cumulus-pallet-xcm = {workspace = true} -cumulus-pallet-xcmp-queue = {workspace = true} -cumulus-primitives-core = {workspace = true} -cumulus-primitives-timestamp = {workspace = true} -cumulus-primitives-utility = {workspace = true} -parachain-info = {workspace = true} +cumulus-pallet-dmp-queue = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } +cumulus-pallet-xcm = { workspace = true } +cumulus-pallet-xcmp-queue = { workspace = true } +cumulus-primitives-core = { workspace = true } +cumulus-primitives-timestamp = { workspace = true } +cumulus-primitives-utility = { workspace = true } +parachain-info = { workspace = true } +parachains-common = { workspace = true } # Moonkit -async-backing-primitives = {workspace = true} -moonkit-xcm-primitives = {workspace = true} -nimbus-primitives = {workspace = true} -pallet-author-inherent = {workspace = true} -pallet-author-slot-filter = {workspace = true} +async-backing-primitives = { workspace = true } +moonkit-xcm-primitives = { workspace = true } +nimbus-primitives = { workspace = true } +pallet-author-inherent = { workspace = true } +pallet-author-slot-filter = { workspace = true } # Benchmarking -frame-benchmarking = {workspace = true, optional = true} -frame-system-benchmarking = {workspace = true, optional = true} -frame-try-runtime = {workspace = true, optional = true} +frame-benchmarking = { workspace = true, optional = true } +frame-system-benchmarking = { workspace = true, optional = true } +frame-try-runtime = { workspace = true, optional = true } [dev-dependencies] -ethereum = {workspace = true} -frame-metadata = {workspace = true} -hex = {workspace = true, features = ["std"]} -sha3 = {workspace = true, features = ["std"]} +ethereum = { workspace = true } +frame-metadata = { workspace = true } +hex = { workspace = true, features = ["std"] } +sha3 = { workspace = true, features = ["std"] } -cumulus-primitives-parachain-inherent = {workspace = true} -cumulus-test-relay-sproof-builder = {workspace = true} +cumulus-primitives-parachain-inherent = { workspace = true } +cumulus-test-relay-sproof-builder = { workspace = true } -pallet-message-queue = {workspace = true} -polkadot-runtime-parachains = {workspace = true} -xcm-simulator = {workspace = true} +polkadot-runtime-parachains = { workspace = true } +xcm-simulator = { workspace = true } -precompile-utils = {workspace = true, features = ["std", "testing"]} +precompile-utils = { workspace = true, features = ["std", "testing"] } [build-dependencies] -substrate-wasm-builder = {workspace = true} +substrate-wasm-builder = { workspace = true } [features] default = ["std"] -evm-tracing = ["evm-tracing-events", "moonbeam-evm-tracer", "rlp", "sha3"] std = [ - "account/std", - "async-backing-primitives/std", - "cumulus-pallet-dmp-queue/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-core/std", - "cumulus-primitives-timestamp/std", - "evm-tracing-events/std", - "fp-evm/std", - "fp-rpc/std", - "fp-self-contained/std", - "frame-benchmarking/std", - "frame-executive/std", - "frame-support/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "moonbeam-core-primitives/std", - "moonbeam-evm-tracer/std", - "moonbeam-relay-encoder/std", - "moonbeam-rpc-primitives-debug/std", - "moonbeam-rpc-primitives-txpool/std", - "moonbeam-runtime-common/std", - "moonbeam-xcm-benchmarks/std", - "moonkit-xcm-primitives/std", - "nimbus-primitives/std", - "orml-xtokens/std", - "pallet-asset-manager/std", - "pallet-assets/std", - "pallet-author-inherent/std", - "pallet-author-mapping/std", - "pallet-author-slot-filter/std", - "pallet-balances/std", - "pallet-collective/std", - "pallet-conviction-voting/std", - "pallet-crowdloan-rewards/std", - "pallet-erc20-xcm-bridge/std", - "pallet-evm-chain-id/std", - "pallet-ethereum-xcm/std", - "pallet-ethereum/std", - "pallet-evm-precompile-author-mapping/std", - "pallet-evm-precompile-balances-erc20/std", - "pallet-evm-precompile-batch/std", - "pallet-evm-precompile-call-permit/std", - "pallet-evm-precompile-collective/std", - "pallet-evm-precompile-conviction-voting/std", - "pallet-evm-precompile-parachain-staking/std", - "pallet-evm-precompile-preimage/std", - "pallet-evm-precompile-randomness/std", - "pallet-evm-precompile-referenda/std", - "pallet-evm-precompile-relay-encoder/std", - "pallet-evm-precompile-xcm-transactor/std", - "pallet-evm-precompile-xcm-utils/std", - "pallet-evm-precompile-xtokens/std", - "pallet-evm-precompileset-assets-erc20/std", - "pallet-evm/std", - "pallet-identity/std", - "pallet-maintenance-mode/std", - "pallet-migrations/std", - "pallet-moonbeam-lazy-migrations/std", - "pallet-moonbeam-orbiters/std", - "pallet-multisig/std", - "pallet-parachain-staking/std", - "pallet-preimage/std", - "pallet-proxy-genesis-companion/std", - "pallet-proxy/std", - "pallet-randomness/std", - "pallet-referenda/std", - "pallet-root-testing/std", - "pallet-scheduler/std", - "pallet-society/std", - "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - "pallet-treasury/std", - "pallet-utility/std", - "pallet-whitelist/std", - "pallet-xcm-transactor/std", - "pallet-xcm/std", - "parachain-info/std", - "parity-scale-codec/std", - "precompile-utils/std", - "scale-info/std", - "session-keys-primitives/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-slots/std", - "sp-core/std", - "sp-inherents/std", - "sp-io/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-std/std", - "sp-transaction-pool/std", - "sp-version/std", - "strum/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm-primitives/std", - "xcm/std", + "account/std", + "async-backing-primitives/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "evm-tracing-events/std", + "fp-evm/std", + "fp-rpc/std", + "fp-self-contained/std", + "frame-benchmarking/std", + "frame-executive/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "moonbeam-core-primitives/std", + "moonbeam-evm-tracer/std", + "moonbeam-relay-encoder/std", + "moonbeam-rpc-primitives-debug/std", + "moonbeam-rpc-primitives-txpool/std", + "moonbeam-runtime-common/std", + "moonbeam-xcm-benchmarks/std", + "moonkit-xcm-primitives/std", + "nimbus-primitives/std", + "orml-xtokens/std", + "pallet-asset-manager/std", + "pallet-assets/std", + "pallet-author-inherent/std", + "pallet-author-mapping/std", + "pallet-author-slot-filter/std", + "pallet-balances/std", + "pallet-collective/std", + "pallet-conviction-voting/std", + "pallet-crowdloan-rewards/std", + "pallet-erc20-xcm-bridge/std", + "pallet-evm-chain-id/std", + "pallet-ethereum-xcm/std", + "pallet-ethereum/std", + "pallet-evm-precompile-author-mapping/std", + "pallet-evm-precompile-balances-erc20/std", + "pallet-evm-precompile-batch/std", + "pallet-evm-precompile-call-permit/std", + "pallet-evm-precompile-collective/std", + "pallet-evm-precompile-conviction-voting/std", + "pallet-evm-precompile-parachain-staking/std", + "pallet-evm-precompile-preimage/std", + "pallet-evm-precompile-randomness/std", + "pallet-evm-precompile-referenda/std", + "pallet-evm-precompile-relay-encoder/std", + "pallet-evm-precompile-xcm-transactor/std", + "pallet-evm-precompile-xcm-utils/std", + "pallet-evm-precompile-xtokens/std", + "pallet-evm-precompileset-assets-erc20/std", + "pallet-evm/std", + "pallet-identity/std", + "pallet-maintenance-mode/std", + "pallet-migrations/std", + "pallet-moonbeam-lazy-migrations/std", + "pallet-moonbeam-orbiters/std", + "pallet-multisig/std", + "pallet-parachain-staking/std", + "pallet-preimage/std", + "pallet-proxy-genesis-companion/std", + "pallet-proxy/std", + "pallet-randomness/std", + "pallet-referenda/std", + "pallet-root-testing/std", + "pallet-scheduler/std", + "pallet-society/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "pallet-utility/std", + "pallet-whitelist/std", + "pallet-xcm-transactor/std", + "pallet-xcm/std", + "parachain-info/std", + "parachains-common/std", + "parity-scale-codec/std", + "precompile-utils/std", + "scale-info/std", + "session-keys-primitives/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-slots/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "sp-genesis-builder/std", + "strum/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm-primitives/std", + "xcm/std", ] +evm-tracing = ["evm-tracing-events", "moonbeam-evm-tracer", "rlp", "sha3"] # Will be enabled by the `wasm-builder` when building the runtime for WASM. runtime-wasm = [] @@ -298,73 +303,103 @@ runtime-wasm = [] on-chain-release-build = ["sp-api/disable-logging"] runtime-benchmarks = [ - "cumulus-pallet-parachain-system/runtime-benchmarks", - "frame-benchmarking", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "hex-literal", - "moonbeam-relay-encoder/runtime-benchmarks", - "moonbeam-runtime-common/runtime-benchmarks", - "moonbeam-xcm-benchmarks/runtime-benchmarks", - "pallet-asset-manager/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", - "pallet-author-inherent/runtime-benchmarks", - "pallet-author-mapping/runtime-benchmarks", - "pallet-author-slot-filter/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-collective/runtime-benchmarks", - "pallet-conviction-voting/runtime-benchmarks", - "pallet-crowdloan-rewards/runtime-benchmarks", - "pallet-ethereum-xcm/runtime-benchmarks", - "pallet-ethereum/runtime-benchmarks", - "pallet-evm/runtime-benchmarks", - "pallet-identity/runtime-benchmarks", - "pallet-migrations/runtime-benchmarks", - "pallet-moonbeam-lazy-migrations/runtime-benchmarks", - "pallet-moonbeam-orbiters/runtime-benchmarks", - "pallet-multisig/runtime-benchmarks", - "pallet-parachain-staking/runtime-benchmarks", - "pallet-preimage/runtime-benchmarks", - "pallet-proxy/runtime-benchmarks", - "pallet-randomness/runtime-benchmarks", - "pallet-referenda/runtime-benchmarks", - "pallet-scheduler/runtime-benchmarks", - "pallet-society/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-treasury/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-whitelist/runtime-benchmarks", - "pallet-xcm-benchmarks", - "pallet-xcm-transactor/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "session-keys-primitives/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", + "cumulus-pallet-parachain-system/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", + "frame-benchmarking", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "hex-literal", + "moonbeam-relay-encoder/runtime-benchmarks", + "moonbeam-runtime-common/runtime-benchmarks", + "moonbeam-xcm-benchmarks/runtime-benchmarks", + "parachains-common/runtime-benchmarks", + "pallet-asset-manager/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", + "pallet-author-inherent/runtime-benchmarks", + "pallet-author-mapping/runtime-benchmarks", + "pallet-author-slot-filter/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-conviction-voting/runtime-benchmarks", + "pallet-crowdloan-rewards/runtime-benchmarks", + "pallet-ethereum-xcm/runtime-benchmarks", + "pallet-ethereum/runtime-benchmarks", + "pallet-evm/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-migrations/runtime-benchmarks", + "pallet-moonbeam-lazy-migrations/runtime-benchmarks", + "pallet-moonbeam-orbiters/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-parachain-staking/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-randomness/runtime-benchmarks", + "pallet-referenda/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-society/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-whitelist/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", + "pallet-xcm-transactor/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "session-keys-primitives/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", ] try-runtime = [ - "fp-self-contained/try-runtime", - "frame-executive/try-runtime", - "frame-system/try-runtime", - "frame-try-runtime", - "moonbeam-runtime-common/try-runtime", - "pallet-asset-manager/try-runtime", - "pallet-author-mapping/try-runtime", - "pallet-author-slot-filter/try-runtime", - "pallet-balances/try-runtime", - "pallet-collective/try-runtime", - "pallet-conviction-voting/try-runtime", - "pallet-maintenance-mode/try-runtime", - "pallet-migrations/try-runtime", - "pallet-moonbeam-lazy-migrations/try-runtime", - "pallet-parachain-staking/try-runtime", - "pallet-preimage/try-runtime", - "pallet-referenda/try-runtime", - "pallet-root-testing/try-runtime", - "pallet-scheduler/try-runtime", - "pallet-society/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-whitelist/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "fp-self-contained/try-runtime", + "frame-executive/try-runtime", + "frame-system/try-runtime", + "frame-try-runtime", + "moonbeam-runtime-common/try-runtime", + "pallet-asset-manager/try-runtime", + "pallet-author-mapping/try-runtime", + "pallet-author-slot-filter/try-runtime", + "pallet-balances/try-runtime", + "pallet-collective/try-runtime", + "pallet-conviction-voting/try-runtime", + "pallet-maintenance-mode/try-runtime", + "pallet-migrations/try-runtime", + "pallet-moonbeam-lazy-migrations/try-runtime", + "pallet-parachain-staking/try-runtime", + "pallet-preimage/try-runtime", + "pallet-referenda/try-runtime", + "pallet-root-testing/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-society/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-whitelist/try-runtime", + "pallet-xcm/try-runtime", + "pallet-message-queue/try-runtime", + "pallet-utility/try-runtime", + "pallet-transaction-payment/try-runtime", + "parachain-info/try-runtime", + "pallet-evm-chain-id/try-runtime", + "parachain-info/try-runtime", + "pallet-evm/try-runtime", + "pallet-ethereum/try-runtime", + "pallet-treasury/try-runtime", + "pallet-author-inherent/try-runtime", + "pallet-crowdloan-rewards/try-runtime", + "pallet-proxy/try-runtime", + "pallet-identity/try-runtime", + "orml-xtokens/try-runtime", + "pallet-assets/try-runtime", + "pallet-xcm-transactor/try-runtime", + "pallet-proxy-genesis-companion/try-runtime", + "pallet-moonbeam-orbiters/try-runtime", + "pallet-ethereum-xcm/try-runtime", + "pallet-randomness/try-runtime", + "pallet-whitelist/try-runtime", + "pallet-erc20-xcm-bridge/try-runtime", + "pallet-multisig/try-runtime", ] diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 558bd5ba26..23a5241dcc 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -30,11 +30,9 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use account::AccountId20; use cumulus_pallet_parachain_system::{RelayChainStateProof, RelaychainDataProvider}; -use cumulus_primitives_core::relay_chain; use fp_rpc::TransactionStatus; -// Re-export required by get! macro. -use cumulus_primitives_core::{relay_chain::BlockNumber as RelayBlockNumber, DmpMessageHandler}; +use cumulus_primitives_core::{relay_chain, AggregateMessageOrigin}; #[cfg(feature = "std")] pub use fp_evm::GenesisAccount; pub use frame_support::traits::Get; @@ -49,8 +47,8 @@ use frame_support::{ tokens::imbalance::ResolveTo, tokens::{PayFromAccount, UnityAssetBalanceConversion}, ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, - EqualPrivilegeOnly, Imbalance, InstanceFilter, LinearStoragePrice, OffchainWorker, - OnFinalize, OnIdle, OnInitialize, OnRuntimeUpgrade, OnUnbalanced, + EqualPrivilegeOnly, Imbalance, InstanceFilter, LinearStoragePrice, OnFinalize, + OnUnbalanced, }, weights::{ constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND}, @@ -83,8 +81,6 @@ use smallvec::smallvec; use sp_api::impl_runtime_apis; use sp_consensus_slots::Slot; use sp_core::{OpaqueMetadata, H160, H256, U256}; -#[cfg(feature = "try-runtime")] -use sp_runtime::TryRuntimeError; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ @@ -148,7 +144,7 @@ pub mod currency { /// Maximum weight per block pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, u64::MAX) .saturating_div(2) - .set_proof_size(cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64); + .set_proof_size(relay_chain::MAX_POV_SIZE as u64); pub const MILLISECS_PER_BLOCK: u64 = 12000; pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); @@ -251,6 +247,8 @@ impl frame_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. type RuntimeOrigin = RuntimeOrigin; + /// The aggregated RuntimeTask type. + type RuntimeTask = RuntimeTask; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = ConstU32<256>; /// Maximum weight of each block. With a default weight system of 1byte == 1weight, 4mb is ok. @@ -302,7 +300,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = ConstU32<0>; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = ConstU32<1>; type WeightInfo = moonbeam_weights::pallet_balances::WeightInfo; } @@ -593,6 +590,15 @@ impl pallet_treasury::Config for Runtime { type BenchmarkHelper = BenchmarkHelper; } +parameter_types! { + pub const MaxSubAccounts: u32 = 100; + pub const MaxAdditionalFields: u32 = 100; + pub const MaxRegistrars: u32 = 20; + pub const PendingUsernameExpiration: u32 = 7 * DAYS; + pub const MaxSuffixLength: u32 = 7; + pub const MaxUsernameLength: u32 = 32; +} + type IdentityForceOrigin = EitherOfDiverse, governance::custom_origins::GeneralAdmin>; type IdentityRegistrarOrigin = @@ -603,18 +609,22 @@ impl pallet_identity::Config for Runtime { type Currency = Balances; // Add one item in storage and take 258 bytes type BasicDeposit = ConstU128<{ currency::deposit(1, 258) }>; - // Not add any item to the storage but takes 66 bytes - type FieldDeposit = ConstU128<{ currency::deposit(0, 66) }>; + // Does not add any item to the storage but takes 1 bytes + type ByteDeposit = ConstU128<{ currency::deposit(0, 1) }>; // Add one item in storage and take 53 bytes type SubAccountDeposit = ConstU128<{ currency::deposit(1, 53) }>; - type MaxSubAccounts = ConstU32<100>; - type MaxAdditionalFields = ConstU32<100>; - type IdentityInformation = pallet_identity::simple::IdentityInfo; - - type MaxRegistrars = ConstU32<20>; + type MaxSubAccounts = MaxSubAccounts; + type IdentityInformation = pallet_identity::legacy::IdentityInfo; + type MaxRegistrars = MaxRegistrars; type Slashed = Treasury; type ForceOrigin = IdentityForceOrigin; type RegistrarOrigin = IdentityRegistrarOrigin; + type OffchainSignature = Signature; + type SigningPublicKey = ::Signer; + type UsernameAuthorityOrigin = EnsureRoot; + type PendingUsernameExpiration = PendingUsernameExpiration; + type MaxSuffixLength = MaxSuffixLength; + type MaxUsernameLength = MaxUsernameLength; type WeightInfo = moonbeam_weights::pallet_identity::WeightInfo; } @@ -657,13 +667,14 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = ParachainInfo; - type DmpMessageHandler = MaintenanceMode; type ReservedDmpWeight = ReservedDmpWeight; type OutboundXcmpMessageSource = XcmpQueue; type XcmpMessageHandler = XcmpQueue; type ReservedXcmpWeight = ReservedXcmpWeight; type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; type ConsensusHook = cumulus_pallet_parachain_system::ExpectParentIncluded; + type DmpQueue = frame_support::traits::EnqueueWithOrigin; + type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight; } pub struct EthereumXcmEnsureProxy; @@ -695,6 +706,7 @@ impl pallet_ethereum_xcm::Config for Runtime { parameter_types! { pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; } impl parachain_info::Config for Runtime {} @@ -1180,78 +1192,6 @@ impl moonkit_xcm_primitives::PauseXcmExecution for XcmExecutionManager { } } -pub struct NormalDmpHandler; -impl DmpMessageHandler for NormalDmpHandler { - // This implementation makes messages be queued - // Since the limit is 0, messages are queued for next iteration - fn handle_dmp_messages( - iter: impl Iterator)>, - limit: Weight, - ) -> Weight { - (if Migrations::should_pause_xcm() { - DmpQueue::handle_dmp_messages(iter, Weight::zero()) - } else { - DmpQueue::handle_dmp_messages(iter, limit) - }) + ::DbWeight::get().reads(1) - } -} - -pub struct MaintenanceDmpHandler; -impl DmpMessageHandler for MaintenanceDmpHandler { - // This implementation makes messages be queued - // Since the limit is 0, messages are queued for next iteration - fn handle_dmp_messages( - iter: impl Iterator)>, - _limit: Weight, - ) -> Weight { - DmpQueue::handle_dmp_messages(iter, Weight::zero()) - } -} - -/// The hooks we want to run in Maintenance Mode -pub struct MaintenanceHooks; - -impl OnInitialize for MaintenanceHooks { - fn on_initialize(n: BlockNumber) -> Weight { - AllPalletsWithSystem::on_initialize(n) - } -} - -// return 0 -// For some reason using empty tuple () isnt working -// There exist only two pallets that use onIdle and these are xcmp and dmp queues -// For some reason putting an empty tumple does not work (transaction never finishes) -// We use an empty onIdle, if on the future we want one of the pallets to execute it -// we need to provide it here -impl OnIdle for MaintenanceHooks { - fn on_idle(_n: BlockNumber, _max_weight: Weight) -> Weight { - Weight::zero() - } -} - -impl OnRuntimeUpgrade for MaintenanceHooks { - fn on_runtime_upgrade() -> Weight { - AllPalletsWithSystem::on_runtime_upgrade() - } - - #[cfg(feature = "try-runtime")] - fn try_on_runtime_upgrade(checks: bool) -> Result { - AllPalletsWithSystem::try_on_runtime_upgrade(checks) - } -} - -impl OnFinalize for MaintenanceHooks { - fn on_finalize(n: BlockNumber) { - AllPalletsWithSystem::on_finalize(n) - } -} - -impl OffchainWorker for MaintenanceHooks { - fn offchain_worker(n: BlockNumber) { - AllPalletsWithSystem::offchain_worker(n) - } -} - impl pallet_maintenance_mode::Config for Runtime { type RuntimeEvent = RuntimeEvent; type NormalCallFilter = NormalFilter; @@ -1259,12 +1199,6 @@ impl pallet_maintenance_mode::Config for Runtime { type MaintenanceOrigin = pallet_collective::EnsureProportionAtLeast; type XcmExecutionManager = XcmExecutionManager; - type NormalDmpHandler = NormalDmpHandler; - type MaintenanceDmpHandler = MaintenanceDmpHandler; - // We use AllPalletsWithSystem because we dont want to change the hooks in normal - // operation - type NormalExecutiveHooks = AllPalletsWithSystem; - type MaintenanceExecutiveHooks = MaintenanceHooks; } impl pallet_proxy_genesis_companion::Config for Runtime { @@ -1355,7 +1289,9 @@ impl pallet_randomness::Config for Runtime { type WeightInfo = moonbeam_weights::pallet_randomness::WeightInfo; } -impl pallet_root_testing::Config for Runtime {} +impl pallet_root_testing::Config for Runtime { + type RuntimeEvent = RuntimeEvent; +} parameter_types! { // One storage item; key size is 32 + 20; value is size 4+4+16+20 bytes = 44 bytes. @@ -1384,7 +1320,7 @@ construct_runtime! { // Previously 2: pallet_randomness_collective_flip Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, - RootTesting: pallet_root_testing::{Pallet, Call, Storage} = 5, + RootTesting: pallet_root_testing::{Pallet, Call, Storage, Event} = 5, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -1450,7 +1386,7 @@ construct_runtime! { // Previously 108: pallet_assets:: EthereumXcm: pallet_ethereum_xcm::{Pallet, Call, Storage, Origin} = 109, Erc20XcmBridge: pallet_erc20_xcm_bridge::{Pallet} = 110, - + MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 111, // Randomness Randomness: pallet_randomness::{Pallet, Call, Storage, Event, Inherent} = 120, @@ -1481,7 +1417,7 @@ mod benches { [pallet_proxy, Proxy] [pallet_identity, Identity] [cumulus_pallet_xcmp_queue, XcmpQueue] - [pallet_xcm, PolkadotXcm] + [pallet_xcm, PalletXcmExtrinsiscsBenchmark::] [pallet_asset_manager, AssetManager] [pallet_xcm_transactor, XcmTransactor] [pallet_moonbeam_orbiters, MoonbeamOrbiters] @@ -1526,7 +1462,7 @@ pub type Executive = frame_executive::Executive< Block, frame_system::ChainContext, Runtime, - pallet_maintenance_mode::ExecutiveHooks, + AllPalletsWithSystem, >; // All of our runtimes share most of their Runtime API implementations. @@ -1734,8 +1670,8 @@ mod tests { Balance::from(10 * GLMR + 2580 * MILLIGLMR) ); assert_eq!( - get!(pallet_identity, FieldDeposit, u128), - Balance::from(660 * MILLIGLMR) + get!(pallet_identity, ByteDeposit, u128), + Balance::from(10 * MILLIGLMR) ); assert_eq!( get!(pallet_identity, SubAccountDeposit, u128), diff --git a/runtime/moonbeam/src/precompiles.rs b/runtime/moonbeam/src/precompiles.rs index cf7469bb62..8ffbf9dab3 100644 --- a/runtime/moonbeam/src/precompiles.rs +++ b/runtime/moonbeam/src/precompiles.rs @@ -229,7 +229,7 @@ type MoonbeamPrecompilesAt = ( >, PrecompileAt< AddressU64<2072>, - IdentityPrecompile, + IdentityPrecompile, (CallableByContract, CallableByPrecompile), >, ); diff --git a/runtime/moonbeam/src/xcm_config.rs b/runtime/moonbeam/src/xcm_config.rs index 8985f52563..6325b3ba87 100644 --- a/runtime/moonbeam/src/xcm_config.rs +++ b/runtime/moonbeam/src/xcm_config.rs @@ -18,19 +18,19 @@ //! use super::{ - governance, AccountId, AssetId, AssetManager, Assets, Balance, Balances, DealWithFees, - Erc20XcmBridge, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, - RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, + governance, AccountId, AssetId, AssetManager, Balance, Balances, DealWithFees, Erc20XcmBridge, + MaintenanceMode, MessageQueue, ParachainInfo, ParachainSystem, Perbill, PolkadotXcm, Runtime, + RuntimeBlockWeights, RuntimeCall, RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, }; use frame_support::{ parameter_types, - traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess}, + traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess, TransformOrigin}, }; use moonbeam_runtime_common::weights as moonbeam_weights; use pallet_evm_precompileset_assets_erc20::AccountIdAssetIdConversion; use sp_runtime::{ - traits::{Hash as THash, PostDispatchInfoOf}, + traits::{Hash as THash, MaybeEquivalence, PostDispatchInfoOf}, DispatchErrorWithPostInfo, }; use sp_weights::Weight; @@ -40,25 +40,31 @@ use sp_core::{ConstU32, H160, H256}; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, - DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FungiblesAdapter, HashedDescription, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, DescribeAllTerminal, DescribeFamily, + EnsureXcmOrigin, FungibleAdapter as XcmCurrencyAdapter, FungiblesAdapter, HashedDescription, NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; -use xcm::latest::prelude::*; +use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; +use xcm::latest::prelude::{ + Asset, GlobalConsensus, InteriorLocation, Junction, Location, NetworkId, PalletInstance, + Parachain, +}; use xcm_executor::traits::{CallDispatcher, ConvertLocation, JustTry}; +use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use orml_xcm_support::MultiNativeAsset; use xcm_primitives::{ - AbsoluteAndRelativeReserve, AccountIdToCurrencyId, AccountIdToMultiLocation, AsAssetType, + AbsoluteAndRelativeReserve, AccountIdToCurrencyId, AccountIdToLocation, AsAssetType, FirstAssetTrader, SignedToAccountId20, UtilityAvailableCalls, UtilityEncodeCall, XcmTransact, }; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; +use sp_core::Get; use sp_std::{ convert::{From, Into, TryFrom}, prelude::*, @@ -73,21 +79,21 @@ parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; // The relay chain Origin type pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())].into(); // Self Reserve location, defines the multilocation identifiying the self-reserve currency // This is used to match it also against our Balances pallet when we receive such - // a MultiLocation: (Self Balances pallet index) + // a Location: (Self Balances pallet index) // We use the RELATIVE multilocation - pub SelfReserve: MultiLocation = MultiLocation { + pub SelfReserve: Location = Location { parents:0, - interior: Junctions::X1( + interior: [ PalletInstance(::index() as u8) - ) + ].into() }; } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( @@ -95,7 +101,7 @@ pub type LocationToAccountId = ( ParentIsPreset, // Sibling parachain origins convert to AccountId via the `ParaId::into`. SiblingParachainConvertsVia, - // If we receive a MultiLocation of type AccountKey20, just generate a native account + // If we receive a Location of type AccountKey20, just generate a native account AccountKey20Aliases, // Generate remote accounts according to polkadot standards HashedDescription>, @@ -104,7 +110,7 @@ pub type LocationToAccountId = ( /// Wrapper type around `LocationToAccountId` to convert an `AccountId` to type `H160`. pub struct LocationToH160; impl ConvertLocation for LocationToH160 { - fn convert_location(location: &MultiLocation) -> Option { + fn convert_location(location: &Location) -> Option { >::convert_location(location) .map(Into::into) } @@ -114,7 +120,7 @@ impl ConvertLocation for LocationToH160 { // It will use pallet-assets, and the Id will be matched against AsAssetType pub type ForeignFungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: - Assets, + super::Assets, // Use this currency when it is a fungible asset matching the given location or name: ( ConvertedConcreteId< @@ -124,7 +130,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< JustTry, >, ), - // Do a simple punn to convert an AccountId20 MultiLocation into a native chain account ID: + // Do a simple punn to convert an AccountId20 Location into a native chain account ID: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -218,7 +224,7 @@ parameter_types! { /// We do not burn anything because we want to mimic exactly what /// the sovereign account has pub type XcmFeesToAccount = xcm_primitives::XcmFeesToAccount< - Assets, + super::Assets, ( ConvertedConcreteId< AssetId, @@ -297,14 +303,15 @@ impl xcm_executor::Config for XcmExecutorConfig { type UniversalAliases = Nothing; type SafeCallFilter = SafeCallFilter; type Aliasers = Nothing; + type TransactionalProcessor = xcm_builder::FrameTransactionalProcessor; } type XcmExecutor = pallet_erc20_xcm_bridge::XcmExecutorWrapper< - RuntimeCall, + XcmExecutorConfig, xcm_executor::XcmExecutor, >; -// Converts a Signed Local Origin into a MultiLocation +// Converts a Signed Local Origin into a Location pub type LocalOriginToLocation = SignedToAccountId20; /// The means for routing XCM messages which are not for local execution into the right message @@ -316,11 +323,6 @@ pub type XcmRouter = ( XcmpQueue, ); -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -345,8 +347,6 @@ impl pallet_xcm::Config for Runtime { type RemoteLockConsumerIdentifier = (); // TODO pallet-xcm weights type WeightInfo = moonbeam_weights::pallet_xcm::WeightInfo; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; } @@ -357,10 +357,10 @@ impl cumulus_pallet_xcm::Config for Runtime { impl cumulus_pallet_xcmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; - type ExecuteOverweightOrigin = EnsureRoot; + type XcmpQueue = TransformOrigin; + type MaxInboundSuspended = sp_core::ConstU32<1_000>; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = moonbeam_weights::cumulus_pallet_xcmp_queue::WeightInfo; @@ -369,36 +369,100 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { >; } +parameter_types! { + pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; +} + +// TODO: This pallet can be removed after the lazy migration is done and +// event `Completed` is emitted. +// https://github.com/paritytech/polkadot-sdk/pull/1246 impl cumulus_pallet_dmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; - type ExecuteOverweightOrigin = EnsureRoot; + type DmpSink = frame_support::traits::EnqueueWithOrigin; + type WeightInfo = cumulus_pallet_dmp_queue::weights::SubstrateWeight; +} + +parameter_types! { + /// The amount of weight (if any) which should be provided to the message queue for + /// servicing enqueued items. + /// + /// This may be legitimately `None` in the case that you will call + /// `ServiceQueues::service_queues` manually. + pub MessageQueueServiceWeight: Weight = + Perbill::from_percent(25) * RuntimeBlockWeights::get().max_block; + /// The maximum number of stale pages (i.e. of overweight messages) allowed before culling + /// can happen. Once there are more stale pages than this, then historical pages may be + /// dropped, even if they contain unprocessed overweight messages. + pub const MessageQueueMaxStale: u32 = 8; + /// The size of the page; this implies the maximum message size which can be sent. + /// + /// A good value depends on the expected message sizes, their weights, the weight that is + /// available for processing them and the maximal needed message size. The maximal message + /// size is slightly lower than this as defined by [`MaxMessageLenOf`]. + pub const MessageQueueHeapSize: u32 = 128 * 1048; +} + +impl pallet_message_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + #[cfg(feature = "runtime-benchmarks")] + type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor< + cumulus_primitives_core::AggregateMessageOrigin, + >; + #[cfg(not(feature = "runtime-benchmarks"))] + type MessageProcessor = + xcm_builder::ProcessXcmMessage; + type Size = u32; + type HeapSize = MessageQueueHeapSize; + type MaxStale = MessageQueueMaxStale; + type ServiceWeight = MessageQueueServiceWeight; + // The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin: + type QueueChangeHandler = NarrowOriginToSibling; + // NarrowOriginToSibling calls XcmpQueue's is_paused if Origin is sibling. Allows all other origins + type QueuePausedQuery = (MaintenanceMode, NarrowOriginToSibling); + type WeightInfo = pallet_message_queue::weights::SubstrateWeight; } // Our AssetType. For now we only handle Xcm Assets #[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)] pub enum AssetType { - Xcm(MultiLocation), + Xcm(xcm::v3::Location), } impl Default for AssetType { fn default() -> Self { - Self::Xcm(MultiLocation::here()) + Self::Xcm(xcm::v3::Location::here()) } } -impl From for AssetType { - fn from(location: MultiLocation) -> Self { +impl From for AssetType { + fn from(location: xcm::v3::Location) -> Self { Self::Xcm(location) } } -impl Into> for AssetType { - fn into(self) -> Option { + +// This can be removed once we fully adopt xcm::v4 everywhere +impl TryFrom for AssetType { + type Error = (); + fn try_from(location: Location) -> Result { + Ok(Self::Xcm(location.try_into()?)) + } +} + +impl Into> for AssetType { + fn into(self) -> Option { match self { Self::Xcm(location) => Some(location), } } } +impl Into> for AssetType { + fn into(self) -> Option { + match self { + Self::Xcm(location) => xcm_builder::V4V3LocationConverter::convert_back(&location), + } + } +} + // Implementation on how to retrieve the AssetId from an AssetType // We simply hash the AssetType and take the lowest 128 bits impl From for AssetId { @@ -446,17 +510,17 @@ impl AccountIdToCurrencyId for Runtime { }) } } -// How to convert from CurrencyId to MultiLocation -pub struct CurrencyIdtoMultiLocation(sp_std::marker::PhantomData); -impl sp_runtime::traits::Convert> - for CurrencyIdtoMultiLocation +// How to convert from CurrencyId to Location +pub struct CurrencyIdToLocation(sp_std::marker::PhantomData); +impl sp_runtime::traits::Convert> + for CurrencyIdToLocation where - AssetXConverter: sp_runtime::traits::MaybeEquivalence, + AssetXConverter: sp_runtime::traits::MaybeEquivalence, { - fn convert(currency: CurrencyId) -> Option { + fn convert(currency: CurrencyId) -> Option { match currency { CurrencyId::SelfReserve => { - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), @@ -481,19 +545,19 @@ parameter_types! { // This is how we are going to detect whether the asset is a Reserve asset // This however is the chain part only - pub SelfLocation: MultiLocation = MultiLocation::here(); + pub SelfLocation: Location = Location::here(); // We need this to be able to catch when someone is trying to execute a non- // cross-chain transfer in xtokens through the absolute path way - pub SelfLocationAbsolute: MultiLocation = MultiLocation { + pub SelfLocationAbsolute: Location = Location { parents:1, - interior: Junctions::X1( + interior: [ Parachain(ParachainInfo::parachain_id().into()) - ) + ].into() }; } parameter_type_with_key! { - pub ParachainMinFee: |location: MultiLocation| -> Option { + pub ParachainMinFee: |location: Location| -> Option { match (location.parents, location.first_interior()) { // Polkadot AssetHub fee (1, Some(Parachain(1000u32))) => Some(50_000_000u128), @@ -506,9 +570,8 @@ impl orml_xtokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type CurrencyIdConvert = - CurrencyIdtoMultiLocation>; + type AccountIdToLocation = AccountIdToLocation; + type CurrencyIdConvert = CurrencyIdToLocation>; type XcmExecutor = XcmExecutor; type SelfLocation = SelfLocation; type Weigher = XcmWeigher; @@ -516,13 +579,13 @@ impl orml_xtokens::Config for Runtime { type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = AbsoluteAndRelativeReserve; } // 1 DOT should be enough parameter_types! { - pub MaxHrmpRelayFee: MultiAsset = (MultiLocation::parent(), 1_000_000_000_000u128).into(); + pub MaxHrmpRelayFee: Asset = (Location::parent(), 1_000_000_000_000u128).into(); } // For now we only allow to transact in the relay, although this might change in the future @@ -563,9 +626,9 @@ impl UtilityEncodeCall for Transactors { } impl XcmTransact for Transactors { - fn destination(self) -> MultiLocation { + fn destination(self) -> Location { match self { - Transactors::Relay => MultiLocation::parent(), + Transactors::Relay => Location::parent(), } } } @@ -580,9 +643,8 @@ impl pallet_xcm_transactor::Config for Runtime { type DerivativeAddressRegistrationOrigin = DerivativeAddressRegistrationOrigin; type SovereignAccountDispatcherOrigin = EnsureRoot; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type CurrencyIdToMultiLocation = - CurrencyIdtoMultiLocation>; + type AccountIdToLocation = AccountIdToLocation; + type CurrencyIdToLocation = CurrencyIdToLocation>; type XcmSender = XcmRouter; type SelfLocation = SelfLocation; type Weigher = XcmWeigher; @@ -599,11 +661,11 @@ parameter_types! { // This is the relative view of erc20 assets. // Identified by this prefix + AccountKey20(contractAddress) // We use the RELATIVE multilocation - pub Erc20XcmBridgePalletLocation: MultiLocation = MultiLocation { + pub Erc20XcmBridgePalletLocation: Location = Location { parents:0, - interior: Junctions::X1( + interior: [ PalletInstance(::index() as u8) - ) + ].into() }; // To be able to support almost all erc20 implementations, @@ -621,11 +683,12 @@ impl pallet_erc20_xcm_bridge::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] mod testing { use super::*; + use xcm_builder::V4V3LocationConverter; /// This From exists for benchmarking purposes. It has the potential side-effect of calling /// AssetManager::set_asset_type_asset_id() and should NOT be used in any production code. - impl From for CurrencyId { - fn from(location: MultiLocation) -> CurrencyId { + impl From for CurrencyId { + fn from(location: Location) -> CurrencyId { use xcm_primitives::AssetTypeGetter; // If it does not exist, for benchmarking purposes, we create the association @@ -634,7 +697,9 @@ mod testing { { asset_id } else { - let asset_type = AssetType::Xcm(location); + let asset_type = AssetType::Xcm( + V4V3LocationConverter::convert(&location).expect("convert to v3"), + ); let asset_id: AssetId = asset_type.clone().into(); AssetManager::set_asset_type_asset_id(asset_type, asset_id); asset_id diff --git a/runtime/moonbeam/tests/common/mod.rs b/runtime/moonbeam/tests/common/mod.rs index 353a68a64c..1db8374af5 100644 --- a/runtime/moonbeam/tests/common/mod.rs +++ b/runtime/moonbeam/tests/common/mod.rs @@ -26,7 +26,7 @@ pub use moonbeam_runtime::{ asset_config::AssetRegistrarMetadata, currency::{GIGAWEI, GLMR, SUPPLY_FACTOR, WEI}, xcm_config::AssetType, - AccountId, AssetId, AssetManager, Assets, AuthorInherent, Balance, Balances, CrowdloanRewards, + AccountId, AssetId, AssetManager, AuthorInherent, Balance, Balances, CrowdloanRewards, Ethereum, Executive, Header, InflationInfo, ParachainStaking, Range, Runtime, RuntimeCall, RuntimeEvent, System, TransactionConverter, TransactionPaymentAsGasPrice, UncheckedExtrinsic, HOURS, WEEKS, @@ -301,7 +301,7 @@ impl ExtBuilder { ) .unwrap(); for (account, balance) in xcm_asset_initialization.balances { - Assets::mint( + moonbeam_runtime::Assets::mint( origin_of(AssetManager::account_id()), asset_id.into(), account, diff --git a/runtime/moonbeam/tests/evm_tracing.rs b/runtime/moonbeam/tests/evm_tracing.rs index f7fe777829..144dae000e 100644 --- a/runtime/moonbeam/tests/evm_tracing.rs +++ b/runtime/moonbeam/tests/evm_tracing.rs @@ -52,9 +52,17 @@ mod tests { ); let transaction = ethereum_transaction(VALID_ETH_TX); let eth_uxt = unchecked_eth_tx(VALID_ETH_TX); + let block = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 1, + parent_hash: Default::default(), + state_root: Default::default(), + }; assert!(Runtime::trace_transaction( vec![non_eth_uxt.clone(), eth_uxt, non_eth_uxt.clone()], - &transaction + &transaction, + &block ) .is_ok()); }); @@ -84,10 +92,17 @@ mod tests { let eth_uxt = unchecked_eth_tx(VALID_ETH_TX); let eth_tx = ethereum_transaction(VALID_ETH_TX); let eth_extrinsic_hash = eth_tx.hash(); - + let block = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 1, + parent_hash: Default::default(), + state_root: Default::default(), + }; assert!(Runtime::trace_block( vec![non_eth_uxt.clone(), eth_uxt.clone(), non_eth_uxt, eth_uxt], - vec![eth_extrinsic_hash, eth_extrinsic_hash] + vec![eth_extrinsic_hash, eth_extrinsic_hash], + &block ) .is_ok()); }); diff --git a/runtime/moonbeam/tests/integration_test.rs b/runtime/moonbeam/tests/integration_test.rs index 3ec1073c92..6f78558bb4 100644 --- a/runtime/moonbeam/tests/integration_test.rs +++ b/runtime/moonbeam/tests/integration_test.rs @@ -64,7 +64,7 @@ use sp_runtime::{ }; use std::str::from_utf8; use xcm::latest::prelude::*; -use xcm::{VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation}; +use xcm::{VersionedAsset, VersionedAssets, VersionedLocation}; use xcm_builder::{ParentIsPreset, SiblingParachainConvertsVia}; use xcm_executor::traits::ConvertLocation; @@ -1576,7 +1576,7 @@ fn root_can_change_default_xcm_vers() { (AccountId::from(BOB), 1_000 * GLMR), ]) .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1588,13 +1588,14 @@ fn root_can_change_default_xcm_vers() { }]) .build() .execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); - let dest = MultiLocation { + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: [1u8; 32], - }), + }] + .into(), }; let source_id: moonbeam_runtime::AssetId = source_location.clone().into(); // Default XCM version is not set yet, so xtokens should fail because it does not @@ -1604,7 +1605,7 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V3(dest.clone())), + Box::new(xcm::VersionedLocation::V4(dest.clone())), WeightLimit::Limited(4000000000.into()) ), orml_xtokens::Error::::XcmExecutionFailed @@ -1621,7 +1622,7 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), WeightLimit::Limited(4000000000.into()) )); }) @@ -1630,7 +1631,7 @@ fn root_can_change_default_xcm_vers() { #[test] fn asset_can_be_registered() { ExtBuilder::default().build().execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); let source_id: moonbeam_runtime::AssetId = source_location.clone().into(); let asset_metadata = AssetRegistrarMetadata { name: b"RelayToken".to_vec(), @@ -1653,7 +1654,7 @@ fn asset_can_be_registered() { fn xcm_asset_erc20_precompiles_supply_and_balance() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1671,7 +1672,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { .execute_with(|| { // We have the assetId that corresponds to the relay chain registered let relay_asset_id: moonbeam_runtime::AssetId = - AssetType::Xcm(MultiLocation::parent()).into(); + AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1680,7 +1681,10 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { ); // Assert the asset has been created with the correct supply - assert_eq!(Assets::total_supply(relay_asset_id), 1_000 * GLMR); + assert_eq!( + moonbeam_runtime::Assets::total_supply(relay_asset_id), + 1_000 * GLMR + ); // Access totalSupply through precompile. Important that the context is correct Precompiles::new() @@ -1712,7 +1716,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { fn xcm_asset_erc20_precompiles_transfer() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1730,7 +1734,7 @@ fn xcm_asset_erc20_precompiles_transfer() { .execute_with(|| { // We have the assetId that corresponds to the relay chain registered let relay_asset_id: moonbeam_runtime::AssetId = - AssetType::Xcm(MultiLocation::parent()).into(); + AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1777,7 +1781,7 @@ fn xcm_asset_erc20_precompiles_transfer() { fn xcm_asset_erc20_precompiles_approve() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1795,7 +1799,7 @@ fn xcm_asset_erc20_precompiles_approve() { .execute_with(|| { // We have the assetId that corresponds to the relay chain registered let relay_asset_id: moonbeam_runtime::AssetId = - AssetType::Xcm(MultiLocation::parent()).into(); + AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1863,7 +1867,7 @@ fn xcm_asset_erc20_precompiles_approve() { fn xtokens_precompile_transfer() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1884,7 +1888,7 @@ fn xtokens_precompile_transfer() { // We have the assetId that corresponds to the relay chain registered let relay_asset_id: moonbeam_runtime::AssetId = - AssetType::Xcm(MultiLocation::parent()).into(); + AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1893,12 +1897,12 @@ fn xtokens_precompile_transfer() { ); // Alice has 1000 tokens. She should be able to send through precompile - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // We use the address of the asset as an identifier of the asset we want to transfer @@ -1923,7 +1927,7 @@ fn xtokens_precompile_transfer() { fn xtokens_precompile_transfer_multiasset() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1943,12 +1947,12 @@ fn xtokens_precompile_transfer_multiasset() { let xtokens_precompile_address = H160::from_low_u64_be(2052); // Alice has 1000 tokens. She should be able to send through precompile - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // This time we transfer it through TransferMultiAsset @@ -1959,7 +1963,7 @@ fn xtokens_precompile_transfer_multiasset() { xtokens_precompile_address, XtokensPCall::transfer_multiasset { // We want to transfer the relay token - asset: MultiLocation::parent(), + asset: Location::parent(), amount: 500_000_000_000_000u128.into(), destination: destination.clone(), weight: 4_000_000, @@ -1986,20 +1990,21 @@ fn make_sure_glmr_can_be_transferred_precompile() { .with_safe_xcm_version(2) .build() .execute_with(|| { - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: [1u8; 32], - }), + }] + .into(), }; assert_ok!(XTokens::transfer_multiasset( origin_of(AccountId::from(ALICE)), - Box::new(VersionedMultiAsset::V3(MultiAsset { - id: Concrete(moonbeam_runtime::xcm_config::SelfReserve::get()), + Box::new(VersionedAsset::V4(Asset { + id: AssetId(moonbeam_runtime::xcm_config::SelfReserve::get()), fun: Fungible(1000) })), - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(40000.into()) )); }); @@ -2020,18 +2025,19 @@ fn make_sure_glmr_can_be_transferred() { .with_safe_xcm_version(2) .build() .execute_with(|| { - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: [1u8; 32], - }), + }] + .into(), }; assert_ok!(XTokens::transfer( origin_of(AccountId::from(ALICE)), CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(40000.into()) )); }); @@ -2051,24 +2057,25 @@ fn make_sure_polkadot_xcm_cannot_be_called() { )]) .build() .execute_with(|| { - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: [1u8; 32], - }), + }] + .into(), }; - let multiassets: MultiAssets = [MultiAsset { - id: Concrete(moonbeam_runtime::xcm_config::SelfLocation::get()), + let assets: Assets = [Asset { + id: AssetId(moonbeam_runtime::xcm_config::SelfLocation::get()), fun: Fungible(1000), }] .to_vec() .into(); assert_noop!( RuntimeCall::PolkadotXcm(pallet_xcm::Call::::reserve_transfer_assets { - dest: Box::new(VersionedMultiLocation::V3(dest.clone())), - beneficiary: Box::new(VersionedMultiLocation::V3(dest)), - assets: Box::new(VersionedMultiAssets::V3(multiassets)), + dest: Box::new(VersionedLocation::V4(dest.clone())), + beneficiary: Box::new(VersionedLocation::V4(dest)), + assets: Box::new(VersionedAssets::V4(assets)), fee_asset_item: 0, }) .dispatch(::RuntimeOrigin::signed( @@ -2090,9 +2097,9 @@ fn transact_through_signed_precompile_works_v2() { .build() .execute_with(|| { // Destination - let dest = MultiLocation::parent(); + let dest = Location::parent(); - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -2130,9 +2137,9 @@ fn transact_through_signed_cannot_send_to_local_chain() { .build() .execute_with(|| { // Destination - let dest = MultiLocation::here(); + let dest = Location::here(); - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -2170,7 +2177,7 @@ fn transactor_cannot_use_more_than_max_weight() { (AccountId::from(BOB), 1_000 * GLMR), ]) .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -2182,7 +2189,7 @@ fn transactor_cannot_use_more_than_max_weight() { }]) .build() .execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); let source_id: moonbeam_runtime::AssetId = source_location.clone().into(); assert_ok!(XcmTransactor::register( root_origin(), @@ -2193,7 +2200,7 @@ fn transactor_cannot_use_more_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000.into(), @@ -2203,7 +2210,7 @@ fn transactor_cannot_use_more_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1, )); @@ -2213,9 +2220,9 @@ fn transactor_cannot_use_more_than_max_weight() { moonbeam_runtime::xcm_config::Transactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![], @@ -2259,7 +2266,7 @@ fn call_xtokens_with_fee() { ]) .with_safe_xcm_version(2) .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -2271,17 +2278,19 @@ fn call_xtokens_with_fee() { }]) .build() .execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); - let dest = MultiLocation { + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: [1u8; 32], - }), + }] + .into(), }; let source_id: moonbeam_runtime::AssetId = source_location.clone().into(); - let before_balance = Assets::balance(source_id, &AccountId::from(ALICE)); + let before_balance = + moonbeam_runtime::Assets::balance(source_id, &AccountId::from(ALICE)); // We are able to transfer with fee assert_ok!(XTokens::transfer_with_fee( @@ -2289,11 +2298,12 @@ fn call_xtokens_with_fee() { CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, 100, - Box::new(xcm::VersionedMultiLocation::V3(dest.clone())), + Box::new(xcm::VersionedLocation::V4(dest.clone())), WeightLimit::Limited(4000000000.into()) )); - let after_balance = Assets::balance(source_id, &AccountId::from(ALICE)); + let after_balance = + moonbeam_runtime::Assets::balance(source_id, &AccountId::from(ALICE)); // At least these much (plus fees) should have been charged assert_eq!(before_balance - 100_000_000_000_000 - 100, after_balance); }); @@ -2304,7 +2314,7 @@ fn test_xcm_utils_ml_tp_account() { ExtBuilder::default().build().execute_with(|| { let xcm_utils_precompile_address = H160::from_low_u64_be(2060); let expected_address_parent: H160 = - ParentIsPreset::::convert_location(&MultiLocation::parent()) + ParentIsPreset::::convert_location(&Location::parent()) .unwrap() .into(); @@ -2313,17 +2323,17 @@ fn test_xcm_utils_ml_tp_account() { ALICE, xcm_utils_precompile_address, XcmUtilsPCall::multilocation_to_address { - multilocation: MultiLocation::parent(), + location: Location::parent(), }, ) .expect_cost(1000) .expect_no_logs() .execute_returns(Address(expected_address_parent)); - let parachain_2000_multilocation = MultiLocation::new(1, X1(Parachain(2000))); + let parachain_2000_location = Location::new(1, [Parachain(2000)]); let expected_address_parachain: H160 = SiblingParachainConvertsVia::::convert_location( - ¶chain_2000_multilocation, + ¶chain_2000_location, ) .unwrap() .into(); @@ -2333,27 +2343,28 @@ fn test_xcm_utils_ml_tp_account() { ALICE, xcm_utils_precompile_address, XcmUtilsPCall::multilocation_to_address { - multilocation: parachain_2000_multilocation, + location: parachain_2000_location, }, ) .expect_cost(1000) .expect_no_logs() .execute_returns(Address(expected_address_parachain)); - let alice_in_parachain_2000_multilocation = MultiLocation::new( + let alice_in_parachain_2000_location = Location::new( 1, - X2( + [ Parachain(2000), AccountKey20 { network: None, key: ALICE, }, - ), + ], ); - let expected_address_alice_in_parachain_2000: H160 = - xcm_builder::HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &alice_in_parachain_2000_multilocation, - ) + let expected_address_alice_in_parachain_2000 = + xcm_builder::HashedDescription::< + AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&alice_in_parachain_2000_location) .unwrap() .into(); @@ -2362,7 +2373,7 @@ fn test_xcm_utils_ml_tp_account() { ALICE, xcm_utils_precompile_address, XcmUtilsPCall::multilocation_to_address { - multilocation: alice_in_parachain_2000_multilocation, + location: alice_in_parachain_2000_location, }, ) .expect_cost(1000) @@ -2378,7 +2389,7 @@ fn test_xcm_utils_weight_message() { let expected_weight = XcmWeight::::clear_origin().ref_time(); - let message: Vec = xcm::VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); + let message: Vec = xcm::VersionedXcm::<()>::V4(Xcm(vec![ClearOrigin])).encode(); let input = XcmUtilsPCall::weight_message { message: message.into(), @@ -2396,9 +2407,9 @@ fn test_xcm_utils_weight_message() { fn test_xcm_utils_get_units_per_second() { ExtBuilder::default().build().execute_with(|| { let xcm_utils_precompile_address = H160::from_low_u64_be(2060); - let multilocation = SelfReserve::get(); + let location = SelfReserve::get(); - let input = XcmUtilsPCall::get_units_per_second { multilocation }; + let input = XcmUtilsPCall::get_units_per_second { location }; let expected_units = WEIGHT_REF_TIME_PER_SECOND as u128 * moonbeam_runtime::currency::WEIGHT_FEE; diff --git a/runtime/moonbeam/tests/xcm_mock/parachain.rs b/runtime/moonbeam/tests/xcm_mock/parachain.rs index bf3bd82f2a..bff719f23c 100644 --- a/runtime/moonbeam/tests/xcm_mock/parachain.rs +++ b/runtime/moonbeam/tests/xcm_mock/parachain.rs @@ -26,10 +26,9 @@ use frame_support::{ weights::Weight, PalletId, }; +pub use moonbeam_runtime::xcm_config::AssetType; -use cumulus_primitives_core::relay_chain::HrmpChannelId; use frame_system::{pallet_prelude::BlockNumberFor, EnsureNever, EnsureRoot}; -use orml_traits::parameter_type_with_key; use pallet_xcm::migration::v1::VersionUncheckedMigrateToV1; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use sp_core::H256; @@ -40,18 +39,20 @@ use sp_runtime::{ use sp_std::{convert::TryFrom, prelude::*}; use xcm::{latest::prelude::*, Version as XcmVersion, VersionedXcm}; +use cumulus_primitives_core::relay_chain::HrmpChannelId; +use orml_traits::parameter_type_with_key; use pallet_ethereum::PostLogContent; use polkadot_core_primitives::BlockNumber as RelayBlockNumber; use polkadot_parachain::primitives::{Id as ParaId, Sibling}; use xcm::latest::{ AssetId as XcmAssetId, Error as XcmError, ExecuteXcm, Junction::{PalletInstance, Parachain}, - Junctions, MultiLocation, NetworkId, Outcome, Xcm, + Location, NetworkId, Outcome, Xcm, }; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, - EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, FungiblesAdapter, IsConcrete, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, EnsureXcmOrigin, FixedRateOfFungible, + FixedWeightBounds, FungibleAdapter as XcmCurrencyAdapter, FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, @@ -78,6 +79,7 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -119,7 +121,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -172,7 +173,7 @@ impl pallet_assets::Config for Runtime { } } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( @@ -182,7 +183,10 @@ pub type LocationToAccountId = ( SiblingParachainConvertsVia, AccountKey20Aliases, // Generate remote accounts according to polkadot standards - xcm_builder::HashedDescriptionDescribeFamilyAllTerminal, + xcm_builder::HashedDescription< + AccountId, + xcm_builder::DescribeFamily, + >, ); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, @@ -225,7 +229,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< JustTry, >, ), - // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: + // Do a simple punn to convert an AccountId32 Location into a native chain account ID: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -241,7 +245,7 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< // Use this currency when it is a fungible asset matching any of the locations in // SelfReserveRepresentations IsConcrete, - // We can convert the MultiLocations with our converter above: + // We can convert the Locations with our converter above: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -293,20 +297,23 @@ pub type XcmFeesToAccount_ = xcm_primitives::XcmFeesToAccount< parameter_types! { // We cannot skip the native trader for some specific tests, so we will have to work with // a native trader that charges same number of units as weight - pub ParaTokensPerSecond: (XcmAssetId, u128, u128) = - (Concrete(SelfReserve::get()), 1000000000000, 0); + pub ParaTokensPerSecond: (XcmAssetId, u128, u128) = ( + AssetId(SelfReserve::get()), + 1000000000000, + 0, + ); } parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); - pub SelfReserve: MultiLocation = MultiLocation { + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())].into(); + pub SelfReserve: Location = Location { parents:0, - interior: Junctions::X1( + interior: [ PalletInstance(::index() as u8) - ) + ].into() }; pub const MaxAssetsIntoHolding: u32 = 64; } @@ -352,6 +359,8 @@ impl Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + + type TransactionalProcessor = (); } impl cumulus_pallet_xcm::Config for Runtime { @@ -366,17 +375,17 @@ pub enum CurrencyId { ForeignAsset(AssetId), } -// How to convert from CurrencyId to MultiLocation -pub struct CurrencyIdtoMultiLocation(sp_std::marker::PhantomData); -impl sp_runtime::traits::Convert> - for CurrencyIdtoMultiLocation +// How to convert from CurrencyId to Location +pub struct CurrencyIdToLocation(sp_std::marker::PhantomData); +impl sp_runtime::traits::Convert> + for CurrencyIdToLocation where - AssetXConverter: MaybeEquivalence, + AssetXConverter: MaybeEquivalence, { - fn convert(currency: CurrencyId) -> Option { + fn convert(currency: CurrencyId) -> Option { match currency { CurrencyId::SelfReserve => { - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), @@ -387,17 +396,17 @@ where parameter_types! { pub const BaseXcmWeight: Weight = Weight::from_parts(100u64, 100u64); pub const MaxAssetsForTransfer: usize = 2; - pub SelfLocation: MultiLocation = MultiLocation::here(); - pub SelfLocationAbsolute: MultiLocation = MultiLocation { + pub SelfLocation: Location = Location::here(); + pub SelfLocationAbsolute: Location = Location { parents:1, - interior: Junctions::X1( + interior: [ Parachain(MsgQueue::parachain_id().into()) - ) + ].into() }; } parameter_type_with_key! { - pub ParachainMinFee: |location: MultiLocation| -> Option { + pub ParachainMinFee: |location: Location| -> Option { match (location.parents, location.first_interior()) { (1, Some(Parachain(4u32))) => Some(50u128), _ => None, @@ -410,9 +419,9 @@ impl orml_xtokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = xcm_primitives::AccountIdToMultiLocation; + type AccountIdToLocation = xcm_primitives::AccountIdToLocation; type CurrencyIdConvert = - CurrencyIdtoMultiLocation>; + CurrencyIdToLocation>; type XcmExecutor = XcmExecutor; type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; @@ -420,7 +429,7 @@ impl orml_xtokens::Config for Runtime { type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = xcm_primitives::AbsoluteAndRelativeReserve; } @@ -525,15 +534,25 @@ pub mod mock_msg_queue { let hash = Encode::using_encoded(&xcm, T::Hashing::hash); let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { - let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); + let location = Location::new(1, [Parachain(sender.into())]); let mut id = [0u8; 32]; id.copy_from_slice(hash.as_ref()); - match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { - Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), + match T::XcmExecutor::prepare_and_execute( + location, + xcm, + &mut id, + max_weight, + Weight::zero(), + ) { + Outcome::Error { error } => { + (Err(error.clone()), Event::Fail(Some(hash), error)) + } + Outcome::Complete { used } => (Ok(used), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), + Outcome::Incomplete { used, error } => { + (Ok(used), Event::Fail(Some(hash), error)) + } } } Err(()) => ( @@ -577,7 +596,7 @@ pub mod mock_msg_queue { limit: Weight, ) -> Weight { for (_i, (_sent_at, data)) in iter.enumerate() { - let id = sp_io::hashing::blake2_256(&data[..]); + let mut id = sp_io::hashing::blake2_256(&data[..]); let maybe_msg = VersionedXcm::::decode(&mut &data[..]) .map(Xcm::::try_from); match maybe_msg { @@ -588,7 +607,14 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); + let outcome = T::XcmExecutor::prepare_and_execute( + Parent, + x, + &mut id, + limit, + Weight::zero(), + ); + Self::deposit_event(Event::ExecutedDownward(id, outcome)); } } @@ -654,12 +680,7 @@ pub type LocalOriginToLocation = xcm_primitives::SignedToAccountId20; parameter_types! { - pub MatcherLocation: MultiLocation = MultiLocation::here(); -} - -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub MatcherLocation: Location = Location::here(); } impl pallet_xcm::Config for Runtime { @@ -688,48 +709,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; -} - -// Our AssetType. For now we only handle Xcm Assets -#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)] -pub enum AssetType { - Xcm(MultiLocation), -} -impl Default for AssetType { - fn default() -> Self { - Self::Xcm(MultiLocation::here()) - } -} - -impl From for AssetType { - fn from(location: MultiLocation) -> Self { - Self::Xcm(location) - } -} - -impl Into> for AssetType { - fn into(self) -> Option { - match self { - Self::Xcm(location) => Some(location), - } - } -} - -// Implementation on how to retrieve the AssetId from an AssetType -// We simply hash the AssetType and take the lowest 128 bits -impl From for AssetId { - fn from(asset: AssetType) -> AssetId { - match asset { - AssetType::Xcm(id) => { - let mut result: [u8; 16] = [0u8; 16]; - let hash: H256 = id.using_encoded(::Hashing::hash); - result.copy_from_slice(&hash.as_fixed_bytes()[0..16]); - u128::from_le_bytes(result) - } - } - } } // We instruct how to register the Assets @@ -763,7 +742,7 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { fn destroy_foreign_asset(asset: AssetId) -> DispatchResult { // Mark the asset as destroying - Assets::start_destroy(RuntimeOrigin::root(), asset)?; + Assets::start_destroy(RuntimeOrigin::root(), asset.into())?; Ok(()) } @@ -816,7 +795,7 @@ impl pallet_asset_manager::Config for Runtime { // 1 DOT should be enough parameter_types! { - pub MaxHrmpRelayFee: MultiAsset = (MultiLocation::parent(), 1_000_000_000_000u128).into(); + pub MaxHrmpRelayFee: Asset = (Location::parent(), 1_000_000_000_000u128).into(); } impl pallet_xcm_transactor::Config for Runtime { @@ -826,9 +805,9 @@ impl pallet_xcm_transactor::Config for Runtime { type DerivativeAddressRegistrationOrigin = EnsureRoot; type SovereignAccountDispatcherOrigin = frame_system::EnsureRoot; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = xcm_primitives::AccountIdToMultiLocation; - type CurrencyIdToMultiLocation = - CurrencyIdtoMultiLocation>; + type AccountIdToLocation = xcm_primitives::AccountIdToLocation; + type CurrencyIdToLocation = + CurrencyIdToLocation>; type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; type UniversalLocation = UniversalLocation; @@ -941,9 +920,9 @@ pub enum MockTransactors { } impl xcm_primitives::XcmTransact for MockTransactors { - fn destination(self) -> MultiLocation { + fn destination(self) -> Location { match self { - MockTransactors::Relay => MultiLocation::parent(), + MockTransactors::Relay => Location::parent(), } } } @@ -996,7 +975,6 @@ impl pallet_ethereum::Config for Runtime { type PostLogContent = PostBlockAndTxnHashes; type ExtraDataLength = ConstU32<30>; } - parameter_types! { pub ReservedXcmpWeight: Weight = Weight::from_parts(u64::max_value(), 0); } diff --git a/runtime/moonbeam/tests/xcm_mock/relay_chain.rs b/runtime/moonbeam/tests/xcm_mock/relay_chain.rs index 8eeaad46cd..40bff5e1ae 100644 --- a/runtime/moonbeam/tests/xcm_mock/relay_chain.rs +++ b/runtime/moonbeam/tests/xcm_mock/relay_chain.rs @@ -40,9 +40,10 @@ use xcm::latest::prelude::*; use xcm_builder::{ Account32Hash, AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, - ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, - FixedWeightBounds, IsConcrete, ProcessXcmMessage, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, + ChildSystemParachainAsSuperuser, FixedRateOfFungible, FixedWeightBounds, + FungibleAdapter as XcmCurrencyAdapter, IsConcrete, ProcessXcmMessage, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + WithComputedOrigin, }; use xcm_executor::{Config, XcmExecutor}; pub type AccountId = AccountId32; @@ -56,6 +57,7 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -97,7 +99,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -109,17 +110,19 @@ impl pallet_utility::Config for Runtime { type PalletsOrigin = OriginCaller; } -impl shared::Config for Runtime {} +impl shared::Config for Runtime { + type DisabledValidators = (); +} impl configuration::Config for Runtime { type WeightInfo = configuration::TestWeightInfo; } parameter_types! { - pub KsmLocation: MultiLocation = Here.into(); + pub KsmLocation: Location = Here.into(); pub const KusamaNetwork: NetworkId = NetworkId::Kusama; pub const AnyNetwork: Option = None; - pub UniversalLocation: InteriorMultiLocation = Here; + pub UniversalLocation: InteriorLocation = Here; } pub type SovereignAccountOf = ( @@ -142,10 +145,10 @@ type LocalOriginConverter = ( parameter_types! { pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); - pub KsmPerSecond: (AssetId, u128, u128) = (Concrete(KsmLocation::get()), 1, 1); + pub KsmPerSecond: (AssetId, u128, u128) = (AssetId(KsmLocation::get()), 1, 1); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; - pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub MatcherLocation: Location = Location::here(); } pub type XcmRouter = super::RelayChainXcmRouter; @@ -168,9 +171,9 @@ pub type XcmBarrier = ( ); parameter_types! { - pub Kusama: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(KsmLocation::get()) }); - pub Statemine: MultiLocation = Parachain(4).into(); - pub KusamaForStatemine: (MultiAssetFilter, MultiLocation) = (Kusama::get(), Statemine::get()); + pub Kusama: AssetFilter = Wild(AllOf { fun: WildFungible, id: AssetId(KsmLocation::get()) }); + pub Statemine: Location = Parachain(4).into(); + pub KusamaForStatemine: (AssetFilter, Location) = (Kusama::get(), Statemine::get()); } pub type TrustedTeleporters = xcm_builder::Case; @@ -201,15 +204,11 @@ impl Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + type TransactionalProcessor = (); } pub type LocalOriginToLocation = SignedToAccountId32; -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; @@ -235,8 +234,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; } parameter_types! { @@ -272,6 +269,7 @@ impl paras::Config for Runtime { type NextSessionRotation = TestNextSessionRotation; type QueueFootprinter = (); type OnNewHead = (); + type AssignCoretime = (); } impl dmp::Config for Runtime {} @@ -404,7 +402,6 @@ impl hrmp::WeightInfo for TestHrmpWeightInfo { fn force_open_hrmp_channel(_: u32) -> Weight { Weight::from_parts(1, 0) } - fn establish_system_channel() -> Weight { Weight::from_parts(1, 0) } diff --git a/runtime/moonbeam/tests/xcm_mock/statemint_like.rs b/runtime/moonbeam/tests/xcm_mock/statemint_like.rs index 987a83ae4a..a3da2c2160 100644 --- a/runtime/moonbeam/tests/xcm_mock/statemint_like.rs +++ b/runtime/moonbeam/tests/xcm_mock/statemint_like.rs @@ -17,8 +17,8 @@ //! Relay chain runtime mock. use frame_support::{ - construct_runtime, match_types, parameter_types, - traits::{AsEnsureOriginWithArg, Everything, Nothing}, + construct_runtime, parameter_types, + traits::{AsEnsureOriginWithArg, Contains, Everything, Nothing}, weights::Weight, }; use frame_system::{EnsureRoot, EnsureSigned}; @@ -39,7 +39,7 @@ use xcm::VersionedXcm; use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex, - ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, + ConvertedConcreteId, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, FungibleAdapter, FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, @@ -60,6 +60,7 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -101,7 +102,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -156,18 +156,18 @@ impl pallet_assets::Config for Runtime { } parameter_types! { - pub const KsmLocation: MultiLocation = MultiLocation::parent(); + pub const KsmLocation: Location = Location::parent(); pub const RelayNetwork: NetworkId = NetworkId::Kusama; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); - pub Local: MultiLocation = Here.into(); + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())].into(); + pub Local: Location = Here.into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); pub KsmPerSecond: (xcm::latest::prelude::AssetId, u128, u128) = - (Concrete(KsmLocation::get()), 1, 1); + (AssetId(KsmLocation::get()), 1, 1); } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( @@ -180,12 +180,12 @@ pub type LocationToAccountId = ( ); /// Means for transacting the native currency on this chain. -pub type CurrencyTransactor = CurrencyAdapter< +pub type CurrencyTransactor = FungibleAdapter< // Use this currency: Balances, // Use this currency when it is a fungible asset matching the given location or name: IsConcrete, - // Convert an XCM MultiLocation into a local account id: + // Convert an XCM Location into a local account id: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -204,7 +204,7 @@ pub type FungiblesTransactor = FungiblesAdapter< AsPrefixedGeneralIndex, JustTry, >, - // Convert an XCM MultiLocation into a local account id: + // Convert an XCM Location into a local account id: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -247,17 +247,28 @@ parameter_types! { pub const MaxInstructions: u32 = 100; } -match_types! { - pub type ParentOrParentsExecutivePlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; +pub struct ParentOrParentsExecutivePlurality; +impl Contains for ParentOrParentsExecutivePlurality { + fn contains(location: &Location) -> bool { + matches!( + location.unpack(), + (1, []) + | ( + 1, + [Plurality { + id: BodyId::Executive, + .. + }] + ) + ) + } } -match_types! { - pub type ParentOrSiblings: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(_) } - }; + +pub struct ParentOrSiblings; +impl Contains for ParentOrSiblings { + fn contains(location: &Location) -> bool { + matches!(location.unpack(), (1, []) | (1, [_])) + } } pub type Barrier = ( @@ -272,7 +283,7 @@ pub type Barrier = ( ); parameter_types! { - pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub MatcherLocation: Location = Location::here(); pub const MaxAssetsIntoHolding: u32 = 64; } @@ -303,6 +314,8 @@ impl Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + + type TransactionalProcessor = (); } /// No local origins on this chain are allowed to dispatch XCM sends/executions. @@ -310,11 +323,6 @@ pub type LocalOriginToLocation = SignedToAccountId32; -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -339,8 +347,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; } impl cumulus_pallet_xcm::Config for Runtime { @@ -413,15 +419,25 @@ pub mod mock_msg_queue { let hash = Encode::using_encoded(&xcm, T::Hashing::hash); let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { - let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); + let location = Location::new(1, [Parachain(sender.into())]); let mut id = [0u8; 32]; id.copy_from_slice(hash.as_ref()); - match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { - Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), + match T::XcmExecutor::prepare_and_execute( + location, + xcm, + &mut id, + max_weight, + Weight::zero(), + ) { + Outcome::Error { error } => { + (Err(error.clone()), Event::Fail(Some(hash), error)) + } + Outcome::Complete { used } => (Ok(used), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), + Outcome::Incomplete { used, error } => { + (Ok(used), Event::Fail(Some(hash), error)) + } } } Err(()) => ( @@ -465,7 +481,7 @@ pub mod mock_msg_queue { limit: Weight, ) -> Weight { for (_i, (_sent_at, data)) in iter.enumerate() { - let id = sp_io::hashing::blake2_256(&data[..]); + let mut id = sp_io::hashing::blake2_256(&data[..]); let maybe_msg = VersionedXcm::::decode(&mut &data[..]) .map(Xcm::::try_from); match maybe_msg { @@ -476,7 +492,14 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); + let outcome = T::XcmExecutor::prepare_and_execute( + Parent, + x, + &mut id, + limit, + Weight::zero(), + ); + Self::deposit_event(Event::ExecutedDownward(id, outcome)); } } @@ -510,10 +533,10 @@ pub mod mock_statemint_prefix { #[pallet::storage] #[pallet::getter(fn current_prefix)] - pub(super) type CurrentPrefix = StorageValue<_, MultiLocation, ValueQuery>; + pub(super) type CurrentPrefix = StorageValue<_, Location, ValueQuery>; - impl Get for Pallet { - fn get() -> MultiLocation { + impl Get for Pallet { + fn get() -> Location { Self::current_prefix() } } @@ -522,11 +545,11 @@ pub mod mock_statemint_prefix { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { // Changed Prefix - PrefixChanged(MultiLocation), + PrefixChanged(Location), } impl Pallet { - pub fn set_prefix(prefix: MultiLocation) { + pub fn set_prefix(prefix: Location) { CurrentPrefix::::put(&prefix); Self::deposit_event(Event::PrefixChanged(prefix)); } diff --git a/runtime/moonbeam/tests/xcm_tests.rs b/runtime/moonbeam/tests/xcm_tests.rs index 5739252288..92a36fec77 100644 --- a/runtime/moonbeam/tests/xcm_tests.rs +++ b/runtime/moonbeam/tests/xcm_tests.rs @@ -29,9 +29,12 @@ use pallet_xcm_transactor::{ Currency, CurrencyPayment, HrmpInitParams, HrmpOperation, TransactWeights, }; use sp_core::ConstU32; -use xcm::latest::prelude::*; -use xcm::{VersionedMultiLocation, WrapVersion}; -use xcm_builder::HashedDescriptionDescribeFamilyAllTerminal; +use sp_runtime::traits::MaybeEquivalence; +use xcm::latest::prelude::{ + AccountId32, AccountKey20, GeneralIndex, Junction, Junctions, Limited, Location, OriginKind, + PalletInstance, Parachain, QueryResponse, Reanchorable, Response, WeightLimit, Xcm, +}; +use xcm::{VersionedLocation, WrapVersion}; use xcm_executor::traits::ConvertLocation; use xcm_mock::parachain; use xcm_mock::relay_chain; @@ -44,7 +47,7 @@ use xcm_simulator::TestExt; fn receive_relay_asset_from_relay() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -70,7 +73,7 @@ fn receive_relay_asset_from_relay() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -81,8 +84,8 @@ fn receive_relay_asset_from_relay() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -99,7 +102,7 @@ fn receive_relay_asset_from_relay() { fn send_relay_asset_to_relay() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -126,7 +129,7 @@ fn send_relay_asset_to_relay() { )); }); - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -137,8 +140,8 @@ fn send_relay_asset_to_relay() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -155,12 +158,13 @@ fn send_relay_asset_to_relay() { }); // We now send back some money to the relay - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: RELAYALICE.into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -168,7 +172,7 @@ fn send_relay_asset_to_relay() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 123, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -189,7 +193,7 @@ fn send_relay_asset_to_relay() { fn send_relay_asset_to_para_b() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -232,7 +236,7 @@ fn send_relay_asset_to_para_b() { )); }); - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -241,8 +245,8 @@ fn send_relay_asset_to_para_b() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -253,15 +257,16 @@ fn send_relay_asset_to_para_b() { }); // Now send relay asset from para A to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { @@ -269,7 +274,7 @@ fn send_relay_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -290,8 +295,10 @@ fn send_para_a_asset_to_para_b() { MockNet::reset(); // This represents the asset in paraA - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -318,15 +325,16 @@ fn send_para_a_asset_to_para_b() { }); // Send para A asset from para A to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; // Native token is substracted in paraA @@ -336,7 +344,7 @@ fn send_para_a_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -360,8 +368,10 @@ fn send_para_a_asset_from_para_b_to_para_c() { MockNet::reset(); // Represents para A asset - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -404,22 +414,23 @@ fn send_para_a_asset_from_para_b_to_para_c() { )); }); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { assert_ok!(XTokens::transfer( parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -438,15 +449,16 @@ fn send_para_a_asset_from_para_b_to_para_c() { }); // Send para A asset from para B to para C - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(3), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaB::execute_with(|| { @@ -454,7 +466,7 @@ fn send_para_a_asset_from_para_b_to_para_c() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -470,8 +482,10 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { MockNet::reset(); // para A asset - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -498,15 +512,16 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { }); // Send para A asset to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { @@ -514,7 +529,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -533,22 +548,23 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { }); // Send back para A asset to para A - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(1), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaB::execute_with(|| { assert_ok!(XTokens::transfer( parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -566,7 +582,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { fn receive_relay_asset_with_trader() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -594,7 +610,7 @@ fn receive_relay_asset_with_trader() { )); }); - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -609,8 +625,8 @@ fn receive_relay_asset_with_trader() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 100).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 100).into()), 0, )); }); @@ -627,8 +643,10 @@ fn receive_relay_asset_with_trader() { fn send_para_a_asset_to_para_b_with_trader() { MockNet::reset(); - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -653,15 +671,16 @@ fn send_para_a_asset_to_para_b_with_trader() { )); }); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; // In destination chain, we only need 4 weight @@ -671,7 +690,7 @@ fn send_para_a_asset_to_para_b_with_trader() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(10u64, DEFAULT_PROOF_SIZE)) )); }); @@ -701,8 +720,10 @@ fn send_para_a_asset_to_para_b_with_trader() { fn send_para_a_asset_to_para_b_with_trader_and_fee() { MockNet::reset(); - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -728,15 +749,16 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { )); }); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; // we use transfer_with_fee @@ -746,7 +768,7 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { parachain::CurrencyId::SelfReserve, 100, 1, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -769,7 +791,7 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { fn error_when_not_paying_enough() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -778,7 +800,7 @@ fn error_when_not_paying_enough() { decimals: 12, }; - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -809,8 +831,8 @@ fn error_when_not_paying_enough() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 5).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 5).into()), 0, )); }); @@ -825,7 +847,7 @@ fn error_when_not_paying_enough() { fn transact_through_derivative_multilocation() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -852,7 +874,7 @@ fn transact_through_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000000000.into(), @@ -861,14 +883,14 @@ fn transact_through_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); // Let's construct the call to know how much weight it is going to require - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -878,8 +900,8 @@ fn transact_through_derivative_multilocation() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000003100u128).into()), 0, )); }); @@ -901,12 +923,13 @@ fn transact_through_derivative_multilocation() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -915,7 +938,7 @@ fn transact_through_derivative_multilocation() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -956,8 +979,8 @@ fn transact_through_derivative_multilocation() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -983,7 +1006,7 @@ fn transact_through_derivative_multilocation() { fn transact_through_derivative_with_custom_fee_weight() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1010,7 +1033,7 @@ fn transact_through_derivative_with_custom_fee_weight() { // Let's construct the call to know how much weight it is going to require - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1020,8 +1043,8 @@ fn transact_through_derivative_with_custom_fee_weight() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000003100u128).into()), 0, )); }); @@ -1043,12 +1066,13 @@ fn transact_through_derivative_with_custom_fee_weight() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1057,7 +1081,7 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1099,8 +1123,8 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee weight mapping fee_amount: Some(overall_weight as u128) @@ -1137,7 +1161,7 @@ fn transact_through_derivative_with_custom_fee_weight() { fn transact_through_derivative_with_custom_fee_weight_refund() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1164,7 +1188,7 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { // Let's construct the call to know how much weight it is going to require - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1174,8 +1198,8 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000009100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000009100u128).into()), 0, )); }); @@ -1197,12 +1221,13 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1211,7 +1236,7 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1253,8 +1278,8 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee weight mapping fee_amount: Some(overall_weight as u128) @@ -1290,7 +1315,7 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { fn transact_through_sovereign() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1317,7 +1342,7 @@ fn transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000000000.into(), @@ -1326,12 +1351,12 @@ fn transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1340,8 +1365,8 @@ fn transact_through_sovereign() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000003100u128).into()), 0, )); }); @@ -1362,12 +1387,13 @@ fn transact_through_sovereign() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1376,7 +1402,7 @@ fn transact_through_sovereign() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1395,9 +1421,9 @@ fn transact_through_sovereign() { }); // We send the xcm transact operation to parent - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: Here, + interior: /* Here */ [].into(), }; // Encode the call. Balances transact to para_a_account @@ -1426,11 +1452,11 @@ fn transact_through_sovereign() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -1456,7 +1482,7 @@ fn transact_through_sovereign() { fn transact_through_sovereign_with_custom_fee_weight() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1481,7 +1507,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { )); }); - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1490,8 +1516,8 @@ fn transact_through_sovereign_with_custom_fee_weight() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000003100u128).into()), 0, )); }); @@ -1512,12 +1538,13 @@ fn transact_through_sovereign_with_custom_fee_weight() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1526,7 +1553,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1545,9 +1572,9 @@ fn transact_through_sovereign_with_custom_fee_weight() { }); // We send the xcm transact operation to parent - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: Here, + interior: /* Here */ [].into(), }; // Encode the call. Balances transact to para_a_account @@ -1577,11 +1604,11 @@ fn transact_through_sovereign_with_custom_fee_weight() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee-weight mapping fee_amount: Some(total_weight as u128) @@ -1608,7 +1635,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { fn transact_through_sovereign_with_custom_fee_weight_refund() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1633,7 +1660,7 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { )); }); - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1642,8 +1669,8 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000009100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000009100u128).into()), 0, )); }); @@ -1664,12 +1691,13 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1678,7 +1706,7 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1697,9 +1725,9 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { }); // We send the xcm transact operation to parent - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: Here, + interior: /* Here */ [].into(), }; // Encode the call. Balances transact to para_a_account @@ -1729,11 +1757,11 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee-weight mapping fee_amount: Some(total_weight as u128) @@ -1761,7 +1789,7 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { fn test_automatic_versioning_on_runtime_upgrade_with_relay() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1786,7 +1814,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { }); let response = Response::Version(2); - let querier: MultiLocation = Here.into(); + let querier: Location = ([]/* Here */).into(); // This is irrelevant, nothing will be done with this message, // but we need to pass a message as an argument to trigger the storage change @@ -1799,7 +1827,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { // The router is mocked, and we cannot use WrapVersion in ChildParachainRouter. So we will force // it directly here // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1824,8 +1852,8 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); @@ -1838,9 +1866,9 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { let expected_supported_version: relay_chain::RuntimeEvent = pallet_xcm::Event::SupportedVersionChanged { - location: MultiLocation { + location: Location { parents: 0, - interior: X1(Parachain(1)), + interior: [Parachain(1)].into(), }, version: 1, } @@ -1873,9 +1901,9 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { // This event should have been seen in the relay let expected_supported_version_2: relay_chain::RuntimeEvent = pallet_xcm::Event::SupportedVersionChanged { - location: MultiLocation { + location: Location { parents: 0, - interior: X1(Parachain(1)), + interior: [Parachain(1)].into(), }, version: 2, } @@ -1892,7 +1920,7 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { MockNet::reset(); let fresh_account = [2u8; 20]; - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -1917,7 +1945,7 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: fresh_account, } @@ -1926,8 +1954,8 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -1952,8 +1980,8 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -1970,7 +1998,7 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass MockNet::reset(); let fresh_account = [2u8; 20]; - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -1995,7 +2023,7 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: fresh_account, } @@ -2004,8 +2032,8 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -2031,7 +2059,7 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { assert_eq!(parachain::System::account(evm_account_id).sufficients, 1); }); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -2055,7 +2083,7 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: sufficient_account, } @@ -2064,8 +2092,8 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -2099,7 +2127,7 @@ fn empty_account_should_not_be_reset() { let evm_account_id = parachain::AccountId::from(sufficient_account); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -2133,7 +2161,7 @@ fn empty_account_should_not_be_reset() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: sufficient_account, } @@ -2142,8 +2170,8 @@ fn empty_account_should_not_be_reset() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -2197,7 +2225,7 @@ fn empty_account_should_not_be_reset() { fn test_statemint_like() { MockNet::reset(); - let dest_para = MultiLocation::new(1, X1(Parachain(1))); + let dest_para = Location::new(1, [Parachain(1)]); let sov = xcm_builder::SiblingParachainConvertsVia::< polkadot_parachain::primitives::Sibling, @@ -2205,15 +2233,18 @@ fn test_statemint_like() { >::convert_location(&dest_para) .unwrap(); - let statemint_asset_a_balances = MultiLocation::new( + let statemint_asset_a_balances = Location::new( 1, - X3( + [ Parachain(4), PalletInstance(5), xcm::latest::prelude::GeneralIndex(0u128), - ), + ], + ); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(&statemint_asset_a_balances) + .expect("convert to v3"), ); - let source_location = parachain::AssetType::Xcm(statemint_asset_a_balances); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -2266,7 +2297,7 @@ fn test_statemint_like() { )); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -2275,16 +2306,16 @@ fn test_statemint_like() { // Send with new prefix assert_ok!(StatemintChainPalletXcm::reserve_transfer_assets( statemint_like::RuntimeOrigin::signed(RELAYALICE), - Box::new(MultiLocation::new(1, X1(Parachain(1))).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new(Location::new(1, [Parachain(1)]).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), Box::new( ( - X2( + [ xcm::latest::prelude::PalletInstance( ::index() as u8 ), xcm::latest::prelude::GeneralIndex(0), - ), + ], 123 ) .into() @@ -2303,7 +2334,7 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { MockNet::reset(); // Relay asset - let relay_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let relay_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_relay_id: parachain::AssetId = relay_location.clone().into(); let relay_asset_metadata = parachain::AssetMetadata { @@ -2313,11 +2344,13 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { }; // Statemint asset - let statemint_asset = MultiLocation::new( + let statemint_asset = Location::new( 1, - X3(Parachain(4u32), PalletInstance(5u8), GeneralIndex(10u128)), + [Parachain(4u32), PalletInstance(5u8), GeneralIndex(10u128)], + ); + let statemint_location_asset = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(&statemint_asset).expect("convert to v3"), ); - let statemint_location_asset = parachain::AssetType::Xcm(statemint_asset); let source_statemint_asset_id: parachain::AssetId = statemint_location_asset.clone().into(); let asset_metadata_statemint_asset = parachain::AssetMetadata { @@ -2326,7 +2359,7 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { decimals: 12, }; - let dest_para = MultiLocation::new(1, X1(Parachain(1))); + let dest_para = Location::new(1, [Parachain(1)]); let sov = xcm_builder::SiblingParachainConvertsVia::< polkadot_parachain::primitives::Sibling, @@ -2364,7 +2397,7 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { )); }); - let parachain_beneficiary_from_relay: MultiLocation = Junction::AccountKey20 { + let parachain_beneficiary_from_relay: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -2376,11 +2409,11 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), Box::new( - VersionedMultiLocation::V3(parachain_beneficiary_from_relay) + VersionedLocation::V4(parachain_beneficiary_from_relay) .clone() .into() ), - Box::new((Here, 200).into()), + Box::new(([] /* Here */, 200).into()), 0, )); }); @@ -2414,7 +2447,7 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { )); // Send statemint USDC asset to Alice in Parachain A - let parachain_beneficiary_from_statemint: MultiLocation = AccountKey20 { + let parachain_beneficiary_from_statemint: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -2423,20 +2456,20 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { // Send with new prefix assert_ok!(StatemintChainPalletXcm::reserve_transfer_assets( statemint_like::RuntimeOrigin::signed(RELAYALICE), - Box::new(MultiLocation::new(1, X1(Parachain(1))).into()), + Box::new(Location::new(1, [Parachain(1)]).into()), Box::new( - VersionedMultiLocation::V3(parachain_beneficiary_from_statemint) + VersionedLocation::V4(parachain_beneficiary_from_statemint) .clone() .into() ), Box::new( ( - X2( + [ xcm::latest::prelude::PalletInstance( ::index() as u8 ), GeneralIndex(10), - ), + ], 125 ) .into() @@ -2445,15 +2478,16 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { )); }); - let statemint_beneficiary = MultiLocation { + let statemint_beneficiary = Location { parents: 1, - interior: X2( + interior: [ Parachain(4), AccountId32 { network: None, id: RELAYBOB.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { @@ -2484,7 +2518,7 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { (parachain::CurrencyId::ForeignAsset(source_relay_id), 100) ], 1, - Box::new(VersionedMultiLocation::V3(statemint_beneficiary)), + Box::new(VersionedLocation::V4(statemint_beneficiary)), WeightLimit::Limited(Weight::from_parts(80_000_000u64, 100_000u64)) )); }); @@ -2510,13 +2544,13 @@ fn send_statemint_asset_from_para_a_to_statemint_with_relay_fee() { #[test] fn transact_through_signed_multilocation() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000000000.into(), @@ -2526,17 +2560,18 @@ fn transact_through_signed_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -2545,7 +2580,7 @@ fn transact_through_signed_multilocation() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), ancestry.interior) + .reanchor(&Location::parent(), &ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2589,10 +2624,10 @@ fn transact_through_signed_multilocation() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -2616,17 +2651,18 @@ fn transact_through_signed_multilocation() { #[test] fn transact_through_signed_multilocation_custom_fee_and_weight() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); ParaA::execute_with(|| { ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -2635,7 +2671,7 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), ancestry.interior) + .reanchor(&Location::parent(), &ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2680,10 +2716,10 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_weight as u128) }, @@ -2707,17 +2743,18 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { #[test] fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); ParaA::execute_with(|| { ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -2726,7 +2763,7 @@ fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), ancestry.interior) + .reanchor(&Location::parent(), &ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2771,10 +2808,10 @@ fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_weight as u128) }, @@ -2800,18 +2837,18 @@ fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { #[test] fn transact_through_signed_multilocation_para_to_para() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -2821,33 +2858,32 @@ fn transact_through_signed_multilocation_para_to_para() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); - let mut descend_origin_multilocation = parachain::SelfLocation::get(); - descend_origin_multilocation - .append_with(signed_origin) - .unwrap(); + let mut descend_origin_location = parachain::SelfLocation::get(); + descend_origin_location.append_with(signed_origin).unwrap(); // To convert it to what the paraB will see instead of us - descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + descend_origin_location + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_location) + .unwrap(); ParaB::execute_with(|| { // free execution, full amount received @@ -2883,9 +2919,9 @@ fn transact_through_signed_multilocation_para_to_para() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -2911,42 +2947,41 @@ fn transact_through_signed_multilocation_para_to_para() { #[test] fn transact_through_signed_multilocation_para_to_para_refund() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); - let mut descend_origin_multilocation = parachain::SelfLocation::get(); - descend_origin_multilocation - .append_with(signed_origin) - .unwrap(); + let mut descend_origin_location = parachain::SelfLocation::get(); + descend_origin_location.append_with(signed_origin).unwrap(); // To convert it to what the paraB will see instead of us - descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + descend_origin_location + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_location) + .unwrap(); ParaB::execute_with(|| { // free execution, full amount received @@ -2983,9 +3018,9 @@ fn transact_through_signed_multilocation_para_to_para_refund() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: Some(overall_weight as u128) @@ -3012,18 +3047,18 @@ fn transact_through_signed_multilocation_para_to_para_refund() { #[test] fn transact_through_signed_multilocation_para_to_para_ethereum() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3033,33 +3068,32 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); - let mut descend_origin_multilocation = parachain::SelfLocation::get(); - descend_origin_multilocation - .append_with(signed_origin) - .unwrap(); + let mut descend_origin_location = parachain::SelfLocation::get(); + descend_origin_location.append_with(signed_origin).unwrap(); // To convert it to what the paraB will see instead of us - descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + descend_origin_location + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_location) + .unwrap(); let mut parachain_b_alice_balances_before = 0; ParaB::execute_with(|| { @@ -3110,9 +3144,9 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3140,18 +3174,18 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { #[test] fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3161,33 +3195,32 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); - let mut descend_origin_multilocation = parachain::SelfLocation::get(); - descend_origin_multilocation - .append_with(signed_origin) - .unwrap(); + let mut descend_origin_location = parachain::SelfLocation::get(); + descend_origin_location.append_with(signed_origin).unwrap(); // To convert it to what the paraB will see instead of us - descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + descend_origin_location + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_location) + .unwrap(); let mut parachain_b_alice_balances_before = 0; ParaB::execute_with(|| { @@ -3239,9 +3272,9 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3264,18 +3297,18 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() #[test] fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3285,33 +3318,32 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); - let mut descend_origin_multilocation = parachain::SelfLocation::get(); - descend_origin_multilocation - .append_with(signed_origin) - .unwrap(); + let mut descend_origin_location = parachain::SelfLocation::get(); + descend_origin_location.append_with(signed_origin).unwrap(); // To convert it to what the paraB will see instead of us - descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + descend_origin_location + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_location) + .unwrap(); let transfer_recipient = evm_account(); let mut transfer_recipient_balance_before = 0; @@ -3371,9 +3403,9 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3426,8 +3458,8 @@ fn hrmp_init_accept_through_root() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -3459,8 +3491,8 @@ fn hrmp_init_accept_through_root() { para_id: 1u32.into() }, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -3517,8 +3549,8 @@ fn hrmp_close_works() { recipient: 2u32.into() }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, diff --git a/runtime/moonriver/Cargo.toml b/runtime/moonriver/Cargo.toml index 526b9f182f..eeb0bbf980 100644 --- a/runtime/moonriver/Cargo.toml +++ b/runtime/moonriver/Cargo.toml @@ -1,5 +1,5 @@ [package] -authors = {workspace = true} +authors = { workspace = true } build = "build.rs" description = "Moonriver Runtime" edition = "2021" @@ -9,282 +9,287 @@ name = "moonriver-runtime" version = "0.8.4" [dependencies] -hex-literal = {workspace = true, optional = true} -log = {workspace = true} -num_enum = {workspace = true} -rlp = {workspace = true, optional = true} -serde = {workspace = true, features = ["derive"]} -sha3 = {workspace = true, optional = true} -smallvec = {workspace = true} -strum = {workspace = true} -strum_macros = {workspace = true} +hex-literal = { workspace = true, optional = true } +log = { workspace = true } +num_enum = { workspace = true } +rlp = { workspace = true, optional = true } +serde = { workspace = true, features = ["derive"] } +sha3 = { workspace = true, optional = true } +smallvec = { workspace = true } +strum = { workspace = true } +strum_macros = { workspace = true } # Moonbeam -account = {workspace = true} -moonbeam-core-primitives = {workspace = true} -moonbeam-relay-encoder = {workspace = true} -moonbeam-runtime-common = {workspace = true} -precompile-utils = {workspace = true} -session-keys-primitives = {workspace = true} -xcm-primitives = {workspace = true} +account = { workspace = true } +moonbeam-core-primitives = { workspace = true } +moonbeam-relay-encoder = { workspace = true } +moonbeam-runtime-common = { workspace = true } +precompile-utils = { workspace = true } +session-keys-primitives = { workspace = true } +xcm-primitives = { workspace = true } # Moonbeam pallets -moonbeam-xcm-benchmarks = {workspace = true} -pallet-asset-manager = {workspace = true} -pallet-author-mapping = {workspace = true} -pallet-crowdloan-rewards = {workspace = true} -pallet-erc20-xcm-bridge = {workspace = true} -pallet-ethereum-xcm = {workspace = true} -pallet-evm-chain-id = {workspace = true} -pallet-maintenance-mode = {workspace = true, features = ["xcm-support"]} -pallet-migrations = {workspace = true} -pallet-moonbeam-lazy-migrations = {workspace = true} -pallet-moonbeam-orbiters = {workspace = true} -pallet-parachain-staking = {workspace = true} -pallet-proxy-genesis-companion = {workspace = true} -pallet-randomness = {workspace = true} -pallet-xcm-transactor = {workspace = true} +moonbeam-xcm-benchmarks = { workspace = true } +pallet-asset-manager = { workspace = true } +pallet-author-mapping = { workspace = true } +pallet-crowdloan-rewards = { workspace = true } +pallet-erc20-xcm-bridge = { workspace = true } +pallet-ethereum-xcm = { workspace = true } +pallet-evm-chain-id = { workspace = true } +pallet-maintenance-mode = { workspace = true, features = ["xcm-support"] } +pallet-migrations = { workspace = true } +pallet-moonbeam-lazy-migrations = { workspace = true } +pallet-moonbeam-orbiters = { workspace = true } +pallet-parachain-staking = { workspace = true } +pallet-proxy-genesis-companion = { workspace = true } +pallet-randomness = { workspace = true } +pallet-xcm-transactor = { workspace = true } # Moonbeam precompiles -pallet-evm-precompile-author-mapping = {workspace = true} -pallet-evm-precompile-balances-erc20 = {workspace = true} -pallet-evm-precompile-batch = {workspace = true} -pallet-evm-precompile-call-permit = {workspace = true} -pallet-evm-precompile-collective = {workspace = true} -pallet-evm-precompile-conviction-voting = {workspace = true} -pallet-evm-precompile-crowdloan-rewards = {workspace = true} -pallet-evm-precompile-gmp = {workspace = true} -pallet-evm-precompile-identity = {workspace = true} -pallet-evm-precompile-parachain-staking = {workspace = true} -pallet-evm-precompile-preimage = {workspace = true} -pallet-evm-precompile-proxy = {workspace = true} -pallet-evm-precompile-randomness = {workspace = true} -pallet-evm-precompile-referenda = {workspace = true} -pallet-evm-precompile-registry = {workspace = true} -pallet-evm-precompile-relay-encoder = {workspace = true} -pallet-evm-precompile-xcm-transactor = {workspace = true} -pallet-evm-precompile-xcm-utils = {workspace = true} -pallet-evm-precompile-xtokens = {workspace = true} -pallet-evm-precompileset-assets-erc20 = {workspace = true} +pallet-evm-precompile-author-mapping = { workspace = true } +pallet-evm-precompile-balances-erc20 = { workspace = true } +pallet-evm-precompile-batch = { workspace = true } +pallet-evm-precompile-call-permit = { workspace = true } +pallet-evm-precompile-collective = { workspace = true } +pallet-evm-precompile-conviction-voting = { workspace = true } +pallet-evm-precompile-crowdloan-rewards = { workspace = true } +pallet-evm-precompile-gmp = { workspace = true } +pallet-evm-precompile-identity = { workspace = true } +pallet-evm-precompile-parachain-staking = { workspace = true } +pallet-evm-precompile-preimage = { workspace = true } +pallet-evm-precompile-proxy = { workspace = true } +pallet-evm-precompile-randomness = { workspace = true } +pallet-evm-precompile-referenda = { workspace = true } +pallet-evm-precompile-registry = { workspace = true } +pallet-evm-precompile-relay-encoder = { workspace = true } +pallet-evm-precompile-xcm-transactor = { workspace = true } +pallet-evm-precompile-xcm-utils = { workspace = true } +pallet-evm-precompile-xtokens = { workspace = true } +pallet-evm-precompileset-assets-erc20 = { workspace = true } # Moonbeam tracing -evm-tracing-events = {workspace = true, optional = true} -moonbeam-evm-tracer = {workspace = true, optional = true} -moonbeam-rpc-primitives-debug = {workspace = true} -moonbeam-rpc-primitives-txpool = {workspace = true} +evm-tracing-events = { workspace = true, optional = true } +moonbeam-evm-tracer = { workspace = true, optional = true } +moonbeam-rpc-primitives-debug = { workspace = true } +moonbeam-rpc-primitives-txpool = { workspace = true } # Substrate -frame-executive = {workspace = true} -frame-support = {workspace = true} -frame-system = {workspace = true} -frame-system-rpc-runtime-api = {workspace = true} -pallet-assets = {workspace = true} -pallet-balances = {workspace = true, features = ["insecure_zero_ed"]} -pallet-collective = {workspace = true} -pallet-conviction-voting = {workspace = true} -pallet-identity = {workspace = true} -pallet-multisig = {workspace = true} -pallet-preimage = {workspace = true} -pallet-proxy = {workspace = true} -pallet-referenda = {workspace = true} -pallet-root-testing = {workspace = true} -pallet-scheduler = {workspace = true} -pallet-society = {workspace = true} -pallet-timestamp = {workspace = true} -pallet-transaction-payment = {workspace = true} -pallet-transaction-payment-rpc-runtime-api = {workspace = true} -pallet-treasury = {workspace = true} -pallet-utility = {workspace = true} -pallet-whitelist = {workspace = true} -parity-scale-codec = {workspace = true, features = [ - "derive", - "max-encoded-len", - "chain-error", -]} -scale-info = {workspace = true, features = ["derive"]} -sp-api = {workspace = true} -sp-block-builder = {workspace = true} -sp-consensus-slots = {workspace = true} -sp-core = {workspace = true} -sp-debug-derive = {workspace = true} -sp-inherents = {workspace = true} -sp-io = {workspace = true, features = ["improved_panic_error_reporting"]} -sp-offchain = {workspace = true} -sp-runtime = {workspace = true} -sp-session = {workspace = true} -sp-std = {workspace = true} -sp-transaction-pool = {workspace = true} -sp-version = {workspace = true} -sp-weights = {workspace = true} +frame-executive = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +frame-system-rpc-runtime-api = { workspace = true } +pallet-assets = { workspace = true } +pallet-balances = { workspace = true, features = ["insecure_zero_ed"] } +pallet-collective = { workspace = true } +pallet-conviction-voting = { workspace = true } +pallet-identity = { workspace = true } +pallet-multisig = { workspace = true } +pallet-preimage = { workspace = true } +pallet-proxy = { workspace = true } +pallet-referenda = { workspace = true } +pallet-root-testing = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-society = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +pallet-treasury = { workspace = true } +pallet-utility = { workspace = true } +pallet-whitelist = { workspace = true } +parity-scale-codec = { workspace = true, features = [ + "derive", + "max-encoded-len", + "chain-error", +] } +scale-info = { workspace = true, features = ["derive"] } +sp-api = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-slots = { workspace = true } +sp-core = { workspace = true } +sp-debug-derive = { workspace = true } +sp-inherents = { workspace = true } +sp-io = { workspace = true, features = ["improved_panic_error_reporting"] } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } +sp-weights = { workspace = true } +sp-genesis-builder = { workspace = true } # Frontier -fp-evm = {workspace = true} -fp-rpc = {workspace = true} -fp-self-contained = {workspace = true, features = ["serde"]} -pallet-ethereum = {workspace = true, features = ["forbid-evm-reentrancy"]} -pallet-evm = {workspace = true, features = ["forbid-evm-reentrancy"]} -pallet-evm-precompile-blake2 = {workspace = true} -pallet-evm-precompile-bn128 = {workspace = true} -pallet-evm-precompile-dispatch = {workspace = true} -pallet-evm-precompile-modexp = {workspace = true} -pallet-evm-precompile-sha3fips = {workspace = true} -pallet-evm-precompile-simple = {workspace = true} +fp-evm = { workspace = true } +fp-rpc = { workspace = true } +fp-self-contained = { workspace = true, features = ["serde"] } +pallet-ethereum = { workspace = true, features = ["forbid-evm-reentrancy"] } +pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] } +pallet-evm-precompile-blake2 = { workspace = true } +pallet-evm-precompile-bn128 = { workspace = true } +pallet-evm-precompile-dispatch = { workspace = true } +pallet-evm-precompile-modexp = { workspace = true } +pallet-evm-precompile-sha3fips = { workspace = true } +pallet-evm-precompile-simple = { workspace = true } # Polkadot / XCM -orml-traits = {workspace = true} -orml-xcm-support = {workspace = true} -orml-xtokens = {workspace = true} -pallet-xcm = {workspace = true} -pallet-xcm-benchmarks = {workspace = true, optional = true} -polkadot-core-primitives = {workspace = true} -polkadot-parachain = {workspace = true} -polkadot-runtime-common = {workspace = true} -xcm = {workspace = true} -xcm-builder = {workspace = true} -xcm-executor = {workspace = true} +orml-traits = { workspace = true } +orml-xcm-support = { workspace = true } +orml-xtokens = { workspace = true } +pallet-xcm = { workspace = true } +pallet-xcm-benchmarks = { workspace = true, optional = true } +polkadot-core-primitives = { workspace = true } +polkadot-parachain = { workspace = true } +polkadot-runtime-common = { workspace = true } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } +pallet-message-queue = { workspace = true } # Cumulus -cumulus-pallet-dmp-queue = {workspace = true} -cumulus-pallet-parachain-system = {workspace = true} -cumulus-pallet-xcm = {workspace = true} -cumulus-pallet-xcmp-queue = {workspace = true} -cumulus-primitives-core = {workspace = true} -cumulus-primitives-timestamp = {workspace = true} -cumulus-primitives-utility = {workspace = true} -parachain-info = {workspace = true} +cumulus-pallet-dmp-queue = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } +cumulus-pallet-xcm = { workspace = true } +cumulus-pallet-xcmp-queue = { workspace = true } +cumulus-primitives-core = { workspace = true } +cumulus-primitives-timestamp = { workspace = true } +cumulus-primitives-utility = { workspace = true } +parachain-info = { workspace = true } +parachains-common = { workspace = true } # Moonkit -async-backing-primitives = {workspace = true} -moonkit-xcm-primitives = {workspace = true} -nimbus-primitives = {workspace = true} -pallet-author-inherent = {workspace = true} -pallet-author-slot-filter = {workspace = true} +async-backing-primitives = { workspace = true } +moonkit-xcm-primitives = { workspace = true } +nimbus-primitives = { workspace = true } +pallet-author-inherent = { workspace = true } +pallet-author-slot-filter = { workspace = true } # Benchmarking -frame-benchmarking = {workspace = true, optional = true} -frame-system-benchmarking = {workspace = true, optional = true} -frame-try-runtime = {workspace = true, optional = true} +frame-benchmarking = { workspace = true, optional = true } +frame-system-benchmarking = { workspace = true, optional = true } +frame-try-runtime = { workspace = true, optional = true } [dev-dependencies] -ethereum = {workspace = true} -frame-metadata = {workspace = true} -hex = {workspace = true, features = ["std"]} -sha3 = {workspace = true, features = ["std"]} +ethereum = { workspace = true } +frame-metadata = { workspace = true } +hex = { workspace = true, features = ["std"] } +sha3 = { workspace = true, features = ["std"] } -cumulus-primitives-parachain-inherent = {workspace = true} -cumulus-test-relay-sproof-builder = {workspace = true} +cumulus-primitives-parachain-inherent = { workspace = true } +cumulus-test-relay-sproof-builder = { workspace = true } -pallet-message-queue = {workspace = true} -polkadot-runtime-parachains = {workspace = true} -xcm-simulator = {workspace = true} +polkadot-runtime-parachains = { workspace = true } +xcm-simulator = { workspace = true } -precompile-utils = {workspace = true, features = ["std", "testing"]} +precompile-utils = { workspace = true, features = ["std", "testing"] } [build-dependencies] -substrate-wasm-builder = {workspace = true} +substrate-wasm-builder = { workspace = true } [features] default = ["std"] std = [ - "account/std", - "async-backing-primitives/std", - "cumulus-pallet-dmp-queue/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-core/std", - "cumulus-primitives-timestamp/std", - "evm-tracing-events/std", - "fp-evm/std", - "fp-rpc/std", - "fp-self-contained/std", - "frame-benchmarking/std", - "frame-executive/std", - "frame-support/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "moonbeam-core-primitives/std", - "moonbeam-evm-tracer/std", - "moonbeam-relay-encoder/std", - "moonbeam-rpc-primitives-debug/std", - "moonbeam-rpc-primitives-txpool/std", - "moonbeam-runtime-common/std", - "moonbeam-xcm-benchmarks/std", - "moonkit-xcm-primitives/std", - "nimbus-primitives/std", - "orml-xtokens/std", - "pallet-asset-manager/std", - "pallet-assets/std", - "pallet-author-inherent/std", - "pallet-author-mapping/std", - "pallet-author-slot-filter/std", - "pallet-balances/std", - "pallet-collective/std", - "pallet-conviction-voting/std", - "pallet-crowdloan-rewards/std", - "pallet-erc20-xcm-bridge/std", - "pallet-evm-chain-id/std", - "pallet-ethereum-xcm/std", - "pallet-ethereum/std", - "pallet-evm-precompile-author-mapping/std", - "pallet-evm-precompile-balances-erc20/std", - "pallet-evm-precompile-batch/std", - "pallet-evm-precompile-call-permit/std", - "pallet-evm-precompile-collective/std", - "pallet-evm-precompile-conviction-voting/std", - "pallet-evm-precompile-parachain-staking/std", - "pallet-evm-precompile-preimage/std", - "pallet-evm-precompile-randomness/std", - "pallet-evm-precompile-referenda/std", - "pallet-evm-precompile-xcm-transactor/std", - "pallet-evm-precompile-xcm-utils/std", - "pallet-evm-precompile-xtokens/std", - "pallet-evm/std", - "pallet-identity/std", - "pallet-maintenance-mode/std", - "pallet-migrations/std", - "pallet-moonbeam-lazy-migrations/std", - "pallet-moonbeam-orbiters/std", - "pallet-multisig/std", - "pallet-parachain-staking/std", - "pallet-preimage/std", - "pallet-proxy-genesis-companion/std", - "pallet-proxy/std", - "pallet-randomness/std", - "pallet-referenda/std", - "pallet-root-testing/std", - "pallet-scheduler/std", - "pallet-society/std", - "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - "pallet-treasury/std", - "pallet-utility/std", - "pallet-whitelist/std", - "pallet-xcm-transactor/std", - "pallet-xcm/std", - "parachain-info/std", - "parity-scale-codec/std", - "precompile-utils/std", - "scale-info/std", - "session-keys-primitives/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-slots/std", - "sp-core/std", - "sp-inherents/std", - "sp-io/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-std/std", - "sp-transaction-pool/std", - "sp-version/std", - "strum/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm-primitives/std", - "xcm/std", + "account/std", + "async-backing-primitives/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "evm-tracing-events/std", + "fp-evm/std", + "fp-rpc/std", + "fp-self-contained/std", + "frame-benchmarking/std", + "frame-executive/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "moonbeam-core-primitives/std", + "moonbeam-evm-tracer/std", + "moonbeam-relay-encoder/std", + "moonbeam-rpc-primitives-debug/std", + "moonbeam-rpc-primitives-txpool/std", + "moonbeam-runtime-common/std", + "moonbeam-xcm-benchmarks/std", + "moonkit-xcm-primitives/std", + "nimbus-primitives/std", + "orml-xtokens/std", + "pallet-asset-manager/std", + "pallet-assets/std", + "pallet-author-inherent/std", + "pallet-author-mapping/std", + "pallet-author-slot-filter/std", + "pallet-balances/std", + "pallet-collective/std", + "pallet-conviction-voting/std", + "pallet-crowdloan-rewards/std", + "pallet-erc20-xcm-bridge/std", + "pallet-evm-chain-id/std", + "pallet-ethereum-xcm/std", + "pallet-ethereum/std", + "pallet-evm-precompile-author-mapping/std", + "pallet-evm-precompile-balances-erc20/std", + "pallet-evm-precompile-batch/std", + "pallet-evm-precompile-call-permit/std", + "pallet-evm-precompile-collective/std", + "pallet-evm-precompile-conviction-voting/std", + "pallet-evm-precompile-parachain-staking/std", + "pallet-evm-precompile-preimage/std", + "pallet-evm-precompile-randomness/std", + "pallet-evm-precompile-referenda/std", + "pallet-evm-precompile-xcm-transactor/std", + "pallet-evm-precompile-xcm-utils/std", + "pallet-evm-precompile-xtokens/std", + "pallet-evm/std", + "pallet-identity/std", + "pallet-maintenance-mode/std", + "pallet-migrations/std", + "pallet-moonbeam-lazy-migrations/std", + "pallet-moonbeam-orbiters/std", + "pallet-multisig/std", + "pallet-parachain-staking/std", + "pallet-preimage/std", + "pallet-proxy-genesis-companion/std", + "pallet-proxy/std", + "pallet-randomness/std", + "pallet-referenda/std", + "pallet-root-testing/std", + "pallet-scheduler/std", + "pallet-society/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "pallet-utility/std", + "pallet-whitelist/std", + "pallet-xcm-transactor/std", + "pallet-xcm/std", + "parachain-info/std", + "parachains-common/std", + "parity-scale-codec/std", + "precompile-utils/std", + "scale-info/std", + "session-keys-primitives/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-slots/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "sp-genesis-builder/std", + "strum/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm-primitives/std", + "xcm/std", ] # Must be enabled for tracing runtimes only @@ -302,72 +307,103 @@ runtime-wasm = [] on-chain-release-build = ["sp-api/disable-logging"] runtime-benchmarks = [ - "cumulus-pallet-parachain-system/runtime-benchmarks", - "frame-benchmarking", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "hex-literal", - "moonbeam-relay-encoder/runtime-benchmarks", - "moonbeam-runtime-common/runtime-benchmarks", - "moonbeam-xcm-benchmarks/runtime-benchmarks", - "pallet-asset-manager/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", - "pallet-author-inherent/runtime-benchmarks", - "pallet-author-mapping/runtime-benchmarks", - "pallet-author-slot-filter/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-collective/runtime-benchmarks", - "pallet-conviction-voting/runtime-benchmarks", - "pallet-crowdloan-rewards/runtime-benchmarks", - "pallet-ethereum-xcm/runtime-benchmarks", - "pallet-ethereum/runtime-benchmarks", - "pallet-evm/runtime-benchmarks", - "pallet-identity/runtime-benchmarks", - "pallet-migrations/runtime-benchmarks", - "pallet-moonbeam-lazy-migrations/runtime-benchmarks", - "pallet-moonbeam-orbiters/runtime-benchmarks", - "pallet-multisig/runtime-benchmarks", - "pallet-parachain-staking/runtime-benchmarks", - "pallet-preimage/runtime-benchmarks", - "pallet-proxy/runtime-benchmarks", - "pallet-randomness/runtime-benchmarks", - "pallet-referenda/runtime-benchmarks", - "pallet-scheduler/runtime-benchmarks", - "pallet-society/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-treasury/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-whitelist/runtime-benchmarks", - "pallet-xcm-benchmarks", - "pallet-xcm-transactor/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "session-keys-primitives/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", + "cumulus-pallet-parachain-system/runtime-benchmarks", + "cumulus-primitives-core/runtime-benchmarks", + "frame-benchmarking", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "hex-literal", + "moonbeam-relay-encoder/runtime-benchmarks", + "moonbeam-runtime-common/runtime-benchmarks", + "moonbeam-xcm-benchmarks/runtime-benchmarks", + "parachains-common/runtime-benchmarks", + "pallet-asset-manager/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", + "pallet-author-inherent/runtime-benchmarks", + "pallet-author-mapping/runtime-benchmarks", + "pallet-author-slot-filter/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-conviction-voting/runtime-benchmarks", + "pallet-crowdloan-rewards/runtime-benchmarks", + "pallet-ethereum-xcm/runtime-benchmarks", + "pallet-ethereum/runtime-benchmarks", + "pallet-evm/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-migrations/runtime-benchmarks", + "pallet-moonbeam-lazy-migrations/runtime-benchmarks", + "pallet-moonbeam-orbiters/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", + "pallet-parachain-staking/runtime-benchmarks", + "pallet-preimage/runtime-benchmarks", + "pallet-proxy/runtime-benchmarks", + "pallet-randomness/runtime-benchmarks", + "pallet-referenda/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-society/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-whitelist/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", + "pallet-xcm-transactor/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "session-keys-primitives/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", ] try-runtime = [ - "fp-self-contained/try-runtime", - "frame-executive/try-runtime", - "frame-system/try-runtime", - "frame-try-runtime", - "moonbeam-runtime-common/try-runtime", - "pallet-asset-manager/try-runtime", - "pallet-author-mapping/try-runtime", - "pallet-author-slot-filter/try-runtime", - "pallet-balances/try-runtime", - "pallet-collective/try-runtime", - "pallet-conviction-voting/try-runtime", - "pallet-maintenance-mode/try-runtime", - "pallet-migrations/try-runtime", - "pallet-moonbeam-lazy-migrations/try-runtime", - "pallet-parachain-staking/try-runtime", - "pallet-preimage/try-runtime", - "pallet-referenda/try-runtime", - "pallet-root-testing/try-runtime", - "pallet-scheduler/try-runtime", - "pallet-society/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-whitelist/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "fp-self-contained/try-runtime", + "frame-executive/try-runtime", + "frame-system/try-runtime", + "frame-try-runtime", + "moonbeam-runtime-common/try-runtime", + "pallet-asset-manager/try-runtime", + "pallet-author-mapping/try-runtime", + "pallet-author-slot-filter/try-runtime", + "pallet-balances/try-runtime", + "pallet-collective/try-runtime", + "pallet-conviction-voting/try-runtime", + "pallet-maintenance-mode/try-runtime", + "pallet-migrations/try-runtime", + "pallet-moonbeam-lazy-migrations/try-runtime", + "pallet-parachain-staking/try-runtime", + "pallet-preimage/try-runtime", + "pallet-referenda/try-runtime", + "pallet-root-testing/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-society/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-whitelist/try-runtime", + "pallet-message-queue/try-runtime", + "pallet-xcm/try-runtime", + "pallet-message-queue/try-runtime", + "pallet-utility/try-runtime", + "pallet-transaction-payment/try-runtime", + "parachain-info/try-runtime", + "pallet-evm-chain-id/try-runtime", + "parachain-info/try-runtime", + "pallet-evm/try-runtime", + "pallet-ethereum/try-runtime", + "pallet-treasury/try-runtime", + "pallet-author-inherent/try-runtime", + "pallet-crowdloan-rewards/try-runtime", + "pallet-proxy/try-runtime", + "pallet-identity/try-runtime", + "orml-xtokens/try-runtime", + "pallet-assets/try-runtime", + "pallet-xcm-transactor/try-runtime", + "pallet-proxy-genesis-companion/try-runtime", + "pallet-moonbeam-orbiters/try-runtime", + "pallet-ethereum-xcm/try-runtime", + "pallet-randomness/try-runtime", + "pallet-whitelist/try-runtime", + "pallet-erc20-xcm-bridge/try-runtime", + "pallet-multisig/try-runtime", ] diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 658dff94a9..76c68ff20f 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -30,10 +30,10 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use account::AccountId20; use cumulus_pallet_parachain_system::{RelayChainStateProof, RelaychainDataProvider}; -use cumulus_primitives_core::relay_chain; use fp_rpc::TransactionStatus; // Re-export required by get! macro. +use cumulus_primitives_core::{relay_chain, AggregateMessageOrigin}; #[cfg(feature = "std")] pub use fp_evm::GenesisAccount; pub use frame_support::traits::Get; @@ -48,8 +48,8 @@ use frame_support::{ tokens::imbalance::ResolveTo, tokens::{PayFromAccount, UnityAssetBalanceConversion}, ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, - EqualPrivilegeOnly, Imbalance, InstanceFilter, LinearStoragePrice, OffchainWorker, - OnFinalize, OnIdle, OnInitialize, OnRuntimeUpgrade, OnUnbalanced, + EqualPrivilegeOnly, Imbalance, InstanceFilter, LinearStoragePrice, OnFinalize, + OnUnbalanced, }, weights::{ constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND}, @@ -80,8 +80,6 @@ use scale_info::TypeInfo; use sp_api::impl_runtime_apis; use sp_consensus_slots::Slot; use sp_core::{OpaqueMetadata, H160, H256, U256}; -#[cfg(feature = "try-runtime")] -use sp_runtime::TryRuntimeError; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, serde::{Deserialize, Serialize}, @@ -97,7 +95,6 @@ use sp_runtime::{ }; use sp_std::{convert::TryFrom, prelude::*}; -use cumulus_primitives_core::{relay_chain::BlockNumber as RelayBlockNumber, DmpMessageHandler}; use smallvec::smallvec; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -149,7 +146,7 @@ pub mod currency { /// Maximum weight per block pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, u64::MAX) .saturating_div(2) - .set_proof_size(cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64); + .set_proof_size(relay_chain::MAX_POV_SIZE as u64); pub const MILLISECS_PER_BLOCK: u64 = 12000; pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); @@ -251,6 +248,8 @@ impl frame_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. type RuntimeOrigin = RuntimeOrigin; + /// The aggregated RuntimeTask type. + type RuntimeTask = RuntimeTask; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = ConstU32<256>; /// Maximum weight of each block. With a default weight system of 1byte == 1weight, 4mb is ok. @@ -302,7 +301,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = ConstU32<0>; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = ConstU32<1>; type WeightInfo = moonbeam_weights::pallet_balances::WeightInfo; } @@ -593,6 +591,15 @@ impl pallet_treasury::Config for Runtime { type BenchmarkHelper = BenchmarkHelper; } +parameter_types! { + pub const MaxSubAccounts: u32 = 100; + pub const MaxAdditionalFields: u32 = 100; + pub const MaxRegistrars: u32 = 20; + pub const PendingUsernameExpiration: u32 = 7 * DAYS; + pub const MaxSuffixLength: u32 = 7; + pub const MaxUsernameLength: u32 = 32; +} + type IdentityForceOrigin = EitherOfDiverse, governance::custom_origins::GeneralAdmin>; type IdentityRegistrarOrigin = @@ -603,18 +610,22 @@ impl pallet_identity::Config for Runtime { type Currency = Balances; // Add one item in storage and take 258 bytes type BasicDeposit = ConstU128<{ currency::deposit(1, 258) }>; - // Not add any item to the storage but takes 66 bytes - type FieldDeposit = ConstU128<{ currency::deposit(0, 66) }>; + // Does not add any item to the storage but takes 1 bytes + type ByteDeposit = ConstU128<{ currency::deposit(0, 1) }>; // Add one item in storage and take 53 bytes type SubAccountDeposit = ConstU128<{ currency::deposit(1, 53) }>; - type MaxSubAccounts = ConstU32<100>; - type MaxAdditionalFields = ConstU32<100>; - type IdentityInformation = pallet_identity::simple::IdentityInfo; - - type MaxRegistrars = ConstU32<20>; + type MaxSubAccounts = MaxSubAccounts; + type IdentityInformation = pallet_identity::legacy::IdentityInfo; + type MaxRegistrars = MaxRegistrars; type Slashed = Treasury; type ForceOrigin = IdentityForceOrigin; type RegistrarOrigin = IdentityRegistrarOrigin; + type OffchainSignature = Signature; + type SigningPublicKey = ::Signer; + type UsernameAuthorityOrigin = EnsureRoot; + type PendingUsernameExpiration = PendingUsernameExpiration; + type MaxSuffixLength = MaxSuffixLength; + type MaxUsernameLength = MaxUsernameLength; type WeightInfo = moonbeam_weights::pallet_identity::WeightInfo; } @@ -682,19 +693,21 @@ impl pallet_ethereum_xcm::Config for Runtime { parameter_types! { pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; } impl cumulus_pallet_parachain_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = ParachainInfo; - type DmpMessageHandler = MaintenanceMode; type ReservedDmpWeight = ReservedDmpWeight; type OutboundXcmpMessageSource = XcmpQueue; type XcmpMessageHandler = XcmpQueue; type ReservedXcmpWeight = ReservedXcmpWeight; type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; type ConsensusHook = cumulus_pallet_parachain_system::ExpectParentIncluded; + type DmpQueue = frame_support::traits::EnqueueWithOrigin; + type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight; } impl parachain_info::Config for Runtime {} @@ -1182,78 +1195,6 @@ impl moonkit_xcm_primitives::PauseXcmExecution for XcmExecutionManager { } } -pub struct NormalDmpHandler; -impl DmpMessageHandler for NormalDmpHandler { - // This implementation makes messages be queued - // Since the limit is 0, messages are queued for next iteration - fn handle_dmp_messages( - iter: impl Iterator)>, - limit: Weight, - ) -> Weight { - (if Migrations::should_pause_xcm() { - DmpQueue::handle_dmp_messages(iter, Weight::zero()) - } else { - DmpQueue::handle_dmp_messages(iter, limit) - }) + ::DbWeight::get().reads(1) - } -} - -pub struct MaintenanceDmpHandler; -impl DmpMessageHandler for MaintenanceDmpHandler { - // This implementation makes messages be queued - // Since the limit is 0, messages are queued for next iteration - fn handle_dmp_messages( - iter: impl Iterator)>, - _limit: Weight, - ) -> Weight { - DmpQueue::handle_dmp_messages(iter, Weight::zero()) - } -} - -/// The hooks we wantt to run in Maintenance Mode -pub struct MaintenanceHooks; - -impl OnInitialize for MaintenanceHooks { - fn on_initialize(n: BlockNumber) -> Weight { - AllPalletsWithSystem::on_initialize(n) - } -} - -// return 0 -// For some reason using empty tuple () isnt working -// There exist only two pallets that use onIdle and these are xcmp and dmp queues -// For some reason putting an empty tumple does not work (transaction never finishes) -// We use an empty onIdle, if on the future we want one of the pallets to execute it -// we need to provide it here -impl OnIdle for MaintenanceHooks { - fn on_idle(_n: BlockNumber, _max_weight: Weight) -> Weight { - Weight::zero() - } -} - -impl OnRuntimeUpgrade for MaintenanceHooks { - fn on_runtime_upgrade() -> Weight { - AllPalletsWithSystem::on_runtime_upgrade() - } - - #[cfg(feature = "try-runtime")] - fn try_on_runtime_upgrade(checks: bool) -> Result { - AllPalletsWithSystem::try_on_runtime_upgrade(checks) - } -} - -impl OnFinalize for MaintenanceHooks { - fn on_finalize(n: BlockNumber) { - AllPalletsWithSystem::on_finalize(n) - } -} - -impl OffchainWorker for MaintenanceHooks { - fn offchain_worker(n: BlockNumber) { - AllPalletsWithSystem::offchain_worker(n) - } -} - impl pallet_maintenance_mode::Config for Runtime { type RuntimeEvent = RuntimeEvent; type NormalCallFilter = NormalFilter; @@ -1261,12 +1202,6 @@ impl pallet_maintenance_mode::Config for Runtime { type MaintenanceOrigin = pallet_collective::EnsureProportionAtLeast; type XcmExecutionManager = XcmExecutionManager; - type NormalDmpHandler = NormalDmpHandler; - type MaintenanceDmpHandler = MaintenanceDmpHandler; - // We use AllPalletsWithSystem because we dont want to change the hooks in normal - // operation - type NormalExecutiveHooks = AllPalletsWithSystem; - type MaintenanceExecutiveHooks = MaintenanceHooks; } impl pallet_proxy_genesis_companion::Config for Runtime { @@ -1357,7 +1292,9 @@ impl pallet_randomness::Config for Runtime { type WeightInfo = moonbeam_weights::pallet_randomness::WeightInfo; } -impl pallet_root_testing::Config for Runtime {} +impl pallet_root_testing::Config for Runtime { + type RuntimeEvent = RuntimeEvent; +} parameter_types! { // One storage item; key size is 32 + 20; value is size 4+4+16+20 bytes = 44 bytes. @@ -1386,7 +1323,7 @@ construct_runtime! { // Previously 2: pallet_randomness_collective_flip Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, - RootTesting: pallet_root_testing::{Pallet, Call, Storage} = 5, + RootTesting: pallet_root_testing::{Pallet, Call, Storage, Event} = 5, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -1451,6 +1388,7 @@ construct_runtime! { // Previously 108: pallet_assets:: EthereumXcm: pallet_ethereum_xcm::{Pallet, Call, Storage, Origin} = 109, Erc20XcmBridge: pallet_erc20_xcm_bridge::{Pallet} = 110, + MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} = 111, // Randomness Randomness: pallet_randomness::{Pallet, Call, Storage, Event, Inherent} = 120, @@ -1481,7 +1419,7 @@ mod benches { [pallet_proxy, Proxy] [pallet_identity, Identity] [cumulus_pallet_xcmp_queue, XcmpQueue] - [pallet_xcm, PolkadotXcm] + [pallet_xcm, PalletXcmExtrinsiscsBenchmark::] [pallet_asset_manager, AssetManager] [pallet_xcm_transactor, XcmTransactor] [pallet_moonbeam_orbiters, MoonbeamOrbiters] @@ -1526,7 +1464,7 @@ pub type Executive = frame_executive::Executive< Block, frame_system::ChainContext, Runtime, - pallet_maintenance_mode::ExecutiveHooks, + AllPalletsWithSystem, >; // All of our runtimes share most of their Runtime API implementations. @@ -1734,8 +1672,8 @@ mod tests { Balance::from(1 * MOVR + 25800 * MICROMOVR) ); assert_eq!( - get!(pallet_identity, FieldDeposit, u128), - Balance::from(6600 * MICROMOVR) + get!(pallet_identity, ByteDeposit, u128), + Balance::from(100 * MICROMOVR) ); assert_eq!( get!(pallet_identity, SubAccountDeposit, u128), diff --git a/runtime/moonriver/src/precompiles.rs b/runtime/moonriver/src/precompiles.rs index 8b8282f5a8..73e58f5aae 100644 --- a/runtime/moonriver/src/precompiles.rs +++ b/runtime/moonriver/src/precompiles.rs @@ -223,7 +223,7 @@ type MoonriverPrecompilesAt = ( >, PrecompileAt< AddressU64<2072>, - IdentityPrecompile, + IdentityPrecompile, (CallableByContract, CallableByPrecompile), >, ); diff --git a/runtime/moonriver/src/xcm_config.rs b/runtime/moonriver/src/xcm_config.rs index 394737f06c..1cec5c258b 100644 --- a/runtime/moonriver/src/xcm_config.rs +++ b/runtime/moonriver/src/xcm_config.rs @@ -18,14 +18,14 @@ //! use super::{ - governance, AccountId, AssetId, AssetManager, Assets, Balance, Balances, DealWithFees, - Erc20XcmBridge, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, - RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, + governance, AccountId, AssetId, AssetManager, Balance, Balances, DealWithFees, Erc20XcmBridge, + MaintenanceMode, MessageQueue, ParachainInfo, ParachainSystem, Perbill, PolkadotXcm, Runtime, + RuntimeBlockWeights, RuntimeCall, RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, }; use frame_support::{ parameter_types, - traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess}, + traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess, TransformOrigin}, }; use moonbeam_runtime_common::weights as moonbeam_weights; use pallet_evm_precompileset_assets_erc20::AccountIdAssetIdConversion; @@ -40,25 +40,31 @@ use sp_core::{ConstU32, H160, H256}; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, - DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FungiblesAdapter, HashedDescription, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, DescribeAllTerminal, DescribeFamily, + EnsureXcmOrigin, FungibleAdapter as XcmCurrencyAdapter, FungiblesAdapter, HashedDescription, NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; -use xcm::latest::prelude::*; +use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; +use xcm::latest::prelude::{ + Asset, GlobalConsensus, InteriorLocation, Junction, Location, NetworkId, PalletInstance, + Parachain, +}; use xcm_executor::traits::{CallDispatcher, ConvertLocation, JustTry}; +use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; use orml_xcm_support::MultiNativeAsset; use xcm_primitives::{ - AbsoluteAndRelativeReserve, AccountIdToCurrencyId, AccountIdToMultiLocation, AsAssetType, + AbsoluteAndRelativeReserve, AccountIdToCurrencyId, AccountIdToLocation, AsAssetType, FirstAssetTrader, SignedToAccountId20, UtilityAvailableCalls, UtilityEncodeCall, XcmTransact, }; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; +use sp_core::Get; use sp_std::{ convert::{From, Into, TryFrom}, prelude::*, @@ -74,22 +80,22 @@ parameter_types! { // The relay chain Origin type pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); // The universal location within the global consensus system - pub UniversalLocation: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())); + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into())].into(); // Self Reserve location, defines the multilocation identifiying the self-reserve currency // This is used to match it also against our Balances pallet when we receive such - // a MultiLocation: (Self Balances pallet index) + // a Location: (Self Balances pallet index) // We use the RELATIVE multilocation - pub SelfReserve: MultiLocation = MultiLocation { + pub SelfReserve: Location = Location { parents:0, - interior: Junctions::X1( + interior: [ PalletInstance(::index() as u8) - ) + ].into() }; } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( @@ -97,7 +103,7 @@ pub type LocationToAccountId = ( ParentIsPreset, // Sibling parachain origins convert to AccountId via the `ParaId::into`. SiblingParachainConvertsVia, - // If we receive a MultiLocation of type AccountKey20, just generate a native account + // If we receive a Location of type AccountKey20, just generate a native account AccountKey20Aliases, // Generate remote accounts according to polkadot standards HashedDescription>, @@ -106,7 +112,7 @@ pub type LocationToAccountId = ( /// Wrapper type around `LocationToAccountId` to convert an `AccountId` to type `H160`. pub struct LocationToH160; impl ConvertLocation for LocationToH160 { - fn convert_location(location: &MultiLocation) -> Option { + fn convert_location(location: &Location) -> Option { >::convert_location(location) .map(Into::into) } @@ -116,7 +122,7 @@ impl ConvertLocation for LocationToH160 { // It will use pallet-assets, and the Id will be matched against AsAssetType pub type ForeignFungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: - Assets, + super::Assets, // Use this currency when it is a fungible asset matching the given location or name: ( ConvertedConcreteId< @@ -126,7 +132,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< JustTry, >, ), - // Do a simple punn to convert an AccountId20 MultiLocation into a native chain account ID: + // Do a simple punn to convert an AccountId20 Location into a native chain account ID: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -226,7 +232,7 @@ parameter_types! { /// We do not burn anything because we want to mimic exactly what /// the sovereign account has pub type XcmFeesToAccount = xcm_primitives::XcmFeesToAccount< - Assets, + super::Assets, ( ConvertedConcreteId< AssetId, @@ -305,14 +311,15 @@ impl xcm_executor::Config for XcmExecutorConfig { type UniversalAliases = Nothing; type SafeCallFilter = SafeCallFilter; type Aliasers = Nothing; + type TransactionalProcessor = xcm_builder::FrameTransactionalProcessor; } type XcmExecutor = pallet_erc20_xcm_bridge::XcmExecutorWrapper< - RuntimeCall, + XcmExecutorConfig, xcm_executor::XcmExecutor, >; -// Converts a Signed Local Origin into a MultiLocation +// Converts a Signed Local Origin into a Location pub type LocalOriginToLocation = SignedToAccountId20; /// The means for routing XCM messages which are not for local execution into the right message @@ -324,11 +331,6 @@ pub type XcmRouter = ( XcmpQueue, ); -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -353,8 +355,6 @@ impl pallet_xcm::Config for Runtime { type RemoteLockConsumerIdentifier = (); // TODO pallet-xcm weights type WeightInfo = moonbeam_weights::pallet_xcm::WeightInfo; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; type AdminOrigin = EnsureRoot; } @@ -365,10 +365,10 @@ impl cumulus_pallet_xcm::Config for Runtime { impl cumulus_pallet_xcmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = PolkadotXcm; - type ExecuteOverweightOrigin = EnsureRoot; + type XcmpQueue = TransformOrigin; + type MaxInboundSuspended = sp_core::ConstU32<1_000>; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = moonbeam_weights::cumulus_pallet_xcmp_queue::WeightInfo; @@ -377,36 +377,100 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { >; } +parameter_types! { + pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; +} + +// TODO: This pallet can be removed after the lazy migration is done and +// event `Completed` is emitted. +// https://github.com/paritytech/polkadot-sdk/pull/1246 impl cumulus_pallet_dmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; - type ExecuteOverweightOrigin = EnsureRoot; + type DmpSink = frame_support::traits::EnqueueWithOrigin; + type WeightInfo = cumulus_pallet_dmp_queue::weights::SubstrateWeight; +} + +parameter_types! { + /// The amount of weight (if any) which should be provided to the message queue for + /// servicing enqueued items. + /// + /// This may be legitimately `None` in the case that you will call + /// `ServiceQueues::service_queues` manually. + pub MessageQueueServiceWeight: Weight = + Perbill::from_percent(25) * RuntimeBlockWeights::get().max_block; + /// The maximum number of stale pages (i.e. of overweight messages) allowed before culling + /// can happen. Once there are more stale pages than this, then historical pages may be + /// dropped, even if they contain unprocessed overweight messages. + pub const MessageQueueMaxStale: u32 = 8; + /// The size of the page; this implies the maximum message size which can be sent. + /// + /// A good value depends on the expected message sizes, their weights, the weight that is + /// available for processing them and the maximal needed message size. The maximal message + /// size is slightly lower than this as defined by [`MaxMessageLenOf`]. + pub const MessageQueueHeapSize: u32 = 128 * 1048; +} + +impl pallet_message_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + #[cfg(feature = "runtime-benchmarks")] + type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor< + cumulus_primitives_core::AggregateMessageOrigin, + >; + #[cfg(not(feature = "runtime-benchmarks"))] + type MessageProcessor = + xcm_builder::ProcessXcmMessage; + type Size = u32; + type HeapSize = MessageQueueHeapSize; + type MaxStale = MessageQueueMaxStale; + type ServiceWeight = MessageQueueServiceWeight; + // The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin: + type QueueChangeHandler = NarrowOriginToSibling; + // NarrowOriginToSibling calls XcmpQueue's is_paused if Origin is sibling. Allows all other origins + type QueuePausedQuery = (MaintenanceMode, NarrowOriginToSibling); + type WeightInfo = pallet_message_queue::weights::SubstrateWeight; } // Our AssetType. For now we only handle Xcm Assets #[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)] pub enum AssetType { - Xcm(MultiLocation), + Xcm(xcm::v3::Location), } impl Default for AssetType { fn default() -> Self { - Self::Xcm(MultiLocation::here()) + Self::Xcm(xcm::v3::Location::here()) } } -impl From for AssetType { - fn from(location: MultiLocation) -> Self { +impl From for AssetType { + fn from(location: xcm::v3::Location) -> Self { Self::Xcm(location) } } -impl Into> for AssetType { - fn into(self) -> Option { + +// This can be removed once we fully adopt xcm::v4 everywhere +impl TryFrom for AssetType { + type Error = (); + fn try_from(location: Location) -> Result { + Ok(Self::Xcm(location.try_into()?)) + } +} + +impl Into> for AssetType { + fn into(self) -> Option { match self { Self::Xcm(location) => Some(location), } } } +impl Into> for AssetType { + fn into(self) -> Option { + match self { + Self::Xcm(location) => xcm_builder::V4V3LocationConverter::convert_back(&location), + } + } +} + // Implementation on how to retrieve the AssetId from an AssetType // We simply hash the AssetType and take the lowest 128 bits impl From for AssetId { @@ -454,14 +518,14 @@ impl AccountIdToCurrencyId for Runtime { } } -// How to convert from CurrencyId to MultiLocation -pub struct CurrencyIdtoMultiLocation(sp_std::marker::PhantomData); -impl sp_runtime::traits::Convert> - for CurrencyIdtoMultiLocation +// How to convert from CurrencyId to Location +pub struct CurrencyIdToLocation(sp_std::marker::PhantomData); +impl sp_runtime::traits::Convert> + for CurrencyIdToLocation where - AssetXConverter: MaybeEquivalence, + AssetXConverter: MaybeEquivalence, { - fn convert(currency: CurrencyId) -> Option { + fn convert(currency: CurrencyId) -> Option { match currency { // For now and until Xtokens is adapted to handle 0.9.16 version we use // the old anchoring here @@ -469,7 +533,7 @@ where // chain does not change // TODO! change this to NewAnchoringSelfReserve once xtokens is adapted for it CurrencyId::SelfReserve => { - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), @@ -494,19 +558,19 @@ parameter_types! { // This is how we are going to detect whether the asset is a Reserve asset // This however is the chain part only - pub SelfLocation: MultiLocation = MultiLocation::here(); + pub SelfLocation: Location = Location::here(); // We need this to be able to catch when someone is trying to execute a non- // cross-chain transfer in xtokens through the absolute path way - pub SelfLocationAbsolute: MultiLocation = MultiLocation { + pub SelfLocationAbsolute: Location = Location { parents:1, - interior: Junctions::X1( + interior: [ Parachain(ParachainInfo::parachain_id().into()) - ) + ].into() }; } parameter_type_with_key! { - pub ParachainMinFee: |location: MultiLocation| -> Option { + pub ParachainMinFee: |location: Location| -> Option { match (location.parents, location.first_interior()) { // Kusama AssetHub fee (1, Some(Parachain(1000u32))) => Some(50_000_000u128), @@ -519,9 +583,8 @@ impl orml_xtokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type CurrencyIdConvert = - CurrencyIdtoMultiLocation>; + type AccountIdToLocation = AccountIdToLocation; + type CurrencyIdConvert = CurrencyIdToLocation>; type XcmExecutor = XcmExecutor; type SelfLocation = SelfLocation; type Weigher = XcmWeigher; @@ -529,13 +592,13 @@ impl orml_xtokens::Config for Runtime { type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = AbsoluteAndRelativeReserve; } // 1 KSM should be enough parameter_types! { - pub MaxHrmpRelayFee: MultiAsset = (MultiLocation::parent(), 1_000_000_000_000u128).into(); + pub MaxHrmpRelayFee: Asset = (Location::parent(), 1_000_000_000_000u128).into(); } // For now we only allow to transact in the relay, although this might change in the future @@ -576,9 +639,9 @@ impl UtilityEncodeCall for Transactors { } impl XcmTransact for Transactors { - fn destination(self) -> MultiLocation { + fn destination(self) -> Location { match self { - Transactors::Relay => MultiLocation::parent(), + Transactors::Relay => Location::parent(), } } } @@ -593,9 +656,8 @@ impl pallet_xcm_transactor::Config for Runtime { type DerivativeAddressRegistrationOrigin = DerivativeAddressRegistrationOrigin; type SovereignAccountDispatcherOrigin = EnsureRoot; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type CurrencyIdToMultiLocation = - CurrencyIdtoMultiLocation>; + type AccountIdToLocation = AccountIdToLocation; + type CurrencyIdToLocation = CurrencyIdToLocation>; type XcmSender = XcmRouter; type SelfLocation = SelfLocation; type Weigher = XcmWeigher; @@ -612,11 +674,11 @@ parameter_types! { // This is the relative view of erc20 assets. // Identified by this prefix + AccountKey20(contractAddress) // We use the RELATIVE multilocation - pub Erc20XcmBridgePalletLocation: MultiLocation = MultiLocation { + pub Erc20XcmBridgePalletLocation: Location = Location { parents:0, - interior: Junctions::X1( + interior: [ PalletInstance(::index() as u8) - ) + ].into() }; // To be able to support almost all erc20 implementations, @@ -634,11 +696,12 @@ impl pallet_erc20_xcm_bridge::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] mod testing { use super::*; + use xcm_builder::V4V3LocationConverter; /// This From exists for benchmarking purposes. It has the potential side-effect of calling /// AssetManager::set_asset_type_asset_id() and should NOT be used in any production code. - impl From for CurrencyId { - fn from(location: MultiLocation) -> CurrencyId { + impl From for CurrencyId { + fn from(location: Location) -> CurrencyId { use xcm_primitives::AssetTypeGetter; // If it does not exist, for benchmarking purposes, we create the association @@ -647,7 +710,9 @@ mod testing { { asset_id } else { - let asset_type = AssetType::Xcm(location); + let asset_type = AssetType::Xcm( + V4V3LocationConverter::convert(&location).expect("convert to v3"), + ); let asset_id: AssetId = asset_type.clone().into(); AssetManager::set_asset_type_asset_id(asset_type, asset_id); asset_id diff --git a/runtime/moonriver/tests/common/mod.rs b/runtime/moonriver/tests/common/mod.rs index da3092da5e..626c2e9a3f 100644 --- a/runtime/moonriver/tests/common/mod.rs +++ b/runtime/moonriver/tests/common/mod.rs @@ -26,7 +26,7 @@ pub use moonriver_runtime::{ asset_config::AssetRegistrarMetadata, currency::{GIGAWEI, MOVR, SUPPLY_FACTOR, WEI}, xcm_config::AssetType, - AccountId, AssetId, AssetManager, Assets, AuthorInherent, Balance, Balances, CrowdloanRewards, + AccountId, AssetId, AssetManager, AuthorInherent, Balance, Balances, CrowdloanRewards, Ethereum, Executive, Header, InflationInfo, ParachainStaking, Range, Runtime, RuntimeCall, RuntimeEvent, System, TransactionConverter, TransactionPaymentAsGasPrice, UncheckedExtrinsic, HOURS, WEEKS, @@ -308,7 +308,7 @@ impl ExtBuilder { ) .unwrap(); for (account, balance) in xcm_asset_initialization.balances { - Assets::mint( + moonriver_runtime::Assets::mint( origin_of(AssetManager::account_id()), asset_id.into(), account, diff --git a/runtime/moonriver/tests/evm_tracing.rs b/runtime/moonriver/tests/evm_tracing.rs index 9acf4de3b8..86aaab3707 100644 --- a/runtime/moonriver/tests/evm_tracing.rs +++ b/runtime/moonriver/tests/evm_tracing.rs @@ -52,9 +52,17 @@ mod tests { ); let transaction = ethereum_transaction(VALID_ETH_TX); let eth_uxt = unchecked_eth_tx(VALID_ETH_TX); + let block = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 1, + parent_hash: Default::default(), + state_root: Default::default(), + }; assert!(Runtime::trace_transaction( vec![non_eth_uxt.clone(), eth_uxt, non_eth_uxt.clone()], - &transaction + &transaction, + &block ) .is_ok()); }); @@ -84,10 +92,17 @@ mod tests { let eth_uxt = unchecked_eth_tx(VALID_ETH_TX); let eth_tx = ethereum_transaction(VALID_ETH_TX); let eth_extrinsic_hash = eth_tx.hash(); - + let block = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 1, + parent_hash: Default::default(), + state_root: Default::default(), + }; assert!(Runtime::trace_block( vec![non_eth_uxt.clone(), eth_uxt.clone(), non_eth_uxt, eth_uxt], - vec![eth_extrinsic_hash, eth_extrinsic_hash] + vec![eth_extrinsic_hash, eth_extrinsic_hash], + &block ) .is_ok()); }); diff --git a/runtime/moonriver/tests/integration_test.rs b/runtime/moonriver/tests/integration_test.rs index 641153c72f..48d84eaae4 100644 --- a/runtime/moonriver/tests/integration_test.rs +++ b/runtime/moonriver/tests/integration_test.rs @@ -62,7 +62,7 @@ use sp_runtime::{ }; use std::str::from_utf8; use xcm::latest::prelude::*; -use xcm::{VersionedMultiAssets, VersionedMultiLocation}; +use xcm::{VersionedAssets, VersionedLocation}; use xcm_builder::{ParentIsPreset, SiblingParachainConvertsVia}; use xcm_executor::traits::ConvertLocation; @@ -1553,7 +1553,7 @@ fn root_can_change_default_xcm_vers() { (AccountId::from(BOB), 1_000 * MOVR), ]) .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1565,13 +1565,14 @@ fn root_can_change_default_xcm_vers() { }]) .build() .execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); - let dest = MultiLocation { + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: [1u8; 32], - }), + }] + .into(), }; let source_id: moonriver_runtime::AssetId = source_location.clone().into(); // Default XCM version is not set yet, so xtokens should fail because it does not @@ -1581,7 +1582,7 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V3(dest.clone())), + Box::new(xcm::VersionedLocation::V4(dest.clone())), WeightLimit::Limited(4000000000.into()) ), orml_xtokens::Error::::XcmExecutionFailed @@ -1598,7 +1599,7 @@ fn root_can_change_default_xcm_vers() { origin_of(AccountId::from(ALICE)), CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), WeightLimit::Limited(4000000000.into()) )); }) @@ -1607,7 +1608,7 @@ fn root_can_change_default_xcm_vers() { #[test] fn asset_can_be_registered() { ExtBuilder::default().build().execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); let source_id: moonriver_runtime::AssetId = source_location.clone().into(); let asset_metadata = AssetRegistrarMetadata { name: b"RelayToken".to_vec(), @@ -1630,7 +1631,7 @@ fn asset_can_be_registered() { fn xcm_asset_erc20_precompiles_supply_and_balance() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1647,7 +1648,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { .build() .execute_with(|| { // We have the assetId that corresponds to the relay chain registered - let relay_asset_id: AssetId = AssetType::Xcm(MultiLocation::parent()).into(); + let relay_asset_id: AssetId = AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1656,7 +1657,10 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { ); // Assert the asset has been created with the correct supply - assert_eq!(Assets::total_supply(relay_asset_id), 1_000 * MOVR); + assert_eq!( + moonriver_runtime::Assets::total_supply(relay_asset_id), + 1_000 * MOVR + ); // Access totalSupply through precompile. Important that the context is correct Precompiles::new() @@ -1688,7 +1692,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() { fn xcm_asset_erc20_precompiles_transfer() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1705,7 +1709,7 @@ fn xcm_asset_erc20_precompiles_transfer() { .build() .execute_with(|| { // We have the assetId that corresponds to the relay chain registered - let relay_asset_id: AssetId = AssetType::Xcm(MultiLocation::parent()).into(); + let relay_asset_id: AssetId = AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1752,7 +1756,7 @@ fn xcm_asset_erc20_precompiles_transfer() { fn xcm_asset_erc20_precompiles_approve() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1769,7 +1773,7 @@ fn xcm_asset_erc20_precompiles_approve() { .build() .execute_with(|| { // We have the assetId that corresponds to the relay chain registered - let relay_asset_id: AssetId = AssetType::Xcm(MultiLocation::parent()).into(); + let relay_asset_id: AssetId = AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1837,7 +1841,7 @@ fn xcm_asset_erc20_precompiles_approve() { fn xtokens_precompiles_transfer() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1858,7 +1862,7 @@ fn xtokens_precompiles_transfer() { // We have the assetId that corresponds to the relay chain registered let relay_asset_id: moonriver_runtime::AssetId = - AssetType::Xcm(MultiLocation::parent()).into(); + AssetType::Xcm(xcm::v3::Location::parent()).into(); // Its address is let asset_precompile_address = Runtime::asset_id_to_account( @@ -1867,12 +1871,12 @@ fn xtokens_precompiles_transfer() { ); // Alice has 1000 tokens. She should be able to send through precompile - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // We use the address of the asset as an identifier of the asset we want to transferS @@ -1897,7 +1901,7 @@ fn xtokens_precompiles_transfer() { fn xtokens_precompiles_transfer_multiasset() { ExtBuilder::default() .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1917,12 +1921,12 @@ fn xtokens_precompiles_transfer_multiasset() { let xtokens_precompile_address = H160::from_low_u64_be(2052); // Alice has 1000 tokens. She should be able to send through precompile - let destination = MultiLocation::new( + let destination = Location::new( 1, - Junctions::X1(Junction::AccountId32 { + [Junction::AccountId32 { network: None, id: [1u8; 32], - }), + }], ); // This time we transfer it through TransferMultiAsset @@ -1933,7 +1937,7 @@ fn xtokens_precompiles_transfer_multiasset() { xtokens_precompile_address, XtokensPCall::transfer_multiasset { // We want to transfer the relay token - asset: MultiLocation::parent(), + asset: Location::parent(), amount: 500_000_000_000_000u128.into(), destination, weight: 4_000_000, @@ -1959,24 +1963,25 @@ fn make_sure_polkadot_xcm_cannot_be_called() { )]) .build() .execute_with(|| { - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: [1u8; 32], - }), + }] + .into(), }; - let multiassets: MultiAssets = [MultiAsset { - id: Concrete(moonriver_runtime::xcm_config::SelfLocation::get()), + let assets: Assets = [Asset { + id: AssetId(moonriver_runtime::xcm_config::SelfLocation::get()), fun: Fungible(1000), }] .to_vec() .into(); assert_noop!( RuntimeCall::PolkadotXcm(pallet_xcm::Call::::reserve_transfer_assets { - dest: Box::new(VersionedMultiLocation::V3(dest.clone())), - beneficiary: Box::new(VersionedMultiLocation::V3(dest)), - assets: Box::new(VersionedMultiAssets::V3(multiassets)), + dest: Box::new(VersionedLocation::V4(dest.clone())), + beneficiary: Box::new(VersionedLocation::V4(dest)), + assets: Box::new(VersionedAssets::V4(assets)), fee_asset_item: 0, }) .dispatch(::RuntimeOrigin::signed( @@ -1995,7 +2000,7 @@ fn transactor_cannot_use_more_than_max_weight() { (AccountId::from(BOB), 1_000 * MOVR), ]) .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -2007,7 +2012,7 @@ fn transactor_cannot_use_more_than_max_weight() { }]) .build() .execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); let source_id: moonriver_runtime::AssetId = source_location.clone().into(); assert_ok!(XcmTransactor::register( root_origin(), @@ -2018,7 +2023,7 @@ fn transactor_cannot_use_more_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( root_origin(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000.into(), @@ -2028,7 +2033,7 @@ fn transactor_cannot_use_more_than_max_weight() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( root_origin(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), 1 )); @@ -2038,9 +2043,9 @@ fn transactor_cannot_use_more_than_max_weight() { moonriver_runtime::xcm_config::Transactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new( - xcm::VersionedMultiLocation::V3(MultiLocation::parent()) - )), + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() + ))), fee_amount: None }, vec![], @@ -2086,9 +2091,9 @@ fn transact_through_signed_precompile_works_v2() { .build() .execute_with(|| { // Destination - let dest = MultiLocation::parent(); + let dest = Location::parent(); - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -2126,9 +2131,9 @@ fn transact_through_signed_cannot_send_to_local_chain() { .build() .execute_with(|| { // Destination - let dest = MultiLocation::here(); + let dest = Location::here(); - let fee_payer_asset = MultiLocation::parent(); + let fee_payer_asset = Location::parent(); let bytes = vec![1u8, 2u8, 3u8]; @@ -2167,7 +2172,7 @@ fn call_xtokens_with_fee() { ]) .with_safe_xcm_version(2) .with_xcm_assets(vec![XcmAssetInitialization { - asset_type: AssetType::Xcm(MultiLocation::parent()), + asset_type: AssetType::Xcm(xcm::v3::Location::parent()), metadata: AssetRegistrarMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -2179,17 +2184,19 @@ fn call_xtokens_with_fee() { }]) .build() .execute_with(|| { - let source_location = AssetType::Xcm(MultiLocation::parent()); - let dest = MultiLocation { + let source_location = AssetType::Xcm(xcm::v3::Location::parent()); + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: [1u8; 32], - }), + }] + .into(), }; let source_id: moonriver_runtime::AssetId = source_location.clone().into(); - let before_balance = Assets::balance(source_id, &AccountId::from(ALICE)); + let before_balance = + moonriver_runtime::Assets::balance(source_id, &AccountId::from(ALICE)); // We are able to transfer with fee assert_ok!(XTokens::transfer_with_fee( @@ -2197,11 +2204,12 @@ fn call_xtokens_with_fee() { CurrencyId::ForeignAsset(source_id), 100_000_000_000_000, 100, - Box::new(xcm::VersionedMultiLocation::V3(dest.clone())), + Box::new(xcm::VersionedLocation::V4(dest.clone())), WeightLimit::Limited(4000000000.into()) ),); - let after_balance = Assets::balance(source_id, &AccountId::from(ALICE)); + let after_balance = + moonriver_runtime::Assets::balance(source_id, &AccountId::from(ALICE)); // At least these much (plus fees) should have been charged assert_eq!(before_balance - 100_000_000_000_000 - 100, after_balance); }); @@ -2212,7 +2220,7 @@ fn test_xcm_utils_ml_tp_account() { ExtBuilder::default().build().execute_with(|| { let xcm_utils_precompile_address = H160::from_low_u64_be(2060); let expected_address_parent: H160 = - ParentIsPreset::::convert_location(&MultiLocation::parent()) + ParentIsPreset::::convert_location(&Location::parent()) .unwrap() .into(); @@ -2221,14 +2229,14 @@ fn test_xcm_utils_ml_tp_account() { ALICE, xcm_utils_precompile_address, XcmUtilsPCall::multilocation_to_address { - multilocation: MultiLocation::parent(), + location: Location::parent(), }, ) .expect_cost(1000) .expect_no_logs() .execute_returns(Address(expected_address_parent)); - let parachain_2000_multilocation = MultiLocation::new(1, X1(Parachain(2000))); + let parachain_2000_multilocation = Location::new(1, [Parachain(2000)]); let expected_address_parachain: H160 = SiblingParachainConvertsVia::::convert_location( ¶chain_2000_multilocation, @@ -2241,27 +2249,28 @@ fn test_xcm_utils_ml_tp_account() { ALICE, xcm_utils_precompile_address, XcmUtilsPCall::multilocation_to_address { - multilocation: parachain_2000_multilocation, + location: parachain_2000_multilocation, }, ) .expect_cost(1000) .expect_no_logs() .execute_returns(Address(expected_address_parachain)); - let alice_in_parachain_2000_multilocation = MultiLocation::new( + let alice_in_parachain_2000_location = Location::new( 1, - X2( + [ Parachain(2000), AccountKey20 { network: None, key: ALICE, }, - ), + ], ); - let expected_address_alice_in_parachain_2000: H160 = - xcm_builder::HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &alice_in_parachain_2000_multilocation, - ) + let expected_address_alice_in_parachain_2000 = + xcm_builder::HashedDescription::< + AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&alice_in_parachain_2000_location) .unwrap() .into(); @@ -2270,7 +2279,7 @@ fn test_xcm_utils_ml_tp_account() { ALICE, xcm_utils_precompile_address, XcmUtilsPCall::multilocation_to_address { - multilocation: alice_in_parachain_2000_multilocation, + location: alice_in_parachain_2000_location, }, ) .expect_cost(1000) @@ -2286,7 +2295,7 @@ fn test_xcm_utils_weight_message() { let expected_weight = XcmWeight::::clear_origin().ref_time(); - let message: Vec = xcm::VersionedXcm::<()>::V3(Xcm(vec![ClearOrigin])).encode(); + let message: Vec = xcm::VersionedXcm::<()>::V4(Xcm(vec![ClearOrigin])).encode(); let input = XcmUtilsPCall::weight_message { message: message.into(), @@ -2304,9 +2313,9 @@ fn test_xcm_utils_weight_message() { fn test_xcm_utils_get_units_per_second() { ExtBuilder::default().build().execute_with(|| { let xcm_utils_precompile_address = H160::from_low_u64_be(2060); - let multilocation = SelfReserve::get(); + let location = SelfReserve::get(); - let input = XcmUtilsPCall::get_units_per_second { multilocation }; + let input = XcmUtilsPCall::get_units_per_second { location }; let expected_units = WEIGHT_REF_TIME_PER_SECOND as u128 * moonriver_runtime::currency::WEIGHT_FEE; diff --git a/runtime/moonriver/tests/xcm_mock/parachain.rs b/runtime/moonriver/tests/xcm_mock/parachain.rs index f6f1843fc8..32666e5be7 100644 --- a/runtime/moonriver/tests/xcm_mock/parachain.rs +++ b/runtime/moonriver/tests/xcm_mock/parachain.rs @@ -45,12 +45,12 @@ use polkadot_parachain::primitives::{Id as ParaId, Sibling}; use xcm::latest::{ AssetId as XcmAssetId, Error as XcmError, ExecuteXcm, Junction::{PalletInstance, Parachain}, - Junctions, MultiLocation, NetworkId, Outcome, Xcm, + Location, NetworkId, Outcome, Xcm, }; use xcm_builder::{ AccountKey20Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter as XcmCurrencyAdapter, - EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, FungiblesAdapter, IsConcrete, + AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, EnsureXcmOrigin, FixedRateOfFungible, + FixedWeightBounds, FungibleAdapter as XcmCurrencyAdapter, FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountKey20AsNative, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, @@ -59,6 +59,7 @@ use xcm_executor::{traits::JustTry, Config, XcmExecutor}; #[cfg(feature = "runtime-benchmarks")] use moonbeam_runtime_common::benchmarking::BenchmarkHelper as ArgumentsBenchmarkHelper; +pub use moonriver_runtime::xcm_config::AssetType; use scale_info::TypeInfo; use xcm_simulator::{ DmpMessageHandlerT as DmpMessageHandler, XcmpMessageFormat, @@ -77,6 +78,7 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -118,7 +120,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -171,7 +172,7 @@ impl pallet_assets::Config for Runtime { } } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( @@ -181,7 +182,10 @@ pub type LocationToAccountId = ( SiblingParachainConvertsVia, AccountKey20Aliases, // Generate remote accounts according to polkadot standards - xcm_builder::HashedDescriptionDescribeFamilyAllTerminal, + xcm_builder::HashedDescription< + AccountId, + xcm_builder::DescribeFamily, + >, ); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, @@ -224,7 +228,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< JustTry, >, ), - // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: + // Do a simple punn to convert an AccountId32 Location into a native chain account ID: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -240,7 +244,7 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< // Use this currency when it is a fungible asset matching any of the locations in // SelfReserveRepresentations IsConcrete, - // We can convert the MultiLocations with our converter above: + // We can convert the Locations with our converter above: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -294,7 +298,7 @@ parameter_types! { // We cannot skip the native trader for some specific tests, so we will have to work with // a native trader that charges same number of units as weight pub ParaTokensPerSecond: (XcmAssetId, u128, u128) = ( - Concrete(SelfReserve::get()), + AssetId(SelfReserve::get()), 1000000000000, 0, ); @@ -303,16 +307,13 @@ parameter_types! { parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); - - // This is used to match it against our Balances pallet when we receive such a MultiLocation - // (Parent, Self Para Id, Self Balances pallet index) - pub SelfReserve: MultiLocation = MultiLocation { + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())].into(); + pub SelfReserve: Location = Location { parents:0, - interior: Junctions::X1( + interior: [ PalletInstance(::index() as u8) - ) + ].into() }; pub const MaxAssetsIntoHolding: u32 = 64; } @@ -344,7 +345,6 @@ impl Config for XcmConfig { FixedRateOfFungible, xcm_primitives::FirstAssetTrader, ); - type ResponseHandler = PolkadotXcm; type SubscriptionService = PolkadotXcm; type AssetTrap = PolkadotXcm; @@ -359,6 +359,8 @@ impl Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + + type TransactionalProcessor = (); } impl cumulus_pallet_xcm::Config for Runtime { @@ -373,14 +375,14 @@ pub enum CurrencyId { ForeignAsset(AssetId), } -// How to convert from CurrencyId to MultiLocation -pub struct CurrencyIdtoMultiLocation(sp_std::marker::PhantomData); -impl sp_runtime::traits::Convert> - for CurrencyIdtoMultiLocation +// How to convert from CurrencyId to Location +pub struct CurrencyIdToLocation(sp_std::marker::PhantomData); +impl sp_runtime::traits::Convert> + for CurrencyIdToLocation where - AssetXConverter: MaybeEquivalence, + AssetXConverter: MaybeEquivalence, { - fn convert(currency: CurrencyId) -> Option { + fn convert(currency: CurrencyId) -> Option { match currency { CurrencyId::SelfReserve => { // For now and until Xtokens is adapted to handle 0.9.16 version we use @@ -388,7 +390,7 @@ where // This is not a problem in either cases, since the view of the destination // chain does not change // TODO! change this to NewAnchoringSelfReserve once xtokens is adapted for it - let multi: MultiLocation = SelfReserve::get(); + let multi: Location = SelfReserve::get(); Some(multi) } CurrencyId::ForeignAsset(asset) => AssetXConverter::convert_back(&asset), @@ -399,17 +401,17 @@ where parameter_types! { pub const BaseXcmWeight: Weight = Weight::from_parts(100u64, 100u64); pub const MaxAssetsForTransfer: usize = 2; - pub SelfLocation: MultiLocation = MultiLocation::here(); - pub SelfLocationAbsolute: MultiLocation = MultiLocation { + pub SelfLocation: Location = Location::here(); + pub SelfLocationAbsolute: Location = Location { parents:1, - interior: Junctions::X1( + interior: [ Parachain(MsgQueue::parachain_id().into()) - ) + ].into() }; } parameter_type_with_key! { - pub ParachainMinFee: |location: MultiLocation| -> Option { + pub ParachainMinFee: |location: Location| -> Option { match (location.parents, location.first_interior()) { (1, Some(Parachain(4u32))) => Some(50u128), _ => None, @@ -422,9 +424,9 @@ impl orml_xtokens::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = xcm_primitives::AccountIdToMultiLocation; + type AccountIdToLocation = xcm_primitives::AccountIdToLocation; type CurrencyIdConvert = - CurrencyIdtoMultiLocation>; + CurrencyIdToLocation>; type XcmExecutor = XcmExecutor; type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; @@ -432,7 +434,7 @@ impl orml_xtokens::Config for Runtime { type UniversalLocation = UniversalLocation; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; + type LocationsFilter = Everything; type ReserveProvider = xcm_primitives::AbsoluteAndRelativeReserve; } @@ -537,15 +539,25 @@ pub mod mock_msg_queue { let hash = Encode::using_encoded(&xcm, T::Hashing::hash); let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { - let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); + let location = Location::new(1, [Parachain(sender.into())]); let mut id = [0u8; 32]; id.copy_from_slice(hash.as_ref()); - match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { - Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), + match T::XcmExecutor::prepare_and_execute( + location, + xcm, + &mut id, + max_weight, + Weight::zero(), + ) { + Outcome::Error { error } => { + (Err(error.clone()), Event::Fail(Some(hash), error)) + } + Outcome::Complete { used } => (Ok(used), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), + Outcome::Incomplete { used, error } => { + (Ok(used), Event::Fail(Some(hash), error)) + } } } Err(()) => ( @@ -589,7 +601,7 @@ pub mod mock_msg_queue { limit: Weight, ) -> Weight { for (_i, (_sent_at, data)) in iter.enumerate() { - let id = sp_io::hashing::blake2_256(&data[..]); + let mut id = sp_io::hashing::blake2_256(&data[..]); let maybe_msg = VersionedXcm::::decode(&mut &data[..]) .map(Xcm::::try_from); match maybe_msg { @@ -600,7 +612,13 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); + let outcome = T::XcmExecutor::prepare_and_execute( + Parent, + x, + &mut id, + limit, + Weight::zero(), + ); Self::deposit_event(Event::ExecutedDownward(id, outcome)); } @@ -667,12 +685,7 @@ pub type LocalOriginToLocation = xcm_primitives::SignedToAccountId20; parameter_types! { - pub MatcherLocation: MultiLocation = MultiLocation::here(); -} - -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); + pub MatcherLocation: Location = Location::here(); } impl pallet_xcm::Config for Runtime { @@ -701,48 +714,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; -} - -// Our AssetType. For now we only handle Xcm Assets -#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)] -pub enum AssetType { - Xcm(MultiLocation), -} -impl Default for AssetType { - fn default() -> Self { - Self::Xcm(MultiLocation::here()) - } -} - -impl From for AssetType { - fn from(location: MultiLocation) -> Self { - Self::Xcm(location) - } -} - -impl Into> for AssetType { - fn into(self) -> Option { - match self { - Self::Xcm(location) => Some(location), - } - } -} - -// Implementation on how to retrieve the AssetId from an AssetType -// We simply hash the AssetType and take the lowest 128 bits -impl From for AssetId { - fn from(asset: AssetType) -> AssetId { - match asset { - AssetType::Xcm(id) => { - let mut result: [u8; 16] = [0u8; 16]; - let hash: H256 = id.using_encoded(::Hashing::hash); - result.copy_from_slice(&hash.as_fixed_bytes()[0..16]); - u128::from_le_bytes(result) - } - } - } } // We instruct how to register the Assets @@ -776,14 +747,16 @@ impl pallet_asset_manager::AssetRegistrar for AssetRegistrar { fn destroy_foreign_asset(asset: AssetId) -> DispatchResult { // Mark the asset as destroying - Assets::start_destroy(RuntimeOrigin::root(), asset)?; + Assets::start_destroy(RuntimeOrigin::root(), asset.into())?; Ok(()) } fn destroy_asset_dispatch_info_weight(asset: AssetId) -> Weight { RuntimeCall::Assets( - pallet_assets::Call::::start_destroy { id: asset }, + pallet_assets::Call::::start_destroy { + id: asset.into(), + }, ) .get_dispatch_info() .weight @@ -826,7 +799,7 @@ impl pallet_asset_manager::Config for Runtime { // 1 KSM should be enough parameter_types! { - pub MaxHrmpRelayFee: MultiAsset = (MultiLocation::parent(), 1_000_000_000_000u128).into(); + pub MaxHrmpRelayFee: Asset = (Location::parent(), 1_000_000_000_000u128).into(); } impl pallet_xcm_transactor::Config for Runtime { @@ -836,9 +809,9 @@ impl pallet_xcm_transactor::Config for Runtime { type DerivativeAddressRegistrationOrigin = EnsureRoot; type SovereignAccountDispatcherOrigin = frame_system::EnsureRoot; type CurrencyId = CurrencyId; - type AccountIdToMultiLocation = xcm_primitives::AccountIdToMultiLocation; - type CurrencyIdToMultiLocation = - CurrencyIdtoMultiLocation>; + type AccountIdToLocation = xcm_primitives::AccountIdToLocation; + type CurrencyIdToLocation = + CurrencyIdToLocation>; type SelfLocation = SelfLocation; type Weigher = xcm_builder::FixedWeightBounds; type UniversalLocation = UniversalLocation; @@ -951,9 +924,9 @@ pub enum MockTransactors { } impl xcm_primitives::XcmTransact for MockTransactors { - fn destination(self) -> MultiLocation { + fn destination(self) -> Location { match self { - MockTransactors::Relay => MultiLocation::parent(), + MockTransactors::Relay => Location::parent(), } } } diff --git a/runtime/moonriver/tests/xcm_mock/relay_chain.rs b/runtime/moonriver/tests/xcm_mock/relay_chain.rs index 8eeaad46cd..40bff5e1ae 100644 --- a/runtime/moonriver/tests/xcm_mock/relay_chain.rs +++ b/runtime/moonriver/tests/xcm_mock/relay_chain.rs @@ -40,9 +40,10 @@ use xcm::latest::prelude::*; use xcm_builder::{ Account32Hash, AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, - ChildSystemParachainAsSuperuser, CurrencyAdapter as XcmCurrencyAdapter, FixedRateOfFungible, - FixedWeightBounds, IsConcrete, ProcessXcmMessage, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, + ChildSystemParachainAsSuperuser, FixedRateOfFungible, FixedWeightBounds, + FungibleAdapter as XcmCurrencyAdapter, IsConcrete, ProcessXcmMessage, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + WithComputedOrigin, }; use xcm_executor::{Config, XcmExecutor}; pub type AccountId = AccountId32; @@ -56,6 +57,7 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -97,7 +99,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -109,17 +110,19 @@ impl pallet_utility::Config for Runtime { type PalletsOrigin = OriginCaller; } -impl shared::Config for Runtime {} +impl shared::Config for Runtime { + type DisabledValidators = (); +} impl configuration::Config for Runtime { type WeightInfo = configuration::TestWeightInfo; } parameter_types! { - pub KsmLocation: MultiLocation = Here.into(); + pub KsmLocation: Location = Here.into(); pub const KusamaNetwork: NetworkId = NetworkId::Kusama; pub const AnyNetwork: Option = None; - pub UniversalLocation: InteriorMultiLocation = Here; + pub UniversalLocation: InteriorLocation = Here; } pub type SovereignAccountOf = ( @@ -142,10 +145,10 @@ type LocalOriginConverter = ( parameter_types! { pub const BaseXcmWeight: Weight = Weight::from_parts(1000u64, 1000u64); - pub KsmPerSecond: (AssetId, u128, u128) = (Concrete(KsmLocation::get()), 1, 1); + pub KsmPerSecond: (AssetId, u128, u128) = (AssetId(KsmLocation::get()), 1, 1); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; - pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub MatcherLocation: Location = Location::here(); } pub type XcmRouter = super::RelayChainXcmRouter; @@ -168,9 +171,9 @@ pub type XcmBarrier = ( ); parameter_types! { - pub Kusama: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(KsmLocation::get()) }); - pub Statemine: MultiLocation = Parachain(4).into(); - pub KusamaForStatemine: (MultiAssetFilter, MultiLocation) = (Kusama::get(), Statemine::get()); + pub Kusama: AssetFilter = Wild(AllOf { fun: WildFungible, id: AssetId(KsmLocation::get()) }); + pub Statemine: Location = Parachain(4).into(); + pub KusamaForStatemine: (AssetFilter, Location) = (Kusama::get(), Statemine::get()); } pub type TrustedTeleporters = xcm_builder::Case; @@ -201,15 +204,11 @@ impl Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + type TransactionalProcessor = (); } pub type LocalOriginToLocation = SignedToAccountId32; -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; @@ -235,8 +234,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; } parameter_types! { @@ -272,6 +269,7 @@ impl paras::Config for Runtime { type NextSessionRotation = TestNextSessionRotation; type QueueFootprinter = (); type OnNewHead = (); + type AssignCoretime = (); } impl dmp::Config for Runtime {} @@ -404,7 +402,6 @@ impl hrmp::WeightInfo for TestHrmpWeightInfo { fn force_open_hrmp_channel(_: u32) -> Weight { Weight::from_parts(1, 0) } - fn establish_system_channel() -> Weight { Weight::from_parts(1, 0) } diff --git a/runtime/moonriver/tests/xcm_mock/statemine_like.rs b/runtime/moonriver/tests/xcm_mock/statemine_like.rs index 1046428fa6..b3d5e778c0 100644 --- a/runtime/moonriver/tests/xcm_mock/statemine_like.rs +++ b/runtime/moonriver/tests/xcm_mock/statemine_like.rs @@ -17,8 +17,8 @@ //! Relay chain runtime mock. use frame_support::{ - construct_runtime, match_types, parameter_types, - traits::{AsEnsureOriginWithArg, Everything, Nothing}, + construct_runtime, parameter_types, + traits::{AsEnsureOriginWithArg, Contains, Everything, Nothing}, weights::Weight, }; use frame_system::{EnsureRoot, EnsureSigned}; @@ -39,7 +39,7 @@ use xcm::VersionedXcm; use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex, - ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, + ConvertedConcreteId, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, FungibleAdapter, FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, @@ -60,6 +60,7 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; + type RuntimeTask = RuntimeTask; type Nonce = u64; type Block = Block; type Hash = H256; @@ -101,7 +102,6 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); type RuntimeFreezeReason = (); } @@ -156,18 +156,18 @@ impl pallet_assets::Config for Runtime { } parameter_types! { - pub const KsmLocation: MultiLocation = MultiLocation::parent(); + pub const KsmLocation: Location = Location::parent(); pub const RelayNetwork: NetworkId = NetworkId::Kusama; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = - X2(GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())); - pub Local: MultiLocation = Here.into(); + pub UniversalLocation: InteriorLocation = + [GlobalConsensus(RelayNetwork::get()), Parachain(MsgQueue::parachain_id().into())].into(); + pub Local: Location = Here.into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); pub KsmPerSecond: (xcm::latest::prelude::AssetId, u128, u128) = - (Concrete(KsmLocation::get()), 1, 1); + (AssetId(KsmLocation::get()), 1, 1); } -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( @@ -180,12 +180,12 @@ pub type LocationToAccountId = ( ); /// Means for transacting the native currency on this chain. -pub type CurrencyTransactor = CurrencyAdapter< +pub type CurrencyTransactor = FungibleAdapter< // Use this currency: Balances, // Use this currency when it is a fungible asset matching the given location or name: IsConcrete, - // Convert an XCM MultiLocation into a local account id: + // Convert an XCM Location into a local account id: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -204,7 +204,7 @@ pub type FungiblesTransactor = FungiblesAdapter< AsPrefixedGeneralIndex, JustTry, >, - // Convert an XCM MultiLocation into a local account id: + // Convert an XCM Location into a local account id: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): AccountId, @@ -235,7 +235,7 @@ pub type XcmOriginToTransactDispatchOrigin = ( // transaction from the Root origin. ParentAsSuperuser, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. + // `RuntimeOrigin::signed` origin of the same 32-byte value. SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. pallet_xcm::XcmPassthrough, @@ -247,17 +247,28 @@ parameter_types! { pub const MaxInstructions: u32 = 100; } -match_types! { - pub type ParentOrParentsExecutivePlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; +pub struct ParentOrParentsExecutivePlurality; +impl Contains for ParentOrParentsExecutivePlurality { + fn contains(location: &Location) -> bool { + matches!( + location.unpack(), + (1, []) + | ( + 1, + [Plurality { + id: BodyId::Executive, + .. + }] + ) + ) + } } -match_types! { - pub type ParentOrSiblings: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(_) } - }; + +pub struct ParentOrSiblings; +impl Contains for ParentOrSiblings { + fn contains(location: &Location) -> bool { + matches!(location.unpack(), (1, []) | (1, [_])) + } } pub type Barrier = ( @@ -272,7 +283,7 @@ pub type Barrier = ( ); parameter_types! { - pub MatcherLocation: MultiLocation = MultiLocation::here(); + pub MatcherLocation: Location = Location::here(); pub const MaxAssetsIntoHolding: u32 = 64; } @@ -303,6 +314,8 @@ impl Config for XcmConfig { type UniversalAliases = Nothing; type SafeCallFilter = Everything; type Aliasers = Nothing; + + type TransactionalProcessor = (); } /// No local origins on this chain are allowed to dispatch XCM sends/executions. @@ -310,11 +323,6 @@ pub type LocalOriginToLocation = SignedToAccountId32; -#[cfg(feature = "runtime-benchmarks")] -parameter_types! { - pub ReachableDest: Option = Some(Parent.into()); -} - impl pallet_xcm::Config for Runtime { type RuntimeEvent = RuntimeEvent; type SendXcmOrigin = EnsureXcmOrigin; @@ -339,8 +347,6 @@ impl pallet_xcm::Config for Runtime { type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); type AdminOrigin = frame_system::EnsureRoot; - #[cfg(feature = "runtime-benchmarks")] - type ReachableDest = ReachableDest; } impl cumulus_pallet_xcm::Config for Runtime { @@ -413,15 +419,25 @@ pub mod mock_msg_queue { let hash = Encode::using_encoded(&xcm, T::Hashing::hash); let (result, event) = match Xcm::::try_from(xcm) { Ok(xcm) => { - let location = MultiLocation::new(1, Junctions::X1(Parachain(sender.into()))); + let location = Location::new(1, [Parachain(sender.into())]); let mut id = [0u8; 32]; id.copy_from_slice(hash.as_ref()); - match T::XcmExecutor::execute_xcm(location, xcm, id, max_weight) { - Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)), - Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))), + match T::XcmExecutor::prepare_and_execute( + location, + xcm, + &mut id, + max_weight, + Weight::zero(), + ) { + Outcome::Error { error } => { + (Err(error.clone()), Event::Fail(Some(hash), error)) + } + Outcome::Complete { used } => (Ok(used), Event::Success(Some(hash))), // As far as the caller is concerned, this was dispatched without error, so // we just report the weight used. - Outcome::Incomplete(w, e) => (Ok(w), Event::Fail(Some(hash), e)), + Outcome::Incomplete { used, error } => { + (Ok(used), Event::Fail(Some(hash), error)) + } } } Err(()) => ( @@ -465,7 +481,7 @@ pub mod mock_msg_queue { limit: Weight, ) -> Weight { for (_i, (_sent_at, data)) in iter.enumerate() { - let id = sp_io::hashing::blake2_256(&data[..]); + let mut id = sp_io::hashing::blake2_256(&data[..]); let maybe_msg = VersionedXcm::::decode(&mut &data[..]) .map(Xcm::::try_from); match maybe_msg { @@ -476,7 +492,13 @@ pub mod mock_msg_queue { Self::deposit_event(Event::UnsupportedVersion(id)); } Ok(Ok(x)) => { - let outcome = T::XcmExecutor::execute_xcm(Parent, x, id, limit); + let outcome = T::XcmExecutor::prepare_and_execute( + Parent, + x, + &mut id, + limit, + Weight::zero(), + ); Self::deposit_event(Event::ExecutedDownward(id, outcome)); } @@ -511,10 +533,10 @@ pub mod mock_statemine_prefix { #[pallet::storage] #[pallet::getter(fn current_prefix)] - pub(super) type CurrentPrefix = StorageValue<_, MultiLocation, ValueQuery>; + pub(super) type CurrentPrefix = StorageValue<_, Location, ValueQuery>; - impl Get for Pallet { - fn get() -> MultiLocation { + impl Get for Pallet { + fn get() -> Location { Self::current_prefix() } } @@ -523,11 +545,11 @@ pub mod mock_statemine_prefix { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { // Changed Prefix - PrefixChanged(MultiLocation), + PrefixChanged(Location), } impl Pallet { - pub fn set_prefix(prefix: MultiLocation) { + pub fn set_prefix(prefix: Location) { CurrentPrefix::::put(&prefix); Self::deposit_event(Event::PrefixChanged(prefix)); } diff --git a/runtime/moonriver/tests/xcm_tests.rs b/runtime/moonriver/tests/xcm_tests.rs index 1868ecd47f..f2ec871857 100644 --- a/runtime/moonriver/tests/xcm_tests.rs +++ b/runtime/moonriver/tests/xcm_tests.rs @@ -24,9 +24,13 @@ use frame_support::{ BoundedVec, }; use sp_core::ConstU32; -use xcm::latest::prelude::*; -use xcm::{VersionedMultiLocation, WrapVersion}; -use xcm_builder::HashedDescriptionDescribeFamilyAllTerminal; +use sp_runtime::traits::MaybeEquivalence; +use xcm::latest::prelude::{ + AccountId32, AccountKey20, All, BuyExecution, ClearOrigin, DepositAsset, GeneralIndex, + Junction, Junctions, Limited, Location, OriginKind, PalletInstance, Parachain, QueryResponse, + Reanchorable, Response, WeightLimit, WithdrawAsset, Xcm, +}; +use xcm::{VersionedLocation, WrapVersion}; use xcm_executor::traits::ConvertLocation; use xcm_mock::parachain; use xcm_mock::relay_chain; @@ -44,7 +48,7 @@ use xcm_primitives::{UtilityEncodeCall, DEFAULT_PROOF_SIZE}; fn receive_relay_asset_from_relay() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -69,7 +73,7 @@ fn receive_relay_asset_from_relay() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -78,8 +82,8 @@ fn receive_relay_asset_from_relay() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -96,7 +100,7 @@ fn receive_relay_asset_from_relay() { fn send_relay_asset_to_relay() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -123,7 +127,7 @@ fn send_relay_asset_to_relay() { )); }); - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -134,8 +138,8 @@ fn send_relay_asset_to_relay() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -152,12 +156,13 @@ fn send_relay_asset_to_relay() { }); // We now send back some money to the relay - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: RELAYALICE.into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -165,7 +170,7 @@ fn send_relay_asset_to_relay() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 123, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -185,7 +190,7 @@ fn send_relay_asset_to_relay() { fn send_relay_asset_to_para_b() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -229,7 +234,7 @@ fn send_relay_asset_to_para_b() { }); // First send relay chain asset to Parachain A like in previous test - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -238,8 +243,8 @@ fn send_relay_asset_to_para_b() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -249,15 +254,16 @@ fn send_relay_asset_to_para_b() { }); // Now send relay asset from para A to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { @@ -265,7 +271,7 @@ fn send_relay_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -286,8 +292,10 @@ fn send_para_a_asset_to_para_b() { MockNet::reset(); // This represents the asset in paraA - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -314,15 +322,16 @@ fn send_para_a_asset_to_para_b() { }); // Send para A asset from para A to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { @@ -330,7 +339,7 @@ fn send_para_a_asset_to_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -356,8 +365,10 @@ fn send_para_a_asset_from_para_b_to_para_c() { MockNet::reset(); // Represents para A asset - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -401,22 +412,23 @@ fn send_para_a_asset_from_para_b_to_para_c() { }); // Send para A asset to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { assert_ok!(XTokens::transfer( parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -435,15 +447,16 @@ fn send_para_a_asset_from_para_b_to_para_c() { }); // Send para A asset from para B to para C - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(3), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaB::execute_with(|| { @@ -451,7 +464,7 @@ fn send_para_a_asset_from_para_b_to_para_c() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -468,8 +481,10 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { MockNet::reset(); // Para A asset - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -496,22 +511,23 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { }); // Send para A asset to para B - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { assert_ok!(XTokens::transfer( parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -530,22 +546,23 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { }); // Send back para A asset to para A - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(1), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaB::execute_with(|| { assert_ok!(XTokens::transfer( parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -564,8 +581,10 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a() { fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { MockNet::reset(); - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -590,22 +609,23 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { )); }); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { assert_ok!(XTokens::transfer( parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); }); @@ -626,14 +646,14 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { // This time we will force the new reanchoring by manually sending the // Message through polkadotXCM pallet - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(Parachain(1)), + interior: [Parachain(1)].into(), }; - let reanchored_para_a_balances = MultiLocation::new(0, X1(PalletInstance(1u8))); + let reanchored_para_a_balances = Location::new(0, [PalletInstance(1u8)]); - let message = xcm::VersionedXcm::<()>::V3(Xcm(vec![ + let message = xcm::VersionedXcm::<()>::V4(Xcm(vec![ WithdrawAsset((reanchored_para_a_balances.clone(), 100).into()), ClearOrigin, BuyExecution { @@ -642,12 +662,12 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { }, DepositAsset { assets: All.into(), - beneficiary: MultiLocation::new( + beneficiary: Location::new( 0, - X1(AccountKey20 { + [AccountKey20 { network: None, key: PARAALICE, - }), + }], ), }, ])); @@ -669,14 +689,14 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { // This time we will force the new reanchoring by manually sending the // Message through polkadotXCM pallet - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(Parachain(1)), + interior: [Parachain(1)].into(), }; - let reanchored_para_a_balances = MultiLocation::new(0, X1(PalletInstance(1u8))); + let reanchored_para_a_balances = Location::new(0, [PalletInstance(1u8)]); - let message = xcm::VersionedXcm::<()>::V3(Xcm(vec![ + let message = xcm::VersionedXcm::<()>::V4(Xcm(vec![ WithdrawAsset((reanchored_para_a_balances.clone(), 100).into()), ClearOrigin, BuyExecution { @@ -685,12 +705,12 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { }, DepositAsset { assets: All.into(), - beneficiary: MultiLocation::new( + beneficiary: Location::new( 0, - X1(AccountKey20 { + [AccountKey20 { network: None, key: PARAALICE, - }), + }], ), }, ])); @@ -717,7 +737,7 @@ fn send_para_a_asset_to_para_b_and_back_to_para_a_with_new_reanchoring() { fn receive_relay_asset_with_trader() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -745,7 +765,7 @@ fn receive_relay_asset_with_trader() { )); }); - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -760,8 +780,8 @@ fn receive_relay_asset_with_trader() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 100).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 100).into()), 0, )); }); @@ -778,8 +798,10 @@ fn receive_relay_asset_with_trader() { fn send_para_a_asset_to_para_b_with_trader() { MockNet::reset(); - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -804,15 +826,16 @@ fn send_para_a_asset_to_para_b_with_trader() { )); }); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; // In destination chain, we only need 4 weight @@ -822,7 +845,7 @@ fn send_para_a_asset_to_para_b_with_trader() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(10u64, DEFAULT_PROOF_SIZE)) )); }); @@ -852,8 +875,10 @@ fn send_para_a_asset_to_para_b_with_trader() { fn send_para_a_asset_to_para_b_with_trader_and_fee() { MockNet::reset(); - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -879,15 +904,16 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { )); }); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; // we use transfer_with_fee @@ -897,7 +923,7 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { parachain::CurrencyId::SelfReserve, 100, 1, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(800000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -920,7 +946,7 @@ fn send_para_a_asset_to_para_b_with_trader_and_fee() { fn error_when_not_paying_enough() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -929,7 +955,7 @@ fn error_when_not_paying_enough() { decimals: 12, }; - let dest: MultiLocation = Junction::AccountKey20 { + let dest: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -960,8 +986,8 @@ fn error_when_not_paying_enough() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 5).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 5).into()), 0, )); }); @@ -976,7 +1002,7 @@ fn error_when_not_paying_enough() { fn transact_through_derivative_multilocation() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1003,7 +1029,7 @@ fn transact_through_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000000000.into(), @@ -1012,14 +1038,14 @@ fn transact_through_derivative_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); // Let's construct the call to know how much weight it is going to require - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1029,8 +1055,8 @@ fn transact_through_derivative_multilocation() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000003100u128).into()), 0, )); }); @@ -1052,12 +1078,13 @@ fn transact_through_derivative_multilocation() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1066,7 +1093,7 @@ fn transact_through_derivative_multilocation() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1107,8 +1134,8 @@ fn transact_through_derivative_multilocation() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -1134,7 +1161,7 @@ fn transact_through_derivative_multilocation() { fn transact_through_derivative_with_custom_fee_weight() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1161,7 +1188,7 @@ fn transact_through_derivative_with_custom_fee_weight() { // Let's construct the call to know how much weight it is going to require - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1171,8 +1198,8 @@ fn transact_through_derivative_with_custom_fee_weight() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000003100u128).into()), 0, )); }); @@ -1194,12 +1221,13 @@ fn transact_through_derivative_with_custom_fee_weight() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1208,7 +1236,7 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1250,8 +1278,8 @@ fn transact_through_derivative_with_custom_fee_weight() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee weight mapping fee_amount: Some(overall_weight as u128) @@ -1288,7 +1316,7 @@ fn transact_through_derivative_with_custom_fee_weight() { fn transact_through_derivative_with_custom_fee_weight_refund() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1315,7 +1343,7 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { // Let's construct the call to know how much weight it is going to require - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1325,8 +1353,8 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000009100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000009100u128).into()), 0, )); }); @@ -1348,12 +1376,13 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1362,7 +1391,7 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1404,8 +1433,8 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { parachain::MockTransactors::Relay, 0, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee weight mapping fee_amount: Some(overall_weight as u128) @@ -1441,7 +1470,7 @@ fn transact_through_derivative_with_custom_fee_weight_refund() { fn transact_through_sovereign() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1468,7 +1497,7 @@ fn transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000000000.into(), @@ -1477,12 +1506,12 @@ fn transact_through_sovereign() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); }); - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1491,8 +1520,8 @@ fn transact_through_sovereign() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000003100u128).into()), 0, )); }); @@ -1513,12 +1542,13 @@ fn transact_through_sovereign() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1527,7 +1557,7 @@ fn transact_through_sovereign() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1546,9 +1576,9 @@ fn transact_through_sovereign() { }); // We send the xcm transact operation to parent - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: Here, + interior: /* Here */ [].into(), }; // Encode the call. Balances transact to para_a_account @@ -1577,11 +1607,11 @@ fn transact_through_sovereign() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -1607,7 +1637,7 @@ fn transact_through_sovereign() { fn transact_through_sovereign_with_custom_fee_weight() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1632,7 +1662,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { )); }); - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1641,8 +1671,8 @@ fn transact_through_sovereign_with_custom_fee_weight() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000003100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000003100u128).into()), 0, )); }); @@ -1663,12 +1693,13 @@ fn transact_through_sovereign_with_custom_fee_weight() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1677,7 +1708,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1696,9 +1727,9 @@ fn transact_through_sovereign_with_custom_fee_weight() { }); // We send the xcm transact operation to parent - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: Here, + interior: /* Here */ [].into(), }; // Encode the call. Balances transact to para_a_account @@ -1728,11 +1759,11 @@ fn transact_through_sovereign_with_custom_fee_weight() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee-weight mapping fee_amount: Some(total_weight as u128) @@ -1759,7 +1790,7 @@ fn transact_through_sovereign_with_custom_fee_weight() { fn transact_through_sovereign_with_custom_fee_weight_refund() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -1784,7 +1815,7 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { )); }); - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1793,8 +1824,8 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 4000009100u128).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 4000009100u128).into()), 0, )); }); @@ -1815,12 +1846,13 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { // Send to registered address let registered_address = derivative_account_id(para_a_account(), 0); - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X1(AccountId32 { + interior: [AccountId32 { network: None, id: registered_address.clone().into(), - }), + }] + .into(), }; ParaA::execute_with(|| { @@ -1829,7 +1861,7 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::ForeignAsset(source_id), 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(40000u64, DEFAULT_PROOF_SIZE)) )); }); @@ -1848,9 +1880,9 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { }); // We send the xcm transact operation to parent - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: Here, + interior: /* Here */ [].into(), }; // Encode the call. Balances transact to para_a_account @@ -1880,11 +1912,11 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_sovereign( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(dest)), + Box::new(xcm::VersionedLocation::V4(dest)), PARAALICE.into(), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), // 1-1 fee-weight mapping fee_amount: Some(total_weight as u128) @@ -1912,7 +1944,7 @@ fn transact_through_sovereign_with_custom_fee_weight_refund() { fn test_automatic_versioning_on_runtime_upgrade_with_relay() { MockNet::reset(); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -1937,7 +1969,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { }); let response = Response::Version(2); - let querier: MultiLocation = Here.into(); + let querier: Location = ([]/* Here */).into(); // This is irrelevant, nothing will be done with this message, // but we need to pass a message as an argument to trigger the storage change @@ -1950,7 +1982,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { // The router is mocked, and we cannot use WrapVersion in ChildParachainRouter. So we will force // it directly here // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -1975,8 +2007,8 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); @@ -1989,9 +2021,9 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { let expected_supported_version: relay_chain::RuntimeEvent = pallet_xcm::Event::SupportedVersionChanged { - location: MultiLocation { + location: Location { parents: 0, - interior: X1(Parachain(1)), + interior: [Parachain(1)].into(), }, version: 1, } @@ -2024,9 +2056,9 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { // This event should have been seen in the relay let expected_supported_version_2: relay_chain::RuntimeEvent = pallet_xcm::Event::SupportedVersionChanged { - location: MultiLocation { + location: Location { parents: 0, - interior: X1(Parachain(1)), + interior: [Parachain(1)].into(), }, version: 2, } @@ -2042,8 +2074,10 @@ fn test_automatic_versioning_on_runtime_upgrade_with_relay() { fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { MockNet::reset(); - let para_a_balances = MultiLocation::new(1, X2(Parachain(1), PalletInstance(1u8))); - let source_location = parachain::AssetType::Xcm(para_a_balances); + let para_a_balances = Location::new(1, [Parachain(1), PalletInstance(1u8)]); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(¶_a_balances).expect("convert to v3"), + ); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -2052,7 +2086,8 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { decimals: 18, }; let response = Response::Version(2); - let querier: MultiLocation = Here.into(); + let querier: Location = [] /* Here */ + .into(); // This is irrelevant, nothing will be done with this message, // but we need to pass a message as an argument to trigger the storage change @@ -2095,7 +2130,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { )); // Wrap version, which sets VersionedStorage assert_ok!(::wrap_version( - &MultiLocation::new(1, X1(Parachain(2))).into(), + &Location::new(1, [Parachain(2)]).into(), mock_message )); @@ -2107,9 +2142,9 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { let expected_supported_version: parachain::RuntimeEvent = pallet_xcm::Event::SupportedVersionChanged { - location: MultiLocation { + location: Location { parents: 1, - interior: X1(Parachain(2)), + interior: [Parachain(2)].into(), }, version: 0, } @@ -2121,15 +2156,16 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { }); // Let's ensure talking in v0 works - let dest = MultiLocation { + let dest = Location { parents: 1, - interior: X2( + interior: [ Parachain(2), AccountKey20 { network: None, key: PARAALICE.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { // free execution, full amount received @@ -2137,7 +2173,7 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { parachain::RuntimeOrigin::signed(PARAALICE.into()), parachain::CurrencyId::SelfReserve, 100, - Box::new(VersionedMultiLocation::V3(dest)), + Box::new(VersionedLocation::V4(dest)), WeightLimit::Limited(Weight::from_parts(80u64, DEFAULT_PROOF_SIZE)) )); // free execution, full amount received @@ -2174,9 +2210,9 @@ fn test_automatic_versioning_on_runtime_upgrade_with_para_b() { // This event should have been seen in para A let expected_supported_version_2: parachain::RuntimeEvent = pallet_xcm::Event::SupportedVersionChanged { - location: MultiLocation { + location: Location { parents: 1, - interior: X1(Parachain(2)), + interior: [Parachain(2)].into(), }, version: 2, } @@ -2194,7 +2230,7 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { MockNet::reset(); let fresh_account = [2u8; 20]; - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -2219,7 +2255,7 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: fresh_account, } @@ -2228,8 +2264,8 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -2254,8 +2290,8 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -2272,7 +2308,7 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass MockNet::reset(); let fresh_account = [2u8; 20]; - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -2297,7 +2333,7 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: fresh_account, } @@ -2306,8 +2342,8 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -2333,7 +2369,7 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { assert_eq!(parachain::System::account(evm_account_id).sufficients, 1); }); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), symbol: b"Relay".to_vec(), @@ -2357,7 +2393,7 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: sufficient_account, } @@ -2366,8 +2402,8 @@ fn evm_account_receiving_assets_should_handle_sufficients_ref_count() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -2401,7 +2437,7 @@ fn empty_account_should_not_be_reset() { let evm_account_id = parachain::AccountId::from(sufficient_account); - let source_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let source_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { name: b"RelayToken".to_vec(), @@ -2435,7 +2471,7 @@ fn empty_account_should_not_be_reset() { }); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: sufficient_account, } @@ -2444,8 +2480,8 @@ fn empty_account_should_not_be_reset() { assert_ok!(RelayChainPalletXcm::reserve_transfer_assets( relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), - Box::new(VersionedMultiLocation::V3(dest.clone()).clone().into()), - Box::new((Here, 123).into()), + Box::new(VersionedLocation::V4(dest.clone()).clone().into()), + Box::new(([] /* Here */, 123).into()), 0, )); }); @@ -2499,7 +2535,7 @@ fn empty_account_should_not_be_reset() { fn test_statemine_like() { MockNet::reset(); - let dest_para = MultiLocation::new(1, X1(Parachain(1))); + let dest_para = Location::new(1, [Parachain(1)]); let sov = xcm_builder::SiblingParachainConvertsVia::< polkadot_parachain::primitives::Sibling, @@ -2507,15 +2543,18 @@ fn test_statemine_like() { >::convert_location(&dest_para) .unwrap(); - let statemine_asset_a_balances = MultiLocation::new( + let statemine_asset_a_balances = Location::new( 1, - X3( + [ Parachain(4), PalletInstance(5), xcm::latest::prelude::GeneralIndex(0u128), - ), + ], + ); + let source_location = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(&statemine_asset_a_balances) + .expect("convert to v3"), ); - let source_location = parachain::AssetType::Xcm(statemine_asset_a_balances); let source_id: parachain::AssetId = source_location.clone().into(); let asset_metadata = parachain::AssetMetadata { @@ -2567,7 +2606,7 @@ fn test_statemine_like() { )); // Actually send relay asset to parachain - let dest: MultiLocation = AccountKey20 { + let dest: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -2576,16 +2615,16 @@ fn test_statemine_like() { // Send with new prefix assert_ok!(StatemineChainPalletXcm::reserve_transfer_assets( statemine_like::RuntimeOrigin::signed(RELAYALICE), - Box::new(MultiLocation::new(1, X1(Parachain(1))).into()), - Box::new(VersionedMultiLocation::V3(dest).clone().into()), + Box::new(Location::new(1, [Parachain(1)]).into()), + Box::new(VersionedLocation::V4(dest).clone().into()), Box::new( ( - X2( + [ xcm::latest::prelude::PalletInstance( ::index() as u8 ), xcm::latest::prelude::GeneralIndex(0), - ), + ], 123 ) .into() @@ -2604,7 +2643,7 @@ fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { MockNet::reset(); // Relay asset - let relay_location = parachain::AssetType::Xcm(MultiLocation::parent()); + let relay_location = parachain::AssetType::Xcm(xcm::v3::Location::parent()); let source_relay_id: parachain::AssetId = relay_location.clone().into(); let relay_asset_metadata = parachain::AssetMetadata { @@ -2614,11 +2653,13 @@ fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { }; // Statemine asset - let statemine_asset = MultiLocation::new( + let statemine_asset = Location::new( 1, - X3(Parachain(4u32), PalletInstance(5u8), GeneralIndex(10u128)), + [Parachain(4u32), PalletInstance(5u8), GeneralIndex(10u128)], + ); + let statemine_location_asset = parachain::AssetType::Xcm( + xcm_builder::V4V3LocationConverter::convert(&statemine_asset).expect("convert to v3"), ); - let statemine_location_asset = parachain::AssetType::Xcm(statemine_asset); let source_statemine_asset_id: parachain::AssetId = statemine_location_asset.clone().into(); let asset_metadata_statemine_asset = parachain::AssetMetadata { @@ -2627,7 +2668,7 @@ fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { decimals: 12, }; - let dest_para = MultiLocation::new(1, X1(Parachain(1))); + let dest_para = Location::new(1, [Parachain(1)]); let sov = xcm_builder::SiblingParachainConvertsVia::< polkadot_parachain::primitives::Sibling, @@ -2665,7 +2706,7 @@ fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { )); }); - let parachain_beneficiary_from_relay: MultiLocation = Junction::AccountKey20 { + let parachain_beneficiary_from_relay: Location = Junction::AccountKey20 { network: None, key: PARAALICE, } @@ -2677,11 +2718,11 @@ fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { relay_chain::RuntimeOrigin::signed(RELAYALICE), Box::new(Parachain(1).into()), Box::new( - VersionedMultiLocation::V3(parachain_beneficiary_from_relay) + VersionedLocation::V4(parachain_beneficiary_from_relay) .clone() .into() ), - Box::new((Here, 200).into()), + Box::new(([] /* Here */, 200).into()), 0, )); }); @@ -2715,7 +2756,7 @@ fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { )); // Send statemine USDC asset to Alice in Parachain A - let parachain_beneficiary_from_statemint: MultiLocation = AccountKey20 { + let parachain_beneficiary_from_statemint: Location = AccountKey20 { network: None, key: PARAALICE, } @@ -2724,20 +2765,20 @@ fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { // Send with new prefix assert_ok!(StatemineChainPalletXcm::reserve_transfer_assets( statemine_like::RuntimeOrigin::signed(RELAYALICE), - Box::new(MultiLocation::new(1, X1(Parachain(1))).into()), + Box::new(Location::new(1, [Parachain(1)]).into()), Box::new( - VersionedMultiLocation::V3(parachain_beneficiary_from_statemint) + VersionedLocation::V4(parachain_beneficiary_from_statemint) .clone() .into() ), Box::new( ( - X2( + [ xcm::latest::prelude::PalletInstance( ::index() as u8 ), GeneralIndex(10), - ), + ], 125 ) .into() @@ -2746,15 +2787,16 @@ fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { )); }); - let statemine_beneficiary = MultiLocation { + let statemine_beneficiary = Location { parents: 1, - interior: X2( + interior: [ Parachain(4), AccountId32 { network: None, id: RELAYBOB.into(), }, - ), + ] + .into(), }; ParaA::execute_with(|| { @@ -2785,7 +2827,7 @@ fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { (parachain::CurrencyId::ForeignAsset(source_relay_id), 100) ], 1, - Box::new(VersionedMultiLocation::V3(statemine_beneficiary)), + Box::new(VersionedLocation::V4(statemine_beneficiary)), WeightLimit::Limited(Weight::from_parts(80_000_000u64, 100_000u64)) )); }); @@ -2810,13 +2852,13 @@ fn send_statemint_asset_from_para_a_to_statemine_with_relay_fee() { #[test] fn transact_through_signed_multilocation() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), // Relay charges 1000 for every instruction, and we have 3, so 3000 3000.into(), 20000000000.into(), @@ -2826,17 +2868,18 @@ fn transact_through_signed_multilocation() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), WEIGHT_REF_TIME_PER_SECOND as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -2845,7 +2888,7 @@ fn transact_through_signed_multilocation() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), ancestry.interior) + .reanchor(&Location::parent(), &ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2889,10 +2932,10 @@ fn transact_through_signed_multilocation() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: None }, @@ -2917,17 +2960,18 @@ fn transact_through_signed_multilocation() { #[test] fn transact_through_signed_multilocation_custom_fee_and_weight() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); ParaA::execute_with(|| { ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -2936,7 +2980,7 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), ancestry.interior) + .reanchor(&Location::parent(), &ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -2981,10 +3025,10 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_weight as u128) }, @@ -3008,17 +3052,18 @@ fn transact_through_signed_multilocation_custom_fee_and_weight() { #[test] fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); ParaA::execute_with(|| { ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); let mut descend_origin_multilocation = parachain::SelfLocation::get(); descend_origin_multilocation @@ -3027,7 +3072,7 @@ fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { // To convert it to what the relay will see instead of us descend_origin_multilocation - .reanchor(&MultiLocation::parent(), ancestry.interior) + .reanchor(&Location::parent(), &ancestry.interior) .unwrap(); let derived = xcm_builder::Account32Hash::< @@ -3072,10 +3117,10 @@ fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(MultiLocation::parent())), + Box::new(xcm::VersionedLocation::V4(Location::parent())), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_weight as u128) }, @@ -3101,18 +3146,18 @@ fn transact_through_signed_multilocation_custom_fee_and_weight_refund() { #[test] fn transact_through_signed_multilocation_para_to_para() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3122,33 +3167,32 @@ fn transact_through_signed_multilocation_para_to_para() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); - let mut descend_origin_multilocation = parachain::SelfLocation::get(); - descend_origin_multilocation - .append_with(signed_origin) - .unwrap(); + let mut descend_origin_location = parachain::SelfLocation::get(); + descend_origin_location.append_with(signed_origin).unwrap(); // To convert it to what the paraB will see instead of us - descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + descend_origin_location + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_location) + .unwrap(); ParaB::execute_with(|| { // free execution, full amount received @@ -3184,9 +3228,9 @@ fn transact_through_signed_multilocation_para_to_para() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3212,42 +3256,41 @@ fn transact_through_signed_multilocation_para_to_para() { #[test] fn transact_through_signed_multilocation_para_to_para_refund() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); - let mut descend_origin_multilocation = parachain::SelfLocation::get(); - descend_origin_multilocation - .append_with(signed_origin) - .unwrap(); + let mut descend_origin_location = parachain::SelfLocation::get(); + descend_origin_location.append_with(signed_origin).unwrap(); // To convert it to what the paraB will see instead of us - descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + descend_origin_location + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_location) + .unwrap(); ParaB::execute_with(|| { // free execution, full amount received @@ -3284,9 +3327,9 @@ fn transact_through_signed_multilocation_para_to_para_refund() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: Some(overall_weight as u128) @@ -3313,18 +3356,18 @@ fn transact_through_signed_multilocation_para_to_para_refund() { #[test] fn transact_through_signed_multilocation_para_to_para_ethereum() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3334,33 +3377,32 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); - let mut descend_origin_multilocation = parachain::SelfLocation::get(); - descend_origin_multilocation - .append_with(signed_origin) - .unwrap(); + let mut descend_origin_location = parachain::SelfLocation::get(); + descend_origin_location.append_with(signed_origin).unwrap(); // To convert it to what the paraB will see instead of us - descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + descend_origin_location + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_location) + .unwrap(); let mut parachain_b_alice_balances_before = 0; ParaB::execute_with(|| { @@ -3411,9 +3453,9 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3441,18 +3483,18 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() { #[test] fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3462,33 +3504,32 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); - let mut descend_origin_multilocation = parachain::SelfLocation::get(); - descend_origin_multilocation - .append_with(signed_origin) - .unwrap(); + let mut descend_origin_location = parachain::SelfLocation::get(); + descend_origin_location.append_with(signed_origin).unwrap(); // To convert it to what the paraB will see instead of us - descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + descend_origin_location + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_location) + .unwrap(); let mut parachain_b_alice_balances_before = 0; ParaB::execute_with(|| { @@ -3540,9 +3581,9 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3565,18 +3606,18 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails() #[test] fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() { MockNet::reset(); - let mut ancestry = MultiLocation::parent(); + let mut ancestry = Location::parent(); - let para_b_location = MultiLocation::new(1, X1(Parachain(2))); + let para_b_location = Location::new(1, [Parachain(2)]); - let para_b_balances = MultiLocation::new(1, X2(Parachain(2), PalletInstance(1u8))); + let para_b_balances = Location::new(1, [Parachain(2), PalletInstance(1u8)]); ParaA::execute_with(|| { // Root can set transact info assert_ok!(XcmTransactor::set_transact_info( parachain::RuntimeOrigin::root(), // ParaB - Box::new(xcm::VersionedMultiLocation::V3(para_b_location.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_location.clone())), // Para charges 1000 for every instruction, and we have 3, so 3 3.into(), 20000000000.into(), @@ -3586,33 +3627,32 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() // Root can set transact info assert_ok!(XcmTransactor::set_fee_per_second( parachain::RuntimeOrigin::root(), - Box::new(xcm::VersionedMultiLocation::V3(para_b_balances.clone())), + Box::new(xcm::VersionedLocation::V4(para_b_balances.clone())), parachain::ParaTokensPerSecond::get().1 as u128, )); ancestry = parachain::UniversalLocation::get().into(); }); // Let's construct the Junction that we will append with DescendOrigin - let signed_origin: Junctions = X1(AccountKey20 { + let signed_origin: Junctions = [AccountKey20 { network: None, key: PARAALICE, - }); + }] + .into(); - let mut descend_origin_multilocation = parachain::SelfLocation::get(); - descend_origin_multilocation - .append_with(signed_origin) - .unwrap(); + let mut descend_origin_location = parachain::SelfLocation::get(); + descend_origin_location.append_with(signed_origin).unwrap(); // To convert it to what the paraB will see instead of us - descend_origin_multilocation - .reanchor(¶_b_location, ancestry.interior) + descend_origin_location + .reanchor(¶_b_location, &ancestry.interior) .unwrap(); - let derived = - HashedDescriptionDescribeFamilyAllTerminal::::convert_location( - &descend_origin_multilocation, - ) - .unwrap(); + let derived = xcm_builder::HashedDescription::< + parachain::AccountId, + xcm_builder::DescribeFamily, + >::convert_location(&descend_origin_location) + .unwrap(); let transfer_recipient = evm_account(); let mut transfer_recipient_balance_before = 0; @@ -3672,9 +3712,9 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds() ParaA::execute_with(|| { assert_ok!(XcmTransactor::transact_through_signed( parachain::RuntimeOrigin::signed(PARAALICE.into()), - Box::new(xcm::VersionedMultiLocation::V3(para_b_location)), + Box::new(xcm::VersionedLocation::V4(para_b_location)), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( para_b_balances ))), fee_amount: None @@ -3727,8 +3767,8 @@ fn hrmp_init_accept_through_root() { proposed_max_message_size: 1 }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -3760,8 +3800,8 @@ fn hrmp_init_accept_through_root() { para_id: 1u32.into() }, CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, @@ -3818,8 +3858,8 @@ fn hrmp_close_works() { recipient: 2u32.into() }), CurrencyPayment { - currency: Currency::AsMultiLocation(Box::new(xcm::VersionedMultiLocation::V3( - MultiLocation::parent() + currency: Currency::AsMultiLocation(Box::new(xcm::VersionedLocation::V4( + Location::parent() ))), fee_amount: Some(total_fee) }, diff --git a/runtime/relay-encoder/src/westend.rs b/runtime/relay-encoder/src/westend.rs index 2fb7e9054e..499ee5db26 100644 --- a/runtime/relay-encoder/src/westend.rs +++ b/runtime/relay-encoder/src/westend.rs @@ -256,6 +256,7 @@ mod tests { #[test] fn test_stake_bond() { let mut expected_encoded: Vec = Vec::new(); + let controller: AccountId32 = [1u8; 32].into(); let index = ::PalletInfo::index::< westend_runtime::Staking, @@ -265,7 +266,7 @@ mod tests { let mut expected = pallet_staking::Call::::bond { value: 100u32.into(), - payee: pallet_staking::RewardDestination::Controller, + payee: pallet_staking::RewardDestination::Account(controller.clone()), } .encode(); expected_encoded.append(&mut expected); @@ -274,7 +275,7 @@ mod tests { ::encode_call( xcm_primitives::AvailableStakeCalls::Bond( 100u32.into(), - pallet_staking::RewardDestination::Controller + pallet_staking::RewardDestination::Account(controller.clone()), ) ), expected_encoded.clone() @@ -291,7 +292,7 @@ mod tests { >::encode_call( xcm_primitives::AvailableStakeCalls::Bond( 100u32.into(), - pallet_staking::RewardDestination::Controller + pallet_staking::RewardDestination::Account(controller) ) ), expected_encoded @@ -535,6 +536,7 @@ mod tests { #[test] fn test_set_payee() { let mut expected_encoded: Vec = Vec::new(); + let controller: AccountId32 = [1u8; 32].into(); let index = ::PalletInfo::index::< westend_runtime::Staking, @@ -543,7 +545,7 @@ mod tests { expected_encoded.push(index); let mut expected = pallet_staking::Call::::set_payee { - payee: pallet_staking::RewardDestination::Controller, + payee: pallet_staking::RewardDestination::Account(controller.clone()), } .encode(); expected_encoded.append(&mut expected); @@ -551,7 +553,7 @@ mod tests { assert_eq!( ::encode_call( xcm_primitives::AvailableStakeCalls::SetPayee( - pallet_staking::RewardDestination::Controller + pallet_staking::RewardDestination::Account(controller.clone()) ) ), expected_encoded.clone() @@ -567,7 +569,7 @@ mod tests { moonbase_runtime::Runtime> as StakeEncodeCall >::encode_call( xcm_primitives::AvailableStakeCalls::SetPayee( - pallet_staking::RewardDestination::Controller + pallet_staking::RewardDestination::Account(controller) ) ), expected_encoded diff --git a/scripts/verify-licenses.sh b/scripts/verify-licenses.sh index 2d2e1dd96a..6200e8dbe9 100755 --- a/scripts/verify-licenses.sh +++ b/scripts/verify-licenses.sh @@ -9,6 +9,7 @@ LICENSES=( "Apache-2.0 OR BSD-1-Clause OR MIT" "Apache-2.0 OR BSD-2-Clause OR MIT" "Apache-2.0 OR BSD-3-Clause OR MIT" + "Apache-2.0 OR BSD-3-Clause" "Apache-2.0 OR BSL-1.0" "Apache-2.0 OR CC0-1.0 OR MIT-0" "Apache-2.0 OR CC0-1.0" @@ -46,7 +47,8 @@ NAMES=( licenses_filter=$(printf ' .license != "%s" and' "${LICENSES[@]}") authors_filter=$(printf ' .authors != "%s" and' "${AUTHORS[@]}") names_filter=$(printf ' .name != "%s" and' "${NAMES[@]}") -filter="${licenses_filter}${authors_filter}${names_filter:0:-4}" +# "true" at the end is necessary to close the "and" conditional +filter="${licenses_filter}${authors_filter}${names_filter} true" echo -e "checking licenses with filter:\n$filter\n" RESULT=$(jq "[.[] | select($filter)]" licenses.json) diff --git a/test/helpers/xcm.ts b/test/helpers/xcm.ts index f234597884..994dfdaf7c 100644 --- a/test/helpers/xcm.ts +++ b/test/helpers/xcm.ts @@ -185,7 +185,10 @@ export async function injectEncodedHrmpMessageAndSeal( ) { // Send RPC call to inject XCM message await customDevRpcRequest("xcm_injectHrmpMessage", [paraId, message]); - return await context.createBlock(); + // Create a block in which the XCM will be enqueued + await context.createBlock(); + // The next block will process the hrmp message in the message queue + return context.createBlock(); } // Weight a particular message using the xcm utils precompile @@ -211,7 +214,9 @@ export async function injectHrmpMessageAndSeal( message?: RawXcmMessage ) { await injectHrmpMessage(context, paraId, message); - // Create a block in which the XCM will be executed + // Create a block in which the XCM will be enqueued + await context.createBlock(); + // The next block will process the hrmp message in the message queue await context.createBlock(); } @@ -253,7 +258,12 @@ export interface XcmFragmentConfig { multilocation: MultiLocation; fungible: bigint; }[]; - weight_limit?: BN; + weight_limit?: + | BN + | { + refTime: BN | number | bigint; + proofSize: BN | number | bigint; + }; descend_origin?: string; beneficiary?: string; } @@ -346,7 +356,7 @@ export class XcmFragment { // Ticket seems to indicate the version of the assets ticket: { parents: 0, - interior: { X1: { GeneralIndex: 3 } }, + interior: { X1: { GeneralIndex: 4 } }, }, }, }); @@ -482,6 +492,34 @@ export class XcmFragment { }; } + /// XCM V4 calls + as_v4(): any { + const patchLocationV4recursively = (value: any) => { + // e.g. Convert this: { X1: { Parachain: 1000 } } to { X1: [ { Parachain: 1000 } ] } + if (value && typeof value == "object") { + if (Array.isArray(value)) { + return value.map(patchLocationV4recursively); + } + for (const k of Object.keys(value)) { + if (k === "Concrete" || k === "Abstract") { + return patchLocationV4recursively(value[k]); + } + if (k.match(/^X\d$/g) && !Array.isArray(value[k])) { + value[k] = Object.entries(value[k]).map(([k, v]) => ({ + [k]: patchLocationV4recursively(v), + })); + } else { + value[k] = patchLocationV4recursively(value[k]); + } + } + } + return value; + }; + return { + V4: this.instructions.map((inst) => patchLocationV4recursively(inst)), + }; + } + // Add a `BurnAsset` instruction burn_asset(amount: bigint = 0n): this { this.instructions.push({ diff --git a/test/moonwall.config.json b/test/moonwall.config.json index bb4cf9874c..fd0e9254d9 100644 --- a/test/moonwall.config.json +++ b/test/moonwall.config.json @@ -379,7 +379,7 @@ "--force-authoring", "--rpc-cors=all", "--alice", - "--chain=moonbeam-dev", + "--chain=tmp/moonbeam-dev-raw.json", "--sealing=manual", "--tmp" ] @@ -421,7 +421,7 @@ "--force-authoring", "--rpc-cors=all", "--alice", - "--chain=moonbase-dev", + "--chain=tmp/moonbase-dev-raw.json", "--sealing=manual", "--tmp" ] @@ -459,7 +459,7 @@ "--force-authoring", "--rpc-cors=all", "--alice", - "--chain=moonbase-dev", + "--chain=tmp/moonbase-dev-raw.json", "--sealing=manual", "--tmp", "--wasm-runtime-overrides=moonbase-overrides", diff --git a/test/scripts/compile-wasm.ts b/test/scripts/compile-wasm.ts index 788002df98..5091123d60 100644 --- a/test/scripts/compile-wasm.ts +++ b/test/scripts/compile-wasm.ts @@ -38,6 +38,34 @@ yargs(hideBin(process.argv)) }) .parse(); +async function spawn(cmd: string) { + return new Promise((resolve, reject) => { + var spawned = child_process.spawn(cmd, { shell: true }); + + let errData = ""; + let outData = ""; + spawned.stdout.on("data", (chunk) => { + outData += chunk.toString(); + }); + + spawned.stderr.on("data", (chunk) => { + errData += chunk.toString(); + }); + + spawned.on("close", function (code) { + if (code && code > 0) { + return reject(new Error(errData)); + } + + resolve(outData); + }); + + spawned.on("error", function (err) { + reject(err); + }); + }); +} + async function main(args: any) { const outputDirectory = path.join(process.cwd(), args.argv.OutputDirectory); const binaryPath = args.argv.Binary; @@ -50,12 +78,25 @@ async function main(args: any) { await fs.mkdir("tmp", { recursive: true }); const tmpDir = await fs.mkdtemp("tmp/base-path"); try { + // Generate plain chain spec + const generateChainSpecCmd = + `${binaryPath} build-spec` + ` --chain ${args.argv.Chain} > tmp/${args.argv.Chain}.json`; + console.log(`🗃️ ${generateChainSpecCmd}`); + await spawn(generateChainSpecCmd); + + // Generate raw chain spec + const generateRawChainSpecCmd = + `${binaryPath} build-spec --chain tmp/${args.argv.Chain}.json ` + + `--raw > tmp/${args.argv.Chain}-raw.json`; + console.log(`🗃️ ${generateRawChainSpecCmd}`); + await spawn(generateRawChainSpecCmd); + + // Generate precompiled wasm const command = `${binaryPath} precompile-wasm --log=wasmtime-runtime --base-path=${tmpDir} ` + - `--chain ${args.argv.Chain} ${outputDirectory}`; + `--chain tmp/${args.argv.Chain}-raw.json ${outputDirectory}`; console.log(`🗃️ ${command}`); - - child_process.execSync(`${command}`); + await spawn(command); } finally { if ((await fs.stat(tmpDir)).isDirectory()) { await fs.rm(tmpDir, { recursive: true, force: true }); diff --git a/test/suites/dev/moonbase/test-fees/test-fee-multiplier-max.ts b/test/suites/dev/moonbase/test-fees/test-fee-multiplier-max.ts index 8c9b832987..9da791c799 100644 --- a/test/suites/dev/moonbase/test-fees/test-fee-multiplier-max.ts +++ b/test/suites/dev/moonbase/test-fees/test-fee-multiplier-max.ts @@ -84,7 +84,7 @@ describeSuite({ // note that this is not really affected by the high multiplier because most of its fee is // derived from the length_fee, which is not scaled by the multiplier - expect(initialBalance - afterBalance).to.equal(9_231_801_265_723_667_008n); + expect(initialBalance - afterBalance).to.equal(601_486_761_265_723_667_008n); }, }); diff --git a/test/suites/dev/moonbase/test-fees/test-fee-multiplier-xcm.ts b/test/suites/dev/moonbase/test-fees/test-fee-multiplier-xcm.ts index 49baf78bc8..c97aaa3790 100644 --- a/test/suites/dev/moonbase/test-fees/test-fee-multiplier-xcm.ts +++ b/test/suites/dev/moonbase/test-fees/test-fee-multiplier-xcm.ts @@ -1,13 +1,13 @@ import "@moonbeam-network/api-augment/moonbase"; import { beforeAll, beforeEach, describeSuite, expect } from "@moonwall/cli"; import { BALTATHAR_ADDRESS, KeyringPair, alith, generateKeyringPair } from "@moonwall/util"; -import { BN, bnToHex } from "@polkadot/util"; +import { bnToHex } from "@polkadot/util"; import { RawXcmMessage, XcmFragment, descendOriginFromAddress20, expectOk, - injectHrmpMessageAndSeal, + injectHrmpMessage, } from "../../../../helpers"; // Below should be the calculation: @@ -162,7 +162,10 @@ describeSuite({ fungible: transferredBalance / 3n, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 4000000000n, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -170,30 +173,39 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", - requireWeightAtMost: new BN(1000000000), + originKind: "SovereignAccount", + requireWeightAtMost: { + refTime: 1000000000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v3(); - await injectHrmpMessageAndSeal(context, 1, { + await injectHrmpMessage(context, 1, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); + // Enqueue XCM message + await context.createBlock(); const postValue = await context.polkadotJs().query.transactionPayment.nextFeeMultiplier(); + expect(initialValue.eq(postValue), "Fee Multiplier has changed between blocks").to.be.true; + + // Process xcm message + await context.createBlock(); + const postBalance = (await context.polkadotJs().query.system.account(random.address)).data .free; const postHeight = ( await context.polkadotJs().rpc.chain.getBlock() ).block.header.number.toNumber(); - expect(initialHeight).to.equal(postHeight - 1); + expect(initialHeight).to.equal(postHeight - 2); expect(initialBalance.lt(postBalance), "Expected balances not updated").to.be.true; - expect(initialValue.eq(postValue), "Fee Multiplier has changed between blocks").to.be.true; }, }); @@ -265,7 +277,10 @@ describeSuite({ fungible: transferredBalance / 3n, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 4000000000n, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -273,30 +288,38 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", - requireWeightAtMost: new BN(1000000000), + originKind: "SovereignAccount", + requireWeightAtMost: { + refTime: 1000000000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncodedV1, }, }, }) - .as_v2(); + .as_v3(); - await injectHrmpMessageAndSeal(context, 1, { + await injectHrmpMessage(context, 1, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); + // Enqueue XCM message + await context.createBlock(); const postValue = await context.polkadotJs().query.transactionPayment.nextFeeMultiplier(); + expect(initialValue.eq(postValue), "Fee Multiplier has changed between blocks").to.be.true; + + // Process xcm message + await context.createBlock(); + const postBalance = (await context.polkadotJs().query.system.account(random.address)).data .free; const postHeight = ( await context.polkadotJs().rpc.chain.getBlock() ).block.header.number.toNumber(); - - expect(initialHeight).to.equal(postHeight - 1); + expect(initialHeight).to.equal(postHeight - 2); expect(initialBalance.lt(postBalance), "Expected balances not updated").to.be.true; - expect(initialValue.eq(postValue), "Fee Multiplier has changed between blocks").to.be.true; }, }); }, diff --git a/test/suites/dev/moonbase/test-fees/test-length-fees.ts b/test/suites/dev/moonbase/test-fees/test-length-fees.ts index d5c8ade09f..aeac6d0d26 100644 --- a/test/suites/dev/moonbase/test-fees/test-length-fees.ts +++ b/test/suites/dev/moonbase/test-fees/test-length-fees.ts @@ -22,7 +22,7 @@ describeSuite({ title: "should have expensive runtime-upgrade fees", test: async () => { const fee = await testRuntimeUpgrade(context); - expect(fee).toBeLessThanOrEqual(9226801665723667008n); + expect(fee).toBeLessThanOrEqual(9274087607203200560n); }, }); }, diff --git a/test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts b/test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts index 3de5cb64bd..a6a5b5c576 100644 --- a/test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts +++ b/test/suites/dev/moonbase/test-pov/test-xcm-to-evm-pov.ts @@ -138,6 +138,8 @@ describeSuite({ type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); + await context.createBlock(); + // This block is the one that processes the xcm messages const { result, block } = await context.createBlock(); // With 500k gas we are allowed to use ~150k of POV, so verify the range. @@ -238,6 +240,8 @@ describeSuite({ type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); + context.createBlock(); + // This block is the one that processes the xcm messages const { result, block } = await context.createBlock(); expect(block.proofSize).to.be.at.least(EXPECTED_POV_ROUGH / 1.1); diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-dummy-bytecode.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-dummy-bytecode.ts index d6f93d674d..26fb9d38ed 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-dummy-bytecode.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-dummy-bytecode.ts @@ -20,7 +20,7 @@ import { keccak256 } from "viem"; const INIT_CODE = "0x600580600B6000396000F360006000fd"; describeSuite({ - id: "D012939", + id: "D012938", title: "Precompiles - precompiles dummy bytecode", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-ecpairing.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-ecpairing.ts index 8b1eeebea0..d944589fb7 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-ecpairing.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-ecpairing.ts @@ -3,7 +3,7 @@ import { describeSuite, expect, beforeEach } from "@moonwall/cli"; import { u8aToHex } from "@polkadot/util"; describeSuite({ - id: "D012940", + id: "D012939", title: "Precompiles - ecPairing", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-ecrecover.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-ecrecover.ts index 36ef104963..70bef38e56 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-ecrecover.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-ecrecover.ts @@ -3,7 +3,7 @@ import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, ALITH_PRIVATE_KEY } from "@moonwall/util"; describeSuite({ - id: "D012941", + id: "D012940", title: "Precompiles - ecrecover", foundationMethods: "dev", testCases: ({ context, log, it }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-erc20-overflow.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-erc20-overflow.ts index 37923b3b23..8d374e482d 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-erc20-overflow.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-erc20-overflow.ts @@ -3,7 +3,7 @@ import { describeSuite, expect } from "@moonwall/cli"; import { generateKeyringPair } from "@moonwall/util"; describeSuite({ - id: "D012942", + id: "D012941", title: "Precompile ERC20 - Transfering through precompile", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-erc20.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-erc20.ts index ff9ce66448..fab4148853 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-erc20.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-erc20.ts @@ -28,7 +28,7 @@ import { ALITH_GENESIS_TRANSFERABLE_BALANCE } from "../../../../helpers"; const ABI_REVERT_SELECTOR = "0x08c379a0"; describeSuite({ - id: "D012943", + id: "D012942", title: "Precompiles - ERC20 Native", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity.ts index f7715c6e04..36f16266ba 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity.ts @@ -5,7 +5,7 @@ import { toHex } from "viem"; import { PRECOMPILE_IDENTITY_ADDRESS } from "../../../../helpers"; describeSuite({ - id: "D012944", + id: "D012943", title: "Precompiles - Identity precompile", foundationMethods: "dev", testCases: ({ it, log, context }) => { @@ -90,7 +90,7 @@ describeSuite({ expect(identity.isValid).to.be.true; expect(identity.judgements).to.be.empty; - expect(identity.deposit).to.equal(1032400000000000000n); + expect(identity.deposit).to.equal(1034200000000000000n); expect(identity.info.additional.length).to.equal(1); expect(identity.info.additional[0].key.hasData).to.be.true; expect(identity.info.additional[0].key.value).to.equal(toHex("discord")); diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity10.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity10.ts index 08c13b7c83..7be05ebdf7 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity10.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity10.ts @@ -4,7 +4,7 @@ import { alith, charleth } from "@moonwall/util"; import { expectEVMResult, PRECOMPILE_IDENTITY_ADDRESS } from "../../../../helpers"; describeSuite({ - id: "D012945", + id: "D012944", title: "Precompiles - Identity precompile - set account id", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity11.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity11.ts index b01681412c..e60d8496e3 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity11.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity11.ts @@ -9,7 +9,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012946", + id: "D012945", title: "Precompiles - Identity precompile - add sub", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity12.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity12.ts index 66c3b56f0c..ebe615b190 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity12.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity12.ts @@ -5,7 +5,7 @@ import { toHex } from "viem"; import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult } from "../../../../helpers"; describeSuite({ - id: "D012947", + id: "D012946", title: "Precompiles - Identity precompile - rename sub", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity13.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity13.ts index 1ca76e2680..e2ddd7165e 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity13.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity13.ts @@ -9,7 +9,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012948", + id: "D012947", title: "Precompiles - Identity precompile - remove sub", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity14.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity14.ts index f83ed7d0c3..307b649f3c 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity14.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity14.ts @@ -9,7 +9,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012949", + id: "D012948", title: "Precompiles - Identity precompile - quit sub", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity2.ts index 722f512fe0..8db5eb8f49 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity2.ts @@ -9,7 +9,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012950", + id: "D012949", title: "Precompiles - Identity precompile - set identity", foundationMethods: "dev", testCases: ({ it, log, context }) => { @@ -68,7 +68,7 @@ describeSuite({ expect(identity.isValid).to.be.true; expect(identity.judgements).to.be.empty; - expect(identity.deposit).to.equal(1032400000000000000n); + expect(identity.deposit).to.equal(1034200000000000000n); expect(identity.info.additional.length).to.equal(1); expect(identity.info.additional[0].key.hasData).to.be.true; expect(identity.info.additional[0].key.value).to.equal(toHex("discord")); diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity3.ts index 4690d88c2a..b118079c53 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity3.ts @@ -9,7 +9,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012951", + id: "D012950", title: "Precompiles - Identity precompile - clear identity", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity4.ts index c0b2996324..1ed86cbd33 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity4.ts @@ -9,7 +9,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012952", + id: "D012951", title: "Precompiles - Identity precompile - request judgement", foundationMethods: "dev", testCases: ({ it, log, context }) => { @@ -69,7 +69,7 @@ describeSuite({ expect(identity.judgements[0].registrarIndex).to.equal(0); expect(identity.judgements[0].judgement.isFeePaid).to.be.true; expect(identity.judgements[0].judgement.feePaidDeposit).to.equal(100n); - expect(identity.deposit).to.equal(1025800000000000000n); + expect(identity.deposit).to.equal(1027400000000000000n); expect(identity.info.display.hasData).to.be.true; expect(identity.info.display.value).to.equal(toHex("display")); }, diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity5.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity5.ts index 305afaa9bc..f349f710f9 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity5.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity5.ts @@ -9,7 +9,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012953", + id: "D012952", title: "Precompiles - Identity precompile - cancel requested judgement", foundationMethods: "dev", testCases: ({ it, log, context }) => { @@ -69,7 +69,7 @@ describeSuite({ expect(identity.isValid).to.be.true; expect(identity.judgements).to.be.empty; - expect(identity.deposit).to.equal(1025800000000000000n); + expect(identity.deposit).to.equal(1027400000000000000n); expect(identity.info.display.hasData).to.be.true; expect(identity.info.display.value).to.equal(toHex("display")); }, diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity6.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity6.ts index 276574ded7..6ae8e205b8 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity6.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity6.ts @@ -9,7 +9,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012954", + id: "D012953", title: "Precompiles - Identity precompile - provide judgement", foundationMethods: "dev", testCases: ({ it, log, context }) => { @@ -32,7 +32,7 @@ describeSuite({ const identityHash = context .polkadotJs() - .registry.createType("PalletIdentitySimpleIdentityInfo", identityData) + .registry.createType("PalletIdentityLegacyIdentityInfo", identityData) .hash.toHex(); const block = await context.createBlock( await context.writeContract!({ @@ -85,7 +85,7 @@ describeSuite({ expect(identity.isValid).to.be.true; expect(identity.judgements).to.have.length(1); expect(identity.judgements[0].judgement.isKnownGood).to.be.true; - expect(identity.deposit).to.equal(1025800000000000000n); + expect(identity.deposit).to.equal(1027400000000000000n); expect(identity.info.display.hasData).to.be.true; expect(identity.info.display.value).to.equal(toHex("display")); }, diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity7.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity7.ts index 4eed4dce8d..bb873cdfb9 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity7.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity7.ts @@ -5,7 +5,7 @@ import { toHex } from "viem"; import { PRECOMPILE_IDENTITY_ADDRESS, expectEVMResult } from "../../../../helpers"; describeSuite({ - id: "D012955", + id: "D012954", title: "Precompiles - Identity precompile - set subs", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity8.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity8.ts index 9b39f2f78a..727e4169ae 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity8.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity8.ts @@ -4,7 +4,7 @@ import { alith } from "@moonwall/util"; import { expectEVMResult, PRECOMPILE_IDENTITY_ADDRESS } from "../../../../helpers"; describeSuite({ - id: "D012956", + id: "D012955", title: "Precompiles - Identity precompile - set fee", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-identity9.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-identity9.ts index 1bbe4e6648..b282eec082 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-identity9.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-identity9.ts @@ -4,7 +4,7 @@ import { alith } from "@moonwall/util"; import { expectEVMResult, PRECOMPILE_IDENTITY_ADDRESS } from "../../../../helpers"; describeSuite({ - id: "D012957", + id: "D012956", title: "Precompiles - Identity precompile - set fields", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-modexp.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-modexp.ts index 86c5beb114..83c29980f3 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-modexp.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-modexp.ts @@ -7,7 +7,7 @@ import { expectEVMResult, testVectors } from "../../../../helpers"; const MODEXP_PRECOMPILE_ADDRESS = "0x0000000000000000000000000000000000000005"; describeSuite({ - id: "D012958", + id: "D012957", title: "Precompiles - modexp", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-preimage.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-preimage.ts index 9eb56d998f..4927889c60 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-preimage.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-preimage.ts @@ -6,7 +6,7 @@ import { Preimage, expectEVMResult, expectSubstrateEvent } from "../../../../hel // Each test is instantiating a new proposal (Not ideal for isolation but easier to write) // Be careful to not reach the maximum number of proposals. describeSuite({ - id: "D012959", + id: "D012958", title: "Precompiles - Preimage precompile", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-author-mapping.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-author-mapping.ts index 4691d5cd5b..c11d0ab61d 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-author-mapping.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-author-mapping.ts @@ -12,7 +12,7 @@ import { encodeFunctionData } from "viem"; import { expectEVMResult, getAuthorMappingInfo } from "../../../../helpers"; describeSuite({ - id: "D012960", + id: "D012959", title: "Proxy : Author Mapping - simple association", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-governance.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-governance.ts index bf6b67b73a..9167c88163 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-governance.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-governance.ts @@ -23,7 +23,7 @@ import { expectEVMResult } from "../../../../helpers"; const proposalHash = "0xf3d039875302d49d52fb1af6877a2c46bc55b004afb8130f94dd9d0489ca3185"; describeSuite({ - id: "D012961", + id: "D012960", title: "Proxing governance (through proxy precompile)", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo.ts index 500d73d8fd..103e1e0deb 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo.ts @@ -4,7 +4,7 @@ import { BALTATHAR_ADDRESS, CHARLETH_ADDRESS, DOROTHY_ADDRESS, GLMR } from "@moo import { setupPoolWithParticipants } from "../../../../helpers"; describeSuite({ - id: "D012962", + id: "D012961", title: "Proxy Leader Demo - Preparing Participation Pool", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo2.ts index 025d678868..3bcb00557f 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo2.ts @@ -3,7 +3,7 @@ import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { expectEVMResult, setupPoolWithParticipants } from "../../../../helpers"; describeSuite({ - id: "D012963", + id: "D012962", title: "Proxy Leader Demo - Start Voting", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo3.ts index 28c99baf54..4e1f67bc78 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-leader-demo3.ts @@ -10,7 +10,7 @@ import { import { setupPoolWithParticipants, expectEVMResult } from "../../../../helpers"; describeSuite({ - id: "D012964", + id: "D012963", title: "Proxy Leader Demo - Vote", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-non-transfer.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-non-transfer.ts index 8a3656956c..4c8a82a79e 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-non-transfer.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-non-transfer.ts @@ -18,7 +18,7 @@ import { encodeFunctionData } from "viem"; import { expectEVMResult, getAuthorMappingInfo } from "../../../../helpers"; describeSuite({ - id: "D012965", + id: "D012964", title: "Proxy : Non transfer - Evm transfer", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo.ts index 23c79ed4fd..fc28217fdf 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo.ts @@ -13,7 +13,7 @@ import { nToHex } from "@polkadot/util"; import { setupWithParticipants } from "../../../../helpers"; describeSuite({ - id: "D012966", + id: "D012965", title: "Proxy Call Staking Demo - Register Candidate", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo2.ts index b1de9c15f3..97f290de72 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo2.ts @@ -16,7 +16,7 @@ import { nToHex } from "@polkadot/util"; import { setupWithParticipants } from "../../../../helpers"; describeSuite({ - id: "D012967", + id: "D012966", title: "Proxy Call Staking Demo - New Participant", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo3.ts index 8140812990..62282abe3c 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo3.ts @@ -14,7 +14,7 @@ import { nToHex } from "@polkadot/util"; import { setupWithParticipants } from "../../../../helpers"; describeSuite({ - id: "D012968", + id: "D012967", title: "Proxy Call Staking Demo - Leave Participant", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo4.ts index 4a62246840..6149187009 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy-staking-demo4.ts @@ -13,7 +13,7 @@ import { nToHex } from "@polkadot/util"; import { setupWithParticipants } from "../../../../helpers"; describeSuite({ - id: "D012969", + id: "D012968", title: "Proxy Call Staking Demo - Unregister Candidate", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy.ts index fc73c62105..482f713a3d 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-proxy.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-proxy.ts @@ -23,7 +23,7 @@ import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; import { expectEVMResult } from "../../../../helpers"; describeSuite({ - id: "D012970", + id: "D012969", title: "Precompile - Proxy", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-referenda-demo.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-referenda-demo.ts index 68b8f97d21..1aa36e18bc 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-referenda-demo.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-referenda-demo.ts @@ -15,7 +15,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012971", + id: "D012970", title: "Precompiles - Referenda Auto Upgrade Demo", foundationMethods: "dev", testCases: ({ it, log, context }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-referenda.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-referenda.ts index 5cc5e56e70..89ab2070ef 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-referenda.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-referenda.ts @@ -11,7 +11,7 @@ import { // Each test is instantiating a new proposal (Not ideal for isolation but easier to write) describeSuite({ - id: "D012972", + id: "D012971", title: "Precompiles - Referenda precompile", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-relay-encoder.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-relay-encoder.ts index 4fd9414c65..c0db1fb41e 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-relay-encoder.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-relay-encoder.ts @@ -3,7 +3,7 @@ import { describeSuite, expect } from "@moonwall/cli"; import { ALITH_SESSION_ADDRESS, BALTATHAR_SESSION_ADDRESS } from "@moonwall/util"; describeSuite({ - id: "D012973", + id: "D012972", title: "Precompiles - relay-encoder", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-relay-verifier.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-relay-verifier.ts index 22e99d2835..3a29be83a3 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-relay-verifier.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-relay-verifier.ts @@ -3,7 +3,7 @@ import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { PRECOMPILE_RELAY_DATA_VERIFIER_ADDRESS } from "../../../../helpers"; describeSuite({ - id: "D012974", + id: "D012973", title: "Precompiles - relay-verifier", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-revert-attack.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-revert-attack.ts index 3189517aab..ea0e511bd6 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-revert-attack.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-revert-attack.ts @@ -10,7 +10,7 @@ import { ALITH_ADDRESS, MIN_GLMR_STAKING } from "@moonwall/util"; // We have to make sure that's not possible describeSuite({ - id: "D012975", + id: "D012974", title: "Precompiles - Reverting Staking precompile", foundationMethods: "dev", testCases: ({ context, log, it }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-ripemd160.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-ripemd160.ts index 116ad83451..ba50c678ae 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-ripemd160.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-ripemd160.ts @@ -4,7 +4,7 @@ import { toHex } from "viem"; import { expectEVMResult } from "../../../../helpers"; describeSuite({ - id: "D012976", + id: "D012975", title: "Precompiles - ripemd160 ", foundationMethods: "dev", testCases: ({ context, log, it }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-sha3fips.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-sha3fips.ts index 83e577acc6..51964c78ab 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-sha3fips.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-sha3fips.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect } from "@moonwall/cli"; describeSuite({ - id: "D012977", + id: "D012976", title: "Precompiles - sha3fips", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call.ts index d8a0f2d2bb..fdd8a424cc 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call.ts @@ -12,7 +12,7 @@ import { encodeFunctionData } from "viem"; import { expectEVMResult } from "../../../../helpers"; describeSuite({ - id: "D012978", + id: "D012977", title: "Smart Contract Precompile Call - AddProxy Staking", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call2.ts index 76542dedf8..97c5f6097e 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call2.ts @@ -12,7 +12,7 @@ import { encodeFunctionData } from "viem"; import { expectEVMResult } from "../../../../helpers"; describeSuite({ - id: "D012979", + id: "D012978", title: "Smart Contract Precompile Call - Proxy - Any Proxy Type", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call3.ts index 50ff2a3b43..a460b787c1 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call3.ts @@ -11,7 +11,7 @@ import { encodeFunctionData } from "viem"; import { expectEVMResult } from "../../../../helpers"; describeSuite({ - id: "D012980", + id: "D012979", title: "Smart Contract Precompile Call - Proxy - Any Proxy Type", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call4.ts index fbc6bd459c..951b851b8c 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call4.ts @@ -5,7 +5,7 @@ import { encodeFunctionData } from "viem"; import { expectEVMResult } from "../../../../helpers"; describeSuite({ - id: "D012981", + id: "D012980", title: "Smart Contract Precompile Call - Proxy - Real Account", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call5.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call5.ts index f5d984971d..5dc81758dd 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call5.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-smart-contract-call5.ts @@ -4,7 +4,7 @@ import { encodeFunctionData } from "viem"; import { expectEVMResult } from "../../../../helpers"; describeSuite({ - id: "D012982", + id: "D012981", title: "Smart Contract Precompile Call - Proxy - Real Account", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-staking.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking.ts index 62f5bb51fb..fbe4657523 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-staking.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-staking.ts @@ -3,7 +3,7 @@ import { describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS } from "@moonwall/util"; describeSuite({ - id: "D012983", + id: "D012982", title: "Precompiles - Staking - Genesis", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-staking2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking2.ts index 198b896217..6165ccbb1e 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-staking2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-staking2.ts @@ -4,7 +4,7 @@ import { ALITH_ADDRESS, ETHAN_ADDRESS, ETHAN_PRIVATE_KEY, MIN_GLMR_STAKING } fro import { verifyLatestBlockFees } from "../../../../helpers"; describeSuite({ - id: "D012984", + id: "D012983", title: "Precompiles - Staking - Join Candidates", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-staking3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking3.ts index d665610917..e7cbb51979 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-staking3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-staking3.ts @@ -3,7 +3,7 @@ import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { ETHAN_ADDRESS, ETHAN_PRIVATE_KEY, MIN_GLMR_STAKING } from "@moonwall/util"; describeSuite({ - id: "D012985", + id: "D012984", title: "Precompiles - Staking - Collator Leaving", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-staking4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking4.ts index cb9daa51f8..a663b9aa38 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-staking4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-staking4.ts @@ -3,7 +3,7 @@ import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, ETHAN_ADDRESS, ETHAN_PRIVATE_KEY, MIN_GLMR_STAKING } from "@moonwall/util"; describeSuite({ - id: "D012986", + id: "D012985", title: "Precompiles - Staking - Join Delegators", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-staking5.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking5.ts index ea6ce4ac18..a01fc4c8d0 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-staking5.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-staking5.ts @@ -9,7 +9,7 @@ import { } from "@moonwall/util"; describeSuite({ - id: "D012987", + id: "D012986", title: "Precompiles - Staking - Join Delegators", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-staking6.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-staking6.ts index d1f5b9f419..8052fbee09 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-staking6.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-staking6.ts @@ -3,7 +3,7 @@ import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, ETHAN_ADDRESS } from "@moonwall/util"; describeSuite({ - id: "D012988", + id: "D012987", title: "Precompiles - Staking - AwardedPoints", foundationMethods: "dev", testCases: ({ context, it }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole.ts index c5e69da0e3..ada88a50f9 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole.ts @@ -50,7 +50,7 @@ const WH_IMPLICIT_DECIMALS = 18n; const WH_IMPLICIT_MULTIPLIER = 10n ** WH_IMPLICIT_DECIMALS; describeSuite({ - id: "D012989", + id: "D012988", title: "Test local Wormhole", foundationMethods: "dev", @@ -339,7 +339,7 @@ describeSuite({ const block = await context.createBlock(rawTx); expectEVMResult(block.result!.events, "Succeed", "Returned"); - const events = expectSubstrateEvents(block, "xTokens", "TransferredMultiAssets"); + const events = expectSubstrateEvents(block, "xTokens", "TransferredAssets"); const transferFungible = events[0].data[1][0].fun; expect(transferFungible.isFungible); const transferAmount = transferFungible.asFungible.toBigInt(); @@ -381,7 +381,7 @@ describeSuite({ const block = await context.createBlock(rawTx); expectEVMResult(block.result!.events, "Succeed", "Returned"); - const events = expectSubstrateEvents(block, "xTokens", "TransferredMultiAssets"); + const events = expectSubstrateEvents(block, "xTokens", "TransferredAssets"); const transferFungible = events[0].data[1][0].fun; expect(transferFungible.isFungible); const transferAmount = transferFungible.asFungible.toBigInt(); @@ -427,7 +427,7 @@ describeSuite({ expectEVMResult(block.result!.events, "Succeed", "Returned"); // there should be no xTokens TransferredMultiAssets event since fee >= amount sent - const events = expectSubstrateEvents(block!, "xTokens", "TransferredMultiAssets"); + const events = expectSubstrateEvents(block!, "xTokens", "TransferredAssets"); expect(events.length).to.eq(0); // TODO: isn't expectSubstrateEvents supposed to expect > 0? const alithWHTokenAfter = await whWethContract.balanceOf(ALITH_ADDRESS); @@ -469,7 +469,7 @@ describeSuite({ const block = await context.createBlock(rawTx); expectEVMResult(block.result!.events, "Succeed", "Returned"); - const events = expectSubstrateEvents(block, "xTokens", "TransferredMultiAssets"); + const events = expectSubstrateEvents(block, "xTokens", "TransferredAssets"); const transferFungible = events[0].data[1][0].fun; expect(transferFungible.isFungible); const transferAmount = transferFungible.asFungible.toBigInt(); @@ -566,7 +566,7 @@ describeSuite({ const result = await context.createBlock(rawTx); expectEVMResult(result.result.events, "Succeed", "Returned"); - const events = expectSubstrateEvents(result, "xTokens", "TransferredMultiAssets"); + const events = expectSubstrateEvents(result, "xTokens", "TransferredAssets"); const transferFungible = events[0].data[1][0].fun; expect(transferFungible.isFungible); const transferAmount = transferFungible.asFungible.toBigInt(); diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole2.ts index 27993946cc..0250737e96 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-wormhole2.ts @@ -3,7 +3,7 @@ import { describeSuite, expect } from "@moonwall/cli"; import { expectEVMResult, extractRevertReason } from "../../../../helpers"; describeSuite({ - id: "D012990", + id: "D012989", title: "Test GMP Killswitch", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor.ts index 6c9fa9505a..269fbccc4d 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor.ts @@ -10,7 +10,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012991", + id: "D012990", title: "Precompiles - xcm transactor", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor10.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor10.ts index cebf35c747..c64c5468c8 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor10.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor10.ts @@ -15,7 +15,7 @@ import { const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; describeSuite({ - id: "D012992", + id: "D012991", title: "Precompiles - xcm transactor V3", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor11.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor11.ts index 4ea2f25fb5..01dacfb9be 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor11.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor11.ts @@ -12,7 +12,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012993", + id: "D012992", title: "Precompiles - xcm transactor V3", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor12.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor12.ts index f6a637c531..3e66d16029 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor12.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor12.ts @@ -14,7 +14,7 @@ import { const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; describeSuite({ - id: "D012994", + id: "D012993", title: "Precompiles - xcm transactor V3", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor2.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor2.ts index b005d5ab8b..fc14698706 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor2.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor2.ts @@ -13,7 +13,7 @@ import { const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; describeSuite({ - id: "D012995", + id: "D012994", title: "Precompiles - xcm transactor", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor3.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor3.ts index 5d0dcd5da3..c8b0720446 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor3.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor3.ts @@ -13,7 +13,7 @@ import { const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; describeSuite({ - id: "D012996", + id: "D012995", title: "Precompiles - xcm transactor", foundationMethods: "dev", testCases: ({ context, it }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor4.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor4.ts index f219476d8c..b84ffe746c 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor4.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor4.ts @@ -8,7 +8,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012997", + id: "D012996", title: "Precompiles - xcm transactor", foundationMethods: "dev", testCases: ({ context, it }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor5.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor5.ts index 1ada2d7e6b..25d5165d5f 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor5.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor5.ts @@ -8,7 +8,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012998", + id: "D012997", title: "Precompiles - xcm transactor V2", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor6.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor6.ts index 8068db4ed9..f67cb49aac 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor6.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor6.ts @@ -13,7 +13,7 @@ import { const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; describeSuite({ - id: "D012999", + id: "D012998", title: "Precompiles - xcm transactor V2", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor7.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor7.ts index 14ddadbf42..d3179a4c32 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor7.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor7.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012900", + id: "D012999", title: "Precompiles - xcm transactor V2", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor8.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor8.ts index d13bdc3ee6..0d8923f5bd 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor8.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor8.ts @@ -13,7 +13,7 @@ import { const ADDRESS_RELAY_ASSETS = "0xffffffff1fcacbd218edc0eba20fc2308c778080"; describeSuite({ - id: "D012901", + id: "D012900", title: "Precompiles - xcm transactor V2", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor9.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor9.ts index 0d6bf21c6a..623eb3c130 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor9.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-transactor9.ts @@ -10,7 +10,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012902", + id: "D012901", title: "Precompiles - xcm transactor V3", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts index db1308db0f..d8fe184460 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xcm-utils.ts @@ -8,7 +8,7 @@ import { expectEVMResult, descendOriginFromAddress20 } from "../../../../helpers export const CLEAR_ORIGIN_WEIGHT = 5_194_000n; describeSuite({ - id: "D012903", + id: "D012902", title: "Precompiles - xcm utils", foundationMethods: "dev", testCases: ({ context, it }) => { diff --git a/test/suites/dev/moonbase/test-precompile/test-precompile-xtokens.ts b/test/suites/dev/moonbase/test-precompile/test-precompile-xtokens.ts index a62a286305..5fc9d6dcbc 100644 --- a/test/suites/dev/moonbase/test-precompile/test-precompile-xtokens.ts +++ b/test/suites/dev/moonbase/test-precompile/test-precompile-xtokens.ts @@ -8,7 +8,7 @@ import { } from "../../../../helpers"; describeSuite({ - id: "D012904", + id: "D012903", title: "Precompiles - xtokens", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-proxy/test-proxy-identity.ts b/test/suites/dev/moonbase/test-proxy/test-proxy-identity.ts index e8f168982f..ddc377339c 100644 --- a/test/suites/dev/moonbase/test-proxy/test-proxy-identity.ts +++ b/test/suites/dev/moonbase/test-proxy/test-proxy-identity.ts @@ -22,7 +22,7 @@ describeSuite({ }; const identity = context .polkadotJs() - .registry.createType("PalletIdentitySimpleIdentityInfo", identityData); + .registry.createType("PalletIdentityLegacyIdentityInfo", identityData); identityHash = identity.hash.toHex(); const block = await context.createBlock([ @@ -37,7 +37,7 @@ describeSuite({ }); const identityOf = await context.polkadotJs().query.identity.identityOf(signer.address); - expect(identityOf.unwrap().info.hash.toHex(), "Identity hash should match").to.equal( + expect(identityOf.unwrap()[0].info.hash.toHex(), "Identity hash should match").to.equal( identityHash ); }); @@ -148,7 +148,7 @@ describeSuite({ // }; // const identity = context // .polkadotJs() -// .registry.createType("PalletIdentitySimpleIdentityInfo", identityData); +// .registry.createType("PalletIdentityLegacyIdentityInfo", identityData); // identityHash = identity.hash.toHex(); // const block = await context.createBlock([ // context diff --git a/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound-pov.ts b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound-pov.ts index ed641c8a0e..34d4d09d8a 100644 --- a/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound-pov.ts +++ b/test/suites/dev/moonbase/test-staking/test-rewards-auto-compound-pov.ts @@ -98,7 +98,7 @@ describeSuite({ expect( weights.mandatory.proofSize.toNumber(), "proofSize is too high, this might lead to empty block" - ).to.be.at.most(2_500_000); + ).to.be.at.most(2_600_000); // block could support ~500ms refTime but we consider it safer to error when reaching // over 200ms for the payout diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-queue.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-queue.ts deleted file mode 100644 index 7a3cc7f1da..0000000000 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-queue.ts +++ /dev/null @@ -1,155 +0,0 @@ -import "@moonbeam-network/api-augment"; -import { customDevRpcRequest, describeSuite, expect } from "@moonwall/cli"; -import { GLMR } from "@moonwall/util"; -import type { XcmVersionedXcm } from "@polkadot/types/lookup"; -import { u8aToHex } from "@polkadot/util"; -import { XcmFragment, weightMessage } from "../../../../helpers"; - -describeSuite({ - id: "D013907", - title: "Mock XCMP - test XCMP execution", - foundationMethods: "dev", - testCases: ({ context, it, log }) => { - it({ - id: "T01", - title: "Should test DMP on_initialization and on_idle", - test: async function () { - const metadata = await context.polkadotJs().rpc.state.getMetadata(); - const balancesPalletIndex = metadata.asLatest.pallets - .find(({ name }) => name.toString() == "Balances")! - .index.toNumber(); - - // TODO this test mostly changes it's nature due to proof size accounting - // by now we just decrease the number of supported messages from 50 to 20. - const numMsgs = 20; - // let's target half of then being executed - - // xcmp reserved is BLOCK/4 - const totalDmpWeight = - context.polkadotJs().consts.system.blockWeights.maxBlock.refTime.toBigInt() / 4n; - - // we want half of numParaMsgs to be executed. That give us how much each message weights - const weightPerMessage = (totalDmpWeight * BigInt(2)) / BigInt(numMsgs); - - // Now we need to construct the message. This needs to: - // - pass barrier (withdraw + buyExecution + unlimited buyExecution*n) - // we know at least 2 instructions are needed per message (withdrawAsset + buyExecution) - // how many unlimited buyExecutions do we need to append? - - // we will bias this number. The reason is we want to test the decay, and therefore we need - // an unbalanced number of messages executed. We specifically need that at some point - // we get out of the loop of the execution (we reach the threshold limit), to then - // go on idle - - const config = { - assets: [ - { - multilocation: { - parents: 0, - interior: { - X1: { PalletInstance: balancesPalletIndex }, - }, - }, - fungible: 1_000_000_000_000_000n, - }, - ], - }; - - // How much does the withdraw weight? - const withdrawWeight = await weightMessage( - context, - context - .polkadotJs() - .createType("XcmVersionedXcm", new XcmFragment(config).withdraw_asset().as_v2()) - ); - - // How much does the buyExecution weight? - const buyExecutionWeight = await weightMessage( - context, - context - .polkadotJs() - .createType("XcmVersionedXcm", new XcmFragment(config).buy_execution().as_v2()) - ); - - // How much does the refundSurplus weight? - // We use refund surplus because it has 0 pov - // it's easier to focus on reftime - const refundSurplusWeight = await weightMessage( - context, - context - .polkadotJs() - .createType("XcmVersionedXcm", new XcmFragment(config).refund_surplus().as_v2()) - ); - - const refundSurplusPerMessage = - (weightPerMessage - withdrawWeight - buyExecutionWeight) / refundSurplusWeight; - - const xcmMessage = new XcmFragment(config) - .withdraw_asset() - .buy_execution() - .refund_surplus(refundSurplusPerMessage) - .as_v2(); - - const receivedMessage: XcmVersionedXcm = context - .polkadotJs() - .createType("XcmVersionedXcm", xcmMessage); - - const totalMessage = [...receivedMessage.toU8a()]; - - // We want these isntructions to fail in BuyExecution. That means - // WithdrawAsset needs to work. The only way for this to work - // is to fund each sovereign account - const sovereignAddress = u8aToHex( - new Uint8Array([...new TextEncoder().encode("Parent")]) - ).padEnd(42, "0"); - - // We first fund the parent sovereign account with 1000 - // we will only withdraw 1, so no problem on this - await context.createBlock( - context.polkadotJs().tx.balances.transferAllowDeath(sovereignAddress, 1n * GLMR), - { allowFailures: false } - ); - - // now we start injecting messages - // several - for (let i = 0; i < numMsgs; i++) { - await customDevRpcRequest("xcm_injectDownwardMessage", [totalMessage]); - } - - await context.createBlock(); - - const signedBlock = await context.polkadotJs().rpc.chain.getBlock(); - const apiAt = await context.polkadotJs().at(signedBlock.block.header.hash); - const allRecords = await apiAt.query.system.events(); - // lets grab at which point the dmp queue was exhausted - const exhaustIndex = allRecords.findIndex(({ event }) => - context.polkadotJs().events.dmpQueue.MaxMessagesExhausted.is(event) - ); - - expect( - exhaustIndex, - "Index not found where dmpQueue is exhausted" - ).to.be.greaterThanOrEqual(0); - - // OnInitialization - const eventsExecutedOnInitialization = allRecords.filter( - ({ event }, index) => - context.polkadotJs().events.dmpQueue.ExecutedDownward.is(event) && index < exhaustIndex - ); - - // OnIdle - const eventsExecutedOnIdle = allRecords.filter( - ({ event }, index) => - context.polkadotJs().events.dmpQueue.ExecutedDownward.is(event) && index > exhaustIndex - ); - - // the test was designed to go half and half - expect(eventsExecutedOnInitialization.length).to.be.eq(10); - expect(eventsExecutedOnIdle.length).to.be.eq(10); - const pageIndex = await apiAt.query.dmpQueue.pageIndex(); - expect(pageIndex.beginUsed.toBigInt()).to.eq(0n); - expect(pageIndex.endUsed.toBigInt()).to.eq(0n); - }, - }); - }, -}); diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-3.ts b/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-3.ts deleted file mode 100644 index d59dea9f84..0000000000 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-3.ts +++ /dev/null @@ -1,239 +0,0 @@ -import "@moonbeam-network/api-augment"; -import { beforeAll, describeSuite, expect } from "@moonwall/cli"; - -import { BN } from "@polkadot/util"; -import { KeyringPair } from "@polkadot/keyring/types"; -import { Abi, encodeFunctionData } from "viem"; -import { generateKeyringPair } from "@moonwall/util"; -import { - XcmFragment, - RawXcmMessage, - injectHrmpMessageAndSeal, - descendOriginFromAddress20, - MultiLocation, - registerForeignAsset, - weightMessage, -} from "../../../../helpers/xcm.js"; - -describeSuite({ - id: "D013921", - title: "Mock XCM - receive horizontal transact ETHEREUM (asset fee)", - foundationMethods: "dev", - testCases: ({ context, it, log }) => { - const assetMetadata = { - name: "FOREIGN", - symbol: "FOREIGN", - decimals: 12n, - isFrozen: false, - }; - const statemint_para_id = 1001; - const statemint_assets_pallet_instance = 50; - const palletId = "0x6D6f646c617373746d6E67720000000000000000"; - - const ASSET_MULTILOCATION: MultiLocation = { - parents: 1, - interior: { - X3: [ - { Parachain: statemint_para_id }, - { PalletInstance: statemint_assets_pallet_instance }, - { GeneralIndex: 0n }, - ], - }, - }; - - const STATEMINT_LOCATION = { - Xcm: ASSET_MULTILOCATION, - }; - - let assetId: string; - let sendingAddress: `0x${string}`; - let descendedAddress: `0x${string}`; - let random: KeyringPair; - let contractDeployed: `0x${string}`; - let contractABI: Abi; - - // Gas limit + one db read - const assetsToTransfer = (3_300_000_000n + 25_000_000n) * 2n; - - beforeAll(async () => { - const { contractAddress, abi } = await context.deployContract!("Incrementor"); - - contractDeployed = contractAddress; - contractABI = abi; - - const { originAddress, descendOriginAddress } = descendOriginFromAddress20(context); - sendingAddress = originAddress; - descendedAddress = descendOriginAddress; - random = generateKeyringPair(); - - // registerForeignAsset - const { registeredAssetId, registeredAsset } = await registerForeignAsset( - context, - STATEMINT_LOCATION, - assetMetadata, - 1_000_000_000_000 - ); - assetId = registeredAssetId; - expect(registeredAsset.owner.toHex()).to.eq(palletId.toLowerCase()); - - const config = { - assets: [ - { - multilocation: ASSET_MULTILOCATION, - fungible: 0n, - }, - ], - beneficiary: descendOriginAddress, - }; - - // How much will the message weight? - const chargedWeight = await weightMessage( - context, - context - .polkadotJs() - .createType( - "XcmVersionedXcm", - new XcmFragment(config) - .reserve_asset_deposited() - .clear_origin() - .buy_execution() - .deposit_asset() - .as_v2() - ) - ); - - // we modify the config now: - // we send assetsToTransfer plus whatever we will be charged in weight - config.assets[0].fungible = assetsToTransfer + chargedWeight; - - // Construct the real message - const xcmMessage = new XcmFragment(config) - .reserve_asset_deposited() - .clear_origin() - .buy_execution() - .deposit_asset() - .as_v2(); - - // Send an XCM and create block to execute it - await injectHrmpMessageAndSeal(context, statemint_para_id, { - type: "XcmVersionedXcm", - payload: xcmMessage, - } as RawXcmMessage); - - // Make sure descended address has the transferred foreign assets (minus the xcm fees). - expect( - (await context.polkadotJs().query.assets.account(assetId, descendedAddress)) - .unwrap() - .balance.toBigInt() - ).to.eq(assetsToTransfer); - }); - - it({ - id: "T01", - title: "should receive transact and should be able to execute", - test: async function () { - const xcmTransactions = [ - { - V1: { - gas_limit: 100000, - fee_payment: { - Auto: { - Low: null, - }, - }, - action: { - Call: contractDeployed, - }, - value: 0n, - input: encodeFunctionData({ - abi: contractABI, - functionName: "incr", - args: [], - }), - access_list: null, - }, - }, - { - V2: { - gas_limit: 100000, - action: { - Call: contractDeployed, - }, - value: 0n, - input: encodeFunctionData({ - abi: contractABI, - functionName: "incr", - args: [], - }), - access_list: null, - }, - }, - ]; - - let expectedCalls = 0n; - - for (const xcmTransaction of xcmTransactions) { - expectedCalls++; - - // TODO need to update lookup types for xcm ethereum transaction V2 - const transferCall = context.polkadotJs().tx.ethereumXcm.transact(xcmTransaction); - const transferCallEncoded = transferCall?.method.toHex(); - - // We are going to test that we can receive a transact operation from parachain 1 - // using descendOrigin first - const xcmMessage = new XcmFragment({ - assets: [ - { - multilocation: ASSET_MULTILOCATION, - fungible: assetsToTransfer / 2n, - }, - ], - weight_limit: new BN((assetsToTransfer / 2n).toString()), - descend_origin: sendingAddress, - }) - .descend_origin() - .withdraw_asset() - .buy_execution() - .push_any({ - Transact: { - originType: "SovereignAccount", - // 100_000 gas + 1 db read - requireWeightAtMost: 2_525_000_000n, - call: { - encoded: transferCallEncoded, - }, - }, - }) - .as_v2(); - - // Send an XCM and create block to execute it - await injectHrmpMessageAndSeal(context, 1, { - type: "XcmVersionedXcm", - payload: xcmMessage, - } as RawXcmMessage); - - const actualCalls = ( - await context.viem().call({ - to: contractDeployed, - data: encodeFunctionData({ abi: contractABI, functionName: "count" }), - }) - ).data; - - expect(BigInt(actualCalls!.toString())).to.eq(expectedCalls); - } - // Make sure descended address went below existential deposit and was killed - expect((await context.polkadotJs().query.assets.account(assetId, descendedAddress)).isNone) - .to.be.true; - // Even if the account does not exist in assets aymore, we still have a nonce 1. Reason is: - // - First transact withdrew 1/2 of assets, nonce was increased to 1. - // - Second transact withdrew the last 1/2 of assets, account was reaped and zeroed. - // - The subsequent evm execution increased the nonce to 1, even without sufficient - // references. - // We can expect this to be the behaviour on any xcm fragment that completely drains an - // account to transact ethereum-xcm after. - const nonce = await context.viem().getTransactionCount({ address: descendedAddress }); - expect(nonce).to.be.eq(1); - }, - }); - }, -}); diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-asset-transfer.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-asset-transfer.ts index d252d4768d..936be085b3 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-asset-transfer.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-asset-transfer.ts @@ -13,7 +13,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D014001", + id: "D013901", title: "Mock XCM - receive downward transfer", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -38,6 +38,8 @@ describeSuite({ // You can provide a message, but if you don't a downward transfer is the default await customDevRpcRequest("xcm_injectDownwardMessage", [[]]); + // Process the next block + await context.createBlock(); // Create a block in which the XCM will be executed await context.createBlock(); diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-1.ts index eb81415f75..0ee47b330b 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-1.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D014002", + id: "D013902", title: "Mock XCM V3 - downward transfer with non-triggered error handler", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -69,6 +69,8 @@ describeSuite({ // Send RPC call to inject XCM message await customDevRpcRequest("xcm_injectDownwardMessage", [totalMessage]); + // Process the next block + await context.createBlock(); // Create a block in which the XCM will be executed await context.createBlock(); // Make sure ALITH did not reveive anything diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-2.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-2.ts index 9193746a82..cdc74b05b9 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-2.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D014003", + id: "D013903", title: "Mock XCM V3 - downward transfer with triggered error handler", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -69,6 +69,8 @@ describeSuite({ // Send RPC call to inject XCM message await customDevRpcRequest("xcm_injectDownwardMessage", [totalMessage]); + // Process the next block + await context.createBlock(); // Create a block in which the XCM will be executed await context.createBlock(); // Make sure the state has ALITH's to DOT tokens diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-3.ts index 4fc56f6cc6..3af041dbff 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-3.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D014004", + id: "D013904", title: "Mock XCM V3 - downward transfer with always triggered appendix", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -66,6 +66,8 @@ describeSuite({ // Send RPC call to inject XCM message await customDevRpcRequest("xcm_injectDownwardMessage", [totalMessage]); + // Process the next block + await context.createBlock(); // Create a block in which the XCM will be executed await context.createBlock(); // Make sure the state has ALITH's to DOT tokens diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-4.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-4.ts index cc0cbcbe01..3b7dc73950 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-4.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D014005", + id: "D013905", title: "Mock XCM V3 - downward transfer with always triggered appendix", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -69,6 +69,8 @@ describeSuite({ // Send RPC call to inject XCM message await customDevRpcRequest("xcm_injectDownwardMessage", [totalMessage]); + // Process the next block + await context.createBlock(); // Create a block in which the XCM will be executed await context.createBlock(); // Make sure the state has ALITH's to DOT tokens diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-5.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-5.ts index 8266370622..9e5b759a07 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-5.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D014006", + id: "D013906", title: "Mock XCM V3 - downward transfer with always triggered appendix", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -69,6 +69,8 @@ describeSuite({ // Send RPC call to inject XCM message await customDevRpcRequest("xcm_injectDownwardMessage", [totalMessage]); + // Process the next block + await context.createBlock(); // Create a block in which the XCM will be executed await context.createBlock(); // Make sure the state has ALITH's to DOT tokens diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-6.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-6.ts index 3b72912181..88f16d2ad9 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-error-and-appendix-6.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D014007", + id: "D013907", title: "Mock XCM V3 - downward transfer claim trapped assets", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -62,6 +62,8 @@ describeSuite({ // Send RPC call to inject XCM message await customDevRpcRequest("xcm_injectDownwardMessage", [totalMessage]); + // Process the next block + await context.createBlock(); // Create a block in which the XCM will be executed await context.createBlock(); @@ -109,6 +111,8 @@ describeSuite({ // Send RPC call to inject XCM message await customDevRpcRequest("xcm_injectDownwardMessage", [totalMessage]); + // Process the next block + await context.createBlock(); // Create a block in which the XCM will be executed await context.createBlock(); // Make sure the state has ALITH's to DOT tokens diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-queue.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-queue.ts index f595a51c25..3dd92ab08e 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-queue.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-dmp-queue.ts @@ -1,221 +1,61 @@ import "@moonbeam-network/api-augment"; -import { customDevRpcRequest, describeSuite, expect } from "@moonwall/cli"; -import { GLMR } from "@moonwall/util"; -import type { XcmVersionedXcm } from "@polkadot/types/lookup"; -import { u8aToHex } from "@polkadot/util"; -import { XcmFragment, weightMessage } from "../../../../helpers"; +import { describeSuite, expect } from "@moonwall/cli"; describeSuite({ - id: "D014008", - title: "Mock XCMP - test XCMP execution", + id: "D013908", + title: "Test DMP migration (This test should be removed in RT3000", foundationMethods: "dev", testCases: ({ context, it, log }) => { it({ id: "T01", - title: "Should test DMP on_initialization and on_idle", + title: "Should test migration to Message Queue", test: async function () { - const metadata = await context.polkadotJs().rpc.state.getMetadata(); - const balancesPalletIndex = metadata.asLatest.pallets - .find(({ name }) => name.toString() == "Balances")! - .index.toNumber(); - - // TODO this test mostly changes it's nature due to proof size accounting - // by now we just decrease the number of supported messages from 50 to 20. - const numMsgs = 20; - // let's target half of then being executed - - // xcmp reserved is BLOCK/4 - const totalDmpWeight = - context.polkadotJs().consts.system.blockWeights.maxBlock.refTime.toBigInt() / 4n; - - // we want half of numParaMsgs to be executed. That give us how much each message weights - const weightPerMessage = (totalDmpWeight * BigInt(2)) / BigInt(numMsgs); - - // Now we need to construct the message. This needs to: - // - pass barrier (withdraw + buyExecution + unlimited buyExecution*n) - // we know at least 2 instructions are needed per message (withdrawAsset + buyExecution) - // how many unlimited buyExecutions do we need to append? - - // we will bias this number. The reason is we want to test the decay, and therefore we need - // an unbalanced number of messages executed. We specifically need that at some point - // we get out of the loop of the execution (we reach the threshold limit), to then - // go on idle - - const config = { - assets: [ - { - multilocation: { - parents: 0, - interior: { - X1: { PalletInstance: balancesPalletIndex }, - }, - }, - fungible: 1_000_000_000_000_000n, - }, - ], - }; + await context.createBlock(); - // How much does the withdraw weight? - const withdrawWeight = await weightMessage( - context, - context - .polkadotJs() - .createType("XcmVersionedXcm", new XcmFragment(config).withdraw_asset().as_v3()) + let events = (await context.polkadotJs().query.system.events()).filter(({ event }) => + context.polkadotJs().events.dmpQueue.StartedExport.is(event) ); + expect(events).to.have.lengthOf(1); - // How much does the buyExecution weight? - const buyExecutionWeight = await weightMessage( - context, - context - .polkadotJs() - .createType("XcmVersionedXcm", new XcmFragment(config).buy_execution().as_v3()) - ); + // Create new block + await context.createBlock(); - // How much does the refundSurplus weight? - // We use refund surplus because it has 0 pov - // it's easier to focus on reftime - const refundSurplusWeight = await weightMessage( - context, - context - .polkadotJs() - .createType("XcmVersionedXcm", new XcmFragment(config).refund_surplus().as_v3()) + events = (await context.polkadotJs().query.system.events()).filter(({ event }) => + context.polkadotJs().events.dmpQueue.CompletedExport.is(event) ); + expect(events).to.have.lengthOf(1); - const xcmMessage = new XcmFragment(config).withdraw_asset().buy_execution().as_v3(); - - const receivedMessage: XcmVersionedXcm = context - .polkadotJs() - .createType("XcmVersionedXcm", xcmMessage) as any; - - const totalMessage = [...receivedMessage.toU8a()]; - - // We want these isntructions to fail in BuyExecution. That means - // WithdrawAsset needs to work. The only way for this to work - // is to fund each sovereign account - const sovereignAddress = u8aToHex( - new Uint8Array([...new TextEncoder().encode("Parent")]) - ).padEnd(42, "0"); + // Create new block + await context.createBlock(); - // We first fund the parent sovereign account with 1000 - // we will only withdraw 1, so no problem on this - await context.createBlock( - context.polkadotJs().tx.balances.transferAllowDeath(sovereignAddress, 1n * GLMR), - { allowFailures: false } + events = (await context.polkadotJs().query.system.events()).filter(({ event }) => + context.polkadotJs().events.dmpQueue.StartedOverweightExport.is(event) ); + expect(events).to.have.lengthOf(1); - // now we start injecting messages - // several - for (let i = 0; i < numMsgs; i++) { - await customDevRpcRequest("xcm_injectDownwardMessage", [totalMessage]); - } - + // Create new block await context.createBlock(); - const signedBlock = await context.polkadotJs().rpc.chain.getBlock(); - const apiAt = await context.polkadotJs().at(signedBlock.block.header.hash); - const allRecords = await apiAt.query.system.events(); - - // lets grab at which point the dmp queue was exhausted - const exhaustIndex = allRecords.findIndex(({ event }) => - context.polkadotJs().events.dmpQueue.MaxMessagesExhausted.is(event) + events = (await context.polkadotJs().query.system.events()).filter(({ event }) => + context.polkadotJs().events.dmpQueue.CompletedOverweightExport.is(event) ); + expect(events).to.have.lengthOf(1); - expect( - exhaustIndex, - "Index not found where dmpQueue is exhausted" - ).to.be.greaterThanOrEqual(0); - - // OnInitialization - const eventsExecutedOnInitialization = allRecords.filter( - ({ event }, index) => - context.polkadotJs().events.dmpQueue.ExecutedDownward.is(event) && index < exhaustIndex - ); + // Create new block + await context.createBlock(); - // OnIdle - const eventsExecutedOnIdle = allRecords.filter( - ({ event }, index) => - context.polkadotJs().events.dmpQueue.ExecutedDownward.is(event) && index > exhaustIndex + events = (await context.polkadotJs().query.system.events()).filter(({ event }) => + context.polkadotJs().events.dmpQueue.StartedCleanup.is(event) ); + expect(events).to.have.lengthOf(1); - // the test was designed to go half and half - expect(eventsExecutedOnInitialization.length).to.be.eq(10); - expect(eventsExecutedOnIdle.length).to.be.eq(10); - const pageIndex = await apiAt.query.dmpQueue.pageIndex(); - expect(pageIndex.beginUsed.toBigInt()).to.eq(0n); - expect(pageIndex.endUsed.toBigInt()).to.eq(0n); - - // Repeat the test with different parameters - { - const xcmMessage = new XcmFragment(config) - .withdraw_asset() - .buy_execution(0, 5n) - .refund_surplus() - .as_v3(); - - const receivedMessage: XcmVersionedXcm = context - .polkadotJs() - .createType("XcmVersionedXcm", xcmMessage) as any; - - const totalMessage = [...receivedMessage.toU8a()]; - - // We want these isntructions to fail in BuyExecution. That means - // WithdrawAsset needs to work. The only way for this to work - // is to fund each sovereign account - const sovereignAddress = u8aToHex( - new Uint8Array([...new TextEncoder().encode("Parent")]) - ).padEnd(42, "0"); - - // We first fund the parent sovereign account with 1000 - // we will only withdraw 1, so no problem on this - await context.createBlock( - context.polkadotJs().tx.balances.transferAllowDeath(sovereignAddress, 1n * GLMR), - { allowFailures: false } - ); - - // now we start injecting messages - // several - for (let i = 0; i < numMsgs; i++) { - await customDevRpcRequest("xcm_injectDownwardMessage", [totalMessage]); - } - - await context.createBlock(); - - const signedBlock = await context.polkadotJs().rpc.chain.getBlock(); - const apiAt = await context.polkadotJs().at(signedBlock.block.header.hash); - console.log("signedBlock", signedBlock.block.header.hash.toHex()); - const allRecords = await apiAt.query.system.events(); - - // lets grab at which point the dmp queue was exhausted - const exhaustIndex = allRecords.findIndex(({ event }) => - context.polkadotJs().events.dmpQueue.MaxMessagesExhausted.is(event) - ); - - expect( - exhaustIndex, - "Index not found where dmpQueue is exhausted" - ).to.be.greaterThanOrEqual(0); - - // OnInitialization - const eventsExecutedOnInitialization = allRecords.filter( - ({ event }, index) => - context.polkadotJs().events.dmpQueue.ExecutedDownward.is(event) && - index < exhaustIndex - ); - - // OnIdle - const eventsExecutedOnIdle = allRecords.filter( - ({ event }, index) => - context.polkadotJs().events.dmpQueue.ExecutedDownward.is(event) && - index > exhaustIndex - ); + // Create new block + await context.createBlock(); - // the test was designed to go half and half - expect(eventsExecutedOnInitialization.length).to.be.eq(10); - expect(eventsExecutedOnIdle.length).to.be.eq(10); - const pageIndex = await apiAt.query.dmpQueue.pageIndex(); - expect(pageIndex.beginUsed.toBigInt()).to.eq(0n); - expect(pageIndex.endUsed.toBigInt()).to.eq(0n); - } + events = (await context.polkadotJs().query.system.events()).filter(({ event }) => + context.polkadotJs().events.dmpQueue.Completed.is(event) + ); + expect(events).to.have.lengthOf(1); }, }); }, diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-1.ts index fd717981c6..ef7143b891 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-1.ts @@ -16,7 +16,7 @@ const assetMetadata = { }; describeSuite({ - id: "D014009", + id: "D013909", title: "Mock XCM - receive horizontal transfer", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -41,9 +41,10 @@ describeSuite({ // You can provide a message, but if you don't a horizontal transfer is the default await customDevRpcRequest("xcm_injectHrmpMessage", [foreign_para_id, []]); + // Process the next block + await context.createBlock(); // Create a block in which the XCM will be executed await context.createBlock(); - // Make sure the state has ALITH's foreign parachain tokens const alith_dot_balance = ( await context.polkadotJs().query.assets.account(assetId, alith.address) diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-2.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-2.ts index 97c05976b0..159a0dcb76 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-2.ts @@ -34,7 +34,7 @@ const STATEMINT_LOCATION = { }; describeSuite({ - id: "D014010", + id: "D013910", title: "Mock XCM - receive horizontal transfer", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-3.ts index e83956a551..396738ca1c 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-3.ts @@ -35,7 +35,7 @@ const STATEMINT_LOCATION = { }; describeSuite({ - id: "D014011", + id: "D013911", title: "Mock XCM - receive horizontal transfer", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-4.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-4.ts index 535d3fa45a..6e1cc18cc9 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-4.ts @@ -13,7 +13,7 @@ import { const foreign_para_id = 2000; describeSuite({ - id: "D014012", + id: "D013912", title: "Mock XCM - receive horizontal transfer of DEV", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-5.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-5.ts index a21e96f9dc..d906c73f63 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-5.ts @@ -14,7 +14,7 @@ import { const foreign_para_id = 2000; describeSuite({ - id: "D014013", + id: "D013913", title: "Mock XCM - receive horizontal transfer of DEV with new reanchor", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-6.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-6.ts index 9545f22386..dccbf7144b 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-6.ts @@ -48,7 +48,7 @@ const STATEMINT_ASSET_ONE_LOCATION = { }; describeSuite({ - id: "D014014", + id: "D013914", title: "Mock XCM - receive horizontal transfer", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-8.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-8.ts index 2ac2355a7f..7b34ede26e 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-8.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-asset-transfer-8.ts @@ -33,7 +33,7 @@ const STATEMINT_LOCATION = { }; describeSuite({ - id: "D014015", + id: "D013915", title: "Mock XCM - receive horizontal transfer", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-1.ts index c61b66f624..bbbc3b3244 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-1.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014016", + id: "D013916", title: "Mock XCM - receive horizontal transact", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-2.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-2.ts index cb72164599..5d2a7626a7 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-2.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014017", + id: "D013917", title: "Mock XCM - receive horizontal transact with two Descends", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-3.ts index b9ea91155d..28fb0ff56f 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-3.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014018", + id: "D013918", title: "Mock XCM - receive horizontal transact without withdraw", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-4.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-4.ts index ac87273503..63c77cb791 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-4.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014019", + id: "D013919", title: "Mock XCM - receive horizontal transact without buy execution", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts index 8d25f0ba70..d0b1583355 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-1.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014020", + id: "D013920", title: "Mock XCM - receive horizontal transact ETHEREUM (transfer)", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-10.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-10.ts index 912615496d..504fafdb5a 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-10.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-10.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014021", + id: "D013921", title: "Mock XCM - transact ETHEREUM input size check succeeds", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-11.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-11.ts index 912c37c04a..3b7739bc1b 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-11.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-11.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014022", + id: "D013922", title: "Mock XCM - transact ETHEREUM input size check fails", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts index 43d3fac4f7..1b7844926b 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-12.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014023", + id: "D013923", title: "Mock XCM - receive horizontal transact ETHEREUM (transfer)", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -149,9 +149,7 @@ describeSuite({ const weightBlock = await context.polkadotJs().query.system.blockWeight(); // Make sure the system block weight corresponds to gas used and not gas limit // It should be sufficient to verify that we used less than what was marked - expect( - 12_500_000_000n + 25_000_000n - weightBlock.mandatory.refTime.toBigInt() - ).toBeGreaterThan(0n); + expect(targetXcmWeight - weightBlock.mandatory.refTime.toBigInt()).toBeGreaterThan(0n); } }, }); diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-2.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-2.ts index 29a70f1a48..96708a9450 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-2.ts @@ -12,7 +12,7 @@ import { import { GAS_LIMIT_POV_RATIO } from "@moonwall/util"; describeSuite({ - id: "D014024", + id: "D013924", title: "Mock XCM - receive horizontal transact ETHEREUM (call)", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts index e73671a4c3..edb066299c 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-3.ts @@ -16,7 +16,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014025", + id: "D013925", title: "Mock XCM - receive horizontal transact ETHEREUM (asset fee)", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-4.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-4.ts index a83eb0efde..34409abc95 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-4.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014026", + id: "D013926", title: "Mock XCM - receive horizontal transact ETHEREUM (proxy)", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-5.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-5.ts index 642927dbd2..349c060501 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-5.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014027", + id: "D013927", title: "Mock XCM - receive horizontal transact ETHEREUM (proxy)", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts index 90ee12553f..adb18dcffe 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-6.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014028", + id: "D013928", title: "Mock XCM - receive horizontal transact ETHEREUM (proxy)", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-7.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-7.ts index 0947a33195..dfca714d97 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-7.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-7.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014029", + id: "D013929", title: "Mock XCM - transact ETHEREUM (proxy) disabled switch", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-8.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-8.ts index 762cb8a157..4ac342b227 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-8.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-8.ts @@ -11,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D014030", + id: "D013930", title: "Mock XCM - transact ETHEREUM (non-proxy) disabled switch", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-9.ts b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-9.ts index ed980bdcab..9a9235230f 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-9.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-mock-hrmp-transact-ethereum-9.ts @@ -3,7 +3,7 @@ import { describeSuite, expect } from "@moonwall/cli"; import { alith } from "@moonwall/util"; describeSuite({ - id: "D014031", + id: "D013931", title: "Mock XCM - EthereumXcm only disable by root", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-data-field-size.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-data-field-size.ts index 6261801365..1b753559c9 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-data-field-size.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-data-field-size.ts @@ -11,7 +11,7 @@ import { parseEther } from "ethers"; export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; describeSuite({ - id: "D014032", + id: "D013932", title: "Mock ERC20 <> XCM - Test wrong size of GeneralKey data field", foundationMethods: "dev", testCases: ({ context, it }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-excess-gas.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-excess-gas.ts index 3c95fc41c3..0ebef78224 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-excess-gas.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-excess-gas.ts @@ -14,7 +14,7 @@ import { export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; describeSuite({ - id: "D014033", + id: "D013933", title: "Mock XCM - Test bad contract with excess gas usage", foundationMethods: "dev", testCases: ({ context, it }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-fees-and-trap.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-fees-and-trap.ts index c11887789c..cfdd3966aa 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-fees-and-trap.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-fees-and-trap.ts @@ -6,7 +6,6 @@ import { expectEVMResult } from "../../../../helpers"; import { XcmFragment, XcmFragmentConfig, - expectXcmEventMessage, injectHrmpMessageAndSeal, sovereignAccountOfSibling, weightMessage, @@ -15,7 +14,7 @@ import { export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; describeSuite({ - id: "D014034", + id: "D013934", title: "Mock XCM - Fails trying to pay fees with ERC20", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -109,7 +108,16 @@ describeSuite({ payload: xcmMessage, }); - expect(await expectXcmEventMessage(context, "TooExpensive")).toBe(true); + const events = (await polkadotJs.query.system.events()) + .filter(({ event }) => polkadotJs.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => !success); + + expect(events).to.have.lengthOf(1); + // pallet-message-queue does not show an error when "success" is false. + // https://github.com/paritytech/polkadot-sdk/issues/478 + // > + // expect(await expectXcmEventMessage(context, "TooExpensive")).toBe(true); // Charleth should not receive ERC20 tokens due to failed execution expect( @@ -323,7 +331,16 @@ describeSuite({ payload: xcmMessageFailedClaim, }); - expect(await expectXcmEventMessage(context, "UnknownClaim")).toBe(true); + const events2 = (await context.polkadotJs().query.system.events()) + .filter(({ event }) => context.polkadotJs().events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => !success); + + expect(events2).to.have.lengthOf(1); + // pallet-message-queue does not show an error when "success" is false. + // https://github.com/paritytech/polkadot-sdk/issues/478 + // > + // expect(await expectXcmEventMessage(context, "UnknownClaim")).toBe(true); // Check the sovereign account has the same initial amount of ERC20 tokens expect( diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3-filter.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3-filter.ts index 0c4fb559a4..ae924ab780 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3-filter.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3-filter.ts @@ -13,7 +13,7 @@ import { export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; describeSuite({ - id: "D014035", + id: "D013935", title: "Mock XCM V3 - XCM Weight Limit", foundationMethods: "dev", testCases: ({ context, it }) => { @@ -122,12 +122,10 @@ describeSuite({ }); const allRecords = await polkadotJs.query.system.events(); - const [{ event }] = allRecords.filter( - ({ event: { section, method } }) => - section === "xcmpQueue" && method === "OverweightEnqueued" - ); - const [_paraId, _messageId, _weight, proof] = event.data; - return proof.proofSize.toNumber(); + const [{ weightUsed }] = allRecords + .filter(({ event }) => polkadotJs.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data as unknown as { weightUsed: { proofSize: unknown } }); + return Number(weightUsed.proofSize); }; const limit = 64n; diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3.ts index f35905ce6c..e0be375669 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-erc20-v3.ts @@ -13,7 +13,7 @@ import { export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; describeSuite({ - id: "D014036", + id: "D013936", title: "Mock XCM V3 - Receive erc20 via XCM", foundationMethods: "dev", testCases: ({ context, it }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-1.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-1.ts index 92e234cd20..fbee46a97c 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-1.ts @@ -3,7 +3,7 @@ import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { alith } from "@moonwall/util"; describeSuite({ - id: "D014037", + id: "D013937", title: "Precompiles - xcm transactor", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-2.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-2.ts index e732c2c753..59ffe53f99 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcm-transactor-2.ts @@ -2,7 +2,7 @@ import "@moonbeam-network/api-augment"; import { describeSuite, expect, dispatchAsGeneralAdmin } from "@moonwall/cli"; describeSuite({ - id: "D014038", + id: "D013938", title: "Precompiles - xcm transactor", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-max-weight-instructions.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-max-weight-instructions.ts index 7aed369efe..1a7d4f7df9 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-max-weight-instructions.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-max-weight-instructions.ts @@ -5,33 +5,34 @@ import { alith, CHARLETH_ADDRESS } from "@moonwall/util"; import { XcmFragment, RawXcmMessage, - injectHrmpMessage, sovereignAccountOfSibling, XcmFragmentConfig, + injectHrmpMessageAndSeal, } from "../../../../helpers/xcm.js"; import { parseEther } from "ethers"; +import { ApiPromise } from "@polkadot/api"; describeSuite({ - id: "D014039", + id: "D013939", title: "XCM V3 - Max Weight Instructions", foundationMethods: "dev", testCases: ({ context, it, log }) => { let dotAsset: XcmFragmentConfig; let amount: bigint; const paraId: number = 888; + let api: ApiPromise; beforeAll(async () => { + api = await context.polkadotJs(); + const paraSovereign = sovereignAccountOfSibling(context, paraId); - const metadata = await context.polkadotJs().rpc.state.getMetadata(); + const metadata = await api.rpc.state.getMetadata(); const balancesPalletIndex = metadata.asLatest.pallets .find(({ name }) => name.toString() === "Balances")! .index.toNumber(); // Send some native tokens to the sovereign account of paraId (to pay fees) - await context - .polkadotJs() - .tx.balances.transferAllowDeath(paraSovereign, parseEther("1")) - .signAndSend(alith); + await api.tx.balances.transferAllowDeath(paraSovereign, parseEther("1")).signAndSend(alith); await context.createBlock(); amount = 1_000_000_000_000_000n; @@ -62,18 +63,18 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for WeightNotComputable error - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.ProcessingFailed.is(event)) + .map((e) => e.event.data.toHuman() as { error: string }); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("WeightNotComputable"); + expect(events[0].error).equals("Unsupported"); }, }); @@ -88,18 +89,18 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for WeightNotComputable error - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.ProcessingFailed.is(event)) + .map((e) => e.event.data.toHuman() as { error: string }); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("WeightNotComputable"); + expect(events[0].error).equals("Unsupported"); }, }); @@ -114,18 +115,18 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for WeightNotComputable error - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.ProcessingFailed.is(event)) + .map((e) => e.event.data.toHuman() as { error: string }); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("WeightNotComputable"); + expect(events[0].error).equals("Unsupported"); }, }); @@ -140,18 +141,18 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for WeightNotComputable error - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.ProcessingFailed.is(event)) + .map((e) => e.event.data.toHuman() as { error: string }); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("WeightNotComputable"); + expect(events[0].error).equals("Unsupported"); }, }); @@ -166,18 +167,18 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for WeightNotComputable error - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.ProcessingFailed.is(event)) + .map((e) => e.event.data.toHuman() as { error: string }); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("WeightNotComputable"); + expect(events[0].error).equals("Unsupported"); }, }); @@ -192,18 +193,18 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for WeightNotComputable error - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.ProcessingFailed.is(event)) + .map((e) => e.event.data.toHuman() as { error: string }); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("WeightNotComputable"); + expect(events[0].error).equals("Unsupported"); }, }); @@ -218,18 +219,18 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for WeightNotComputable error - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.ProcessingFailed.is(event)) + .map((e) => e.event.data.toHuman() as { error: string }); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("WeightNotComputable"); + expect(events[0].error).equals("Unsupported"); }, }); }, diff --git a/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-new-instructions.ts b/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-new-instructions.ts index b38abf6cf9..17a9c7ceb3 100644 --- a/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-new-instructions.ts +++ b/test/suites/dev/moonbase/test-xcm-v3/test-xcmv3-new-instructions.ts @@ -1,40 +1,40 @@ -import "@moonbeam-network/api-augment"; +import "@moonbeam-network/api-augment/moonbase"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; import { alith, CHARLETH_ADDRESS } from "@moonwall/util"; import { XcmFragment, RawXcmMessage, - injectHrmpMessage, sovereignAccountOfSibling, XcmFragmentConfig, + injectHrmpMessageAndSeal, } from "../../../../helpers/xcm.js"; import { parseEther } from "ethers"; +import { ApiPromise } from "@polkadot/api"; // Here we are testing each allowed instruction to be executed. Even if some of them throw an error, // the important thing (and what we are testing) is that they are // executed and are not blocked with 'WeightNotComputable' due to using max weight. describeSuite({ - id: "D014040", + id: "D013940", title: "XCM V3 - Max Weight Instructions", foundationMethods: "dev", testCases: ({ context, it, log }) => { let dotAsset: XcmFragmentConfig; let amount: bigint; const paraId: number = 888; + let api: ApiPromise; beforeAll(async () => { + api = await context.polkadotJs(); const paraSovereign = sovereignAccountOfSibling(context, paraId); - const metadata = await context.polkadotJs().rpc.state.getMetadata(); + const metadata = await api.rpc.state.getMetadata(); const balancesPalletIndex = metadata.asLatest.pallets .find(({ name }) => name.toString() === "Balances")! .index.toNumber(); // Send some native tokens to the sovereign account of paraId (to pay fees) - await context - .polkadotJs() - .tx.balances.transferAllowDeath(paraSovereign, parseEther("1")) - .signAndSend(alith); + await api.tx.balances.transferAllowDeath(paraSovereign, parseEther("1")).signAndSend(alith); await context.createBlock(); amount = 1_000_000_000_000_000n; @@ -65,16 +65,17 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Success.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => success); + expect(events).to.have.lengthOf(1); }, }); @@ -90,16 +91,17 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Success.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => success); + expect(events).to.have.lengthOf(1); }, }); @@ -115,16 +117,17 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Success.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => success); + expect(events).to.have.lengthOf(1); }, }); @@ -140,16 +143,17 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Success.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => success); + expect(events).to.have.lengthOf(1); }, }); @@ -165,16 +169,17 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Success.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => success); + expect(events).to.have.lengthOf(1); }, }); @@ -191,23 +196,24 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Success.is(event) - ); + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => success); + expect(events).to.have.lengthOf(1); }, }); it({ id: "T07", - title: "Should execute ReportHolding (Transport)", + title: "Should fail to execute ReportHolding (Transport)", test: async function () { const xcmMessage = new XcmFragment(dotAsset) .withdraw_asset() @@ -216,24 +222,28 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); - // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + // Search for failure + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => !success); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("Transport"); + // pallet-message-queue does not show an error when "success" is false. + // https://github.com/paritytech/polkadot-sdk/issues/478 + // > + // expect(events[0].event.data[2].toString()).equals("Transport"); }, }); it({ id: "T08", - title: "Should execute ExpectAsset (ExpectationFalse)", + title: "Should fail to execute ExpectAsset (ExpectationFalse)", test: async function () { const xcmMessage = new XcmFragment(dotAsset) .withdraw_asset() @@ -242,24 +252,28 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); - // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + // Search for failure + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => !success); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("ExpectationFalse"); + // pallet-message-queue does not show an error when "success" is false. + // https://github.com/paritytech/polkadot-sdk/issues/478 + // > + // expect(events[0].event.data[2].toString()).equals("ExpectationFalse"); }, }); it({ id: "T09", - title: "Should execute ExpectOrigin (ExpectationFalse)", + title: "Should fail to execute ExpectOrigin (ExpectationFalse)", test: async function () { const xcmMessage = new XcmFragment(dotAsset) .withdraw_asset() @@ -268,24 +282,28 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); - // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + // Search for failure + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => !success); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("ExpectationFalse"); + // pallet-message-queue does not show an error when "success" is false. + // https://github.com/paritytech/polkadot-sdk/issues/478 + // > + // expect(events[0].event.data[2].toString()).equals("ExpectationFalse"); }, }); it({ id: "T10", - title: "Should execute ExpectError (ExpectationFalse)", + title: "Should fail to execute ExpectError (ExpectationFalse)", test: async function () { const xcmMessage = new XcmFragment(dotAsset) .withdraw_asset() @@ -294,24 +312,28 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); - // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + // Search for failure + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => !success); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("ExpectationFalse"); + // pallet-message-queue does not show an error when "success" is false. + // https://github.com/paritytech/polkadot-sdk/issues/478 + // > + // expect(events[0].event.data[2].toString()).equals("ExpectationFalse"); }, }); it({ id: "T11", - title: "Should execute QueryPallet (Transport)", + title: "Should fail to execute QueryPallet (Transport)", test: async function () { const xcmMessage = new XcmFragment(dotAsset) .withdraw_asset() @@ -320,24 +342,28 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); - // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + // Search for failure + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => !success); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("Transport"); + // pallet-message-queue does not show an error when "success" is false. + // https://github.com/paritytech/polkadot-sdk/issues/478 + // > + // expect(events[0].event.data[2].toString()).equals("Transport"); }, }); it({ id: "T12", - title: "Should execute ExpectPallet (NameMismatch)", + title: "Should fail to execute ExpectPallet (NameMismatch)", test: async function () { const xcmMessage = new XcmFragment(dotAsset) .withdraw_asset() @@ -346,24 +372,28 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); - // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + // Search for failure + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => !success); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("NameMismatch"); + // pallet-message-queue does not show an error when "success" is false. + // https://github.com/paritytech/polkadot-sdk/issues/478 + // > + // expect(events[0].event.data[2].toString()).equals("NameMismatch"); }, }); it({ id: "T13", - title: "Should execute ReportTransactStatus (Transport)", + title: "Should fail to execute ReportTransactStatus (Transport)", test: async function () { const xcmMessage = new XcmFragment(dotAsset) .withdraw_asset() @@ -372,24 +402,28 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); - // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + // Search for failure + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => !success); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("Transport"); + // pallet-message-queue does not show an error when "success" is false. + // https://github.com/paritytech/polkadot-sdk/issues/478 + // > + // expect(events[0].event.data[2].toString()).equals("Transport"); }, }); it({ id: "T14", - title: "Should execute UnpaidExecution (BadOrigin)", + title: "Should fail to execute UnpaidExecution (BadOrigin)", test: async function () { const xcmMessage = new XcmFragment(dotAsset) .withdraw_asset() @@ -398,18 +432,22 @@ describeSuite({ .as_v3(); // Mock the reception of the xcm message - await injectHrmpMessage(context, paraId, { + await injectHrmpMessageAndSeal(context, paraId, { type: "XcmVersionedXcm", payload: xcmMessage, } as RawXcmMessage); - await context.createBlock(); - // Search for Success - const events = (await context.polkadotJs().query.system.events()).filter(({ event }) => - context.polkadotJs().events.xcmpQueue.Fail.is(event) - ); + // Search for failure + const events = (await api.query.system.events()) + .filter(({ event }) => api.events.messageQueue.Processed.is(event)) + .map((e) => e.event.data.toHuman() as { success: boolean }) + .filter(({ success }) => !success); + expect(events).to.have.lengthOf(1); - expect(events[0].event.data[2].toString()).equals("BadOrigin"); + // pallet-message-queue does not show an error when "success" is false. + // https://github.com/paritytech/polkadot-sdk/issues/478 + // > + // expect(events[0].event.data[2].toString()).equals("BadOrigin"); }, }); }, diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-1.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-1.ts similarity index 96% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-1.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-1.ts index 4e3a266637..db313dd93e 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-1.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D013901", + id: "D014001", title: "Mock XCM V3 - downward transfer with non-triggered error handler", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -56,10 +56,10 @@ describeSuite({ // But since there is no error, and the deposit is on the error handler, the assets // will be trapped .with(function () { - return this.set_error_handler_with([this.deposit_asset]); + return this.set_error_handler_with([this.deposit_asset_v3]); }) .clear_origin() - .as_v2(); + .as_v4(); const receivedMessage: XcmVersionedXcm = context .polkadotJs() @@ -71,6 +71,7 @@ describeSuite({ // Create a block in which the XCM will be executed await context.createBlock(); + await context.createBlock(); // Make sure ALITH did not reveive anything const alith_dot_balance = await context .polkadotJs() diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-2.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-2.ts similarity index 96% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-2.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-2.ts index ff3f249255..85ec0e1280 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-2.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D013902", + id: "D014002", title: "Mock XCM V3 - downward transfer with triggered error handler", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -55,10 +55,10 @@ describeSuite({ // BuyExecution does not charge for fees because we registered it for not doing so // As a consequence the trapped assets will be entirely credited .with(function () { - return this.set_error_handler_with([this.deposit_asset]); + return this.set_error_handler_with([this.deposit_asset_v3]); }) .trap() - .as_v2(); + .as_v4(); const receivedMessage: XcmVersionedXcm = context .polkadotJs() @@ -71,6 +71,7 @@ describeSuite({ // Create a block in which the XCM will be executed await context.createBlock(); + await context.createBlock(); // Make sure the state has ALITH's to DOT tokens const alith_dot_balance = ( await context.polkadotJs().query.assets.account(assetId, alith.address) diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-3.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-3.ts similarity index 94% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-3.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-3.ts index 9eb27e65f8..b5dee2ffe8 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-3.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D013903", + id: "D014003", title: "Mock XCM V3 - downward transfer with always triggered appendix", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -54,9 +54,9 @@ describeSuite({ .buy_execution() // Set an appendix to be executed after the XCM message is executed. No matter if errors .with(function () { - return this.set_appendix_with([this.deposit_asset]); + return this.set_appendix_with([this.deposit_asset_v3]); }) - .as_v2(); + .as_v4(); const receivedMessage: XcmVersionedXcm = context .polkadotJs() @@ -68,6 +68,7 @@ describeSuite({ // Create a block in which the XCM will be executed await context.createBlock(); + await context.createBlock(); // Make sure the state has ALITH's to DOT tokens const alith_dot_balance = ( await context.polkadotJs().query.assets.account(assetId, alith.address) diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-4.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-4.ts similarity index 94% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-4.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-4.ts index 2e9bf66a55..8293e70f81 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-4.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D013904", + id: "D014004", title: "Mock XCM V3 - downward transfer with always triggered appendix", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -56,10 +56,10 @@ describeSuite({ // As a consequence the trapped assets will be entirely credited // The goal is to show appendix runs even if there is an error .with(function () { - return this.set_appendix_with([this.deposit_asset]); + return this.set_appendix_with([this.deposit_asset_v3]); }) .trap() - .as_v2(); + .as_v4(); const receivedMessage: XcmVersionedXcm = context .polkadotJs() @@ -71,6 +71,7 @@ describeSuite({ // Create a block in which the XCM will be executed await context.createBlock(); + await context.createBlock(); // Make sure the state has ALITH's to DOT tokens const alith_dot_balance = ( await context.polkadotJs().query.assets.account(assetId, alith.address) diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-5.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-5.ts similarity index 94% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-5.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-5.ts index afd0b36304..86fce6e905 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-5.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D013905", + id: "D014005", title: "Mock XCM V3 - downward transfer with always triggered appendix", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -56,10 +56,10 @@ describeSuite({ // As a consequence the trapped assets will be entirely credited // The goal is to show appendix runs even if there is an error .with(function () { - return this.set_appendix_with([this.deposit_asset]); + return this.set_appendix_with([this.deposit_asset_v3]); }) .trap() - .as_v2(); + .as_v4(); const receivedMessage: XcmVersionedXcm = context .polkadotJs() @@ -71,6 +71,7 @@ describeSuite({ // Create a block in which the XCM will be executed await context.createBlock(); + await context.createBlock(); // Make sure the state has ALITH's to DOT tokens const alith_dot_balance = ( await context.polkadotJs().query.assets.account(assetId, alith.address) diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-6.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-6.ts similarity index 94% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-6.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-6.ts index c594ac7b8f..3f30d44db2 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-dmp-error-and-appendix-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-dmp-error-and-appendix-6.ts @@ -15,7 +15,7 @@ const RELAY_TOKEN = 1_000_000_000_000n; const palletId = "0x6D6f646c617373746d6E67720000000000000000"; describeSuite({ - id: "D013906", + id: "D014006", title: "Mock XCM V3 - downward transfer claim trapped assets", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -34,7 +34,7 @@ describeSuite({ // BuyExecution does not charge for fees because we registered it for not doing so // But since there is no error, and the deposit is on the error handler, the assets // will be trapped. - // Goal is to trapp assets, so that later can be claimed + // Goal is to trap assets, so that later can be claimed // Since we only BuyExecution, but we do not do anything with the assets after that, // they are trapped const xcmMessage = new XcmFragment({ @@ -52,7 +52,7 @@ describeSuite({ }) .reserve_asset_deposited() .buy_execution() - .as_v2(); + .as_v4(); const receivedMessage: XcmVersionedXcm = context .polkadotJs() @@ -64,6 +64,7 @@ describeSuite({ // Create a block in which the XCM will be executed await context.createBlock(); + await context.createBlock(); // Make sure ALITH did not reveive anything const alith_dot_balance = await context @@ -97,8 +98,8 @@ describeSuite({ .claim_asset() .buy_execution() // Deposit assets, this time correctly, on Alith - .deposit_asset() - .as_v2(); + .deposit_asset_v3() + .as_v4(); const receivedMessage: XcmVersionedXcm = context .polkadotJs() @@ -111,6 +112,7 @@ describeSuite({ // Create a block in which the XCM will be executed await context.createBlock(); + await context.createBlock(); // Make sure the state has ALITH's to DOT tokens const alith_dot_balance = ( await context.polkadotJs().query.assets.account(assetId, alith.address) diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-1.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-1.ts similarity index 97% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-1.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-1.ts index 1a29a86ed1..cfe9400920 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-1.ts @@ -34,7 +34,7 @@ const STATEMINT_LOCATION = { }; describeSuite({ - id: "D013908", + id: "D014007", title: "Mock XCM - receive horizontal transfer", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -78,8 +78,8 @@ describeSuite({ .reserve_asset_deposited() .clear_origin() .buy_execution() - .deposit_asset() - .as_v2(); + .deposit_asset_v3() + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, statemint_para_id, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-2.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-2.ts similarity index 94% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-2.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-2.ts index 74620dbb2f..347bace758 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-2.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { alith } from "@moonwall/util"; import { registerForeignAsset, @@ -36,7 +35,7 @@ const STATEMINT_LOCATION = { }; describeSuite({ - id: "D013909", + id: "D014008", title: "Mock XCM - receive horizontal transfer", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -81,14 +80,17 @@ describeSuite({ fungible: 10000000000000n, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, beneficiary: alith.address, }) .reserve_asset_deposited() .clear_origin() .buy_execution() - .deposit_asset() - .as_v2(); + .deposit_asset_v3() + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, statemint_para_id, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-3.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-3.ts similarity index 94% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-3.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-3.ts index 6679279391..b825c6394b 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-3.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair } from "@moonwall/util"; import { @@ -14,7 +13,7 @@ import { const foreign_para_id = 2000; describeSuite({ - id: "D013910", + id: "D014009", title: "Mock XCM - receive horizontal transfer of DEV", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -65,14 +64,17 @@ describeSuite({ fungible: transferredBalance, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, beneficiary: random.address, }) .withdraw_asset() .clear_origin() .buy_execution() - .deposit_asset() - .as_v2(); + .deposit_asset_v3() + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, foreign_para_id, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-4.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-4.ts similarity index 95% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-4.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-4.ts index 432596e6aa..c9fa11a199 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-4.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair } from "@moonwall/util"; import { @@ -15,7 +14,7 @@ import { const foreign_para_id = 2000; describeSuite({ - id: "D013911", + id: "D014010", title: "Mock XCM - receive horizontal transfer of DEV with new reanchor", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -64,14 +63,17 @@ describeSuite({ fungible: transferredBalance, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, beneficiary: random.address, }) .withdraw_asset() .clear_origin() .buy_execution() - .deposit_asset() - .as_v2(); + .deposit_asset_v3() + .as_v4(); const chargedWeight = await weightMessage( context, diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-5.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-5.ts similarity index 95% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-5.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-5.ts index 54a860acff..d553611eda 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-5.ts @@ -1,8 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; - import { alith } from "@moonwall/util"; import { @@ -50,7 +48,7 @@ const STATEMINT_ASSET_ONE_LOCATION = { }; describeSuite({ - id: "D013912", + id: "D014011", title: "Mock XCM - receive horizontal transfer", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -106,14 +104,17 @@ describeSuite({ fungible: 10000000000000n, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, beneficiary: alith.address, }) .reserve_asset_deposited() .clear_origin() .buy_execution(1) // buy execution with asset at index 1 - .deposit_asset(2n) - .as_v2(); + .deposit_asset_v3(2n) + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, statemint_para_id, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-6.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-6.ts similarity index 93% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-6.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-6.ts index e1ddcc6480..99244c31ab 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-asset-transfer-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-asset-transfer-6.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { alith } from "@moonwall/util"; import { registerForeignAsset, @@ -34,7 +33,7 @@ const STATEMINT_LOCATION = { }; describeSuite({ - id: "D013913", + id: "D014012", title: "Mock XCM - receive horizontal transfer", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -67,14 +66,17 @@ describeSuite({ fungible: 10000000000000n, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, beneficiary: alith.address, }) .reserve_asset_deposited() .clear_origin() .buy_execution() - .deposit_asset(2n) - .as_v2(); + .deposit_asset_v3(2n) + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, statemint_para_id, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-1.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-1.ts similarity index 90% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-1.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-1.ts index f02c040df3..6377fa5761 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-1.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair } from "@moonwall/util"; import { @@ -12,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013914", + id: "D014013", title: "Mock XCM - receive horizontal transact", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -68,7 +67,10 @@ describeSuite({ fungible: transferredBalance / 2n, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -76,14 +78,17 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", - requireWeightAtMost: new BN(1000000000), + originKind: "SovereignAccount", + requireWeightAtMost: { + refTime: 1000000000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-2.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-2.ts similarity index 90% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-2.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-2.ts index a86202a9e0..5490d45a1b 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-2.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair } from "@moonwall/util"; import { @@ -12,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013915", + id: "D014014", title: "Mock XCM - receive horizontal transact with two Descends", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -68,7 +67,10 @@ describeSuite({ fungible: transferredBalance / 2n, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -77,14 +79,17 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", - requireWeightAtMost: new BN(1000000000), + originKind: "SovereignAccount", + requireWeightAtMost: { + refTime: 1000000000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-3.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-3.ts similarity index 90% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-3.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-3.ts index ec60a3669f..d5266ed9da 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-3.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-3.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair } from "@moonwall/util"; import { @@ -12,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013916", + id: "D014015", title: "Mock XCM - receive horizontal transact without withdraw", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -68,21 +67,27 @@ describeSuite({ fungible: transferredBalance / 2n, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", - requireWeightAtMost: new BN(1000000000), + originKind: "SovereignAccount", + requireWeightAtMost: { + refTime: 1000000000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-4.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-4.ts similarity index 90% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-4.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-4.ts index d67fc00ce9..26a99d5c4b 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-4.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair } from "@moonwall/util"; import { @@ -12,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013917", + id: "D014016", title: "Mock XCM - receive horizontal transact without buy execution", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -68,21 +67,27 @@ describeSuite({ fungible: transferredBalance / 2n, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() .withdraw_asset() .push_any({ Transact: { - originType: "SovereignAccount", - requireWeightAtMost: new BN(1000000000), + originKind: "SovereignAccount", + requireWeightAtMost: { + refTime: 1000000000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-1.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-1.ts similarity index 93% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-1.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-1.ts index 95017ea2a0..5b7132b64c 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-1.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair } from "@moonwall/util"; import { @@ -12,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013918", + id: "D014017", title: "Mock XCM - receive horizontal transact ETHEREUM (transfer)", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -111,7 +110,10 @@ describeSuite({ fungible: targetXcmFee, }, ], - weight_limit: new BN(targetXcmWeight.toString()), + weight_limit: { + refTime: targetXcmWeight, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -119,15 +121,18 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", + originKind: "SovereignAccount", // 21_000 gas limit + db read - requireWeightAtMost: 550_000_000n, + requireWeightAtMost: { + refTime: 550_000_000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-10.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-10.ts similarity index 93% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-10.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-10.ts index 657bc324ee..9bad6f19cc 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-10.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-10.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { Abi, encodeFunctionData } from "viem"; import { XcmFragment, @@ -11,7 +10,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013919", + id: "D014018", title: "Mock XCM - transact ETHEREUM input size check fails", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -121,7 +120,10 @@ describeSuite({ fungible: transferredBalance / 2n, }, ], - weight_limit: new BN(40000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -129,14 +131,17 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", - requireWeightAtMost: 30000000000n, + originKind: "SovereignAccount", + requireWeightAtMost: { + refTime: 30000000000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-2.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-2.ts similarity index 92% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-2.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-2.ts index 58b350477f..ac09844399 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-2.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { Abi, encodeFunctionData } from "viem"; import { XcmFragment, @@ -11,7 +10,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013920", + id: "D014019", title: "Mock XCM - receive horizontal transact ETHEREUM (call)", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -113,7 +112,10 @@ describeSuite({ fungible: transferredBalance / 2n, }, ], - weight_limit: new BN(4000000000), + weight_limit: { + refTime: 40000000000n, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -121,14 +123,17 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", - requireWeightAtMost: 3000000000n, + originKind: "SovereignAccount", + requireWeightAtMost: { + refTime: 3000000000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-4.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-4.ts similarity index 93% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-4.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-4.ts index 8d82c157dc..0e5aaa1a3e 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-4.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-4.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair } from "@moonwall/util"; import { @@ -12,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013922", + id: "D014020", title: "Mock XCM - receive horizontal transact ETHEREUM (proxy)", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -112,7 +111,10 @@ describeSuite({ fungible: targetXcmFee, }, ], - weight_limit: new BN(targetXcmWeight.toString()), + weight_limit: { + refTime: targetXcmWeight, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -120,15 +122,18 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", + originKind: "SovereignAccount", // 100_000 gas + 2 db read - requireWeightAtMost: 575_000_000n, + requireWeightAtMost: { + refTime: 575_000_000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-5.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-5.ts similarity index 93% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-5.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-5.ts index f54cc964de..b183f3d533 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-5.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-5.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair, charleth } from "@moonwall/util"; import { @@ -12,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013923", + id: "D014021", title: "Mock XCM - receive horizontal transact ETHEREUM (proxy)", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -119,7 +118,10 @@ describeSuite({ fungible: targetXcmFee, }, ], - weight_limit: new BN(targetXcmWeight.toString()), + weight_limit: { + refTime: targetXcmWeight, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -127,15 +129,18 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", + originKind: "SovereignAccount", // 100_000 gas + 2 reads - requireWeightAtMost: 575_000_000n, + requireWeightAtMost: { + refTime: 575_000_000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-6.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-6.ts similarity index 95% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-6.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-6.ts index 30974e4072..ae62a155f3 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-6.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-6.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair, charleth } from "@moonwall/util"; import { @@ -12,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013924", + id: "D014022", title: "Mock XCM - receive horizontal transact ETHEREUM (proxy)", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -132,7 +131,10 @@ describeSuite({ fungible: targetXcmFee, }, ], - weight_limit: new BN(targetXcmWeight.toString()), + weight_limit: { + refTime: targetXcmWeight, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -140,15 +142,18 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", + originKind: "SovereignAccount", // 100_000 gas + 2db reads - requireWeightAtMost: 575_000_000n, + requireWeightAtMost: { + refTime: 575_000_000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-7.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-7.ts similarity index 95% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-7.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-7.ts index 8a97553c87..c97e96f6a8 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-7.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-7.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair, charleth, alith } from "@moonwall/util"; import { @@ -12,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013925", + id: "D014023", title: "Mock XCM - transact ETHEREUM (proxy) disabled switch", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -140,7 +139,10 @@ describeSuite({ fungible: targetXcmFee, }, ], - weight_limit: new BN(targetXcmWeight.toString()), + weight_limit: { + refTime: targetXcmWeight, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -148,15 +150,18 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", + originKind: "SovereignAccount", // 100_000 gas + 2db reads - requireWeightAtMost: 575_000_000n, + requireWeightAtMost: { + refTime: 575_000_000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-8.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-8.ts similarity index 93% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-8.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-8.ts index a7b6d0cd90..4619d094ce 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-8.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-8.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair, alith } from "@moonwall/util"; import { @@ -12,7 +11,7 @@ import { } from "../../../../helpers/xcm.js"; describeSuite({ - id: "D013926", + id: "D014024", title: "Mock XCM - transact ETHEREUM (non-proxy) disabled switch", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -117,7 +116,10 @@ describeSuite({ fungible: targetXcmFee, }, ], - weight_limit: new BN(targetXcmWeight.toString()), + weight_limit: { + refTime: targetXcmWeight, + proofSize: 110000n, + }, descend_origin: sendingAddress, }) .descend_origin() @@ -125,15 +127,18 @@ describeSuite({ .buy_execution() .push_any({ Transact: { - originType: "SovereignAccount", + originKind: "SovereignAccount", // 21_000 gas limit + db read - requireWeightAtMost: 575_000_000n, + requireWeightAtMost: { + refTime: 575_000_000n, + proofSize: 80000n, + }, call: { encoded: transferCallEncoded, }, }, }) - .as_v2(); + .as_v4(); // Send an XCM and create block to execute it await injectHrmpMessageAndSeal(context, 1, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-9.ts b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-9.ts similarity index 98% rename from test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-9.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-9.ts index d094a008e8..b5a46192d6 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-mock-hrmp-transact-ethereum-9.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-mock-hrmp-transact-ethereum-9.ts @@ -3,7 +3,7 @@ import { describeSuite, expect } from "@moonwall/cli"; import { alith } from "@moonwall/util"; describeSuite({ - id: "D013927", + id: "D014025", title: "Mock XCM - EthereumXcm only disable by root", foundationMethods: "dev", testCases: ({ context, it, log }) => { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer-two-ERC20.ts b/test/suites/dev/moonbase/test-xcm-v4/test-xcm-erc20-transfer-two-ERC20.ts similarity index 98% rename from test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer-two-ERC20.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-xcm-erc20-transfer-two-ERC20.ts index c14ca6450a..1dde002dea 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer-two-ERC20.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-xcm-erc20-transfer-two-ERC20.ts @@ -13,7 +13,7 @@ import { export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; describeSuite({ - id: "D013928", + id: "D014026", title: "Mock XCM - Send two local ERC20", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -201,7 +201,7 @@ describeSuite({ }, { AccountKey20: { - network: "Any", + network: null, key: erc20ContractAddress2, }, }, @@ -220,7 +220,7 @@ describeSuite({ }, { AccountKey20: { - network: "Any", + network: null, key: erc20ContractAddress1, }, }, @@ -238,8 +238,8 @@ describeSuite({ .withdraw_asset() .clear_origin() .buy_execution() - .deposit_asset(3n) - .as_v2(); + .deposit_asset_v3(3n) + .as_v4(); // Mock the reception of the xcm message await injectHrmpMessageAndSeal(context, paraId, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer.ts b/test/suites/dev/moonbase/test-xcm-v4/test-xcm-erc20-transfer.ts similarity index 98% rename from test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-xcm-erc20-transfer.ts index 9936583f18..45b4023240 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-xcm-erc20-transfer.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-xcm-erc20-transfer.ts @@ -14,7 +14,7 @@ import { export const ERC20_TOTAL_SUPPLY = 1_000_000_000n; describeSuite({ - id: "D013929", + id: "D014027", title: "Mock XCM - Send local erc20", foundationMethods: "dev", testCases: ({ context, it }) => { @@ -156,7 +156,7 @@ describeSuite({ }, { AccountKey20: { - network: "Any", + network: null, key: erc20ContractAddress, }, }, @@ -173,8 +173,8 @@ describeSuite({ .withdraw_asset() .clear_origin() .buy_execution() - .deposit_asset(2n) - .as_v2(); + .deposit_asset_v3(2n) + .as_v4(); // Mock the reception of the xcm message await injectHrmpMessageAndSeal(context, paraId, { diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-1.ts b/test/suites/dev/moonbase/test-xcm-v4/test-xcm-ver-conversion-1.ts similarity index 93% rename from test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-1.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-xcm-ver-conversion-1.ts index 11df63b990..49ed9aed72 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-1.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-xcm-ver-conversion-1.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair } from "@moonwall/util"; import { @@ -15,7 +14,7 @@ import { const foreign_para_id = 2000; describeSuite({ - id: "D013930", + id: "D014028", title: "XCM Moonbase: version compatibility", foundationMethods: "dev", testCases: ({ context, it, log }) => { @@ -41,7 +40,7 @@ describeSuite({ it({ id: "T01", - title: "Should execute v2 message", + title: "Should execute v4 message", test: async function () { const metadata = await context.polkadotJs().rpc.state.getMetadata(); const balancesPalletIndex = metadata.asLatest.pallets @@ -60,14 +59,17 @@ describeSuite({ fungible: transferredBalance, }, ], - weight_limit: new BN(8000000000), + weight_limit: { + refTime: 8000000000, + proofSize: 110000n, + }, beneficiary: random.address, }) .withdraw_asset() .clear_origin() .buy_execution() - .deposit_asset() - .as_v2(); + .deposit_asset_v3() + .as_v4(); const chargedWeight = await weightMessage( context, diff --git a/test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-2.ts b/test/suites/dev/moonbase/test-xcm-v4/test-xcm-ver-conversion-2.ts similarity index 93% rename from test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-2.ts rename to test/suites/dev/moonbase/test-xcm-v4/test-xcm-ver-conversion-2.ts index 4b0c206afd..20e74b7f73 100644 --- a/test/suites/dev/moonbase/test-xcm-v2/test-xcm-ver-conversion-2.ts +++ b/test/suites/dev/moonbase/test-xcm-v4/test-xcm-ver-conversion-2.ts @@ -1,7 +1,6 @@ import "@moonbeam-network/api-augment"; import { beforeAll, describeSuite, expect } from "@moonwall/cli"; -import { BN } from "@polkadot/util"; import { KeyringPair } from "@polkadot/keyring/types"; import { generateKeyringPair } from "@moonwall/util"; import { @@ -15,10 +14,9 @@ import { const foreign_para_id = 2000; describeSuite({ - id: "D013931", + id: "D014029", title: "XCM Moonriver: version compatibility", foundationMethods: "dev", - chainType: "moonriver", testCases: ({ context, it, log }) => { let transferredBalance: bigint; let sovereignAddress: string; @@ -42,7 +40,7 @@ describeSuite({ it({ id: "T01", - title: "Should execute v2 message", + title: "Should execute v4 message", test: async function () { const metadata = await context.polkadotJs().rpc.state.getMetadata(); const balancesPalletIndex = metadata.asLatest.pallets @@ -61,14 +59,17 @@ describeSuite({ fungible: transferredBalance, }, ], - weight_limit: new BN(8000000000), + weight_limit: { + refTime: 8000000000, + proofSize: 110000n, + }, beneficiary: random.address, }) .withdraw_asset() .clear_origin() .buy_execution() - .deposit_asset() - .as_v2(); + .deposit_asset_v3() + .as_v4(); const chargedWeight = await weightMessage( context, diff --git a/test/suites/tracing-tests/test-trace-ethereum-xcm-2.ts b/test/suites/tracing-tests/test-trace-ethereum-xcm-2.ts index 7073a8f1e9..a1fd0e3bba 100644 --- a/test/suites/tracing-tests/test-trace-ethereum-xcm-2.ts +++ b/test/suites/tracing-tests/test-trace-ethereum-xcm-2.ts @@ -102,6 +102,9 @@ describeSuite({ payload: xcmMessage, } as RawXcmMessage); + // Create a new block to include the xcm message + await context.createBlock(); + // By calling deployContract() a new block will be created, // including the ethereum xcm call + regular ethereum transaction const { contractAddress: eventEmitterAddress } = await context.deployContract!( diff --git a/test/suites/tracing-tests/test-trace-ethereum-xcm-3.ts b/test/suites/tracing-tests/test-trace-ethereum-xcm-3.ts index 0bf0eebf63..0da8a27216 100644 --- a/test/suites/tracing-tests/test-trace-ethereum-xcm-3.ts +++ b/test/suites/tracing-tests/test-trace-ethereum-xcm-3.ts @@ -112,6 +112,10 @@ describeSuite({ payload: xcmMessage, } as RawXcmMessage); } + + // Block that includes the hrmp messages + await context.createBlock(); + // Block that processes the hrmp messasges in the message queue await context.createBlock(); const txHashes = (await context.viem().getBlock({ blockTag: "latest" })).transactions;