diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index da101b6d0..4eb3909b3 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -20,7 +20,7 @@ jobs: with: components: rustfmt target: wasm32-unknown-unknown - toolchain: 1.74.0 + toolchain: 1.77.0 - name: Generate WeightInfo Files run: make generate-bifrost-weights - name: Commit Automatically diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 08d034534..c3cb51fb3 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -25,7 +25,7 @@ jobs: - name: Install toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: 1.74.0 + toolchain: 1.77.0 components: rustfmt, clippy target: wasm32-unknown-unknown - name: Cargo clippy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7bb04416..5e3de645a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: with: components: rustfmt target: wasm32-unknown-unknown - toolchain: 1.74.0 + toolchain: 1.77.0 - name: Download kusama strool result uses: actions/download-artifact@v4 diff --git a/Cargo.lock b/Cargo.lock index ac932c9d6..df94459fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,11 +23,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.28.1", + "gimli 0.29.0", ] [[package]] @@ -68,18 +68,7 @@ dependencies = [ "cipher 0.4.4", "ctr", "ghash", - "subtle 2.5.0", -] - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.14", - "once_cell", - "version_check", + "subtle 2.6.1", ] [[package]] @@ -89,7 +78,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom 0.2.14", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -142,47 +131,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -190,9 +180,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "approx" @@ -214,7 +204,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -228,6 +218,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" @@ -240,6 +242,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" @@ -254,9 +295,60 @@ 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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "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" @@ -300,6 +392,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" @@ -313,6 +418,35 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "ark-scale" +version = "0.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f69c00b3b529be29528a6f2fd5fa7b1790f8bed81b9cdca17e326538545a179" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ark-secret-scalar" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "ark-transcript", + "digest 0.10.7", + "getrandom_or_panic", + "zeroize", +] + [[package]] name = "ark-serialize" version = "0.4.2" @@ -343,20 +477,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", + "rayon", ] [[package]] -name = "array-bytes" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +name = "ark-transcript" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] [[package]] name = "array-bytes" -version = "6.2.2" +version = "6.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" [[package]] name = "arrayref" @@ -404,7 +546,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -437,22 +579,21 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.2.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 5.3.0", - "event-listener-strategy 0.5.2", + "event-listener-strategy", "futures-core", "pin-project-lite 0.2.14", ] [[package]] name = "async-executor" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" dependencies = [ "async-task", "concurrent-queue", @@ -495,17 +636,17 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.0", + "polling 3.7.2", "rustix 0.38.34", "slab", "tracing", @@ -523,12 +664,12 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener 5.3.1", + "event-listener-strategy", "pin-project-lite 0.2.14", ] @@ -562,12 +703,12 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" +checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" dependencies = [ - "async-io 2.3.2", - "async-lock 3.3.0", + "async-io 2.3.3", + "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", @@ -586,13 +727,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -608,6 +749,15 @@ dependencies = [ "pin-project-lite 0.2.14", ] +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + [[package]] name = "atomic-take" version = "1.1.0" @@ -621,26 +771,60 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] -name = "autocfg" +name = "auto_impl" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ - "addr2line 0.21.0", + "addr2line 0.22.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.32.2", + "object 0.36.1", "rustc-demangle", ] +[[package]] +name = "bandersnatch_vrfs" +version = "0.0.4" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-serialize", + "ark-std", + "dleq_vrf", + "fflonk", + "merlin", + "rand_chacha 0.3.1", + "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", +] + [[package]] name = "base-x" version = "0.2.11" @@ -665,6 +849,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -695,7 +885,7 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -729,7 +919,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -752,7 +942,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -773,12 +963,12 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "bifrost-cli" -version = "0.11.0" +version = "0.12.0" dependencies = [ "bifrost-primitives", "bifrost-service", @@ -795,6 +985,7 @@ dependencies = [ "polkadot-primitives", "sc-cli", "sc-executor", + "sc-network", "sc-offchain", "sc-service", "sc-sysinfo", @@ -805,7 +996,6 @@ dependencies = [ "sp-runtime", "staging-node-inspect", "substrate-build-script-utils", - "try-runtime-cli", ] [[package]] @@ -827,7 +1017,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -848,7 +1038,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] @@ -868,7 +1058,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -898,7 +1088,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm-builder", ] @@ -925,7 +1115,7 @@ dependencies = [ "bifrost-primitives", "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -954,7 +1144,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -982,12 +1172,13 @@ dependencies = [ "pallet-transaction-payment", "pallet-xcm", "parity-scale-codec", + "polkadot-parachain-primitives", "scale-info", "sp-arithmetic", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1031,6 +1222,7 @@ dependencies = [ "bifrost-slp", "bifrost-vtoken-voting", "bifrost-xcm-interface", + "cumulus-pallet-parachain-system", "cumulus-primitives-core", "env_logger", "frame-support", @@ -1059,7 +1251,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-parachain-info", "staging-xcm", "staging-xcm-builder", @@ -1073,7 +1265,6 @@ name = "bifrost-kusama-runtime" version = "0.8.0" dependencies = [ "bifrost-asset-registry", - "bifrost-call-switchgear", "bifrost-channel-commission", "bifrost-cross-in-out", "bifrost-currencies", @@ -1111,6 +1302,7 @@ dependencies = [ "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -1155,6 +1347,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", + "pallet-tx-pause", "pallet-utility", "pallet-whitelist", "pallet-xcm", @@ -1179,7 +1372,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-version", "staging-parachain-info", @@ -1216,7 +1409,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "substrate-fixed", ] @@ -1226,7 +1419,6 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-buy-back", - "bifrost-call-switchgear", "bifrost-channel-commission", "bifrost-clouds-convert", "bifrost-cross-in-out", @@ -1262,8 +1454,15 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-timestamp", "cumulus-primitives-utility", + "ethabi", + "evm", + "fp-account", + "fp-evm", + "fp-rpc", + "fp-self-contained", "frame-benchmarking", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -1275,6 +1474,8 @@ dependencies = [ "leverage-staking", "log", "merkle-distributor", + "module-evm-utility-macro", + "num_enum 0.5.11", "orml-oracle", "orml-tokens", "orml-traits", @@ -1286,12 +1487,25 @@ dependencies = [ "pallet-aura", "pallet-authorship", "pallet-balances", + "pallet-base-fee", "pallet-bounties", "pallet-collator-selection", "pallet-collective", "pallet-conviction-voting", "pallet-democracy", + "pallet-dynamic-fee", "pallet-elections-phragmen", + "pallet-ethereum", + "pallet-evm", + "pallet-evm-accounts", + "pallet-evm-accounts-rpc-runtime-api", + "pallet-evm-chain-id", + "pallet-evm-precompile-blake2", + "pallet-evm-precompile-bn128", + "pallet-evm-precompile-dispatch", + "pallet-evm-precompile-modexp", + "pallet-evm-precompile-sha3fips", + "pallet-evm-precompile-simple", "pallet-identity", "pallet-indices", "pallet-membership", @@ -1306,9 +1520,11 @@ dependencies = [ "pallet-session", "pallet-timestamp", "pallet-tips", + "pallet-traits", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", + "pallet-tx-pause", "pallet-utility", "pallet-whitelist", "pallet-xcm", @@ -1317,6 +1533,7 @@ dependencies = [ "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", + "primitive-types", "scale-info", "serde", "serde_json", @@ -1333,7 +1550,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-version", "staging-parachain-info", @@ -1360,7 +1577,7 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", "zenlink-protocol", @@ -1374,6 +1591,8 @@ dependencies = [ "bifrost-farming-rpc-runtime-api", "bifrost-flexible-fee-rpc", "bifrost-flexible-fee-rpc-runtime-api", + "bifrost-kusama-runtime", + "bifrost-polkadot-runtime", "bifrost-primitives", "bifrost-salp-rpc", "bifrost-salp-rpc-runtime-api", @@ -1383,18 +1602,40 @@ dependencies = [ "bifrost-ve-minting-rpc-runtime-api", "bifrost-vtoken-minting-rpc", "bifrost-vtoken-minting-rpc-runtime-api", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-test-relay-sproof-builder", + "fc-api", + "fc-db", + "fc-mapping-sync", + "fc-rpc", + "fc-rpc-core", + "fc-storage", + "fp-rpc", + "futures 0.3.30", + "hex-literal 0.4.1", "jsonrpsee", "lend-market-rpc", "lend-market-rpc-runtime-api", "pallet-transaction-payment-rpc", "sc-client-api", + "sc-consensus", + "sc-consensus-aura", + "sc-consensus-manual-seal", + "sc-network", + "sc-network-sync", "sc-rpc", "sc-rpc-api", + "sc-transaction-pool", "sc-transaction-pool-api", "sp-api", "sp-block-builder", "sp-blockchain", + "sp-consensus-aura", + "sp-core", + "sp-inherents", "sp-runtime", + "sp-timestamp", "substrate-frame-rpc-system", "zenlink-protocol", "zenlink-protocol-rpc", @@ -1421,6 +1662,7 @@ dependencies = [ "frame-system", "frame-system-rpc-runtime-api", "log", + "num-traits", "orml-tokens", "orml-traits", "orml-xcm-support", @@ -1430,12 +1672,15 @@ dependencies = [ "pallet-membership", "pallet-multisig", "pallet-scheduler", + "pallet-traits", "pallet-transaction-payment", "pallet-treasury", "pallet-utility", "pallet-xcm", "parity-scale-codec", "polkadot-parachain-primitives", + "scale-info", + "serde", "sp-api", "sp-arithmetic", "sp-block-builder", @@ -1446,7 +1691,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-version", "staging-parachain-info", @@ -1487,7 +1732,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1522,6 +1767,7 @@ dependencies = [ name = "bifrost-service" version = "0.8.0" dependencies = [ + "async-trait", "bifrost-farming-rpc-runtime-api", "bifrost-flexible-fee-rpc-runtime-api", "bifrost-kusama-runtime", @@ -1532,6 +1778,7 @@ dependencies = [ "bifrost-runtime-common", "bifrost-salp-rpc-runtime-api", "bifrost-ve-minting-rpc-runtime-api", + "clap", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -1542,6 +1789,20 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-interface", + "cumulus-test-relay-sproof-builder", + "fc-consensus", + "fc-db", + "fc-mapping-sync", + "fc-rpc", + "fc-rpc-core", + "fc-storage", + "flume 0.10.14", + "fp-account", + "fp-consensus", + "fp-dynamic-fee", + "fp-evm", + "fp-rpc", + "fp-storage", "frame-benchmarking", "frame-benchmarking-cli", "frame-system-rpc-runtime-api", @@ -1590,14 +1851,13 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-timestamp", "sp-transaction-pool", "sp-trie", "staging-xcm", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", - "try-runtime-cli", "zenlink-protocol", "zenlink-protocol-runtime-api", "zenlink-stable-amm-runtime-api", @@ -1637,7 +1897,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1659,7 +1919,7 @@ dependencies = [ "cumulus-pallet-xcm", "cumulus-primitives-core", "ethabi", - "ethereum", + "ethereum 0.14.0", "frame-benchmarking", "frame-support", "frame-system", @@ -1679,7 +1939,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-parachain-info", "staging-xcm", "staging-xcm-builder", @@ -1707,7 +1967,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1735,7 +1995,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1764,7 +2024,7 @@ dependencies = [ "bifrost-primitives", "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1793,7 +2053,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1828,7 +2088,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1853,7 +2113,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1884,7 +2144,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1914,7 +2174,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-core", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1931,7 +2191,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1951,7 +2211,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1974,7 +2234,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm-builder", ] @@ -2006,7 +2266,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -2036,7 +2296,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-core", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -2061,7 +2321,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -2085,16 +2345,15 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", ] [[package]] name = "binary-merkle-tree" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf857f8f411164ce1af14a778626af96251de7a77837711efbc440807e7053f" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hash-db 0.16.0", "log", @@ -2121,13 +2380,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.19", + "prettyplease 0.2.20", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -2136,19 +2395,31 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ - "bitcoin_hashes", - "rand", - "rand_core 0.6.4", - "serde", - "unicode-normalization", + "bitcoin_hashes 0.11.0", ] +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + [[package]] name = "bitcoin_hashes" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -2157,9 +2428,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -2229,9 +2500,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" dependencies = [ "arrayref", "arrayvec 0.7.4", @@ -2260,12 +2531,11 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel 2.2.1", - "async-lock 3.3.0", + "async-channel 2.3.1", "async-task", "futures-io", "futures-lite 2.3.0", @@ -2295,9 +2565,8 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub-router" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ff4abe93be7bc1663adc41817b1aa3476fbec953ce361537419924310d5dd4" +version = "0.6.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", @@ -2366,9 +2635,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" [[package]] name = "byteorder" @@ -2378,9 +2647,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "bzip2-sys" @@ -2405,9 +2674,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ "serde", ] @@ -2429,7 +2698,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -2437,13 +2706,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.95" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" dependencies = [ "jobserver", "libc", - "once_cell", ] [[package]] @@ -2521,7 +2789,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2537,6 +2805,19 @@ dependencies = [ "unsigned-varint", ] +[[package]] +name = "cid" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd94671561e36e4e7de75f753f577edafb0e7c05d6e4547229fdf7938fbcd2c3" +dependencies = [ + "core2", + "multibase", + "multihash 0.18.1", + "serde", + "unsigned-varint", +] + [[package]] name = "cipher" version = "0.2.5" @@ -2557,20 +2838,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ckb-merkle-mountain-range" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" -dependencies = [ - "cfg-if", -] - [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -2579,9 +2851,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.8" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", "clap_derive", @@ -2589,9 +2861,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.8" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", @@ -2609,14 +2881,14 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "coarsetime" @@ -2641,9 +2913,19 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + +[[package]] +name = "combine" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] [[package]] name = "comfy-table" @@ -2656,6 +2938,22 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "common" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof#665f5f51af5734c7b6d90b985dd6861d4c5b4752" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "fflonk", + "getrandom_or_panic", + "merlin", + "rand_chacha 0.3.1", +] + [[package]] name = "common-path" version = "1.0.0" @@ -2705,7 +3003,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", "once_cell", "tiny-keccak", ] @@ -2811,7 +3109,7 @@ dependencies = [ "gimli 0.27.3", "hashbrown 0.13.2", "log", - "regalloc2", + "regalloc2 0.6.1", "smallvec", "target-lexicon", ] @@ -2885,11 +3183,26 @@ dependencies = [ "wasmtime-types", ] +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -2924,9 +3237,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -2942,7 +3255,7 @@ checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -2974,17 +3287,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle 2.5.0", -] - -[[package]] -name = "crypto-mac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" -dependencies = [ - "generic-array 0.14.7", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -2998,9 +3301,8 @@ dependencies = [ [[package]] name = "cumulus-client-cli" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d2597fe3235d263457aaff65d0fb5bed506698b81530e2e6afecd6d6c9af32" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "clap", "parity-scale-codec", @@ -3016,16 +3318,15 @@ dependencies = [ [[package]] name = "cumulus-client-collator" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c06ae72a125d056da3b722f00f87881a2afbb2af8fe9fa9a91587f139b9667e" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", "futures 0.3.30", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", @@ -3040,9 +3341,8 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18f4977f6a88af39c46832d571ac0d95e8322bf22eab42550fec34f72da9f034" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-client-collator", @@ -3083,9 +3383,8 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350db1fc8841a44f344474b791d2ebe61b79bf6061043a7d826b3d02d1935a56" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -3113,9 +3412,8 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38028f75597a34d447f059d6a7fd9c1c91bce0b8c48b08b1cbd19eb3def9c376" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "anyhow", "async-trait", @@ -3129,16 +3427,15 @@ dependencies = [ [[package]] name = "cumulus-client-network" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ac095ef439c595ccb998be5a9d40778d8963c5a8ebbaed838fed6293232915b" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-relay-chain-interface", "futures 0.3.30", "futures-timer", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-parachain-primitives", "polkadot-primitives", @@ -3153,9 +3450,8 @@ dependencies = [ [[package]] name = "cumulus-client-parachain-inherent" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b516290cd4a6efc117824135761f3642dc57685e13da00727c460053ce978fe" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3170,17 +3466,16 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", - "sp-storage", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "tracing", ] [[package]] name = "cumulus-client-pov-recovery" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d55e96004ca9aa9d9b96a28ab2d97b1ca8d303c9d2405ea34cdf1462d4c4f0" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3192,7 +3487,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-overseer", "polkadot-primitives", - "rand", + "rand 0.8.5", "sc-client-api", "sc-consensus", "sp-consensus", @@ -3203,9 +3498,8 @@ dependencies = [ [[package]] name = "cumulus-client-service" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "657f57c56159bb6cb74d9221de8f11c9e09962666381357896562662d3019799" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -3234,15 +3528,15 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-core", + "sp-io", "sp-runtime", "sp-transaction-pool", ] [[package]] name = "cumulus-pallet-aura-ext" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8e78b18548ae3454bc8a46e2bc2e3f521ea547844cbaecc9344d4741f4b1ef" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -3254,14 +3548,13 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "cumulus-pallet-parachain-system" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a215fe4d66d23e8f3956bd21b9d80d2b33239f3b150b36d56fa238cfc9421a5" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -3281,35 +3574,34 @@ dependencies = [ "polkadot-runtime-parachains", "scale-info", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-inherents", "sp-io", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "sp-version", "staging-xcm", + "staging-xcm-builder", "trie-db", ] [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "befbaf3a1ce23ac8476481484fef5f4d500cbd15b4dad6380ce1d28134b0c1f7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "cumulus-pallet-xcm" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e802291060763f8d1176bf808da97aafe5afe7351f62bb093c317c1d35c5cee" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -3318,15 +3610,14 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa22d6e479a4d3a2790bab291269ba0917a1ac384255a54a2ebc3f7c37e505e" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", @@ -3343,16 +3634,16 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", + "staging-xcm-builder", "staging-xcm-executor", ] [[package]] name = "cumulus-primitives-aura" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f07d6177692154043d7ddcc0b87ca5365ae8e4d94b90d9931f6b2f76e162f09" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -3360,14 +3651,13 @@ dependencies = [ "sp-api", "sp-consensus-aura", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "cumulus-primitives-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df07f6825fd50ea30aae335e43dc1a615a05de7465f5f329b9e414f2c886a12" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -3376,16 +3666,15 @@ dependencies = [ "scale-info", "sp-api", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "staging-xcm", ] [[package]] name = "cumulus-primitives-parachain-inherent" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ad140a065a6b8001fb26ec42b91391e90fde120f5b4e57986698249a9b98c8" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3393,40 +3682,39 @@ dependencies = [ "scale-info", "sp-core", "sp-inherents", - "sp-std", + "sp-runtime", + "sp-state-machine", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", ] [[package]] name = "cumulus-primitives-proof-size-hostfunction" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b74f9141190b9f4bf96a947ade46da64097b77f1ebfa8d611c81724250e119" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "sp-externalities", - "sp-runtime-interface", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", ] [[package]] name = "cumulus-primitives-timestamp" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34584abda4aeac69abe08ba3146d0ca059cd5636a8c4ccf680f2b9f99fc5f8ee" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "futures 0.3.30", "parity-scale-codec", "sp-inherents", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-timestamp", ] [[package]] name = "cumulus-primitives-utility" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e65466e56d642f979b556d098a03755ae51972fff5fa0f9b1cdcfdb3df062ea3" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -3437,7 +3725,7 @@ dependencies = [ "polkadot-runtime-parachains", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -3445,9 +3733,8 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff27dec2eab6cd1d854756d62bd7053721ccd115f36f9e8b0976b1e46b70ef7" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3470,9 +3757,8 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c736f39b50eecf194707e15d0359677bb8fe8138b01f6493ab9b7e10d2d1ae" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3489,17 +3775,16 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7718fe298d567adc44fae3dd7024418d6eff08264041e4b0544d1892861cd6" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", "cumulus-relay-chain-rpc-interface", "futures 0.3.30", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-availability-recovery", "polkadot-collator-protocol", "polkadot-core-primitives", @@ -3512,6 +3797,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", + "polkadot-service", "sc-authority-discovery", "sc-client-api", "sc-network", @@ -3531,9 +3817,8 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e2269d4c1f37593257b3d7b90f8b56adab0793d9b9f5c1b5334c9ca7e3b10b" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3545,7 +3830,7 @@ dependencies = [ "parity-scale-codec", "pin-project", "polkadot-overseer", - "rand", + "rand 0.8.5", "sc-client-api", "sc-rpc-api", "sc-service", @@ -3560,7 +3845,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-state-machine", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-version", "thiserror", "tokio", @@ -3571,16 +3856,15 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfff604ad01c5c0c397f9a971c8cec6443aea3658813778875b4f64de07847d5" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", "polkadot-primitives", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", ] @@ -3593,24 +3877,23 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms", "rustc_version", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -3622,7 +3905,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -3640,9 +3923,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.121" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21db378d04296a84d8b7d047c36bb3954f0b46529db725d7e62fb02f9ba53ccc" +checksum = "273dcfd3acd4e1e276af13ed2a43eea7001318823e7a726a6b3ed39b4acc0b82" dependencies = [ "cc", "cxxbridge-flags", @@ -3652,9 +3935,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.121" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5262a7fa3f0bae2a55b767c223ba98032d7c328f5c13fa5cdc980b77fc0658" +checksum = "d8b2766fbd92be34e9ed143898fce6c572dc009de39506ed6903e5a05b68914e" dependencies = [ "cc", "codespan-reporting", @@ -3662,24 +3945,37 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "cxxbridge-flags" -version = "1.0.121" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8dcadd2e2fb4a501e1d9e93d6e88e6ea494306d8272069c92d5a9edf8855c0" +checksum = "839fcd5e43464614ffaa989eaf1c139ef1f0c51672a1ed08023307fa1b909ccd" [[package]] name = "cxxbridge-macro" -version = "1.0.121" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad08a837629ad949b73d032c637653d069e909cffe4ee7870b02301939ce39cc" +checksum = "4b2c1c1776b986979be68bb2285da855f8d8a35851a769fca8740df7c3d07877" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core 0.9.10", ] [[package]] @@ -3752,17 +4048,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive-syn-parse" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive-syn-parse" version = "0.2.0" @@ -3771,20 +4056,20 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] @@ -3820,7 +4105,7 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -3867,13 +4152,29 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", +] + +[[package]] +name = "dleq_vrf" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-scale", + "ark-secret-scalar", + "ark-serialize", + "ark-std", + "ark-transcript", + "arrayvec 0.7.4", + "zeroize", ] [[package]] @@ -3892,17 +4193,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" dependencies = [ "common-path", - "derive-syn-parse 0.2.0", + "derive-syn-parse", "once_cell", "proc-macro2", "quote", "regex", - "syn 2.0.60", + "syn 2.0.71", "termcolor", - "toml 0.8.12", + "toml 0.8.14", "walkdir", ] +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + [[package]] name = "downcast" version = "0.11.0" @@ -3958,10 +4265,20 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", - "signature", + "serdect", + "signature 2.2.0", "spki", ] +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature 1.6.4", +] + [[package]] name = "ed25519" version = "2.2.3" @@ -3969,35 +4286,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", - "signature", + "signature 2.2.0", ] [[package]] name = "ed25519-dalek" -version = "2.1.1" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek 4.1.2", - "ed25519", - "rand_core 0.6.4", + "curve25519-dalek 3.2.0", + "ed25519 1.5.3", + "rand 0.7.3", "serde", - "sha2 0.10.8", - "subtle 2.5.0", + "sha2 0.9.9", "zeroize", ] [[package]] -name = "ed25519-zebra" -version = "3.1.0" +name = "ed25519-dalek" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", - "hex", + "curve25519-dalek 4.1.3", + "ed25519 2.2.3", "rand_core 0.6.4", - "sha2 0.9.9", + "serde", + "sha2 0.10.8", + "subtle 2.6.1", "zeroize", ] @@ -4007,9 +4324,9 @@ version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek 4.1.2", - "ed25519", - "hashbrown 0.14.3", + "curve25519-dalek 4.1.3", + "ed25519 2.2.3", + "hashbrown 0.14.5", "hex", "rand_core 0.6.4", "sha2 0.10.8", @@ -4018,9 +4335,12 @@ dependencies = [ [[package]] name = "either" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +dependencies = [ + "serde", +] [[package]] name = "elliptic-curve" @@ -4037,7 +4357,8 @@ dependencies = [ "pkcs8", "rand_core 0.6.4", "sec1", - "subtle 2.5.0", + "serdect", + "subtle 2.6.1", "zeroize", ] @@ -4059,24 +4380,36 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "enumflags2" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -4087,7 +4420,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -4117,9 +4450,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4146,6 +4479,7 @@ dependencies = [ "fixed-hash", "impl-codec", "impl-rlp", + "impl-serde", "scale-info", "tiny-keccak", ] @@ -4163,10 +4497,29 @@ dependencies = [ "parity-scale-codec", "rlp", "scale-info", + "serde", "sha3", "triehash", ] +[[package]] +name = "ethereum" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e04d24d20b8ff2235cffbf242d5092de3aa45f77c5270ddbfadd2778ca13fea" +dependencies = [ + "bytes", + "ethereum-types", + "hash-db 0.16.0", + "hash256-std-hasher", + "parity-scale-codec", + "rlp", + "scale-info", + "serde", + "sha3", + "trie-root", +] + [[package]] name = "ethereum-types" version = "0.14.1" @@ -4177,6 +4530,7 @@ dependencies = [ "fixed-hash", "impl-codec", "impl-rlp", + "impl-serde", "primitive-types", "scale-info", "uint", @@ -4201,9 +4555,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "4.0.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", @@ -4211,69 +4565,95 @@ dependencies = [ ] [[package]] -name = "event-listener" -version = "5.3.0" +name = "event-listener-strategy" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "concurrent-queue", - "parking", + "event-listener 5.3.1", "pin-project-lite 0.2.14", ] [[package]] -name = "event-listener-strategy" -version = "0.4.0" +name = "evm" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +checksum = "767f43e9630cc36cf8ff2777cbb0121b055f0d1fd6eaaa13b46a1808f0d0e7e9" dependencies = [ - "event-listener 4.0.3", - "pin-project-lite 0.2.14", + "auto_impl", + "environmental", + "ethereum 0.15.0", + "evm-core", + "evm-gasometer", + "evm-runtime", + "log", + "parity-scale-codec", + "primitive-types", + "rlp", + "scale-info", + "serde", + "sha3", ] [[package]] -name = "event-listener-strategy" -version = "0.5.2" +name = "evm-core" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "d1da6cedc5cedb4208e59467106db0d1f50db01b920920589f8e672c02fdc04f" dependencies = [ - "event-listener 5.3.0", - "pin-project-lite 0.2.14", -] - + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", +] + [[package]] -name = "exit-future" -version = "0.2.0" +name = "evm-gasometer" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" +checksum = "1dc0eb591abc5cd7b05bef6a036c2bb6c66ab6c5e0c5ce94bfe377ab670b1fd7" dependencies = [ - "futures 0.3.30", + "environmental", + "evm-core", + "evm-runtime", + "primitive-types", ] [[package]] -name = "expander" -version = "0.0.4" +name = "evm-runtime" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a718c0675c555c5f976fff4ea9e2c150fa06cefa201cadef87cfbf9324075881" +checksum = "84bbe09b64ae13a29514048c1bb6fda6374ac0b4f6a1f15a443348ab88ef42cd" dependencies = [ - "blake3", - "fs-err", - "proc-macro2", - "quote", + "auto_impl", + "environmental", + "evm-core", + "primitive-types", + "sha3", +] + +[[package]] +name = "exit-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" +dependencies = [ + "futures 0.3.30", ] [[package]] name = "expander" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e83c02035136f1592a47964ea60c05a50e4ed8b5892cfac197063850898d4d" +checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" dependencies = [ "blake2 0.10.6", + "file-guard", "fs-err", - "prettier-please", + "prettyplease 0.2.20", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -4282,6 +4662,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" version = "1.9.0" @@ -4299,9 +4685,9 @@ checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fatality" -version = "0.0.6" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad875162843b0d046276327afe0136e9ed3a23d5a754210fb6f1f33610d39ab" +checksum = "ec6f82451ff7f0568c6181287189126d492b5654e30a788add08027b6363d019" dependencies = [ "fatality-proc-macro", "thiserror", @@ -4309,19 +4695,185 @@ dependencies = [ [[package]] name = "fatality-proc-macro" -version = "0.0.6" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" +checksum = "eb42427514b063d97ce21d5199f36c0c307d981434a6be32582bc79fe5bd2303" dependencies = [ - "expander 0.0.4", - "indexmap 1.9.3", - "proc-macro-crate 1.3.1", + "expander", + "indexmap 2.2.6", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.71", +] + +[[package]] +name = "fc-api" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "async-trait", + "fp-storage", + "parity-scale-codec", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "fc-consensus" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "async-trait", + "fp-consensus", + "fp-rpc", + "sc-consensus", + "sp-api", + "sp-block-builder", + "sp-consensus", + "sp-runtime", "thiserror", ] +[[package]] +name = "fc-db" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "async-trait", + "ethereum 0.15.0", + "fc-api", + "fc-storage", + "fp-consensus", + "fp-rpc", + "fp-storage", + "futures 0.3.30", + "kvdb-rocksdb", + "log", + "parity-db", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-client-api", + "sc-client-db", + "smallvec", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-runtime", + "sqlx", + "tokio", +] + +[[package]] +name = "fc-mapping-sync" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fc-db", + "fc-storage", + "fp-consensus", + "fp-rpc", + "futures 0.3.30", + "futures-timer", + "log", + "parking_lot 0.12.3", + "sc-client-api", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "tokio", +] + +[[package]] +name = "fc-rpc" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "evm", + "fc-api", + "fc-mapping-sync", + "fc-rpc-core", + "fc-storage", + "fp-evm", + "fp-rpc", + "fp-storage", + "futures 0.3.30", + "hex", + "jsonrpsee", + "libsecp256k1", + "log", + "pallet-evm", + "parity-scale-codec", + "prometheus", + "rand 0.8.5", + "rlp", + "sc-client-api", + "sc-consensus-aura", + "sc-network", + "sc-network-sync", + "sc-rpc", + "sc-service", + "sc-transaction-pool", + "sc-transaction-pool-api", + "sc-utils", + "schnellru", + "serde", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-core", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-timestamp", + "substrate-prometheus-endpoint", + "thiserror", + "tokio", +] + +[[package]] +name = "fc-rpc-core" +version = "1.1.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "jsonrpsee", + "rlp", + "rustc-hex", + "serde", + "serde_json", + "sp-crypto-hashing", +] + +[[package]] +name = "fc-storage" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "fp-rpc", + "fp-storage", + "parity-scale-codec", + "sc-client-api", + "sp-api", + "sp-io", + "sp-runtime", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + [[package]] name = "fdlimit" version = "0.3.0" @@ -4339,14 +4891,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", +] + +[[package]] +name = "fflonk" +version = "0.1.0" +source = "git+https://github.com/w3f/fflonk#1e854f35e9a65d08b11a86291405cdc95baa0a35" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "merlin", ] [[package]] name = "fiat-crypto" -version = "0.2.8" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "file-guard" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" +checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" +dependencies = [ + "libc", + "winapi", +] [[package]] name = "file-per-thread-logger" @@ -4382,7 +4957,7 @@ dependencies = [ "log", "num-traits", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "scale-info", ] @@ -4393,7 +4968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -4406,9 +4981,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4556222738635b7a3417ae6130d8f52201e45a0c4d1a907f0826383adb5f85e7" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "libz-sys", @@ -4424,17 +4999,55 @@ dependencies = [ "num-traits", ] +[[package]] +name = "flume" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "pin-project", + "spin 0.9.8", +] + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.8", +] + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "fork-tree" version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e93d3f0315c2eccf23453609e0ab92fe7c6ad1ca8129bcaf80b9a08c8d7fc52b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", ] @@ -4448,6 +5061,119 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "forwarded-header-value" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" +dependencies = [ + "nonempty", + "thiserror", +] + +[[package]] +name = "fp-account" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "hex", + "impl-serde", + "libsecp256k1", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "fp-consensus" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "parity-scale-codec", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "fp-dynamic-fee" +version = "1.0.0" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "async-trait", + "sp-core", + "sp-inherents", +] + +[[package]] +name = "fp-ethereum" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "fp-evm", + "frame-support", + "parity-scale-codec", +] + +[[package]] +name = "fp-evm" +version = "3.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "evm", + "frame-support", + "num_enum 0.7.2", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "fp-rpc" +version = "3.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "fp-evm", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-core", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "fp-self-contained" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "frame-support", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", +] + +[[package]] +name = "fp-storage" +version = "2.0.0" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "parity-scale-codec", + "serde", +] + [[package]] name = "fragile" version = "2.0.0" @@ -4456,9 +5182,8 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4090659c6aaa3c4d5b6c6ec909b4b0a25dec10ad92aad5f729efa8d5bd4d806a" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-support-procedural", @@ -4474,20 +5199,19 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "static_assertions", ] [[package]] name = "frame-benchmarking-cli" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efe02c96362e3c7308cdea7545859f767194a1f3f00928f0e1357f4b8a0b3b2c" +version = "32.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "Inflector", - "array-bytes 6.2.2", + "array-bytes", "chrono", "clap", "comfy-table", @@ -4496,14 +5220,15 @@ dependencies = [ "frame-system", "gethostname", "handlebars", - "itertools 0.10.5", + "itertools 0.11.0", "lazy_static", "linked-hash-map", "log", "parity-scale-codec", - "rand", + "rand 0.8.5", "rand_pcg", "sc-block-builder", + "sc-chain-spec", "sc-cli", "sc-client-api", "sc-client-db", @@ -4516,15 +5241,16 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-database", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-genesis-builder", "sp-inherents", "sp-io", "sp-keystore", "sp-runtime", "sp-state-machine", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", - "sp-wasm-interface", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "thousands", ] @@ -4532,20 +5258,18 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5c3bff645e46577c69c272733c53fa3a77d1ee6e40dfb66157bc94b0740b8fc" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "frame-election-provider-support" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87da19ee99e6473cd057ead84337d20011fe5e299c6750e88e43b8b7963b8852" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -4556,15 +5280,15 @@ dependencies = [ "sp-core", "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "frame-executive" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bff9574ee2dcc349f646e1d2faadf76afd688c2ea1bbac5e4a0e19a0c19c59" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ + "aquamarine", "frame-support", "frame-system", "frame-try-runtime", @@ -4574,8 +5298,8 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -4591,36 +5315,27 @@ dependencies = [ ] [[package]] -name = "frame-remote-externalities" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360bfdb6821372164a65933d9a6d5998f38c722360b59b69d2bf78a87ef58b2a" +name = "frame-metadata-hash-extension" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "futures 0.3.30", - "indicatif", - "jsonrpsee", + "array-bytes", + "docify", + "frame-support", + "frame-system", "log", "parity-scale-codec", - "serde", - "sp-core", - "sp-crypto-hashing", - "sp-io", + "scale-info", "sp-runtime", - "sp-state-machine", - "spinners", - "substrate-rpc-client", - "tokio", - "tokio-retry", ] [[package]] name = "frame-support" -version = "29.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e52c84b611d2049d9253f83a62ab0f093e4be5c42a7ef42ea5bb16d6611e32" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "aquamarine", - "array-bytes 6.2.2", + "array-bytes", "bitflags 1.3.2", "docify", "environmental", @@ -4640,7 +5355,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-crypto-hashing-proc-macro", - "sp-debug-derive", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-genesis-builder", "sp-inherents", "sp-io", @@ -4648,8 +5363,8 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", "static_assertions", "tt-call", @@ -4657,53 +5372,49 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf1d648c4007d421b9677b3c893256913498fff159dc2d85022cdd9cc432f3c" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse 0.1.5", - "expander 2.1.0", + "derive-syn-parse", + "expander", "frame-support-procedural-tools", - "itertools 0.10.5", + "itertools 0.11.0", "macro_magic", "proc-macro-warning", "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "frame-support-procedural-tools" version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3363df38464c47a73eb521a4f648bfcc7537a82d70347ef8af3f73b6d019e910" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "frame-support-procedural-tools-derive" version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68672b9ec6fe72d259d3879dc212c5e42e977588cdac830c76f54d9f492aeb58" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "frame-system" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc20a793c3cec0b11165c1075fe11a255b2491f3eef8230bb3073cb296e7383" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cfg-if", "docify", @@ -4715,16 +5426,15 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-version", "sp-weights", ] [[package]] name = "frame-system-benchmarking" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac47ee48fee3a0b49c9ab9ee68997dee3733776a355f780cf2858449cf495d69" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4733,14 +5443,13 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "frame-system-rpc-runtime-api" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c1b20433c3c76b56ce905ed971631ec8c34fa64cf6c20e590afe46455fc0cc8" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "sp-api", @@ -4748,15 +5457,14 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eab87d07bc2f9a2160b818d1b7506c303b3b28b6a8a5f01dc5e2641390450b5" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "parity-scale-codec", "sp-api", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -4843,6 +5551,17 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot 0.12.3", +] + [[package]] name = "futures-io" version = "0.3.30" @@ -4885,7 +5604,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -4988,13 +5707,15 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -5003,7 +5724,7 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "rand", + "rand 0.8.5", "rand_core 0.6.4", ] @@ -5023,7 +5744,7 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ - "fallible-iterator", + "fallible-iterator 0.2.0", "indexmap 1.9.3", "stable_deref_trait", ] @@ -5033,6 +5754,16 @@ name = "gimli" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator 0.3.0", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "glob" @@ -5040,6 +5771,26 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "governor" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +dependencies = [ + "cfg-if", + "dashmap", + "futures 0.3.30", + "futures-timer", + "no-std-compat", + "nonzero_ext", + "parking_lot 0.12.3", + "portable-atomic", + "quanta", + "rand 0.8.5", + "smallvec", + "spinning_top", +] + [[package]] name = "group" version = "0.13.0" @@ -5048,7 +5799,7 @@ checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -5072,9 +5823,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.5.0" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" dependencies = [ "log", "pest", @@ -5110,9 +5861,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] [[package]] name = "hashbrown" @@ -5120,16 +5868,16 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash", ] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", "serde", ] @@ -5140,7 +5888,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -5148,6 +5896,9 @@ name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "heck" @@ -5161,12 +5912,24 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + [[package]] name = "hex-literal" version = "0.3.4" @@ -5198,16 +5961,6 @@ dependencies = [ "digest 0.9.0", ] -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac 0.11.0", - "digest 0.9.0", -] - [[package]] name = "hmac" version = "0.12.1" @@ -5278,9 +6031,9 @@ checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -5296,9 +6049,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -5311,7 +6064,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.14", - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -5329,9 +6082,9 @@ dependencies = [ "hyper", "log", "rustls 0.21.12", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -5345,7 +6098,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core", ] [[package]] @@ -5368,6 +6121,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "0.5.0" @@ -5394,7 +6157,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io 2.3.2", + "async-io 2.3.3", "core-foundation", "fnv", "futures 0.3.30", @@ -5447,18 +6210,18 @@ dependencies = [ [[package]] name = "include_dir" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" dependencies = [ "include_dir_macros", ] [[package]] name = "include_dir_macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" dependencies = [ "proc-macro2", "quote", @@ -5482,7 +6245,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -5491,19 +6254,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" -[[package]] -name = "indicatif" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", -] - [[package]] name = "inout" version = "0.1.3" @@ -5515,9 +6265,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -5543,7 +6293,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] @@ -5560,7 +6310,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.6", + "socket2 0.5.7", "widestring", "windows-sys 0.48.0", "winreg", @@ -5578,7 +6328,7 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.52.0", ] @@ -5592,6 +6342,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -5610,6 +6366,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -5636,12 +6401,11 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc" +checksum = "cfdb12a2381ea5b2e68c3469ec604a007b367778cdb14d09612c8069ebd616ad" dependencies = [ "jsonrpsee-core", - "jsonrpsee-http-client", "jsonrpsee-proc-macros", "jsonrpsee-server", "jsonrpsee-types", @@ -5652,19 +6416,20 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" +checksum = "4978087a58c3ab02efc5b07c5e5e2803024536106fd5506f558db172c889b3aa" dependencies = [ "futures-util", "http", "jsonrpsee-core", "pin-project", - "rustls-native-certs", + "rustls-native-certs 0.7.1", + "rustls-pki-types", "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tokio-util", "tracing", "url", @@ -5672,73 +6437,54 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" +checksum = "b4b257e1ec385e07b0255dde0b933f948b5c8b8c28d42afda9587c3a967b896d" dependencies = [ "anyhow", - "async-lock 2.8.0", "async-trait", "beef", "futures-timer", "futures-util", "hyper", "jsonrpsee-types", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", "rustc-hash", "serde", "serde_json", - "soketto", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "jsonrpsee-http-client" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" -dependencies = [ - "async-trait", - "hyper", - "hyper-rustls", - "jsonrpsee-core", - "jsonrpsee-types", - "serde", - "serde_json", "thiserror", "tokio", - "tower", + "tokio-stream", "tracing", - "url", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29110019693a4fa2dbda04876499d098fa16d70eba06b1e6e2b3f1b251419515" +checksum = "7d0bb047e79a143b32ea03974a6bf59b62c2a4c5f5d42a381c907a8bbb3f75c0" dependencies = [ "heck 0.4.1", - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] name = "jsonrpsee-server" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c39a00449c9ef3f50b84fc00fc4acba20ef8f559f07902244abf4c15c5ab9c" +checksum = "12d8b6a9674422a8572e0b0abb12feeb3f2aeda86528c80d0350c2bd0923ab41" dependencies = [ "futures-util", "http", "hyper", "jsonrpsee-core", "jsonrpsee-types", + "pin-project", "route-recognizer", "serde", "serde_json", @@ -5753,23 +6499,22 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" +checksum = "150d6168405890a7a3231a3c74843f58b8959471f6df76078db2619ddee1d07d" dependencies = [ "anyhow", "beef", "serde", "serde_json", "thiserror", - "tracing", ] [[package]] name = "jsonrpsee-ws-client" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca9cb3933ccae417eb6b08c3448eb1cb46e39834e5b503e395e5e5bd08546c0" +checksum = "58b9db2dfd5bb1194b0ce921504df9ceae210a345bc2f6c5a61432089bbab070" dependencies = [ "http", "jsonrpsee-client-transport", @@ -5788,6 +6533,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", ] @@ -5822,7 +6568,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" dependencies = [ "kvdb", - "parking_lot 0.12.2", + "parking_lot 0.12.3", ] [[package]] @@ -5833,7 +6579,7 @@ checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "regex", "rocksdb", "smallvec", @@ -5852,9 +6598,12 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin 0.9.8", +] [[package]] name = "lazycell" @@ -5888,7 +6637,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm-builder", ] @@ -5950,7 +6699,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -5958,18 +6707,18 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -5987,7 +6736,7 @@ dependencies = [ "bytes", "futures 0.3.30", "futures-timer", - "getrandom 0.2.14", + "getrandom 0.2.15", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -6052,10 +6801,10 @@ dependencies = [ "multihash 0.17.0", "multistream-select", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "quick-protobuf", - "rand", + "rand 0.8.5", "rw-stream-sink", "smallvec", "thiserror", @@ -6072,9 +6821,9 @@ dependencies = [ "futures 0.3.30", "libp2p-core", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "smallvec", - "trust-dns-resolver", + "trust-dns-resolver 0.22.0", ] [[package]] @@ -6106,12 +6855,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ "bs58 0.4.0", - "ed25519-dalek", + "ed25519-dalek 2.1.1", "log", "multiaddr", "multihash 0.17.0", "quick-protobuf", - "rand", + "rand 0.8.5", "sha2 0.10.8", "thiserror", "zeroize", @@ -6136,7 +6885,7 @@ dependencies = [ "libp2p-swarm", "log", "quick-protobuf", - "rand", + "rand 0.8.5", "sha2 0.10.8", "smallvec", "thiserror", @@ -6158,11 +6907,11 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "log", - "rand", + "rand 0.8.5", "smallvec", "socket2 0.4.10", "tokio", - "trust-dns-proto", + "trust-dns-proto 0.22.0", "void", ] @@ -6194,7 +6943,7 @@ dependencies = [ "log", "once_cell", "quick-protobuf", - "rand", + "rand 0.8.5", "sha2 0.10.8", "snow", "static_assertions", @@ -6216,7 +6965,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "rand", + "rand 0.8.5", "void", ] @@ -6234,9 +6983,9 @@ dependencies = [ "libp2p-identity", "libp2p-tls", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "quinn-proto", - "rand", + "rand 0.8.5", "rustls 0.20.9", "thiserror", "tokio", @@ -6254,7 +7003,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand", + "rand 0.8.5", "smallvec", ] @@ -6273,7 +7022,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm-derive", "log", - "rand", + "rand 0.8.5", "smallvec", "tokio", "void", @@ -6321,7 +7070,7 @@ dependencies = [ "rustls 0.20.9", "thiserror", "webpki", - "x509-parser", + "x509-parser 0.14.0", "yasna", ] @@ -6350,7 +7099,7 @@ dependencies = [ "futures-rustls", "libp2p-core", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "quicksink", "rw-stream-sink", "soketto", @@ -6377,7 +7126,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -6409,7 +7158,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand", + "rand 0.8.5", "serde", "sha2 0.9.9", "typenum", @@ -6423,7 +7172,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -6444,11 +7193,22 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "libsqlite3-sys" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "libz-sys" -version = "1.1.16" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" dependencies = [ "cc", "pkg-config", @@ -6502,9 +7262,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lioness" @@ -6518,6 +7278,61 @@ dependencies = [ "keystream", ] +[[package]] +name = "litep2p" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f02542ae3a94b4c4ffa37dc56388c923e286afa3bf65452e3984b50b2a2f316" +dependencies = [ + "async-trait", + "bs58 0.4.0", + "bytes", + "cid 0.10.1", + "ed25519-dalek 1.0.1", + "futures 0.3.30", + "futures-timer", + "hex-literal 0.4.1", + "indexmap 2.2.6", + "libc", + "mockall 0.12.1", + "multiaddr", + "multihash 0.17.0", + "network-interface", + "nohash-hasher", + "parking_lot 0.12.3", + "pin-project", + "prost 0.11.9", + "prost-build 0.11.9", + "quinn", + "rand 0.8.5", + "rcgen", + "ring 0.16.20", + "rustls 0.20.9", + "serde", + "sha2 0.10.8", + "simple-dns", + "smallvec", + "snow", + "socket2 0.5.7", + "static_assertions", + "str0m", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tokio-util", + "tracing", + "trust-dns-resolver 0.23.2", + "uint", + "unsigned-varint", + "url", + "webpki", + "x25519-dalek 2.0.1", + "x509-parser 0.15.1", + "yasna", + "zeroize", +] + [[package]] name = "lock_api" version = "0.4.12" @@ -6560,9 +7375,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.24.0" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +checksum = "d6eab492fe7f8651add23237ea56dbf11b3c4ff762ab83d40a47f11433421f91" dependencies = [ "libc", "lz4-sys", @@ -6570,9 +7385,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +checksum = "e9764018d143cc854c9f17f0b907de70f14393b1f502da6375dce70f00514eb3" dependencies = [ "cc", "libc", @@ -6589,58 +7404,52 @@ dependencies = [ [[package]] name = "macro_magic" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "macro_magic_core" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", - "derive-syn-parse 0.1.5", + "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "macro_magic_core_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "macro_magic_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.60", + "syn 2.0.71", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "match_cfg" version = "0.1.0" @@ -6649,9 +7458,9 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "matchers" -version = "0.0.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ "regex-automata 0.1.10", ] @@ -6674,9 +7483,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memfd" @@ -6726,7 +7535,7 @@ dependencies = [ [[package]] name = "merkle-distributor" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "frame-support", "frame-system", @@ -6739,7 +7548,21 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "merkleized-metadata" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f313fcff1d2a4bcaa2deeaa00bf7530d77d5f7bd0467a117dde2e29a75a7a17a" +dependencies = [ + "array-bytes", + "blake3", + "frame-metadata", + "parity-scale-codec", + "scale-decode", + "scale-info", ] [[package]] @@ -6761,7 +7584,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" dependencies = [ "futures 0.3.30", - "rand", + "rand 0.8.5", "thrift", ] @@ -6773,9 +7596,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -6802,25 +7625,24 @@ dependencies = [ "bitflags 1.3.2", "blake2 0.10.6", "c2-chacha", - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.3", "either", "hashlink", "lioness", "log", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "rand_chacha 0.3.1", "rand_distr", - "subtle 2.5.0", + "subtle 2.6.1", "thiserror", "zeroize", ] [[package]] name = "mmr-gadget" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f62cddc29c17965ab16a051a745520d41c28d8b4c2b6188aaf661db056d67c9" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "log", @@ -6838,9 +7660,8 @@ dependencies = [ [[package]] name = "mmr-rpc" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2634b45039e064c343a0a77ed45e03ca027c84e1b250b2f3988af7cde9b7e79e" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -6862,8 +7683,23 @@ dependencies = [ "downcast", "fragile", "lazy_static", - "mockall_derive", - "predicates", + "mockall_derive 0.11.4", + "predicates 2.1.5", + "predicates-tree", +] + +[[package]] +name = "mockall" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43766c2b5203b10de348ffe19f7e54564b64f3d6018ff7648d1e2d6d3a0f0a48" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "lazy_static", + "mockall_derive 0.12.1", + "predicates 3.1.0", "predicates-tree", ] @@ -6879,6 +7715,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "mockall_derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cbce79ec385a1d4f54baa90a76401eb15d9cab93685f62e7e9f942aa00ae2" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.71", +] + +[[package]] +name = "module-evm-utility" +version = "2.21.0" +dependencies = [ + "ethereum 0.14.0", + "sha3", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "module-evm-utility-macro" +version = "2.21.0" +dependencies = [ + "module-evm-utility", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "multiaddr" version = "0.17.1" @@ -6920,7 +7787,7 @@ dependencies = [ "blake3", "core2", "digest 0.10.7", - "multihash-derive 0.8.0", + "multihash-derive 0.8.1", "sha2 0.10.8", "sha3", "unsigned-varint", @@ -6932,10 +7799,14 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", "core2", "digest 0.10.7", - "multihash-derive 0.8.0", + "multihash-derive 0.8.1", "sha2 0.10.8", + "sha3", "unsigned-varint", ] @@ -6971,16 +7842,16 @@ dependencies = [ [[package]] name = "multihash-derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" +checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 1.1.3", "proc-macro-error", "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -6996,16 +7867,16 @@ dependencies = [ [[package]] name = "multihash-derive-impl" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38685e08adb338659871ecfc6ee47ba9b22dcc8abcf6975d379cc49145c3040" +checksum = "3958713ce794e12f7c6326fac9aa274c68d74c4881dd37b3e2662b8a2046bb19" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 2.0.0", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", - "synstructure", + "syn 2.0.71", + "synstructure 0.13.1", ] [[package]] @@ -7014,6 +7885,12 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "multistream-select" version = "0.12.1" @@ -7030,9 +7907,9 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.32.5" +version = "0.32.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea4908d4f23254adda3daa60ffef0f1ac7b8c3e9a864cf3cc154b251908a2ef" +checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4" dependencies = [ "approx", "matrixmultiply", @@ -7046,13 +7923,13 @@ dependencies = [ [[package]] name = "nalgebra-macros" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" +checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] @@ -7061,7 +7938,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" dependencies = [ - "rand", + "rand 0.8.5", ] [[package]] @@ -7069,6 +7946,26 @@ name = "nanorand" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] [[package]] name = "netlink-packet-core" @@ -7136,6 +8033,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "network-interface" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a43439bf756eed340bdf8feba761e2d50c7d47175d87545cd5cbe4a137c4d1" +dependencies = [ + "cc", + "libc", + "thiserror", + "winapi", +] + [[package]] name = "nix" version = "0.24.3" @@ -7149,15 +8058,22 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", + "cfg_aliases", "libc", ] +[[package]] +name = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + [[package]] name = "no-std-net" version = "0.6.0" @@ -7186,12 +8102,48 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nonempty" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" + +[[package]] +name = "nonzero_ext" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" + [[package]] name = "normalize-line-endings" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -7204,9 +8156,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] @@ -7228,21 +8180,31 @@ dependencies = [ ] [[package]] -name = "num-integer" -version = "0.1.46" +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ + "autocfg", + "num-integer", "num-traits", ] [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -7264,15 +8226,50 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] [[package]] -name = "number_prefix" -version = "0.4.0" +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive 0.7.2", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.71", +] [[package]] name = "object" @@ -7295,6 +8292,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "object" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +dependencies = [ + "memchr", +] + [[package]] name = "oid-registry" version = "0.6.1" @@ -7322,12 +8328,60 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.3.1+3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +dependencies = [ + "cc", +] + +[[package]] +name = "openssl-sys" +version = "0.9.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -7336,9 +8390,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orchestra" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2356622ffdfe72362a45a1e5e87bb113b8327e596e39b91f11f0ef4395c8da79" +checksum = "92829eef0328a3d1cd22a02c0e51deb92a5362df3e7d21a4e9bdc38934694e66" dependencies = [ "async-trait", "dyn-clonable", @@ -7353,15 +8407,15 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eedb646674596266dc9bb2b5c7eea7c36b32ecc7777eba0d510196972d72c4fd" +checksum = "1344346d5af32c95bbddea91b18a88cc83eac394192d20ef2fc4c40a74332355" dependencies = [ - "expander 2.1.0", + "expander", "indexmap 2.2.6", "itertools 0.11.0", "petgraph", - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -7378,9 +8432,10 @@ dependencies = [ [[package]] name = "orml-oracle" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "orml-traits", @@ -7391,13 +8446,13 @@ dependencies = [ "sp-application-crypto", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "orml-tokens" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "frame-system", @@ -7408,13 +8463,13 @@ dependencies = [ "serde", "sp-arithmetic", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "orml-traits" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -7427,14 +8482,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "orml-unknown-tokens" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "frame-system", @@ -7442,14 +8497,14 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "orml-utilities" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "parity-scale-codec", @@ -7458,41 +8513,41 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "orml-xcm" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "frame-system", "pallet-xcm", "parity-scale-codec", "scale-info", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "orml-xcm-support" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "orml-traits", "parity-scale-codec", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", ] [[package]] name = "orml-xtokens" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "frame-system", @@ -7505,20 +8560,26 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", ] [[package]] -name = "pallet-asset-conversion" -version = "11.0.0" +name = "overload" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4079f12db3cf98daa717337ab5b7e5ef15aa3bec3b497f501dc715d129b500da" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pallet-asset-conversion" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-api", @@ -7526,14 +8587,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-asset-rate" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571ce57fd846911041749832b46a8c2b01f0b79ffebcd7585e3973865607036d" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7542,14 +8602,13 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-asset-tx-payment" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed783679921ad8b96807d683d320c314e305753b230d5c04dc713bab7aca64c" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7561,14 +8620,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-assets" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46728a98a910af13f6a77033dd053456650773bb7adc71e0ba845bff7e31b33e" +version = "29.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7578,14 +8636,13 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-aura" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a611bef3c8cf281e41a43f32a4153260bdc8b7b61b901e65c7a4442529224e11" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -7596,14 +8653,13 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-authority-discovery" -version = "29.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd9a381c613e6538638391fb51f353fd13b16f849d0d1ac66a388326bd456f1" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -7613,14 +8669,13 @@ dependencies = [ "sp-application-crypto", "sp-authority-discovery", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-authorship" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d83773e731a1760f99684b09961ed7b92acafe335f36f08ebb8313d3b9c72e2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -7628,14 +8683,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-babe" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3f2020c52667a650d64e84a4bbb63388e25bc1c9bc872a8243d03bfcb285049" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7653,14 +8707,13 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-bags-list" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd27bfa4bfa5751652842b81241c7eff3e68f2806d9dacc17b03d2cb20a39756" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "aquamarine", "docify", @@ -7675,15 +8728,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-balances" -version = "29.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a54b5d0c7c4c3731883d6b1ac18aff44db20c3d0a3470c8861001a17afdc85" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -7693,14 +8745,27 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "pallet-base-fee" +version = "1.0.0" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", ] [[package]] name = "pallet-beefy" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bedd80e9d8b196f31ea134efd271fdc1b8380ca3aa2d8af6ea8b5a0dc4fa460" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -7714,16 +8779,15 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-beefy-mmr" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d334f24d3c0c016d16aa87d069485847d622e8ebebace18ec5cf56609ca3a67" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "binary-merkle-tree", "frame-support", "frame-system", @@ -7740,14 +8804,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-bounties" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4765879e96676c13cdbed746d66fd59dcde1e9e65fda1f064fa2fffa3bc5d597" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7759,32 +8822,32 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-broker" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3626d7e8e49b153b84c74594e1fb4b6d64720b5a9588297d3ba3c049c3b3b9e3" +version = "0.6.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", + "sp-api", "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-child-bounties" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00fd06f2d719f5bb16ab3e836c6b053bbd92631ba694f8c2bf810013b2548167" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7797,14 +8860,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-collator-selection" -version = "10.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49d1157d9a4b7966040158a7b4f1fb29f0cefa8deb6eb9b3452df7ce4161a31c" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7814,18 +8876,135 @@ dependencies = [ "pallet-balances", "pallet-session", "parity-scale-codec", - "rand", + "rand 0.8.5", + "scale-info", + "sp-runtime", + "sp-staking", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "pallet-collective" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "pallet-conviction-voting" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "assert_matches", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "pallet-delegated-staking" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", "scale-info", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "pallet-democracy" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "pallet-dynamic-fee" +version = "4.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-dynamic-fee", + "fp-evm", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-inherents", +] + +[[package]] +name = "pallet-election-provider-multi-phase" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-election-provider-support-benchmarking", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "strum 0.26.3", +] + +[[package]] +name = "pallet-election-provider-support-benchmarking" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-system", + "parity-scale-codec", + "sp-npos-elections", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] -name = "pallet-collective" +name = "pallet-elections-phragmen" version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c362a0b8f30895c15ecc7d8c24b0d94bb586c4b9bbd37ac8053b4629d9cc80b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7835,111 +9014,156 @@ dependencies = [ "scale-info", "sp-core", "sp-io", + "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-staking", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] -name = "pallet-conviction-voting" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aee3a8b6fcde893f862993f9d45eb0fcd492dde0967fd56ef78d79fc7b53dc0" +name = "pallet-ethereum" +version = "4.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" dependencies = [ - "assert_matches", - "frame-benchmarking", + "ethereum 0.15.0", + "ethereum-types", + "evm", + "fp-consensus", + "fp-ethereum", + "fp-evm", + "fp-rpc", + "fp-storage", "frame-support", "frame-system", + "pallet-evm", "parity-scale-codec", "scale-info", - "serde", "sp-io", "sp-runtime", - "sp-std", ] [[package]] -name = "pallet-democracy" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa781d632063087bcd3ff46eb1a668f15647ab116f1c8a7c573b7168f62d72c3" +name = "pallet-evm" +version = "6.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" dependencies = [ + "environmental", + "evm", + "fp-account", + "fp-evm", "frame-benchmarking", "frame-support", "frame-system", + "hash-db 0.16.0", + "hex-literal 0.4.1", + "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std", ] [[package]] -name = "pallet-election-provider-multi-phase" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b54d1d3fe9ae61a144d581147e699b7c3009169de0019a0f87cca0bed82681e7" +name = "pallet-evm-accounts" +version = "1.1.1" dependencies = [ "frame-benchmarking", - "frame-election-provider-support", "frame-support", "frame-system", - "log", - "pallet-election-provider-support-benchmarking", + "hex-literal 0.4.1", + "orml-tokens", + "orml-traits", + "pallet-traits", "parity-scale-codec", - "rand", "scale-info", - "sp-arithmetic", "sp-core", "sp-io", - "sp-npos-elections", - "sp-runtime", - "sp-std", - "strum 0.24.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] -name = "pallet-election-provider-support-benchmarking" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46ec87816a1e32a1ab6deececa99e21e6684b111efe87b11b8298328dbbefd01" +name = "pallet-evm-accounts-rpc-runtime-api" +version = "1.0.0" dependencies = [ - "frame-benchmarking", - "frame-election-provider-support", - "frame-system", "parity-scale-codec", - "sp-npos-elections", - "sp-runtime", - "sp-std", + "sp-api", ] [[package]] -name = "pallet-elections-phragmen" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cb0158cc7461fda5db04c5791d0df34635bec37181763aca449bade677d12d" +name = "pallet-evm-chain-id" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" dependencies = [ - "frame-benchmarking", "frame-support", "frame-system", - "log", "parity-scale-codec", "scale-info", +] + +[[package]] +name = "pallet-evm-precompile-blake2" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", +] + +[[package]] +name = "pallet-evm-precompile-bn128" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", "sp-core", - "sp-io", - "sp-npos-elections", + "substrate-bn", +] + +[[package]] +name = "pallet-evm-precompile-dispatch" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "frame-support", + "pallet-evm", + "parity-scale-codec", "sp-runtime", - "sp-staking", - "sp-std", +] + +[[package]] +name = "pallet-evm-precompile-modexp" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "num", +] + +[[package]] +name = "pallet-evm-precompile-sha3fips" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "tiny-keccak", +] + +[[package]] +name = "pallet-evm-precompile-simple" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "ripemd", + "sp-io", ] [[package]] name = "pallet-fast-unstake" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2222607a0dba10a9d57cab5360a6549b5fda925181c3c7af481246c0964998df" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -7952,14 +9176,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-grandpa" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b20be8592eed7ebca2ee661fc43450088552ebe0bd483d7b101cf5968ab12d" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7976,14 +9199,13 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-identity" version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e1cae19e30e7dc822c419988b30bb1318d79a8d5da92733822d0e84fe760ca" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7994,14 +9216,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-im-online" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598ea5c87351edc953d1f455f32ff456cf2f1daf7bbada1f1e03be8e384852ab" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8015,14 +9236,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-indices" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e880ebdb429ca76fb400b1b361ed7fce018a5ea2fc2da4764de5156fffdfa73" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8033,14 +9253,13 @@ dependencies = [ "sp-io", "sp-keyring", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-membership" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad901cdf3de23daf23ff8b092ab318b13faebfc1aa4d84263f2fdc84feaf3e9b" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8051,14 +9270,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-message-queue" -version = "32.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccb23dee70b184a214d729db550117a0965a69107d466d35181d60a6feede38" +version = "31.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "environmental", "frame-benchmarking", @@ -8071,15 +9289,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", ] [[package]] name = "pallet-mmr" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f1f23a70764dad2b4094d8be12ebbb82df210f2e80dd36fa941a5ac191c6cd" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8091,14 +9308,13 @@ dependencies = [ "sp-io", "sp-mmr-primitives", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-multisig" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176f6a5c170185f892a047c0ae189bc52eb390f2c0b94d4261ed0ebc7f82a548" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8108,14 +9324,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-nis" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a64a0e80dec2c60d5962dd249061a47dc4356db440f26cdec50b8acaded1d3" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8125,14 +9340,13 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-nomination-pools" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f14519c1c613d2f8c95c27015864c11a37969a23deeba9f6dbaff4276e1b81c" +version = "25.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8144,48 +9358,46 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-nomination-pools-benchmarking" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a1eba3078e2492cad15e4695f90eb3fc570386d9f71f8b81f709c7123fc6b5" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-support", "frame-system", "pallet-bags-list", + "pallet-delegated-staking", "pallet-nomination-pools", "pallet-staking", "parity-scale-codec", "scale-info", "sp-runtime", - "sp-runtime-interface", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-nomination-pools-runtime-api" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5b35e6c471a669437b987ff02e11e2283412c9ebaeec5334dec3f73bcea652" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-offences" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b5bcfdc4f6032d7570929094fd459de12d840c440c395fb4d365d679e13eda" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8196,14 +9408,13 @@ dependencies = [ "serde", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-offences-benchmarking" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbc33e3086c19235cb903cbbbde1bc1c4f428519ad4c23446dc84c75d0061582" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8221,14 +9432,31 @@ dependencies = [ "scale-info", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "pallet-parameters" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-preimage" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7344a30c304771beb90aec34604100185e47cdc0366e268ad18922de602a0c7e" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8239,7 +9467,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -8265,15 +9493,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "pallet-proxy" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7aa31a0b91e8060b808c3e3407e4578a5e94503b174b9e99769147b24fb2c56" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8282,14 +9509,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-ranked-collective" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3733dbfc44d8f5e1a08287a9064e5794e9d0e92b1bd68cdad2e22202b1964528" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8302,14 +9528,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-recovery" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "797b554ddc87082c18223440d61a81cf35ccab6573321ce473a099e7a709a760" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8318,14 +9543,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-referenda" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da850889e7101b63cadb980b7f39df67feb6d63bc6092769b9b708e9eb596db1" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8338,14 +9562,13 @@ dependencies = [ "sp-arithmetic", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-root-testing" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59171cbf2b823c13685b1b80dd3e1e84425680ff4e006d8016f8c14d2ec44974" +version = "4.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8354,14 +9577,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-scheduler" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e2a4ebe6a5f98b14a26deed8d7a1ea28bb2c2d3ad4d6dc129a725523a2042d" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8372,15 +9594,14 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", ] [[package]] name = "pallet-session" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7412ac59247b300feee53709f7009a23d1c6f8c70528599f48f44e102d896d03" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8395,15 +9616,14 @@ dependencies = [ "sp-session", "sp-staking", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", ] [[package]] name = "pallet-session-benchmarking" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9c2731415381020db1e78db8b40207f8423a16099e78f2fde599cbcb57ea8db" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8411,36 +9631,34 @@ dependencies = [ "pallet-session", "pallet-staking", "parity-scale-codec", - "rand", + "rand 0.8.5", "sp-runtime", "sp-session", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-society" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba64f96619c25ae7a0b41f4a5111c2d3102e8b8c6cbce80ece6955e825f9de2" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", "parity-scale-codec", - "rand_chacha 0.2.2", + "rand_chacha 0.3.1", "scale-info", "sp-arithmetic", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-staking" -version = "29.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668b7d28c499f0d9f295fad26cf6c342472e21842e3b13bcaaac8536358b2d6c" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8450,33 +9668,31 @@ dependencies = [ "pallet-authorship", "pallet-session", "parity-scale-codec", - "rand_chacha 0.2.2", + "rand_chacha 0.3.1", "scale-info", "serde", "sp-application-crypto", "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-staking-reward-curve" version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efca5a4a423427d2c83af5fe07ab648c16b91e3782c3cc23316fe0bd96b4c794" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "pallet-staking-reward-fn" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505d45e08bad052f55fb51f00a6b6244d23ee46ffdc8091f6cddf4e3a880319d" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "log", "sp-arithmetic", @@ -8484,9 +9700,8 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237d7b5a10cb6cba727c3e957fb241776302aa3cce589e6759ba53f50129c1a5" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "sp-api", @@ -8495,9 +9710,8 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e52dedc146b7a9c3b7c5a6ff4c4c442a8ab8cc58ec30e90e1e98cdc51ad34" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8508,14 +9722,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-sudo" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d02f7855d411913e77e57126f4a8b8a32d90d9bf47d0b747e367a1301729c3" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8525,14 +9738,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-timestamp" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b8810ddfb254c7fb8cd7698229cce513d309a43ff117b38798dae6120f477b" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8544,16 +9756,15 @@ dependencies = [ "sp-inherents", "sp-io", "sp-runtime", - "sp-std", - "sp-storage", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-timestamp", ] [[package]] name = "pallet-tips" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca4b9921c9e9b59e8eeb64677ba6ec49743ef5fe98e0b63f77411b2b9f6cc99" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8566,7 +9777,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -8586,7 +9797,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -8594,9 +9805,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f690f5c287ad34b28ca951ef7fae80b08cc9218d970723b7a70e4d29396872" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8606,14 +9816,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-transaction-payment-rpc" -version = "31.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ef209d2d5d077e325bf49b024fd2eff109a5c2ca0d84ce0d50a65839e6b026" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -8628,9 +9837,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c78bcba80c7c61712b98a6b5640975ebd25ceb688c18e975af78a0fac81785b0" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8641,9 +9849,8 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1605eb5083a2cd172544f33c6e59eca2e23ac49f02f13d1562b1b8a409df9c60" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8656,14 +9863,31 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "pallet-tx-pause" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "pallet-proxy", + "pallet-utility", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-utility" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "954f15b98c3fdebb763bb5cea4ec6803fd180d540ec5b07a9fcb2c118251d52c" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8673,14 +9897,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-vesting" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4525f3038cdf078fea39d913c563ca626f09a615e7724f0c9eac97743c75ff44" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8689,14 +9912,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-whitelist" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0ad4ce05688bdddcdb682cbed2f3edff0ee5349f0b745ebacc27d179582432" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8705,14 +9927,13 @@ dependencies = [ "scale-info", "sp-api", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-xcm" -version = "8.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13f5c598737e84294880333170d1df3868a11ad7ee79d0b1d1af37365e1c277" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8726,17 +9947,17 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", + "xcm-fee-payment-runtime-api", ] [[package]] name = "pallet-xcm-benchmarks" -version = "8.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c10e1c92086ce2069a3d2387d9431f48660b6ec92054c4d0a4e30a9f54e7ad3" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8746,7 +9967,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -8754,9 +9975,8 @@ dependencies = [ [[package]] name = "parachains-common" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34aa00981a24a2b772afaa49e258f9bcd6bb372db060a05614becc1c74d4456" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", @@ -8777,13 +9997,26 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-parachain-info", "staging-xcm", "staging-xcm-executor", "substrate-wasm-builder", ] +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + [[package]] name = "parity-db" version = "0.4.13" @@ -8798,8 +10031,8 @@ dependencies = [ "log", "lz4", "memmap2 0.5.10", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "siphasher", "snap", "winapi", @@ -8863,9 +10096,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core 0.9.10", @@ -8893,9 +10126,9 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.5.3", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -8905,20 +10138,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" [[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pbkdf2" -version = "0.8.0" +name = "password-hash" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ - "crypto-mac 0.11.0", + "base64ct", + "rand_core 0.6.4", + "subtle 2.6.1", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "pbkdf2" version = "0.12.2" @@ -8926,6 +10161,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", + "password-hash", ] [[package]] @@ -8951,9 +10187,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.9" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", "thiserror", @@ -8962,9 +10198,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.9" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" dependencies = [ "pest", "pest_generator", @@ -8972,22 +10208,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.9" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "pest_meta" -version = "2.7.9" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", @@ -8996,9 +10232,9 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap 2.2.6", @@ -9021,7 +10257,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -9044,9 +10280,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" dependencies = [ "atomic-waker", "fastrand 2.1.0", @@ -9069,22 +10305,15 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "platforms" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" - [[package]] name = "polkadot-approval-distribution" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdfa52beecc446ccf733dede1a0089e6396d3df13401004d27c0ce2530816bc" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "futures 0.3.30", "futures-timer", - "itertools 0.10.5", + "itertools 0.11.0", "polkadot-node-jaeger", "polkadot-node-metrics", "polkadot-node-network-protocol", @@ -9092,15 +10321,14 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand", + "rand 0.8.5", "tracing-gum", ] [[package]] name = "polkadot-availability-bitfield-distribution" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80ffc856dfbdb31178625760824ae320ddb7dd5694b217f489bd2832b8de15a5" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "always-assert", "futures 0.3.30", @@ -9109,15 +10337,14 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand", + "rand 0.8.5", "tracing-gum", ] [[package]] name = "polkadot-availability-distribution" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d05c26cc8d6fa0f5f432d9de880f20ad0d24ca51a618834ea6612d1bd96ab1" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "derive_more", "fatality", @@ -9129,7 +10356,8 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand", + "rand 0.8.5", + "sc-network", "schnellru", "sp-core", "sp-keystore", @@ -9139,9 +10367,8 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d77e0b979f43861ab4c78c216c2729644bb12812f9bc859858bd3b8fc56b4d6" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "fatality", @@ -9153,7 +10380,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand", + "rand 0.8.5", "sc-network", "schnellru", "thiserror", @@ -9162,10 +10389,19 @@ dependencies = [ ] [[package]] -name = "polkadot-cli" -version = "8.0.0" +name = "polkadot-ckb-merkle-mountain-range" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef362c44280e3883a39ca452acc4a4fb61a18250d634d68578b22df7edd8290c" +checksum = "a4b44320e5f7ce2c18227537a3032ae5b2c476a7e8eddba45333e1011fc31b92" +dependencies = [ + "cfg-if", + "itertools 0.10.5", +] + +[[package]] +name = "polkadot-cli" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cfg-if", "clap", @@ -9185,16 +10421,15 @@ dependencies = [ "sp-io", "sp-keyring", "sp-maybe-compressed-blob", + "sp-runtime", "substrate-build-script-utils", "thiserror", - "try-runtime-cli", ] [[package]] name = "polkadot-collator-protocol" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507391f1be9f9b9a8fbf28ca13b0ab3f04947a54a1115d423d115aacf8889bf4" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "fatality", @@ -9215,22 +10450,20 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a08e4e014c853b252ecbbe3ccd67b2d33d78e46988d309b8cccf4ac06e25ef" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "polkadot-dispute-distribution" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae32e83ef6bc0ec2874c76c19dff8f3795832ccc27f0abc587a7137994c42d26" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "derive_more", "fatality", @@ -9254,9 +10487,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b10514ace3272d38b602e1795a5a340b265285c4af875473d682a5c9d6c831c" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -9269,9 +10501,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01f05f7f60022d4beb30414f1f7c7e4ae728fea02086a4a0f8ff0a73e73ea4aa" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "futures-timer", @@ -9279,7 +10510,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "sc-network", "sc-network-common", @@ -9292,9 +10523,8 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049ec1298ac6e96bcf4d980cd5864aceeee73b3298ab5d6dd7a3193d47578abc" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "always-assert", "async-trait", @@ -9302,7 +10532,7 @@ dependencies = [ "fatality", "futures 0.3.30", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -9316,9 +10546,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f1211ab8b154c2e2b4b89c64f57f96056c881e4fcfa2ce29b6e5cbc978e74f1" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "parity-scale-codec", @@ -9335,15 +10564,14 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61a17b7e4edd3b73afbe0c6e8b5369bf3b721361a232baf11fb1698077067a4" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "derive_more", "futures 0.3.30", "futures-timer", - "itertools 0.10.5", + "itertools 0.11.0", "kvdb", "merlin", "parity-scale-codec", @@ -9353,7 +10581,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", "sc-keystore", @@ -9369,9 +10597,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b334f06423ff701e4b807d6832741ec24e0e97ebc13b560fc99bc0652926c0" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "futures 0.3.30", @@ -9392,9 +10619,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f07f8840f3f2f0bee6264c18ce471c99c925f9afb65952e1d584b6d773cf4115" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "fatality", @@ -9413,9 +10639,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0687006f843d6da8687eb24da735a04cbdcf4c3a98d82055b9b3a9047537e17e" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "polkadot-node-subsystem", @@ -9429,9 +10654,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3035acf9069801e980b91b5178591f8a7052b4409de13824db7a6c798b36b98" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -9451,9 +10675,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c990b9ffdde6725fe79f55e3b7c4c32ce2134a06103708476fa595a4ac652e95" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "polkadot-node-metrics", @@ -9466,9 +10689,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451965f3ace786d392c407872d61324765061b87027890b02ffd625554531f97" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "futures-timer", @@ -9484,9 +10706,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13ea9d5b4aa43b5b1f718c3ec951adff0b0d74909cb1fe28206f5d88492247d" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "fatality", "futures 0.3.30", @@ -9504,9 +10725,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6574c0bda4e10d722f761d4b8ab5d1708f0f963e5840370aa9cee8f559c90a23" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -9522,9 +10742,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-prospective-parachains" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "160f80a11b9d2b8e36e510ea54ce5b06e77179c0c502f7e19e5a5809bc1523ee" +version = "6.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "fatality", @@ -9540,9 +10759,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d0a64371700537c3dc15b3956536e4541f093b7c38ac21737ea9fea3562a83" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "fatality", @@ -9552,24 +10770,22 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", + "schnellru", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bbb1b5f4b966f21a0336e94c0a0222958d2f3cba451da1157af271d07f9748" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "always-assert", - "array-bytes 6.2.2", + "array-bytes", "blake3", "cfg-if", "futures 0.3.30", "futures-timer", - "is_executable", - "libc", "parity-scale-codec", "pin-project", "polkadot-core-primitives", @@ -9579,11 +10795,9 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-parachain-primitives", "polkadot-primitives", - "rand", + "rand 0.8.5", "slotmap", "sp-core", - "sp-maybe-compressed-blob", - "sp-wasm-interface", "tempfile", "thiserror", "tokio", @@ -9592,9 +10806,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ab4a91e62a9f7e67cf400931578f2505417cc43a32ac29458163604f2b277b" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "polkadot-node-primitives", @@ -9609,16 +10822,14 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003981d3b63e4f527ef7f03cbe280e41ec649d9be365668887f0b107610640f4" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "cfg-if", "cpu-time", "futures 0.3.30", "landlock", "libc", - "nix 0.27.1", + "nix 0.28.0", "parity-scale-codec", "polkadot-parachain-primitives", "polkadot-primitives", @@ -9628,18 +10839,17 @@ dependencies = [ "seccompiler", "sp-core", "sp-crypto-hashing", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-io", - "sp-tracing", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-core-runtime-api" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6ea6a03f297b7387fc59c41c3c32285803971cb27e81d7e9ca696824d6773" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "polkadot-node-metrics", @@ -9653,18 +10863,18 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d113b48e7b6126964c3a790b101d99e17fd3cb75a92e94d54587ce1340df21" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "lazy_static", "log", "mick-jaeger", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-primitives", "sc-network", + "sc-network-types", "sp-core", "thiserror", "tokio", @@ -9672,9 +10882,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef2e2a934f0d0d606fcfc53fc26f4cacd8b9f18fb2118829203fa813af2cdae" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bs58 0.5.1", "futures 0.3.30", @@ -9692,9 +10901,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07f9e67b0f25d695947a15b6fe8ee6f8e83f3dfcbca124a13281c0edd0dc4703" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -9707,19 +10915,20 @@ dependencies = [ "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-primitives", - "rand", + "rand 0.8.5", "sc-authority-discovery", "sc-network", - "strum 0.24.1", + "sc-network-types", + "sp-runtime", + "strum 0.26.3", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-primitives" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375744eee7a53576387e14856e1c65be8ecef8b449567bb2cff85706266c8912" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "bounded-vec", @@ -9741,9 +10950,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d6c226cdbcd48ab1e506d8512f0fb01839f9a72eec2fc0cf7771f6d3352171" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -9752,13 +10960,13 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1404525da0ab9d44bac1041449bf0c5576240f9031b305dc41654567e98b6021" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "bitvec", "derive_more", + "fatality", "futures 0.3.30", "orchestra", "polkadot-node-jaeger", @@ -9768,6 +10976,7 @@ dependencies = [ "polkadot-statement-table", "sc-client-api", "sc-network", + "sc-network-types", "sc-transaction-pool-api", "smallvec", "sp-api", @@ -9781,21 +10990,21 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65a7d101f28bf718d15f01a060ed8cf7a7e2d8d5705c494b49ece696cada0adf" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "derive_more", "fatality", "futures 0.3.30", "futures-channel", - "itertools 0.10.5", + "itertools 0.11.0", "kvdb", "parity-db", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", + "polkadot-erasure-coding", "polkadot-node-jaeger", "polkadot-node-metrics", "polkadot-node-network-protocol", @@ -9805,7 +11014,7 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "prioritized-metered-channel", - "rand", + "rand 0.8.5", "sc-client-api", "schnellru", "sp-application-crypto", @@ -9817,15 +11026,14 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5ed988deffeddf440473586f62efc5dd498f6016e6650881db09dd60b3b24f" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", "futures-timer", "orchestra", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -9840,9 +11048,8 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248ab090959a92e61493277e33b7e85104280a4beb4cb0815137d3c8c50a07f4" +version = "6.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bounded-collections", "derive_more", @@ -9852,15 +11059,14 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", ] [[package]] name = "polkadot-primitives" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d5f9930210cab0233d81204415c9ef4a8889cdf3e60de1435250481a2773ca" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "hex-literal 0.4.1", @@ -9881,14 +11087,13 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "polkadot-rpc" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb4747cb8faa532e8446b38b74266fd626d6b660fe6b00776dd6c4543cc0457f" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -9908,10 +11113,12 @@ dependencies = [ "sc-sync-state-rpc", "sc-transaction-pool-api", "sp-api", + "sp-application-crypto", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", + "sp-consensus-beefy", "sp-keystore", "sp-runtime", "substrate-frame-rpc-system", @@ -9920,9 +11127,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06afbb3bd10245ad1907242a98ddffc3c0c1e209738b8382bc5bcfc1f28c0429" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "frame-benchmarking", @@ -9963,7 +11169,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -9972,23 +11178,21 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3566c6fd0c21b5dd555309427c984cf506f875ee90f710acea295b478fecbe0" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bs58 0.5.1", "frame-benchmarking", "parity-scale-codec", "polkadot-primitives", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "polkadot-runtime-parachains" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bcfd672be236fd1c38c702e7e99fe3f3e54df0ddb8127e542423221d1f50669" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -10013,7 +11217,7 @@ dependencies = [ "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-metrics", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "rustc-hex", "scale-info", @@ -10028,7 +11232,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", "static_assertions", @@ -10036,9 +11240,8 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2fd665185877bec296588c7cf1ec0ef75e0545050b5e1d42d94240a284149da" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "frame-benchmarking", @@ -10054,13 +11257,12 @@ dependencies = [ "log", "mmr-gadget", "pallet-babe", - "pallet-im-online", "pallet-staking", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "parity-db", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-approval-distribution", "polkadot-availability-bitfield-distribution", "polkadot-availability-distribution", @@ -10141,22 +11343,23 @@ dependencies = [ "sp-runtime", "sp-session", "sp-state-machine", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-timestamp", "sp-transaction-pool", "sp-version", "sp-weights", + "staging-xcm", "substrate-prometheus-endpoint", "thiserror", "tracing-gum", "westend-runtime", + "xcm-fee-payment-runtime-api", ] [[package]] name = "polkadot-statement-distribution" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff6d16cbd994987f48a9f107f12e4c7fff26cdd71df6288e9521adc7cff3427" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -10178,9 +11381,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5e010da3c6a65d8f263d0f825a04d995ffc8a37f886f674fcbbc73bf158d01" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -10188,6 +11390,89 @@ dependencies = [ "tracing-gum", ] +[[package]] +name = "polkavm" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a3693e5efdb2bf74e449cd25fd777a28bd7ed87e41f5d5da75eb31b4de48b94" +dependencies = [ + "libc", + "log", + "polkavm-assembler", + "polkavm-common", + "polkavm-linux-raw", +] + +[[package]] +name = "polkavm-assembler" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa96d6d868243acc12de813dd48e756cbadcc8e13964c70d272753266deadc1" +dependencies = [ + "log", +] + +[[package]] +name = "polkavm-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" +dependencies = [ + "log", +] + +[[package]] +name = "polkavm-derive" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" +dependencies = [ + "polkavm-derive-impl-macro", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" +dependencies = [ + "polkavm-common", + "proc-macro2", + "quote", + "syn 2.0.71", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" +dependencies = [ + "polkavm-derive-impl", + "syn 2.0.71", +] + +[[package]] +name = "polkavm-linker" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" +dependencies = [ + "gimli 0.28.1", + "hashbrown 0.14.5", + "log", + "object 0.32.2", + "polkavm-common", + "regalloc2 0.9.3", + "rustc-demangle", +] + +[[package]] +name = "polkavm-linux-raw" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26e85d3456948e650dff0cfc85603915847faf893ed1e66b020bb82ef4557120" + [[package]] name = "polling" version = "2.8.0" @@ -10206,13 +11491,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi", + "hermit-abi 0.4.0", "pin-project-lite 0.2.14", "rustix 0.38.34", "tracing", @@ -10274,6 +11559,16 @@ dependencies = [ "regex", ] +[[package]] +name = "predicates" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" +dependencies = [ + "anstyle", + "predicates-core", +] + [[package]] name = "predicates-core" version = "1.0.6" @@ -10290,21 +11585,11 @@ dependencies = [ "termtree", ] -[[package]] -name = "prettier-please" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" -dependencies = [ - "proc-macro2", - "syn 2.0.60", -] - [[package]] name = "prettyplease" -version = "0.1.11" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28f53e8b192565862cf99343194579a022eb9c7dd3a8d03134734803c7b3125" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", "syn 1.0.109", @@ -10312,12 +11597,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -10352,12 +11637,21 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "thiserror", + "toml 0.5.11", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", ] [[package]] @@ -10401,29 +11695,29 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ "cfg-if", "fnv", "lazy_static", "memchr", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "thiserror", ] @@ -10435,7 +11729,7 @@ checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus-client-derive-encode", ] @@ -10447,7 +11741,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -10462,12 +11756,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.5", + "prost-derive 0.12.6", ] [[package]] @@ -10481,17 +11775,38 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "log", - "multimap", + "multimap 0.8.3", "petgraph", - "prettyplease 0.1.11", + "prettyplease 0.1.25", "prost 0.11.9", - "prost-types", + "prost-types 0.11.9", "regex", "syn 1.0.109", "tempfile", "which", ] +[[package]] +name = "prost-build" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +dependencies = [ + "bytes", + "heck 0.5.0", + "itertools 0.12.1", + "log", + "multimap 0.10.0", + "once_cell", + "petgraph", + "prettyplease 0.2.20", + "prost 0.12.6", + "prost-types 0.12.6", + "regex", + "syn 2.0.71", + "tempfile", +] + [[package]] name = "prost-derive" version = "0.11.9" @@ -10507,15 +11822,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -10528,12 +11843,36 @@ dependencies = [ ] [[package]] -name = "psm" -version = "0.1.21" +name = "prost-types" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +dependencies = [ + "prost 0.12.6", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "quanta" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" dependencies = [ - "cc", + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi 0.11.0+wasi-snapshot-preview1", + "web-sys", + "winapi", ] [[package]] @@ -10575,6 +11914,24 @@ dependencies = [ "pin-project-lite 0.1.12", ] +[[package]] +name = "quinn" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" +dependencies = [ + "bytes", + "pin-project-lite 0.2.14", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.20.9", + "thiserror", + "tokio", + "tracing", + "webpki", +] + [[package]] name = "quinn-proto" version = "0.9.6" @@ -10582,7 +11939,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ "bytes", - "rand", + "rand 0.8.5", "ring 0.16.20", "rustc-hash", "rustls 0.20.9", @@ -10593,6 +11950,19 @@ dependencies = [ "webpki", ] +[[package]] +name = "quinn-udp" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" +dependencies = [ + "libc", + "quinn-proto", + "socket2 0.4.10", + "tracing", + "windows-sys 0.42.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -10608,6 +11978,19 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + [[package]] name = "rand" version = "0.8.5" @@ -10654,7 +12037,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", ] [[package]] @@ -10664,7 +12047,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", ] [[package]] @@ -10676,6 +12068,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "raw-cpuid" +version = "11.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -10734,11 +12135,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -10747,7 +12148,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", "libredox", "thiserror", ] @@ -10766,22 +12167,22 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -10796,16 +12197,29 @@ dependencies = [ "smallvec", ] +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -10819,13 +12233,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -10836,9 +12250,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "resolv-conf" @@ -10857,7 +12271,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle 2.5.0", + "subtle 2.6.1", +] + +[[package]] +name = "ring" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof#665f5f51af5734c7b6d90b985dd6861d4c5b4752" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "arrayvec 0.7.4", + "blake2 0.10.6", + "common", + "fflonk", + "merlin", ] [[package]] @@ -10883,7 +12314,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.14", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -10933,13 +12364,14 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d089e93be2b8b76dd0d4b794a6a995ca3a1d6cb0ea3dd1cd42462f048bcfc926" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "binary-merkle-tree", + "bitvec", "frame-benchmarking", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -10962,7 +12394,6 @@ dependencies = [ "pallet-elections-phragmen", "pallet-grandpa", "pallet-identity", - "pallet-im-online", "pallet-indices", "pallet-membership", "pallet-message-queue", @@ -10970,6 +12401,7 @@ dependencies = [ "pallet-multisig", "pallet-nis", "pallet-offences", + "pallet-parameters", "pallet-preimage", "pallet-proxy", "pallet-ranked-collective", @@ -11001,6 +12433,7 @@ dependencies = [ "scale-info", "serde", "serde_derive", + "serde_json", "smallvec", "sp-api", "sp-arithmetic", @@ -11008,6 +12441,7 @@ dependencies = [ "sp-block-builder", "sp-consensus-babe", "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core", "sp-genesis-builder", "sp-inherents", @@ -11017,8 +12451,8 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", - "sp-storage", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-version", "staging-xcm", @@ -11026,13 +12460,13 @@ dependencies = [ "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", + "xcm-fee-payment-runtime-api", ] [[package]] name = "rococo-runtime-constants" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b45c21ccb0f8777512a65510c106aeee4b59682944b9a5cb31cd7b8ed4ccb47" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "polkadot-primitives", @@ -11089,9 +12523,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -11111,7 +12545,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.23", ] [[package]] @@ -11157,10 +12591,10 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] @@ -11184,10 +12618,24 @@ checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.5", + "subtle 2.6.1", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -11195,7 +12643,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "schannel", "security-framework", ] @@ -11209,6 +12670,22 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -11219,11 +12696,22 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ruzstd" @@ -11249,15 +12737,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safe_arch" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" dependencies = [ "bytemuck", ] @@ -11273,36 +12761,36 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357127c91373ed6d1ae582f6e3300ab5b13bcde43bbf270a891f44194ef48b70" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "log", "sp-core", - "sp-wasm-interface", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", ] [[package]] name = "sc-authority-discovery" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb3c14cb8022844835a6f7209196b8c6544d389fe5d2972d8df2ae4ca75afbe" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", "futures-timer", "ip_network", "libp2p", + "linked_hash_set", "log", - "multihash 0.18.1", + "multihash 0.17.0", "multihash-codetable", "parity-scale-codec", - "prost 0.12.4", - "prost-build", - "rand", + "prost 0.12.6", + "prost-build 0.12.6", + "rand 0.8.5", "sc-client-api", "sc-network", + "sc-network-types", "sp-api", "sp-authority-discovery", "sp-blockchain", @@ -11315,9 +12803,8 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "724c3a6eee5f0829a1b79a15e12d63ed81b33281b14004a6331a8883b2fd8fd1" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "futures-timer", @@ -11338,9 +12825,8 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8b0640994965c6ff3afa13242d95a61611b83da21fd86ac2b1ebd03e241a02" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "sp-api", @@ -11355,10 +12841,9 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f73880050f8b04fed7f6301279ef3899df13a3891bd06156d56f9a1c50fefba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "docify", "log", "memmap2 0.9.4", @@ -11377,38 +12862,37 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "sc-chain-spec-derive" version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2e80fbdaea194762d4b4b0eec389037c25ad102676203b42d684774ae3019b8" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sc-cli" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a284c10ea92b1fe789b9f0e5815d393f3a1e3bf6a4adaa884f24e36143b83b" +version = "0.36.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", - "bip39", + "array-bytes", "chrono", "clap", "fdlimit", "futures 0.3.30", - "itertools 0.10.5", + "itertools 0.11.0", "libp2p-identity", "log", "names", + "parity-bip39", "parity-scale-codec", - "rand", + "rand 0.8.5", "regex", "rpassword", "sc-client-api", @@ -11435,15 +12919,14 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e914dfadaaf384d8869ae47f3ec783bf6a1ac24e7827f5fec2e0e649a450a91" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "fnv", "futures 0.3.30", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -11452,20 +12935,19 @@ dependencies = [ "sp-consensus", "sp-core", "sp-database", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-runtime", "sp-state-machine", "sp-statement-store", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f08c4f29e6d2b8915bab6435b8817fa39ef7708c04a7cf6226f803e133b017c" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hash-db 0.16.0", "kvdb", @@ -11475,7 +12957,7 @@ dependencies = [ "log", "parity-db", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-state-db", "schnellru", @@ -11490,18 +12972,17 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e1ac2c698b828073982b6f5b1a466fcc345a452983356af74254ade8e9987d" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", "futures-timer", - "libp2p-identity", "log", - "mockall", - "parking_lot 0.12.2", + "mockall 0.11.4", + "parking_lot 0.12.3", "sc-client-api", + "sc-network-types", "sc-utils", "serde", "sp-api", @@ -11516,9 +12997,8 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a16fd09794291795ad43ea1df7190083f9a47fc0a73e9b8ec0ae98fbe53a2b34" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -11546,9 +13026,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ec3dc31f8fd024684d1306488836680558b680a8ec38219e19f20854811f02" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "fork-tree", @@ -11558,7 +13037,7 @@ dependencies = [ "num-rational", "num-traits", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-consensus", "sc-consensus-epochs", @@ -11583,9 +13062,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf2b3004672f9eea0d9af6c9b944fa3ef0bc72fd88cea9075cdf6dc96d1439ac" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "jsonrpsee", @@ -11606,23 +13084,23 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ce3ee15eff7fa642791966d427f185184df3c7f4e58893705f3e7781da8ef5" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "async-trait", "fnv", "futures 0.3.30", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-consensus", "sc-network", "sc-network-gossip", "sc-network-sync", + "sc-network-types", "sc-utils", "sp-api", "sp-application-crypto", @@ -11633,7 +13111,6 @@ dependencies = [ "sp-core", "sp-crypto-hashing", "sp-keystore", - "sp-mmr-primitives", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", @@ -11643,18 +13120,18 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1ed5e8ac2cb53c6a248c8f469353f55bd23c72f23fe371ac19c1d46618de1a" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-consensus-beefy", "sc-rpc", "serde", + "sp-application-crypto", "sp-consensus-beefy", "sp-core", "sp-runtime", @@ -11663,9 +13140,8 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f68ddb91626f901578515eed93c7919f739660161f4e9f7b9407e2d0ede981" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "fork-tree", "parity-scale-codec", @@ -11677,12 +13153,11 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae91e5b5a120be4d13a59eaf94fd85d7c7af528482b8e21d861fa1167df3083" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "ahash 0.8.11", - "array-bytes 6.2.2", + "ahash", + "array-bytes", "async-trait", "dyn-clone", "finality-grandpa", @@ -11691,8 +13166,8 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -11701,6 +13176,7 @@ dependencies = [ "sc-network-common", "sc-network-gossip", "sc-network-sync", + "sc-network-types", "sc-telemetry", "sc-transaction-pool-api", "sc-utils", @@ -11721,9 +13197,8 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697cbd528516561dbc818a8990d5477169e86d9335a0b29207cf6f6a90269e7c" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "finality-grandpa", "futures 0.3.30", @@ -11742,9 +13217,8 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c26241f1846c897626b141e2568dbf9088036a1b18b241de23fcebc7a8f5e2e" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "assert_matches", "async-trait", @@ -11778,9 +13252,8 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567bddd65d52951fb9bc7a7e05d1dfdfc47ff2c594ec5ca9756d27e7226635bb" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -11802,64 +13275,73 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2ac6c356538d67987bbb867e11a12a84ba87250c70fd50005b6d74f570a4f7" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-executor-common", + "sc-executor-polkavm", "sc-executor-wasmtime", "schnellru", "sp-api", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-io", "sp-panic-handler", - "sp-runtime-interface", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "sp-version", - "sp-wasm-interface", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "tracing", ] [[package]] name = "sc-executor-common" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07498138dee3ddf2c71299ca372d8449880bb3a8a8a299a483094e9c26b0823e" +version = "0.29.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ + "polkavm", "sc-allocator", "sp-maybe-compressed-blob", - "sp-wasm-interface", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "wasm-instrument", ] +[[package]] +name = "sc-executor-polkavm" +version = "0.29.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "log", + "polkavm", + "sc-executor-common", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + [[package]] name = "sc-executor-wasmtime" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a387779ab54ec1ffce0bf3a6631faada079459d42796c1895683767918a642" +version = "0.29.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "anyhow", "cfg-if", "libc", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rustix 0.36.17", "sc-allocator", "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "wasmtime", ] [[package]] name = "sc-informant" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb603a0a703f1bc10a4e6462bec1036d8fb8b3e3eff5513a9c07f98ccb8d662d" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "ansi_term", "futures 0.3.30", @@ -11875,12 +13357,11 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cc4f6a558dd23e3bae2e9f195da822465258b9aaf211c34360d7f6efb944e54" +version = "25.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", - "parking_lot 0.12.2", + "array-bytes", + "parking_lot 0.12.3", "serde_json", "sp-application-crypto", "sp-core", @@ -11890,24 +13371,23 @@ dependencies = [ [[package]] name = "sc-mixnet" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45fb213c15679fe5b87c383815d7fb758c70d3e7c573948bd7fe26ff344d2272" +version = "0.4.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "arrayvec 0.7.4", "blake2 0.10.6", "bytes", "futures 0.3.30", "futures-timer", - "libp2p-identity", "log", "mixnet", "multiaddr", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-network", + "sc-network-types", "sc-transaction-pool-api", "sp-api", "sp-consensus", @@ -11920,15 +13400,15 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f231c7d5e749ec428b4cfa669d759ae76cd3da4f50d7352a2d711acdc7532891" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "async-trait", "asynchronous-codec", "bytes", + "cid 0.9.0", "either", "fnv", "futures 0.3.30", @@ -11936,66 +13416,52 @@ dependencies = [ "ip_network", "libp2p", "linked_hash_set", + "litep2p", "log", - "mockall", + "mockall 0.11.4", + "once_cell", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "partial_sort", "pin-project", - "rand", + "prost 0.12.6", + "prost-build 0.12.6", + "rand 0.8.5", "sc-client-api", "sc-network-common", + "sc-network-types", "sc-utils", - "serde", - "serde_json", - "smallvec", - "sp-arithmetic", - "sp-blockchain", - "sp-core", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", - "tokio", - "tokio-stream", - "unsigned-varint", - "wasm-timer", - "zeroize", -] - -[[package]] -name = "sc-network-bitswap" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2f89b0134738cb3d982b6e625ca93ae8dbe83ce2a06e4b6a396e4df09ed3499" -dependencies = [ - "async-channel 1.9.0", - "cid", - "futures 0.3.30", - "libp2p-identity", - "log", - "prost 0.12.4", - "prost-build", - "sc-client-api", - "sc-network", + "schnellru", + "serde", + "serde_json", + "smallvec", + "sp-arithmetic", "sp-blockchain", + "sp-core", "sp-runtime", + "substrate-prometheus-endpoint", "thiserror", + "tokio", + "tokio-stream", "unsigned-varint", + "void", + "wasm-timer", + "zeroize", ] [[package]] name = "sc-network-common" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3504bbff5ab016948dbab0f21a8be26324810b76eff3627ce744adb5bfc1b3ce" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "bitflags 1.3.2", "futures 0.3.30", "libp2p-identity", "parity-scale-codec", - "prost-build", + "prost-build 0.12.6", "sc-consensus", + "sc-network-types", "sp-consensus", "sp-consensus-grandpa", "sp-runtime", @@ -12003,11 +13469,10 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad02cf809c34b53614fa61377e3289064edf6c78eb11df071d11fbf7546d7e9" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "ahash 0.8.11", + "ahash", "futures 0.3.30", "futures-timer", "libp2p", @@ -12015,6 +13480,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-network-sync", + "sc-network-types", "schnellru", "sp-runtime", "substrate-prometheus-endpoint", @@ -12023,20 +13489,19 @@ dependencies = [ [[package]] name = "sc-network-light" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84ef0b212c775f58e0304ec09166089f6b09afddf559b7c2b5702933b3be4" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "futures 0.3.30", - "libp2p-identity", "log", "parity-scale-codec", - "prost 0.12.4", - "prost-build", + "prost 0.12.6", + "prost-build 0.12.6", "sc-client-api", "sc-network", + "sc-network-types", "sp-blockchain", "sp-core", "sp-runtime", @@ -12045,11 +13510,10 @@ dependencies = [ [[package]] name = "sc-network-sync" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa9377059deece4e7d419d9ec456f657268c0c603e1cf98df4a920f6da83461" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "async-trait", "fork-tree", @@ -12057,14 +13521,15 @@ dependencies = [ "futures-timer", "libp2p", "log", - "mockall", + "mockall 0.11.4", "parity-scale-codec", - "prost 0.12.4", - "prost-build", + "prost 0.12.6", + "prost-build 0.12.6", "sc-client-api", "sc-consensus", "sc-network", "sc-network-common", + "sc-network-types", "sc-utils", "schnellru", "smallvec", @@ -12082,11 +13547,10 @@ dependencies = [ [[package]] name = "sc-network-transactions" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16c9cad4baf348725bd82eadcd1747fc112ec49c76b863755ce79c588fa73fe4" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "futures 0.3.30", "libp2p", "log", @@ -12094,19 +13558,35 @@ dependencies = [ "sc-network", "sc-network-common", "sc-network-sync", + "sc-network-types", "sc-utils", "sp-consensus", "sp-runtime", "substrate-prometheus-endpoint", ] +[[package]] +name = "sc-network-types" +version = "0.10.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "bs58 0.5.1", + "ed25519-dalek 2.1.1", + "libp2p-identity", + "litep2p", + "multiaddr", + "multihash 0.17.0", + "rand 0.8.5", + "thiserror", + "zeroize", +] + [[package]] name = "sc-offchain" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aee89f2abd406356bfd688bd7a51155dc963259e4b752bb85d1f8a061a194fd" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "bytes", "fnv", "futures 0.3.30", @@ -12118,16 +13598,17 @@ dependencies = [ "num_cpus", "once_cell", "parity-scale-codec", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "sc-client-api", "sc-network", "sc-network-common", + "sc-network-types", "sc-transaction-pool-api", "sc-utils", "sp-api", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-keystore", "sp-offchain", "sp-runtime", @@ -12138,8 +13619,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb8dadb2ae5a316e4d08cad6aacd5de1dec792f3bd94e3960795ff7ffd07211c" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -12147,15 +13627,14 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5acf6d89f062d1334a0c5b67e9dea97666cd47a49acb2696eab55ff1a1bf74" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -12180,9 +13659,8 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9db6aaabfa7e0c27ec15d0f0a11b994cd4bcf86e362f0d9732b4a414d793f0f" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12201,11 +13679,15 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "691440bbaddd3bc2675309c965cc75f8bf694f51e0a28039bfc9658299fbc394" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ + "forwarded-header-value", + "futures 0.3.30", + "governor", "http", + "hyper", + "ip_network", "jsonrpsee", "log", "serde_json", @@ -12217,23 +13699,24 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f10275c62296a785f6e2ac716521e3b6e0fae470416fdf86491cbbfcc2e23d" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "futures 0.3.30", "futures-util", "hex", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", + "rand 0.8.5", "sc-chain-spec", "sc-client-api", "sc-rpc", "sc-transaction-pool-api", "sc-utils", + "schnellru", "serde", "sp-api", "sp-blockchain", @@ -12248,9 +13731,8 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ea779b8c5bdb0d0199c8beebcf1fdc5641e468c480e1c4684be660c8c90af" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "directories", @@ -12260,9 +13742,9 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", - "rand", + "rand 0.8.5", "sc-chain-spec", "sc-client-api", "sc-client-db", @@ -12271,11 +13753,11 @@ dependencies = [ "sc-informant", "sc-keystore", "sc-network", - "sc-network-bitswap", "sc-network-common", "sc-network-light", "sc-network-sync", "sc-network-transactions", + "sc-network-types", "sc-rpc", "sc-rpc-server", "sc-rpc-spec-v2", @@ -12285,18 +13767,19 @@ dependencies = [ "sc-transaction-pool", "sc-transaction-pool-api", "sc-utils", + "schnellru", "serde", "serde_json", "sp-api", "sp-blockchain", "sp-consensus", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-keystore", "sp-runtime", "sp-session", "sp-state-machine", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-transaction-storage-proof", "sp-trie", @@ -12312,21 +13795,19 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa842052c41ad379eaecdfddc0d5c953d57e311ae688233f68f461b91d38da0a" +version = "0.30.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sp-core", ] [[package]] name = "sc-storage-monitor" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26cb401aad6732700c8d866cbbef1175b9aeb8230908aff27059ef14bd058ef3" +version = "0.16.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "clap", "fs4", @@ -12338,9 +13819,8 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bc382c7d997f4531eee5e5d57f970eaf2761d722298d7747385a4ad69fa6b12" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12358,15 +13838,14 @@ dependencies = [ [[package]] name = "sc-sysinfo" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25d2ab8f15021916a07cfbe7a08be484c5dc7d57f07bc0e2aa03260b55a5632f" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "derive_more", "futures 0.3.30", "libc", "log", - "rand", + "rand 0.8.5", "rand_pcg", "regex", "sc-telemetry", @@ -12375,22 +13854,22 @@ dependencies = [ "sp-core", "sp-crypto-hashing", "sp-io", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "sc-telemetry" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0673a93aa0684b606abfc5fce6c882ada7bb5fad8a2ddc66a09a42bcc9664d91" +version = "15.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "chrono", "futures 0.3.30", "libp2p", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", - "rand", + "rand 0.8.5", + "sc-network", "sc-utils", "serde", "serde_json", @@ -12400,9 +13879,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77b4fdb4f359f19c395ba862430f3ca0efb50b0310b09753caaa06997edd606" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "ansi_term", "chrono", @@ -12411,7 +13889,7 @@ dependencies = [ "libc", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "regex", "rustc-hash", "sc-client-api", @@ -12422,7 +13900,7 @@ dependencies = [ "sp-core", "sp-rpc", "sp-runtime", - "sp-tracing", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "tracing", "tracing-log", @@ -12432,20 +13910,18 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "151cdf86d79abf22cf2a240a7ca95041c908dbd96c2ae9a818073042aa210964" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sc-transaction-pool" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "326dc8ea417c53b6787bd1bb27431d44768504451f5ce4efdde0c15877c7c121" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -12453,7 +13929,7 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-transaction-pool-api", "sc-utils", @@ -12463,7 +13939,7 @@ dependencies = [ "sp-core", "sp-crypto-hashing", "sp-runtime", - "sp-tracing", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror", @@ -12471,9 +13947,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ae888ce3491acb1b489c3dba930d0c46c7ef9f9893ba0ab8af9125362f3d14" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -12488,20 +13963,42 @@ dependencies = [ [[package]] name = "sc-utils" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b1a238f5baa56405db4e440e2d2f697583736fa2e2f1aac345c438a42975f1" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-channel 1.9.0", "futures 0.3.30", "futures-timer", "lazy_static", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus", "sp-arithmetic", ] +[[package]] +name = "scale-bits" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" +dependencies = [ + "parity-scale-codec", + "scale-type-resolver", +] + +[[package]] +name = "scale-decode" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" +dependencies = [ + "derive_more", + "parity-scale-codec", + "scale-bits", + "scale-type-resolver", + "smallvec", +] + [[package]] name = "scale-info" version = "2.11.3" @@ -12528,6 +14025,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-type-resolver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" + [[package]] name = "schannel" version = "0.1.23" @@ -12539,11 +14042,11 @@ dependencies = [ [[package]] name = "schnellru" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" dependencies = [ - "ahash 0.8.11", + "ahash", "cfg-if", "hashbrown 0.13.2", ] @@ -12573,13 +14076,13 @@ dependencies = [ "aead", "arrayref", "arrayvec 0.7.4", - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.3", "getrandom_or_panic", "merlin", "rand_core 0.6.4", "serde_bytes", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -12605,6 +14108,21 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "sctp-proto" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6220f78bb44c15f326b0596113305f6101097a18755d53727a575c97e09fb24" +dependencies = [ + "bytes", + "crc", + "fxhash", + "log", + "rand 0.8.5", + "slab", + "thiserror", +] + [[package]] name = "sec1" version = "0.7.3" @@ -12615,7 +14133,8 @@ dependencies = [ "der", "generic-array 0.14.7", "pkcs8", - "subtle 2.5.0", + "serdect", + "subtle 2.6.1", "zeroize", ] @@ -12657,11 +14176,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -12670,9 +14189,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -12689,9 +14208,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -12704,31 +14223,31 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -12744,10 +14263,20 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +dependencies = [ + "serde", +] + +[[package]] +name = "serdect" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" dependencies = [ + "base16ct", "serde", ] @@ -12764,6 +14293,18 @@ dependencies = [ "opaque-debug 0.3.1", ] +[[package]] +name = "sha-1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", + "sha1-asm", +] + [[package]] name = "sha1" version = "0.10.6" @@ -12775,6 +14316,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha1-asm" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "286acebaf8b67c1130aedffad26f594eff0c1292389158135327d2e23aed582b" +dependencies = [ + "cc", +] + [[package]] name = "sha2" version = "0.9.9" @@ -12833,6 +14383,12 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + [[package]] name = "signature" version = "2.2.0" @@ -12876,6 +14432,15 @@ dependencies = [ "similar", ] +[[package]] +name = "simple-dns" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae9a3fcdadafb6d97f4c0e007e4247b114ee0f119f650c3cbf3a8b3a1479694" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "simple-mermaid" version = "0.1.1" @@ -12905,15 +14470,14 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40fa5e14772407fd2ccffdd5971bf055bbf46a40727c0ea96d2bb6563d17e1c" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "enumn", "parity-scale-codec", "paste", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -12964,13 +14528,13 @@ dependencies = [ "chacha20", "crossbeam-queue", "derive_more", - "ed25519-zebra 4.0.3", + "ed25519-zebra", "either", "event-listener 2.5.3", "fnv", "futures-lite 1.13.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "hmac 0.12.1", "itertools 0.11.0", @@ -12981,10 +14545,10 @@ dependencies = [ "num-bigint", "num-rational", "num-traits", - "pbkdf2 0.12.2", + "pbkdf2", "pin-project", "poly1305", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "ruzstd", "schnorrkel 0.10.2", @@ -13019,15 +14583,15 @@ dependencies = [ "futures-channel", "futures-lite 1.13.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "itertools 0.11.0", "log", "lru 0.11.1", "no-std-net", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "serde", "serde_json", @@ -13053,12 +14617,12 @@ dependencies = [ "aes-gcm", "blake2 0.10.6", "chacha20poly1305", - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.3", "rand_core 0.6.4", "ring 0.17.8", "rustc_version", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -13073,9 +14637,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -13094,15 +14658,14 @@ dependencies = [ "http", "httparse", "log", - "rand", - "sha-1", + "rand 0.8.5", + "sha-1 0.9.8", ] [[package]] name = "sp-api" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef42aa652381ade883c14ffbbb5c0fec36d382d2217b5bace01b8a0e8634778" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hash-db 0.16.0", "log", @@ -13110,11 +14673,12 @@ dependencies = [ "scale-info", "sp-api-proc-macro", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-metadata-ir", "sp-runtime", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "sp-version", "thiserror", @@ -13123,83 +14687,94 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0694be2891593450916d6b53a274d234bccbc86bcbada36ba23fc356989070c7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "Inflector", "blake2 0.10.6", - "expander 2.1.0", + "expander", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sp-application-crypto" -version = "31.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "547cad7a6eabb52c639ec117b3db9c6b43cf1b29a9393b18feb19e101a91833f" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", "serde", "sp-core", "sp-io", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "sp-arithmetic" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa823ca5adc490d47dccb41d69ad482bc57a317bd341de275868378f48f131c" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ + "docify", "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "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 = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92b177c72b5d2973c36d60f6ef942d791d9fd91eae8b08c71882e4118d4fbfc" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", "sp-runtime", - "sp-std", ] [[package]] name = "sp-block-builder" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b36ce171caa7eb2bbe682c089f755fdefa71d3702e4fb1ba30d10146aef99d5" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std", ] [[package]] name = "sp-blockchain" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31303e766d2e53812641bbc1f1cec03a85793fc9e627e55f0a6854b28708758" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "schnellru", "sp-api", "sp-consensus", @@ -13211,9 +14786,8 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6e512b862c4ff7a26cdcd364898cc42e181ff5cb35fbb226ff27d88c81569a" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -13227,9 +14801,8 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf13c293685319751f72fa5216c7fb5f25f3e8e8fe29b4503296ed5f5466b3d" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "parity-scale-codec", @@ -13239,15 +14812,13 @@ dependencies = [ "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std", "sp-timestamp", ] [[package]] name = "sp-consensus-babe" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9be2f86a2f0ce2a78b455feb547aa27604fd76a7f7a691995cbad44e0b1b9dd" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "parity-scale-codec", @@ -13259,15 +14830,13 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std", "sp-timestamp", ] [[package]] name = "sp-consensus-beefy" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ff890a84ef57628b010df0e1d75b3a78fb7f575e4ceeba7215c276902c403e" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "lazy_static", "parity-scale-codec", @@ -13278,17 +14847,16 @@ dependencies = [ "sp-core", "sp-crypto-hashing", "sp-io", + "sp-keystore", "sp-mmr-primitives", "sp-runtime", - "sp-std", - "strum 0.24.1", + "strum 0.26.3", ] [[package]] name = "sp-consensus-grandpa" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b606164600db36e596db7abf32b4533dc9a74526d9444c4c45035427b2199b" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "finality-grandpa", "log", @@ -13300,60 +14868,58 @@ dependencies = [ "sp-core", "sp-keystore", "sp-runtime", - "sp-std", ] [[package]] name = "sp-consensus-slots" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a5bd1fcd84bbdc7255528c7cdb92f9357fd555f06ee553af7e340cbdab517c" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", "sp-timestamp", ] [[package]] name = "sp-core" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c33c7a1568175250628567d50c4e1c54a6ac5bc1190413b9be29a9e810cbe73" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", - "bip39", + "array-bytes", + "bandersnatch_vrfs", "bitflags 1.3.2", "blake2 0.10.6", "bounded-collections", "bs58 0.5.1", "dyn-clonable", - "ed25519-zebra 3.1.0", + "ed25519-zebra", "futures 0.3.30", "hash-db 0.16.0", "hash256-std-hasher", "impl-serde", - "itertools 0.10.5", + "itertools 0.11.0", + "k256", "libsecp256k1", "log", "merlin", + "parity-bip39", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "paste", "primitive-types", - "rand", + "rand 0.8.5", "scale-info", "schnorrkel 0.11.4", "secp256k1", "secrecy", "serde", "sp-crypto-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "ss58-registry", "substrate-bip39", "thiserror", @@ -13362,11 +14928,30 @@ dependencies = [ "zeroize", ] +[[package]] +name = "sp-crypto-ec-utils" +version = "0.10.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" +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 24.0.0 (git+https://github.com/paritytech/polkadot-sdk)", +] + [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "blake2b_simd", "byteorder", @@ -13379,95 +14964,108 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sp-database" version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722cbecdbf5b94578137dbd07feb51e95f7de221be0c1ff4dcfe0bb4cd986929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "kvdb", - "parking_lot 0.12.2", + "parking_lot 0.12.3", ] [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", +] + +[[package]] +name = "sp-debug-derive" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sp-externalities" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7096ed024cec397804864898b093b51e14c7299f1d00c67dd5800330e02bb82" +version = "0.25.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "environmental", "parity-scale-codec", - "sp-std", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "sp-externalities" +version = "0.25.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] [[package]] name = "sp-genesis-builder" version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd865540ec19479c7349b584ccd78cc34c3f3a628a2a69dbb6365ceec36295ee" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ + "parity-scale-codec", + "scale-info", "serde_json", "sp-api", "sp-runtime", - "sp-std", ] [[package]] name = "sp-inherents" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "607c9e35e96966645ff180a9e9f976433b96e905d0a91d8d5315e605a21f4bc0" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", "thiserror", ] [[package]] name = "sp-io" -version = "31.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec43aa073eab35fcb920d7592474d5427ea3be2bf938706a3ad955d7ba54fd8d" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bytes", - "ed25519-dalek", + "ed25519-dalek 2.1.1", "libsecp256k1", "log", "parity-scale-codec", + "polkavm-derive", "rustversion", "secp256k1", "sp-core", "sp-crypto-hashing", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-keystore", - "sp-runtime-interface", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-state-machine", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "tracing", "tracing-core", @@ -13475,33 +15073,29 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "32.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cf0a2f881958466fc92bc9b39bbc2c0d815ded4a21f8f953372b0ac2e11b02" +version = "31.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "sp-core", "sp-runtime", - "strum 0.24.1", + "strum 0.26.3", ] [[package]] name = "sp-keystore" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444f2d53968b1ce5e908882710ff1f3873fcf3e95f59d57432daf685bbacb959" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sp-core", - "sp-externalities", - "thiserror", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c768c11afbe698a090386876911da4236af199cd38a5866748df4d8628aeff" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "thiserror", "zstd 0.12.4", @@ -13510,52 +15104,45 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0b5e87e56c1bb26d9524d48dd127121d630f895bd5914a34f0b017489f7c1d" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", - "sp-std", ] [[package]] name = "sp-mixnet" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bebd44b915c65aeb7e7eeaea466aba3b27cdd915c83ea83d4643c54f21ffbbf" +version = "0.4.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", - "sp-std", ] [[package]] name = "sp-mmr-primitives" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891b7263b7c44a569173ee1078f68fb1a01991a44914607c0100aa5ae41f6562" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "ckb-merkle-mountain-range", "log", "parity-scale-codec", + "polkadot-ckb-merkle-mountain-range", "scale-info", "serde", "sp-api", "sp-core", - "sp-debug-derive", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-runtime", - "sp-std", "thiserror", ] [[package]] name = "sp-npos-elections" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195d7e1154c91cce5c3abc8c778689c3e5799da6411328dd32ac7a974c68e526" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13563,14 +15150,12 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", ] [[package]] name = "sp-offchain" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d83b955dce0b6d143bec3f60571311168f362b1c16cf044da7037a407b66c19" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "sp-api", "sp-core", @@ -13580,8 +15165,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f5a17a0a11de029a8b811cb6e8b32ce7e02183cc04a3e965c383246798c416" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "backtrace", "lazy_static", @@ -13590,9 +15174,8 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9af4b73fe7ddd88b1641cca90048c4e525e721763199e6fd29c4f590884f4d16" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "rustc-hash", "serde", @@ -13601,18 +15184,18 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "32.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a95e71603a6281e91b0f1fd3d68057644be16d75a4602013187b8137db8abee" +version = "31.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "either", "hash256-std-hasher", "impl-trait-for-tuples", "log", + "num-traits", "parity-scale-codec", "paste", - "rand", + "rand 0.8.5", "scale-info", "serde", "simple-mermaid", @@ -13620,48 +15203,78 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", ] [[package]] name = "sp-runtime-interface" -version = "25.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2321ab29d4bcc31f1ba1b4f076a81fb2a666465231e5c981c72320d74dbe63" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive", + "primitive-types", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", + "polkavm-derive", "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk)", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfaf6e85b2ec12a4b99cd6d8d57d083e30c94b7f1b0d8f93547121495aae6f0c" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.71", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" dependencies = [ "Inflector", - "expander 2.1.0", + "expander", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sp-session" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b86531090cc04d2ab3535df07146258e2fb3ab6257b0a77ef14aa08282c3d4a" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13670,14 +15283,12 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std", ] [[package]] name = "sp-staking" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e14d003ecf0b610bf1305a92bdab875289b39d514c073f30e75e78c2763a788" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -13685,25 +15296,22 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", ] [[package]] name = "sp-state-machine" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67297e702aa32027d7766803f362a420d6d3ec9e2f84961f3c64e2e52b5aaf9" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hash-db 0.16.0", "log", "parity-scale-codec", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "smallvec", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-panic-handler", - "sp-std", "sp-trie", "thiserror", "tracing", @@ -13712,26 +15320,24 @@ dependencies = [ [[package]] name = "sp-statement-store" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309a9ae4e8134bbed8ffc510cf4d461a4a651f9250b556de782cedd876abe1ff" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "aes-gcm", - "curve25519-dalek 4.1.2", - "ed25519-dalek", + "curve25519-dalek 4.1.3", + "ed25519-dalek 2.1.1", "hkdf", "parity-scale-codec", - "rand", + "rand 0.8.5", "scale-info", "sha2 0.10.8", "sp-api", "sp-application-crypto", "sp-core", "sp-crypto-hashing", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-runtime", - "sp-runtime-interface", - "sp-std", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "x25519-dalek 2.0.1", ] @@ -13739,45 +15345,66 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" + +[[package]] +name = "sp-std" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" [[package]] name = "sp-storage" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "sp-storage" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] [[package]] name = "sp-timestamp" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249cd06624f2edb53b25af528ab216a508dc9d0870e158b43caac3a97e86699f" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std", "thiserror", ] [[package]] name = "sp-tracing" version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "parity-scale-codec", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-tracing" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" dependencies = [ "parity-scale-codec", - "sp-std", "tracing", "tracing-core", "tracing-subscriber", @@ -13785,9 +15412,8 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9742861c5330bdcb42856a6eed3d3745b58ee1c92ca4c9260032ff4e6c387165" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "sp-api", "sp-runtime", @@ -13795,9 +15421,8 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece8e22a5419c7a336a2544654e1389fec8cac19b93081a30912842b44e8167f" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "parity-scale-codec", @@ -13805,29 +15430,26 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std", "sp-trie", ] [[package]] name = "sp-trie" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed48dfd05081e8b36741b10ce4eb686c135a2952227a11fe71caec89890ddbb" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "ahash 0.8.11", + "ahash", "hash-db 0.16.0", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "scale-info", "schnellru", "sp-core", - "sp-externalities", - "sp-std", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "tracing", "trie-db", @@ -13836,9 +15458,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4a660c68995663d6778df324f4e2b4efc48d55a8e9c92c22a5fb7dae7899cd" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13847,7 +15468,7 @@ dependencies = [ "serde", "sp-crypto-hashing-proc-macro", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-version-proc-macro", "thiserror", ] @@ -13855,34 +15476,40 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9bc3fed32d6dacbbbfb28dd1fe0224affbb737cb6cbfca1d9149351c2b69a7d" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std", "wasmtime", ] +[[package]] +name = "sp-wasm-interface" +version = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" +dependencies = [ + "impl-trait-for-tuples", + "log", + "parity-scale-codec", +] + [[package]] name = "sp-weights" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3be30aec904994451dcacf841a9168cfbbaf817de6b24b6a1c1418cbf1af2fe" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -13890,8 +15517,7 @@ dependencies = [ "serde", "smallvec", "sp-arithmetic", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -13905,16 +15531,17 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] [[package]] -name = "spinners" -version = "4.1.1" +name = "spinning_top" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0ef947f358b9c238923f764c72a4a9d42f2d637c46e059dbd319d6e7cfb4f82" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" dependencies = [ - "lazy_static", - "maplit", - "strum 0.24.1", + "lock_api", ] [[package]] @@ -13927,6 +15554,126 @@ dependencies = [ "der", ] +[[package]] +name = "sqlformat" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" +dependencies = [ + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" +dependencies = [ + "ahash", + "atoi", + "byteorder", + "bytes", + "crc", + "crossbeam-queue", + "either", + "event-listener 2.5.3", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashlink", + "hex", + "indexmap 2.2.6", + "log", + "memchr", + "native-tls", + "once_cell", + "paste", + "percent-encoding", + "serde", + "sha2 0.10.8", + "smallvec", + "sqlformat", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "url", +] + +[[package]] +name = "sqlx-macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.109", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" +dependencies = [ + "dotenvy", + "either", + "heck 0.4.1", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.8", + "sqlx-core", + "sqlx-sqlite", + "syn 1.0.109", + "tempfile", + "tokio", + "url", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" +dependencies = [ + "atoi", + "flume 0.11.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "tracing", + "url", + "urlencoding", +] + [[package]] name = "ss58-registry" version = "1.47.0" @@ -13950,9 +15697,8 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-node-inspect" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "394fb14c6e056213bfc3a97a246492604a6c6a0813b786f87cc2d585270c0a0b" +version = "0.12.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "clap", "parity-scale-codec", @@ -13969,9 +15715,8 @@ dependencies = [ [[package]] name = "staging-parachain-info" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da7dc139d104f676a18c13380a09c3f72d59450a7471116387cbf8cb5f845a0e" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -13979,16 +15724,15 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "staging-xcm" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fa328b87de3466bc38cc9a07244c42c647b7755b81115e1dfeb47cc13fc6e6" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "bounded-collections", "derivative", "environmental", @@ -14003,9 +15747,8 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f6cfc27c1d45f9a67e20ed3f7e60296299688825350291606add10bf3bbff2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -14018,7 +15761,7 @@ dependencies = [ "sp-arithmetic", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", "staging-xcm", "staging-xcm-executor", @@ -14026,9 +15769,8 @@ dependencies = [ [[package]] name = "staging-xcm-executor" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a638f4c8735cc04b5c93920a1f59e679f48b131315a07d146798e0decebf7720" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "environmental", "frame-benchmarking", @@ -14041,7 +15783,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", "staging-xcm", ] @@ -14080,6 +15822,26 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "str0m" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6706347e49b13373f7ddfafad47df7583ed52083d6fc8a594eb2c80497ef959d" +dependencies = [ + "combine", + "crc", + "fastrand 2.1.0", + "hmac 0.12.1", + "once_cell", + "openssl", + "openssl-sys", + "sctp-proto", + "serde", + "sha-1 0.10.1", + "thiserror", + "tracing", +] + [[package]] name = "strobe-rs" version = "0.8.1" @@ -14089,7 +15851,7 @@ dependencies = [ "bitflags 1.3.2", "byteorder", "keccak", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -14104,9 +15866,6 @@ name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] [[package]] name = "strum" @@ -14140,27 +15899,38 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "substrate-bip39" -version = "0.4.6" +version = "0.4.7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "hmac 0.12.1", + "pbkdf2", + "schnorrkel 0.11.4", + "sha2 0.10.8", + "zeroize", +] + +[[package]] +name = "substrate-bn" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" +checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel 0.11.4", - "sha2 0.9.9", - "zeroize", + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", ] [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b285e7d183a32732fdc119f3d81b7915790191fad602b7c709ef247073c77a2e" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" [[package]] name = "substrate-fixed" @@ -14175,9 +15945,8 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332f903d2f34703204f0003136c9abbc569d691028279996a1daf8f248a7369f" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.30", @@ -14196,8 +15965,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8fe06b03b8a291c09507c42f92a2c2c10dd3d62975d02c7f64a92d87bfe09b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hyper", "log", @@ -14206,25 +15974,10 @@ dependencies = [ "tokio", ] -[[package]] -name = "substrate-rpc-client" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40e5235d8460ec81e9a382345aa80d75e2943f224a332559847344bb62fa13b3" -dependencies = [ - "async-trait", - "jsonrpsee", - "log", - "sc-rpc-api", - "serde", - "sp-runtime", -] - [[package]] name = "substrate-state-trie-migration-rpc" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5768a5d3c76eebfdf94c23a3fde6c832243a043d60561e5ac1a2b475b9ad09f3" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -14250,19 +16003,28 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "511bbc2df035f5fe2556d855369a1bbb45df620360391a1f6e3fa1a1d64af79a" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ + "array-bytes", "build-helper", "cargo_metadata", "console", "filetime", + "frame-metadata", + "merkleized-metadata", + "parity-scale-codec", "parity-wasm", + "polkavm-linker", + "sc-executor", + "sp-core", + "sp-io", "sp-maybe-compressed-blob", - "strum 0.24.1", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-version", + "strum 0.26.3", "tempfile", - "toml 0.8.12", + "toml 0.8.14", "walkdir", "wasm-opt", ] @@ -14275,9 +16037,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-ng" @@ -14298,9 +16060,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -14319,6 +16081,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -14348,9 +16121,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" [[package]] name = "tempfile" @@ -14391,9 +16164,9 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" dependencies = [ "thiserror-impl", ] @@ -14415,18 +16188,18 @@ checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -14530,9 +16303,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -14545,52 +16318,52 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project-lite 0.2.14", "signal-hook-registry", - "socket2 0.5.6", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] -name = "tokio-retry" -version = "0.3.0" +name = "tokio-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "pin-project", - "rand", + "rustls 0.21.12", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.21.12", + "rustls 0.22.4", + "rustls-pki-types", "tokio", ] @@ -14606,11 +16379,26 @@ dependencies = [ "tokio-util", ] +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "rustls 0.21.12", + "rustls-native-certs 0.6.3", + "tokio", + "tokio-rustls 0.24.1", + "tungstenite", +] + [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -14618,7 +16406,6 @@ dependencies = [ "futures-sink", "pin-project-lite 0.2.14", "tokio", - "tracing", ] [[package]] @@ -14632,30 +16419,30 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.12", + "toml_edit 0.22.15", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap 2.2.6", "toml_datetime", @@ -14675,15 +16462,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.7", + "winnow 0.6.13", ] [[package]] @@ -14707,7 +16494,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bytes", "futures-core", "futures-util", @@ -14751,7 +16538,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -14776,9 +16563,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9690af7fe11d125786fa1b5ca802192f631b61a4411277865c8e0581c887e286" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "coarsetime", "polkadot-primitives", @@ -14789,68 +16575,52 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f074568687ffdfd0adb6005aa8d1d96840197f2c159f80471285f08694cf0ce" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "expander 2.1.0", + "expander", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "tracing-log" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ "log", "once_cell", "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.2.25" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "ansi_term", - "chrono", - "lazy_static", "matchers", - "parking_lot 0.11.2", + "nu-ansi-term", + "once_cell", + "parking_lot 0.12.3", "regex", - "serde", - "serde_json", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] name = "trie-db" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" +checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" dependencies = [ "hash-db 0.16.0", - "hashbrown 0.13.2", "log", "rustc-hex", "smallvec", @@ -14884,14 +16654,14 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner", + "enum-as-inner 0.5.1", "futures-channel", "futures-io", "futures-util", "idna 0.2.3", "ipnet", "lazy_static", - "rand", + "rand 0.8.5", "smallvec", "socket2 0.4.10", "thiserror", @@ -14901,6 +16671,31 @@ dependencies = [ "url", ] +[[package]] +name = "trust-dns-proto" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner 0.6.0", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.4.0", + "ipnet", + "once_cell", + "rand 0.8.5", + "smallvec", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "trust-dns-resolver" version = "0.22.0" @@ -14912,57 +16707,41 @@ dependencies = [ "ipconfig", "lazy_static", "lru-cache", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "resolv-conf", "smallvec", "thiserror", "tokio", "tracing", - "trust-dns-proto", + "trust-dns-proto 0.22.0", ] [[package]] -name = "try-lock" -version = "0.2.5" +name = "trust-dns-resolver" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot 0.12.3", + "rand 0.8.5", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto 0.23.2", +] [[package]] -name = "try-runtime-cli" -version = "0.39.0" +name = "try-lock" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9454e1af0a0be675f837d63080ef8f43510c05df8c059570622386a0cf40b548" -dependencies = [ - "async-trait", - "clap", - "frame-remote-externalities", - "frame-try-runtime", - "hex", - "log", - "parity-scale-codec", - "sc-cli", - "sc-executor", - "serde", - "serde_json", - "sp-api", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-core", - "sp-debug-derive", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-rpc", - "sp-runtime", - "sp-state-machine", - "sp-timestamp", - "sp-transaction-storage-proof", - "sp-version", - "sp-weights", - "substrate-rpc-client", - "zstd 0.12.4", -] +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tt-call" @@ -14970,6 +16749,26 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand 0.8.5", + "rustls 0.21.12", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "twox-hash" version = "1.6.3" @@ -14978,7 +16777,7 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand", + "rand 0.8.5", "static_assertions", ] @@ -15035,9 +16834,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -15045,6 +16844,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + [[package]] name = "universal-hash" version = "0.5.1" @@ -15052,7 +16857,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -15065,6 +16870,7 @@ dependencies = [ "bytes", "futures-io", "futures-util", + "tokio-util", ] [[package]] @@ -15081,20 +16887,32 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna 0.5.0", "percent-encoding", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" @@ -15122,9 +16940,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "w3f-bls" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" +checksum = "9c5da5fa2c6afa2c9158eaa7cd9aee249765eb32b5fb0c63ad8b9e79336a47ec" dependencies = [ "ark-bls12-377", "ark-bls12-381", @@ -15135,7 +16953,7 @@ dependencies = [ "arrayref", "constcat", "digest 0.10.7", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", "sha2 0.10.8", @@ -15146,9 +16964,9 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" @@ -15211,7 +17029,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", "wasm-bindgen-shared", ] @@ -15245,7 +17063,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -15545,7 +17363,7 @@ dependencies = [ "memfd", "memoffset", "paste", - "rand", + "rand 0.8.5", "rustix 0.36.17", "wasmtime-asm-macros", "wasmtime-environ", @@ -15596,15 +17414,15 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2a5cebb4c678a0d1291bb21f9d44ddebceae044b0fb5200fa3bed108a31595" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "binary-merkle-tree", "bitvec", "frame-benchmarking", "frame-election-provider-support", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -15622,6 +17440,7 @@ dependencies = [ "pallet-beefy-mmr", "pallet-collective", "pallet-conviction-voting", + "pallet-delegated-staking", "pallet-democracy", "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", @@ -15629,7 +17448,6 @@ dependencies = [ "pallet-fast-unstake", "pallet-grandpa", "pallet-identity", - "pallet-im-online", "pallet-indices", "pallet-membership", "pallet-message-queue", @@ -15690,8 +17508,8 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", - "sp-storage", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-version", "staging-xcm", @@ -15699,13 +17517,13 @@ dependencies = [ "staging-xcm-executor", "substrate-wasm-builder", "westend-runtime-constants", + "xcm-fee-payment-runtime-api", ] [[package]] name = "westend-runtime-constants" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b080c193714605ce1033311d85035247adca170181cd68a3ad7e3ca87755a14" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "polkadot-primitives", @@ -15732,9 +17550,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.16" +version = "0.7.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a1851a719f11d1d2fea40e15c72f6c00de8c142d7ac47c1441cc7e4d0d5bc6" +checksum = "2caba658a80831539b30698ae9862a72db6697dfdd7151e46920f5f2755c3ce2" dependencies = [ "bytemuck", "safe_arch", @@ -15783,7 +17601,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core 0.51.1", + "windows-core", "windows-targets 0.48.5", ] @@ -15797,12 +17615,18 @@ dependencies = [ ] [[package]] -name = "windows-core" -version = "0.52.0" +name = "windows-sys" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows-targets 0.52.5", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -15829,7 +17653,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -15864,18 +17688,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -15892,9 +17716,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -15910,9 +17734,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -15928,15 +17752,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -15952,9 +17776,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -15970,9 +17794,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -15988,9 +17812,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -16006,9 +17830,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -16021,9 +17845,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.7" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b9415ee827af173ebb3f15f9083df5a122eb93572ec28741fb153356ea2578" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -16064,7 +17888,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.3", "rand_core 0.6.4", "serde", "zeroize", @@ -16089,10 +17913,26 @@ dependencies = [ ] [[package]] -name = "xcm-emulator" -version = "0.6.0" +name = "x509-parser" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b49681988880dd6d08a4d5f6b7cb612a0f12172270349655c1e2f870b3526fd" +checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +dependencies = [ + "asn1-rs", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "xcm-emulator" +version = "0.5.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", @@ -16117,38 +17957,55 @@ dependencies = [ "sp-crypto-hashing", "sp-io", "sp-runtime", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", ] +[[package]] +name = "xcm-fee-payment-runtime-api" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-weights", + "staging-xcm", +] + [[package]] name = "xcm-procedural" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "xcm-simulator" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c65d85900081973f0c2cf0aad76e61f2d2560ea57ee2c7c886a68a0e4cf81c8a" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", + "frame-system", "parity-scale-codec", "paste", "polkadot-core-primitives", "polkadot-parachain-primitives", + "polkadot-primitives", "polkadot-runtime-parachains", + "scale-info", "sp-io", - "sp-std", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -16163,8 +18020,8 @@ dependencies = [ "futures 0.3.30", "log", "nohash-hasher", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "static_assertions", ] @@ -16180,7 +18037,7 @@ dependencies = [ [[package]] name = "zenlink-protocol" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "cumulus-primitives-core", "frame-benchmarking", @@ -16195,14 +18052,14 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "zenlink-protocol-rpc" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -16218,18 +18075,18 @@ dependencies = [ [[package]] name = "zenlink-protocol-runtime-api" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "zenlink-protocol", ] [[package]] name = "zenlink-stable-amm" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "frame-support", "frame-system", @@ -16240,13 +18097,13 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "zenlink-stable-amm-rpc" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -16260,18 +18117,18 @@ dependencies = [ [[package]] name = "zenlink-stable-amm-runtime-api" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "zenlink-stable-amm", ] [[package]] name = "zenlink-swap-router" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "frame-support", "frame-system", @@ -16282,36 +18139,36 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "zenlink-protocol", "zenlink-stable-amm", ] [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -16324,7 +18181,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -16367,9 +18224,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.12+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 7985cd2db..acf7a1ccf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ members = [ "pallets/vsbond-auction", "pallets/call-switchgear", "pallets/cross-in-out", + "pallets/evm-accounts", "pallets/xcm-interface", "pallets/slp", "pallets/vstoken-conversion", @@ -35,6 +36,7 @@ members = [ "pallets/clouds-convert", "runtime/bifrost-kusama", + "runtime/bifrost-polkadot/src/evm/evm-utility/macro", "runtime/bifrost-polkadot", "integration-tests" @@ -59,217 +61,248 @@ bifrost-kusama-runtime = { path = "runtime/bifrost-kusama" } bifrost-polkadot-runtime = { path = "runtime/bifrost-polkadot" } # Bifrost Wasm -bifrost-asset-registry = { path = "pallets/asset-registry", default-features = false } -bifrost-buy-back = { path = "pallets/buy-back", default-features = false } -bifrost-call-switchgear = { path = "pallets/call-switchgear", default-features = false } -bifrost-cross-in-out = { path = "pallets/cross-in-out", default-features = false } -bifrost-currencies = { path = "pallets/currencies", default-features = false } -bifrost-farming = { path = "pallets/farming", default-features = false } -bifrost-farming-rpc-runtime-api = { path = "pallets/farming/rpc/runtime-api", default-features = false } -bifrost-fee-share = { path = "pallets/fee-share", default-features = false } -bifrost-flexible-fee = { path = "pallets/flexible-fee", default-features = false } -bifrost-flexible-fee-rpc-runtime-api = { path = "pallets/flexible-fee/rpc/runtime-api", default-features = false } -bifrost-parachain-staking = { path = "pallets/parachain-staking", default-features = false } -bifrost-primitives = { path = "primitives" , default-features = false } -bifrost-runtime-common = { path = "runtime/common", default-features = false } -bifrost-salp = { path = "pallets/salp", default-features = false } -bifrost-salp-rpc-runtime-api = { path = "pallets/salp/rpc/runtime-api", default-features = false } -bifrost-service = { path = "node/service", default-features = false } -bifrost-slp = { path = "pallets/slp", default-features = false } -bifrost-slpx = { path = "pallets/slpx", default-features = false } -bifrost-stable-asset = { path = "pallets/stable-asset", default-features = false } -bifrost-stable-pool = { path = "pallets/stable-pool", default-features = false } -bifrost-stable-pool-rpc-runtime-api = { path = "pallets/stable-pool/rpc/runtime-api", default-features = false } -bifrost-system-maker = { path = "pallets/system-maker", default-features = false } -bifrost-system-staking = { path = "pallets/system-staking", default-features = false } -bifrost-token-issuer = { path = "pallets/token-issuer", default-features = false } -bifrost-ve-minting = { path = "pallets/ve-minting", default-features = false } -bifrost-ve-minting-rpc-runtime-api = { path = "pallets/ve-minting/rpc/runtime-api", default-features = false } -bifrost-vesting = { path = "pallets/vesting", default-features = false } -bifrost-vsbond-auction = { path = "pallets/vsbond-auction", default-features = false } -bifrost-vstoken-conversion = { path = "pallets/vstoken-conversion", default-features = false } -bifrost-vtoken-minting = { path = "pallets/vtoken-minting", default-features = false } -bifrost-vtoken-voting = { path = "pallets/vtoken-voting", default-features = false } -bifrost-xcm-interface = { path = "pallets/xcm-interface", default-features = false } -lend-market = { path = "pallets/lend-market", default-features = false } -lend-market-rpc-runtime-api = { path = "pallets/lend-market/rpc/runtime-api", default-features = false } -pallet-prices = { path = "pallets/prices", default-features = false } -pallet-traits = { path = "pallets/traits", default-features = false } -leverage-staking = { path = "pallets/leverage-staking", default-features = false } -bifrost-channel-commission = { path = "pallets/channel-commission", default-features = false } -bifrost-clouds-convert = { path = "pallets/clouds-convert", default-features = false } +bifrost-asset-registry = { path = "pallets/asset-registry", default-features = false } +bifrost-buy-back = { path = "pallets/buy-back", default-features = false } +bifrost-channel-commission = { path = "pallets/channel-commission", default-features = false } +bifrost-clouds-convert = { path = "pallets/clouds-convert", default-features = false } +bifrost-cross-in-out = { path = "pallets/cross-in-out", default-features = false } +bifrost-currencies = { path = "pallets/currencies", default-features = false } +bifrost-farming = { path = "pallets/farming", default-features = false } +bifrost-farming-rpc-runtime-api = { path = "pallets/farming/rpc/runtime-api", default-features = false } +bifrost-fee-share = { path = "pallets/fee-share", default-features = false } +bifrost-flexible-fee = { path = "pallets/flexible-fee", default-features = false } +bifrost-flexible-fee-rpc-runtime-api = { path = "pallets/flexible-fee/rpc/runtime-api", default-features = false } +bifrost-parachain-staking = { path = "pallets/parachain-staking", default-features = false } +bifrost-primitives = { path = "primitives" , default-features = false } +bifrost-runtime-common = { path = "runtime/common", default-features = false } +bifrost-salp = { path = "pallets/salp", default-features = false } +bifrost-salp-rpc-runtime-api = { path = "pallets/salp/rpc/runtime-api", default-features = false } +bifrost-service = { path = "node/service", default-features = false } +bifrost-slp = { path = "pallets/slp", default-features = false } +bifrost-slpx = { path = "pallets/slpx", default-features = false } +bifrost-stable-asset = { path = "pallets/stable-asset", default-features = false } +bifrost-stable-pool = { path = "pallets/stable-pool", default-features = false } +bifrost-stable-pool-rpc-runtime-api = { path = "pallets/stable-pool/rpc/runtime-api", default-features = false } +bifrost-system-maker = { path = "pallets/system-maker", default-features = false } +bifrost-system-staking = { path = "pallets/system-staking", default-features = false } +bifrost-token-issuer = { path = "pallets/token-issuer", default-features = false } +bifrost-ve-minting = { path = "pallets/ve-minting", default-features = false } +bifrost-ve-minting-rpc-runtime-api = { path = "pallets/ve-minting/rpc/runtime-api", default-features = false } +bifrost-vesting = { path = "pallets/vesting", default-features = false } +bifrost-vsbond-auction = { path = "pallets/vsbond-auction", default-features = false } +bifrost-vstoken-conversion = { path = "pallets/vstoken-conversion", default-features = false } +bifrost-vtoken-minting = { path = "pallets/vtoken-minting", default-features = false } bifrost-vtoken-minting-rpc-runtime-api = { path = "pallets/vtoken-minting/rpc/runtime-api", default-features = false } +bifrost-vtoken-voting = { path = "pallets/vtoken-voting", default-features = false } +bifrost-xcm-interface = { path = "pallets/xcm-interface", default-features = false } +lend-market = { path = "pallets/lend-market", default-features = false } +lend-market-rpc-runtime-api = { path = "pallets/lend-market/rpc/runtime-api", default-features = false } +leverage-staking = { path = "pallets/leverage-staking", default-features = false } +module-evm-utility-macro = { path = "runtime/bifrost-polkadot/src/evm/evm-utility/macro", default-features = false } +pallet-evm-accounts = { path = "pallets/evm-accounts", default-features = false } +pallet-evm-accounts-rpc-runtime-api = { path = "pallets/evm-accounts/rpc/runtime-api", default-features = false } +pallet-prices = { path = "pallets/prices", default-features = false } +pallet-traits = { path = "pallets/traits", default-features = false } # Zenlink -merkle-distributor = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } -zenlink-protocol = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } -zenlink-protocol-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0" } -zenlink-protocol-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } -zenlink-stable-amm = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } -zenlink-stable-amm-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0" } -zenlink-stable-amm-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } -zenlink-swap-router = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } +merkle-distributor = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } +zenlink-protocol = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } +zenlink-protocol-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0" } +zenlink-protocol-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } +zenlink-stable-amm = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } +zenlink-stable-amm-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0" } +zenlink-stable-amm-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } +zenlink-swap-router = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } # Orml -orml-tokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-traits = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-unknown-tokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-utilities = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-xcm = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-xcm-support = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-xtokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-oracle = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } +orml-tokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-traits = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-unknown-tokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-utilities = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-xcm = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-xcm-support = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-xtokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-oracle = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } + +# Frontier +fc-api = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-consensus = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-db = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-mapping-sync = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-rpc = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-rpc-core = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-storage = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-account = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-consensus = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-dynamic-fee = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-evm = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-rpc = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-self-contained = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-storage = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-base-fee = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-dynamic-fee = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-ethereum = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-chain-id = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-dispatch = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-modexp = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-sha3fips = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-simple = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } # polkadot-sdk (wasm) -cumulus-client-collator = { version = "0.8.0", default-features = false } -cumulus-client-consensus-proposer = { version = "0.8.0", default-features = false } -cumulus-pallet-aura-ext = { version = "0.8.0", default-features = false } -cumulus-pallet-parachain-system = { version = "0.8.0", default-features = false, features = ["parameterized-consensus-hook"] } -cumulus-pallet-xcm = { version = "0.8.0", default-features = false } -cumulus-pallet-xcmp-queue = { version = "0.8.0", default-features = false } -cumulus-primitives-core = { version = "0.8.0", default-features = false } -cumulus-primitives-parachain-inherent = { version = "0.8.0", default-features = false } -cumulus-primitives-timestamp = { version = "0.8.0", default-features = false } -cumulus-primitives-utility = { version = "0.8.0", default-features = false } -cumulus-test-relay-sproof-builder = { version = "0.8.0", default-features = false } -frame-benchmarking = { version = "29.0.0", default-features = false } -frame-executive = { version = "29.0.0", default-features = false } -frame-support = { version = "29.0.0", default-features = false } -frame-system = { version = "29.0.0", default-features = false } -frame-system-benchmarking = { version = "29.0.0", default-features = false } -frame-system-rpc-runtime-api = { version = "27.0.0", default-features = false } -frame-try-runtime = { version = "0.35.0", default-features = false } -pallet-assets = { version = "30.0.0", default-features = false } -pallet-asset-rate = { version = "8.0.0", default-features = false } -pallet-aura = { version = "28.0.0", default-features = false } -pallet-authority-discovery = { version = "29.0.0", default-features = false } -pallet-authorship = { version = "29.0.0", default-features = false } -pallet-balances = { version = "29.0.0", default-features = false } -pallet-bounties = { version = "28.0.0", default-features = false } -pallet-collator-selection = { version = "10.0.0", default-features = false } -pallet-collective = { version = "29.0.0", default-features = false } -pallet-conviction-voting = { version = "29.0.0", default-features = false } -pallet-democracy = { version = "29.0.0", default-features = false } -pallet-elections-phragmen = { version = "30.0.0", default-features = false } -pallet-identity = { version = "29.0.0", default-features = false } -pallet-im-online = { version = "28.0.0", default-features = false } -pallet-indices = { version = "29.0.0", default-features = false } -pallet-membership = { version = "29.0.0", default-features = false } -pallet-message-queue = { version = "32.0.0", default-features = false } -pallet-multisig = { version = "29.0.0", default-features = false } -pallet-preimage = { version = "29.0.0", default-features = false } -pallet-proxy = { version = "29.0.0", default-features = false } -pallet-ranked-collective = { version = "29.0.0", default-features = false } -pallet-recovery = { version = "29.0.0", default-features = false } -pallet-referenda = { version = "29.0.0", default-features = false } -pallet-scheduler = { version = "30.0.0", default-features = false } -pallet-session = { version = "29.0.0", default-features = false } -pallet-staking = { version = "29.0.0", default-features = false } -pallet-sudo = { version = "29.0.0", default-features = false } -pallet-timestamp = { version = "28.0.0", default-features = false } -pallet-tips = { version = "28.0.0", default-features = false } -pallet-transaction-payment = { version = "29.0.0", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { version = "29.0.0", default-features = false } -pallet-treasury = { version = "28.0.0", default-features = false } -pallet-utility = { version = "29.0.0", default-features = false } -pallet-whitelist = { version = "28.0.0", default-features = false } -pallet-xcm = { version = "8.0.0", default-features = false } -parachains-common = { version = "8.0.0", default-features = false } -parachain-info = { version = "0.8.0", package = "staging-parachain-info", default-features = false } -polkadot-core-primitives = { version = "8.0.0", default-features = false } -polkadot-parachain-primitives = { version = "7.0.0", default-features = false } -polkadot-primitives = { version = "8.0.0", default-features = false } -polkadot-runtime-common = { version = "8.0.0", default-features = false } -polkadot-runtime-parachains = { version = "8.0.0", default-features = false } -sp-api = { version = "27.0.0", default-features = false } -sp-application-crypto = { version = "31.0.0", default-features = false } -sp-arithmetic = { version = "24.0.0", default-features = false } -sp-authority-discovery = { version = "27.0.0", default-features = false } -sp-block-builder = { version = "27.0.0", default-features = false } -sp-blockchain = { version = "29.0.0", default-features = false } -sp-consensus = { version = "0.33.0", default-features = false } -sp-consensus-aura = { version = "0.33.0", default-features = false } -sp-consensus-slots = { version = "0.33.0", default-features = false } -sp-core = { version = "29.0.0", default-features = false } -sp-debug-derive = { version = "14.0.0", default-features = false } -sp-externalities = { version = "0.26.0", default-features = false } -sp-genesis-builder = { version = "0.8.0", default-features = false } -sp-inherents = { version = "27.0.0", default-features = false } -sp-io = { version = "31.0.0", default-features = false } -sp-keyring = { version = "32.0.0", default-features = false } -sp-keystore = { version = "0.35.0", default-features = false } -sp-maybe-compressed-blob = { version = "11.0.0", default-features = false } -sp-npos-elections = { version = "27.0.0", default-features = false } -sp-offchain = { version = "27.0.0", default-features = false } -sp-runtime = { version = "32.0.0", default-features = false } -sp-runtime-interface = { version = "25.0.0", default-features = false } -sp-session = { version = "28.0.0", default-features = false } -sp-staking = { version = "27.0.0", default-features = false } -sp-state-machine = { version = "0.36.0", default-features = false } -sp-std = { version = "14.0.0", default-features = false } -sp-storage = { version = "20.0.0", default-features = false } -sp-timestamp = { version = "27.0.0", default-features = false } -sp-tracing = { version = "16.0.0", default-features = false } -sp-transaction-pool = { version = "27.0.0", default-features = false } -sp-trie = { version = "30.0.0", default-features = false } -sp-version = { version = "30.0.0", default-features = false } -sp-wasm-interface = { version = "20.0.0", default-features = false } -sp-weights = { version = "28.0.0", default-features = false } -substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } -xcm = { version = "8.0.0", package = "staging-xcm", default-features = false } -xcm-builder = { version = "8.0.0", package = "staging-xcm-builder", default-features = false } -xcm-executor = { version = "8.0.1", package = "staging-xcm-executor", default-features = false } +cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-test-relay-sproof-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-asset-rate = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-bounties = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-ranked-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-recovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-tips = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-tx-pause = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-whitelist = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", package = "staging-parachain-info", default-features = false } +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-application-crypto = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-debug-derive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-externalities = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-maybe-compressed-blob = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-npos-elections = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-runtime-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-storage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-trie = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-wasm-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", package = "staging-xcm", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", package = "staging-xcm-builder", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", package = "staging-xcm-executor", default-features = false } # polkadot-sdk (client) -cumulus-client-cli = { version = "0.8.0" } -cumulus-client-consensus-aura = { version = "0.8.0" } -cumulus-client-consensus-common = { version = "0.8.0" } -cumulus-client-consensus-relay-chain = { version = "0.8.0" } -cumulus-client-network = { version = "0.8.0" } -cumulus-client-pov-recovery = { version = "0.8.0" } -cumulus-client-service = { version = "0.8.0" } -cumulus-relay-chain-inprocess-interface = { version = "0.8.0" } -cumulus-relay-chain-interface = { version = "0.8.0" } -cumulus-relay-chain-minimal-node = { version = "0.8.0" } -cumulus-relay-chain-rpc-interface = { version = "0.8.0" } -frame-benchmarking-cli = { version = "33.0.0" } -node-inspect = { version = "0.13.0", package = "staging-node-inspect" } -pallet-transaction-payment-rpc = { version = "31.0.0" } -polkadot-cli = { version = "8.0.0" } -polkadot-service = { version = "8.0.0" } -sc-basic-authorship = { version = "0.35.0" } -sc-chain-spec = { version = "28.0.0" } -sc-cli = { version = "0.37.0" } -sc-client-api = { version = "29.0.0" } -sc-consensus = { version = "0.34.0" } -sc-consensus-aura = { version = "0.35.0" } -sc-consensus-grandpa = { version = "0.20.0" } -sc-consensus-manual-seal = { version = "0.36.0" } -sc-consensus-slots = { version = "0.34.0" } -sc-executor = { version = "0.33.0" } -sc-keystore = { version = "26.0.0" } -sc-network = { version = "0.35.0" } -sc-network-common = { version = "0.34.0" } -sc-network-sync = { version = "0.34.0" } -sc-offchain = { version = "30.0.0" } -sc-rpc = { version = "30.0.0" } -sc-rpc-api = { version = "0.34.0" } -sc-rpc-server = { version = "12.0.0" } -sc-service = { version = "0.36.0" } -sc-sysinfo = { version = "28.0.0" } -sc-telemetry = { version = "16.0.0" } -sc-tracing = { version = "29.0.0" } -sc-transaction-pool = { version = "29.0.0" } -sc-transaction-pool-api = { version = "29.0.0" } -sp-consensus-babe = { version = "0.33.0" } -sp-rpc = { version = "27.0.0" } -substrate-build-script-utils = { version = "11.0.0" } -substrate-frame-rpc-system = { version = "29.0.0" } -substrate-prometheus-endpoint = { version = "0.17.0" } -substrate-wasm-builder = { version = "18.0.0" } -try-runtime-cli = { version = "0.39.0" } -xcm-emulator = { version = "0.6.0" } -xcm-simulator = { version = "8.0.0" } +cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-pov-recovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +node-inspect = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", package = "staging-node-inspect" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-network-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-rpc-server = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +try-runtime-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +xcm-simulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } # Other async-trait = { version = "0.1.76" } @@ -278,24 +311,32 @@ clap = { version = "4.5.8" } env_logger = { version = "0.10.2" } ethabi = { version = "18.0.0", default-features = false } ethereum = { version = "0.14.0", default-features = false, features = ["with-codec"] } +evm = { version = "0.41.1", default-features = false } +flume = { version = "0.10.9" } futures = { version = "0.3.30" } hex = { version = "0.4.3", default-features = false } hex-literal = { version = "0.4.1" } impl-trait-for-tuples = { version = "0.2.2" } -jsonrpsee = { version = "0.20.3" } +jsonrpsee = { version = "0.22.5" } log = { version = "0.4.22", default-features = false } num-bigint = { version = "0.4.6", default-features = false } num-traits = { version = "0.2.19", default-features = false } +num_enum = { version = "0.5.1", default-features = false } parity-scale-codec = { version = "3.6.12", default-features = false } paste = { version = "1.0.15" } +primitive-types = { version = "0.12.0", default-features = false } +proc-macro2 = { version = "1.0.40" } +quote = { version = "1.0.20" } scale-info = { version = "2.11.3", default-features = false } serde = { version = "1.0.203", default-features = false } serde_json = { version = "1.0.120", default-features = false } +sha3 = { version = "0.10.6", default-features = false } similar-asserts = { version = "1.1.0" } smallvec = { version = "1.13.1" } static_assertions = { version = "1.1.0" } strum = { version = "0.26.3", default-features = false, features = ["derive"] } strum_macros = { version = "0.26.2" } +syn = { version = "1.0.98", features = ["full", "fold", "extra-traits", "visit"] } tiny-keccak = { version = "2.0", features = ["fips202"] } [profile.dev] diff --git a/Dockerfile b/Dockerfile index 23737c9f9..bed52bf54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,8 @@ FROM rust:buster as builder RUN apt-get update && apt-get install time cmake clang libclang-dev llvm protobuf-compiler -y -RUN rustup toolchain install 1.74.0 -RUN rustup target add wasm32-unknown-unknown --toolchain 1.74.0 +RUN rustup toolchain install 1.77.0 +RUN rustup target add wasm32-unknown-unknown --toolchain 1.77.0 WORKDIR /app COPY . /app diff --git a/Makefile b/Makefile index f85585344..d34db9aa7 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ test-runtimes: .PHONY: test-benchmarks test-benchmarks: - SKIP_WASM_BUILD= cargo test benchmarking --features="runtime-benchmarks, polkadot" + SKIP_WASM_BUILD= cargo test benchmarking --features="with-bifrost-runtime, runtime-benchmarks, polkadot" .PHONY: clean # cargo clean clean: diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 4f1942630..334332f4b 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -13,6 +13,7 @@ bifrost-runtime-common = { workspace = true } bifrost-slp = { workspace = true } bifrost-vtoken-voting = { workspace = true } bifrost-xcm-interface = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } cumulus-primitives-core = { workspace = true } env_logger = { workspace = true } frame-support = { workspace = true } diff --git a/integration-tests/src/mock/bifrost.rs b/integration-tests/src/mock/bifrost.rs index b76157e29..5a116eba1 100644 --- a/integration-tests/src/mock/bifrost.rs +++ b/integration-tests/src/mock/bifrost.rs @@ -192,6 +192,10 @@ impl Config for XcmConfig { type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } impl mock_message_queue::Config for Runtime { diff --git a/integration-tests/src/mock/relaychain.rs b/integration-tests/src/mock/relaychain.rs index 6772a2580..7ae78ad3f 100644 --- a/integration-tests/src/mock/relaychain.rs +++ b/integration-tests/src/mock/relaychain.rs @@ -16,6 +16,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +use bifrost_polkadot_runtime::{ + xcm_config, BlockHashCount, Hash, Nonce, ReservedDmpWeight, ReservedXcmpWeight, + RuntimeBlockLength, RuntimeBlockWeights, SS58Prefix, Version, XcmpQueue, +}; +use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; use cumulus_primitives_core::ParaId; use frame_support::{ construct_runtime, derive_impl, parameter_types, @@ -47,6 +52,39 @@ impl frame_system::Config for Runtime { type Lookup = IdentityLookup; type Block = Block; type AccountData = pallet_balances::AccountData; + + /// The index type for storing how many extrinsics an account has signed. + type Nonce = Nonce; + /// The type for hashing blocks and tries. + type Hash = Hash; + /// Maximum number of block number to block hash mappings to keep (oldest pruned first). + type BlockHashCount = BlockHashCount; + /// Runtime version. + type Version = Version; + type BlockWeights = RuntimeBlockWeights; + type BlockLength = RuntimeBlockLength; + type SS58Prefix = SS58Prefix; + type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +impl cumulus_pallet_parachain_system::Config for Runtime { + type DmpQueue = frame_support::traits::EnqueueWithOrigin< + bifrost_polkadot_runtime::MessageQueue, + xcm_config::RelayOrigin, + >; + type RuntimeEvent = RuntimeEvent; + type OnSystemEvent = (); + type OutboundXcmpMessageSource = XcmpQueue; + type ReservedDmpWeight = ReservedDmpWeight; + type ReservedXcmpWeight = ReservedXcmpWeight; + type SelfParaId = parachain_info::Pallet; + type XcmpMessageHandler = XcmpQueue; + type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; + type ConsensusHook = cumulus_pallet_parachain_system::ExpectParentIncluded; + type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight< + bifrost_polkadot_runtime::Runtime, + >; } impl pallet_balances::Config for Runtime { @@ -136,6 +174,10 @@ impl Config for XcmConfig { type SafeCallFilter = Everything; type Aliasers = (); type TransactionalProcessor = (); + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } pub type LocalOriginToLocation = SignedToAccountId32; @@ -173,6 +215,7 @@ type Block = frame_system::mocking::MockBlock; parameter_types! { pub MessageQueueServiceWeight: Weight = Weight::from_parts(1_000_000_000, 1_000_000); + pub MessageQueueIdleServiceWeight: Weight = Weight::from_parts(1_000_000_000, 1_000_000); pub const MessageQueueHeapSize: u32 = 65_536; pub const MessageQueueMaxStale: u32 = 16; } @@ -209,6 +252,7 @@ impl pallet_message_queue::Config for Runtime { type QueueChangeHandler = (); type QueuePausedQuery = (); type WeightInfo = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } construct_runtime!( @@ -218,5 +262,6 @@ construct_runtime!( ParasOrigin: origin, MessageQueue: pallet_message_queue, XcmPallet: pallet_xcm, + ParachainSystem: cumulus_pallet_parachain_system, } ); diff --git a/integration-tests/src/tests/slp.rs b/integration-tests/src/tests/slp.rs index 433a18dea..799aa9e7d 100644 --- a/integration-tests/src/tests/slp.rs +++ b/integration-tests/src/tests/slp.rs @@ -59,7 +59,7 @@ fn cross_dot_to_bifrost(to: AccountId32, amount: u128) { 100_000_000_000, ); let _ = RelayBalances::deposit_creating(&to, amount); - assert_ok!(RelayXcmPallet::reserve_transfer_assets( + assert_ok!(RelayXcmPallet::limited_reserve_transfer_assets( Some(to.clone()).into(), Box::new(VersionedLocation::V4(Parachain(2030).into())), Box::new(VersionedLocation::V4( @@ -67,6 +67,7 @@ fn cross_dot_to_bifrost(to: AccountId32, amount: u128) { )), Box::new(VersionedAssets::V4((Here, amount / 10).into())), 0, + Unlimited )); }); } diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 73f754bfa..299baeac0 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bifrost-cli" -version = "0.11.0" +version = "0.12.0" authors = ["Liebi Technologies "] description = "Bifrost Parachain Node" build = "build.rs" @@ -33,6 +33,7 @@ sc-sysinfo = { workspace = true } sc-telemetry = { workspace = true } sc-tracing = { workspace = true } sc-offchain = { workspace = true } +sc-network = { workspace = true } # node-specific dependencies bifrost-service = { workspace = true } @@ -40,7 +41,6 @@ bifrost-primitives = { workspace = true } # CLI-specific dependencies sc-cli = { workspace = true, optional = true } -try-runtime-cli = { workspace = true, optional = true } frame-try-runtime = { workspace = true, optional = true } frame-benchmarking-cli = { workspace = true, optional = true } node-inspect = { workspace = true, optional = true } @@ -64,7 +64,6 @@ cli = [ "node-inspect", "sc-cli", "frame-benchmarking-cli", - 'try-runtime-cli', "sc-service", "substrate-build-script-utils", ] @@ -76,5 +75,5 @@ with-bifrost-runtime = [ with-bifrost-kusama-runtime = ["bifrost-service/with-bifrost-kusama-runtime"] with-bifrost-polkadot-runtime = ["bifrost-service/with-bifrost-polkadot-runtime"] with-all-runtime = ["with-bifrost-runtime"] -try-runtime = ["bifrost-service/try-runtime", "try-runtime-cli/try-runtime"] -fast-runtime = ["bifrost-service/fast-runtime"] +try-runtime = ["bifrost-service/try-runtime"] +fast-runtime = ["bifrost-service/fast-runtime"] \ No newline at end of file diff --git a/node/cli/src/cli.rs b/node/cli/src/cli.rs index 2724c9e95..364b66adc 100644 --- a/node/cli/src/cli.rs +++ b/node/cli/src/cli.rs @@ -18,6 +18,7 @@ use std::path::PathBuf; +use bifrost_service::eth::EthConfiguration; use clap::Parser; use sc_cli::{KeySubcommand, SignCmd, VanityCmd, VerifyCmd}; @@ -104,6 +105,9 @@ pub struct Cli { /// Relay chain arguments #[arg(raw = true)] pub relay_chain_args: Vec, + + #[command(flatten)] + pub eth_config: EthConfiguration, } #[derive(Debug)] @@ -125,7 +129,7 @@ impl RelayChainCli { relay_chain_args: impl Iterator, ) -> Self { let extension = - bifrost_service::chain_spec::RelayExtensions::try_get(&*para_config.chain_spec); + bifrost_service::chain_spec::RelayExtensions::try_get(¶_config.chain_spec); let chain_id = extension.map(|e| e.relay_chain.clone()); let base_path = para_config.base_path.path().join("polkadot"); Self { base_path: Some(base_path), chain_id, base: Parser::parse_from(relay_chain_args) } diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 2eefaf7aa..ec2445401 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -17,6 +17,7 @@ // along with this program. If not, see . use bifrost_service::{self as service, IdentifyVariant}; +use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions; use cumulus_primitives_core::ParaId; use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; use log::info; @@ -25,7 +26,7 @@ use sc_cli::{ NetworkParams, Result, SharedParams, SubstrateCli, }; use sc_service::config::{BasePath, PrometheusConfig}; -use sp_runtime::traits::AccountIdConversion; +use sp_runtime::traits::{AccountIdConversion, HashingFor}; use crate::{Cli, RelayChainCli, Subcommand}; @@ -73,6 +74,8 @@ fn load_spec(id: &str) -> std::result::Result, String> { Box::new(service::chain_spec::bifrost_polkadot::local_testnet_config()), #[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))] "bifrost-paseo" => Box::new(service::chain_spec::bifrost_polkadot::paseo_config()), + #[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))] + "bifrost-polkadot-dev" => Box::new(service::chain_spec::bifrost_polkadot::dev_config()), path => { let path = std::path::PathBuf::from(path); if path.to_str().map(|s| s.contains("bifrost-polkadot")) == Some(true) { @@ -182,7 +185,7 @@ impl SubstrateCli for RelayChainCli { macro_rules! with_runtime_or_err { ($chain_spec:expr, { $( $code:tt )* }) => { - if $chain_spec.is_bifrost_kusama() || $chain_spec.is_dev() { + if $chain_spec.is_bifrost_kusama() { #[cfg(any(feature = "with-bifrost-kusama-runtime",feature = "with-bifrost-runtime"))] #[allow(unused_imports)] use service::collator_kusama::{bifrost_kusama_runtime::{Block, RuntimeApi}, start_node,new_partial}; @@ -192,7 +195,7 @@ macro_rules! with_runtime_or_err { #[cfg(not(any(feature = "with-bifrost-kusama-runtime",feature = "with-bifrost-runtime")))] return Err(service::BIFROST_KUSAMA_RUNTIME_NOT_AVAILABLE.into()); - } else if $chain_spec.is_bifrost_polkadot() { + } else if $chain_spec.is_bifrost_polkadot() || $chain_spec.is_dev() { #[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))] #[allow(unused_imports)] use service::collator_polkadot::{bifrost_polkadot_runtime::{Block, RuntimeApi}, start_node,new_partial}; @@ -362,7 +365,11 @@ pub fn run() -> Result<()> { BenchmarkCmd::Pallet(cmd) => if cfg!(feature = "runtime-benchmarks") { with_runtime_or_err!(chain_spec, { - return runner.sync_run(|config| cmd.run::(config)); + return runner.sync_run(|config| { + cmd.run_with_spec::, ReclaimHostFunctions>(Some( + config.chain_spec, + )) + }); }) } else { Err("Benchmarking wasn't enabled when building the node. \ @@ -418,7 +425,7 @@ pub fn run() -> Result<()> { .flatten(); let para_id = - bifrost_service::chain_spec::RelayExtensions::try_get(&*config.chain_spec) + bifrost_service::chain_spec::RelayExtensions::try_get(&config.chain_spec) .map(|e| e.para_id) .ok_or("Could not find parachain ID in chain-spec.")?; @@ -444,13 +451,21 @@ pub fn run() -> Result<()> { info!("Parachain id: {:?}", id); info!("Parachain Account: {}", parachain_account); info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" }); + info!("Is dev modle: {}", if config.chain_spec.is_dev() { "yes" } else { "no" }); with_runtime_or_err!(config.chain_spec, { { - start_node(config, polkadot_config, collator_options, id, hwbench) - .await - .map(|r| r.0) - .map_err(Into::into) + start_node::>( + config, + polkadot_config, + cli.eth_config, + collator_options, + id, + hwbench, + ) + .await + .map(|r| r.0) + .map_err(Into::into) } }) }) diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index bf69260c2..1254c4fdd 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -8,18 +8,36 @@ edition = "2021" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -jsonrpsee = { workspace = true, features = [ "macros", "server" ] } -bifrost-primitives = { workspace = true } +futures = { workspace = true } +jsonrpsee = { workspace = true, features = ["macros", "server"] } sc-client-api = { workspace = true } +sc-consensus = { workspace = true } +sc-consensus-aura = { workspace = true } +sc-consensus-manual-seal = { workspace = true } +sc-network = { workspace = true } +sc-network-sync = { workspace = true } sc-rpc-api = { workspace = true } sc-rpc = { workspace = true } +sc-transaction-pool = { workspace = true } sc-transaction-pool-api = { workspace = true } -sp-api = { workspace = true } +sp-api = { workspace = true, features = ["default"] } sp-block-builder = { workspace = true } sp-blockchain = { workspace = true } +sp-timestamp = { workspace = true } +sp-core = { workspace = true, features = ["default"] } +sp-consensus-aura = { workspace = true, features = ["default"] } +sp-inherents = { workspace = true, features = ["default"] } sp-runtime = { workspace = true } pallet-transaction-payment-rpc = { workspace = true } substrate-frame-rpc-system = { workspace = true } +cumulus-test-relay-sproof-builder = { workspace = true } +cumulus-primitives-core = { workspace = true } +cumulus-primitives-parachain-inherent = { workspace = true } + +# Bifrost +bifrost-primitives = { workspace = true } +bifrost-kusama-runtime = { workspace = true } +bifrost-polkadot-runtime = { workspace = true } bifrost-flexible-fee-rpc = { workspace = true } bifrost-flexible-fee-rpc-runtime-api = { workspace = true } bifrost-salp-rpc = { workspace = true } @@ -34,9 +52,19 @@ lend-market-rpc = { workspace = true } lend-market-rpc-runtime-api = { workspace = true } zenlink-protocol = { workspace = true } zenlink-protocol-rpc = { workspace = true } -zenlink-protocol-runtime-api = { workspace = true } +zenlink-protocol-runtime-api = { workspace = true, features = ["std"] } zenlink-stable-amm-rpc = { workspace = true } -zenlink-stable-amm-runtime-api = { workspace = true } +zenlink-stable-amm-runtime-api = { workspace = true, features = ["std"] } bifrost-vtoken-minting-rpc = { workspace = true } -bifrost-vtoken-minting-rpc-runtime-api = { workspace = true } +bifrost-vtoken-minting-rpc-runtime-api = { workspace = true, features = ["std"] } + +# Frontier +hex-literal = { workspace = true } +fc-api = { workspace = true } +fc-rpc = { workspace = true } +fc-db = { workspace = true } +fc-mapping-sync = { workspace = true, features = ["sql"] } +fc-rpc-core = { workspace = true } +fc-storage = { workspace = true } +fp-rpc = { workspace = true, features = ["default"] } diff --git a/node/rpc/src/eth.rs b/node/rpc/src/eth.rs new file mode 100644 index 000000000..f9c31b83a --- /dev/null +++ b/node/rpc/src/eth.rs @@ -0,0 +1,242 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use std::sync::Arc; + +use jsonrpsee::RpcModule; +// Substrate +use bifrost_polkadot_runtime::opaque::Block; +use cumulus_primitives_core::PersistedValidationData; +use cumulus_primitives_parachain_inherent::ParachainInherentData; +use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; +use fc_db::kv::Backend as FrontierBackend; +pub use fc_rpc::{EthBlockDataCacheTask, StorageOverride}; +pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; +use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi}; +use sc_client_api::{ + backend::{Backend, StorageProvider}, + client::BlockchainEvents, + StateBackend, +}; +use sc_network::service::traits::NetworkService; +use sc_network_sync::SyncingService; +use sc_rpc::SubscriptionTaskExecutor; +use sc_transaction_pool::{ChainApi, Pool}; +use sc_transaction_pool_api::TransactionPool; +use sp_api::{CallApiAt, ProvideRuntimeApi}; +use sp_block_builder::BlockBuilder as BlockBuilderApi; +use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; + +pub struct BifrostEthConfig(std::marker::PhantomData<(C, BE)>); + +impl fc_rpc::EthConfig for BifrostEthConfig +where + C: sc_client_api::StorageProvider + Sync + Send + 'static, + BE: Backend + 'static, +{ + type EstimateGasAdapter = (); + type RuntimeStorageOverride = + fc_rpc::frontier_backend_client::SystemAccountId20StorageOverride; +} + +/// Extra dependencies for Ethereum compatibility. +pub struct EthDeps { + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// Graph pool instance. + pub graph: Arc>, + /// Ethereum transaction converter. + pub converter: Option, + /// The Node authority flag + pub is_authority: bool, + /// Whether to enable dev signer + pub enable_dev_signer: bool, + /// Network service + pub network: Arc, + /// Chain syncing service + pub sync_service: Arc>, + /// Frontier Backend. + pub frontier_backend: Arc>, + /// Ethereum data access overrides. + pub storage_override: Arc>, + /// Cache for Ethereum block data. + pub block_data_cache: Arc>, + /// EthFilterApi pool. + pub filter_pool: FilterPool, + /// Maximum number of logs in a query. + pub max_past_logs: u32, + /// Fee history cache. + pub fee_history_cache: FeeHistoryCache, + /// Maximum fee history cache size. + pub fee_history_cache_limit: FeeHistoryCacheLimit, + /// Maximum allowed gas limit will be ` block.gas_limit * execute_gas_limit_multiplier` when + /// using eth_call/eth_estimateGas. + pub execute_gas_limit_multiplier: u64, +} + +/// Instantiate Ethereum-compatible RPC extensions. +pub fn create_eth( + mut io: RpcModule<()>, + deps: EthDeps, + subscription_task_executor: SubscriptionTaskExecutor, + pubsub_notification_sinks: Arc< + fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + >, + >, +) -> Result, Box> +where + C: ProvideRuntimeApi, + C::Api: + BlockBuilderApi + EthereumRuntimeRPCApi + ConvertTransactionRuntimeApi, + C: BlockchainEvents + 'static, + C: HeaderBackend + + HeaderMetadata + + StorageProvider, + C: CallApiAt, + BE: Backend + 'static, + BE::State: StateBackend, + P: TransactionPool + 'static, + A: ChainApi + 'static, + CT: ConvertTransaction<::Extrinsic> + Send + Sync + 'static, +{ + use fc_rpc::{ + Debug, DebugApiServer, Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, + EthPubSub, EthPubSubApiServer, EthSigner, Net, NetApiServer, TxPool, TxPoolApiServer, Web3, + Web3ApiServer, + }; + + let EthDeps { + client, + pool, + graph, + converter, + is_authority, + enable_dev_signer, + network, + sync_service, + frontier_backend, + storage_override, + block_data_cache, + filter_pool, + max_past_logs, + fee_history_cache, + fee_history_cache_limit, + execute_gas_limit_multiplier, + } = deps; + + let mut signers = Vec::new(); + if enable_dev_signer { + signers.push(Box::new(EthDevSigner::new()) as Box); + } + + let pending_create_inherent_data_providers = move |_, _| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + // Create a dummy parachain inherent data provider which is required to pass + // the checks by the para chain system. We use dummy values because in the 'pending context' + // neither do we have access to the real values nor do we need them. + let (relay_parent_storage_root, relay_chain_state) = + RelayStateSproofBuilder::default().into_state_root_and_proof(); + let vfp = PersistedValidationData { + // This is a hack to make + // `cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases` happy. Relay parent + // number can't be bigger than u32::MAX. + relay_parent_number: u32::MAX, + relay_parent_storage_root, + ..Default::default() + }; + let parachain_inherent_data = ParachainInherentData { + validation_data: vfp, + relay_chain_state, + downward_messages: Default::default(), + horizontal_messages: Default::default(), + }; + Ok((timestamp, parachain_inherent_data)) + }; + + io.merge( + Eth::<_, _, _, _, _, _, _, BifrostEthConfig<_, _>>::new( + client.clone(), + pool.clone(), + graph.clone(), + converter, + sync_service.clone(), + signers, + storage_override.clone(), + frontier_backend.clone(), + is_authority, + block_data_cache.clone(), + fee_history_cache, + fee_history_cache_limit, + execute_gas_limit_multiplier, + None, + pending_create_inherent_data_providers, + None, + ) + .replace_config::>() + .into_rpc(), + )?; + + io.merge( + EthFilter::new( + client.clone(), + frontier_backend.clone(), + graph.clone(), + filter_pool, + 500_usize, // max stored filters + max_past_logs, + block_data_cache.clone(), + ) + .into_rpc(), + )?; + + io.merge( + EthPubSub::new( + pool, + client.clone(), + sync_service, + subscription_task_executor, + storage_override.clone(), + pubsub_notification_sinks, + ) + .into_rpc(), + )?; + + io.merge( + Net::new( + client.clone(), + network, + // Whether to format the `peer_count` response as Hex (default) or not. + true, + ) + .into_rpc(), + )?; + + io.merge(Web3::new(client.clone()).into_rpc())?; + + io.merge( + Debug::new(client.clone(), frontier_backend, storage_override, block_data_cache).into_rpc(), + )?; + + io.merge(TxPool::new(client, graph).into_rpc())?; + + Ok(io) +} diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 0fef634c8..41dc9059b 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -26,7 +26,7 @@ //! //! The RPCs available in this crate however can make some assumptions //! about how the runtime is constructed and what FRAME pallets -//! are part of it. Therefore all node-runtime-specific RPCs can +//! are part of it. Therefore, all node-runtime-specific RPCs can //! be placed here or imported from corresponding FRAME RPC definitions. #![warn(missing_docs)] @@ -37,6 +37,7 @@ use bifrost_farming_rpc::{FarmingRpc, FarmingRpcApiServer}; use bifrost_farming_rpc_runtime_api::FarmingRuntimeApi; use bifrost_flexible_fee_rpc::{FeeRpcApiServer, FlexibleFeeRpc}; use bifrost_flexible_fee_rpc_runtime_api::FlexibleFeeRuntimeApi as FeeRuntimeApi; +use bifrost_polkadot_runtime::Hash; use bifrost_primitives::{AccountId, Balance, Block, CurrencyId, Nonce, ParaId, PoolId}; use bifrost_salp_rpc::{SalpRpc, SalpRpcApiServer}; use bifrost_salp_rpc_runtime_api::SalpRuntimeApi; @@ -46,9 +47,11 @@ use bifrost_ve_minting_rpc::{VeMintingRpc, VeMintingRpcApiServer}; use bifrost_ve_minting_rpc_runtime_api::VeMintingRuntimeApi; use bifrost_vtoken_minting_rpc::{VtokenMintingRpc, VtokenMintingRpcApiServer}; use bifrost_vtoken_minting_rpc_runtime_api::VtokenMintingRuntimeApi; +use futures::channel::mpsc; use lend_market_rpc::{LendMarket, LendMarketApiServer}; use lend_market_rpc_runtime_api::LendMarketApi; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; +use sc_consensus_manual_seal::rpc::{EngineCommand, ManualSeal, ManualSealApiServer}; use sc_rpc_api::DenyUnsafe; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; @@ -60,6 +63,10 @@ use zenlink_protocol::AssetId; use zenlink_protocol_rpc::{ZenlinkProtocol, ZenlinkProtocolApiServer}; use zenlink_protocol_runtime_api::ZenlinkProtocolApi as ZenlinkProtocolRuntimeApi; use zenlink_stable_amm_rpc::{StableAmm, StableAmmApiServer}; + +mod eth; +pub use self::eth::{create_eth, EthDeps}; + /// Full client dependencies. pub struct FullDeps { /// The client instance to use. @@ -70,6 +77,18 @@ pub struct FullDeps { pub deny_unsafe: DenyUnsafe, } +/// Full client dependencies. +pub struct FullDepsPolkadot { + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// Whether to deny unsafe calls + pub deny_unsafe: DenyUnsafe, + /// Manual seal command sink + pub command_sink: Option>>, +} + /// A IO handler that uses all Full RPC extensions. pub type RpcExtension = jsonrpsee::RpcModule<()>; @@ -118,7 +137,7 @@ where /// RPC of bifrost-polkadot runtime. pub fn create_full_polkadot( - deps: FullDeps, + deps: FullDepsPolkadot, ) -> Result> where C: ProvideRuntimeApi @@ -142,7 +161,7 @@ where P: TransactionPool + Sync + Send + 'static, { let mut module = RpcExtension::new(()); - let FullDeps { client, pool, deny_unsafe } = deps; + let FullDepsPolkadot { client, pool, deny_unsafe, command_sink } = deps; module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?; module.merge(TransactionPayment::new(client.clone()).into_rpc())?; @@ -156,5 +175,13 @@ where module.merge(LendMarket::new(client.clone()).into_rpc())?; module.merge(VtokenMintingRpc::new(client).into_rpc())?; + if let Some(command_sink) = command_sink { + module.merge( + // We provide the rpc handler with the sending end of the channel to allow the rpc + // send EngineCommands to the background block authorship task. + ManualSeal::new(command_sink).into_rpc(), + )?; + } + Ok(module) } diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index da5e8ae5b..e2470953b 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] # Substrate Client +async-trait = { workspace = true } sc-basic-authorship = { workspace = true } sc-chain-spec = { workspace = true } sc-client-api = { workspace = true } @@ -57,7 +58,6 @@ pallet-transaction-payment-rpc = { workspace = true } frame-system-rpc-runtime-api = { workspace = true } substrate-prometheus-endpoint = { workspace = true } substrate-frame-rpc-system = { workspace = true } -try-runtime-cli = { workspace = true, optional = true } pallet-transaction-payment-rpc-runtime-api = { workspace = true } # Cumulus dependencies @@ -71,6 +71,7 @@ cumulus-primitives-core = { workspace = true } cumulus-client-service = { workspace = true } cumulus-primitives-parachain-inherent = { workspace = true } cumulus-relay-chain-interface = { workspace = true } +cumulus-test-relay-sproof-builder = { workspace = true } # Polkadot dependencies polkadot-cli = { workspace = true } @@ -81,10 +82,12 @@ xcm = { workspace = true } bifrost-parachain-staking = { workspace = true } # External Crates +clap = { workspace = true, features = ["derive"] } hex-literal = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } log = { workspace = true } +flume = { workspace = true } futures = { workspace = true, features = ["compat"] } # Runtimes @@ -95,13 +98,27 @@ bifrost-primitives = { workspace = true } bifrost-rpc = { workspace = true } # RPC related dependencies -jsonrpsee = { workspace = true, features = [ "macros", "server" ] } +jsonrpsee = { workspace = true, features = ["macros", "server"] } # zenlink rpc zenlink-protocol = { workspace = true } zenlink-protocol-runtime-api = { workspace = true } zenlink-stable-amm-runtime-api = { workspace = true } +# Frontier +fc-consensus = { workspace = true } +fc-db = { workspace = true, features = ["default", "sql"] } +fc-mapping-sync = { workspace = true, features = ["sql"] } +fc-rpc = { workspace = true, features = ["txpool"] } +fc-rpc-core = { workspace = true } +fc-storage = { workspace = true } +fp-storage = { workspace = true } +fp-consensus = { workspace = true } +fp-account = { workspace = true } +fp-dynamic-fee = { workspace = true, features = ["default"] } +fp-evm = { workspace = true, features = ["default"] } +fp-rpc = { workspace = true, features = ["default"] } + # Bifrost rpc bifrost-flexible-fee-rpc-runtime-api = { workspace = true } bifrost-salp-rpc-runtime-api = { workspace = true } @@ -137,5 +154,4 @@ try-runtime = [ fast-runtime = [ "bifrost-kusama-runtime/fast-runtime", "bifrost-polkadot-runtime/fast-runtime", -] - +] \ No newline at end of file diff --git a/node/service/src/chain_spec/bifrost_kusama.rs b/node/service/src/chain_spec/bifrost_kusama.rs index a0561d014..bd7c17202 100644 --- a/node/service/src/chain_spec/bifrost_kusama.rs +++ b/node/service/src/chain_spec/bifrost_kusama.rs @@ -18,7 +18,7 @@ use bifrost_kusama_runtime::{ constants::currency::DOLLARS, AccountId, Balance, BalancesConfig, BlockNumber, - DefaultBlocksPerRound, InflationInfo, Range, RuntimeGenesisConfig, SS58Prefix, VestingConfig, + DefaultBlocksPerRound, InflationInfo, Range, SS58Prefix, VestingConfig, }; use bifrost_primitives::{CurrencyId, CurrencyId::*, TokenInfo, TokenSymbol::*}; use bifrost_runtime_common::AuraId; @@ -42,7 +42,7 @@ use crate::chain_spec::{get_account_id_from_seed, get_from_seed, RelayExtensions const DEFAULT_PROTOCOL_ID: &str = "bifrost"; /// Specialized `ChainSpec` for the bifrost runtime. -pub type ChainSpec = sc_service::GenericChainSpec; +pub type ChainSpec = sc_service::GenericChainSpec; #[allow(non_snake_case)] pub fn ENDOWMENT() -> u128 { @@ -219,7 +219,7 @@ pub fn local_testnet_config() -> ChainSpec { ChainSpec::builder( bifrost_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - RelayExtensions { relay_chain: "kusama-local".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "kusama-local".into(), para_id: PARA_ID, evm_since: 1 }, ) .with_name("Bifrost Local Testnet") .with_id("bifrost_local_testnet") @@ -325,7 +325,7 @@ pub fn chainspec_config() -> ChainSpec { ChainSpec::builder( bifrost_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - RelayExtensions { relay_chain: "kusama".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "kusama".into(), para_id: PARA_ID, evm_since: 1 }, ) .with_name("Bifrost") .with_id("bifrost") diff --git a/node/service/src/chain_spec/bifrost_polkadot.rs b/node/service/src/chain_spec/bifrost_polkadot.rs index b500f9f54..ee486a4f3 100644 --- a/node/service/src/chain_spec/bifrost_polkadot.rs +++ b/node/service/src/chain_spec/bifrost_polkadot.rs @@ -18,21 +18,29 @@ use crate::chain_spec::{get_account_id_from_seed, get_from_seed, RelayExtensions}; use bifrost_polkadot_runtime::{ - constants::currency::DOLLARS, AccountId, Balance, BlockNumber, RuntimeGenesisConfig, SS58Prefix, + constants::currency::DOLLARS, AccountId, Balance, BlockNumber, SS58Prefix, +}; +use bifrost_primitives::{ + currency::{BNCS, DED, IBTC, INTR, PEN, PINK, USDC, WETH}, + CurrencyId, + CurrencyId::*, + TokenInfo, TokenSymbol, ASTR, BNC, DOT, DOT_TOKEN_ID, DOT_U, FIL, GLMR, MANTA, }; -use bifrost_primitives::{CurrencyId, CurrencyId::*, TokenInfo, TokenSymbol, DOT_TOKEN_ID}; use bifrost_runtime_common::AuraId; use cumulus_primitives_core::ParaId; +use fp_evm::GenesisAccount; use frame_benchmarking::{account, whitelisted_caller}; use hex_literal::hex; use sc_chain_spec::Properties; use sc_service::ChainType; -use sp_core::{crypto::UncheckedInto, sr25519}; +use sp_core::{crypto::UncheckedInto, sr25519, H160, U256}; +use sp_runtime::FixedU128; +use std::{collections::BTreeMap, str::FromStr}; const DEFAULT_PROTOCOL_ID: &str = "bifrost_polkadot"; /// Specialized `ChainSpec` for the bifrost-polkadot runtime. -pub type ChainSpec = sc_service::GenericChainSpec; +pub type ChainSpec = sc_service::GenericChainSpec; #[allow(non_snake_case)] pub fn ENDOWMENT() -> u128 { @@ -67,6 +75,7 @@ pub fn bifrost_polkadot_genesis( balances: Vec<(AccountId, Balance)>, vestings: Vec<(AccountId, BlockNumber, BlockNumber, Balance)>, id: ParaId, + tokens: Vec<(AccountId, CurrencyId, Balance)>, council_membership: Vec, technical_committee_membership: Vec, salp_multisig_key: AccountId, @@ -76,8 +85,9 @@ pub fn bifrost_polkadot_genesis( Vec<(CurrencyId, u32, u32, u32)>, ), oracle_membership: Vec, + evm_accounts: BTreeMap, ) -> serde_json::Value { - serde_json::json!( { + serde_json::json!({ "balances": { "balances": balances }, @@ -103,9 +113,9 @@ pub fn bifrost_polkadot_genesis( .cloned() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - bifrost_polkadot_runtime::SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + bifrost_polkadot_runtime::opaque::SessionKeys { aura }, // session keys ) }) .collect::>(), @@ -121,7 +131,19 @@ pub fn bifrost_polkadot_genesis( "polkadotXcm": { "safeXcmVersion": 3 }, - "salp": { "initialMultisigAccount": Some(salp_multisig_key) } + "salp": { "initialMultisigAccount": Some(salp_multisig_key) }, + "tokens": { "balances": tokens }, + "prices": { + "emergencyPrice": vec![ + (DOT, FixedU128::from_inner(6_000_000_000_000_000_000u128)), + (WETH, FixedU128::from_inner(3000_000_000_000_000_000_000u128)), + (BNC, FixedU128::from_inner(250_000_000_000_000_000u128)), + ] + }, + // EVM compatibility + "evmChainId": { "chainId": 996u64 }, + "dynamicFee": { "minGasPrice": U256::from(560174200u64) }, + "evm": { "accounts": evm_accounts }, }) } @@ -137,24 +159,75 @@ pub fn local_testnet_config() -> ChainSpec { account("bechmarking_account_1", 0, 0), ]; let balances = endowed_accounts.iter().cloned().map(|x| (x, ENDOWMENT())).collect(); + let tokens = endowed_accounts + .iter() + .flat_map(|x| { + vec![ + (x.clone(), DOT, ENDOWMENT() * 4_000_000), + (x.clone(), WETH, ENDOWMENT() * 4_000_000), + ] + }) + .collect(); let council_membership = vec![get_account_id_from_seed::("Alice")]; let technical_committee_membership = vec![get_account_id_from_seed::("Alice")]; let oracle_membership = vec![get_account_id_from_seed::("Alice")]; let salp_multisig: AccountId = hex!["49daa32c7287890f38b7e1a8cd2961723d36d20baa0bf3b82e0c4bdda93b1c0a"].into(); let currency = vec![ - (Native(TokenSymbol::BNC), DOLLARS / 100, None), ( - Token2(DOT_TOKEN_ID), - DOLLARS / 1000_000, - Some((String::from("Polkadot DOT"), String::from("DOT"), 10u8)), + BNC, + 10_000_000_000, + Some((String::from("Bifrost Native Coin"), String::from("BNC"), 12u8)), + ), + (DOT, 1_000_000, Some((String::from("Polkadot DOT"), String::from("DOT"), 10u8))), + ( + GLMR, + 1_000_000_000_000, + Some((String::from("Moonbeam Native Token"), String::from("GLMR"), 18u8)), + ), + (DOT_U, 1_000, Some((String::from("Tether USD"), String::from("USDT"), 6u8))), + (ASTR, 10_000_000_000_000_000, Some((String::from("Astar"), String::from("ASTR"), 18u8))), + ( + FIL, + 1_000_000_000_000, + Some((String::from("Filecoin Network Token"), String::from("FIL"), 18u8)), + ), + (USDC, 1_000, Some((String::from("USD Coin"), String::from("USDC"), 6u8))), + (IBTC, 100, Some((String::from("interBTC"), String::from("IBTC"), 8u8))), + (INTR, 10_000_000, Some((String::from("Interlay"), String::from("INTR"), 10u8))), + ( + MANTA, + 10_000_000_000_000, + Some((String::from("Manta Network"), String::from("MANTA"), 18u8)), + ), + ( + BNCS, + 10_000_000_000, + Some((String::from("bncs-20 inscription token BNCS"), String::from("BNCS"), 12u8)), ), + (PINK, 100_000_000, Some((String::from("PINK"), String::from("PINK"), 10u8))), + (DED, 1, Some((String::from("DED"), String::from("DED"), 10u8))), + (PEN, 100_000_000, Some((String::from("Pendulum"), String::from("PEN"), 12u8))), + (WETH, 100_000_000, Some((String::from("SnowBridge WETH"), String::from("SWETH"), 18u8))), ]; let vcurrency = vec![VSToken2(DOT_TOKEN_ID), VToken(TokenSymbol::BNC), VToken2(DOT_TOKEN_ID)]; + let mut evm_accounts = BTreeMap::new(); + evm_accounts.insert( + // H160 address of CI test runner account + H160::from_str("6be02d1d3665660d22ff9624b7be0551ee1ac91b") + .expect("internal H160 is valid; qed"), + fp_evm::GenesisAccount { + balance: U256::from(1_000_000_000_000_000_000_000_000u128), + code: Default::default(), + nonce: Default::default(), + storage: Default::default(), + }, + ); + ChainSpec::builder( bifrost_polkadot_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - RelayExtensions { relay_chain: "polkadot-local".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "polkadot-local".into(), para_id: PARA_ID, evm_since: 1 }, ) .with_name("Bifrost Polkadot Local Testnet") .with_id("bifrost_polkadot_local_testnet") @@ -170,11 +243,122 @@ pub fn local_testnet_config() -> ChainSpec { balances, vec![], PARA_ID.into(), + tokens, council_membership, technical_committee_membership, salp_multisig, (currency, vcurrency, vec![]), oracle_membership, + evm_accounts, + )) + .with_properties(bifrost_polkadot_properties()) + .with_protocol_id(DEFAULT_PROTOCOL_ID) + .build() +} + +pub fn dev_config() -> ChainSpec { + let endowed_accounts = vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + get_account_id_from_seed::("Dave"), + get_account_id_from_seed::("Eve"), + get_account_id_from_seed::("Ferdie"), + whitelisted_caller(), // Benchmarking whitelist_account + account("bechmarking_account_1", 0, 0), + ]; + let balances = endowed_accounts.iter().cloned().map(|x| (x, ENDOWMENT())).collect(); + let tokens = endowed_accounts + .iter() + .flat_map(|x| { + vec![ + (x.clone(), DOT, ENDOWMENT() * 4_000_000), + (x.clone(), WETH, ENDOWMENT() * 4_000_000), + ] + }) + .collect(); + let council_membership = vec![get_account_id_from_seed::("Alice")]; + let technical_committee_membership = vec![get_account_id_from_seed::("Alice")]; + let oracle_membership = vec![get_account_id_from_seed::("Alice")]; + let salp_multisig: AccountId = + hex!["49daa32c7287890f38b7e1a8cd2961723d36d20baa0bf3b82e0c4bdda93b1c0a"].into(); + let currency = vec![ + ( + BNC, + 10_000_000_000, + Some((String::from("Bifrost Native Coin"), String::from("BNC"), 12u8)), + ), + (DOT, 1_000_000, Some((String::from("Polkadot DOT"), String::from("DOT"), 10u8))), + ( + GLMR, + 1_000_000_000_000, + Some((String::from("Moonbeam Native Token"), String::from("GLMR"), 18u8)), + ), + (DOT_U, 1_000, Some((String::from("Tether USD"), String::from("USDT"), 6u8))), + (ASTR, 10_000_000_000_000_000, Some((String::from("Astar"), String::from("ASTR"), 18u8))), + ( + FIL, + 1_000_000_000_000, + Some((String::from("Filecoin Network Token"), String::from("FIL"), 18u8)), + ), + (USDC, 1_000, Some((String::from("USD Coin"), String::from("USDC"), 6u8))), + (IBTC, 100, Some((String::from("interBTC"), String::from("IBTC"), 8u8))), + (INTR, 10_000_000, Some((String::from("Interlay"), String::from("INTR"), 10u8))), + ( + MANTA, + 10_000_000_000_000, + Some((String::from("Manta Network"), String::from("MANTA"), 18u8)), + ), + ( + BNCS, + 10_000_000_000, + Some((String::from("bncs-20 inscription token BNCS"), String::from("BNCS"), 12u8)), + ), + (PINK, 100_000_000, Some((String::from("PINK"), String::from("PINK"), 10u8))), + (DED, 1, Some((String::from("DED"), String::from("DED"), 10u8))), + (PEN, 100_000_000, Some((String::from("Pendulum"), String::from("PEN"), 12u8))), + (WETH, 100_000_000, Some((String::from("SnowBridge WETH"), String::from("SWETH"), 18u8))), + ]; + let vcurrency = vec![VSToken2(DOT_TOKEN_ID), VToken(TokenSymbol::BNC), VToken2(DOT_TOKEN_ID)]; + + let mut evm_accounts = BTreeMap::new(); + evm_accounts.insert( + // H160 address of CI test runner account + H160::from_str("6be02d1d3665660d22ff9624b7be0551ee1ac91b") + .expect("internal H160 is valid; qed"), + fp_evm::GenesisAccount { + balance: U256::from(1_000_000_000_000_000_000_000_000u128), + code: Default::default(), + nonce: Default::default(), + storage: Default::default(), + }, + ); + + ChainSpec::builder( + bifrost_polkadot_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), + RelayExtensions { relay_chain: "polkadot".into(), para_id: PARA_ID, evm_since: 1 }, + ) + .with_name("Bifrost Polkadot Dev Testnet") + .with_id("dev") + .with_chain_type(ChainType::Development) + .with_genesis_config_patch(bifrost_polkadot_genesis( + vec![ + ( + get_account_id_from_seed::("Alice"), + get_from_seed::("Alice"), + ), + (get_account_id_from_seed::("Bob"), get_from_seed::("Bob")), + ], + balances, + vec![], + PARA_ID.into(), + tokens, + council_membership, + technical_committee_membership, + salp_multisig, + (currency, vcurrency, vec![]), + oracle_membership, + evm_accounts, )) .with_properties(bifrost_polkadot_properties()) .with_protocol_id(DEFAULT_PROTOCOL_ID) @@ -241,7 +425,7 @@ pub fn paseo_config() -> ChainSpec { ChainSpec::builder( bifrost_polkadot_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - RelayExtensions { relay_chain: "paseo".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "paseo".into(), para_id: PARA_ID, evm_since: 1 }, ) .with_name("Bifrost Paseo") .with_id("bifrost_paseo") @@ -251,11 +435,13 @@ pub fn paseo_config() -> ChainSpec { balances, vec![], PARA_ID.into(), + vec![], council_membership, technical_committee_membership, salp_multisig, (vec![], vec![], vec![]), oracle_membership, + BTreeMap::new(), )) .with_properties(bifrost_polkadot_properties()) .with_protocol_id(DEFAULT_PROTOCOL_ID) @@ -294,7 +480,7 @@ pub fn chainspec_config() -> ChainSpec { ChainSpec::builder( bifrost_polkadot_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - RelayExtensions { relay_chain: "polkadot".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "polkadot".into(), para_id: PARA_ID, evm_since: 1 }, ) .with_name("Bifrost Polkadot") .with_id("bifrost_polkadot") @@ -306,9 +492,11 @@ pub fn chainspec_config() -> ChainSpec { PARA_ID.into(), vec![], vec![], + vec![], salp_multisig, (vec![], vec![], vec![]), vec![], + BTreeMap::new(), )) .with_properties(bifrost_polkadot_properties()) .with_protocol_id(DEFAULT_PROTOCOL_ID) diff --git a/node/service/src/chain_spec/mod.rs b/node/service/src/chain_spec/mod.rs index b5a8e00f2..e1c180ce5 100644 --- a/node/service/src/chain_spec/mod.rs +++ b/node/service/src/chain_spec/mod.rs @@ -21,6 +21,7 @@ pub mod bifrost_kusama; #[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))] pub mod bifrost_polkadot; +use bifrost_primitives::BlockNumber; pub use bifrost_primitives::{AccountId, Block, Signature}; use sc_chain_spec::ChainSpecExtension; use serde::{Deserialize, Serialize}; @@ -42,11 +43,14 @@ pub struct RelayExtensions { pub relay_chain: String, /// The id of the Parachain. pub para_id: u32, + /// EVM compatible starting block number + pub evm_since: BlockNumber, } impl RelayExtensions { /// Try to get the extension from the given `ChainSpec`. - pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> { + #[allow(clippy::borrowed_box)] + pub fn try_get(chain_spec: &Box) -> Option<&Self> { sc_chain_spec::get_extension(chain_spec.extensions()) } } diff --git a/node/service/src/collator_kusama.rs b/node/service/src/collator_kusama.rs index 106cbae10..2d2e41cb3 100644 --- a/node/service/src/collator_kusama.rs +++ b/node/service/src/collator_kusama.rs @@ -31,6 +31,7 @@ use cumulus_client_consensus_aura::collators::basic::{ use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport; use cumulus_client_consensus_proposer::Proposer; +use crate::eth::EthConfiguration; use bifrost_primitives::Block; use cumulus_client_service::{ build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks, @@ -42,7 +43,7 @@ use polkadot_primitives::CollatorPair; use sc_client_api::backend::Backend; use sc_consensus::{ImportQueue, LongestChain}; use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; -use sc_network::NetworkBlock; +use sc_network::{service::traits::NetworkBackend, NetworkBlock}; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; @@ -51,12 +52,13 @@ use sp_keystore::KeystorePtr; use substrate_prometheus_endpoint::Registry; #[cfg(not(feature = "runtime-benchmarks"))] -type HostFunctions = sp_io::SubstrateHostFunctions; +type HostFunctions = cumulus_client_service::ParachainHostFunctions; #[cfg(feature = "runtime-benchmarks")] -type HostFunctions = - (sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions); - +type HostFunctions = ( + cumulus_client_service::ParachainHostFunctions, + frame_benchmarking::benchmarking::HostFunctions, +); pub type FullBackend = TFullBackend; pub type FullClient = TFullClient>; pub type MaybeFullSelectChain = Option>; @@ -100,10 +102,11 @@ pub fn new_partial( .build(); let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::( + sc_service::new_full_parts_record_import::( config, telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), executor, + true, )?; let client = Arc::new(client); @@ -210,8 +213,6 @@ fn start_consensus( overseer_handle: OverseerHandle, announce_block: Arc>) + Send + Sync>, ) -> Result<(), sc_service::Error> { - let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; - let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), client.clone(), @@ -239,7 +240,6 @@ fn start_consensus( collator_key, para_id, overseer_handle, - slot_duration, relay_chain_slot_duration, proposer, collator_service, @@ -263,14 +263,18 @@ fn start_consensus( /// This is the actual implementation that is abstract over the executor and the /// runtime api. #[sc_tracing::logging::prefix_logs_with("Parachain🌈")] -async fn start_node_impl( +async fn start_node_impl( parachain_config: Configuration, polkadot_config: Configuration, + _eth_config: EthConfiguration, collator_options: CollatorOptions, sybil_resistance_level: CollatorSybilResistance, para_id: ParaId, hwbench: Option, -) -> sc_service::error::Result<(TaskManager, Arc)> { +) -> sc_service::error::Result<(TaskManager, Arc)> +where + Net: NetworkBackend, +{ let parachain_config = prepare_node_config(parachain_config); let params = new_partial(¶chain_config, false)?; @@ -295,7 +299,8 @@ async fn start_node_impl( let prometheus_registry = parachain_config.prometheus_registry().cloned(); let transaction_pool = params.transaction_pool.clone(); let import_queue_service = params.import_queue.service(); - let net_config = sc_network::config::FullNetworkConfiguration::new(¶chain_config.network); + let net_config = + sc_network::config::FullNetworkConfiguration::<_, _, Net>::new(¶chain_config.network); let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = build_network(BuildNetworkParams { parachain_config: ¶chain_config, @@ -323,7 +328,7 @@ async fn start_node_impl( transaction_pool: Some(OffchainTransactionPoolFactory::new( transaction_pool.clone(), )), - network_provider: network.clone(), + network_provider: Arc::new(network.clone()), is_validator: parachain_config.role.is_authority(), enable_http_requests: false, custom_extensions: move |_| vec![], @@ -428,16 +433,18 @@ async fn start_node_impl( } /// Start a normal parachain node. -pub async fn start_node( +pub async fn start_node>( parachain_config: Configuration, polkadot_config: Configuration, + eth_config: EthConfiguration, collator_options: CollatorOptions, para_id: ParaId, hwbench: Option, ) -> sc_service::error::Result<(TaskManager, Arc)> { - start_node_impl( + start_node_impl::( parachain_config, polkadot_config, + eth_config, collator_options, CollatorSybilResistance::Resistant, para_id, diff --git a/node/service/src/collator_polkadot.rs b/node/service/src/collator_polkadot.rs index d1255f0bb..5bbe2e7b5 100644 --- a/node/service/src/collator_polkadot.rs +++ b/node/service/src/collator_polkadot.rs @@ -17,11 +17,15 @@ // along with this program. If not, see . //! Service implementation. Specialized wrapper over substrate service. -use std::{sync::Arc, time::Duration}; +use std::{ + collections::BTreeMap, + sync::{Arc, Mutex}, + time::Duration, +}; #[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))] pub use bifrost_polkadot_runtime; -use bifrost_polkadot_runtime::RuntimeApi; +use bifrost_polkadot_runtime::{RuntimeApi, TransactionConverter}; use cumulus_client_cli::CollatorOptions; use cumulus_client_collator::service::CollatorService; use cumulus_client_consensus_aura::collators::basic::{ @@ -31,6 +35,7 @@ use cumulus_client_consensus_aura::collators::basic::{ use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport; use cumulus_client_consensus_proposer::Proposer; +use crate::{chain_spec, eth, IdentifyVariant}; use bifrost_primitives::Block; use cumulus_client_service::{ build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks, @@ -38,11 +43,13 @@ use cumulus_client_service::{ }; use cumulus_primitives_core::{relay_chain::Hash, ParaId}; use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; +use fc_rpc_core::types::{FeeHistoryCache, FilterPool}; +use fc_storage::StorageOverrideHandler; use polkadot_primitives::CollatorPair; use sc_client_api::backend::Backend; use sc_consensus::{ImportQueue, LongestChain}; use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; -use sc_network::NetworkBlock; +use sc_network::{service::traits::NetworkBackend, NetworkBlock}; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; @@ -50,12 +57,16 @@ use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_keystore::KeystorePtr; use substrate_prometheus_endpoint::Registry; +use crate::eth::{EthConfiguration, FrontierBackend}; + #[cfg(not(feature = "runtime-benchmarks"))] -type HostFunctions = sp_io::SubstrateHostFunctions; +type HostFunctions = cumulus_client_service::ParachainHostFunctions; #[cfg(feature = "runtime-benchmarks")] -type HostFunctions = - (sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions); +type HostFunctions = ( + cumulus_client_service::ParachainHostFunctions, + frame_benchmarking::benchmarking::HostFunctions, +); pub type FullBackend = TFullBackend; pub type FullClient = TFullClient>; @@ -72,7 +83,14 @@ pub fn new_partial( MaybeFullSelectChain, sc_consensus::import_queue::BasicQueue, sc_transaction_pool::FullPool, - (ParachainBlockImport, Option, Option), + ( + eth::BlockImport, + Option, + Option, + Arc>, + FilterPool, + FeeHistoryCache, + ), >, sc_service::Error, > { @@ -100,10 +118,11 @@ pub fn new_partial( .build(); let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::( + sc_service::new_full_parts_record_import::( config, telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), executor, + true, )?; let client = Arc::new(client); @@ -126,7 +145,21 @@ pub fn new_partial( let select_chain = if dev { Some(LongestChain::new(backend.clone())) } else { None }; - let block_import = ParachainBlockImport::new(client.clone(), backend.clone()); + let frontier_backend = Arc::new(FrontierBackend::open( + Arc::clone(&client), + &config.database, + ð::db_config_dir(config), + )?); + + let evm_since = chain_spec::RelayExtensions::try_get(&config.chain_spec) + .map(|e| e.evm_since) + .unwrap_or(1); + let block_import = eth::BlockImport::new( + ParachainBlockImport::new(client.clone(), backend.clone()), + client.clone(), + frontier_backend.clone(), + evm_since, + ); let import_queue = if dev { sc_consensus_manual_seal::import_queue( @@ -144,6 +177,9 @@ pub fn new_partial( )? }; + let filter_pool: FilterPool = Arc::new(Mutex::new(BTreeMap::new())); + let fee_history_cache: FeeHistoryCache = Arc::new(Mutex::new(BTreeMap::new())); + Ok(PartialComponents { backend, client, @@ -152,14 +188,21 @@ pub fn new_partial( task_manager, transaction_pool, select_chain, - other: (block_import, telemetry, telemetry_worker_handle), + other: ( + block_import, + telemetry, + telemetry_worker_handle, + frontier_backend, + filter_pool, + fee_history_cache, + ), }) } /// Build the import queue for the parachain runtime. fn build_import_queue( client: Arc, - block_import: ParachainBlockImport, + block_import: eth::BlockImport, config: &Configuration, telemetry: Option, task_manager: &TaskManager, @@ -196,7 +239,7 @@ fn build_import_queue( fn start_consensus( client: Arc, - block_import: ParachainBlockImport, + block_import: eth::BlockImport, prometheus_registry: Option<&Registry>, telemetry: Option, task_manager: &TaskManager, @@ -210,8 +253,6 @@ fn start_consensus( overseer_handle: OverseerHandle, announce_block: Arc>) + Send + Sync>, ) -> Result<(), sc_service::Error> { - let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; - let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), client.clone(), @@ -239,7 +280,6 @@ fn start_consensus( collator_key, para_id, overseer_handle, - slot_duration, relay_chain_slot_duration, proposer, collator_service, @@ -263,18 +303,29 @@ fn start_consensus( /// This is the actual implementation that is abstract over the executor and the /// runtime api. #[sc_tracing::logging::prefix_logs_with("Parachain🌈")] -async fn start_node_impl( +async fn start_node_impl( parachain_config: Configuration, polkadot_config: Configuration, + eth_config: EthConfiguration, collator_options: CollatorOptions, sybil_resistance_level: CollatorSybilResistance, para_id: ParaId, hwbench: Option, -) -> sc_service::error::Result<(TaskManager, Arc)> { +) -> sc_service::error::Result<(TaskManager, Arc)> +where + Net: NetworkBackend, +{ let parachain_config = prepare_node_config(parachain_config); let params = new_partial(¶chain_config, false)?; - let (block_import, mut telemetry, telemetry_worker_handle) = params.other; + let ( + block_import, + mut telemetry, + telemetry_worker_handle, + frontier_backend, + filter_pool, + fee_history_cache, + ) = params.other; let client = params.client.clone(); let backend = params.backend.clone(); @@ -295,7 +346,8 @@ async fn start_node_impl( let prometheus_registry = parachain_config.prometheus_registry().cloned(); let transaction_pool = params.transaction_pool.clone(); let import_queue_service = params.import_queue.service(); - let net_config = sc_network::config::FullNetworkConfiguration::new(¶chain_config.network); + let net_config = + sc_network::config::FullNetworkConfiguration::<_, _, Net>::new(¶chain_config.network); let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = build_network(BuildNetworkParams { parachain_config: ¶chain_config, @@ -323,7 +375,7 @@ async fn start_node_impl( transaction_pool: Some(OffchainTransactionPoolFactory::new( transaction_pool.clone(), )), - network_provider: network.clone(), + network_provider: Arc::new(network.clone()), is_validator: parachain_config.role.is_authority(), enable_http_requests: false, custom_extensions: move |_| vec![], @@ -333,17 +385,73 @@ async fn start_node_impl( ); } + let storage_override = Arc::new(StorageOverrideHandler::new(client.clone())); + let block_data_cache = Arc::new(fc_rpc::EthBlockDataCacheTask::new( + task_manager.spawn_handle(), + storage_override.clone(), + eth_config.eth_log_block_cache, + eth_config.eth_statuses_cache, + prometheus_registry.clone(), + )); + + // Sinks for pubsub notifications. + // Everytime a new subscription is created, a new mpsc channel is added to the sink pool. + // The MappingSyncWorker sends through the channel on block import and the subscription emits a + // notification to the subscriber on receiving a message through this channel. + // This way we avoid race conditions when using native substrate block import notification + // stream. + let pubsub_notification_sinks: fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + > = Default::default(); + let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks); + let rpc_builder = { let client = client.clone(); + let is_authority = parachain_config.role.is_authority(); let transaction_pool = transaction_pool.clone(); - - Box::new(move |deny_unsafe, _| { - let deps = crate::rpc::FullDeps { + let network = network.clone(); + let sync_service = sync_service.clone(); + let frontier_backend = frontier_backend.clone(); + let fee_history_cache = fee_history_cache.clone(); + let filter_pool = filter_pool.clone(); + let storage_override = storage_override.clone(); + let pubsub_notification_sinks = pubsub_notification_sinks.clone(); + + Box::new(move |deny_unsafe, subscription_task_executor| { + let deps = crate::rpc::FullDepsPolkadot { client: client.clone(), pool: transaction_pool.clone(), deny_unsafe, + command_sink: None, }; - crate::rpc::create_full_polkadot(deps).map_err(Into::into) + let module = crate::rpc::create_full_polkadot(deps)?; + + let eth_deps = crate::rpc::EthDeps { + client: client.clone(), + pool: transaction_pool.clone(), + graph: transaction_pool.pool().clone(), + converter: Some(TransactionConverter), + is_authority, + enable_dev_signer: eth_config.enable_dev_signer, + network: network.clone(), + sync_service: sync_service.clone(), + frontier_backend: frontier_backend.clone(), + storage_override: storage_override.clone(), + block_data_cache: block_data_cache.clone(), + filter_pool: filter_pool.clone(), + max_past_logs: eth_config.max_past_logs, + fee_history_cache: fee_history_cache.clone(), + fee_history_cache_limit: eth_config.fee_history_limit, + execute_gas_limit_multiplier: eth_config.execute_gas_limit_multiplier, + }; + + crate::rpc::create_eth( + module, + eth_deps, + subscription_task_executor, + pubsub_notification_sinks.clone(), + ) + .map_err(Into::into) }) }; @@ -354,7 +462,7 @@ async fn start_node_impl( task_manager: &mut task_manager, config: parachain_config, keystore: params.keystore_container.keystore(), - backend, + backend: backend.clone(), network: network.clone(), sync_service: sync_service.clone(), system_rpc_tx, @@ -362,6 +470,19 @@ async fn start_node_impl( telemetry: telemetry.as_mut(), })?; + eth::spawn_frontier_tasks( + &task_manager, + client.clone(), + backend, + frontier_backend, + filter_pool, + storage_override, + fee_history_cache, + eth_config.fee_history_limit, + sync_service.clone(), + pubsub_notification_sinks, + ); + if let Some(hwbench) = hwbench { sc_sysinfo::print_hwbench(&hwbench); @@ -428,20 +549,26 @@ async fn start_node_impl( } /// Start a normal parachain node. -pub async fn start_node( +pub async fn start_node>( parachain_config: Configuration, polkadot_config: Configuration, + eth_config: EthConfiguration, collator_options: CollatorOptions, para_id: ParaId, hwbench: Option, ) -> sc_service::error::Result<(TaskManager, Arc)> { - start_node_impl( - parachain_config, - polkadot_config, - collator_options, - CollatorSybilResistance::Resistant, - para_id, - hwbench, - ) - .await + if parachain_config.chain_spec.is_dev() { + crate::dev::start_node::(parachain_config, eth_config).await + } else { + start_node_impl::( + parachain_config, + polkadot_config, + eth_config, + collator_options, + CollatorSybilResistance::Resistant, + para_id, + hwbench, + ) + .await + } } diff --git a/node/service/src/dev.rs b/node/service/src/dev.rs index c4605d55f..69ff11c62 100644 --- a/node/service/src/dev.rs +++ b/node/service/src/dev.rs @@ -16,158 +16,260 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use std::sync::Arc; +use std::{cell::RefCell, sync::Arc}; -use cumulus_primitives_parachain_inherent::MockValidationDataInherentDataProvider; -use futures::StreamExt; -use sc_executor::NativeElseWasmExecutor; -use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; +use cumulus_primitives_core::relay_chain::Hash; +use fc_storage::StorageOverrideHandler; +use jsonrpsee::core::async_trait; +use sc_client_api::Backend; +use sc_network::NetworkBackend; +use sc_service::{Configuration, TaskManager}; +use sc_transaction_pool_api::OffchainTransactionPoolFactory; + +use bifrost_polkadot_runtime::{constants::time::SLOT_DURATION, TransactionConverter}; + +use crate::{ + collator_polkadot::FullClient, + eth::{spawn_frontier_tasks, EthConfiguration}, +}; pub type Block = bifrost_primitives::Block; -pub type Executor = crate::collator_kusama::BifrostExecutor; -pub type RuntimeApi = crate::collator_kusama::bifrost_kusama_runtime::RuntimeApi; -pub type FullClient = - sc_service::TFullClient>; +pub type RuntimeApi = bifrost_polkadot_runtime::RuntimeApi; + pub type FullBackend = sc_service::TFullBackend; pub type FullSelectChain = sc_consensus::LongestChain; -pub fn default_mock_parachain_inherent_data_provider() -> MockValidationDataInherentDataProvider { - MockValidationDataInherentDataProvider { - current_para_block: 0, - relay_offset: 1000, - relay_blocks_per_para_block: 2, - xcm_config: Default::default(), - raw_downward_messages: vec![], - raw_horizontal_messages: vec![], +thread_local!(static TIMESTAMP: RefCell = const { RefCell::new(0) }); + +/// Provide a mock duration starting at 0 in millisecond for timestamp inherent. +/// Each call will increment timestamp by slot_duration making Aura think time has passed. +struct MockTimestampInherentDataProvider; + +#[async_trait] +impl sp_inherents::InherentDataProvider for MockTimestampInherentDataProvider { + async fn provide_inherent_data( + &self, + inherent_data: &mut sp_inherents::InherentData, + ) -> Result<(), sp_inherents::Error> { + TIMESTAMP.with(|x| { + *x.borrow_mut() += SLOT_DURATION; + inherent_data.put_data(sp_timestamp::INHERENT_IDENTIFIER, &*x.borrow()) + }) + } + + async fn try_handle_error( + &self, + _identifier: &sp_inherents::InherentIdentifier, + _error: &[u8], + ) -> Option> { + // The pallet never reports error. + None } } /// Builds a new development service. This service uses manual seal, and mocks /// the parachain inherent. -pub fn start_node(config: Configuration) -> Result { - let sc_service::PartialComponents { - client, - backend, - mut task_manager, - import_queue, - keystore_container, - select_chain: maybe_select_chain, - transaction_pool, - other: (_, _), - } = crate::collator_kusama::new_partial::< - bifrost_kusama_runtime::RuntimeApi, - crate::collator_kusama::BifrostExecutor, - >(&config, true)?; - - let (network, system_rpc_tx, network_starter) = +/// Before calling this function, you must set OnTimestampSet in runtime to be (). +pub async fn start_node( + parachain_config: Configuration, + eth_config: EthConfiguration, +) -> sc_service::error::Result<(TaskManager, Arc)> +where + Net: NetworkBackend, +{ + let params = crate::collator_polkadot::new_partial(¶chain_config, true)?; + let ( + _block_import, + mut telemetry, + _telemetry_worker_handle, + frontier_backend, + filter_pool, + fee_history_cache, + ) = params.other; + + let client = params.client.clone(); + let backend = params.backend.clone(); + let mut task_manager = params.task_manager; + + let transaction_pool = params.transaction_pool.clone(); + let net_config = + sc_network::config::FullNetworkConfiguration::<_, _, Net>::new(¶chain_config.network); + let metrics = Net::register_notification_metrics( + parachain_config.prometheus_config.as_ref().map(|cfg| &cfg.registry), + ); + + let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { - config: &config, + config: ¶chain_config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), - import_queue, + import_queue: params.import_queue, block_announce_validator_builder: None, - warp_sync: None, + warp_sync_params: None, + block_relay: None, + metrics, })?; - if config.offchain_worker.enabled { - let offchain_workers = Arc::new(sc_offchain::OffchainWorkers::new_with_options( - client.clone(), - sc_offchain::OffchainWorkerOptions { enable_http_requests: false }, - )); + let prometheus_registry = parachain_config.prometheus_registry().cloned(); + + if parachain_config.offchain_worker.enabled { + use futures::FutureExt; - // Start the offchain workers to have + let backend_ofc = backend.clone(); task_manager.spawn_handle().spawn( - "offchain-notifications", - None, - sc_offchain::notification_future( - config.role.is_authority(), - client.clone(), - offchain_workers, - task_manager.spawn_handle(), - network.clone(), - ), + "offchain-workers-runner", + "offchain-work", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + keystore: Some(params.keystore_container.keystore()), + offchain_db: backend_ofc.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: Arc::new(network.clone()), + is_validator: parachain_config.role.is_authority(), + enable_http_requests: false, + custom_extensions: move |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } - let prometheus_registry = config.prometheus_registry().cloned(); - let role = config.role.clone(); - - let select_chain = maybe_select_chain - .expect("In dev mode, `new_partial` will return some `select_chain`; qed"); + let select_chain = params + .select_chain + .expect("In `dev` mode, `new_partial` will return some `select_chain`; qed"); - if role.is_authority() { - let proposer_factory = sc_basic_authorship::ProposerFactory::new( - task_manager.spawn_handle(), - client.clone(), - transaction_pool.clone(), - prometheus_registry.as_ref(), - None, - ); + let proposer_factory = sc_basic_authorship::ProposerFactory::new( + task_manager.spawn_handle(), + client.clone(), + transaction_pool.clone(), + None, + None, + ); - let pool = transaction_pool.pool().clone(); - let commands_stream = pool.validated_pool().import_notification_stream().map(|_| { - sc_consensus_manual_seal::rpc::EngineCommand::SealNewBlock { - create_empty: false, - finalize: true, - parent_hash: None, - sender: None, - } + // Channel for the rpc handler to communicate with the authorship task. + let (command_sink, commands_stream) = futures::channel::mpsc::channel(1024); + let authorship_future = + sc_consensus_manual_seal::run_manual_seal(sc_consensus_manual_seal::ManualSealParams { + block_import: client.clone(), + env: proposer_factory, + client: client.clone(), + pool: transaction_pool.clone(), + commands_stream, + select_chain, + consensus_data_provider: None, + create_inherent_data_providers: move |_, ()| async move { + Ok(sp_timestamp::InherentDataProvider::from_system_time()) + }, }); + // we spawn the future on a background thread managed by service. + task_manager.spawn_essential_handle().spawn_blocking( + "manual-seal", + Some("block-authoring"), + authorship_future, + ); - let authorship_future = - sc_consensus_manual_seal::run_manual_seal(sc_consensus_manual_seal::ManualSealParams { - block_import: client.clone(), - env: proposer_factory, - client: client.clone(), - pool: transaction_pool.clone(), - commands_stream, - select_chain, - consensus_data_provider: None, - create_inherent_data_providers: |_, _| async { - Ok(( - sp_timestamp::InherentDataProvider::from_system_time(), - default_mock_parachain_inherent_data_provider(), - )) - }, - }); - // we spawn the future on a background thread managed by service. - task_manager.spawn_essential_handle().spawn_blocking( - "instant-seal", - Some("block-authoring"), - authorship_future, - ); - } + let storage_override = Arc::new(StorageOverrideHandler::new(client.clone())); + let block_data_cache = Arc::new(fc_rpc::EthBlockDataCacheTask::new( + task_manager.spawn_handle(), + storage_override.clone(), + eth_config.eth_log_block_cache, + eth_config.eth_statuses_cache, + prometheus_registry.clone(), + )); + + // Sinks for pubsub notifications. + // Everytime a new subscription is created, a new mpsc channel is added to the sink pool. + // The MappingSyncWorker sends through the channel on block import and the subscription emits a + // notification to the subscriber on receiving a message through this channel. + // This way we avoid race conditions when using native substrate block import notification + // stream. + let pubsub_notification_sinks: fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + > = Default::default(); + let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks); - let rpc_extensions_builder = { + let rpc_builder = { let client = client.clone(); + let is_authority = parachain_config.role.is_authority(); let transaction_pool = transaction_pool.clone(); - Box::new(move |deny_unsafe, _| { - let deps = crate::rpc::FullDeps { + let network = network.clone(); + let sync_service = sync_service.clone(); + let frontier_backend = frontier_backend.clone(); + let fee_history_cache = fee_history_cache.clone(); + let filter_pool = filter_pool.clone(); + let storage_override = storage_override.clone(); + let pubsub_notification_sinks = pubsub_notification_sinks.clone(); + + Box::new(move |deny_unsafe, subscription_task_executor| { + let deps = crate::rpc::FullDepsPolkadot { client: client.clone(), pool: transaction_pool.clone(), deny_unsafe, + command_sink: Some(command_sink.clone()), }; + let module = crate::rpc::create_full_polkadot(deps)?; - Ok(crate::rpc::create_full_rpc(deps)) + let eth_deps = crate::rpc::EthDeps { + client: client.clone(), + pool: transaction_pool.clone(), + graph: transaction_pool.pool().clone(), + converter: Some(TransactionConverter), + is_authority, + enable_dev_signer: eth_config.enable_dev_signer, + network: network.clone(), + sync_service: sync_service.clone(), + frontier_backend: frontier_backend.clone(), + storage_override: storage_override.clone(), + block_data_cache: block_data_cache.clone(), + filter_pool: filter_pool.clone(), + max_past_logs: eth_config.max_past_logs, + fee_history_cache: fee_history_cache.clone(), + fee_history_cache_limit: eth_config.fee_history_limit, + execute_gas_limit_multiplier: eth_config.execute_gas_limit_multiplier, + }; + + crate::rpc::create_eth( + module, + eth_deps, + subscription_task_executor, + pubsub_notification_sinks.clone(), + ) + .map_err(Into::into) }) }; sc_service::spawn_tasks(sc_service::SpawnTasksParams { - network, - client, - keystore: keystore_container.sync_keystore(), + rpc_builder, + client: client.clone(), + transaction_pool: transaction_pool.clone(), task_manager: &mut task_manager, - transaction_pool, - rpc_extensions_builder, - backend, + config: parachain_config, + keystore: params.keystore_container.keystore(), + backend: backend.clone(), + network: network.clone(), + sync_service: sync_service.clone(), system_rpc_tx, - config, - telemetry: None, + tx_handler_controller, + telemetry: telemetry.as_mut(), })?; + spawn_frontier_tasks( + &task_manager, + client.clone(), + backend, + frontier_backend, + filter_pool, + storage_override, + fee_history_cache, + eth_config.fee_history_limit, + sync_service.clone(), + pubsub_notification_sinks, + ); - log::info!("Development Service Ready"); + start_network.start_network(); - network_starter.start_network(); - Ok(task_manager) + Ok((task_manager, client)) } diff --git a/node/service/src/eth.rs b/node/service/src/eth.rs new file mode 100644 index 000000000..ed19208e0 --- /dev/null +++ b/node/service/src/eth.rs @@ -0,0 +1,212 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use std::{marker::PhantomData, path::PathBuf, sync::Arc, time::Duration}; + +use crate::collator_polkadot::{FullBackend, FullClient}; +use bifrost_polkadot_runtime::opaque::Block; +use cumulus_client_consensus_common::ParachainBlockImportMarker; +use cumulus_primitives_core::BlockT; +use fc_consensus::Error; +pub use fc_consensus::FrontierBlockImport; +pub use fc_db::kv::Backend as FrontierBackend; +use fc_mapping_sync::{kv::MappingSyncWorker, SyncStrategy}; +use fc_rpc::EthTask; +pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; +use fc_storage::StorageOverride; +use fp_consensus::ensure_log; +use fp_rpc::EthereumRuntimeRPCApi; +use futures::{future, prelude::*}; +use polkadot_service::HeaderT; +use sc_client_api::{AuxStore, BlockOf, BlockchainEvents}; +use sc_consensus::{ + BlockCheckParams, BlockImport as BlockImportT, BlockImportParams, ImportResult, +}; +use sc_network_sync::SyncingService; +use sc_service::{Configuration, TaskManager}; +use sp_api::ProvideRuntimeApi; +use sp_block_builder::BlockBuilder as BlockBuilderApi; +use sp_blockchain::HeaderBackend; +use sp_consensus::Error as ConsensusError; + +pub fn db_config_dir(config: &Configuration) -> PathBuf { + config.base_path.config_dir(config.chain_spec.id()) +} + +/// The ethereum-compatibility configuration used to run a node. +#[derive(Clone, Debug, clap::Parser)] +pub struct EthConfiguration { + /// Maximum number of logs in a query. + #[arg(long, default_value = "10000")] + pub max_past_logs: u32, + + /// Maximum fee history cache size. + #[arg(long, default_value = "2048")] + pub fee_history_limit: u64, + + #[arg(long)] + pub enable_dev_signer: bool, + + /// The dynamic-fee pallet target gas price set by block author + #[arg(long, default_value = "1")] + pub target_gas_price: u64, + + /// Maximum allowed gas limit will be `block.gas_limit * execute_gas_limit_multiplier` + /// when using eth_call/eth_estimateGas. + #[arg(long, default_value = "10")] + pub execute_gas_limit_multiplier: u64, + + /// Size in bytes of the LRU cache for block data. + #[arg(long, default_value = "50")] + pub eth_log_block_cache: usize, + + /// Size in bytes of the LRU cache for transactions statuses data. + #[arg(long, default_value = "50")] + pub eth_statuses_cache: usize, +} + +type BlockNumberOf = <::Header as HeaderT>::Number; + +pub struct BlockImport, C> { + inner: I, + client: Arc, + backend: Arc>, + evm_since: BlockNumberOf, + _marker: PhantomData, +} + +impl, C> Clone for BlockImport { + fn clone(&self) -> Self { + BlockImport { + inner: self.inner.clone(), + client: self.client.clone(), + backend: self.backend.clone(), + evm_since: self.evm_since, + _marker: PhantomData, + } + } +} + +impl BlockImport +where + B: BlockT, + I: BlockImportT + Send + Sync, + I::Error: Into, + C: ProvideRuntimeApi + Send + Sync + HeaderBackend + AuxStore + BlockOf, + C::Api: EthereumRuntimeRPCApi, + C::Api: BlockBuilderApi, +{ + pub fn new( + inner: I, + client: Arc, + backend: Arc>, + evm_since: BlockNumberOf, + ) -> Self { + Self { inner, client, backend, evm_since, _marker: PhantomData } + } +} + +#[async_trait::async_trait] +impl BlockImportT for BlockImport +where + B: BlockT, + ::Number: PartialOrd, + I: BlockImportT + Send + Sync, + I::Error: Into, + C: ProvideRuntimeApi + Send + Sync + HeaderBackend + AuxStore + BlockOf, + C::Api: EthereumRuntimeRPCApi, + C::Api: BlockBuilderApi, +{ + type Error = ConsensusError; + + async fn check_block( + &mut self, + block: BlockCheckParams, + ) -> Result { + self.inner.check_block(block).await.map_err(Into::into) + } + + async fn import_block( + &mut self, + block: BlockImportParams, + ) -> Result { + if *block.header.number() >= self.evm_since { + ensure_log(block.header.digest()).map_err(Error::from)?; + } + self.inner.import_block(block).await.map_err(Into::into) + } +} + +impl, C> ParachainBlockImportMarker for BlockImport {} + +pub fn spawn_frontier_tasks( + task_manager: &TaskManager, + client: Arc, + backend: Arc, + frontier_backend: Arc>, + filter_pool: FilterPool, + storage_overrides: Arc>, + fee_history_cache: FeeHistoryCache, + fee_history_cache_limit: FeeHistoryCacheLimit, + sync: Arc>, + pubsub_notification_sinks: Arc< + fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + >, + >, +) { + task_manager.spawn_essential_handle().spawn( + "frontier-mapping-sync-worker", + None, + MappingSyncWorker::new( + client.import_notification_stream(), + Duration::new(6, 0), + client.clone(), + backend, + storage_overrides.clone(), + frontier_backend, + 3, + 0, + SyncStrategy::Parachain, + sync, + pubsub_notification_sinks, + ) + .for_each(|()| future::ready(())), + ); + + // Spawn Frontier EthFilterApi maintenance task. + // Each filter is allowed to stay in the pool for 100 blocks. + const FILTER_RETAIN_THRESHOLD: u64 = 100; + task_manager.spawn_essential_handle().spawn( + "frontier-filter-pool", + None, + EthTask::filter_pool_task(client.clone(), filter_pool, FILTER_RETAIN_THRESHOLD), + ); + + // Spawn Frontier FeeHistory cache maintenance task. + task_manager.spawn_essential_handle().spawn( + "frontier-fee-history", + None, + EthTask::fee_history_task( + client, + storage_overrides, + fee_history_cache, + fee_history_cache_limit, + ), + ); +} diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 064905019..dbf35cc57 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -23,7 +23,9 @@ pub mod chain_spec; pub mod collator_kusama; #[cfg(feature = "with-bifrost-polkadot-runtime")] pub mod collator_polkadot; +pub mod eth; pub use bifrost_rpc as rpc; +pub mod dev; /// Can be called for a `Configuration` to check if it is a configuration for the `Bifrost` network. pub trait IdentifyVariant { diff --git a/pallets/buy-back/src/mock.rs b/pallets/buy-back/src/mock.rs index 61a75824e..77b9ee1dd 100644 --- a/pallets/buy-back/src/mock.rs +++ b/pallets/buy-back/src/mock.rs @@ -433,6 +433,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/clouds-convert/src/mock.rs b/pallets/clouds-convert/src/mock.rs index cf44d4be6..ad5914f29 100644 --- a/pallets/clouds-convert/src/mock.rs +++ b/pallets/clouds-convert/src/mock.rs @@ -87,6 +87,11 @@ impl frame_system::Config for Runtime { type Version = (); type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = (); + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); } parameter_types! { diff --git a/pallets/cross-in-out/src/lib.rs b/pallets/cross-in-out/src/lib.rs index 1a14206b0..5f1841e6c 100644 --- a/pallets/cross-in-out/src/lib.rs +++ b/pallets/cross-in-out/src/lib.rs @@ -29,6 +29,7 @@ use frame_system::pallet_prelude::*; use orml_traits::MultiCurrency; use sp_std::boxed::Box; pub use weights::WeightInfo; +#[allow(deprecated)] use xcm::{ opaque::v2::{Junction::AccountId32, Junctions::X1, NetworkId::Any}, v2::MultiLocation, @@ -48,6 +49,7 @@ type BalanceOf = <::MultiCurrency as MultiCurrency< >>::Balance; type AccountIdOf = ::AccountId; +#[allow(deprecated)] #[frame_support::pallet] pub mod pallet { use super::*; diff --git a/pallets/cross-in-out/src/tests.rs b/pallets/cross-in-out/src/tests.rs index 2a7e8b836..77ee7d706 100644 --- a/pallets/cross-in-out/src/tests.rs +++ b/pallets/cross-in-out/src/tests.rs @@ -22,8 +22,10 @@ use crate::{mock::*, *}; use bifrost_primitives::currency::KSM; use frame_support::{assert_noop, assert_ok, WeakBoundedVec}; use sp_runtime::DispatchError::BadOrigin; +#[allow(deprecated)] use xcm::opaque::v2::{Junction, Junctions::X1}; +#[allow(deprecated)] #[test] fn cross_in_and_cross_out_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -160,6 +162,7 @@ fn add_to_and_remove_from_register_whitelist_should_work() { }); } +#[allow(deprecated)] #[test] fn register_linked_account_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -235,6 +238,7 @@ fn register_and_deregister_currency_for_cross_in_out_should_work() { }); } +#[allow(deprecated)] #[test] fn change_outer_linked_account_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { diff --git a/pallets/currencies/src/lib.rs b/pallets/currencies/src/lib.rs index 4d0304868..5c6b448bc 100644 --- a/pallets/currencies/src/lib.rs +++ b/pallets/currencies/src/lib.rs @@ -619,13 +619,18 @@ impl fungibles::Inspect for Pallet { } impl fungibles::Unbalanced for Pallet { - fn handle_dust(_dust: fungibles::Dust) { - // https://github.com/paritytech/substrate/blob/569aae5341ea0c1d10426fa1ec13a36c0b64393b/frame/support/src/traits/tokens/fungibles/regular.rs#L124 - // Note: currently the field of Dust type is private and there is no constructor for it, so - // we can't construct a Dust value and pass it. Do nothing here. - // `Pallet` overwrites these functions which can be called as user-level operation of - // fungibles traits when calling these functions, it will not actually reach - // `Unbalanced::handle_dust`. + fn handle_dust(dust: fungibles::Dust) { + let asset = dust.0; + if asset == T::GetNativeCurrencyId::get() { + >::handle_dust(fungible::Dust( + dust.1.into(), + )) + } else { + >::handle_dust(fungibles::Dust( + dust.0.into(), + dust.1.into(), + )) + } } fn write_balance( @@ -668,16 +673,26 @@ impl fungibles::Mutate for Pallet { asset_id: Self::AssetId, who: &T::AccountId, amount: Self::Balance, + preservation: Preservation, precision: Precision, fortitude: Fortitude, ) -> Result { match asset_id { id if id == T::GetNativeCurrencyId::get() => >::burn_from( - who, amount, precision, fortitude, + who, + amount, + preservation, + precision, + fortitude, ), _ => >::burn_from( - asset_id, who, amount, precision, fortitude, + asset_id, + who, + amount, + preservation, + precision, + fortitude, ), } } @@ -1246,10 +1261,17 @@ where fn burn_from( who: &T::AccountId, amount: Self::Balance, + preservation: Preservation, precision: Precision, fortitude: Fortitude, ) -> Result { - >::burn_from(who, amount, precision, fortitude) + >::burn_from( + who, + amount, + preservation, + precision, + fortitude, + ) } fn transfer( diff --git a/pallets/evm-accounts/Cargo.toml b/pallets/evm-accounts/Cargo.toml new file mode 100644 index 000000000..4542bc2d6 --- /dev/null +++ b/pallets/evm-accounts/Cargo.toml @@ -0,0 +1,56 @@ +[package] +name = "pallet-evm-accounts" +version = "1.1.1" +authors = ['GalacticCouncil'] +edition = "2021" +license = "Apache-2.0" +homepage = 'https://github.com/galacticcouncil/hydradx-node' +repository = 'https://github.com/galacticcouncil/hydradx-node' +description = "HydraDX EVM accounts pallet" +readme = "README.md" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +# parity +scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } +codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "3.4.0" } + +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-std = { workspace = true } +sp-core = { workspace = true } + +# Optional imports for benchmarking +frame-benchmarking = { workspace = true, optional = true } +sp-io = { workspace = true, optional = true } +pallet-traits = { workspace = true } + +[dev-dependencies] +sp-core = { workspace = true } +sp-io = { workspace = true } +frame-benchmarking = { workspace = true } +orml-tokens = { workspace = true } +orml-traits = { workspace = true, default-features = false } +hex-literal = { workspace = true } + +[features] +default = ["std"] +std = [ + "codec/std", + "scale-info/std", + "sp-std/std", + "sp-core/std", + "sp-io/std", + "frame-support/std", + "frame-system/std", + "orml-tokens/std", + "pallet-traits/std", + "frame-benchmarking/std", +] +runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", + "sp-io", +] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-accounts/README.md b/pallets/evm-accounts/README.md new file mode 100644 index 000000000..8e2a80b72 --- /dev/null +++ b/pallets/evm-accounts/README.md @@ -0,0 +1,34 @@ +# EVM accounts pallet + +## Terminology + +* **Truncated address:** * A substrate address created from an EVM address by prefixing it with "ETH\0" and appending with eight 0 bytes. +* **Full Substrate address:** * Original 32 bytes long native address (not a truncated address). +* **EVM address:** * First 20 bytes of a Substrate address. + +## Overview + +The pallet allows users to bind their Substrate account to the EVM address and to grant a permission to deploy smart contracts. +The purpose of this pallet is to make interaction with the EVM easier. +Binding an address is not necessary for interacting with the EVM. + +### Binding +Without binding, we are unable to get the original Substrate address from the EVM address inside +of the EVM. Inside of the EVM, we have access only to the EVM address (first 20 bytes of a Substrate account). +In this case we create and use a truncated version of the original Substrate address that called the EVM. +The original and truncated address are two different Substrate addresses. + +With binding, we store the last 12 bytes of the Substrate address. Then we can get the original +Substrate address by concatenating these 12 bytes stored in the storage to the EVM address. + +### Smart contract deployment +This pallet also allows granting a permission to deploy smart contracts. +`ControllerOrigin` can add this permission to EVM addresses. +The list of whitelisted accounts is stored in the storage of this pallet. + +### Dispatchable Functions + +* `bind_evm_address` - Binds a Substrate address to EVM address. +* `add_contract_deployer` - Adds a permission to deploy smart contracts. +* `remove_contract_deployer` - Removes a permission of whitelisted address to deploy smart contracts. +* `renounce_contract_deployer` - Renounce caller's permission to deploy smart contracts. diff --git a/pallets/evm-accounts/rpc/runtime-api/Cargo.toml b/pallets/evm-accounts/rpc/runtime-api/Cargo.toml new file mode 100644 index 000000000..731980d10 --- /dev/null +++ b/pallets/evm-accounts/rpc/runtime-api/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "pallet-evm-accounts-rpc-runtime-api" +version = "1.0.0" +authors = ['GalacticCouncil'] +edition = "2021" +license = "Apache-2.0" +homepage = 'https://github.com/galacticcouncil/hydradx-node' +repository = 'https://github.com/galacticcouncil/hydradx-node' +description = "RPC runtime API for EVM accounts pallet" +readme = "README.md" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } +sp-api = { workspace = true } + +[features] +default = ["std"] +std = [ + "codec/std", + "sp-api/std", +] diff --git a/pallets/evm-accounts/rpc/runtime-api/README.md b/pallets/evm-accounts/rpc/runtime-api/README.md new file mode 100644 index 000000000..5969f05c4 --- /dev/null +++ b/pallets/evm-accounts/rpc/runtime-api/README.md @@ -0,0 +1 @@ +Runtime API definition for EVM accounts pallet. diff --git a/pallets/evm-accounts/rpc/runtime-api/src/lib.rs b/pallets/evm-accounts/rpc/runtime-api/src/lib.rs new file mode 100644 index 000000000..c26dcacf3 --- /dev/null +++ b/pallets/evm-accounts/rpc/runtime-api/src/lib.rs @@ -0,0 +1,38 @@ +// Copyright (C) 2020-2022 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Runtime API definition for the EVM accounts pallet. + +#![cfg_attr(not(feature = "std"), no_std)] + +use codec::Codec; + +sp_api::decl_runtime_apis! { + /// The API to query EVM account conversions. + pub trait EvmAccountsApi where + AccountId: Codec, + EvmAddress: Codec, + { + /// get the EVM address from the substrate address. + fn evm_address(account_id: AccountId) -> EvmAddress; + + /// Return the Substrate address bound to the EVM account. If not bound, returns `None`. + fn bound_account_id(evm_address: EvmAddress) -> Option; + + /// Get the Substrate address from the EVM address. + /// Returns the truncated version of the address if the address wasn't bind. + fn account_id(evm_address: EvmAddress) -> AccountId; + } +} diff --git a/pallets/evm-accounts/src/benchmarking.rs b/pallets/evm-accounts/src/benchmarking.rs new file mode 100644 index 000000000..9214eab69 --- /dev/null +++ b/pallets/evm-accounts/src/benchmarking.rs @@ -0,0 +1,78 @@ +// Copyright (C) 2020-2024 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![cfg(feature = "runtime-benchmarks")] + +use super::*; +use crate::Pallet as EVMAccounts; + +use frame_benchmarking::{account, benchmarks}; +use frame_system::RawOrigin; +use sp_std::prelude::*; + +benchmarks! { + where_clause { + where T::AccountId: AsRef<[u8; 32]> + frame_support::pallet_prelude::IsType, + } + + bind_evm_address { + let user: T::AccountId = account("user", 0, 1); + let evm_address = Pallet::::evm_address(&user); + assert!(!AccountExtension::::contains_key(evm_address)); + + }: _(RawOrigin::Signed(user.clone())) + verify { + assert!(AccountExtension::::contains_key(evm_address)); + } + + add_contract_deployer { + let user: T::AccountId = account("user", 0, 1); + let evm_address = Pallet::::evm_address(&user); + assert!(!ContractDeployer::::contains_key(evm_address)); + + }: _(RawOrigin::Root, evm_address) + verify { + assert!(ContractDeployer::::contains_key(evm_address)); + } + + remove_contract_deployer { + let user: T::AccountId = account("user", 0, 1); + let evm_address = Pallet::::evm_address(&user); + + EVMAccounts::::add_contract_deployer(RawOrigin::Root.into(), evm_address)?; + + assert!(ContractDeployer::::contains_key(evm_address)); + + }: _(RawOrigin::Root, evm_address) + verify { + assert!(!ContractDeployer::::contains_key(evm_address)); + } + + renounce_contract_deployer { + let user: T::AccountId = account("user", 0, 1); + let evm_address = Pallet::::evm_address(&user); + + EVMAccounts::::add_contract_deployer(RawOrigin::Root.into(), evm_address)?; + EVMAccounts::::bind_evm_address(RawOrigin::Signed(user.clone()).into())?; + + assert!(ContractDeployer::::contains_key(evm_address)); + + }: _(RawOrigin::Signed(user)) + verify { + assert!(!ContractDeployer::::contains_key(evm_address)); + } + + impl_benchmark_test_suite!(Pallet, crate::mock::ExtBuilder::default().build(), crate::mock::Test); +} diff --git a/pallets/evm-accounts/src/lib.rs b/pallets/evm-accounts/src/lib.rs new file mode 100644 index 000000000..e86a6d5e2 --- /dev/null +++ b/pallets/evm-accounts/src/lib.rs @@ -0,0 +1,317 @@ +// Copyright (C) 2020-2024 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! # EVM accounts pallet +//! +//! ## Terminology +//! +//! * **Truncated address:** * A substrate address created from an EVM address by prefixing it with +//! "ETH\0" and appending with eight 0 bytes. +//! * **Full Substrate address:** * Original 32 bytes long native address (not a truncated address). +//! * **EVM address:** * First 20 bytes of a Substrate address. +//! +//! ## Overview +//! +//! The pallet allows users to bind their Substrate account to the EVM address and to grant a +//! permission to deploy smart contracts. The purpose of this pallet is to make interaction with the +//! EVM easier. Binding an address is not necessary for interacting with the EVM. +//! +//! ### Binding +//! Without binding, we are unable to get the original Substrate address from the EVM address inside +//! of the EVM. Inside of the EVM, we have access only to the EVM address (first 20 bytes of a +//! Substrate account). In this case we create and use a truncated version of the original Substrate +//! address that called the EVM. The original and truncated address are two different Substrate +//! addresses. +//! +//! With binding, we store the last 12 bytes of the Substrate address. Then we can get the original +//! Substrate address by concatenating these 12 bytes stored in the storage to the EVM address. +//! +//! ### Smart contract deployment +//! This pallet also allows granting a permission to deploy smart contracts. +//! `ControllerOrigin` can add this permission to EVM addresses. +//! The list of whitelisted accounts is stored in the storage of this pallet. +//! +//! ### Dispatchable Functions +//! +//! * `bind_evm_address` - Binds a Substrate address to EVM address. +//! * `add_contract_deployer` - Adds a permission to deploy smart contracts. +//! * `remove_contract_deployer` - Removes a permission of whitelisted address to deploy smart +//! contracts. +//! * `renounce_contract_deployer` - Renounce caller's permission to deploy smart contracts. + +#![cfg_attr(not(feature = "std"), no_std)] + +use frame_support::{ + ensure, + pallet_prelude::{DispatchResult, Get}, +}; +use pallet_traits::evm::InspectEvmAccounts; +use sp_core::{ + crypto::{AccountId32, ByteArray}, + H160, U256, +}; + +#[cfg(test)] +mod mock; +#[cfg(test)] +mod tests; + +mod benchmarking; +pub mod weights; + +pub use pallet::*; +pub use weights::WeightInfo; + +pub type Balance = u128; +pub type EvmAddress = H160; +pub type AccountIdLast12Bytes = [u8; 12]; + +pub trait EvmNonceProvider { + fn get_nonce(evm_address: H160) -> U256; +} + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::config] + pub trait Config: frame_system::Config { + /// The overarching event type. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + /// EVM nonce provider. + type EvmNonceProvider: EvmNonceProvider; + + /// Fee multiplier for the binding of addresses. + #[pallet::constant] + type FeeMultiplier: Get; + + /// Origin that can whitelist addresses for smart contract deployment. + type ControllerOrigin: EnsureOrigin; + + /// Weight information for extrinsic in this pallet. + type WeightInfo: WeightInfo; + } + + /// Maps an EVM address to the last 12 bytes of a substrate account. + #[pallet::storage] + #[pallet::getter(fn account)] + pub(super) type AccountExtension = + StorageMap<_, Blake2_128Concat, EvmAddress, AccountIdLast12Bytes>; + + /// Whitelisted addresses that are allowed to deploy smart contracts. + #[pallet::storage] + pub(super) type ContractDeployer = StorageMap<_, Blake2_128Concat, EvmAddress, ()>; + + #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] + pub enum Event { + /// Binding was created. + Bound { account: T::AccountId, address: EvmAddress }, + /// Deployer was added. + DeployerAdded { who: EvmAddress }, + /// Deployer was removed. + DeployerRemoved { who: EvmAddress }, + } + + #[pallet::error] + #[cfg_attr(test, derive(PartialEq, Eq))] + pub enum Error { + /// EVM Account's nonce is not zero + TruncatedAccountAlreadyUsed, + /// Address is already bound + AddressAlreadyBound, + /// Bound address cannot be used + BoundAddressCannotBeUsed, + /// Address not whitelisted + AddressNotWhitelisted, + } + + #[pallet::hooks] + impl Hooks> for Pallet + where + T::AccountId: frame_support::traits::IsType, + { + fn integrity_test() { + // implementation of this pallet expects that EvmAddress is 20 bytes and AccountId is 32 + // bytes long. If this is not true, `copy_from_slice` might panic. + assert_eq!(EvmAddress::len_bytes(), 20, "EVM Address is expected to be 20 bytes long."); + assert_eq!(AccountId32::LEN, 32, "AccountId is expected to be 32 bytes long."); + } + } + + #[pallet::call] + impl Pallet + where + T::AccountId: AsRef<[u8; 32]> + frame_support::traits::IsType, + { + /// Binds a Substrate address to EVM address. + /// After binding, the EVM is able to convert an EVM address to the original Substrate + /// address. Without binding, the EVM converts an EVM address to a truncated Substrate + /// address, which doesn't correspond to the origin address. + /// + /// Binding an address is not necessary for interacting with the EVM. + /// + /// Parameters: + /// - `origin`: Substrate account binding an address + /// + /// Emits `EvmAccountBound` event when successful. + #[pallet::call_index(0)] + #[pallet::weight(::WeightInfo::bind_evm_address().saturating_mul(::FeeMultiplier::get() as u64))] + pub fn bind_evm_address(origin: OriginFor) -> DispatchResult { + let who = ensure_signed(origin)?; + + let evm_address = Self::evm_address(&who); + + // This check is not necessary. It prevents binding the same address multiple times. + // Without this check binding the address second time can have pass or fail, depending + // on the nonce. So it's better to prevent any confusion and throw an error when address + // is already bound. + ensure!( + !AccountExtension::::contains_key(evm_address), + Error::::AddressAlreadyBound + ); + + let nonce = T::EvmNonceProvider::get_nonce(evm_address); + ensure!(nonce.is_zero(), Error::::TruncatedAccountAlreadyUsed); + + let mut last_12_bytes: [u8; 12] = [0; 12]; + last_12_bytes.copy_from_slice(&who.as_ref()[20..32]); + + >::insert(evm_address, last_12_bytes); + + Self::deposit_event(Event::Bound { account: who, address: evm_address }); + + Ok(()) + } + + /// Adds an EVM address to the list of addresses that are allowed to deploy smart contracts. + /// + /// Parameters: + /// - `origin`: Substrate account whitelisting an address. Must be `ControllerOrigin`. + /// - `address`: EVM address that is whitelisted + /// + /// Emits `DeployerAdded` event when successful. + #[pallet::call_index(1)] + #[pallet::weight(::WeightInfo::add_contract_deployer())] + pub fn add_contract_deployer(origin: OriginFor, address: EvmAddress) -> DispatchResult { + T::ControllerOrigin::ensure_origin(origin.clone())?; + + >::insert(address, ()); + + Self::deposit_event(Event::DeployerAdded { who: address }); + + Ok(()) + } + + /// Removes an EVM address from the list of addresses that are allowed to deploy smart + /// contracts. + /// + /// Parameters: + /// - `origin`: Substrate account removing the EVM address from the whitelist. Must be + /// `ControllerOrigin`. + /// - `address`: EVM address that is removed from the whitelist + /// + /// Emits `DeployerRemoved` event when successful. + #[pallet::call_index(2)] + #[pallet::weight(::WeightInfo::remove_contract_deployer())] + pub fn remove_contract_deployer( + origin: OriginFor, + address: EvmAddress, + ) -> DispatchResult { + T::ControllerOrigin::ensure_origin(origin.clone())?; + + >::remove(address); + + Self::deposit_event(Event::DeployerRemoved { who: address }); + + Ok(()) + } + + /// Removes the account's EVM address from the list of addresses that are allowed to deploy + /// smart contracts. Based on the best practices, this extrinsic can be called by any + /// whitelisted account to renounce their own permission. + /// + /// Parameters: + /// - `origin`: Substrate account removing their EVM address from the whitelist. + /// + /// Emits `DeployerRemoved` event when successful. + #[pallet::call_index(3)] + #[pallet::weight(::WeightInfo::renounce_contract_deployer())] + pub fn renounce_contract_deployer(origin: OriginFor) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + let address = Self::evm_address(&who); + + >::remove(address); + + Self::deposit_event(Event::DeployerRemoved { who: address }); + + Ok(()) + } + } +} + +impl InspectEvmAccounts for Pallet +where + T::AccountId: AsRef<[u8; 32]> + frame_support::traits::IsType, +{ + /// Returns `True` if the account is EVM truncated account. + fn is_evm_account(account_id: T::AccountId) -> bool { + let account_ref = account_id.as_ref(); + &account_ref[0..4] == b"ETH\0" && account_ref[24..32] == [0u8; 8] + } + + /// Get the EVM address from the substrate address. + fn evm_address(account_id: &impl AsRef<[u8; 32]>) -> EvmAddress { + let acc = account_id.as_ref(); + EvmAddress::from_slice(&acc[..20]) + } + + /// Get the truncated address from the EVM address. + fn truncated_account_id(evm_address: EvmAddress) -> T::AccountId { + let mut data: [u8; 32] = [0u8; 32]; + data[0..4].copy_from_slice(b"ETH\0"); + data[4..24].copy_from_slice(&evm_address[..]); + AccountId32::from(data).into() + } + + /// Return the Substrate address bound to the EVM account. If not bound, returns `None`. + fn bound_account_id(evm_address: EvmAddress) -> Option { + let Some(last_12_bytes) = AccountExtension::::get(evm_address) else { + return None; + }; + let mut data: [u8; 32] = [0u8; 32]; + data[..20].copy_from_slice(evm_address.0.as_ref()); + data[20..32].copy_from_slice(&last_12_bytes); + Some(AccountId32::from(data).into()) + } + + /// Get the Substrate address from the EVM address. + /// Returns the truncated version of the address if the address wasn't bind. + fn account_id(evm_address: EvmAddress) -> T::AccountId { + Self::bound_account_id(evm_address) + .unwrap_or_else(|| Self::truncated_account_id(evm_address)) + } + + /// Returns `True` if the address is allowed to deploy smart contracts. + fn can_deploy_contracts(evm_address: EvmAddress) -> bool { + ContractDeployer::::contains_key(evm_address) + } +} diff --git a/pallets/evm-accounts/src/mock.rs b/pallets/evm-accounts/src/mock.rs new file mode 100644 index 000000000..25d6514ac --- /dev/null +++ b/pallets/evm-accounts/src/mock.rs @@ -0,0 +1,128 @@ +#![cfg(test)] +use super::*; + +use crate as pallet_evm_accounts; +use crate::{Balance, Config}; +use frame_support::{ + derive_impl, parameter_types, + sp_runtime::{ + traits::{IdentifyAccount, IdentityLookup, Verify}, + BuildStorage, MultiSignature, + }, + traits::Everything, +}; +use frame_system::EnsureRoot; +use orml_traits::parameter_type_with_key; +pub use sp_core::H160; +use std::{cell::RefCell, collections::HashMap}; + +pub type AssetId = u32; +pub type Signature = MultiSignature; +pub type AccountId = <::Signer as IdentifyAccount>::AccountId; +type Block = frame_system::mocking::MockBlock; + +pub const ONE: Balance = 1_000_000_000_000; +pub const INITIAL_BALANCE: Balance = 1_000_000_000_000 * ONE; + +pub const ALICE: AccountId = AccountId::new([1; 32]); + +pub const HDX: AssetId = 0; + +thread_local! { + pub static NONCE: RefCell> = RefCell::new(HashMap::default()); +} + +frame_support::construct_runtime!( + pub enum Test + { + System: frame_system, + EVMAccounts: pallet_evm_accounts, + Tokens: orml_tokens, + } + +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub const SS58Prefix: u8 = 63; + pub const NativeAssetId: AssetId = HDX; +} + +pub struct EvmNonceProviderMock; +impl EvmNonceProvider for EvmNonceProviderMock { + fn get_nonce(evm_address: H160) -> U256 { + NONCE.with(|v| v.borrow().get(&evm_address).copied()).unwrap_or_default() + } +} + +impl Config for Test { + type RuntimeEvent = RuntimeEvent; + type FeeMultiplier = sp_core::ConstU32<10>; + type EvmNonceProvider = EvmNonceProviderMock; + type ControllerOrigin = EnsureRoot; + type WeightInfo = (); +} + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] +impl frame_system::Config for Test { + type Block = Block; + type AccountId = AccountId; + type Lookup = IdentityLookup; +} + +parameter_type_with_key! { + pub ExistentialDeposits: |_asset_id: AssetId| -> Balance { + 1 + }; +} + +impl orml_tokens::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Balance = Balance; + type Amount = i128; + type CurrencyId = AssetId; + type WeightInfo = (); + type ExistentialDeposits = ExistentialDeposits; + type CurrencyHooks = (); + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = (); + type DustRemovalWhitelist = Everything; +} + +pub struct ExtBuilder { + endowed_accounts: Vec<(AccountId, AssetId, Balance)>, +} + +impl Default for ExtBuilder { + fn default() -> Self { + NONCE.with(|v| { + v.borrow_mut().clear(); + }); + + Self { endowed_accounts: vec![(ALICE, HDX, INITIAL_BALANCE)] } + } +} + +impl ExtBuilder { + pub fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); + + orml_tokens::GenesisConfig:: { balances: self.endowed_accounts } + .assimilate_storage(&mut t) + .unwrap(); + + let mut r: sp_io::TestExternalities = t.into(); + r.execute_with(|| System::set_block_number(1)); + r + } + + pub fn with_non_zero_nonce(self, account_id: AccountId) -> Self { + let evm_address = EVMAccounts::evm_address(&account_id); + NONCE.with(|v| { + let mut m = v.borrow_mut(); + m.insert(evm_address, U256::one()); + }); + self + } +} diff --git a/pallets/evm-accounts/src/tests.rs b/pallets/evm-accounts/src/tests.rs new file mode 100644 index 000000000..e27d4335f --- /dev/null +++ b/pallets/evm-accounts/src/tests.rs @@ -0,0 +1,131 @@ +// This file is part of HydraDX-node. + +// Copyright (C) 2020-2024 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::*; +use mock::*; + +use frame_support::{assert_noop, assert_ok}; +use hex_literal::hex; + +#[test] +fn eth_address_should_convert_to_truncated_address_when_not_bound() { + ExtBuilder::default().build().execute_with(|| { + // Arrange + let evm_address = H160::from(hex!["222222ff7Be76052e023Ec1a306fCca8F9659D80"]); + let truncated_address = AccountId::from(hex![ + "45544800222222ff7be76052e023ec1a306fcca8f9659d800000000000000000" + ]); + + assert_eq!(EVMAccounts::truncated_account_id(evm_address), truncated_address); + + // Act & Assert + assert_eq!(EVMAccounts::bound_account_id(evm_address), None); + assert_eq!(EVMAccounts::account_id(evm_address), truncated_address); + }); +} + +#[test] +fn eth_address_should_convert_to_full_address_when_bound() { + ExtBuilder::default().build().execute_with(|| { + // Arrange & Act + assert_ok!(EVMAccounts::bind_evm_address(RuntimeOrigin::signed(ALICE),)); + + // Assert + let evm_address = EVMAccounts::evm_address(&ALICE); + + assert_eq!(EVMAccounts::bound_account_id(evm_address), Some(ALICE)); + + assert_eq!(EVMAccounts::account_id(evm_address), ALICE); + }); +} + +#[test] +fn bind_address_should_fail_when_nonce_is_not_zero() { + ExtBuilder::default().with_non_zero_nonce(ALICE).build().execute_with(|| { + assert_noop!( + EVMAccounts::bind_evm_address(RuntimeOrigin::signed(ALICE)), + Error::::TruncatedAccountAlreadyUsed + ); + }); +} + +#[test] +fn bind_address_should_fail_when_already_bound() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(EVMAccounts::bind_evm_address(RuntimeOrigin::signed(ALICE),)); + assert_noop!( + EVMAccounts::bind_evm_address(RuntimeOrigin::signed(ALICE)), + Error::::AddressAlreadyBound + ); + }); +} + +#[test] +fn add_contract_deployer_should_store_address_in_the_storage() { + ExtBuilder::default().build().execute_with(|| { + // Arrange + let evm_address = EVMAccounts::evm_address(&ALICE); + assert!(!EVMAccounts::can_deploy_contracts(evm_address)); + + // Act + assert_ok!(EVMAccounts::add_contract_deployer(RuntimeOrigin::root(), evm_address)); + + // Assert + assert!(EVMAccounts::can_deploy_contracts(evm_address)); + + // adding the address again should be ok + assert_ok!(EVMAccounts::add_contract_deployer(RuntimeOrigin::root(), evm_address)); + }); +} + +#[test] +fn remove_contract_deployer_should_remove_address_from_the_storage() { + ExtBuilder::default().build().execute_with(|| { + // Arrange + let evm_address = EVMAccounts::evm_address(&ALICE); + assert_ok!(EVMAccounts::add_contract_deployer(RuntimeOrigin::root(), evm_address)); + assert!(EVMAccounts::can_deploy_contracts(evm_address)); + + // Act + assert_ok!(EVMAccounts::remove_contract_deployer(RuntimeOrigin::root(), evm_address)); + + // Assert + assert!(!EVMAccounts::can_deploy_contracts(evm_address)); + + // removing the address again should be ok + assert_ok!(EVMAccounts::remove_contract_deployer(RuntimeOrigin::root(), evm_address)); + }); +} + +#[test] +fn renounce_contract_deployer_should_remove_address_from_the_storage() { + ExtBuilder::default().build().execute_with(|| { + // Arrange + let evm_address = EVMAccounts::evm_address(&ALICE); + assert_ok!(EVMAccounts::add_contract_deployer(RuntimeOrigin::root(), evm_address)); + assert!(EVMAccounts::can_deploy_contracts(evm_address)); + + // Act + assert_ok!(EVMAccounts::renounce_contract_deployer(RuntimeOrigin::signed(ALICE))); + + // Assert + assert!(!EVMAccounts::can_deploy_contracts(evm_address)); + + // ronouncing the address again should be ok + assert_ok!(EVMAccounts::renounce_contract_deployer(RuntimeOrigin::signed(ALICE))); + }); +} diff --git a/pallets/evm-accounts/src/weights.rs b/pallets/evm-accounts/src/weights.rs new file mode 100644 index 000000000..9421d1a0f --- /dev/null +++ b/pallets/evm-accounts/src/weights.rs @@ -0,0 +1,164 @@ +// This file is part of HydraDX. + +// Copyright (C) 2020-2024 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for `pallet_evm_accounts` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-02-21, STEPS: `10`, REPEAT: `30`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 + +// Executed Command: +// target/release/hydradx +// benchmark +// pallet +// --chain=dev +// --steps=10 +// --repeat=30 +// --wasm-execution=compiled +// --heap-pages=4096 +// --template=.maintain/pallet-weight-template-no-back.hbs +// --pallet=pallet-evm-accounts +// --output=weights-1.1.0/evm-accounts.rs +// --extrinsic=* + +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{ + traits::Get, + weights::{constants::RocksDbWeight, Weight}, +}; +use sp_std::marker::PhantomData; + +pub trait WeightInfo { + fn bind_evm_address() -> Weight; + fn add_contract_deployer() -> Weight; + fn remove_contract_deployer() -> Weight; + fn renounce_contract_deployer() -> Weight; +} + +pub struct HydraWeight(PhantomData); + +impl WeightInfo for HydraWeight { + /// Storage: `EVMAccounts::AccountExtension` (r:1 w:1) + /// Proof: `EVMAccounts::AccountExtension` (`max_values`: None, `max_size`: Some(48), added: + /// 2523, mode: `MaxEncodedLen`) Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: + /// `MaxEncodedLen`) Storage: `AssetRegistry::NextAssetId` (r:1 w:0) + /// Proof: `AssetRegistry::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, + /// mode: `MaxEncodedLen`) Storage: `AssetRegistry::LocationAssets` (r:1 w:0) + /// Proof: `AssetRegistry::LocationAssets` (`max_values`: None, `max_size`: Some(622), added: + /// 3097, mode: `MaxEncodedLen`) Storage: `Tokens::Accounts` (r:1 w:0) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: + /// `MaxEncodedLen`) + fn bind_evm_address() -> Weight { + // Proof Size summary in bytes: + // Measured: `479` + // Estimated: `4087` + // Minimum execution time: 36_357_000 picoseconds. + Weight::from_parts(36_601_000, 4087) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn add_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_157_000 picoseconds. + Weight::from_parts(13_481_000, 0).saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn remove_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_196_000 picoseconds. + Weight::from_parts(13_517_000, 0).saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn renounce_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_153_000 picoseconds. + Weight::from_parts(13_380_000, 0).saturating_add(T::DbWeight::get().writes(1)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + /// Storage: `EVMAccounts::AccountExtension` (r:1 w:1) + /// Proof: `EVMAccounts::AccountExtension` (`max_values`: None, `max_size`: Some(48), added: + /// 2523, mode: `MaxEncodedLen`) Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: + /// `MaxEncodedLen`) Storage: `AssetRegistry::NextAssetId` (r:1 w:0) + /// Proof: `AssetRegistry::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, + /// mode: `MaxEncodedLen`) Storage: `AssetRegistry::LocationAssets` (r:1 w:0) + /// Proof: `AssetRegistry::LocationAssets` (`max_values`: None, `max_size`: Some(622), added: + /// 3097, mode: `MaxEncodedLen`) Storage: `Tokens::Accounts` (r:1 w:0) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: + /// `MaxEncodedLen`) + fn bind_evm_address() -> Weight { + // Proof Size summary in bytes: + // Measured: `479` + // Estimated: `4087` + // Minimum execution time: 36_357_000 picoseconds. + Weight::from_parts(36_601_000, 4087) + .saturating_add(RocksDbWeight::get().reads(5)) + .saturating_add(RocksDbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn add_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_157_000 picoseconds. + Weight::from_parts(13_481_000, 0).saturating_add(RocksDbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn remove_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_196_000 picoseconds. + Weight::from_parts(13_517_000, 0).saturating_add(RocksDbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn renounce_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_153_000 picoseconds. + Weight::from_parts(13_380_000, 0).saturating_add(RocksDbWeight::get().writes(1)) + } +} diff --git a/pallets/farming/src/lib.rs b/pallets/farming/src/lib.rs index 3f4d1a706..f518fe5e9 100644 --- a/pallets/farming/src/lib.rs +++ b/pallets/farming/src/lib.rs @@ -404,9 +404,9 @@ pub mod pallet { let reward_issuer = T::RewardIssuer::get().into_sub_account_truncating(pid); let basic_token = *tokens_proportion.get(0).ok_or(Error::::NotNullable)?; let tokens_proportion_map: BTreeMap, Perbill> = - tokens_proportion.into_iter().map(|(k, v)| (k, v)).collect(); + tokens_proportion.into_iter().collect(); let basic_rewards_map: BTreeMap, BalanceOf> = - basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + basic_rewards.into_iter().collect(); let mut pool_info = PoolInfo::new( keeper, @@ -424,7 +424,7 @@ pub mod pallet { if let Some((max_block, gauge_basic_rewards)) = gauge_init { let gauge_basic_rewards_map: BTreeMap, BalanceOf> = - gauge_basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + gauge_basic_rewards.into_iter().collect(); Self::create_gauge_pool(pid, &mut pool_info, gauge_basic_rewards_map, max_block)?; }; @@ -689,7 +689,7 @@ pub mod pallet { ensure!(pool_info.state == PoolState::Retired, Error::::InvalidPoolState); if let Some(basic_rewards) = basic_rewards { let basic_rewards_map: BTreeMap, BalanceOf> = - basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + basic_rewards.into_iter().collect(); pool_info.basic_rewards = basic_rewards_map; }; if let Some(min_deposit_to_start) = min_deposit_to_start { @@ -709,7 +709,7 @@ pub mod pallet { }; if let Some((max_block, gauge_basic_rewards)) = gauge_init { let gauge_basic_rewards_map: BTreeMap, BalanceOf> = - gauge_basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + gauge_basic_rewards.into_iter().collect(); Self::create_gauge_pool(pid, &mut pool_info, gauge_basic_rewards_map, max_block)?; }; @@ -764,7 +764,7 @@ pub mod pallet { ); if let Some(basic_rewards) = basic_rewards { let basic_rewards_map: BTreeMap, BalanceOf> = - basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + basic_rewards.into_iter().collect(); pool_info.basic_rewards = basic_rewards_map; }; if let Some(withdraw_limit_time) = withdraw_limit_time { @@ -778,7 +778,7 @@ pub mod pallet { }; if let Some(gauge_basic_rewards) = gauge_basic_rewards { let gauge_basic_rewards_map: BTreeMap, BalanceOf> = - gauge_basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + gauge_basic_rewards.into_iter().collect(); GaugePoolInfos::::mutate( pool_info.gauge.ok_or(Error::::GaugePoolNotExist)?, |gauge_pool_info_old| { diff --git a/pallets/fee-share/src/mock.rs b/pallets/fee-share/src/mock.rs index f60adbbde..ece282274 100644 --- a/pallets/fee-share/src/mock.rs +++ b/pallets/fee-share/src/mock.rs @@ -422,6 +422,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/flexible-fee/Cargo.toml b/pallets/flexible-fee/Cargo.toml index dc0ac1552..6e4285a9e 100644 --- a/pallets/flexible-fee/Cargo.toml +++ b/pallets/flexible-fee/Cargo.toml @@ -11,20 +11,23 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } pallet-transaction-payment = { workspace = true } +pallet-balances = { workspace = true } sp-arithmetic = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } bifrost-primitives = { workspace = true } +bifrost-xcm-interface = { workspace = true } zenlink-protocol = { workspace = true } orml-traits = { workspace = true } cumulus-primitives-core = { workspace = true } bifrost-asset-registry = { workspace = true } +polkadot-parachain-primitives = { workspace = true } log = { workspace = true } +xcm = { workspace = true } [dev-dependencies] orml-tokens = { workspace = true } bifrost-currencies = { workspace = true } -pallet-balances = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } cumulus-primitives-core = { workspace = true } @@ -33,7 +36,6 @@ bifrost-asset-registry = { workspace = true } bifrost-xcm-interface = { workspace = true } xcm-executor = { workspace = true } xcm-builder = { workspace = true } -xcm = { workspace = true } pallet-xcm = { workspace = true } bifrost-vtoken-voting = { workspace = true, features = ["kusama"] } diff --git a/pallets/flexible-fee/src/lib.rs b/pallets/flexible-fee/src/lib.rs index 71ac0b428..bebb95aaa 100644 --- a/pallets/flexible-fee/src/lib.rs +++ b/pallets/flexible-fee/src/lib.rs @@ -18,10 +18,13 @@ #![cfg_attr(not(feature = "std"), no_std)] +pub use crate::pallet::*; use bifrost_primitives::{ + currency::WETH, traits::{FeeGetter, XcmDestWeightAndFeeHandler}, - CurrencyId, ExtraFeeName, TryConvertFrom, XcmOperationType, BNC, + AccountFeeCurrency, CurrencyId, ExtraFeeName, TryConvertFrom, XcmOperationType, BNC, }; +use bifrost_xcm_interface::{polkadot::RelaychainCall, traits::parachains, PolkadotXcmCall}; use core::convert::Into; use cumulus_primitives_core::ParaId; use frame_support::{ @@ -30,19 +33,23 @@ use frame_support::{ Currency, ExistenceRequirement, Get, Imbalance, OnUnbalanced, ReservableCurrency, WithdrawReasons, }, + transactional, + weights::WeightMeter, + PalletId, }; use frame_system::pallet_prelude::*; use orml_traits::MultiCurrency; -pub use pallet::*; use pallet_transaction_payment::OnChargeTransaction; -use sp_arithmetic::traits::{CheckedAdd, SaturatedConversion}; +use polkadot_parachain_primitives::primitives::Sibling; +use sp_arithmetic::traits::{CheckedAdd, SaturatedConversion, UniqueSaturatedInto}; use sp_runtime::{ - traits::{DispatchInfoOf, PostDispatchInfoOf, Saturating, Zero}, + traits::{AccountIdConversion, DispatchInfoOf, PostDispatchInfoOf, Saturating, Zero}, transaction_validity::TransactionValidityError, BoundedVec, }; -use sp_std::{vec, vec::Vec}; +use sp_std::{boxed::Box, vec, vec::Vec}; pub use weights::WeightInfo; +use xcm::{prelude::Unlimited, v4::prelude::*}; use zenlink_protocol::{AssetBalance, AssetId, ExportZenlink}; #[cfg(feature = "runtime-benchmarks")] @@ -52,10 +59,25 @@ mod mock; mod tests; pub mod weights; +pub type AccountIdOf = ::AccountId; +pub type CurrencyIdOf = + <::MultiCurrency as MultiCurrency>>::CurrencyId; +pub type BalanceOf = <::MultiCurrency as MultiCurrency>>::Balance; +pub type PalletBalanceOf = <::Currency as Currency>>::Balance; +pub type NegativeImbalanceOf = + <::Currency as Currency>>::NegativeImbalance; +pub type PositiveImbalanceOf = + <::Currency as Currency>>::PositiveImbalance; +pub type CallOf = ::RuntimeCall; + +#[derive(Encode, Decode, Copy, Clone, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +pub enum TargetChain { + AssetHub, + RelayChain, +} + #[frame_support::pallet] pub mod pallet { - use bifrost_primitives::XcmDestWeightAndFeeHandler; - use super::*; #[pallet::config] @@ -74,6 +96,9 @@ pub mod pallet { type Currency: Currency + ReservableCurrency; /// Handler for the unbalanced decrease type OnUnbalanced: OnUnbalanced>; + /// xcm transfer interface + type XcmRouter: SendXcm; + type DexOperator: ExportZenlink; /// Filter if this transaction needs to be deducted extra fee besides basic transaction fee, /// and get the name of the fee @@ -85,35 +110,71 @@ pub mod pallet { #[pallet::constant] type MaxFeeCurrencyOrderListLen: Get; + #[pallet::constant] + type MinAssetHubExecutionFee: Get>; + + #[pallet::constant] + type MinRelaychainExecutionFee: Get>; + + /// The currency id of the RelayChain + #[pallet::constant] + type RelaychainCurrencyId: Get>; + type ParachainId: Get; /// The only origin that can set universal fee currency order list type ControlOrigin: EnsureOrigin; type XcmWeightAndFeeHandler: XcmDestWeightAndFeeHandler>; + + #[pallet::constant] + type PalletId: Get; } - pub type AccountIdOf = ::AccountId; - pub type CurrencyIdOf = - <::MultiCurrency as MultiCurrency>>::CurrencyId; - pub type PalletBalanceOf = <::Currency as Currency>>::Balance; - pub type NegativeImbalanceOf = - <::Currency as Currency>>::NegativeImbalance; - pub type PositiveImbalanceOf = - <::Currency as Currency>>::PositiveImbalance; + #[pallet::hooks] + impl Hooks> for Pallet { + fn on_idle(_n: BlockNumberFor, limit: Weight) -> Weight { + let mut weight = Weight::default(); + + if WeightMeter::with_limit(limit) + .try_consume(T::DbWeight::get().reads_writes(4, 2)) + .is_err() + { + return weight; + } - pub type CallOf = ::RuntimeCall; + weight += T::DbWeight::get().reads_writes(4, 2); - #[pallet::hooks] - impl Hooks> for Pallet {} + if Self::handle_fee().is_err() { + return weight; + } + + weight += T::DbWeight::get().reads_writes(1, 2); + weight + } + } #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - FlexibleFeeExchanged(CurrencyIdOf, PalletBalanceOf), // token and amount + TransferTo { + from: T::AccountId, + target_chain: TargetChain, + amount: BalanceOf, + }, + FlexibleFeeExchanged { + transaction_fee_currency: CurrencyIdOf, + transaction_fee_amount: PalletBalanceOf, + }, // token and amount FixedRateFeeExchanged(CurrencyIdOf, PalletBalanceOf), // [extra_fee_name, currency_id, amount_in, BNC_amount_out] - ExtraFeeDeducted(ExtraFeeName, CurrencyIdOf, PalletBalanceOf, PalletBalanceOf), + ExtraFeeDeducted { + operation: ExtraFeeName, + transaction_extra_fee_currency: CurrencyIdOf, + transaction_extra_fee_amount: PalletBalanceOf, + transaction_extra_fee_bnc_amount: PalletBalanceOf, + transaction_extra_fee_receiver: T::AccountId, + }, } /// The current storage version, we set to 2 our new version(after migrate stroage from vec t @@ -147,6 +208,8 @@ pub mod pallet { WrongListLength, WeightAndFeeNotExist, DexFailedToGetAmountInByPath, + UnweighableMessage, + XcmExecutionFailed, } #[pallet::call] @@ -188,6 +251,115 @@ pub mod pallet { } impl Pallet { + #[transactional] + fn handle_fee() -> DispatchResult { + let fee_receiver = Self::get_fee_receiver(ExtraFeeName::StatemineTransfer); + let fee_receiver_balance = + T::MultiCurrency::free_balance(T::RelaychainCurrencyId::get(), &fee_receiver); + if fee_receiver_balance >= T::MinAssetHubExecutionFee::get() { + T::MultiCurrency::withdraw( + T::RelaychainCurrencyId::get(), + &fee_receiver, + fee_receiver_balance, + )?; + + let asset: Asset = Asset { + id: AssetId(Location::here()), + fun: Fungible(UniqueSaturatedInto::::unique_saturated_into( + fee_receiver_balance, + )), + }; + + let remote_call = + RelaychainCall::, AccountIdOf, BlockNumberFor>::XcmPallet( + PolkadotXcmCall::LimitedTeleportAssets( + Box::new(Location::new(0, [Parachain(parachains::Statemine::ID)]).into()), + Box::new( + Location::new( + 0, + [AccountId32 { + network: None, + id: Sibling::from(T::ParachainId::get()) + .into_account_truncating(), + }], + ) + .into(), + ), + Box::new(asset.into()), + 0, + Unlimited, + ), + ) + .encode() + .into(); + + let (require_weight_at_most, xcm_fee) = + T::XcmWeightAndFeeHandler::get_operation_weight_and_fee( + T::RelaychainCurrencyId::get(), + XcmOperationType::TeleportAssets, + ) + .ok_or(Error::::WeightAndFeeNotExist)?; + + let fee: Asset = Asset { + id: AssetId(Location::here()), + fun: Fungible(UniqueSaturatedInto::::unique_saturated_into(xcm_fee)), + }; + + let remote_xcm = Xcm(vec![ + WithdrawAsset(fee.clone().into()), + BuyExecution { fees: fee.clone(), weight_limit: Unlimited }, + Transact { + origin_kind: OriginKind::SovereignAccount, + require_weight_at_most, + call: remote_call, + }, + DepositAsset { + assets: All.into(), + beneficiary: Location::new(0, [Parachain(T::ParachainId::get().into())]), + }, + ]); + let (ticket, _) = + T::XcmRouter::validate(&mut Some(Location::parent()), &mut Some(remote_xcm)) + .map_err(|_| Error::::UnweighableMessage)?; + T::XcmRouter::deliver(ticket).map_err(|_| Error::::XcmExecutionFailed)?; + + Self::deposit_event(Event::TransferTo { + from: fee_receiver, + target_chain: TargetChain::AssetHub, + amount: fee_receiver_balance, + }); + } + + let fee_receiver = Self::get_fee_receiver(ExtraFeeName::VoteVtoken); + let fee_receiver_balance = + T::MultiCurrency::free_balance(T::RelaychainCurrencyId::get(), &fee_receiver); + if fee_receiver_balance >= T::MinRelaychainExecutionFee::get() { + T::MultiCurrency::withdraw( + T::RelaychainCurrencyId::get(), + &fee_receiver, + fee_receiver_balance, + )?; + + Self::deposit_event(Event::TransferTo { + from: fee_receiver, + target_chain: TargetChain::RelayChain, + amount: fee_receiver_balance, + }); + } + + Ok(()) + } + + fn get_fee_receiver(extra_fee_name: ExtraFeeName) -> T::AccountId { + match extra_fee_name { + ExtraFeeName::SalpContribute | + ExtraFeeName::VoteVtoken | + ExtraFeeName::VoteRemoveDelegatorVote => T::PalletId::get().into_sub_account_truncating(0u64), + ExtraFeeName::StatemineTransfer => T::PalletId::get().into_sub_account_truncating(1u64), + ExtraFeeName::NoExtraFee => T::TreasuryAccount::get(), + } + } + /// Get user fee charge assets order fn inner_get_user_fee_charge_order_list(account_id: &T::AccountId) -> Vec> { let mut order_list: Vec> = Vec::new(); @@ -206,6 +378,54 @@ impl Pallet { order_list } + fn find_out_fee_currency_and_amount( + who: &T::AccountId, + fee: PalletBalanceOf, + ) -> Result, PalletBalanceOf, PalletBalanceOf)>, Error> { + // get the user defined fee charge order list. + let user_fee_charge_order_list = Self::inner_get_user_fee_charge_order_list(who); + + // charge the fee by the order of the above order list. + // first to check whether the user has the asset. If no, pass it. If yes, try to make + // transaction in the DEX in exchange for BNC + for currency_id in user_fee_charge_order_list { + // If it is mainnet currency + if currency_id == BNC { + // check native balance if is enough + if T::MultiCurrency::ensure_can_withdraw(currency_id, who, fee).is_ok() { + // currency, amount_in, amount_out + return Ok(Some((currency_id, fee, fee))); + } + } else { + // If it is other assets, go to exchange fee amount. + let native_asset_id = + Self::get_currency_asset_id(BNC).map_err(|_| Error::::ConversionError)?; + + let amount_out: AssetBalance = fee.saturated_into(); + + let asset_id = Self::get_currency_asset_id(currency_id) + .map_err(|_| Error::::ConversionError)?; + + let path = vec![asset_id, native_asset_id]; + // see if path exists, if not, continue. + // query for amount in + if let Ok(amounts) = T::DexOperator::get_amount_in_by_path(amount_out, &path) { + // make sure the user has enough free token balance that can be charged. + let amount_in = PalletBalanceOf::::saturated_from(amounts[0]); + if T::MultiCurrency::ensure_can_withdraw(currency_id, who, amount_in).is_ok() { + // currency, amount_in, amount_out + return Ok(Some(( + currency_id, + amount_in, + PalletBalanceOf::::saturated_from(amount_out), + ))); + } + } + } + } + Ok(None) + } + /// Make sure there are enough BNC to be deducted if the user has assets in other form of tokens /// rather than BNC. fn ensure_can_charge_fee( @@ -230,10 +450,10 @@ impl Pallet { who, )?; - Self::deposit_event(Event::FlexibleFeeExchanged( - currency_id, - PalletBalanceOf::::saturated_from(amount_in), - )); + Self::deposit_event(Event::FlexibleFeeExchanged { + transaction_fee_currency: currency_id, + transaction_fee_amount: PalletBalanceOf::::saturated_from(amount_in), + }); } } @@ -362,31 +582,31 @@ where ) .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::Custom(44)))?; - // burn fee_currency - T::MultiCurrency::withdraw(fee_info.extra_fee_currency, who, fee_value) - .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::Payment))?; + let transaction_extra_fee_receiver = Self::get_fee_receiver(fee_info.extra_fee_name); - // deposit extra fee deducted event - Self::deposit_event(Event::ExtraFeeDeducted( - fee_info.extra_fee_name, + T::MultiCurrency::transfer( fee_info.extra_fee_currency, + who, + &transaction_extra_fee_receiver, fee_value, - extra_bnc_fee, - )); + ) + .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::Payment))?; + + // deposit extra fee deducted event + Self::deposit_event(Event::ExtraFeeDeducted { + operation: fee_info.extra_fee_name, + transaction_extra_fee_currency: fee_info.extra_fee_currency, + transaction_extra_fee_amount: fee_value, + transaction_extra_fee_bnc_amount: extra_bnc_fee, + transaction_extra_fee_receiver, + }); } // withdraw normal extrinsic fee - let rs = match T::Currency::withdraw( - who, - fee, - withdraw_reason, - ExistenceRequirement::AllowDeath, - ) { + match T::Currency::withdraw(who, fee, withdraw_reason, ExistenceRequirement::AllowDeath) { Ok(imbalance) => Ok(Some(imbalance)), - Err(_msg) => Err(InvalidTransaction::Payment.into()), - }; - - rs + Err(_) => Err(InvalidTransaction::Payment.into()), + } } /// Hand the fee and the tip over to the `[OnUnbalanced]` implementation. @@ -426,52 +646,9 @@ where } } -impl Pallet { - fn find_out_fee_currency_and_amount( - who: &T::AccountId, - fee: PalletBalanceOf, - ) -> Result, PalletBalanceOf, PalletBalanceOf)>, Error> { - // get the user defined fee charge order list. - let user_fee_charge_order_list = Self::inner_get_user_fee_charge_order_list(who); - - // charge the fee by the order of the above order list. - // first to check whether the user has the asset. If no, pass it. If yes, try to make - // transaction in the DEX in exchange for BNC - for currency_id in user_fee_charge_order_list { - // If it is mainnet currency - if currency_id == BNC { - // check native balance if is enough - if T::MultiCurrency::ensure_can_withdraw(currency_id, who, fee).is_ok() { - // currency, amount_in, amount_out - return Ok(Some((currency_id, fee, fee))); - } - } else { - // If it is other assets, go to exchange fee amount. - let native_asset_id = - Self::get_currency_asset_id(BNC).map_err(|_| Error::::ConversionError)?; - - let amount_out: AssetBalance = fee.saturated_into(); - - let asset_id = Self::get_currency_asset_id(currency_id) - .map_err(|_| Error::::ConversionError)?; - - let path = vec![asset_id, native_asset_id]; - // see if path exists, if not, continue. - // query for amount in - if let Ok(amounts) = T::DexOperator::get_amount_in_by_path(amount_out, &path) { - // make sure the user has enough free token balance that can be charged. - let amount_in = PalletBalanceOf::::saturated_from(amounts[0]); - if T::MultiCurrency::ensure_can_withdraw(currency_id, who, amount_in).is_ok() { - // currency, amount_in, amount_out - return Ok(Some(( - currency_id, - amount_in, - PalletBalanceOf::::saturated_from(amount_out), - ))); - } - } - } - } - Ok(None) +/// Provides account's fee payment asset or default fee asset ( Native asset ) +impl AccountFeeCurrency for Pallet { + fn get(who: &T::AccountId) -> CurrencyId { + Pallet::::get_user_default_fee_currency(who).unwrap_or_else(|| WETH) } } diff --git a/pallets/flexible-fee/src/mock.rs b/pallets/flexible-fee/src/mock.rs index 5d7948e7d..6ed57ad38 100644 --- a/pallets/flexible-fee/src/mock.rs +++ b/pallets/flexible-fee/src/mock.rs @@ -31,7 +31,7 @@ use cumulus_primitives_core::ParaId as Pid; use frame_support::{ derive_impl, ord_parameter_types, parameter_types, sp_runtime::{DispatchError, DispatchResult}, - traits::{Everything, Get, LockIdentifier, Nothing}, + traits::{ConstU128, Everything, Get, LockIdentifier, Nothing}, weights::{ConstantMultiplier, IdentityFee}, PalletId, }; @@ -48,7 +48,7 @@ use sp_runtime::{ }; use sp_std::marker::PhantomData; use std::convert::TryInto; -use xcm::{prelude::*, v3::MultiLocation}; +use xcm::v3::MultiLocation; use xcm_builder::{FixedWeightBounds, FrameTransactionalProcessor}; use xcm_executor::XcmExecutor; use zenlink_protocol::{ @@ -175,6 +175,7 @@ impl orml_tokens::Config for Test { parameter_types! { pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; pub const MaxFeeCurrencyOrderListLen: u32 = 50; + pub const FlexibleFeePalletId: PalletId = PalletId(*b"bf/flexi"); } ord_parameter_types! { @@ -194,6 +195,11 @@ impl crate::Config for Test { type ParachainId = ParaInfo; type ControlOrigin = EnsureRoot; type XcmWeightAndFeeHandler = XcmDestWeightAndFee; + type MinAssetHubExecutionFee = ConstU128<3>; + type MinRelaychainExecutionFee = ConstU128<3>; + type RelaychainCurrencyId = RelayCurrencyId; + type XcmRouter = (); + type PalletId = FlexibleFeePalletId; } pub struct XcmDestWeightAndFee; @@ -346,7 +352,7 @@ pub type AccountIdOf = ::AccountId; // Mock XcmExecutor pub struct MockXcmExecutor; -impl XcmHelper, crate::pallet::PalletBalanceOf> for MockXcmExecutor { +impl XcmHelper, PalletBalanceOf> for MockXcmExecutor { fn contribute( _contributer: AccountId, _index: ParaId, @@ -443,6 +449,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/lend-market/src/benchmarking.rs b/pallets/lend-market/src/benchmarking.rs index dfdff93b9..dbbc991a4 100644 --- a/pallets/lend-market/src/benchmarking.rs +++ b/pallets/lend-market/src/benchmarking.rs @@ -88,8 +88,15 @@ fn set_account_borrows( BorrowSnapshot { principal: borrow_balance, borrow_index: Rate::one() }, ); TotalBorrows::::insert(asset_id, borrow_balance); - T::Assets::burn_from(asset_id, &who, borrow_balance, Precision::Exact, Fortitude::Force) - .unwrap(); + T::Assets::burn_from( + asset_id, + &who, + borrow_balance, + Preservation::Protect, + Precision::Exact, + Fortitude::Force, + ) + .unwrap(); } fn assert_last_event(generic_event: ::RuntimeEvent) { @@ -227,6 +234,11 @@ benchmarks! { transfer_initial_balance::(caller.clone()); let deposit_amount: u32 = 200_000_000; let borrowed_amount: u32 = 100_000_000; + assert_ok!(LendMarket::::add_market_bond( + SystemOrigin::Root.into(), + DOT_U, + vec![DOT_U] + )); assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); @@ -267,6 +279,11 @@ benchmarks! { let deposit_amount: u32 = 200_000_000; let borrowed_amount: u32 = 100_000_000; let repay_amount: u32 = 100; + assert_ok!(LendMarket::::add_market_bond( + SystemOrigin::Root.into(), + DOT_U, + vec![DOT_U] + )); assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); @@ -283,6 +300,11 @@ benchmarks! { let deposit_amount: u32 = 200_000_000; let borrowed_amount: u32 = 100_000_000; assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); + assert_ok!(LendMarket::::add_market_bond( + SystemOrigin::Root.into(), + DOT_U, + vec![DOT_U] + )); assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); assert_ok!(LendMarket::::collateral_asset(SystemOrigin::Signed(caller.clone()).into(), DOT_U, true)); diff --git a/pallets/lend-market/src/lib.rs b/pallets/lend-market/src/lib.rs index 6ae64323e..f31bfab89 100644 --- a/pallets/lend-market/src/lib.rs +++ b/pallets/lend-market/src/lib.rs @@ -194,6 +194,8 @@ pub mod pallet { CodecError, /// Collateral is reserved and cannot be liquidated CollateralReserved, + /// Market bond does not exist + MarketBondDoesNotExist, } #[pallet::event] @@ -260,6 +262,10 @@ pub mod pallet { IncentiveReservesReduced(T::AccountId, AssetIdOf, BalanceOf), /// Liquidation free collaterals has been updated LiquidationFreeCollateralsUpdated(Vec>), + MarketBonded { + asset_id: AssetIdOf, + market_bond: Vec>, + }, } /// The timestamp of the last calculation of accrued interest @@ -446,6 +452,10 @@ pub mod pallet { pub type RewardAccrued = StorageMap<_, Blake2_128Concat, T::AccountId, BalanceOf, ValueQuery>; + #[pallet::storage] + pub type MarketBond = + StorageMap<_, Blake2_128Concat, AssetIdOf, Vec>>; + /// DefaultVersion is using for initialize the StorageVersion #[pallet::type_value] pub(super) fn DefaultVersion() -> Versions { @@ -1126,6 +1136,21 @@ pub mod pallet { Self::deposit_event(Event::::LiquidationFreeCollateralsUpdated(collaterals)); Ok(().into()) } + + #[pallet::call_index(22)] + #[pallet::weight(T::WeightInfo::add_market())] + #[transactional] + pub fn add_market_bond( + origin: OriginFor, + asset_id: AssetIdOf, + market_bond: Vec>, + ) -> DispatchResultWithPostInfo { + T::UpdateOrigin::ensure_origin(origin)?; + MarketBond::::insert(asset_id, market_bond.clone()); + + Self::deposit_event(Event::::MarketBonded { asset_id, market_bond }); + Ok(().into()) + } } } @@ -1460,6 +1485,20 @@ impl Pallet { Ok(()) } + /// Borrower shouldn't borrow more than his bonded collateral value + fn borrow_allowed_for_market_bond( + borrow_asset_id: AssetIdOf, + borrower: &T::AccountId, + borrow_amount: BalanceOf, + ) -> DispatchResult { + Self::ensure_under_borrow_cap(borrow_asset_id, borrow_amount)?; + Self::ensure_enough_cash(borrow_asset_id, borrow_amount)?; + let borrow_value = Self::get_asset_value(borrow_asset_id, borrow_amount)?; + Self::ensure_liquidity_for_market_bond(borrow_asset_id, borrower, borrow_value)?; + + Ok(()) + } + #[require_transactional] fn do_repay_borrow_with_amount( borrower: &T::AccountId, @@ -1877,6 +1916,35 @@ impl Pallet { Err(Error::::InsufficientLiquidity.into()) } + fn ensure_liquidity_for_market_bond( + borrow_asset_id: AssetIdOf, + account: &T::AccountId, + reduce_amount: FixedU128, + ) -> DispatchResult { + let collateral_asset_ids = MarketBond::::try_get(borrow_asset_id) + .map_err(|_err| Error::::MarketBondDoesNotExist)?; + + let currency_borrow_amount = Self::current_borrow_balance(account, borrow_asset_id)?; + let total_borrow_value = Self::get_asset_value(borrow_asset_id, currency_borrow_amount)?; + + let mut total_collateral_value: FixedU128 = FixedU128::zero(); + for asset_id in collateral_asset_ids { + total_collateral_value = total_collateral_value + .checked_add(&Self::collateral_asset_value(account, asset_id)?) + .ok_or(ArithmeticError::Overflow)?; + } + + let total_liquidity = total_collateral_value + .checked_sub(&total_borrow_value) + .ok_or(ArithmeticError::Underflow)?; + + if total_liquidity >= reduce_amount { + return Ok(()); + } + + Err(Error::::InsufficientLiquidity.into()) + } + pub fn calc_underlying_amount( voucher_amount: BalanceOf, exchange_rate: Rate, @@ -2064,6 +2132,7 @@ impl LendMarketTrait, AccountIdOf, BalanceOf> for Self::ensure_active_market(asset_id)?; Self::accrue_interest(asset_id)?; + Self::borrow_allowed_for_market_bond(asset_id, borrower, amount)?; Self::borrow_allowed(asset_id, borrower, amount)?; // update borrow index after accrue interest. diff --git a/pallets/lend-market/src/mock.rs b/pallets/lend-market/src/mock.rs index 79b560c3a..42283470c 100644 --- a/pallets/lend-market/src/mock.rs +++ b/pallets/lend-market/src/mock.rs @@ -254,6 +254,10 @@ impl PriceFeeder for MockPriceFeeder { fn get_price(asset_id: &CurrencyId) -> Option { Self::PRICES.with(|prices| *prices.borrow().get(&CurrencyIdWrap(*asset_id)).unwrap()) } + + fn get_normal_price(_asset_id: &CurrencyId) -> Option { + todo!() + } } parameter_types! { diff --git a/pallets/lend-market/src/tests.rs b/pallets/lend-market/src/tests.rs index b4d871049..d23eff689 100644 --- a/pallets/lend-market/src/tests.rs +++ b/pallets/lend-market/src/tests.rs @@ -28,6 +28,21 @@ use sp_runtime::{ #[test] fn init_minting_ok() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(Assets::balance(KSM, ALICE), unit(1000)); assert_eq!(Assets::balance(DOT, ALICE), unit(1000)); assert_eq!(Assets::balance(DOT_U, ALICE), unit(1000)); @@ -39,6 +54,21 @@ fn init_minting_ok() { #[test] fn init_markets_ok() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(LendMarket::market(KSM).unwrap().state, MarketState::Active); assert_eq!(LendMarket::market(DOT).unwrap().state, MarketState::Active); assert_eq!(LendMarket::market(DOT_U).unwrap().state, MarketState::Active); @@ -56,6 +86,21 @@ fn init_markets_ok() { #[test] fn lend_market_native_token_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(::Assets::balance(BNC, &DAVE), unit(1000)); assert_eq!(LendMarket::market(BNC).unwrap().state, MarketState::Active); assert_eq!(BorrowIndex::::get(BNC), Rate::one()); @@ -95,6 +140,21 @@ fn lend_market_native_token_works() { #[test] fn mint_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Deposit 100 DOT assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(100))); @@ -113,6 +173,21 @@ fn mint_works() { #[test] fn mint_must_return_err_when_overflows_occur() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); LendMarket::force_update_market( RuntimeOrigin::root(), DOT, @@ -155,6 +230,21 @@ fn mint_must_return_err_when_overflows_occur() { #[test] fn redeem_allowed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Prepare: Bob Deposit 200 DOT assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, 200)); @@ -189,6 +279,26 @@ fn redeem_allowed_works() { #[test] fn lf_redeem_allowed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT_U, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Set CDOT as lf collateral LendMarket::update_liquidation_free_collateral(RuntimeOrigin::root(), vec![PHA]).unwrap(); LendMarket::mint(RuntimeOrigin::signed(ALICE), PHA, unit(200)).unwrap(); @@ -225,6 +335,21 @@ fn lf_redeem_allowed_works() { #[test] fn redeem_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(100))); assert_ok!(LendMarket::redeem(RuntimeOrigin::signed(ALICE), DOT, unit(20))); @@ -242,6 +367,21 @@ fn redeem_works() { #[test] fn redeem_fails() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_noop!( LendMarket::redeem(RuntimeOrigin::signed(ALICE), DOT, unit(0)), Error::::InvalidAmount @@ -252,6 +392,21 @@ fn redeem_fails() { #[test] fn redeem_fails_when_insufficient_liquidity() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Prepare: Bob Deposit 200 DOT assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, 200)); @@ -272,6 +427,21 @@ fn redeem_fails_when_insufficient_liquidity() { #[test] fn redeem_fails_when_would_use_reserved_balanace() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Prepare: Bob Deposit 200 DOT assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, 200)); @@ -293,6 +463,21 @@ fn redeem_fails_when_would_use_reserved_balanace() { #[test] fn redeem_must_return_err_when_overflows_occur() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Amount is too large, max_value / 0.0X == Overflow // Underflow is used here redeem could also be 0 assert_noop!( @@ -305,6 +490,21 @@ fn redeem_must_return_err_when_overflows_occur() { #[test] fn redeem_all_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(100))); assert_ok!(LendMarket::redeem_all(RuntimeOrigin::signed(ALICE), DOT)); @@ -323,6 +523,21 @@ fn redeem_all_works() { #[test] fn borrow_allowed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Deposit 200 DOT as collateral assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, 200)); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), KSM, 200)); @@ -354,6 +569,21 @@ fn borrow_allowed_works() { #[test] fn update_liquidation_free_collateral_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::update_liquidation_free_collateral( RuntimeOrigin::root(), vec![PHA] @@ -365,6 +595,21 @@ fn update_liquidation_free_collateral_works() { #[test] fn get_account_liquidity_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); LendMarket::mint(RuntimeOrigin::signed(ALICE), PHA, unit(200)).unwrap(); LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), PHA, true).unwrap(); @@ -378,6 +623,21 @@ fn get_account_liquidity_works() { #[test] fn get_account_liquidation_threshold_liquidity_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, unit(200)).unwrap(); LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(200)).unwrap(); @@ -409,6 +669,21 @@ fn get_account_liquidation_threshold_liquidity_works() { #[test] fn lf_borrow_allowed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); LendMarket::mint(RuntimeOrigin::signed(ALICE), PHA, unit(200)).unwrap(); LendMarket::mint(RuntimeOrigin::signed(DAVE), DOT_U, unit(200)).unwrap(); LendMarket::mint(RuntimeOrigin::signed(DAVE), DOT, unit(200)).unwrap(); @@ -431,6 +706,21 @@ fn lf_borrow_allowed_works() { #[test] fn borrow_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Deposit 200 DOT as collateral assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -455,6 +745,21 @@ fn borrow_works() { #[test] fn lf_borrow_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Deposit 200 DOT as collateral LendMarket::mint(RuntimeOrigin::signed(ALICE), PHA, unit(200)).unwrap(); LendMarket::mint(RuntimeOrigin::signed(DAVE), DOT, unit(200)).unwrap(); @@ -481,6 +786,21 @@ fn lf_borrow_works() { #[test] fn repay_borrow_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Deposit 200 DOT as collateral assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -507,6 +827,21 @@ fn repay_borrow_works() { #[test] fn repay_borrow_all_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Bob deposits 200 KSM assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(200))); // Alice deposit 200 DOT as collateral @@ -537,6 +872,21 @@ fn repay_borrow_all_works() { #[test] fn collateral_asset_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // No collateral assets assert_noop!( LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true), @@ -570,6 +920,21 @@ fn collateral_asset_works() { #[test] fn total_collateral_value_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Mock the price for DOT = 1, KSM = 1 let collateral_factor = Rate::saturating_from_rational(50, 100); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(100))); @@ -587,6 +952,21 @@ fn total_collateral_value_works() { #[test] fn add_reserves_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Add 100 DOT reserves assert_ok!(LendMarket::add_reserves(RuntimeOrigin::root(), ALICE, DOT, unit(100))); @@ -599,6 +979,21 @@ fn add_reserves_works() { #[test] fn reduce_reserves_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Add 100 DOT reserves assert_ok!(LendMarket::add_reserves(RuntimeOrigin::root(), ALICE, DOT, unit(100))); @@ -614,6 +1009,21 @@ fn reduce_reserves_works() { #[test] fn reduce_reserve_reduce_amount_must_be_less_than_total_reserves() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::add_reserves(RuntimeOrigin::root(), ALICE, DOT, unit(100))); assert_noop!( LendMarket::reduce_reserves(RuntimeOrigin::root(), ALICE, DOT, unit(200)), @@ -625,6 +1035,21 @@ fn reduce_reserve_reduce_amount_must_be_less_than_total_reserves() { #[test] fn ratio_and_rate_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Permill to FixedU128 let ratio = Permill::from_percent(50); let rate: FixedU128 = ratio.into(); @@ -717,6 +1142,21 @@ fn ratio_and_rate_works() { #[test] fn update_exchange_rate_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Initialize value of exchange rate is 0.02 assert_eq!(LendMarket::exchange_rate(DOT), Rate::saturating_from_rational(2, 100)); @@ -745,6 +1185,21 @@ fn update_exchange_rate_works() { #[test] fn current_borrow_balance_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // snapshot.principal = 0 AccountBorrows::::insert( DOT, @@ -789,6 +1244,21 @@ fn calc_collateral_amount_works() { #[test] fn get_price_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); MockPriceFeeder::set_price(DOT, 0.into()); assert_noop!(LendMarket::get_price(DOT), Error::::PriceIsZero); @@ -800,6 +1270,21 @@ fn get_price_works() { #[test] fn ensure_enough_cash_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // assert_ok!(Assets::mint( // RuntimeOrigin::signed(ALICE), // KSM.into(), @@ -826,6 +1311,21 @@ fn ensure_enough_cash_works() { #[test] fn ensure_valid_exchange_rate_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_noop!( LendMarket::ensure_valid_exchange_rate(FixedU128::saturating_from_rational(1, 100)), Error::::InvalidExchangeRate @@ -853,6 +1353,21 @@ fn ensure_valid_exchange_rate_works() { #[test] fn withdraw_missing_reward_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(::Assets::balance(BNC, &DAVE), unit(1000)); assert_ok!(LendMarket::add_reward(RuntimeOrigin::signed(DAVE), unit(100))); @@ -873,6 +1388,21 @@ fn withdraw_missing_reward_works() { #[test] fn update_market_reward_speed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(LendMarket::reward_supply_speed(DOT), 0); assert_eq!(LendMarket::reward_borrow_speed(DOT), 0); @@ -908,6 +1438,21 @@ fn update_market_reward_speed_works() { #[test] fn reward_calculation_one_palyer_in_multi_markets_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(100))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), KSM, unit(100))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -1102,6 +1647,21 @@ fn reward_calculation_one_palyer_in_multi_markets_works() { #[test] fn reward_calculation_multi_player_in_one_market_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(10))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, unit(10))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -1199,6 +1759,21 @@ fn reward_calculation_multi_player_in_one_market_works() { #[test] fn reward_calculation_after_liquidate_borrow_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(500))); diff --git a/pallets/lend-market/src/tests/edge_cases.rs b/pallets/lend-market/src/tests/edge_cases.rs index c223b2c1f..5d64d5390 100644 --- a/pallets/lend-market/src/tests/edge_cases.rs +++ b/pallets/lend-market/src/tests/edge_cases.rs @@ -23,6 +23,7 @@ fn exceeded_supply_cap() { #[test] fn repay_borrow_all_no_underflow() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![KSM])); // Alice deposits 200 KSM as collateral assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), KSM, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), KSM, true)); @@ -69,6 +70,7 @@ fn ensure_capacity_fails_when_market_not_existed() { #[test] fn redeem_all_should_be_accurate() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![KSM])); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), KSM, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), KSM, true)); assert_ok!(LendMarket::borrow(RuntimeOrigin::signed(ALICE), KSM, unit(50))); diff --git a/pallets/lend-market/src/tests/interest_rate.rs b/pallets/lend-market/src/tests/interest_rate.rs index 62c5bd776..e3859755d 100644 --- a/pallets/lend-market/src/tests/interest_rate.rs +++ b/pallets/lend-market/src/tests/interest_rate.rs @@ -20,6 +20,21 @@ fn utilization_rate_works() { #[test] fn interest_rate_model_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); let rate_decimal: u128 = 1_000_000_000_000_000_000; assert_ok!(Tokens::set_balance( RuntimeOrigin::root(), @@ -113,6 +128,21 @@ fn interest_rate_model_works() { #[test] fn last_accrued_interest_time_should_be_update_correctly() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(LendMarket::borrow_index(DOT), Rate::one()); assert_eq!(LendMarket::last_accrued_interest_time(DOT), 0); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); @@ -129,6 +159,21 @@ fn last_accrued_interest_time_should_be_update_correctly() { #[test] fn accrue_interest_works_after_mint() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::borrow(RuntimeOrigin::signed(ALICE), DOT, unit(100))); @@ -142,6 +187,21 @@ fn accrue_interest_works_after_mint() { #[test] fn accrue_interest_works_after_borrow() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_eq!(LendMarket::borrow_index(DOT), Rate::one()); @@ -154,6 +214,21 @@ fn accrue_interest_works_after_borrow() { #[test] fn accrue_interest_works_after_redeem() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::borrow(RuntimeOrigin::signed(ALICE), DOT, unit(10))); @@ -173,6 +248,21 @@ fn accrue_interest_works_after_redeem() { #[test] fn accrue_interest_works_after_redeem_all() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, unit(20))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -194,6 +284,21 @@ fn accrue_interest_works_after_redeem_all() { #[test] fn accrue_interest_works_after_repay() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::borrow(RuntimeOrigin::signed(ALICE), DOT, unit(20))); @@ -207,6 +312,21 @@ fn accrue_interest_works_after_repay() { #[test] fn accrue_interest_works_after_repay_all() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(200))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -225,7 +345,21 @@ fn accrue_interest_works_after_repay_all() { #[test] fn accrue_interest_works_after_liquidate_borrow() { new_test_ext().execute_with(|| { - // Bob deposits 200 KSM + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Bob deposits 200 KSM assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(200))); // Alice deposits 300 DOT as collateral assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(300))); @@ -254,6 +388,21 @@ fn accrue_interest_works_after_liquidate_borrow() { #[test] fn different_markets_can_accrue_interest_in_one_block() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), KSM, unit(200))); @@ -271,6 +420,21 @@ fn different_markets_can_accrue_interest_in_one_block() { #[test] fn a_market_can_only_accrue_interest_once_in_a_block() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, unit(200))); diff --git a/pallets/lend-market/src/tests/lend_tokens.rs b/pallets/lend-market/src/tests/lend_tokens.rs index d9ac37a54..036df3b79 100644 --- a/pallets/lend-market/src/tests/lend_tokens.rs +++ b/pallets/lend-market/src/tests/lend_tokens.rs @@ -1,7 +1,7 @@ use crate::{ mock::{ - market_mock, new_test_ext, LendMarket, RuntimeOrigin, Test, ALICE, BNC, DAVE, DOT_U, KSM, - LKSM, LUSDT, VBNC, + market_mock, new_test_ext, LendMarket, RuntimeOrigin, Test, ALICE, BNC, DAVE, DOT, DOT_U, + KSM, LKSM, LUSDT, PHA, VBNC, }, tests::unit, Error, *, @@ -15,7 +15,21 @@ use sp_runtime::{FixedPointNumber, TokenError}; #[test] fn trait_inspect_methods_works() { new_test_ext().execute_with(|| { - // No Deposits can't not withdraw + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // No Deposits can't not withdraw assert_err!( LendMarket::can_withdraw(VBNC, &DAVE, 100).into_result(false), TokenError::FundsUnavailable @@ -91,7 +105,21 @@ fn trait_inspect_methods_works() { #[test] fn lend_token_unique_works() { new_test_ext().execute_with(|| { - // lend_token_id already exists in `UnderlyingAssetId` + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // lend_token_id already exists in `UnderlyingAssetId` assert_noop!( LendMarket::add_market(RuntimeOrigin::root(), LKSM, market_mock(VBNC)), Error::::InvalidLendTokenId @@ -108,7 +136,21 @@ fn lend_token_unique_works() { #[test] fn transfer_lend_token_works() { new_test_ext().execute_with(|| { - // DAVE Deposit 100 BNC + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // DAVE Deposit 100 BNC assert_ok!(LendMarket::mint(RuntimeOrigin::signed(DAVE), BNC, unit(100))); // DAVE BNC collateral: deposit = 100 @@ -155,7 +197,21 @@ fn transfer_lend_token_works() { #[test] fn transfer_lend_tokens_under_collateral_works() { new_test_ext().execute_with(|| { - // DAVE Deposit 100 BNC + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // DAVE Deposit 100 BNC assert_ok!(LendMarket::mint(RuntimeOrigin::signed(DAVE), BNC, unit(100))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(DAVE), BNC, true)); diff --git a/pallets/lend-market/src/tests/liquidate_borrow.rs b/pallets/lend-market/src/tests/liquidate_borrow.rs index 27262d056..13a87c561 100644 --- a/pallets/lend-market/src/tests/liquidate_borrow.rs +++ b/pallets/lend-market/src/tests/liquidate_borrow.rs @@ -12,7 +12,9 @@ use sp_runtime::FixedPointNumber; #[test] fn liquidate_borrow_allowed_works() { new_test_ext().execute_with(|| { - // Borrower should have a positive shortfall + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); // Borrower should have a positive shortfall let dot_market = LendMarket::market(DOT).unwrap(); assert_noop!( LendMarket::liquidate_borrow_allowed(&ALICE, DOT, 100, &dot_market), @@ -38,6 +40,9 @@ fn liquidate_borrow_allowed_works() { #[test] fn lf_liquidate_borrow_fails_due_to_lf_collateral() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); LendMarket::update_liquidation_free_collateral(RuntimeOrigin::root(), vec![PHA]).unwrap(); assert_err!( @@ -54,6 +59,13 @@ fn lf_liquidate_borrow_fails_due_to_lf_collateral() { #[test] fn lf_liquidate_borrow_allowed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); LendMarket::update_liquidation_free_collateral(RuntimeOrigin::root(), vec![PHA]).unwrap(); // Bob deposits $200 DOT LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, unit(200)).unwrap(); @@ -95,6 +107,9 @@ fn lf_liquidate_borrow_allowed_works() { #[test] fn deposit_of_borrower_must_be_collateral() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); alice_borrows_100_ksm(); // Adjust KSM price to make shortfall @@ -114,6 +129,9 @@ fn deposit_of_borrower_must_be_collateral() { #[test] fn collateral_value_must_be_greater_than_liquidation_value() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); alice_borrows_100_ksm(); MockPriceFeeder::set_price(KSM, Rate::from_float(2000.0)); @@ -132,6 +150,9 @@ fn collateral_value_must_be_greater_than_liquidation_value() { #[test] fn full_workflow_works_as_expected() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); alice_borrows_100_ksm(); // adjust KSM price to make ALICE generate shortfall @@ -200,6 +221,9 @@ fn full_workflow_works_as_expected() { #[test] fn liquidator_cannot_take_inactive_market_currency() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); alice_borrows_100_ksm(); // Adjust KSM price to make shortfall @@ -218,6 +242,9 @@ fn liquidator_cannot_take_inactive_market_currency() { #[test] fn liquidator_can_not_repay_more_than_the_close_factor_pct_multiplier() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); alice_borrows_100_ksm(); MockPriceFeeder::set_price(KSM, 20.into()); @@ -231,6 +258,9 @@ fn liquidator_can_not_repay_more_than_the_close_factor_pct_multiplier() { #[test] fn liquidator_must_not_be_borrower() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); assert_noop!( LendMarket::liquidate_borrow(RuntimeOrigin::signed(ALICE), ALICE, KSM, 0, DOT), @@ -244,6 +274,13 @@ fn alice_borrows_100_ksm() { } fn initial_setup() { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, DOT_U, PHA])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, DOT_U, PHA])); // Bob deposits 200 KSM assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(200))); // Alice deposits 200 DOT as collateral diff --git a/pallets/leverage-staking/src/benchmarking.rs b/pallets/leverage-staking/src/benchmarking.rs index bfed18abb..a4e055a54 100644 --- a/pallets/leverage-staking/src/benchmarking.rs +++ b/pallets/leverage-staking/src/benchmarking.rs @@ -157,6 +157,11 @@ fn init< VKSM, lend_market::BalanceOf::::unique_saturated_from(unit(1u128)) )); + assert_ok!(lend_market::Pallet::::add_market_bond( + SystemOrigin::Root.into(), + KSM, + vec![VKSM] + )); Ok(()) } diff --git a/pallets/leverage-staking/src/lib.rs b/pallets/leverage-staking/src/lib.rs index 65ae0f67b..7bff552a3 100644 --- a/pallets/leverage-staking/src/lib.rs +++ b/pallets/leverage-staking/src/lib.rs @@ -33,7 +33,7 @@ use frame_support::{ pallet_prelude::*, traits::{ fungibles::Mutate, - tokens::{Fortitude, Precision}, + tokens::{Fortitude, Precision, Preservation}, }, transactional, BoundedVec, }; @@ -208,6 +208,7 @@ impl Pallet { asset_id, &who, reduce_amount, + Preservation::Protect, Precision::Exact, Fortitude::Force, )?; @@ -234,6 +235,7 @@ impl Pallet { asset_id, &who, increase_amount, + Preservation::Protect, Precision::Exact, Fortitude::Force, )?; diff --git a/pallets/leverage-staking/src/mock.rs b/pallets/leverage-staking/src/mock.rs index c909670c6..55096d593 100644 --- a/pallets/leverage-staking/src/mock.rs +++ b/pallets/leverage-staking/src/mock.rs @@ -160,6 +160,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } parameter_type_with_key! { @@ -417,6 +421,10 @@ impl PriceFeeder for MockPriceFeeder { fn get_price(asset_id: &CurrencyId) -> Option { Self::PRICES.with(|prices| *prices.borrow().get(&CurrencyIdWrap(*asset_id)).unwrap()) } + + fn get_normal_price(_asset_id: &CurrencyId) -> Option { + todo!() + } } parameter_types! { diff --git a/pallets/leverage-staking/src/tests.rs b/pallets/leverage-staking/src/tests.rs index 124cf4d95..0cbc7adca 100644 --- a/pallets/leverage-staking/src/tests.rs +++ b/pallets/leverage-staking/src/tests.rs @@ -62,6 +62,8 @@ fn init() { assert_ok!(LendMarket::mint(RuntimeOrigin::signed(0), DOT, unit(100))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(0), VDOT, unit(100))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(1), VDOT, 100_000)); + + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, VDOT])); } #[test] diff --git a/pallets/parachain-staking/src/benchmarks.rs b/pallets/parachain-staking/src/benchmarks.rs index a28b9bf64..cffff55a1 100644 --- a/pallets/parachain-staking/src/benchmarks.rs +++ b/pallets/parachain-staking/src/benchmarks.rs @@ -51,7 +51,6 @@ fn create_funded_user( let min_candidate_stk = min_candidate_stk::(); let total = min_candidate_stk + extra; T::Currency::make_free_balance_be(&user, total); - T::Currency::issue(total); (user, total) } diff --git a/pallets/parachain-staking/src/tests.rs b/pallets/parachain-staking/src/tests.rs index 4866a8172..0fdb75254 100644 --- a/pallets/parachain-staking/src/tests.rs +++ b/pallets/parachain-staking/src/tests.rs @@ -5146,10 +5146,9 @@ fn deferred_payment_steady_state_event_flow() { let reset_issuance = || { let new_issuance = Balances::total_issuance(); let diff = new_issuance - initial_issuance; - let burned = Balances::burn(diff); - Balances::settle( + let _ = Balances::withdraw( &111, - burned, + diff, WithdrawReasons::FEE, ExistenceRequirement::AllowDeath, ) diff --git a/pallets/prices/src/lib.rs b/pallets/prices/src/lib.rs index 28339aa0b..c39db7ad0 100644 --- a/pallets/prices/src/lib.rs +++ b/pallets/prices/src/lib.rs @@ -27,7 +27,7 @@ use bifrost_primitives::*; use frame_support::{dispatch::DispatchClass, pallet_prelude::*, transactional}; use frame_system::pallet_prelude::*; use log; -use orml_traits::{DataFeeder, DataProvider, DataProviderExtended}; +use orml_oracle::{DataFeeder, DataProvider, DataProviderExtended}; pub use pallet::*; use pallet_traits::*; use sp_runtime::{traits::CheckedDiv, FixedU128}; @@ -107,6 +107,26 @@ pub mod pallet { pub type ForeignToNativeAsset = StorageMap<_, Twox64Concat, CurrencyId, CurrencyId, OptionQuery>; + #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] + pub struct GenesisConfig { + pub emergency_price: Vec<(CurrencyId, Price)>, + pub foreign_to_native_asset: Vec<(CurrencyId, CurrencyId)>, + pub phantom: PhantomData, + } + + #[pallet::genesis_build] + impl BuildGenesisConfig for GenesisConfig { + fn build(&self) { + for (asset_id, price) in self.emergency_price.iter() { + EmergencyPrice::::insert(asset_id, price); + } + for (foreign_asset_id, native) in self.foreign_to_native_asset.iter() { + ForeignToNativeAsset::::insert(foreign_asset_id, native); + } + } + } + #[pallet::pallet] #[pallet::without_storage_info] pub struct Pallet(PhantomData); @@ -218,6 +238,16 @@ impl PriceFeeder for Pallet { .and_then(|price| Self::normalize_detail_price(price, mantissa)) }) } + + fn get_normal_price(asset_id: &CurrencyId) -> Option { + let decimals = Self::get_asset_mantissa(asset_id)?; + Self::emergency_price(asset_id) + .and_then(|p| Some(p.into_inner().saturating_div(decimals))) + .or_else(|| { + T::Source::get(&asset_id) + .and_then(|price| Some(price.value.into_inner().saturating_div(decimals))) + }) + } } impl EmergencyPriceFeeder for Pallet { diff --git a/pallets/salp/src/benchmarking.rs b/pallets/salp/src/benchmarking.rs index ee8d173a9..136f5d2b6 100644 --- a/pallets/salp/src/benchmarking.rs +++ b/pallets/salp/src/benchmarking.rs @@ -81,7 +81,6 @@ where T: Config + bifrost_stable_pool::Config + bifrost_stable_asset::Config + o )] mod benchmarks { use super::*; - use frame_benchmarking::impl_benchmark_test_suite; #[benchmark] fn contribute() { diff --git a/pallets/salp/src/mock.rs b/pallets/salp/src/mock.rs index 628dd72e9..193e905ab 100644 --- a/pallets/salp/src/mock.rs +++ b/pallets/salp/src/mock.rs @@ -513,6 +513,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/slp/src/agents/astar_agent/agent.rs b/pallets/slp/src/agents/astar_agent/agent.rs index ea0a27692..e53639d4e 100644 --- a/pallets/slp/src/agents/astar_agent/agent.rs +++ b/pallets/slp/src/agents/astar_agent/agent.rs @@ -594,19 +594,6 @@ impl Pallet::::inner_charge_hosting_fee(charge_amount, to, vtoken) } - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - amount: BalanceOf, - from: &MultiLocation, - to: &MultiLocation, - currency_id: CurrencyId, - ) -> Result<(), Error> { - Pallet::::do_transfer_to(from, to, amount, currency_id)?; - - Ok(()) - } - fn check_delegator_ledger_query_response( &self, query_id: QueryId, diff --git a/pallets/slp/src/agents/filecoin_agent/agent.rs b/pallets/slp/src/agents/filecoin_agent/agent.rs index f1a69b595..c3c9b3ff6 100644 --- a/pallets/slp/src/agents/filecoin_agent/agent.rs +++ b/pallets/slp/src/agents/filecoin_agent/agent.rs @@ -498,17 +498,6 @@ impl Pallet::::inner_charge_hosting_fee(amount, to, currency_id) } - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - _amount: BalanceOf, - _from: &MultiLocation, - _to: &MultiLocation, - _currency_id: CurrencyId, - ) -> Result<(), Error> { - Err(Error::::Unsupported) - } - fn check_delegator_ledger_query_response( &self, _query_id: QueryId, diff --git a/pallets/slp/src/agents/parachain_staking_agent/agent.rs b/pallets/slp/src/agents/parachain_staking_agent/agent.rs index 54c265c3e..f88245f27 100644 --- a/pallets/slp/src/agents/parachain_staking_agent/agent.rs +++ b/pallets/slp/src/agents/parachain_staking_agent/agent.rs @@ -1532,27 +1532,6 @@ impl Pallet::::inner_charge_hosting_fee(charge_amount, to, vtoken) } - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - amount: BalanceOf, - from: &MultiLocation, - to: &MultiLocation, - currency_id: CurrencyId, - ) -> Result<(), Error> { - if currency_id == BNC { - ensure!(!amount.is_zero(), Error::::AmountZero); - let from_account_id = Pallet::::multilocation_to_account(from)?; - let to_account_id = Pallet::::multilocation_to_account(to)?; - T::MultiCurrency::transfer(currency_id, &from_account_id, &to_account_id, amount) - .map_err(|_e| Error::::MultiCurrencyError)?; - } else { - Pallet::::do_transfer_to(from, to, amount, currency_id)?; - } - - Ok(()) - } - fn check_delegator_ledger_query_response( &self, query_id: QueryId, diff --git a/pallets/slp/src/agents/phala_agent/agent.rs b/pallets/slp/src/agents/phala_agent/agent.rs index f6494fa41..bc633fa7e 100644 --- a/pallets/slp/src/agents/phala_agent/agent.rs +++ b/pallets/slp/src/agents/phala_agent/agent.rs @@ -762,19 +762,6 @@ impl Pallet::::inner_charge_hosting_fee(charge_amount, to, vtoken) } - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - amount: BalanceOf, - from: &MultiLocation, - to: &MultiLocation, - currency_id: CurrencyId, - ) -> Result<(), Error> { - Pallet::::do_transfer_to(from, to, amount, currency_id)?; - - Ok(()) - } - fn check_delegator_ledger_query_response( &self, query_id: QueryId, diff --git a/pallets/slp/src/agents/polkadot_agent/agent.rs b/pallets/slp/src/agents/polkadot_agent/agent.rs index 3b6eff0e1..96f4a2882 100644 --- a/pallets/slp/src/agents/polkadot_agent/agent.rs +++ b/pallets/slp/src/agents/polkadot_agent/agent.rs @@ -981,19 +981,6 @@ impl Pallet::::inner_charge_hosting_fee(charge_amount, to, vtoken) } - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - amount: BalanceOf, - from: &MultiLocation, - to: &MultiLocation, - currency_id: CurrencyId, - ) -> Result<(), Error> { - Pallet::::do_transfer_to(from, to, amount, currency_id)?; - - Ok(()) - } - fn check_delegator_ledger_query_response( &self, query_id: QueryId, diff --git a/pallets/slp/src/benchmarking.rs b/pallets/slp/src/benchmarking.rs index f5dce590c..68cd64d01 100644 --- a/pallets/slp/src/benchmarking.rs +++ b/pallets/slp/src/benchmarking.rs @@ -201,7 +201,6 @@ mod benchmarks { use super::*; use crate::primitives::{PhalaLedger, SubstrateValidatorsByDelegatorUpdateEntry}; use bifrost_primitives::VKSM; - use frame_benchmarking::impl_benchmark_test_suite; use sp_arithmetic::traits::SaturatedConversion; #[benchmark] @@ -710,31 +709,6 @@ mod benchmarks { Ok(()) } - #[benchmark] - fn supplement_fee_reserve() -> Result<(), BenchmarkError> { - let origin = ::ControlOrigin::try_successful_origin() - .map_err(|_| BenchmarkError::Weightless)?; - set_mins_and_maxs::(origin.clone()); - - let (entrance_account, _) = ::VtokenMinting::get_entrance_and_exit_accounts(); - let entrance_account_32 = Pallet::::account_id_to_account_32(entrance_account).unwrap(); - let from = Pallet::::account_32_to_local_location(entrance_account_32).unwrap(); - - DelegatorsMultilocation2Index::::insert(KSM, DELEGATOR1, 0); - - FeeSources::::insert(KSM, (from, BalanceOf::::from(4100000000u32))); - - T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::TransferTo, - Some((Weight::from_parts(4000000000, 100000), 0u32.into())), - )?; - - #[extrinsic_call] - _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); - Ok(()) - } - #[benchmark] fn charge_host_fee_and_tune_vtoken_exchange_rate() -> Result<(), BenchmarkError> { let origin = ::ControlOrigin::try_successful_origin() diff --git a/pallets/slp/src/lib.rs b/pallets/slp/src/lib.rs index 2e9f3fa92..260ee7850 100644 --- a/pallets/slp/src/lib.rs +++ b/pallets/slp/src/lib.rs @@ -36,7 +36,7 @@ use bifrost_parachain_staking::ParachainStakingInterface; use bifrost_primitives::{ currency::{BNC, KSM, MANTA, MOVR, PHA}, traits::XcmDestWeightAndFeeHandler, - CurrencyId, CurrencyIdExt, CurrencyIdMapping, DerivativeAccountHandler, DerivativeIndex, + CurrencyId, CurrencyIdMapping, DerivativeAccountHandler, DerivativeIndex, SlpHostingFeeProvider, SlpOperator, TimeUnit, VtokenMintingOperator, XcmOperationType, ASTR, DOT, FIL, GLMR, }; @@ -1246,80 +1246,11 @@ pub mod pallet { #[pallet::call_index(19)] #[pallet::weight(::WeightInfo::supplement_fee_reserve())] pub fn supplement_fee_reserve( - origin: OriginFor, - currency_id: CurrencyId, - dest: Box, + _origin: OriginFor, + _currency_id: CurrencyId, + _dest: Box, ) -> DispatchResult { - // Ensure origin - Self::ensure_authorized(origin, currency_id)?; - - // Ensure dest is one of delegators accounts, or operators account, or in - // SupplementFeeAccountWhitelist. - let mut valid_account = false; - - if DelegatorsMultilocation2Index::::contains_key(currency_id, dest.clone()) { - valid_account = true; - } - - if !valid_account { - let dest_account_id = Self::multilocation_to_account(&dest)?; - let operate_account_op = OperateOrigins::::get(currency_id); - - if let Some(operate_account) = operate_account_op { - if dest_account_id == operate_account { - valid_account = true; - } - } - } - - if !valid_account { - let white_list_op = SupplementFeeAccountWhitelist::::get(currency_id); - - if let Some(white_list) = white_list_op { - let multi_hash = T::Hashing::hash(&dest.encode()); - white_list - .binary_search_by_key(&multi_hash, |(_multi, hash)| *hash) - .map_err(|_| Error::::DestAccountNotValid)?; - - valid_account = true; - } - } - - ensure!(valid_account, Error::::DestAccountNotValid); - - // Get the fee source account and reserve amount from the FeeSources storage. - let (source_location, reserved_fee) = - FeeSources::::get(currency_id).ok_or(Error::::FeeSourceNotExist)?; - - // If currency is BNC, transfer directly. - // Otherwise, call supplement_fee_reserve of StakingFeeManager trait. - if currency_id.is_native() { - let source_account = Self::native_multilocation_to_account(&source_location)?; - let dest_account = Self::native_multilocation_to_account(&dest)?; - T::MultiCurrency::transfer( - currency_id, - &source_account, - &dest_account, - reserved_fee, - )?; - } else { - let staking_agent = Self::get_currency_staking_agent(currency_id)?; - staking_agent.supplement_fee_reserve( - reserved_fee, - &source_location, - &dest, - currency_id, - )?; - } - - // Deposit event. - Pallet::::deposit_event(Event::FeeSupplemented { - currency_id, - amount: reserved_fee, - from: source_location, - to: *dest, - }); - + ensure!(false, Error::::Unsupported); Ok(()) } diff --git a/pallets/slp/src/mocks/mock.rs b/pallets/slp/src/mocks/mock.rs index 7229247f2..5d4836d0d 100644 --- a/pallets/slp/src/mocks/mock.rs +++ b/pallets/slp/src/mocks/mock.rs @@ -532,6 +532,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/slp/src/mocks/mock_kusama.rs b/pallets/slp/src/mocks/mock_kusama.rs index 794c3b67b..8c54946b3 100644 --- a/pallets/slp/src/mocks/mock_kusama.rs +++ b/pallets/slp/src/mocks/mock_kusama.rs @@ -24,7 +24,7 @@ use crate as bifrost_slp; use crate::{Config, DispatchResult, QueryResponseManager}; use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ - currency::{BNC, KSM, MANTA, VKSM}, + currency::{BNC, KSM, MANTA}, Amount, Balance, CurrencyId, DoNothingExecuteXcm, DoNothingRouter, SlpxOperator, TokenSymbol, XcmDestWeightAndFeeHandler, XcmOperationType, }; @@ -616,6 +616,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] @@ -660,15 +664,6 @@ impl Default for ExtBuilder { } impl ExtBuilder { - pub fn balances(mut self, endowed_accounts: Vec<(AccountId, CurrencyId, Balance)>) -> Self { - self.endowed_accounts = endowed_accounts; - self - } - - pub fn one_hundred_for_alice(self) -> Self { - self.balances(vec![(ALICE, BNC, 100), (ALICE, KSM, 100), (ALICE, VKSM, 100)]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); diff --git a/pallets/slp/src/tests/kusama_tests.rs b/pallets/slp/src/tests/kusama_tests.rs index a7e8766c7..20731999f 100644 --- a/pallets/slp/src/tests/kusama_tests.rs +++ b/pallets/slp/src/tests/kusama_tests.rs @@ -19,8 +19,8 @@ #![cfg(test)] use crate::{mocks::mock_kusama::*, *}; -use bifrost_primitives::currency::{BNC, KSM, VKSM}; -use frame_support::{assert_noop, assert_ok, PalletId}; +use bifrost_primitives::currency::{KSM, VKSM}; +use frame_support::{assert_ok, PalletId}; use orml_traits::MultiCurrency; use sp_runtime::traits::AccountIdConversion; use xcm::v3::prelude::*; @@ -74,47 +74,6 @@ fn set_fee_source_works() { }); } -// test native token fee supplement. Non-native will be tested in the integration tests. -#[test] -fn supplement_fee_reserve_works() { - ExtBuilder::default().one_hundred_for_alice().build().execute_with(|| { - // set fee source - let alice_32 = Pallet::::account_id_to_account_32(ALICE).unwrap(); - let alice_location = Pallet::::account_32_to_local_location(alice_32).unwrap(); - assert_ok!(Slp::set_fee_source( - RuntimeOrigin::signed(ALICE), - BNC, - Some((alice_location, 10)) - )); - - // supplement fee - let bob_32 = Pallet::::account_id_to_account_32(BOB).unwrap(); - let bob_location = Pallet::::account_32_to_local_location(bob_32).unwrap(); - assert_eq!(Balances::free_balance(&ALICE), 100); - assert_eq!(Balances::free_balance(&BOB), 0); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(alice_location) - ), - Error::::DestAccountNotValid - ); - - assert_ok!(Slp::set_operate_origin(RuntimeOrigin::signed(ALICE), BNC, Some(BOB))); - - assert_ok!(Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(bob_location) - )); - - assert_eq!(Balances::free_balance(&ALICE), 90); - assert_eq!(Balances::free_balance(&BOB), 10); - }); -} - #[test] fn remove_delegator_works() { ExtBuilder::default().build().execute_with(|| { diff --git a/pallets/slp/src/tests/manta_tests.rs b/pallets/slp/src/tests/manta_tests.rs index 886195541..3e3d1fd1c 100644 --- a/pallets/slp/src/tests/manta_tests.rs +++ b/pallets/slp/src/tests/manta_tests.rs @@ -1468,121 +1468,6 @@ fn manta_transfer_to_works() { }); } -#[test] -fn supplement_fee_account_whitelist_works() { - let bifrost_parachain_account_id_32 = Sibling::from(2030).into_account_truncating(); - - let subaccount_0_account_id_32 = - Utility::derivative_account_id(bifrost_parachain_account_id_32, 0).into(); - - let subaccount_0_location = MultiLocation { - parents: 1, - interior: X2( - Parachain(2104), - Junction::AccountId32 { network: None, id: subaccount_0_account_id_32 }, - ), - }; - - ExtBuilder::default().build().execute_with(|| { - // environment setup - manta_setup(); - let entrance_account_id_32: [u8; 32] = PalletId(*b"bf/vtkin").into_account_truncating(); - let entrance_account_id: AccountId = entrance_account_id_32.into(); - - let entrance_account_location = MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: entrance_account_id_32 }), - }; - - let exit_account_id_32 = PalletId(*b"bf/vtout").into_account_truncating(); - let exit_account_location = MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: exit_account_id_32 }), - }; - - let source_account_id_32 = ALICE.into(); - let source_location = Slp::account_32_to_local_location(source_account_id_32).unwrap(); - assert_ok!(Slp::set_fee_source( - RuntimeOrigin::signed(ALICE), - MANTA, - Some((source_location, 1_000_000_000_000_000_000)) - )); - - // Dest should be one of delegators, operateOrigins or accounts in the whitelist. - assert_ok!(Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(subaccount_0_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(entrance_account_location), - ), - Error::::DestAccountNotValid - ); - - // register entrance_account_location as operateOrigin - assert_ok!(Slp::set_operate_origin( - RuntimeOrigin::signed(ALICE), - MANTA, - Some(entrance_account_id) - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(entrance_account_location), - ), - Error::::TransferToError - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - - // register exit_account_location into whitelist - assert_ok!(Slp::add_supplement_fee_account_to_whitelist( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(exit_account_location), - ), - Error::::TransferToError - ); - - // remove exit_account_location from whitelist - assert_ok!(Slp::remove_supplement_fee_account_from_whitelist( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - }); -} - #[test] fn charge_host_fee_and_tune_vtoken_exchange_rate_works() { let bifrost_parachain_account_id_32 = Sibling::from(2030).into_account_truncating(); diff --git a/pallets/slp/src/tests/moonriver_tests.rs b/pallets/slp/src/tests/moonriver_tests.rs index 36503b513..64f523732 100644 --- a/pallets/slp/src/tests/moonriver_tests.rs +++ b/pallets/slp/src/tests/moonriver_tests.rs @@ -1490,124 +1490,6 @@ fn moonriver_transfer_to_works() { }); } -#[test] -fn supplement_fee_account_whitelist_works() { - let bifrost_parachain_account_id_20: [u8; 20] = Sibling::from(2001).into_account_truncating(); - - let subaccount_0_account_id_20: [u8; 20] = - Slp::derivative_account_id_20(bifrost_parachain_account_id_20, 0).into(); - - let subaccount_0_location = MultiLocation { - parents: 1, - interior: X2( - Parachain(2023), - Junction::AccountKey20 { network: None, key: subaccount_0_account_id_20 }, - ), - }; - - ExtBuilder::default().build().execute_with(|| { - // environment setup - moonriver_setup(); - let entrance_account_id_32: [u8; 32] = PalletId(*b"bf/vtkin").into_account_truncating(); - let entrance_account_id: AccountId = entrance_account_id_32.into(); - - let entrance_account_location = MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: entrance_account_id_32 }), - }; - - let exit_account_id_32: [u8; 32] = PalletId(*b"bf/vtout").into_account_truncating(); - let exit_account_location = MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: exit_account_id_32 }), - }; - - let source_account_id_32: [u8; 32] = ALICE.into(); - let source_location = Slp::account_32_to_local_location(source_account_id_32).unwrap(); - assert_ok!(Slp::set_fee_source( - RuntimeOrigin::signed(ALICE), - MOVR, - Some((source_location, 1_000_000_000_000_000_000)) - )); - - // Dest should be one of delegators, operateOrigins or accounts in the whitelist. - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(subaccount_0_location), - ), - Error::::TransferToError - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(entrance_account_location), - ), - Error::::DestAccountNotValid - ); - - // register entrance_account_location as operateOrigin - assert_ok!(Slp::set_operate_origin( - RuntimeOrigin::signed(ALICE), - MOVR, - Some(entrance_account_id) - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(entrance_account_location), - ), - Error::::TransferToError - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - - // register exit_account_location into whitelist - assert_ok!(Slp::add_supplement_fee_account_to_whitelist( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(exit_account_location), - ), - Error::::TransferToError - ); - - // remove exit_account_location from whitelist - assert_ok!(Slp::remove_supplement_fee_account_from_whitelist( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - }); -} - #[test] fn charge_host_fee_and_tune_vtoken_exchange_rate_works() { let bifrost_parachain_account_id_20: [u8; 20] = Sibling::from(2001).into_account_truncating(); diff --git a/pallets/slp/src/tests/parachain_staking_tests.rs b/pallets/slp/src/tests/parachain_staking_tests.rs index 2f92c9225..69a8758c5 100644 --- a/pallets/slp/src/tests/parachain_staking_tests.rs +++ b/pallets/slp/src/tests/parachain_staking_tests.rs @@ -845,97 +845,6 @@ fn parachain_staking_transfer_to_works() { }); } -#[test] -fn supplement_fee_account_whitelist_works() { - let subaccount_0_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: CHARLIE.into() }), - }; - - ExtBuilder::default().build().execute_with(|| { - // environment setup - parachain_staking_setup(); - let entrance_account_id: AccountId = PalletId(*b"bf/vtkin").into_account_truncating(); - let entrance_account_id_32: [u8; 32] = PalletId(*b"bf/vtkin").into_account_truncating(); - - let entrance_account_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: entrance_account_id_32 }), - }; - let exit_account_id_32: [u8; 32] = PalletId(*b"bf/vtout").into_account_truncating(); - let exit_account_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: exit_account_id_32 }), - }; - - let source_account_id_32: [u8; 32] = ALICE.into(); - let source_location = Slp::account_32_to_local_location(source_account_id_32).unwrap(); - assert_ok!(Slp::set_fee_source( - RuntimeOrigin::signed(ALICE), - BNC, - Some((source_location, 1_000_000_000_000)) - )); - - // Dest should be one of delegators, operateRuntimeOrigins or accounts in the whitelist. - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(subaccount_0_location), - ), - Error::::DestAccountNotValid - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(entrance_account_location), - ), - Error::::DestAccountNotValid - ); - - // register entrance_account_location as operateRuntimeOrigin - assert_ok!(Slp::set_operate_origin( - RuntimeOrigin::signed(ALICE), - BNC, - Some(entrance_account_id) - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - - // register exit_account_location into whitelist - assert_ok!(Slp::add_supplement_fee_account_to_whitelist( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(exit_account_location), - )); - - // remove exit_account_location from whitelist - assert_ok!(Slp::remove_supplement_fee_account_from_whitelist( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - }); -} - #[test] fn add_validator_and_remove_validator_works() { let validator_0_location = diff --git a/pallets/slp/src/tests/phala_tests.rs b/pallets/slp/src/tests/phala_tests.rs index 54d8c054b..c81be3d3a 100644 --- a/pallets/slp/src/tests/phala_tests.rs +++ b/pallets/slp/src/tests/phala_tests.rs @@ -1289,123 +1289,6 @@ fn phala_transfer_to_works() { }); } -#[test] -fn supplement_fee_account_whitelist_works() { - let bifrost_parachain_account_id: AccountId = Sibling::from(2001).into_account_truncating(); - // subaccount_id_0: 41YcGwBLwxbFV7VfbF6zYGgUnYbt96dHcA2DWruRJkWtANFD - let subaccount_0_account_id_32: [u8; 32] = - Utility::derivative_account_id(bifrost_parachain_account_id, 0).into(); - - let subaccount_0_location = MultiLocation { - parents: 1, - interior: X2( - Parachain(2004), - AccountId32 { network: None, id: subaccount_0_account_id_32.into() }, - ), - }; - - ExtBuilder::default().build().execute_with(|| { - // environment setup - phala_setup(); - let entrance_account_id: AccountId = PalletId(*b"bf/vtkin").into_account_truncating(); - let entrance_account_id_32: [u8; 32] = PalletId(*b"bf/vtkin").into_account_truncating(); - let entrance_account_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: entrance_account_id_32 }), - }; - - let exit_account_id_32: [u8; 32] = PalletId(*b"bf/vtout").into_account_truncating(); - let exit_account_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: exit_account_id_32 }), - }; - - let source_account_id_32: [u8; 32] = ALICE.into(); - let source_location = Slp::account_32_to_local_location(source_account_id_32).unwrap(); - assert_ok!(Slp::set_fee_source( - RuntimeOrigin::signed(ALICE), - PHA, - Some((source_location, 1_000_000_000_000_000_000)) - )); - - // Dest should be one of delegators, operateOrigins or accounts in the whitelist. - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(subaccount_0_location), - ), - Error::::TransferToError - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(entrance_account_location), - ), - Error::::DestAccountNotValid - ); - - // register entrance_account_location as operateOrigin - assert_ok!(Slp::set_operate_origin( - RuntimeOrigin::signed(ALICE), - PHA, - Some(entrance_account_id) - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(entrance_account_location), - ), - Error::::TransferToError - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - - // register exit_account_location into whitelist - assert_ok!(Slp::add_supplement_fee_account_to_whitelist( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(exit_account_location), - ), - Error::::TransferToError - ); - - // remove exit_account_location from whitelist - assert_ok!(Slp::remove_supplement_fee_account_from_whitelist( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - }); -} - #[test] fn charge_host_fee_and_tune_vtoken_exchange_rate_works() { let bifrost_parachain_account_id: AccountId = Sibling::from(2001).into_account_truncating(); diff --git a/pallets/slp/src/traits.rs b/pallets/slp/src/traits.rs index 8b1c0f426..2e2d1e22c 100644 --- a/pallets/slp/src/traits.rs +++ b/pallets/slp/src/traits.rs @@ -193,15 +193,6 @@ pub trait StakingAgent< currency_id: CurrencyId, ) -> DispatchResult; - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - amount: Balance, - from: &MultiLocation, - to: &MultiLocation, - currency_id: CurrencyId, - ) -> Result<(), Error>; - /// Remove an existing serving delegator for a particular currency. fn remove_delegator(&self, who: &MultiLocation, currency_id: CurrencyId) -> DispatchResult; diff --git a/pallets/slpx/src/benchmarking.rs b/pallets/slpx/src/benchmarking.rs index d0c07e15d..1b914af4d 100644 --- a/pallets/slpx/src/benchmarking.rs +++ b/pallets/slpx/src/benchmarking.rs @@ -55,7 +55,6 @@ fn init_whitelist() -> (T::AccountId #[benchmarks(where T: Config + bifrost_asset_registry::Config + bifrost_stable_pool::Config + bifrost_stable_asset::Config + orml_tokens::Config)] mod benchmarks { use super::*; - use frame_benchmarking::impl_benchmark_test_suite; #[benchmark] fn add_whitelist() { diff --git a/pallets/slpx/src/mock.rs b/pallets/slpx/src/mock.rs index d0ef639e6..951b740f7 100644 --- a/pallets/slpx/src/mock.rs +++ b/pallets/slpx/src/mock.rs @@ -327,6 +327,10 @@ impl xcm_executor::Config for XcmConfig { type Aliasers = Nothing; type AssetExchanger = (); type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } parameter_type_with_key! { diff --git a/pallets/stable-pool/src/mock.rs b/pallets/stable-pool/src/mock.rs index b5f3e9c6e..0eb1ce4ad 100644 --- a/pallets/stable-pool/src/mock.rs +++ b/pallets/stable-pool/src/mock.rs @@ -146,6 +146,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } parameter_type_with_key! { diff --git a/pallets/system-maker/src/mock.rs b/pallets/system-maker/src/mock.rs index bcd18d750..48323d9f3 100644 --- a/pallets/system-maker/src/mock.rs +++ b/pallets/system-maker/src/mock.rs @@ -429,6 +429,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/system-staking/src/mock.rs b/pallets/system-staking/src/mock.rs index f55394832..32c2cfd58 100644 --- a/pallets/system-staking/src/mock.rs +++ b/pallets/system-staking/src/mock.rs @@ -363,6 +363,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/traits/src/evm.rs b/pallets/traits/src/evm.rs new file mode 100644 index 000000000..8dc1ea184 --- /dev/null +++ b/pallets/traits/src/evm.rs @@ -0,0 +1,20 @@ +pub trait InspectEvmAccounts { + /// Returns `True` if the account is EVM truncated account. + fn is_evm_account(account_id: AccountId) -> bool; + + /// get the EVM address from the substrate address. + fn evm_address(account_id: &impl AsRef<[u8; 32]>) -> EvmAddress; + + /// Get the truncated address from the EVM address. + fn truncated_account_id(evm_address: EvmAddress) -> AccountId; + + /// Return the Substrate address bound to the EVM account. If not bound, returns `None`. + fn bound_account_id(evm_address: EvmAddress) -> Option; + + /// Get the Substrate address from the EVM address. + /// Returns the truncated version of the address if the address wasn't bind. + fn account_id(evm_address: EvmAddress) -> AccountId; + + /// Returns `True` if the address is allowed to deploy smart contracts. + fn can_deploy_contracts(evm_address: EvmAddress) -> bool; +} diff --git a/pallets/traits/src/lib.rs b/pallets/traits/src/lib.rs index bfedd1594..b36d98329 100644 --- a/pallets/traits/src/lib.rs +++ b/pallets/traits/src/lib.rs @@ -3,7 +3,9 @@ use bifrost_primitives::{CurrencyId, PriceDetail}; use num_bigint::{BigUint, ToBigUint}; +pub mod evm; pub mod lend_market; + pub use lend_market::*; pub trait EmergencyCallFilter { @@ -12,6 +14,7 @@ pub trait EmergencyCallFilter { pub trait PriceFeeder { fn get_price(asset_id: &CurrencyId) -> Option; + fn get_normal_price(asset_id: &CurrencyId) -> Option; } pub trait EmergencyPriceFeeder { diff --git a/pallets/ve-minting/rpc/src/lib.rs b/pallets/ve-minting/rpc/src/lib.rs index d55fe6b5d..944d53838 100644 --- a/pallets/ve-minting/rpc/src/lib.rs +++ b/pallets/ve-minting/rpc/src/lib.rs @@ -42,9 +42,11 @@ pub trait VeMintingRpcApi { #[method(name = "ve_minting_balanceOf")] fn balance_of(&self, who: AccountId, at: Option) -> RpcResult; + /// RPC method to get total supply #[method(name = "ve_minting_totalSupply")] fn total_supply(&self, at: Option) -> RpcResult; + /// RPC method to find block epoch #[method(name = "ve_minting_findBlockEpoch")] fn find_block_epoch(&self, max_epoch: U256, at: Option) -> RpcResult; } @@ -75,6 +77,7 @@ where AccountId: Codec, // CallError: From<>::Error>, { + /// Get the balance of the user at a specific block hash fn balance_of( &self, who: AccountId, @@ -109,6 +112,7 @@ where } } + /// Get the total supply at a specific block hash fn total_supply(&self, at: Option<::Hash>) -> RpcResult { let lm_rpc_api = self.client.runtime_api(); let at = at.unwrap_or_else(|| self.client.info().best_hash); @@ -139,6 +143,7 @@ where } } + /// Find the block epoch given a max epoch and block hash fn find_block_epoch( &self, max_epoch: U256, diff --git a/pallets/ve-minting/src/incentive.rs b/pallets/ve-minting/src/incentive.rs index 5af370683..cbbbb7a77 100644 --- a/pallets/ve-minting/src/incentive.rs +++ b/pallets/ve-minting/src/incentive.rs @@ -53,6 +53,7 @@ where } impl Pallet { + /// Check if the current block number is within the end time of the reward pool pub fn last_time_reward_applicable(pool_id: PoolId) -> BlockNumberFor { let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); if current_block_number < Self::incentive_configs(pool_id).period_finish { @@ -62,6 +63,7 @@ impl Pallet { } } + /// Calculate the reward per token for the given pool pub fn reward_per_token( pool_id: PoolId, ) -> Result, BalanceOf>, DispatchError> { @@ -71,6 +73,7 @@ impl Pallet { if total_supply == BalanceOf::::zero() { return Ok(conf.reward_per_token_stored); } + // Iterate over each currency and its associated reward rate conf.reward_rate.iter().try_for_each(|(currency, &reward)| -> DispatchResult { let increment: BalanceOf = U512::from( Self::last_time_reward_applicable(pool_id) @@ -97,6 +100,7 @@ impl Pallet { Ok(conf.reward_per_token_stored) } + /// Calculates the reward earned by an account from a specific reward pool pub fn earned( pool_id: PoolId, addr: &AccountIdOf, @@ -128,6 +132,8 @@ impl Pallet { // .map_err(|_| ArithmeticError::Overflow)? // .unique_saturated_into(); + // If share information is provided, calculate the reward based on the individual share + // and total share. match share_info { Some((share, total_share)) => { let reward = increment @@ -145,6 +151,7 @@ impl Pallet { }) .or_insert(reward); }, + // If no share information is provided, calculate the reward directly None => { let reward = u128::try_from(increment) .map_err(|_| ArithmeticError::Overflow)? @@ -175,8 +182,10 @@ impl Pallet { item.reward_per_token_stored = reward_per_token_stored.clone(); item.last_update_time = Self::last_time_reward_applicable(pool_id); }); + // If an account address is provided, update the rewards if let Some(address) = addr { let earned = Self::earned(pool_id, address, share_info)?; + // If the account has earned rewards, update the rewards storage if earned != BTreeMap::, BalanceOf>::default() { Rewards::::insert(address, earned); } @@ -185,12 +194,14 @@ impl Pallet { Ok(()) } + /// Update reward for all pools pub fn update_reward_all(addr: Option<&AccountIdOf>) -> DispatchResult { // TODO: pool_id Self::update_reward(0, addr, None)?; Ok(()) } + ///Transfer rewards into an account pub fn get_rewards_inner( pool_id: PoolId, addr: &AccountIdOf, @@ -199,7 +210,7 @@ impl Pallet { Self::update_reward(pool_id, Some(addr), share_info)?; if Self::balance_of_current_block(addr)? == BalanceOf::::zero() { return Ok(()); - } + } // Excit earlier if balance of token is zero if let Some(rewards) = Self::rewards(addr) { rewards.iter().try_for_each(|(currency, &reward)| -> DispatchResult { T::MultiCurrency::transfer( diff --git a/pallets/ve-minting/src/lib.rs b/pallets/ve-minting/src/lib.rs index a01b06665..03ce9a825 100644 --- a/pallets/ve-minting/src/lib.rs +++ b/pallets/ve-minting/src/lib.rs @@ -47,7 +47,6 @@ use frame_support::{ use frame_system::pallet_prelude::*; pub use incentive::*; use orml_traits::{LockIdentifier, MultiCurrency, MultiLockableCurrency}; -pub use pallet::*; use sp_core::{U256, U512}; use sp_std::{borrow::ToOwned, cmp::Ordering, collections::btree_map::BTreeMap, vec, vec::Vec}; pub use traits::{ diff --git a/pallets/ve-minting/src/mock.rs b/pallets/ve-minting/src/mock.rs index 9c59dd190..f6f459eb6 100644 --- a/pallets/ve-minting/src/mock.rs +++ b/pallets/ve-minting/src/mock.rs @@ -370,6 +370,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/ve-minting/src/tests.rs b/pallets/ve-minting/src/tests.rs index ce606d4a2..78247e72e 100644 --- a/pallets/ve-minting/src/tests.rs +++ b/pallets/ve-minting/src/tests.rs @@ -27,6 +27,7 @@ use bifrost_runtime_common::milli; use frame_support::{assert_noop, assert_ok}; const POSITIONID0: u128 = 0; +const POSITIONID1: u128 = 1; const POOLID0: PoolId = 0; #[test] @@ -50,6 +51,38 @@ fn create_lock_should_work() { }); } +#[test] +fn create_multi_locks_should_work() { + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + (4 * 365 * 86400 - 5 * 86400) / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(1)), + Point { bias: 9972575751740, slope: 951293, block: 20, amount: 10000000000000 } + ); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(9972575751740)); + assert_eq!(VeMinting::total_supply(System::block_number()), Ok(9972575751740)); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 5_000_000_000_000, + System::block_number() + (2 * 365 * 86400 - 5 * 86400) / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(1)), + Point { bias: 2493136560680, slope: 475646, block: 20, amount: 5000000000000 } + ); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(12465712312420)); + assert_eq!(VeMinting::total_supply(System::block_number()), Ok(12465712312420)); + }); +} + #[test] fn increase_unlock_time_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -86,6 +119,68 @@ fn increase_unlock_time_should_work() { }); } +#[test] +fn increase_unlock_time_should_work2() { + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 7 * 86400 / 12); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + (3 * 365 * 86400 - 5 * 86400) / 12, + )); + assert_eq!(Locked::::get(POSITIONID0).end, 7963200); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(7527391250400)); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 5_000_000_000_000, + System::block_number() + (3 * 365 * 86400 - 5 * 86400) / 12, + )); + assert_eq!(Locked::::get(POSITIONID1).end, 7963200); + assert_noop!( + VeMinting::increase_unlock_time( + RuntimeOrigin::signed(BOB), + POSITIONID0, + System::block_number() + 365 * 86400 / 12 + ), + Error::::ArgumentsError + ); + assert_noop!( + VeMinting::increase_unlock_time( + RuntimeOrigin::signed(BOB), + POSITIONID1, + System::block_number() + 365 * 86400 / 12 + ), + Error::::ArgumentsError + ); + assert_ok!(VeMinting::increase_unlock_time( + RuntimeOrigin::signed(BOB), + POSITIONID0, + (365 * 86400 - 5 * 86400) / 12 + )); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(13784231613600)); + assert_ok!(VeMinting::increase_unlock_time( + RuntimeOrigin::signed(BOB), + POSITIONID1, + (365 * 86400 - 5 * 86400) / 12 + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(1)), + Point { bias: 7527391250400, slope: 951293, block: 50400, amount: 10000000000000 } + ); + assert_eq!(Locked::::get(POSITIONID0).end, 10584000); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(1)), + Point { bias: 3763691668800, slope: 475646, block: 50400, amount: 5000000000000 } + ); + assert_eq!(Locked::::get(POSITIONID1).end, 10584000); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(15030804650400)); + assert_eq!(VeMinting::total_supply(System::block_number()), Ok(15030804650400)); + }); +} + #[test] fn update_reward() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -315,6 +410,51 @@ fn deposit_markup_before_lock_should_work() { }); } +#[test] +fn deposit_markup_before_lock_should_work2() { + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::set_markup_coefficient( + RuntimeOrigin::root(), + VBNC, + FixedU128::from_inner(100_000_000_000_000_000), // 0.1 + FixedU128::saturating_from_integer(1), + )); + assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VBNC, 10_000_000_000_000)); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 15_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::one()), + Point { bias: 2796030953200, slope: 1046740, block: 20, amount: 11003333333333 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::one()), + Point { bias: 4194046429800, slope: 1570110, block: 20, amount: 16504999999999 } + ); + assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); + assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); + assert_eq!( + VeMinting::balance_of(&BOB, Some(System::block_number())), + Ok(2796030953200 + 4194046429800) + ); + assert_eq!( + VeMinting::balance_of(&BOB, Some(System::block_number())), + Ok(2796030953200 + 4194046429800) + ); + }); +} + #[test] fn deposit_markup_after_lock_should_work2() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -476,6 +616,53 @@ fn redeem_unlock_should_work() { }); } +#[test] +fn withdraw_markup_after_lock_should_work3() { + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 15_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::set_markup_coefficient( + RuntimeOrigin::root(), + VBNC, + FixedU128::from_inner(100_000_000_000_000_000), // 0.1 + FixedU128::saturating_from_integer(1), + )); + assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VBNC, 10_000_000_000_000)); + assert_ok!(VeMinting::withdraw_markup(RuntimeOrigin::signed(BOB), VBNC)); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(2)), + Point { bias: 2796030953200, slope: 1046740, block: 20, amount: 11003333333333 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(3)), + Point { bias: 2541074835740, slope: 951293, block: 20, amount: 10000000000000 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(2)), + Point { bias: 4194046429800, slope: 1570110, block: 20, amount: 16504999999999 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(3)), + Point { bias: 3811613589200, slope: 1426940, block: 20, amount: 15000000000000 } + ); + assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); + assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(6352688424940)); + }); +} + #[test] fn redeem_unlock_after_360_days_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -514,6 +701,55 @@ fn redeem_unlock_after_360_days_should_work() { }); } +#[test] +fn redeem_unlock_after_360_days_should_work2() { + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::set_markup_coefficient( + RuntimeOrigin::root(), + VKSM, + FixedU128::from_inner(FixedU128::DIV / 10), // 0.1 + FixedU128::saturating_from_integer(1), + )); + assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VKSM, 10_000_000_000_000)); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(0)); + assert_eq!(Tokens::free_balance(VBNC, &BOB), 1000000000000000); + assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 1000000000000000).is_ok(), true); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 15_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::one()), + Point { bias: 5082152342660, slope: 1902587, block: 20, amount: 20000000000000 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::one()), + Point { bias: 7623229849580, slope: 2853881, block: 20, amount: 30000000000000 } + ); + assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); + assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(12705382192240)); + assert_eq!(Tokens::free_balance(VBNC, &BOB), 1_000_000_000_000_000); + assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 1_000_000_000_000_000).is_ok(), false); + System::set_block_number(System::block_number() + 360 * 86400 / 12); + assert_ok!(VeMinting::redeem_unlock(RuntimeOrigin::signed(BOB), POSITIONID0)); + assert_ok!(VeMinting::redeem_unlock(RuntimeOrigin::signed(BOB), POSITIONID1)); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(0)); + assert_eq!(Tokens::free_balance(VBNC, &BOB), 998341660825205); + assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 998341660825205).is_ok(), true); + }); +} + #[test] fn refresh_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { diff --git a/pallets/vtoken-minting/src/lib.rs b/pallets/vtoken-minting/src/lib.rs index 24836a404..599ea45f5 100644 --- a/pallets/vtoken-minting/src/lib.rs +++ b/pallets/vtoken-minting/src/lib.rs @@ -187,6 +187,7 @@ pub mod pallet { vtoken_amount: BalanceOf, fee: BalanceOf, remark: BoundedVec>, + channel_id: Option, }, Redeemed { address: AccountIdOf, @@ -1597,6 +1598,7 @@ pub mod pallet { vtoken_amount, fee, remark, + channel_id, }); Ok(vtoken_amount.into()) } diff --git a/pallets/vtoken-minting/src/mock.rs b/pallets/vtoken-minting/src/mock.rs index e33677c9d..24d469e92 100644 --- a/pallets/vtoken-minting/src/mock.rs +++ b/pallets/vtoken-minting/src/mock.rs @@ -346,6 +346,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/vtoken-voting/src/benchmarking.rs b/pallets/vtoken-voting/src/benchmarking.rs index 72159e0e5..1e397ec57 100644 --- a/pallets/vtoken-voting/src/benchmarking.rs +++ b/pallets/vtoken-voting/src/benchmarking.rs @@ -180,6 +180,7 @@ mod benchmarks { whitelist_account!(caller); let origin = RawOrigin::Signed(caller); let vtoken = VKSM; + let class = 0u16; let poll_index = 0u32; let vote = account_vote::(100u32.into()); let derivative_index = 0u16; @@ -208,7 +209,7 @@ mod benchmarks { )?; #[extrinsic_call] - _(origin, vtoken, poll_index, derivative_index); + _(origin, vtoken, class, poll_index, derivative_index); Ok(()) } diff --git a/pallets/vtoken-voting/src/call.rs b/pallets/vtoken-voting/src/call.rs index 2ab5093bc..956d2a15a 100644 --- a/pallets/vtoken-voting/src/call.rs +++ b/pallets/vtoken-voting/src/call.rs @@ -19,7 +19,7 @@ #![allow(ambiguous_glob_reexports)] #![allow(unused_imports)] -use crate::{AccountVote, BalanceOf, Config, DerivativeIndex, PollIndex}; +use crate::{AccountVote, BalanceOf, Config, DerivativeIndex, PollClass, PollIndex}; use parity_scale_codec::{Decode, Encode}; use sp_runtime::{traits::StaticLookup, RuntimeDebug}; use sp_std::prelude::*; @@ -61,15 +61,15 @@ pub enum ConvictionVoting { #[codec(index = 0)] Vote(#[codec(compact)] PollIndex, AccountVote>), #[codec(index = 3)] - Unlock(u16, ::Source), + Unlock(PollClass, ::Source), #[codec(index = 4)] - RemoveVote(Option, PollIndex), + RemoveVote(Option, PollIndex), } pub trait ConvictionVotingCall { fn vote(poll_index: PollIndex, vote: AccountVote>) -> Self; - fn remove_vote(class: Option, poll_index: PollIndex) -> Self; + fn remove_vote(class: Option, poll_index: PollIndex) -> Self; } impl ConvictionVotingCall for RelayCall { @@ -77,7 +77,7 @@ impl ConvictionVotingCall for RelayCall { Self::ConvictionVoting(ConvictionVoting::Vote(poll_index, vote)) } - fn remove_vote(class: Option, poll_index: PollIndex) -> Self { + fn remove_vote(class: Option, poll_index: PollIndex) -> Self { Self::ConvictionVoting(ConvictionVoting::RemoveVote(class, poll_index)) } } diff --git a/pallets/vtoken-voting/src/lib.rs b/pallets/vtoken-voting/src/lib.rs index 3cd4ea416..5d99397b8 100644 --- a/pallets/vtoken-voting/src/lib.rs +++ b/pallets/vtoken-voting/src/lib.rs @@ -66,6 +66,7 @@ use xcm::v4::{prelude::*, Weight as XcmWeight}; const CONVICTION_VOTING_ID: LockIdentifier = *b"vtvoting"; type PollIndex = u32; +type PollClass = u16; pub type AccountIdOf = ::AccountId; @@ -557,6 +558,7 @@ pub mod pallet { pub fn remove_delegator_vote( origin: OriginFor, vtoken: CurrencyIdOf, + #[pallet::compact] class: PollClass, #[pallet::compact] poll_index: PollIndex, #[pallet::compact] derivative_index: DerivativeIndex, ) -> DispatchResult { @@ -570,7 +572,7 @@ pub mod pallet { response: Default::default(), }; let remove_vote_call = - as ConvictionVotingCall>::remove_vote(None, poll_index); + as ConvictionVotingCall>::remove_vote(Some(class), poll_index); let (weight, extra_fee) = T::XcmDestWeightAndFee::get_operation_weight_and_fee( CurrencyId::to_token(&vtoken).map_err(|_| Error::::NoData)?, XcmOperationType::RemoveVote, diff --git a/pallets/vtoken-voting/src/mock.rs b/pallets/vtoken-voting/src/mock.rs index 686900e18..ffb1dee22 100644 --- a/pallets/vtoken-voting/src/mock.rs +++ b/pallets/vtoken-voting/src/mock.rs @@ -171,6 +171,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/vtoken-voting/src/tests.rs b/pallets/vtoken-voting/src/tests.rs index 48f204fa2..de56e74e0 100644 --- a/pallets/vtoken-voting/src/tests.rs +++ b/pallets/vtoken-voting/src/tests.rs @@ -892,6 +892,7 @@ fn notify_vote_with_no_data_works() { #[test] fn notify_remove_delegator_vote_success_works() { new_test_ext().execute_with(|| { + let class = 0; let poll_index = 3; let vtoken = VKSM; let mut query_id = 0; @@ -939,6 +940,7 @@ fn notify_remove_delegator_vote_success_works() { assert_ok!(VtokenVoting::remove_delegator_vote( RuntimeOrigin::signed(ALICE), vtoken, + class, poll_index, derivative_index, )); @@ -967,6 +969,7 @@ fn notify_remove_delegator_vote_success_works() { #[test] fn notify_remove_delegator_vote_fail_works() { new_test_ext().execute_with(|| { + let class = 0; let poll_index = 3; let vtoken = VKSM; let mut query_id = 0; @@ -1014,6 +1017,7 @@ fn notify_remove_delegator_vote_fail_works() { assert_ok!(VtokenVoting::remove_delegator_vote( RuntimeOrigin::signed(ALICE), vtoken, + class, poll_index, derivative_index, )); diff --git a/pallets/vtoken-voting/src/weights.rs b/pallets/vtoken-voting/src/weights.rs index 8005536f1..d67897e71 100644 --- a/pallets/vtoken-voting/src/weights.rs +++ b/pallets/vtoken-voting/src/weights.rs @@ -174,30 +174,30 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) - /// Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - /// Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) - /// Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - /// Storage: ParachainSystem ValidationData (r:1 w:0) - /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VtokenVoting DelegatorVote (r:1 w:0) - /// Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) - /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) - /// Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VtokenVoting PendingRemoveDelegatorVote (r:0 w:1) - /// Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + /// Storage: `VtokenVoting::DelegatorVotes` (r:1 w:0) + /// Proof: `VtokenVoting::DelegatorVotes` (`max_values`: None, `max_size`: Some(5136), added: 7611, mode: `MaxEncodedLen`) + /// Storage: `VtokenVoting::ReferendumInfoFor` (r:1 w:0) + /// Proof: `VtokenVoting::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmInterface::XcmWeightAndFee` (r:1 w:0) + /// Proof: `XcmInterface::XcmWeightAndFee` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `VtokenVoting::PendingRemoveDelegatorVote` (r:0 w:1) + /// Proof: `VtokenVoting::PendingRemoveDelegatorVote` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_delegator_vote() -> Weight { // Proof Size summary in bytes: - // Measured: `965` - // Estimated: `4430` - // Minimum execution time: 86_949_000 picoseconds. - Weight::from_parts(112_996_000, 4430) + // Measured: `1048` + // Estimated: `8601` + // Minimum execution time: 35_000_000 picoseconds. + Weight::from_parts(36_000_000, 8601) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } diff --git a/pallets/xcm-interface/src/calls.rs b/pallets/xcm-interface/src/calls.rs index 99e816841..8c1cbf002 100644 --- a/pallets/xcm-interface/src/calls.rs +++ b/pallets/xcm-interface/src/calls.rs @@ -20,7 +20,7 @@ use frame_support::sp_runtime::MultiSignature; use parity_scale_codec::{Decode, Encode}; use sp_runtime::RuntimeDebug; use sp_std::{boxed::Box, vec::Vec}; -use xcm::{VersionedAssets, VersionedLocation}; +use xcm::{v4::WeightLimit, VersionedAssets, VersionedLocation}; use crate::ChainId; @@ -39,7 +39,7 @@ pub enum StakingCall { } #[derive(Encode, Decode, RuntimeDebug, Clone)] -pub enum PolkadotXcm { +pub enum PolkadotXcmCall { #[codec(index = 2)] ReserveTransferAssets( Box, @@ -47,6 +47,22 @@ pub enum PolkadotXcm { Box, u32, ), + #[codec(index = 8)] + LimitedReserveTransferAssets( + Box, + Box, + Box, + u32, + WeightLimit, + ), + #[codec(index = 9)] + LimitedTeleportAssets( + Box, + Box, + Box, + u32, + WeightLimit, + ), } #[derive(Encode, Decode, RuntimeDebug, Clone)] @@ -55,19 +71,6 @@ pub enum SystemCall { RemarkWithEvent(Vec), } -pub mod rococo { - - pub use crate::calls::*; - - #[derive(Encode, Decode, RuntimeDebug)] - pub enum RelaychainCall { - #[codec(index = 28)] - Crowdloan(ContributeCall), - #[codec(index = 91)] - Proxy(ProxyCall), - } -} - pub mod kusama { pub use crate::calls::*; @@ -79,10 +82,15 @@ pub mod kusama { #[codec(index = 30)] Proxy(ProxyCall), } + + #[derive(Encode, Decode, RuntimeDebug)] + pub enum AssetHubCall { + #[codec(index = 31)] + PolkadotXcm(PolkadotXcmCall), + } } pub mod polkadot { - pub use crate::calls::*; #[derive(Encode, Decode, RuntimeDebug)] @@ -91,6 +99,14 @@ pub mod polkadot { Crowdloan(ContributeCall), #[codec(index = 29)] Proxy(ProxyCall), + #[codec(index = 99)] + XcmPallet(PolkadotXcmCall), + } + + #[derive(Encode, Decode, RuntimeDebug)] + pub enum AssetHubCall { + #[codec(index = 31)] + PolkadotXcm(PolkadotXcmCall), } } diff --git a/pallets/xcm-interface/src/lib.rs b/pallets/xcm-interface/src/lib.rs index e7ea013fc..f56f617ee 100644 --- a/pallets/xcm-interface/src/lib.rs +++ b/pallets/xcm-interface/src/lib.rs @@ -17,6 +17,7 @@ // along with this program. If not, see . #![cfg_attr(not(feature = "std"), no_std)] +#![allow(unused_imports)] pub mod calls; pub mod traits; @@ -25,20 +26,19 @@ use bifrost_primitives::{traits::XcmDestWeightAndFeeHandler, CurrencyIdMapping, pub use calls::*; use orml_traits::MultiCurrency; pub use pallet::*; +use sp_runtime::traits::UniqueSaturatedInto; pub use traits::{ChainId, MessageId, Nonce, SalpHelper}; macro_rules! use_relay { ({ $( $code:tt )* }) => { if T::RelayNetwork::get() == NetworkId::Polkadot { use polkadot::RelaychainCall; + use polkadot::AssetHubCall; $( $code )* } else if T::RelayNetwork::get() == NetworkId::Kusama { use kusama::RelaychainCall; - - $( $code )* - } else if T::RelayNetwork::get() == NetworkId::Rococo { - use rococo::RelaychainCall; + use kusama::AssetHubCall; $( $code )* } else { @@ -135,6 +135,7 @@ pub mod pallet { pub enum Event { XcmDestWeightAndFeeUpdated(XcmOperationType, CurrencyIdOf, Weight, BalanceOf), TransferredStatemineMultiAsset(AccountIdOf, BalanceOf), + TransferredEthereumAssets(AccountIdOf, sp_core::H160, BalanceOf), } /// The current storage version, we set to 2 our new version(after migrate stroage @@ -278,6 +279,76 @@ pub mod pallet { Ok(()) } + + #[pallet::call_index(2)] + #[pallet::weight({2_000_000_000})] + pub fn transfer_ethereum_assets( + origin: OriginFor, + currency_id: CurrencyIdOf, + amount: BalanceOf, + to: sp_core::H160, + ) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + let asset_location = + T::CurrencyIdConvert::get_location(currency_id).ok_or(Error::::FailToConvert)?; + + let asset: Asset = Asset { + id: AssetId(asset_location), + fun: Fungible(UniqueSaturatedInto::::unique_saturated_into(amount)), + }; + + let (require_weight_at_most, xcm_fee) = + Self::xcm_dest_weight_and_fee(currency_id, XcmOperationType::EthereumTransfer) + .ok_or(Error::::OperationWeightAndFeeNotExist)?; + + let fee: Asset = Asset { + id: AssetId(Location::parent()), + fun: Fungible(UniqueSaturatedInto::::unique_saturated_into(xcm_fee)), + }; + + T::MultiCurrency::withdraw(currency_id, &who, amount)?; + + let remote_call: DoubleEncoded<()> = use_relay!({ + AssetHubCall::PolkadotXcm(PolkadotXcmCall::LimitedReserveTransferAssets( + Box::new(Location::new(2, [GlobalConsensus(Ethereum { chain_id: 1 })]).into()), + Box::new( + Location::new( + 0, + [AccountKey20 { network: None, key: to.to_fixed_bytes() }], + ) + .into(), + ), + Box::new(asset.into()), + 0, + Unlimited, + )) + .encode() + .into() + }); + + let remote_xcm = Xcm(vec![ + WithdrawAsset(fee.clone().into()), + BuyExecution { fees: fee.clone(), weight_limit: Unlimited }, + Transact { + origin_kind: OriginKind::SovereignAccount, + require_weight_at_most, + call: remote_call, + }, + DepositAsset { + assets: All.into(), + beneficiary: Location::new(1, [Parachain(T::ParachainId::get().into())]), + }, + ]); + let (ticket, _) = ::XcmRouter::validate( + &mut Some(Location::new(1, [Parachain(parachains::Statemine::ID)])), + &mut Some(remote_xcm), + ) + .map_err(|_| Error::::UnweighableMessage)?; + ::XcmRouter::deliver(ticket) + .map_err(|_| Error::::XcmExecutionFailed)?; + Self::deposit_event(Event::::TransferredEthereumAssets(who, to, amount)); + Ok(()) + } } impl XcmHelper, BalanceOf> for Pallet { diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index 563e7fb63..f3598dff8 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -58,9 +58,25 @@ pub const ASTR: CurrencyId = CurrencyId::Token2(ASTR_TOKEN_ID); pub const FIL_TOKEN_ID: u8 = 4u8; pub const FIL: CurrencyId = CurrencyId::Token2(FIL_TOKEN_ID); pub const VFIL: CurrencyId = CurrencyId::VToken2(FIL_TOKEN_ID); +pub const USDC_TOKEN_ID: u8 = 5u8; +pub const USDC: CurrencyId = CurrencyId::Token2(USDC_TOKEN_ID); +pub const IBTC_TOKEN_ID: u8 = 6u8; +pub const IBTC: CurrencyId = CurrencyId::Token2(IBTC_TOKEN_ID); +pub const INTR_TOKEN_ID: u8 = 7u8; +pub const INTR: CurrencyId = CurrencyId::Token2(INTR_TOKEN_ID); pub const MANTA_TOKEN_ID: u8 = 8u8; pub const MANTA: CurrencyId = CurrencyId::Token2(MANTA_TOKEN_ID); pub const VMANTA: CurrencyId = CurrencyId::VToken2(MANTA_TOKEN_ID); +pub const BNCS_TOKEN_ID: u8 = 9u8; +pub const BNCS: CurrencyId = CurrencyId::Token2(BNCS_TOKEN_ID); +pub const PINK_TOKEN_ID: u8 = 10u8; +pub const PINK: CurrencyId = CurrencyId::Token2(PINK_TOKEN_ID); +pub const DED_TOKEN_ID: u8 = 11u8; +pub const DED: CurrencyId = CurrencyId::Token2(DED_TOKEN_ID); +pub const PEN_TOKEN_ID: u8 = 12u8; +pub const PEN: CurrencyId = CurrencyId::Token2(PEN_TOKEN_ID); +pub const WETH_TOKEN_ID: u8 = 13u8; +pub const WETH: CurrencyId = CurrencyId::Token2(WETH_TOKEN_ID); pub const VSBOND_BNC_2001_0_8: CurrencyId = CurrencyId::VSBond(TokenSymbol::BNC, 2001, 0, 8); pub const CLOUD_TOKEN_ID: u8 = 12u8; pub const CLOUD: CurrencyId = CurrencyId::Token2(CLOUD_TOKEN_ID); diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 9e675a505..3bb427b98 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -329,6 +329,8 @@ pub enum XcmOperationType { RemoveVote, Any, SupplementaryFee, + EthereumTransfer, + TeleportAssets, } pub struct ExtraFeeInfo { diff --git a/primitives/src/traits.rs b/primitives/src/traits.rs index 6279a91e9..87a9d5727 100644 --- a/primitives/src/traits.rs +++ b/primitives/src/traits.rs @@ -21,8 +21,8 @@ #![allow(clippy::unnecessary_cast)] use crate::{ - AssetIds, DerivativeIndex, ExtraFeeInfo, LeasePeriod, ParaId, PoolId, RedeemType, TokenId, - TokenSymbol, XcmOperationType, + AssetIds, CurrencyId, DerivativeIndex, ExtraFeeInfo, LeasePeriod, ParaId, PoolId, RedeemType, + TokenId, TokenSymbol, XcmOperationType, }; use frame_support::pallet_prelude::{DispatchResultWithPostInfo, Weight}; use parity_scale_codec::{Decode, Encode, FullCodec}; @@ -551,3 +551,20 @@ impl SlpHostingFeeProvider { + fn get(a: &AccountId) -> CurrencyId; +} + +/// Provides account's balance of fee asset currency in a given currency +pub trait AccountFeeCurrencyBalanceInCurrency { + type Output; + fn get_balance_in_currency(to_currency: CurrencyId, account: &AccountId) -> Self::Output; +} + +pub trait PriceProvider { + type Price; + + fn get_price(asset_a: CurrencyId, asset_b: CurrencyId) -> Option; +} diff --git a/runtime/bifrost-kusama/Cargo.toml b/runtime/bifrost-kusama/Cargo.toml index 3df0cc57f..3e93f2e4d 100644 --- a/runtime/bifrost-kusama/Cargo.toml +++ b/runtime/bifrost-kusama/Cargo.toml @@ -21,6 +21,7 @@ serde_json = { workspace = true } # frame dependencies frame-benchmarking = { workspace = true, optional = true } frame-executive = { workspace = true } +frame-metadata-hash-extension = { workspace = true } frame-support = { workspace = true, features = ["tuples-96"] } frame-system = { workspace = true } frame-system-benchmarking = { workspace = true, optional = true } @@ -48,6 +49,7 @@ pallet-scheduler = { workspace = true } pallet-session = { workspace = true } pallet-timestamp = { workspace = true } pallet-tips = { workspace = true } +pallet-tx-pause = { workspace = true } pallet-transaction-payment = { workspace = true } pallet-transaction-payment-rpc-runtime-api = { workspace = true } pallet-treasury = { workspace = true } @@ -112,7 +114,6 @@ bifrost-stable-asset = { workspace = true } # Bifrost bifrost-asset-registry = { workspace = true } -bifrost-call-switchgear = { workspace = true } bifrost-cross-in-out = { workspace = true } bifrost-currencies = { workspace = true } bifrost-farming = { workspace = true } @@ -158,6 +159,7 @@ std = [ "frame-benchmarking?/std", "frame-executive/std", + "frame-metadata-hash-extension/std", "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", @@ -183,6 +185,7 @@ std = [ "pallet-session/std", "pallet-timestamp/std", "pallet-tips/std", + "pallet-tx-pause/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", "pallet-treasury/std", @@ -237,7 +240,6 @@ std = [ "bifrost-primitives/std", "bifrost-asset-registry/std", - "bifrost-call-switchgear/std", "bifrost-cross-in-out/std", "bifrost-currencies/std", "bifrost-farming-rpc-runtime-api/std", @@ -302,7 +304,6 @@ runtime-benchmarks = [ "bifrost-salp/runtime-benchmarks", "bifrost-vsbond-auction/runtime-benchmarks", "bifrost-token-issuer/runtime-benchmarks", - "bifrost-call-switchgear/runtime-benchmarks", "bifrost-vtoken-minting/runtime-benchmarks", "bifrost-farming/runtime-benchmarks", "bifrost-system-staking/runtime-benchmarks", @@ -357,6 +358,7 @@ try-runtime = [ "pallet-treasury/try-runtime", "pallet-bounties/try-runtime", "pallet-tips/try-runtime", + "pallet-tx-pause/try-runtime", "pallet-preimage/try-runtime", "pallet-whitelist/try-runtime", "orml-xtokens/try-runtime", @@ -372,7 +374,6 @@ try-runtime = [ "bifrost-flexible-fee/try-runtime", "bifrost-salp/try-runtime", "bifrost-token-issuer/try-runtime", - "bifrost-call-switchgear/try-runtime", "bifrost-vsbond-auction/try-runtime", "bifrost-asset-registry/try-runtime", "bifrost-vtoken-minting/try-runtime", @@ -394,6 +395,8 @@ try-runtime = [ "bifrost-channel-commission/try-runtime", ] +# Enable the metadata hash generation in the wasm builder. +metadata-hash = ["substrate-wasm-builder?/metadata-hash"] # When enabled, the runtime API will not be build. # # This is required by Cumulus to access certain types of the @@ -404,7 +407,7 @@ disable-runtime-api = [] # A feature that should be enabled when the runtime should be build for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller like logging for example. -on-chain-release-build = ["sp-api/disable-logging"] +on-chain-release-build = ["sp-api/disable-logging", "metadata-hash"] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] diff --git a/runtime/bifrost-kusama/build.rs b/runtime/bifrost-kusama/build.rs index a6d8f457d..2cacbff1a 100644 --- a/runtime/bifrost-kusama/build.rs +++ b/runtime/bifrost-kusama/build.rs @@ -16,14 +16,17 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#[cfg(feature = "std")] +#[cfg(all(feature = "std", feature = "metadata-hash"))] fn main() { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() + substrate_wasm_builder::WasmBuilder::init_with_defaults() + .enable_metadata_hash("BNC", 12) .build() } +#[cfg(all(feature = "std", not(feature = "metadata-hash")))] +fn main() { + substrate_wasm_builder::WasmBuilder::build_using_defaults() +} + #[cfg(not(feature = "std"))] fn main() {} diff --git a/runtime/bifrost-kusama/src/governance/fellowship.rs b/runtime/bifrost-kusama/src/governance/fellowship.rs index bd9844ff7..b4453594d 100644 --- a/runtime/bifrost-kusama/src/governance/fellowship.rs +++ b/runtime/bifrost-kusama/src/governance/fellowship.rs @@ -26,7 +26,7 @@ use frame_support::traits::{EitherOf, MapSuccess, TryMapSuccess}; use sp_arithmetic::traits::CheckedSub; use sp_runtime::{ morph_types, - traits::{ConstU16, Replace, TypedGet}, + traits::{ConstU16, Replace, ReplaceWithDefault, TypedGet}, }; parameter_types! { @@ -352,6 +352,9 @@ impl pallet_ranked_collective::Config for Runtime TryMapSuccess>>, >, >; + + type AddOrigin = MapSuccess>; + type RemoveOrigin = Self::DemoteOrigin; type Polls = FellowshipReferenda; type MinRankOfClass = sp_runtime::traits::Identity; type VoteWeight = pallet_ranked_collective::Geometric; diff --git a/runtime/bifrost-kusama/src/governance/referenda.rs b/runtime/bifrost-kusama/src/governance/referenda.rs index 907a1b3f9..f566b2b7e 100644 --- a/runtime/bifrost-kusama/src/governance/referenda.rs +++ b/runtime/bifrost-kusama/src/governance/referenda.rs @@ -35,7 +35,7 @@ impl pallet_conviction_voting::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type Polls = Referenda; - type MaxTurnout = frame_support::traits::TotalIssuanceOf; + type MaxTurnout = frame_support::traits::ActiveIssuanceOf; // Maximum number of concurrent votes an account may have type MaxVotes = ConstU32<512>; // Minimum period of vote locking diff --git a/runtime/bifrost-kusama/src/governance/tracks.rs b/runtime/bifrost-kusama/src/governance/tracks.rs index fac57bfc7..613fc32fc 100644 --- a/runtime/bifrost-kusama/src/governance/tracks.rs +++ b/runtime/bifrost-kusama/src/governance/tracks.rs @@ -62,10 +62,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] name: "whitelisted_caller", max_deciding: 100, decision_deposit: 5_000 * BNCS, - prepare_period: 15 * MINUTES, + prepare_period: 5 * MINUTES, decision_period: 14 * DAYS, - confirm_period: 10 * MINUTES, - min_enactment_period: 10 * MINUTES, + confirm_period: 5 * MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: Curve::make_reciprocal( 16, 28 * 24, @@ -73,7 +73,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] percent(50), percent(100), ), - min_support: Curve::make_reciprocal(1, 28, percent(8), percent(2), percent(50)), + min_support: Curve::make_reciprocal(1, 1792, percent(3), percent(2), percent(50)), }, ), ( diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index a93e1549a..acd0f4505 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -56,7 +56,7 @@ use sp_runtime::{ AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, StaticLookup, Zero, }, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, DispatchError, DispatchResult, Perbill, Permill, RuntimeDebug, + ApplyExtrinsicResult, DispatchError, DispatchResult, FixedU128, Perbill, Permill, RuntimeDebug, SaturatedConversion, }; use sp_std::{marker::PhantomData, prelude::*}; @@ -89,13 +89,13 @@ use constants::currency::*; use cumulus_pallet_parachain_system::{RelayNumberStrictlyIncreases, RelaychainDataProvider}; use frame_support::{ dispatch::DispatchClass, - genesis_builder_helper::{build_config, create_default_config}, + genesis_builder_helper::{build_state, get_preset}, sp_runtime::traits::{Convert, ConvertInto}, traits::{ fungible::HoldConsideration, tokens::{PayFromAccount, UnityAssetBalanceConversion}, - Currency, EitherOf, EitherOfDiverse, Get, Imbalance, LinearStoragePrice, LockIdentifier, - OnUnbalanced, + Currency, EitherOf, EitherOfDiverse, Get, Imbalance, InsideBoth, LinearStoragePrice, + LockIdentifier, OnUnbalanced, }, }; use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned}; @@ -143,7 +143,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bifrost"), impl_name: create_runtime_str!("bifrost"), authoring_version: 1, - spec_version: 11000, + spec_version: 12000, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -194,118 +194,6 @@ parameter_types! { pub const SS58Prefix: u8 = 6; } -pub struct CallFilter; -impl Contains for CallFilter { - fn contains(call: &RuntimeCall) -> bool { - let is_core_call = matches!( - call, - RuntimeCall::System(_) | RuntimeCall::Timestamp(_) | RuntimeCall::ParachainSystem(_) - ); - if is_core_call { - // always allow core call - return true; - } - - if bifrost_call_switchgear::OverallToggleFilter::::get_overall_toggle_status() { - return false; - } - - // temporarily ban PhragmenElection - let is_temporarily_banned = matches!(call, RuntimeCall::PhragmenElection(_)); - - if is_temporarily_banned { - return false; - } - - let is_switched_off = - bifrost_call_switchgear::SwitchOffTransactionFilter::::contains(call); - if is_switched_off { - // no switched off call - return false; - } - - // disable transfer - let is_transfer = matches!( - call, - RuntimeCall::Currencies(_) | RuntimeCall::Tokens(_) | RuntimeCall::Balances(_) - ); - if is_transfer { - let is_disabled = match *call { - // bifrost-currencies module - RuntimeCall::Currencies(bifrost_currencies::Call::transfer { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Currencies(bifrost_currencies::Call::transfer_native_currency { - dest: _, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - // orml-tokens module - RuntimeCall::Tokens(orml_tokens::Call::transfer { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Tokens(orml_tokens::Call::transfer_all { - dest: _, - currency_id, - keep_alive: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Tokens(orml_tokens::Call::transfer_keep_alive { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - // Balances module - RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death { - dest: _, - value: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - RuntimeCall::Balances(pallet_balances::Call::transfer_keep_alive { - dest: _, - value: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - RuntimeCall::Balances(pallet_balances::Call::transfer_all { - dest: _, - keep_alive: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - _ => false, - }; - - if is_disabled { - // no switched off call - return false; - } - } - - true - } -} - -pub struct BaseFilter; -impl Contains for BaseFilter { - fn contains(_c: &RuntimeCall) -> bool { - true - } -} - parameter_types! { pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); @@ -342,13 +230,14 @@ parameter_types! { pub const CommissionPalletId: PalletId = PalletId(*b"bf/comms"); pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); pub const FarmingGaugeRewardIssuerPalletId: PalletId = PalletId(*b"bf/fmgar"); + pub const FlexibleFeePalletId: PalletId = PalletId(*b"bf/flexi"); } impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; /// The identifier used to distinguish between accounts. type AccountId = AccountId; - type BaseCallFilter = CallFilter; + type BaseCallFilter = InsideBoth; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; type BlockLength = RuntimeBlockLength; @@ -380,6 +269,11 @@ impl frame_system::Config for Runtime { type Version = Version; type MaxConsumers = ConstU32<16>; type RuntimeTask = (); + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); } impl pallet_timestamp::Config for Runtime { @@ -892,6 +786,25 @@ impl pallet_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; } +/// Calls that can bypass the tx-pause pallet. +/// We always allow system calls and timestamp since it is required for block production +pub struct TxPauseWhitelistedCalls; +impl Contains> for TxPauseWhitelistedCalls { + fn contains(full_name: &pallet_tx_pause::RuntimeCallNameOf) -> bool { + matches!(full_name.0.as_slice(), b"System" | b"Timestamp" | b"TxPause") + } +} + +impl pallet_tx_pause::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PauseOrigin = TechAdminOrCouncil; + type UnpauseOrigin = TechAdminOrCouncil; + type WhitelistedCalls = TxPauseWhitelistedCalls; + type MaxNameLen = ConstU32<256>; + type WeightInfo = pallet_tx_pause::weights::SubstrateWeight; +} + impl frame_system::offchain::CreateSignedTransaction for Runtime where RuntimeCall: From, @@ -923,6 +836,7 @@ where frame_system::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), pallet_transaction_payment::ChargeTransactionPayment::::from(tip), + frame_metadata_hash_extension::CheckMetadataHash::::new(false), ); let raw_payload = SignedPayload::new(call, extra) .map_err(|e| { @@ -1083,6 +997,7 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; type AllowMultipleBlocksPerSlot = ConstBool; + type SlotDuration = ConstU64; } // culumus runtime end @@ -1151,6 +1066,11 @@ impl bifrost_flexible_fee::Config for Runtime { type ParachainId = ParachainInfo; type ControlOrigin = TechAdminOrCouncil; type XcmWeightAndFeeHandler = XcmInterface; + type MinAssetHubExecutionFee = ConstU128<{ 3 * DOLLARS }>; + type MinRelaychainExecutionFee = ConstU128<{ 3 * DOLLARS }>; + type RelaychainCurrencyId = RelayCurrencyId; + type XcmRouter = XcmRouter; + type PalletId = FlexibleFeePalletId; } parameter_types! { @@ -1311,12 +1231,6 @@ impl bifrost_token_issuer::Config for Runtime { type MaxLengthLimit = MaxLengthLimit; } -impl bifrost_call_switchgear::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type UpdateOrigin = CoreAdminOrCouncil; - type WeightInfo = weights::bifrost_call_switchgear::BifrostWeight; -} - impl bifrost_asset_registry::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; @@ -1694,14 +1608,22 @@ parameter_types! { pub const ExpiresIn: Moment = 1000 * 60 * 60; // 60 mins pub const MaxHasDispatchedSize: u32 = 100; pub OracleRootOperatorAccountId: AccountId = OraclePalletId::get().into_account_truncating(); + pub const MinimumTimestampInterval: Moment = 1000 * 60 * 10; // 10 mins + pub const MaximumValueInterval: Price = FixedU128::from_inner(3_000_000_000_000_000); // 0.3% } type BifrostDataProvider = orml_oracle::Instance1; impl orml_oracle::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnNewData = (); - type CombineData = - orml_oracle::DefaultCombineData; + type CombineData = orml_oracle::DefaultCombineData< + Runtime, + MinimumCount, + ExpiresIn, + MinimumTimestampInterval, + MaximumValueInterval, + BifrostDataProvider, + >; type Time = Timestamp; type OracleKey = CurrencyId; type OracleValue = Price; @@ -1710,6 +1632,7 @@ impl orml_oracle::Config for Runtime { type WeightInfo = weights::orml_oracle::WeightInfo; type Members = OracleMembership; type MaxFeedValues = ConstU32<100>; + type ControlOrigin = TechAdminOrCouncil; } pub type TimeStampedPrice = orml_oracle::TimestampedValue; @@ -1906,6 +1829,7 @@ construct_runtime! { Indices: pallet_indices = 2, ParachainSystem: cumulus_pallet_parachain_system = 5, ParachainInfo: parachain_info = 6, + TxPause: pallet_tx_pause = 7, // Monetary stuff Balances: pallet_balances = 10, @@ -1965,7 +1889,6 @@ construct_runtime! { FlexibleFee: bifrost_flexible_fee = 100, Salp: bifrost_salp = 105, TokenIssuer: bifrost_token_issuer = 109, - CallSwitchgear: bifrost_call_switchgear = 112, VSBondAuction: bifrost_vsbond_auction = 113, AssetRegistry: bifrost_asset_registry = 114, VtokenMinting: bifrost_vtoken_minting = 115, @@ -2020,6 +1943,7 @@ pub type SignedExtra = ( frame_system::CheckNonce, frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, + frame_metadata_hash_extension::CheckMetadataHash, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = @@ -2030,7 +1954,12 @@ pub type CheckedExtrinsic = generic::CheckedExtrinsic; parameter_types! { - pub const DmpQueuePalletName: &'static str = "DmpQueue"; + pub const CallSwitchgearPalletName: &'static str = "CallSwitchgear"; +} + +impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { + // This must be the same as the `ChannelInfo` from the `Config`: + type ChannelList = ParachainSystem; } /// All migrations that will run on the next runtime upgrade. @@ -2046,12 +1975,13 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( - bifrost_slpx::migration::v1::MigrateToV1, + // permanent migration, do not remove + pallet_xcm::migration::MigrateToLatestXcmVersion, frame_support::migrations::RemovePallet< - DmpQueuePalletName, + CallSwitchgearPalletName, ::DbWeight, >, - pallet_xcm::migration::MigrateToLatestXcmVersion, + cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, ); } @@ -2073,7 +2003,6 @@ extern crate frame_benchmarking; mod benches { define_benchmarks!( [bifrost_asset_registry, AssetRegistry] - [bifrost_call_switchgear, CallSwitchgear] [bifrost_cross_in_out, CrossInOut] [bifrost_farming, Farming] [bifrost_fee_share, FeeShare] @@ -2115,7 +2044,7 @@ impl_runtime_apis! { Executive::execute_block(block); } - fn initialize_block(header: &::Header) { + fn initialize_block(header: &::Header) -> sp_runtime::ExtrinsicInclusionMode { Executive::initialize_block(header) } } @@ -2212,7 +2141,7 @@ impl_runtime_apis! { } fn authorities() -> Vec { - Aura::authorities().into_inner() + pallet_aura::Authorities::::get().into_inner() } } @@ -2472,12 +2401,16 @@ impl_runtime_apis! { } impl sp_genesis_builder::GenesisBuilder for Runtime { - fn create_default_config() -> Vec { - create_default_config::() + fn build_state(config: Vec) -> sp_genesis_builder::Result { + build_state::(config) + } + + fn get_preset(id: &Option) -> Option> { + get_preset::(id, |_| None) } - fn build_config(config: Vec) -> sp_genesis_builder::Result { - build_config::(config) + fn preset_names() -> Vec { + vec![] } } } diff --git a/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs b/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs deleted file mode 100644 index 439245f52..000000000 --- a/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs +++ /dev/null @@ -1,101 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) Liebi Technologies PTE. LTD. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for bifrost_call_switchgear -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 - -// Executed Command: -// target/release/bifrost -// benchmark -// pallet -// --chain=bifrost-kusama-local -// --steps=50 -// --repeat=20 -// --pallet=bifrost_call_switchgear -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs -// --template=./weight-template/runtime-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions for bifrost_call_switchgear. -pub struct BifrostWeight(PhantomData); -impl bifrost_call_switchgear::WeightInfo for BifrostWeight { - // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) - // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) - fn switchoff_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `3469` - // Minimum execution time: 29_214 nanoseconds. - Weight::from_parts(30_398_000, 3469) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) - // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) - fn switchon_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `55` - // Estimated: `3520` - // Minimum execution time: 31_720 nanoseconds. - Weight::from_parts(32_717_000, 3520) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) - // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) - fn disable_transfers() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `3469` - // Minimum execution time: 26_079 nanoseconds. - Weight::from_parts(26_977_000, 3469) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) - // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) - fn enable_transfers() -> Weight { - // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 27_719 nanoseconds. - Weight::from_parts(28_319_000, 3503) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs index 361ddb923..8939443b4 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs @@ -159,30 +159,30 @@ impl bifrost_vtoken_voting::WeightInfo for BifrostWeigh .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } - // Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) - // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - // Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) - // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) - // Storage: VtokenVoting DelegatorVote (r:1 w:0) - // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) - // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) - // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm QueryCounter (r:1 w:1) - // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainInfo ParachainId (r:1 w:0) - // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: VtokenVoting PendingRemoveDelegatorVote (r:0 w:1) - // Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) - // Storage: PolkadotXcm Queries (r:0 w:1) - // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + // Storage: `VtokenVoting::DelegatorVotes` (r:1 w:0) + // Proof: `VtokenVoting::DelegatorVotes` (`max_values`: None, `max_size`: Some(5136), added: 7611, mode: `MaxEncodedLen`) + // Storage: `VtokenVoting::ReferendumInfoFor` (r:1 w:0) + // Proof: `VtokenVoting::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::ValidationData` (r:1 w:0) + // Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + // Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmInterface::XcmWeightAndFee` (r:1 w:0) + // Proof: `XcmInterface::XcmWeightAndFee` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + // Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainInfo::ParachainId` (r:1 w:0) + // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `VtokenVoting::PendingRemoveDelegatorVote` (r:0 w:1) + // Proof: `VtokenVoting::PendingRemoveDelegatorVote` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + // Storage: `PolkadotXcm::Queries` (r:0 w:1) + // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_delegator_vote() -> Weight { // Proof Size summary in bytes: - // Measured: `965` - // Estimated: `4430` - // Minimum execution time: 94_053 nanoseconds. - Weight::from_parts(105_489_000, 4430) + // Measured: `1048` + // Estimated: `8601` + // Minimum execution time: 34_000 nanoseconds. + Weight::from_parts(35_000_000, 8601) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/bifrost-kusama/src/weights/mod.rs b/runtime/bifrost-kusama/src/weights/mod.rs index b5ccb51c5..9782e1bcc 100644 --- a/runtime/bifrost-kusama/src/weights/mod.rs +++ b/runtime/bifrost-kusama/src/weights/mod.rs @@ -21,7 +21,6 @@ //! A list of the different weight modules for our runtime. pub mod bifrost_asset_registry; -pub mod bifrost_call_switchgear; pub mod bifrost_channel_commission; pub mod bifrost_cross_in_out; pub mod bifrost_currencies; diff --git a/runtime/bifrost-kusama/src/xcm_config.rs b/runtime/bifrost-kusama/src/xcm_config.rs index edecccb34..dbfec5ce6 100644 --- a/runtime/bifrost-kusama/src/xcm_config.rs +++ b/runtime/bifrost-kusama/src/xcm_config.rs @@ -629,6 +629,38 @@ impl Contains for SafeCallFilter { } } +/// Asset filter that allows all assets from a certain location matching asset id. +pub struct AssetPrefixFrom(PhantomData<(Prefix, Origin)>); +impl ContainsPair for AssetPrefixFrom +where + Prefix: Get, + Origin: Get, +{ + fn contains(asset: &Asset, origin: &Location) -> bool { + let loc = Origin::get(); + &loc == origin && + matches!(asset, Asset { id: AssetId(asset_loc), fun: Fungible(_a) } + if asset_loc.starts_with(&Prefix::get())) + } +} + +/// Asset filter that allows native/relay asset if coming from a certain location. +pub struct NativeAssetFrom(PhantomData); +impl> ContainsPair for NativeAssetFrom { + fn contains(asset: &Asset, origin: &Location) -> bool { + let loc = T::get(); + &loc == origin && + matches!(asset, Asset { id: AssetId(asset_loc), fun: Fungible(_a) } + if *asset_loc == Location::from(Parent)) + } +} + +parameter_types! { + /// Location of Asset Hub + pub AssetHubLocation: Location = (Parent, Parachain(1000)).into(); + pub EthereumLocation: Location = Location::new(2, [GlobalConsensus(Ethereum { chain_id: 1 })]); +} + pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type AssetClaims = PolkadotXcm; @@ -636,7 +668,11 @@ impl xcm_executor::Config for XcmConfig { type AssetTrap = BifrostDropAssets; type Barrier = Barrier; type RuntimeCall = RuntimeCall; - type IsReserve = MultiNativeAsset; + type IsReserve = ( + NativeAssetFrom, + AssetPrefixFrom, + MultiNativeAsset, + ); type IsTeleporter = (); type UniversalLocation = UniversalLocation; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -656,6 +692,10 @@ impl xcm_executor::Config for XcmConfig { type MessageExporter = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type XcmRecorder = (); + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); } /// Local origins on this chain are allowed to dispatch XCM sends/executions. @@ -726,10 +766,13 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; type PriceForSiblingDelivery = NoPriceForMessageDelivery; + type MaxActiveOutboundChannels = ConstU32<128>; + type MaxPageSize = ConstU32<{ 103 * 1024 }>; } parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -750,6 +793,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = ConstU32<{ 64 * 1024 }>; type MaxStale = ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } // orml runtime start diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index c152356c3..a1c48358f 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -21,6 +21,7 @@ serde_json = { workspace = true } # frame dependencies frame-benchmarking = { workspace = true, optional = true } frame-executive = { workspace = true } +frame-metadata-hash-extension = { workspace = true } frame-support = { workspace = true, features = ["tuples-96"] } frame-system = { workspace = true } frame-system-benchmarking = { workspace = true, optional = true } @@ -48,6 +49,7 @@ pallet-scheduler = { workspace = true } pallet-session = { workspace = true } pallet-timestamp = { workspace = true } pallet-tips = { workspace = true } +pallet-tx-pause = { workspace = true } pallet-transaction-payment = { workspace = true } pallet-transaction-payment-rpc-runtime-api = { workspace = true } pallet-treasury = { workspace = true } @@ -107,10 +109,34 @@ zenlink-protocol-runtime-api = { workspace = true } # Nuts Finance bifrost-stable-asset = { workspace = true } +# Frontier +num_enum = { workspace = true } +primitive-types = { workspace = true } +ethabi = { workspace = true } +module-evm-utility-macro = { workspace = true } +evm = { workspace = true, features = ["with-codec"] } +fp-account = { workspace = true, features = ["serde"] } +fp-evm = { workspace = true, features = ["serde"] } +fp-rpc = { workspace = true } +fp-self-contained = { workspace = true, features = ["serde"] } +pallet-base-fee = { workspace = true } +pallet-dynamic-fee = { workspace = true } +pallet-ethereum = { workspace = true } +pallet-evm = { workspace = true } +pallet-evm-chain-id = { 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 } +pallet-evm-precompile-bn128 = { workspace = true } +pallet-evm-precompile-blake2 = { workspace = true } +pallet-evm-accounts = { workspace = true } +pallet-evm-accounts-rpc-runtime-api = { workspace = true } +pallet-traits = { workspace = true } + # Bifrost bifrost-asset-registry = { workspace = true } bifrost-buy-back = { workspace = true } -bifrost-call-switchgear = { workspace = true } bifrost-cross-in-out = { workspace = true } bifrost-currencies = { workspace = true } bifrost-farming = { workspace = true } @@ -155,6 +181,7 @@ std = [ "strum/std", "frame-executive/std", + "frame-metadata-hash-extension/std", "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", @@ -179,6 +206,7 @@ std = [ "pallet-session/std", "pallet-timestamp/std", "pallet-tips/std", + "pallet-tx-pause/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", "pallet-treasury/std", @@ -254,6 +282,25 @@ std = [ "leverage-staking/std", "bifrost-xcm-interface/std", "bifrost-channel-commission/std", + # Frontier + "fp-account/std", + "fp-evm/std", + "fp-rpc/std", + "fp-account/std", + "fp-self-contained/std", + "pallet-base-fee/std", + "pallet-dynamic-fee/std", + "pallet-ethereum/std", + "pallet-evm/std", + "pallet-evm-chain-id/std", + "pallet-evm-precompile-dispatch/std", + "pallet-evm-precompile-modexp/std", + "pallet-evm-precompile-sha3fips/std", + "pallet-evm-precompile-simple/std", + "pallet-evm-precompile-bn128/std", + "pallet-evm-precompile-blake2/std", + "pallet-evm-accounts/std", + "pallet-evm-accounts-rpc-runtime-api/std", "bifrost-clouds-convert/std", "bifrost-vtoken-minting-rpc-runtime-api/std", @@ -278,11 +325,11 @@ runtime-benchmarks = [ "pallet-timestamp/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-utility/runtime-benchmarks", + "pallet-ethereum/runtime-benchmarks", "bifrost-vesting/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", - "bifrost-call-switchgear/runtime-benchmarks", "bifrost-slp/runtime-benchmarks", "bifrost-salp/runtime-benchmarks", "bifrost-vtoken-minting/runtime-benchmarks", @@ -301,7 +348,6 @@ runtime-benchmarks = [ try-runtime = [ "bifrost-asset-registry/try-runtime", "bifrost-buy-back/try-runtime", - "bifrost-call-switchgear/try-runtime", "bifrost-channel-commission/try-runtime", "bifrost-clouds-convert/try-runtime", "bifrost-cross-in-out/try-runtime", @@ -361,14 +407,23 @@ try-runtime = [ "pallet-session/try-runtime", "pallet-timestamp/try-runtime", "pallet-tips/try-runtime", + "pallet-tx-pause/try-runtime", "pallet-transaction-payment/try-runtime", "pallet-treasury/try-runtime", "pallet-utility/try-runtime", "pallet-whitelist/try-runtime", "parachain-info/try-runtime", "zenlink-protocol/try-runtime", + "fp-self-contained/try-runtime", + "pallet-ethereum/try-runtime", + "pallet-evm-accounts/try-runtime", + "pallet-evm/try-runtime", + "pallet-evm-chain-id/try-runtime", + "pallet-dynamic-fee/try-runtime", ] +# Enable the metadata hash generation in the wasm builder. +metadata-hash = ["substrate-wasm-builder?/metadata-hash"] # When enabled, the runtime API will not be build. # # This is required by Cumulus to access certain types of the @@ -379,7 +434,7 @@ disable-runtime-api = [] # A feature that should be enabled when the runtime should be build for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller like logging for example. -on-chain-release-build = ["sp-api/disable-logging"] +on-chain-release-build = ["sp-api/disable-logging", "metadata-hash"] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] diff --git a/runtime/bifrost-polkadot/build.rs b/runtime/bifrost-polkadot/build.rs index 8b3550ecf..32ac6de12 100644 --- a/runtime/bifrost-polkadot/build.rs +++ b/runtime/bifrost-polkadot/build.rs @@ -15,14 +15,17 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#[cfg(feature = "std")] +#[cfg(all(feature = "std", feature = "metadata-hash"))] fn main() { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() + substrate_wasm_builder::WasmBuilder::init_with_defaults() + .enable_metadata_hash("BNC", 12) .build() } +#[cfg(all(feature = "std", not(feature = "metadata-hash")))] +fn main() { + substrate_wasm_builder::WasmBuilder::build_using_defaults() +} + #[cfg(not(feature = "std"))] fn main() {} diff --git a/runtime/bifrost-polkadot/src/evm/accounts_conversion.rs b/runtime/bifrost-polkadot/src/evm/accounts_conversion.rs new file mode 100644 index 000000000..70035a95a --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/accounts_conversion.rs @@ -0,0 +1,55 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +#![allow(unused_imports)] +use crate::{ + evm::{ConsensusEngineId, FindAuthor}, + AccountId, Aura, EVMAccounts, Runtime, +}; +use core::marker::PhantomData; +use frame_support::traits::IsType; +use hex_literal::hex; +use pallet_evm::AddressMapping; +use pallet_traits::evm::InspectEvmAccounts; +use parity_scale_codec::{Decode, Encode}; +use sp_core::{crypto::ByteArray, H160}; +use sp_runtime::traits::AccountIdConversion; + +pub struct ExtendedAddressMapping; + +impl AddressMapping for ExtendedAddressMapping { + fn into_account_id(address: H160) -> AccountId { + EVMAccounts::account_id(address) + } +} + +// Ethereum-compatible blocks author (20 bytes) +// Converted by truncating from Substrate author (32 bytes) +pub struct FindAuthorTruncated(PhantomData); +impl> FindAuthor for FindAuthorTruncated { + fn find_author<'a, I>(digests: I) -> Option + where + I: 'a + IntoIterator, + { + if let Some(author_index) = F::find_author(digests) { + let authority_id = + pallet_aura::Authorities::::get()[author_index as usize].clone(); + return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); + } + None + } +} diff --git a/runtime/bifrost-polkadot/src/evm/evm-utility/Cargo.toml b/runtime/bifrost-polkadot/src/evm/evm-utility/Cargo.toml new file mode 100644 index 000000000..5cb191086 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm-utility/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "module-evm-utility" +version = "2.21.0" +authors = ["Acala Developers"] +edition = "2021" + +[dependencies] +sha3 = { workspace = true } +sp-std = { workspace = true } +ethereum = { workspace = true } + +[features] +default = ["std"] +std = [ + "sha3/std", + "sp-std/std", + "ethereum/with-serde", +] diff --git a/runtime/bifrost-polkadot/src/evm/evm-utility/macro/Cargo.toml b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/Cargo.toml new file mode 100644 index 000000000..fb813d1aa --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "module-evm-utility-macro" +version = "2.21.0" +authors = ["Acala Developers"] +edition = "2021" + +[lib] +proc-macro = true + +[dependencies] +quote = { workspace = true } +syn = { workspace = true } +proc-macro2 = { workspace = true } +module-evm-utility = { path = ".." } diff --git a/runtime/bifrost-polkadot/src/evm/evm-utility/macro/src/lib.rs b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/src/lib.rs new file mode 100644 index 000000000..d913d3180 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/src/lib.rs @@ -0,0 +1,70 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use proc_macro::TokenStream; +use proc_macro2::Literal; +use quote::quote; +use syn::{parse_macro_input, Expr, ExprLit, Ident, ItemEnum, Lit, LitByteStr, LitStr}; + +#[proc_macro_attribute] +pub fn generate_function_selector(_: TokenStream, input: TokenStream) -> TokenStream { + let item = parse_macro_input!(input as ItemEnum); + + let ItemEnum { attrs, vis, enum_token, ident, variants, .. } = item; + + let mut ident_expressions: Vec = vec![]; + let mut variant_expressions: Vec = vec![]; + for variant in variants { + if let Some((_, Expr::Lit(ExprLit { lit, .. }))) = variant.discriminant { + if let Lit::Str(token) = lit { + let selector = module_evm_utility::get_function_selector(&token.value()); + // println!("method: {:?}, selector: {:?}", token.value(), selector); + ident_expressions.push(variant.ident); + variant_expressions.push(Expr::Lit(ExprLit { + lit: Lit::Verbatim(Literal::u32_suffixed(selector)), + attrs: Default::default(), + })); + } else { + panic!("Not method string: `{:?}`", lit); + } + } else { + panic!("Not enum: `{:?}`", variant); + } + } + + (quote! { + #(#attrs)* + #vis #enum_token #ident { + #( + #ident_expressions = #variant_expressions, + )* + } + }) + .into() +} + +#[proc_macro] +pub fn keccak256(input: TokenStream) -> TokenStream { + let lit_str = parse_macro_input!(input as LitStr); + + let result = module_evm_utility::sha3_256(&lit_str.value()); + + let eval = Lit::ByteStr(LitByteStr::new(result.as_ref(), proc_macro2::Span::call_site())); + + quote!(#eval).into() +} diff --git a/runtime/bifrost-polkadot/src/evm/evm-utility/macro/tests/test.rs b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/tests/test.rs new file mode 100644 index 000000000..9c4cc995f --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/tests/test.rs @@ -0,0 +1,51 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#[cfg(test)] +mod tests { + #[test] + fn generate_function_selector_works() { + #[module_evm_utility_macro::generate_function_selector] + #[derive(Debug, Eq, PartialEq)] + #[repr(u32)] + pub enum Action { + Name = "name()", + Symbol = "symbol()", + Decimals = "decimals()", + TotalSupply = "totalSupply()", + BalanceOf = "balanceOf(address)", + Transfer = "transfer(address,uint256)", + } + + assert_eq!(Action::Name as u32, 0x06fdde03_u32); + assert_eq!(Action::Symbol as u32, 0x95d89b41_u32); + assert_eq!(Action::Decimals as u32, 0x313ce567_u32); + assert_eq!(Action::TotalSupply as u32, 0x18160ddd_u32); + assert_eq!(Action::BalanceOf as u32, 0x70a08231_u32); + assert_eq!(Action::Transfer as u32, 0xa9059cbb_u32); + } + + #[test] + fn keccak256_works() { + assert_eq!(module_evm_utility_macro::keccak256!(""), &module_evm_utility::sha3_256("")); + assert_eq!( + module_evm_utility_macro::keccak256!("keccak256"), + &module_evm_utility::sha3_256("keccak256") + ); + } +} diff --git a/runtime/bifrost-polkadot/src/evm/evm-utility/src/lib.rs b/runtime/bifrost-polkadot/src/evm/evm-utility/src/lib.rs new file mode 100644 index 000000000..63578c532 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm-utility/src/lib.rs @@ -0,0 +1,43 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! # Evm utiltity Module +//! +//! A pallet provides some utility methods. + +#![cfg_attr(not(feature = "std"), no_std)] + +use sha3::{Digest, Keccak256}; + +pub fn sha3_256(s: &str) -> [u8; 32] { + let mut result = [0u8; 32]; + + // create a SHA3-256 object + let mut hasher = Keccak256::new(); + // write input message + hasher.update(s); + // read hash digest + result.copy_from_slice(&hasher.finalize()[..32]); + + result +} + +pub fn get_function_selector(s: &str) -> u32 { + let result = sha3_256(s); + u32::from_be_bytes(result[..4].try_into().unwrap()) +} diff --git a/runtime/bifrost-polkadot/src/evm/evm_fee.rs b/runtime/bifrost-polkadot/src/evm/evm_fee.rs new file mode 100644 index 000000000..ee4ecae00 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm_fee.rs @@ -0,0 +1,202 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::Currencies; +use bifrost_primitives::{AccountFeeCurrency, Balance, CurrencyId}; +use bifrost_runtime_common::Ratio; +use frame_support::traits::{ + tokens::{Fortitude, Precision, Preservation}, + Get, OnUnbalanced, TryDrop, +}; +use orml_traits::MultiCurrency; +use pallet_evm::{AddressMapping, Error, OnChargeEVMTransaction}; +use sp_core::{H160, U256}; +use sp_runtime::{ + helpers_128bit::multiply_by_rational_with_rounding, + traits::{Convert, UniqueSaturatedInto}, + Rounding, +}; +use sp_std::marker::PhantomData; + +#[derive(Copy, Clone, Default)] +pub struct EvmPaymentInfo { + amount: Balance, + currency_id: CurrencyId, + price: Ratio, +} + +impl EvmPaymentInfo { + pub fn merge(self, other: Self) -> Self { + EvmPaymentInfo { + amount: self.amount.saturating_add(other.amount), + currency_id: self.currency_id, + price: self.price, + } + } +} + +impl TryDrop for EvmPaymentInfo { + fn try_drop(self) -> Result<(), Self> { + if self.amount == 0 { + Ok(()) + } else { + Err(self) + } + } +} + +/// Implements the transaction payment for EVM transactions. +/// Supports multi-currency fees based on what is provided by AC - account currency. +pub struct TransferEvmFees(PhantomData<(OU, AC, EC, C, MC)>); + +impl OnChargeEVMTransaction for TransferEvmFees +where + T: pallet_evm::Config, + OU: OnUnbalanced, + U256: UniqueSaturatedInto, + AC: AccountFeeCurrency, // AccountCurrency + EC: Get, // Evm default fee asset + C: Convert<(CurrencyId, CurrencyId, Balance), Option<(Balance, Ratio)>>, /* Conversion from + * default fee + * asset to account + * currency */ + U256: UniqueSaturatedInto, + MC: frame_support::traits::tokens::fungibles::Mutate< + T::AccountId, + AssetId = CurrencyId, + Balance = Balance, + > + frame_support::traits::tokens::fungibles::Inspect< + T::AccountId, + AssetId = CurrencyId, + Balance = Balance, + >, + sp_runtime::AccountId32: From<::AccountId>, +{ + type LiquidityInfo = Option; + + fn withdraw_fee(who: &H160, fee: U256) -> Result> { + if fee.is_zero() { + return Ok(None); + } + let account_id = T::AddressMapping::into_account_id(*who); + let fee_currency = AC::get(&account_id); + + let Some((converted, price)) = + C::convert((EC::get(), fee_currency, fee.unique_saturated_into())) + else { + return Err(Error::::WithdrawFailed); + }; + + // Ensure that converted fee is not zero + if converted == 0 { + return Err(Error::::WithdrawFailed); + } + + let burned = MC::burn_from( + fee_currency, + &account_id, + converted, + Preservation::Expendable, + Precision::Exact, + Fortitude::Polite, + ) + .map_err(|_| Error::::BalanceLow)?; + + Ok(Some(EvmPaymentInfo { amount: burned, currency_id: fee_currency, price })) + } + + fn correct_and_deposit_fee( + who: &H160, + corrected_fee: U256, + _base_fee: U256, + already_withdrawn: Self::LiquidityInfo, + ) -> Self::LiquidityInfo { + if let Some(paid) = already_withdrawn { + let account_id = T::AddressMapping::into_account_id(*who); + + // fee / weth = amounts[1] / amounts[0] + // fee = weth * amounts[1] / amounts[0] + let adjusted_paid = if let Some(converted_corrected_fee) = + multiply_by_rational_with_rounding( + corrected_fee.unique_saturated_into(), + paid.price.n, + paid.price.d, + Rounding::Up, + ) { + // Calculate how much refund we should return + let refund_amount = paid.amount.saturating_sub(converted_corrected_fee); + + // refund to the account that paid the fees. If this fails, the + // account might have dropped below the existential balance. In + // that case we don't refund anything. + let result = MC::mint_into(paid.currency_id, &account_id, refund_amount); + + let refund_imbalance = if let Ok(amount) = result { + // Ensure that we minted all amount, in case of partial refund for some reason, + // refund the difference back to treasury + debug_assert_eq!(amount, refund_amount); + refund_amount.saturating_sub(amount) + } else { + // If error, we refund the whole amount back to treasury + refund_amount + }; + // figure out how much is left to mint back + // refund_amount already minted back to account, imbalance is what is left to mint + // if any + paid.amount.saturating_sub(refund_amount).saturating_add(refund_imbalance) + } else { + // if conversion failed for some reason, we refund the whole amount back to treasury + paid.amount + }; + + // We can simply refund all the remaining amount back to treasury + OU::on_unbalanced(EvmPaymentInfo { + amount: adjusted_paid, + currency_id: paid.currency_id, + price: paid.price, + }); + return None; + } + None + } + + fn pay_priority_fee(tip: Self::LiquidityInfo) { + if let Some(tip) = tip { + OU::on_unbalanced(tip); + } + } +} + +pub struct DepositEvmFeeToTreasury; +impl OnUnbalanced for DepositEvmFeeToTreasury { + // this is called for substrate-based transactions + fn on_unbalanceds(amounts: impl Iterator) { + Self::on_unbalanced(amounts.fold(EvmPaymentInfo::default(), |i, x| x.merge(i))) + } + + // this is called from pallet_evm for Ethereum-based transactions + // (technically, it calls on_unbalanced, which calls this when non-zero) + fn on_nonzero_unbalanced(payment_info: EvmPaymentInfo) { + let result = Currencies::deposit( + payment_info.currency_id, + &crate::BifrostTreasuryAccount::get(), + payment_info.amount, + ); + debug_assert_eq!(result, Ok(())); + } +} diff --git a/runtime/bifrost-polkadot/src/evm/mod.rs b/runtime/bifrost-polkadot/src/evm/mod.rs new file mode 100644 index 000000000..db779492e --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/mod.rs @@ -0,0 +1,165 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use frame_support::{pallet_prelude::Get, parameter_types, traits::FindAuthor, ConsensusEngineId}; +use orml_tokens::CurrencyAdapter; +use pallet_ethereum::PostLogContent; +use pallet_evm::EnsureAddressTruncated; +use pallet_transaction_payment::Multiplier; +use primitive_types::U256; + +use bifrost_primitives::{currency::WETH, CurrencyId}; +use bifrost_runtime_common::price::{ + ConvertAmount, FeeAssetBalanceInCurrency, OraclePriceProvider, +}; + +pub use crate::evm::accounts_conversion::{ExtendedAddressMapping, FindAuthorTruncated}; +use crate::{ + evm::runner::WrapRunner, governance::TechAdminOrCouncil, Aura, ConstU32, DynamicFee, + EVMChainId, Prices, Runtime, RuntimeEvent, Timestamp, Weight, EVM, MAXIMUM_BLOCK_WEIGHT, + NORMAL_DISPATCH_RATIO, WEIGHT_REF_TIME_PER_SECOND, +}; + +mod accounts_conversion; +mod evm_fee; +pub mod precompiles; +mod runner; + +// Current approximation of the gas per second consumption considering +// EVM execution over compiled WASM (on 4.4Ghz CPU). +// Given the 500ms Weight, from which 75% only are used for transactions, +// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 ~= +// 15_000_000. +pub const GAS_PER_SECOND: u64 = 40_000_000; +// Approximate ratio of the amount of Weight per Gas. +const WEIGHT_PER_GAS: u64 = WEIGHT_REF_TIME_PER_SECOND / GAS_PER_SECOND; + +parameter_types! { + // We allow for a 75% fullness of a 0.5s block + pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / +WEIGHT_PER_GAS); + pub PrecompilesValue: precompiles::BifrostPrecompiles = +precompiles::BifrostPrecompiles::<_>::new(); + pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); +} + +pub struct WethAssetId; +impl Get for WethAssetId { + fn get() -> CurrencyId { + WETH + } +} + +type WethCurrency = CurrencyAdapter; + +pub struct TransactionPaymentMultiplier; + +impl Get for TransactionPaymentMultiplier { + fn get() -> Multiplier { + crate::TransactionPayment::next_fee_multiplier() + } +} + +parameter_types! { + /// The amount of gas per pov. A ratio of 4 if we convert ref_time to gas and we compare + /// it with the pov_size for a block. E.g. + /// ceil( + /// (max_extrinsic.ref_time() / max_extrinsic.proof_size()) / WEIGHT_PER_GAS + /// ) + pub const GasLimitPovSizeRatio: u64 = 4; + /// The amount of gas per storage (in bytes): BLOCK_GAS_LIMIT / BLOCK_STORAGE_LIMIT + /// The current definition of BLOCK_STORAGE_LIMIT is 40 KB, resulting in a value of 366. + pub GasLimitStorageGrowthRatio: u64 = 366; + + pub const SuicideQuickClearLimit: u32 = 0; +} + +impl pallet_evm::Config for Runtime { + type FeeCalculator = DynamicFee; + type GasWeightMapping = pallet_evm::FixedGasWeightMapping; + type WeightPerGas = WeightPerGas; + type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; + type CallOrigin = EnsureAddressTruncated; + type WithdrawOrigin = EnsureAddressTruncated; + type AddressMapping = ExtendedAddressMapping; + type Currency = WethCurrency; + type RuntimeEvent = RuntimeEvent; + type PrecompilesType = precompiles::BifrostPrecompiles; + type PrecompilesValue = PrecompilesValue; + type ChainId = EVMChainId; + type BlockGasLimit = BlockGasLimit; + type Runner = WrapRunner< + Self, + pallet_evm::runner::stack::Runner, // Evm runner that we wrap + FeeAssetBalanceInCurrency< + crate::Runtime, + ConvertAmount>, + crate::FlexibleFee, // Get account's fee payment asset + crate::Currencies, // Account balance inspector + >, + >; + type OnChargeTransaction = evm_fee::TransferEvmFees< + evm_fee::DepositEvmFeeToTreasury, + crate::FlexibleFee, // Get account's fee payment asset + WethAssetId, + ConvertAmount>, + crate::Currencies, // Multi currency support + >; + type OnCreate = (); + type FindAuthor = FindAuthorTruncated; + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type SuicideQuickClearLimit = SuicideQuickClearLimit; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; +} + +impl pallet_evm_chain_id::Config for Runtime {} + +parameter_types! { + pub const PostBlockAndTxnHashes: PostLogContent = PostLogContent::BlockAndTxnHashes; +} + +impl pallet_ethereum::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type StateRoot = pallet_ethereum::IntermediateStateRoot; + type PostLogContent = PostBlockAndTxnHashes; + type ExtraDataLength = ConstU32<30>; +} + +pub struct EvmNonceProvider; +impl pallet_evm_accounts::EvmNonceProvider for EvmNonceProvider { + fn get_nonce(evm_address: sp_core::H160) -> U256 { + EVM::account_basic(&evm_address).0.nonce + } +} + +impl pallet_evm_accounts::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type FeeMultiplier = ConstU32<50>; + type EvmNonceProvider = EvmNonceProvider; + type ControllerOrigin = TechAdminOrCouncil; + type WeightInfo = (); +} + +parameter_types! { + pub BoundDivision: U256 = U256::from(1024); +} + +impl pallet_dynamic_fee::Config for Runtime { + type MinGasPriceBoundDivisor = BoundDivision; +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/costs.rs b/runtime/bifrost-polkadot/src/evm/precompiles/costs.rs new file mode 100644 index 000000000..adb0259f1 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/costs.rs @@ -0,0 +1,43 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Cost calculations. +use crate::evm::precompiles::EvmResult; +use pallet_evm::{ExitError, PrecompileFailure}; + +// Cost calculation is copied from EVM code that is not publicly exposed by the crates. +// https://github.com/rust-blockchain/evm/blob/master/gasometer/src/costs.rs#L148 +pub fn log_costs(topics: usize, data_len: usize) -> EvmResult { + const G_LOG: u64 = 375; + const G_LOGDATA: u64 = 8; + const G_LOGTOPIC: u64 = 375; + + let topic_cost = G_LOGTOPIC + .checked_mul(topics as u64) + .ok_or(PrecompileFailure::Error { exit_status: ExitError::OutOfGas })?; + + let data_cost = G_LOGDATA + .checked_mul(data_len as u64) + .ok_or(PrecompileFailure::Error { exit_status: ExitError::OutOfGas })?; + + G_LOG + .checked_add(topic_cost) + .ok_or(PrecompileFailure::Error { exit_status: ExitError::OutOfGas })? + .checked_add(data_cost) + .ok_or(PrecompileFailure::Error { exit_status: ExitError::OutOfGas }) +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/erc20_mapping.rs b/runtime/bifrost-polkadot/src/evm/precompiles/erc20_mapping.rs new file mode 100644 index 000000000..763b3275b --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/erc20_mapping.rs @@ -0,0 +1,77 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::evm::precompiles::EvmAddress; +use bifrost_primitives::CurrencyId; +use parity_scale_codec::{Decode, Encode}; +use primitive_types::H160; + +pub const CURRENCY_PRECOMPILE_ADDRESS_PREFIX: &[u8] = &[255u8; 4]; + +/// A mapping between AssetId and Erc20 EVM address. +pub trait Erc20Mapping { + fn encode_evm_address(currency_id: CurrencyId) -> Option; + + fn decode_evm_address(evm_address: EvmAddress) -> Option; +} + +pub struct BifrostErc20Mapping; + +/// Erc20Mapping logic for HydraDX +/// The asset id (with type u32) is encoded in the last 4 bytes of EVM address +impl Erc20Mapping for BifrostErc20Mapping { + fn encode_evm_address(currency_id: CurrencyId) -> Option { + let asset_id_bytes = currency_id.encode(); + + let mut evm_address_bytes = [0u8; 20]; + + evm_address_bytes[0..4].copy_from_slice(CURRENCY_PRECOMPILE_ADDRESS_PREFIX); + match currency_id { + CurrencyId::VSBond(..) | CurrencyId::VSBond2(..) => + evm_address_bytes[6..].copy_from_slice(asset_id_bytes.as_slice()), + CurrencyId::LPToken(..) => + evm_address_bytes[15..].copy_from_slice(asset_id_bytes.as_slice()), + _ => evm_address_bytes[18..].copy_from_slice(asset_id_bytes.as_slice()), + }; + + Some(EvmAddress::from(evm_address_bytes)) + } + + fn decode_evm_address(evm_address: EvmAddress) -> Option { + if !is_asset_address(evm_address) { + return None; + } + + let mut currency_id = &evm_address.to_fixed_bytes()[6..]; + if !currency_id.to_vec().starts_with(&[0, 0]) { + return CurrencyId::decode(&mut currency_id).ok(); + }; + + let mut currency_id = &evm_address.to_fixed_bytes()[15..]; + if !currency_id.to_vec().starts_with(&[0, 0]) { + return CurrencyId::decode(&mut currency_id).ok(); + }; + + let mut currency_id = &evm_address.to_fixed_bytes()[18..]; + CurrencyId::decode(&mut currency_id).ok() + } +} + +pub fn is_asset_address(address: H160) -> bool { + &address.to_fixed_bytes()[0..4] == CURRENCY_PRECOMPILE_ADDRESS_PREFIX +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/handle.rs b/runtime/bifrost-polkadot/src/evm/precompiles/handle.rs new file mode 100644 index 000000000..0eeb42343 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/handle.rs @@ -0,0 +1,467 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::evm::precompiles::{costs, revert, Address, Bytes, EvmResult}; +use pallet_evm::{Context, Log, PrecompileHandle}; +use primitive_types::{H160, H256, U256}; +use smallvec::alloc; +use sp_std::{borrow::ToOwned, vec, vec::Vec}; + +/// Wrapper around an EVM input slice, helping to parse it. +/// Provide functions to parse common types. +#[derive(Clone, Copy, Debug)] +pub struct EvmDataReader<'a> { + input: &'a [u8], + cursor: usize, +} + +#[derive(Clone, Debug)] +pub struct EvmDataWriter { + pub(crate) data: Vec, + offset_data: Vec, + selector: Option, +} + +impl EvmDataWriter { + /// Creates a new empty output builder (without selector). + pub fn new() -> Self { + Self { data: vec![], offset_data: vec![], selector: None } + } + + /// Return the built data. + pub fn build(mut self) -> Vec { + Self::bake_offsets(&mut self.data, self.offset_data); + + if let Some(selector) = self.selector { + let mut output = selector.to_be_bytes().to_vec(); + output.append(&mut self.data); + output + } else { + self.data + } + } + + /// Add offseted data at the end of this writer's data, updating the offsets. + fn bake_offsets(output: &mut Vec, offsets: Vec) { + for mut offset_datum in offsets { + let offset_position = offset_datum.offset_position; + let offset_position_end = offset_position + 32; + + // The offset is the distance between the start of the data and the + // start of the pointed data (start of a struct, length of an array). + // Offsets in inner data are relative to the start of their respective "container". + // However in arrays the "container" is actually the item itself instead of the whole + // array, which is corrected by `offset_shift`. + let free_space_offset = output.len() - offset_datum.offset_shift; + + // Override dummy offset to the offset it will be in the final output. + U256::from(free_space_offset) + .to_big_endian(&mut output[offset_position..offset_position_end]); + + // Append this data at the end of the current output. + output.append(&mut offset_datum.data); + } + } + + /// Write arbitrary bytes. + /// Doesn't handle any alignement checks, prefer using `write` instead if possible. + fn write_raw_bytes(mut self, value: &[u8]) -> Self { + self.data.extend_from_slice(value); + self + } + + /// Write data of requested type. + pub fn write(mut self, value: T) -> Self { + T::write(&mut self, value); + self + } + + /// Writes a pointer to given data. + /// The data will be appended when calling `build`. + /// Initially write a dummy value as offset in this writer's data, which will be replaced by + /// the correct offset once the pointed data is appended. + /// + /// Takes `&mut self` since its goal is to be used inside `EvmData` impl and not in chains. + pub fn write_pointer(&mut self, data: Vec) { + let offset_position = self.data.len(); + H256::write(self, H256::repeat_byte(0xff)); + + self.offset_data.push(OffsetDatum { offset_position, data, offset_shift: 0 }); + } +} + +impl Default for EvmDataWriter { + fn default() -> Self { + Self::new() + } +} + +#[derive(Clone, Debug)] +struct OffsetDatum { + // Offset location in the container data. + offset_position: usize, + // Data pointed by the offset that must be inserted at the end of container data. + data: Vec, + // Inside of arrays, the offset is not from the start of array data (length), but from the + // start of the item. This shift allow to correct this. + offset_shift: usize, +} + +/// Data that can be converted from and to EVM data types. +pub trait EvmData: Sized { + fn read(reader: &mut EvmDataReader) -> EvmResult; + fn write(writer: &mut EvmDataWriter, value: Self); + fn has_static_size() -> bool; +} + +impl EvmData for U256 { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let range = reader.move_cursor(32)?; + + let data = reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse U256 out of bounds"))?; + + Ok(U256::from_big_endian(data)) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + let mut buffer = [0u8; 32]; + value.to_big_endian(&mut buffer); + writer.data.extend_from_slice(&buffer); + } + + fn has_static_size() -> bool { + true + } +} + +impl EvmData for H256 { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let range = reader.move_cursor(32)?; + + let data = reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse H256 out of bounds"))?; + + Ok(H256::from_slice(data)) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + writer.data.extend_from_slice(value.as_bytes()); + } + + fn has_static_size() -> bool { + true + } +} + +impl EvmData for Bytes { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let mut inner_reader = reader.read_pointer()?; + + // Read bytes/string size. + let array_size: usize = inner_reader + .read::() + .map_err(|_| revert("tried to parse bytes/string length out of bounds"))? + .try_into() + .map_err(|_| revert("bytes/string length is too large"))?; + + // Get valid range over the bytes data. + let range = inner_reader.move_cursor(array_size)?; + + let data = inner_reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse bytes/string out of bounds"))?; + + let bytes = Self(data.to_owned()); + + Ok(bytes) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + let length = value.0.len(); + + // Pad the data. + // Leave it as is if a multiple of 32, otherwise pad to next + // multiple or 32. + let chunks = length / 32; + let padded_size = match length % 32 { + 0 => chunks * 32, + _ => (chunks + 1) * 32, + }; + + let mut value = value.0.to_vec(); + value.resize(padded_size, 0); + + writer.write_pointer( + EvmDataWriter::new().write(U256::from(length)).write_raw_bytes(&value).build(), + ); + } + + fn has_static_size() -> bool { + false + } +} + +impl EvmData for Address { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let range = reader.move_cursor(32)?; + + let data = reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse H160 out of bounds"))?; + + Ok(H160::from_slice(&data[12..32]).into()) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + H256::write(writer, value.0.into()); + } + + fn has_static_size() -> bool { + true + } +} + +macro_rules! impl_evmdata_for_uints { + ($($uint:ty, )*) => { + $( + impl EvmData for $uint { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let value256: U256 = reader.read()?; + + value256 + .try_into() + .map_err(|_| revert(alloc::format!( + "value too big for type", + ))) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + U256::write(writer, value.into()); + } + + fn has_static_size() -> bool { + true + } + } + )* + }; +} + +impl_evmdata_for_uints!(u8, u16, u32, u64, u128,); + +impl EvmData for bool { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let h256 = H256::read(reader).map_err(|_| revert("tried to parse bool out of bounds"))?; + + Ok(!h256.is_zero()) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + let mut buffer = [0u8; 32]; + if value { + buffer[31] = 1; + } + + writer.data.extend_from_slice(&buffer); + } + + fn has_static_size() -> bool { + true + } +} + +impl<'a> EvmDataReader<'a> { + /// Create a new input parser. + pub fn new(input: &'a [u8]) -> Self { + Self { input, cursor: 0 } + } + + /// Create a new input parser from a selector-initial input. + pub fn read_selector(input: &'a [u8]) -> EvmResult + where + T: num_enum::TryFromPrimitive, + { + if input.len() < 4 { + return Err(revert("tried to parse selector out of bounds")); + } + + let mut buffer = [0u8; 4]; + buffer.copy_from_slice(&input[0..4]); + let selector = T::try_from_primitive(u32::from_be_bytes(buffer)).map_err(|_| { + log::trace!( + target: "precompile-utils", + "Failed to match function selector" + //TODO: add type in log + ); + revert("unknown selector") + })?; + + Ok(selector) + } + + /// Create a new input parser from a selector-initial input. + pub fn new_skip_selector(input: &'a [u8]) -> EvmResult { + if input.len() < 4 { + return Err(revert("input is too short")); + } + + Ok(Self::new(&input[4..])) + } + + /// Check the input has at least the correct amount of arguments before the end (32 bytes + /// values). + pub fn expect_arguments(&self, args: usize) -> EvmResult { + if self.input.len() >= self.cursor + args * 32 { + Ok(()) + } else { + Err(revert("input doesn't match expected length")) + } + } + + /// Read data from the input. + pub fn read(&mut self) -> EvmResult { + T::read(self) + } + + /// Reads a pointer, returning a reader targetting the pointed location. + pub fn read_pointer(&mut self) -> EvmResult { + let offset: usize = self + .read::() + .map_err(|_| revert("tried to parse array offset out of bounds"))? + .try_into() + .map_err(|_| revert("array offset is too large"))?; + + if offset >= self.input.len() { + return Err(revert("pointer points out of bounds")); + } + + Ok(Self { input: &self.input[offset..], cursor: 0 }) + } + + /// Move the reading cursor with provided length, and return a range from the previous cursor + /// location to the new one. + /// Checks cursor overflows. + fn move_cursor(&mut self, len: usize) -> EvmResult> { + let start = self.cursor; + let end = self + .cursor + .checked_add(len) + .ok_or_else(|| revert("data reading cursor overflow"))?; + + self.cursor = end; + + Ok(start..end) + } +} + +/// Represents modifiers a Solidity function can be annotated with. +#[derive(Copy, Clone, PartialEq, Eq)] +pub enum FunctionModifier { + /// Function that doesn't modify the state. + View, + /// Function that modifies the state but refuse receiving funds. + /// Correspond to a Solidity function with no modifiers. + NonPayable, + /// Function that modifies the state and accept funds. + Payable, +} + +pub trait PrecompileHandleExt: PrecompileHandle { + /// Record cost of a log manually. + /// This can be useful to record log costs early when their content have static size. + fn record_log_costs_manual(&mut self, topics: usize, data_len: usize) -> EvmResult; + + /// Record cost of logs. + fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult; + + /// Check that a function call is compatible with the context it is + /// called into. + fn check_function_modifier(&self, modifier: FunctionModifier) -> EvmResult; + + /// Read the selector from the input data. + fn read_selector(&self) -> EvmResult + where + T: num_enum::TryFromPrimitive; + + /// Returns a reader of the input, skipping the selector. + fn read_input(&self) -> EvmResult; +} + +impl PrecompileHandleExt for T { + /// Record cost of a log manualy. + /// This can be useful to record log costs early when their content have static size. + fn record_log_costs_manual(&mut self, topics: usize, data_len: usize) -> EvmResult { + self.record_cost(costs::log_costs(topics, data_len)?)?; + + Ok(()) + } + + /// Record cost of logs. + fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult { + for log in logs { + self.record_log_costs_manual(log.topics.len(), log.data.len())?; + } + + Ok(()) + } + + /// Check that a function call is compatible with the context it is + /// called into. + fn check_function_modifier(&self, modifier: FunctionModifier) -> EvmResult { + check_function_modifier(self.context(), self.is_static(), modifier) + } + + /// Read the selector from the input data. + fn read_selector(&self) -> EvmResult + where + S: num_enum::TryFromPrimitive, + { + let input = self.input(); + EvmDataReader::read_selector(input) + } + + /// Returns a reader of the input, skipping the selector. + fn read_input(&self) -> EvmResult { + EvmDataReader::new_skip_selector(self.input()) + } +} + +/// Check that a function call is compatible with the context it is +/// called into. +pub fn check_function_modifier( + context: &Context, + is_static: bool, + modifier: FunctionModifier, +) -> EvmResult { + if is_static && modifier != FunctionModifier::View { + return Err(revert("can't call non-static function in static context")); + } + + if modifier != FunctionModifier::Payable && context.apparent_value > U256::zero() { + return Err(revert("function is not payable")); + } + + Ok(()) +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/mod.rs b/runtime/bifrost-polkadot/src/evm/precompiles/mod.rs new file mode 100644 index 000000000..56fe7ef92 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/mod.rs @@ -0,0 +1,225 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use core::marker::PhantomData; + +use crate::evm::precompiles::{ + erc20_mapping::is_asset_address, multicurrency::MultiCurrencyPrecompile, +}; +use ethabi::Token; +use frame_support::dispatch::{GetDispatchInfo, PostDispatchInfo}; +use hex_literal::hex; +use pallet_evm::{ + ExitRevert, ExitSucceed, IsPrecompileResult, Precompile, PrecompileFailure, PrecompileHandle, + PrecompileOutput, PrecompileResult, PrecompileSet, +}; +use pallet_evm_precompile_blake2::Blake2F; +use pallet_evm_precompile_bn128::{Bn128Add, Bn128Mul, Bn128Pairing}; +use pallet_evm_precompile_modexp::Modexp; +use pallet_evm_precompile_simple::{ECRecover, Identity, Ripemd160, Sha256}; +use parity_scale_codec::Decode; +use primitive_types::{H160, U256}; +use sp_runtime::traits::Dispatchable; +use sp_std::{borrow::ToOwned, vec::Vec}; + +pub mod costs; +pub mod erc20_mapping; +pub mod handle; +pub mod multicurrency; +pub mod substrate; + +pub type EvmResult = Result; + +#[cfg(test)] +mod tests; + +pub type EvmAddress = H160; + +/// The `address` type of Solidity. +/// H160 could represent 2 types of data (bytes20 and address) that are not encoded the same way. +/// To avoid issues writing H160 is thus not supported. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct Address(pub H160); + +impl From for Address { + fn from(a: H160) -> Address { + Address(a) + } +} + +impl From

for H160 { + fn from(a: Address) -> H160 { + a.0 + } +} + +pub struct BifrostPrecompiles(PhantomData); + +impl BifrostPrecompiles { + #[allow(clippy::new_without_default)] // We'll never use Default and can't derive it. + pub fn new() -> Self { + Self(Default::default()) + } +} + +// Same as Moonbean and Centrifuge, should benefit interoperability +// See also +// https://docs.moonbeam.network/builders/pallets-precompiles/precompiles/overview/#precompiled-contract-addresses +const DISPATCH_ADDR: H160 = addr(1025); + +pub const ECRECOVER: H160 = H160(hex!("0000000000000000000000000000000000000001")); +pub const SHA256: H160 = H160(hex!("0000000000000000000000000000000000000002")); +pub const RIPEMD: H160 = H160(hex!("0000000000000000000000000000000000000003")); +pub const IDENTITY: H160 = H160(hex!("0000000000000000000000000000000000000004")); +pub const MODEXP: H160 = H160(hex!("0000000000000000000000000000000000000005")); +pub const BN_ADD: H160 = H160(hex!("0000000000000000000000000000000000000006")); +pub const BN_MUL: H160 = H160(hex!("0000000000000000000000000000000000000007")); +pub const BN_PAIRING: H160 = H160(hex!("0000000000000000000000000000000000000008")); +pub const BLAKE2F: H160 = H160(hex!("0000000000000000000000000000000000000009")); + +pub const ETH_PRECOMPILE_END: H160 = BLAKE2F; + +fn is_standard_precompile(address: H160) -> bool { + !address.is_zero() && address <= ETH_PRECOMPILE_END +} + +impl PrecompileSet for BifrostPrecompiles +where + R: pallet_evm::Config + bifrost_currencies::Config, + R::RuntimeCall: Dispatchable + GetDispatchInfo + Decode, + ::RuntimeOrigin: From>, + MultiCurrencyPrecompile: Precompile, +{ + fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { + let context = handle.context(); + let address = handle.code_address(); + + // Filter known precompile addresses except Ethereum officials + if address > ETH_PRECOMPILE_END && context.address != address { + return Some(Err(PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: "cannot be called with DELEGATECALL or CALLCODE".into(), + })); + } + + if address == ECRECOVER { + Some(ECRecover::execute(handle)) + } else if address == SHA256 { + Some(Sha256::execute(handle)) + } else if address == RIPEMD { + Some(Ripemd160::execute(handle)) + } else if address == IDENTITY { + Some(Identity::execute(handle)) + } else if address == MODEXP { + Some(Modexp::execute(handle)) + } else if address == BN_ADD { + Some(Bn128Add::execute(handle)) + } else if address == BN_MUL { + Some(Bn128Mul::execute(handle)) + } else if address == BN_PAIRING { + Some(Bn128Pairing::execute(handle)) + } else if address == BLAKE2F { + Some(Blake2F::execute(handle)) + } else if address == DISPATCH_ADDR { + Some(pallet_evm_precompile_dispatch::Dispatch::::execute(handle)) + } else if is_asset_address(address) { + Some(MultiCurrencyPrecompile::::execute(handle)) + } else { + None + } + } + + fn is_precompile(&self, address: H160, _remaining_gas: u64) -> IsPrecompileResult { + let is_precompile = address == DISPATCH_ADDR || + is_asset_address(address) || + is_standard_precompile(address); + IsPrecompileResult::Answer { is_precompile, extra_cost: 0 } + } +} + +// This is a reimplementation of the upstream u64->H160 conversion +// function, made `const` to make our precompile address `const`s a +// bit cleaner. It can be removed when upstream has a const conversion +// function. +pub const fn addr(a: u64) -> H160 { + let b = a.to_be_bytes(); + H160([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]]) +} + +pub fn revert(output: impl AsRef<[u8]>) -> PrecompileFailure { + PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: output.as_ref().to_owned(), + } +} + +pub fn succeed(output: impl AsRef<[u8]>) -> PrecompileOutput { + PrecompileOutput { exit_status: ExitSucceed::Returned, output: output.as_ref().to_owned() } +} + +pub struct Output; + +impl Output { + pub fn encode_uint(b: T) -> Vec + where + U256: From, + { + ethabi::encode(&[Token::Uint(U256::from(b))]) + } + + pub fn encode_bytes(b: &[u8]) -> Vec { + ethabi::encode(&[Token::Bytes(b.to_vec())]) + } +} + +/// The `bytes`/`string` type of Solidity. +/// It is different from `Vec` which will be serialized with padding for each `u8` element +/// of the array, while `Bytes` is tightly packed. +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Bytes(pub Vec); + +impl Bytes { + /// Interpret as `bytes`. + pub fn as_bytes(&self) -> &[u8] { + &self.0 + } + + /// Interpret as `string`. + /// Can fail if the string is not valid UTF8. + pub fn as_str(&self) -> Result<&str, sp_std::str::Utf8Error> { + sp_std::str::from_utf8(&self.0) + } +} + +impl From<&[u8]> for Bytes { + fn from(a: &[u8]) -> Self { + Self(a.to_owned()) + } +} + +impl From<&str> for Bytes { + fn from(a: &str) -> Self { + a.as_bytes().into() + } +} + +impl From for Vec { + fn from(val: Bytes) -> Self { + val.0 + } +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/multicurrency.rs b/runtime/bifrost-polkadot/src/evm/precompiles/multicurrency.rs new file mode 100644 index 000000000..85c571694 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/multicurrency.rs @@ -0,0 +1,244 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::{ + evm::{ + precompiles::{ + erc20_mapping::{BifrostErc20Mapping, Erc20Mapping}, + handle::{EvmDataWriter, FunctionModifier, PrecompileHandleExt}, + substrate::RuntimeHelper, + succeed, Address, Output, + }, + ExtendedAddressMapping, + }, + Currencies, +}; +use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{Balance, CurrencyId, CurrencyIdMapping}; +use frame_support::traits::OriginTrait; +use num_enum::{IntoPrimitive, TryFromPrimitive}; +use orml_traits::{MultiCurrency as MultiCurrencyT, MultiCurrency}; +use pallet_evm::{ + AddressMapping, ExitRevert, Precompile, PrecompileFailure, PrecompileHandle, PrecompileResult, +}; +use primitive_types::H160; +use sp_runtime::{traits::Dispatchable, RuntimeDebug}; +use sp_std::{marker::PhantomData, prelude::*}; + +#[module_evm_utility_macro::generate_function_selector] +#[derive(RuntimeDebug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)] +#[repr(u32)] +pub enum Action { + Name = "name()", + Symbol = "symbol()", + Decimals = "decimals()", + TotalSupply = "totalSupply()", + BalanceOf = "balanceOf(address)", + Allowance = "allowance(address,address)", + Transfer = "transfer(address,uint256)", + Approve = "approve(address,uint256)", + TransferFrom = "transferFrom(address,address,uint256)", +} +pub struct MultiCurrencyPrecompile(PhantomData); + +impl Precompile for MultiCurrencyPrecompile +where + Runtime: frame_system::Config + + pallet_evm::Config + + bifrost_asset_registry::Config + + bifrost_currencies::Config, + <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, + Currencies: MultiCurrency, + bifrost_currencies::Pallet: + MultiCurrency, + ::AccountId: core::convert::From, + <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, +{ + fn execute(handle: &mut impl PrecompileHandle) -> pallet_evm::PrecompileResult { + let address = handle.code_address(); + if let Some(asset_id) = BifrostErc20Mapping::decode_evm_address(address) { + log::debug!(target: "evm", "multicurrency: currency id: {:?}", asset_id); + + let selector = match handle.read_selector() { + Ok(selector) => selector, + Err(e) => return Err(e), + }; + + handle.check_function_modifier(match selector { + Action::Transfer => FunctionModifier::NonPayable, + _ => FunctionModifier::View, + })?; + + return match selector { + Action::Name => Self::name(asset_id, handle), + Action::Symbol => Self::symbol(asset_id, handle), + Action::Decimals => Self::decimals(asset_id, handle), + Action::TotalSupply => Self::total_supply(asset_id, handle), + Action::BalanceOf => Self::balance_of(asset_id, handle), + Action::Transfer => Self::transfer(asset_id, handle), + Action::Allowance => Self::not_supported(asset_id, handle), + Action::Approve => Self::not_supported(asset_id, handle), + Action::TransferFrom => Self::not_supported(asset_id, handle), + }; + } + Err(PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: "invalid currency id".into(), + }) + } +} + +impl MultiCurrencyPrecompile +where + Runtime: frame_system::Config + + pallet_evm::Config + + bifrost_asset_registry::Config + + bifrost_currencies::Config, + Currencies: MultiCurrency, + bifrost_currencies::Pallet: + MultiCurrency, + ::AccountId: core::convert::From, + <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, +{ + fn name(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + match AssetIdMaps::::get_currency_metadata(currency_id) { + Some(metadata) => { + let encoded = Output::encode_bytes(metadata.name.as_slice()); + Ok(succeed(encoded)) + }, + None => Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("Non-existing asset.".into()), + }), + } + } + + fn symbol(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + match AssetIdMaps::::get_currency_metadata(currency_id) { + Some(metadata) => { + let encoded = Output::encode_bytes(metadata.symbol.as_slice()); + Ok(succeed(encoded)) + }, + None => Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("Non-existing asset.".into()), + }), + } + } + + fn decimals(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + match AssetIdMaps::::get_currency_metadata(currency_id) { + Some(metadata) => { + let encoded = Output::encode_uint::(metadata.decimals); + Ok(succeed(encoded)) + }, + None => Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("Non-existing asset.".into()), + }), + } + } + + fn total_supply( + currency_id: CurrencyId, + handle: &mut impl PrecompileHandle, + ) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + let total_issuance = Currencies::total_issuance(currency_id); + + log::debug!(target: "evm", "multicurrency: totalSupply: {:?}", total_issuance); + + let encoded = Output::encode_uint::(total_issuance); + + Ok(succeed(encoded)) + } + + fn balance_of(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let mut input = handle.read_input()?; + input.expect_arguments(1)?; + + let owner: H160 = input.read::
()?.into(); + let who: Runtime::AccountId = ExtendedAddressMapping::into_account_id(owner).into(); //TODO: use pallet? + + let free_balance = Currencies::free_balance(currency_id, &who); + + log::debug!(target: "evm", "multicurrency: balanceOf: {:?}", free_balance); + + let encoded = Output::encode_uint::(free_balance); + + Ok(succeed(encoded)) + } + + fn transfer(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let mut input = handle.read_input()?; + input.expect_arguments(2)?; + + let to: H160 = input.read::
()?.into(); + let amount = input.read::()?; + + let origin = ExtendedAddressMapping::into_account_id(handle.context().caller); + let to = ExtendedAddressMapping::into_account_id(to); + + log::debug!(target: "evm", "multicurrency: transfer from: {:?}, to: {:?}, amount: {:?}", origin, to, amount); + + as MultiCurrency>::transfer( + currency_id, + &(>::into(origin)), + &(>::into(to)), + amount, + ) + .map_err(|e| PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: Into::<&str>::into(e).as_bytes().to_vec(), + })?; + + Ok(succeed(EvmDataWriter::new().write(true).build())) + } + + fn not_supported(_: CurrencyId, _: &mut impl PrecompileHandle) -> PrecompileResult { + Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("not supported".into()), + }) + } +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/substrate.rs b/runtime/bifrost-polkadot/src/evm/precompiles/substrate.rs new file mode 100644 index 000000000..b3214c822 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/substrate.rs @@ -0,0 +1,43 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Utils related to Substrate features: +//! - Substrate call dispatch. +//! - Substrate DB read and write costs + +use core::marker::PhantomData; +use frame_support::{traits::Get, weights::Weight}; +use pallet_evm::GasWeightMapping; + +/// Helper functions requiring a Substrate runtime. +/// This runtime must of course implement `pallet_evm::Config`. +#[derive(Clone, Copy, Debug)] +pub struct RuntimeHelper(PhantomData); + +impl RuntimeHelper +where + Runtime: pallet_evm::Config + frame_system::Config, +{ + /// Cost of a Substrate DB read in gas. + pub fn db_read_gas_cost() -> u64 { + ::GasWeightMapping::weight_to_gas(Weight::from_parts( + ::DbWeight::get().read, + 0, + )) + } +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/tests/erc20_mapping.rs b/runtime/bifrost-polkadot/src/evm/precompiles/tests/erc20_mapping.rs new file mode 100644 index 000000000..266a062f2 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/tests/erc20_mapping.rs @@ -0,0 +1,113 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::evm::precompiles::erc20_mapping::{BifrostErc20Mapping, Erc20Mapping}; +use bifrost_primitives::{ + CurrencyId, TokenSymbol, + TokenSymbol::{BNC, KSM}, +}; +use hex_literal::hex; +use primitive_types::H160; + +macro_rules! encode { + ($asset_id:expr) => {{ + BifrostErc20Mapping::encode_evm_address($asset_id).unwrap() + }}; +} + +macro_rules! decode { + ($evm_address:expr) => {{ + BifrostErc20Mapping::decode_evm_address(H160::from($evm_address)).unwrap() + }}; +} + +macro_rules! decode_optional { + ($evm_address:expr) => {{ + BifrostErc20Mapping::decode_evm_address(H160::from($evm_address)) + }}; +} + +#[test] +fn decode_asset_id_from_evm_address_should_work() { + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000001")), CurrencyId::Native(BNC)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000800")), CurrencyId::Token2(0)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000900")), CurrencyId::VToken2(0)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000204")), CurrencyId::Token(KSM)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000104")), CurrencyId::VToken(KSM)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000404")), CurrencyId::VSToken(KSM)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000a00")), CurrencyId::VSToken2(0)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000a00")), CurrencyId::VSToken2(0)); + assert_eq!( + decode!(hex!("ffffffff00000b00000000000000000000000000")), + CurrencyId::VSBond2(0, 0, 0, 0) + ); + assert_eq!( + decode!(hex!("ffffffff00000501000000000000000000000000")), + CurrencyId::VSBond(TokenSymbol::BNC, 0, 0, 0) + ); + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000601000300")), + CurrencyId::LPToken(TokenSymbol::BNC, 0, TokenSymbol::DOT, 0) + ); +} + +#[test] +fn decode_asset_id_from_evm_address_should_not_work_with_invalid_asset_addresses() { + assert_eq!(decode_optional!(hex!("0000000000000000000000000000000200000000")), None); + assert_eq!(decode_optional!(hex!("0000000000000000000000000000000000000001")), None); + assert_eq!(decode_optional!(hex!("90000000000000000000000000000001ffffffff")), None); + assert_eq!(decode_optional!(hex!("0000000000000000000000000000001100000003")), None); + assert_eq!(decode_optional!(hex!("0000000000000000900000000000000100000003")), None); + assert_eq!(decode_optional!(hex!("7777777777777777777777777777777777777777")), None); +} + +#[test] +fn encode_asset_id_to_evm_address_should_work() { + assert_eq!( + encode!(CurrencyId::Native(BNC)), + H160::from(hex!("ffffffff00000000000000000000000000000001")) + ); + assert_eq!( + encode!(CurrencyId::Token2(0)), + H160::from(hex!("ffffffff00000000000000000000000000000800")) + ); + assert_eq!( + encode!(CurrencyId::VToken2(0)), + H160::from(hex!("ffffffff00000000000000000000000000000900")) + ); + assert_eq!( + encode!(CurrencyId::Token(KSM)), + H160::from(hex!("ffffffff00000000000000000000000000000204")) + ); + assert_eq!( + encode!(CurrencyId::VToken(KSM)), + H160::from(hex!("ffffffff00000000000000000000000000000104")) + ); + assert_eq!( + encode!(CurrencyId::VSBond2(0, 0, 0, 0)), + H160::from(hex!("ffffffff00000b00000000000000000000000000")) + ); + assert_eq!( + encode!(CurrencyId::LPToken(TokenSymbol::BNC, 0, TokenSymbol::DOT, 0)), + H160::from(hex!("ffffffff00000000000000000000000601000300")) + ); + assert_eq!( + encode!(CurrencyId::VSBond(TokenSymbol::BNC, 0, 0, 0)), + H160::from(hex!("ffffffff00000501000000000000000000000000")) + ); +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/tests/mod.rs b/runtime/bifrost-polkadot/src/evm/precompiles/tests/mod.rs new file mode 100644 index 000000000..3f6a29386 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/tests/mod.rs @@ -0,0 +1,19 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +mod erc20_mapping; diff --git a/runtime/bifrost-polkadot/src/evm/runner.rs b/runtime/bifrost-polkadot/src/evm/runner.rs new file mode 100644 index 000000000..4ad5c4b7f --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/runner.rs @@ -0,0 +1,263 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! EVM stack-based runner. +//! This runner is a wrapper around the default stack-based runner that adds possibility to charge +//! fees in different currencies and to validate transactions based on the account's fee payment +//! asset. +//! +//! Shamelessly copied from pallet-evm and modified to support multi-currency fees. +use crate::{evm::WethAssetId, Weight}; +use bifrost_primitives::{AccountFeeCurrencyBalanceInCurrency, Balance}; +use fp_evm::{Account, TransactionValidationError}; +use frame_support::traits::Get; +use pallet_evm::{ + runner::Runner, AddressMapping, CallInfo, Config, CreateInfo, FeeCalculator, RunnerError, +}; +use primitive_types::{H160, H256, U256}; +use sp_runtime::traits::UniqueSaturatedInto; +use sp_std::vec::Vec; + +pub struct WrapRunner(sp_std::marker::PhantomData<(T, R, B)>); + +impl Runner for WrapRunner +where + T: Config, + R: Runner, + >::Error: core::convert::From, + B: AccountFeeCurrencyBalanceInCurrency, +{ + type Error = R::Error; + + fn validate( + source: H160, + target: Option, + input: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + weight_limit: Option, + proof_size_base_cost: Option, + evm_config: &evm::Config, + ) -> Result<(), RunnerError> { + let (base_fee, mut weight) = T::FeeCalculator::min_gas_price(); + + let evm_currency = WethAssetId::get(); + let account_id = T::AddressMapping::into_account_id(source); + let account_nonce = frame_system::Pallet::::account_nonce(&account_id); + let (balance, b_weight) = B::get_balance_in_currency(evm_currency, &account_id); + + let (source_account, inner_weight) = ( + Account { + nonce: U256::from(UniqueSaturatedInto::::unique_saturated_into( + account_nonce, + )), + balance: U256::from(UniqueSaturatedInto::::unique_saturated_into(balance)), + }, + T::DbWeight::get().reads(1).saturating_add(b_weight), + ); + weight = weight.saturating_add(inner_weight); + + let _ = fp_evm::CheckEvmTransaction::::new( + fp_evm::CheckEvmTransactionConfig { + evm_config, + block_gas_limit: T::BlockGasLimit::get(), + base_fee, + chain_id: T::ChainId::get(), + is_transactional, + }, + fp_evm::CheckEvmTransactionInput { + chain_id: Some(T::ChainId::get()), + to: target, + input, + nonce: nonce.unwrap_or(source_account.nonce), + gas_limit: gas_limit.into(), + gas_price: None, + max_fee_per_gas, + max_priority_fee_per_gas, + value, + access_list, + }, + weight_limit, + proof_size_base_cost, + ) + .validate_in_block_for(&source_account) + .and_then(|v| v.with_base_fee()) + .and_then(|v| v.with_balance_for(&source_account)) + .map_err(|error| RunnerError { error, weight })?; + Ok(()) + } + + fn call( + source: H160, + target: H160, + input: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + Some(target), + input.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + // Validated, flag set to false + R::call( + source, + target, + input, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list, + is_transactional, + false, + weight_limit, + proof_size_base_cost, + config, + ) + } + + fn create( + source: H160, + init: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + None, + init.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + // Validated, flag set to false + R::create( + source, + init, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list, + is_transactional, + false, + weight_limit, + proof_size_base_cost, + config, + ) + } + + fn create2( + source: H160, + init: Vec, + salt: H256, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + None, + init.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + //Validated, flag set to false + R::create2( + source, + init, + salt, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list, + is_transactional, + false, + weight_limit, + proof_size_base_cost, + config, + ) + } +} diff --git a/runtime/bifrost-polkadot/src/governance/fellowship.rs b/runtime/bifrost-polkadot/src/governance/fellowship.rs index 4d520a042..bbcec0fdc 100644 --- a/runtime/bifrost-polkadot/src/governance/fellowship.rs +++ b/runtime/bifrost-polkadot/src/governance/fellowship.rs @@ -26,7 +26,7 @@ use frame_support::traits::{EitherOf, MapSuccess, TryMapSuccess}; use sp_arithmetic::traits::CheckedSub; use sp_runtime::{ morph_types, - traits::{ConstU16, Replace, TypedGet}, + traits::{ConstU16, Replace, ReplaceWithDefault, TypedGet}, }; parameter_types! { @@ -355,8 +355,10 @@ impl pallet_ranked_collective::Config for Runtime type Polls = FellowshipReferenda; type MinRankOfClass = sp_runtime::traits::Identity; type VoteWeight = pallet_ranked_collective::Geometric; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkSetup = (); type MemberSwappedHandler = (); type ExchangeOrigin = EitherOfDiverse; + type AddOrigin = MapSuccess>; + type RemoveOrigin = Self::DemoteOrigin; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkSetup = (); } diff --git a/runtime/bifrost-polkadot/src/governance/referenda.rs b/runtime/bifrost-polkadot/src/governance/referenda.rs index 907a1b3f9..f566b2b7e 100644 --- a/runtime/bifrost-polkadot/src/governance/referenda.rs +++ b/runtime/bifrost-polkadot/src/governance/referenda.rs @@ -35,7 +35,7 @@ impl pallet_conviction_voting::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type Polls = Referenda; - type MaxTurnout = frame_support::traits::TotalIssuanceOf; + type MaxTurnout = frame_support::traits::ActiveIssuanceOf; // Maximum number of concurrent votes an account may have type MaxVotes = ConstU32<512>; // Minimum period of vote locking diff --git a/runtime/bifrost-polkadot/src/governance/tracks.rs b/runtime/bifrost-polkadot/src/governance/tracks.rs index fac57bfc7..613fc32fc 100644 --- a/runtime/bifrost-polkadot/src/governance/tracks.rs +++ b/runtime/bifrost-polkadot/src/governance/tracks.rs @@ -62,10 +62,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] name: "whitelisted_caller", max_deciding: 100, decision_deposit: 5_000 * BNCS, - prepare_period: 15 * MINUTES, + prepare_period: 5 * MINUTES, decision_period: 14 * DAYS, - confirm_period: 10 * MINUTES, - min_enactment_period: 10 * MINUTES, + confirm_period: 5 * MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: Curve::make_reciprocal( 16, 28 * 24, @@ -73,7 +73,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] percent(50), percent(100), ), - min_support: Curve::make_reciprocal(1, 28, percent(8), percent(2), percent(50)), + min_support: Curve::make_reciprocal(1, 1792, percent(3), percent(2), percent(50)), }, ), ( diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 2dce7de4a..ef385bce4 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -28,6 +28,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use bifrost_slp::{DerivativeAccountProvider, QueryResponseManager}; use core::convert::TryInto; +use pallet_traits::evm::InspectEvmAccounts; // A few exports that help ease life for downstream crates. use cumulus_pallet_parachain_system::{RelayNumberStrictlyIncreases, RelaychainDataProvider}; pub use frame_support::{ @@ -51,12 +52,12 @@ pub use pallet_balances::Call as BalancesCall; pub use pallet_timestamp::Call as TimestampCall; use sp_api::impl_runtime_apis; use sp_arithmetic::Percent; -use sp_core::{OpaqueMetadata, U256}; +use sp_core::{OpaqueMetadata, H160, H256, U256}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, Zero}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, DispatchError, DispatchResult, Perbill, Permill, RuntimeDebug, + ApplyExtrinsicResult, DispatchError, DispatchResult, FixedU128, Perbill, Permill, RuntimeDebug, }; use sp_std::{marker::PhantomData, prelude::*}; #[cfg(feature = "std")] @@ -65,6 +66,7 @@ use sp_version::RuntimeVersion; /// Constant values used within the runtime. pub mod constants; +mod evm; mod migration; pub mod weights; use bifrost_asset_registry::{AssetIdMaps, FixedRateOfAsset}; @@ -87,18 +89,21 @@ use bifrost_slp::QueryId; use bifrost_ve_minting::traits::VeMintingInterface; use constants::currency::*; use cumulus_primitives_core::ParaId as CumulusParaId; +use fp_evm::FeeCalculator; +use fp_rpc::TransactionStatus; use frame_support::{ dispatch::DispatchClass, - genesis_builder_helper::{build_config, create_default_config}, + genesis_builder_helper::{build_state, get_preset}, sp_runtime::traits::{Convert, ConvertInto}, traits::{ fungible::HoldConsideration, tokens::{PayFromAccount, UnityAssetBalanceConversion}, - Currency, EitherOf, EitherOfDiverse, Get, LinearStoragePrice, + Currency, EitherOf, EitherOfDiverse, Get, InsideBoth, LinearStoragePrice, OnFinalize, }, }; use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned}; use hex_literal::hex; +use pallet_ethereum::Transaction; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; // zenlink imports use zenlink_protocol::{ @@ -108,10 +113,15 @@ use zenlink_protocol::{ // xcm config pub mod xcm_config; use orml_traits::{currency::MutationHooks, location::RelativeReserveProvider}; +use pallet_evm::{GasWeightMapping, Runner}; use pallet_identity::legacy::IdentityInfo; use pallet_xcm::{EnsureResponse, QueryStatus}; use polkadot_runtime_common::prod_or_fast; -use sp_runtime::traits::{IdentityLookup, Verify}; +use sp_arithmetic::traits::UniqueSaturatedInto; +use sp_runtime::{ + traits::{DispatchInfoOf, Dispatchable, IdentityLookup, PostDispatchInfoOf, Verify}, + transaction_validity::TransactionValidityError, +}; use static_assertions::const_assert; use xcm::{v3::MultiLocation, v4::prelude::*}; pub use xcm_config::{ @@ -129,9 +139,29 @@ use governance::{ TechAdminOrCouncil, }; -impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, +/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know +/// the specifics of the runtime. They can then be made to be agnostic over specific formats +/// of data like extrinsics, allowing for them to continue syncing the network through upgrades +/// to even the core data structures. +pub mod opaque { + use super::*; + use cumulus_primitives_core::relay_chain::HashT; + + pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; + + /// Opaque block header type. + pub type Header = generic::Header; + /// Opaque block type. + pub type Block = generic::Block; + /// Opaque block identifier type. + pub type BlockId = generic::BlockId; + /// Opaque block hash type. + pub type Hash = ::Output; + + impl_opaque_keys! { + pub struct SessionKeys { + pub aura: Aura, + } } } @@ -141,7 +171,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bifrost_polkadot"), impl_name: create_runtime_str!("bifrost_polkadot"), authoring_version: 0, - spec_version: 11000, + spec_version: 12000, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -192,111 +222,6 @@ parameter_types! { pub const SS58Prefix: u8 = 6; } -pub struct CallFilter; -impl Contains for CallFilter { - fn contains(call: &RuntimeCall) -> bool { - let is_core_call = matches!( - call, - RuntimeCall::System(_) | RuntimeCall::Timestamp(_) | RuntimeCall::ParachainSystem(_) - ); - if is_core_call { - // always allow core call - return true; - } - - if bifrost_call_switchgear::OverallToggleFilter::::get_overall_toggle_status() { - return false; - } - - // temporarily ban PhragmenElection - let is_temporarily_banned = matches!(call, RuntimeCall::PhragmenElection(_)); - - if is_temporarily_banned { - return false; - } - - let is_switched_off = - bifrost_call_switchgear::SwitchOffTransactionFilter::::contains(call); - if is_switched_off { - // no switched off call - return false; - } - - // disable transfer - let is_transfer = matches!( - call, - RuntimeCall::Currencies(_) | RuntimeCall::Tokens(_) | RuntimeCall::Balances(_) - ); - if is_transfer { - let is_disabled = match *call { - // bifrost-currencies module - RuntimeCall::Currencies(bifrost_currencies::Call::transfer { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Currencies(bifrost_currencies::Call::transfer_native_currency { - dest: _, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - // orml-tokens module - RuntimeCall::Tokens(orml_tokens::Call::transfer { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Tokens(orml_tokens::Call::transfer_all { - dest: _, - currency_id, - keep_alive: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Tokens(orml_tokens::Call::transfer_keep_alive { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - // Balances module - RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death { - dest: _, - value: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - RuntimeCall::Balances(pallet_balances::Call::transfer_keep_alive { - dest: _, - value: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - RuntimeCall::Balances(pallet_balances::Call::transfer_all { - dest: _, - keep_alive: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - _ => false, - }; - - if is_disabled { - // no switched off call - return false; - } - } - - true - } -} - parameter_types! { pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); pub const RelayCurrencyId: CurrencyId = CurrencyId::Token2(DOT_TOKEN_ID); @@ -329,13 +254,14 @@ parameter_types! { pub const FarmingGaugeRewardIssuerPalletId: PalletId = PalletId(*b"bf/fmgar"); pub const BuyBackAccount: PalletId = PalletId(*b"bf/bybck"); pub const LiquidityAccount: PalletId = PalletId(*b"bf/liqdt"); + pub const FlexibleFeePalletId: PalletId = PalletId(*b"bf/flexi"); } impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; /// The identifier used to distinguish between accounts. type AccountId = AccountId; - type BaseCallFilter = CallFilter; + type BaseCallFilter = InsideBoth; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; type BlockLength = RuntimeBlockLength; @@ -367,6 +293,11 @@ impl frame_system::Config for Runtime { type Version = Version; type MaxConsumers = ConstU32<16>; type RuntimeTask = (); + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); } impl pallet_timestamp::Config for Runtime { @@ -861,6 +792,25 @@ impl pallet_transaction_payment::Config for Runtime { type WeightToFee = WeightToFee; } +/// Calls that can bypass the tx-pause pallet. +/// We always allow system calls and timestamp since it is required for block production +pub struct TxPauseWhitelistedCalls; +impl Contains> for TxPauseWhitelistedCalls { + fn contains(full_name: &pallet_tx_pause::RuntimeCallNameOf) -> bool { + matches!(full_name.0.as_slice(), b"System" | b"Timestamp" | b"TxPause") + } +} + +impl pallet_tx_pause::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PauseOrigin = TechAdminOrCouncil; + type UnpauseOrigin = TechAdminOrCouncil; + type WhitelistedCalls = TxPauseWhitelistedCalls; + type MaxNameLen = ConstU32<256>; + type WeightInfo = pallet_tx_pause::weights::SubstrateWeight; +} + // culumus runtime start parameter_types! { pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); @@ -892,10 +842,11 @@ parameter_types! { impl pallet_session::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type Keys = SessionKeys; + type Keys = opaque::SessionKeys; type NextSessionRotation = pallet_session::PeriodicSessions; // Essentially just Aura, but lets be pedantic. - type SessionHandler = ::KeyTypeIdProviders; + type SessionHandler = + ::KeyTypeIdProviders; type SessionManager = CollatorSelection; type ShouldEndSession = pallet_session::PeriodicSessions; type ValidatorId = ::AccountId; @@ -914,6 +865,7 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; type AllowMultipleBlocksPerSlot = ConstBool; + type SlotDuration = ConstU64; } parameter_types! { @@ -1005,6 +957,11 @@ impl bifrost_flexible_fee::Config for Runtime { type ParachainId = ParachainInfo; type ControlOrigin = TechAdminOrCouncil; type XcmWeightAndFeeHandler = XcmInterface; + type MinAssetHubExecutionFee = ConstU128<{ 20 * CENTS }>; + type MinRelaychainExecutionFee = ConstU128<{ 20 * CENTS }>; + type RelaychainCurrencyId = RelayCurrencyId; + type XcmRouter = XcmRouter; + type PalletId = FlexibleFeePalletId; } parameter_types! { @@ -1139,12 +1096,6 @@ impl bifrost_salp::Config for Runtime { type BatchLimit = BatchLimit; } -impl bifrost_call_switchgear::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type UpdateOrigin = CoreAdminOrCouncil; - type WeightInfo = weights::bifrost_call_switchgear::BifrostWeight; -} - impl bifrost_asset_registry::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; @@ -1504,14 +1455,22 @@ parameter_types! { pub const ExpiresIn: Moment = 1000 * 60 * 60; // 60 mins pub const MaxHasDispatchedSize: u32 = 100; pub OracleRootOperatorAccountId: AccountId = OraclePalletId::get().into_account_truncating(); + pub const MinimumTimestampInterval: Moment = 1000 * 60 * 10; // 10 mins + pub const MaximumValueInterval: Price = FixedU128::from_inner(3_000_000_000_000_000); // 0.3% } type BifrostDataProvider = orml_oracle::Instance1; impl orml_oracle::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnNewData = (); - type CombineData = - orml_oracle::DefaultCombineData; + type CombineData = orml_oracle::DefaultCombineData< + Runtime, + MinimumCount, + ExpiresIn, + MinimumTimestampInterval, + MaximumValueInterval, + BifrostDataProvider, + >; type Time = Timestamp; type OracleKey = CurrencyId; type OracleValue = Price; @@ -1520,6 +1479,7 @@ impl orml_oracle::Config for Runtime { type WeightInfo = weights::orml_oracle::WeightInfo; type Members = OracleMembership; type MaxFeedValues = ConstU32<100>; + type ControlOrigin = TechAdminOrCouncil; } pub type TimeStampedPrice = orml_oracle::TimestampedValue; @@ -1741,6 +1701,7 @@ construct_runtime! { Indices: pallet_indices = 2, ParachainSystem: cumulus_pallet_parachain_system = 5, ParachainInfo: parachain_info = 6, + TxPause: pallet_tx_pause = 7, // Monetary stuff Balances: pallet_balances = 10, @@ -1785,6 +1746,13 @@ construct_runtime! { Treasury: pallet_treasury = 61, Preimage: pallet_preimage = 64, + // Frontier and EVM pallets + Ethereum: pallet_ethereum = 65, + EVM: pallet_evm = 66, + EVMChainId: pallet_evm_chain_id = 67, + DynamicFee: pallet_dynamic_fee = 68, + EVMAccounts: pallet_evm_accounts = 69, + // Third party modules XTokens: orml_xtokens = 70, Tokens: orml_tokens = 71, @@ -1797,7 +1765,6 @@ construct_runtime! { // Bifrost modules FlexibleFee: bifrost_flexible_fee = 100, Salp: bifrost_salp = 105, - CallSwitchgear: bifrost_call_switchgear = 112, AssetRegistry: bifrost_asset_registry = 114, VtokenMinting: bifrost_vtoken_minting = 115, Slp: bifrost_slp = 116, @@ -1826,6 +1793,31 @@ construct_runtime! { } } +#[derive(Clone)] +pub struct TransactionConverter; + +impl fp_rpc::ConvertTransaction for TransactionConverter { + fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { + UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ) + } +} + +impl fp_rpc::ConvertTransaction for TransactionConverter { + fn convert_transaction( + &self, + transaction: pallet_ethereum::Transaction, + ) -> opaque::UncheckedExtrinsic { + let extrinsic = UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ); + let encoded = extrinsic.encode(); + opaque::UncheckedExtrinsic::decode(&mut &encoded[..]) + .expect("Encoded extrinsic is always valid") + } +} + /// The type for looking up accounts. We don't expect more than 4 billion of them. pub type AccountIndex = u32; /// Alias to 512-bit hash when used in the context of a transaction signature on the chain. @@ -1854,17 +1846,24 @@ pub type SignedExtra = ( frame_system::CheckNonce, frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, + frame_metadata_hash_extension::CheckMetadataHash, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = - generic::UncheckedExtrinsic; + fp_self_contained::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = + fp_self_contained::CheckedExtrinsic; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; parameter_types! { - pub const DmpQueuePalletName: &'static str = "DmpQueue"; + pub const CallSwitchgearPalletName: &'static str = "CallSwitchgear"; +} + +impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { + // This must be the same as the `ChannelInfo` from the `Config`: + type ChannelList = ParachainSystem; } /// All migrations that will run on the next runtime upgrade. @@ -1880,12 +1879,13 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( - bifrost_slpx::migration::v1::MigrateToV1, + // permanent migration, do not remove + pallet_xcm::migration::MigrateToLatestXcmVersion, frame_support::migrations::RemovePallet< - DmpQueuePalletName, + CallSwitchgearPalletName, ::DbWeight, >, - pallet_xcm::migration::MigrateToLatestXcmVersion, + cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, ); } @@ -1899,6 +1899,62 @@ pub type Executive = frame_executive::Executive< Migrations, >; +impl fp_self_contained::SelfContainedCall for RuntimeCall { + type SignedInfo = H160; + + fn is_self_contained(&self) -> bool { + match self { + RuntimeCall::Ethereum(call) => call.is_self_contained(), + _ => false, + } + } + + fn check_self_contained(&self) -> Option> { + match self { + RuntimeCall::Ethereum(call) => call.check_self_contained(), + _ => None, + } + } + + fn validate_self_contained( + &self, + info: &Self::SignedInfo, + dispatch_info: &DispatchInfoOf, + len: usize, + ) -> Option { + match self { + RuntimeCall::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len), + _ => None, + } + } + + fn pre_dispatch_self_contained( + &self, + info: &Self::SignedInfo, + dispatch_info: &DispatchInfoOf, + len: usize, + ) -> Option> { + match self { + RuntimeCall::Ethereum(call) => + call.pre_dispatch_self_contained(info, dispatch_info, len), + _ => None, + } + } + + fn apply_self_contained( + self, + info: Self::SignedInfo, + ) -> Option>> { + match self { + call @ RuntimeCall::Ethereum(pallet_ethereum::Call::transact { .. }) => + Some(call.dispatch(RuntimeOrigin::from( + pallet_ethereum::RawOrigin::EthereumTransaction(info), + ))), + _ => None, + } + } +} + #[cfg(feature = "runtime-benchmarks")] #[macro_use] extern crate frame_benchmarking; @@ -1931,7 +1987,7 @@ impl_runtime_apis! { Executive::execute_block(block); } - fn initialize_block(header: &::Header) { + fn initialize_block(header: &::Header) -> sp_runtime::ExtrinsicInclusionMode { Executive::initialize_block(header) } } @@ -1962,6 +2018,275 @@ impl_runtime_apis! { } } +impl fp_rpc::EthereumRuntimeRPCApi for Runtime { + fn chain_id() -> u64 { + ::ChainId::get() + } + + fn account_basic(address: H160) -> pallet_evm::Account { + let (account, _) = EVM::account_basic(&address); + account + } + + fn gas_price() -> U256 { + let (gas_price, _) = ::FeeCalculator::min_gas_price(); + gas_price + } + + fn account_code_at(address: H160) -> Vec { + pallet_evm::AccountCodes::::get(address) + } + + fn author() -> H160 { + >::find_author() + } + + fn storage_at(address: H160, index: U256) -> H256 { + let mut tmp = [0u8; 32]; + index.to_big_endian(&mut tmp); + pallet_evm::AccountStorages::::get(address, H256::from_slice(&tmp[..])) + } + + fn call( + from: H160, + to: H160, + data: Vec, + value: U256, + gas_limit: U256, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + estimate: bool, + access_list: Option)>>, + ) -> Result { + let mut config = ::config().clone(); + config.estimate = estimate; + + let is_transactional = false; + let validate = true; + + // Estimated encoded transaction size must be based on the heaviest transaction + // type (EIP1559Transaction) to be compatible with all transaction types. + let mut estimated_transaction_len = data.len() + + // pallet ethereum index: 1 + // transact call index: 1 + // Transaction enum variant: 1 + // chain_id 8 bytes + // nonce: 32 + // max_priority_fee_per_gas: 32 + // max_fee_per_gas: 32 + // gas_limit: 32 + // action: 21 (enum varianrt + call address) + // value: 32 + // access_list: 1 (empty vec size) + // 65 bytes signature + 258; + + if access_list.is_some() { + estimated_transaction_len += access_list.encoded_size(); + } + + let gas_limit = gas_limit.min(u64::MAX.into()).low_u64(); + let without_base_extrinsic_weight = true; + + let (weight_limit, proof_size_base_cost) = + match ::GasWeightMapping::gas_to_weight( + gas_limit, + without_base_extrinsic_weight + ) { + weight_limit if weight_limit.proof_size() > 0 => { + (Some(weight_limit), Some(estimated_transaction_len as u64)) + } + _ => (None, None), + }; + + // don't allow calling EVM RPC or Runtime API from a bound address + if EVMAccounts::bound_account_id(from).is_some() { + return Err(pallet_evm_accounts::Error::::BoundAddressCannotBeUsed.into()) + }; + + ::Runner::call( + from, + to, + data, + value, + gas_limit.unique_saturated_into(), + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.unwrap_or_default(), + is_transactional, + validate, + weight_limit, + proof_size_base_cost, + &config, + ) + .map_err(|err| err.error.into()) + } + + fn create( + from: H160, + data: Vec, + value: U256, + gas_limit: U256, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + estimate: bool, + access_list: Option)>>, + ) -> Result { + let config = if estimate { + let mut config = ::config().clone(); + config.estimate = true; + Some(config) + } else { + None + }; + + let is_transactional = false; + let validate = true; + + // Reused approach from Moonbeam since Frontier implementation doesn't support this + let mut estimated_transaction_len = data.len() + + // to: 20 + // from: 20 + // value: 32 + // gas_limit: 32 + // nonce: 32 + // 1 byte transaction action variant + // chain id 8 bytes + // 65 bytes signature + 210; + if max_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if max_priority_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if access_list.is_some() { + estimated_transaction_len += access_list.encoded_size(); + } + + let gas_limit = gas_limit.min(u64::MAX.into()).low_u64(); + let without_base_extrinsic_weight = true; + + let (weight_limit, proof_size_base_cost) = + match ::GasWeightMapping::gas_to_weight( + gas_limit, + without_base_extrinsic_weight + ) { + weight_limit if weight_limit.proof_size() > 0 => { + (Some(weight_limit), Some(estimated_transaction_len as u64)) + } + _ => (None, None), + }; + + // don't allow calling EVM RPC or Runtime API from a bound address + if EVMAccounts::bound_account_id(from).is_some() { + return Err(pallet_evm_accounts::Error::::BoundAddressCannotBeUsed.into()) + }; + + // the address needs to have a permission to deploy smart contract + if !EVMAccounts::can_deploy_contracts(from) { + return Err(pallet_evm_accounts::Error::::AddressNotWhitelisted.into()) + }; + + #[allow(clippy::or_fun_call)] // suggestion not helpful here + ::Runner::create( + from, + data, + value, + gas_limit.unique_saturated_into(), + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + Vec::new(), + is_transactional, + validate, + weight_limit, + proof_size_base_cost, + config + .as_ref() + .unwrap_or(::config()), + ) + .map_err(|err| err.error.into()) + } + + fn current_transaction_statuses() -> Option> { + pallet_ethereum::CurrentTransactionStatuses::::get() + } + + fn current_block() -> Option { + pallet_ethereum::CurrentBlock::::get() + } + + fn current_receipts() -> Option> { + pallet_ethereum::CurrentReceipts::::get() + } + + fn current_all() -> ( + Option, + Option>, + Option>, + ) { + ( + pallet_ethereum::CurrentBlock::::get(), + pallet_ethereum::CurrentReceipts::::get(), + pallet_ethereum::CurrentTransactionStatuses::::get(), + ) + } + + fn extrinsic_filter(xts: Vec<::Extrinsic>) -> Vec { + xts.into_iter() + .filter_map(|xt| match xt.0.function { + RuntimeCall::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction), + _ => None, + }) + .collect::>() + } + + fn elasticity() -> Option { + None + } + + fn gas_limit_multiplier_support() {} + + fn pending_block( + xts: Vec<::Extrinsic>, + ) -> (Option, Option>) { + for ext in xts.into_iter() { + let _ = Executive::apply_extrinsic(ext); + } + + Ethereum::on_finalize(System::block_number() + 1); + + ( + pallet_ethereum::CurrentBlock::::get(), + pallet_ethereum::CurrentTransactionStatuses::::get() + ) + } + } + + impl fp_rpc::ConvertTransactionRuntimeApi for Runtime { + fn convert_transaction(transaction: Transaction) -> ::Extrinsic { + UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ) + } + } + + impl pallet_evm_accounts_rpc_runtime_api::EvmAccountsApi for Runtime { + fn evm_address(account_id: AccountId) -> H160 { + EVMAccounts::evm_address(&account_id) + } + fn bound_account_id(evm_address: H160) -> Option { + EVMAccounts::bound_account_id(evm_address) + } + fn account_id(evm_address: H160) -> AccountId { + EVMAccounts::account_id(evm_address) + } + } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< Block, Balance, @@ -2008,11 +2333,11 @@ impl_runtime_apis! { fn decode_session_keys( encoded: Vec, ) -> Option, sp_core::crypto::KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) + opaque::SessionKeys::decode_into_raw_public_keys(&encoded) } fn generate_session_keys(seed: Option>) -> Vec { - SessionKeys::generate(seed) + opaque::SessionKeys::generate(seed) } } @@ -2028,13 +2353,14 @@ impl_runtime_apis! { } fn authorities() -> Vec { - Aura::authorities().into_inner() + pallet_aura::Authorities::::get().into_inner() } } impl bifrost_flexible_fee_rpc_runtime_api::FlexibleFeeRuntimeApi for Runtime { - fn get_fee_token_and_amount(who: AccountId, fee: Balance, utx: ::Extrinsic) -> (CurrencyId, Balance) { - let call = utx.function; + fn get_fee_token_and_amount(who: AccountId, fee: Balance,utx: ::Extrinsic) -> (CurrencyId, Balance) { + let call = utx.0.function; + let rs = FlexibleFee::cal_fee_token_and_amount(&who, fee, &call); match rs { @@ -2242,12 +2568,16 @@ impl_runtime_apis! { } impl sp_genesis_builder::GenesisBuilder for Runtime { - fn create_default_config() -> Vec { - create_default_config::() + fn build_state(config: Vec) -> sp_genesis_builder::Result { + build_state::(config) + } + + fn get_preset(id: &Option) -> Option> { + get_preset::(id, |_| None) } - fn build_config(config: Vec) -> sp_genesis_builder::Result { - build_config::(config) + fn preset_names() -> Vec { + vec![] } } } diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs b/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs deleted file mode 100644 index 439245f52..000000000 --- a/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs +++ /dev/null @@ -1,101 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) Liebi Technologies PTE. LTD. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for bifrost_call_switchgear -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 - -// Executed Command: -// target/release/bifrost -// benchmark -// pallet -// --chain=bifrost-kusama-local -// --steps=50 -// --repeat=20 -// --pallet=bifrost_call_switchgear -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs -// --template=./weight-template/runtime-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions for bifrost_call_switchgear. -pub struct BifrostWeight(PhantomData); -impl bifrost_call_switchgear::WeightInfo for BifrostWeight { - // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) - // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) - fn switchoff_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `3469` - // Minimum execution time: 29_214 nanoseconds. - Weight::from_parts(30_398_000, 3469) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) - // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) - fn switchon_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `55` - // Estimated: `3520` - // Minimum execution time: 31_720 nanoseconds. - Weight::from_parts(32_717_000, 3520) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) - // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) - fn disable_transfers() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `3469` - // Minimum execution time: 26_079 nanoseconds. - Weight::from_parts(26_977_000, 3469) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) - // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) - fn enable_transfers() -> Weight { - // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 27_719 nanoseconds. - Weight::from_parts(28_319_000, 3503) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs index 361ddb923..8939443b4 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs @@ -159,30 +159,30 @@ impl bifrost_vtoken_voting::WeightInfo for BifrostWeigh .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } - // Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) - // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - // Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) - // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) - // Storage: VtokenVoting DelegatorVote (r:1 w:0) - // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) - // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) - // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm QueryCounter (r:1 w:1) - // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainInfo ParachainId (r:1 w:0) - // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: VtokenVoting PendingRemoveDelegatorVote (r:0 w:1) - // Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) - // Storage: PolkadotXcm Queries (r:0 w:1) - // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + // Storage: `VtokenVoting::DelegatorVotes` (r:1 w:0) + // Proof: `VtokenVoting::DelegatorVotes` (`max_values`: None, `max_size`: Some(5136), added: 7611, mode: `MaxEncodedLen`) + // Storage: `VtokenVoting::ReferendumInfoFor` (r:1 w:0) + // Proof: `VtokenVoting::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::ValidationData` (r:1 w:0) + // Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + // Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmInterface::XcmWeightAndFee` (r:1 w:0) + // Proof: `XcmInterface::XcmWeightAndFee` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + // Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainInfo::ParachainId` (r:1 w:0) + // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `VtokenVoting::PendingRemoveDelegatorVote` (r:0 w:1) + // Proof: `VtokenVoting::PendingRemoveDelegatorVote` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + // Storage: `PolkadotXcm::Queries` (r:0 w:1) + // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_delegator_vote() -> Weight { // Proof Size summary in bytes: - // Measured: `965` - // Estimated: `4430` - // Minimum execution time: 94_053 nanoseconds. - Weight::from_parts(105_489_000, 4430) + // Measured: `1048` + // Estimated: `8601` + // Minimum execution time: 34_000 nanoseconds. + Weight::from_parts(35_000_000, 8601) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/bifrost-polkadot/src/weights/mod.rs b/runtime/bifrost-polkadot/src/weights/mod.rs index 6ea6b29d5..2dfce402e 100644 --- a/runtime/bifrost-polkadot/src/weights/mod.rs +++ b/runtime/bifrost-polkadot/src/weights/mod.rs @@ -22,7 +22,6 @@ pub mod bifrost_asset_registry; pub mod bifrost_buy_back; -pub mod bifrost_call_switchgear; pub mod bifrost_channel_commission; pub mod bifrost_clouds_convert; pub mod bifrost_cross_in_out; diff --git a/runtime/bifrost-polkadot/src/xcm_config.rs b/runtime/bifrost-polkadot/src/xcm_config.rs index 22d7e397e..b9ba1c7ed 100644 --- a/runtime/bifrost-polkadot/src/xcm_config.rs +++ b/runtime/bifrost-polkadot/src/xcm_config.rs @@ -19,7 +19,8 @@ use super::*; use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ - AccountId, CurrencyId, CurrencyIdMapping, TokenSymbol, DOT_TOKEN_ID, GLMR_TOKEN_ID, + currency::WETH_TOKEN_ID, AccountId, CurrencyId, CurrencyIdMapping, TokenSymbol, DOT_TOKEN_ID, + GLMR_TOKEN_ID, }; pub use bifrost_xcm_interface::traits::{parachains, XcmBaseWeight}; use cumulus_primitives_core::AggregateMessageOrigin; @@ -56,7 +57,7 @@ use bifrost_runtime_common::currency_adapter::{ BifrostDropAssets, DepositToAlternative, MultiCurrencyAdapter, }; use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; -use xcm::v4::{prelude::*, Asset, AssetId, InteriorLocation, Location}; +use xcm::v4::{Asset, AssetId, InteriorLocation, Location}; /// Bifrost Asset Matcher pub struct BifrostAssetMatcher( @@ -483,6 +484,38 @@ impl Contains for SafeCallFilter { } } +/// Asset filter that allows all assets from a certain location matching asset id. +pub struct AssetPrefixFrom(PhantomData<(Prefix, Origin)>); +impl ContainsPair for AssetPrefixFrom +where + Prefix: Get, + Origin: Get, +{ + fn contains(asset: &Asset, origin: &Location) -> bool { + let loc = Origin::get(); + &loc == origin && + matches!(asset, Asset { id: AssetId(asset_loc), fun: Fungible(_a) } + if asset_loc.starts_with(&Prefix::get())) + } +} + +/// Asset filter that allows native/relay asset if coming from a certain location. +pub struct NativeAssetFrom(PhantomData); +impl> ContainsPair for NativeAssetFrom { + fn contains(asset: &Asset, origin: &Location) -> bool { + let loc = T::get(); + &loc == origin && + matches!(asset, Asset { id: AssetId(asset_loc), fun: Fungible(_a) } + if *asset_loc == Location::from(Parent)) + } +} + +parameter_types! { + /// Location of Asset Hub + pub AssetHubLocation: Location = (Parent, Parachain(1000)).into(); + pub EthereumLocation: Location = Location::new(2, [GlobalConsensus(NetworkId::Ethereum { chain_id: 1 })]); +} + pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type AssetClaims = PolkadotXcm; @@ -490,7 +523,11 @@ impl xcm_executor::Config for XcmConfig { type AssetTrap = BifrostDropAssets; type Barrier = Barrier; type RuntimeCall = RuntimeCall; - type IsReserve = MultiNativeAsset; + type IsReserve = ( + NativeAssetFrom, + AssetPrefixFrom, + MultiNativeAsset, + ); type IsTeleporter = (); type UniversalLocation = UniversalLocation; type OriginConverter = XcmOriginToTransactDispatchOrigin; @@ -510,6 +547,10 @@ impl xcm_executor::Config for XcmConfig { type MessageExporter = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } /// Local origins on this chain are allowed to dispatch XCM sends/executions. @@ -577,10 +618,13 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; type PriceForSiblingDelivery = NoPriceForMessageDelivery; + type MaxActiveOutboundChannels = ConstU32<128>; + type MaxPageSize = ConstU32<{ 103 * 1024 }>; } parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -601,6 +645,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = ConstU32<{ 64 * 1024 }>; type MaxStale = ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } // orml runtime start @@ -615,6 +660,7 @@ impl bifrost_currencies::Config for Runtime { parameter_type_with_key! { pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { match currency_id { + &CurrencyId::Token2(WETH_TOKEN_ID) => 15_000_000_000_000, // 0.000015 WETH &CurrencyId::Native(TokenSymbol::BNC) => 10 * milli::(NativeCurrencyId::get()), // 0.01 BNC &CurrencyId::Token2(DOT_TOKEN_ID) => 1_000_000, // DOT &CurrencyId::LPToken(..) => 1 * micro::(NativeCurrencyId::get()), diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 359d7a842..7937f5f93 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -24,6 +24,9 @@ sp-version = { workspace = true } sp-consensus-aura = { workspace = true } sp-arithmetic = { workspace = true } sp-io = { workspace = true } +num-traits = { workspace = true } +scale-info = { workspace = true } +serde = { workspace = true } # frame dependencies frame-executive = { workspace = true } @@ -38,6 +41,7 @@ pallet-scheduler = { workspace = true } pallet-treasury = { workspace = true } pallet-democracy = { workspace = true } pallet-multisig = { workspace = true } +pallet-traits = { workspace = true } # Cumulus dependencies cumulus-pallet-parachain-system = { workspace = true } @@ -93,6 +97,7 @@ std = [ "pallet-democracy/std", "pallet-multisig/std", "pallet-membership/std", + "pallet-traits/std", "pallet-utility/std", "pallet-treasury/std", "pallet-scheduler/std", diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 3d5ed2397..9c5a0b7c7 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -31,6 +31,10 @@ use sp_runtime::{traits::Bounded, FixedPointNumber, Perquintill}; pub mod constants; pub mod currency_adapter; +pub mod price; +pub mod ratio; + +pub use ratio::Ratio; #[cfg(test)] mod tests; @@ -43,7 +47,7 @@ impl BlockNumberProvider type BlockNumber = BlockNumber; fn current_block_number() -> Self::BlockNumber { - cumulus_pallet_parachain_system::Pallet::::validation_data() + cumulus_pallet_parachain_system::ValidationData::::get() .map(|d| d.relay_parent_number) .unwrap_or_default() } @@ -127,7 +131,7 @@ impl BlockNumberProvider type BlockNumber = BlockNumber; fn current_block_number() -> Self::BlockNumber { - cumulus_pallet_parachain_system::Pallet::::validation_data() + cumulus_pallet_parachain_system::ValidationData::::get() .map(|d| d.relay_parent_number) .unwrap_or_default() } diff --git a/runtime/common/src/price.rs b/runtime/common/src/price.rs new file mode 100644 index 000000000..9b0747d18 --- /dev/null +++ b/runtime/common/src/price.rs @@ -0,0 +1,107 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use frame_support::{ + pallet_prelude::Get, + traits::tokens::{Fortitude, Preservation}, +}; +use sp_runtime::{helpers_128bit::multiply_by_rational_with_rounding, traits::Convert, Rounding}; +use sp_std::marker::PhantomData; +use xcm::latest::Weight; + +use bifrost_primitives::{ + AccountFeeCurrency, AccountFeeCurrencyBalanceInCurrency, Balance, CurrencyId, PriceProvider, +}; +use pallet_traits::PriceFeeder; + +use crate::Ratio; + +pub struct OraclePriceProvider(PhantomData); + +impl PriceProvider for OraclePriceProvider +where + PF: PriceFeeder, +{ + type Price = Ratio; + + fn get_price(asset_a: CurrencyId, asset_b: CurrencyId) -> Option { + if let Some(a) = PF::get_normal_price(&asset_a) { + if let Some(b) = PF::get_normal_price(&asset_b) { + Some(Ratio::from((a, b))) + } else { + None + } + } else { + None + } + } +} + +pub struct FeeAssetBalanceInCurrency(PhantomData<(T, C, AC, I)>); + +impl AccountFeeCurrencyBalanceInCurrency + for FeeAssetBalanceInCurrency +where + T: frame_system::Config, + C: Convert<(CurrencyId, CurrencyId, Balance), Option<(Balance, Ratio)>>, + AC: AccountFeeCurrency, + I: frame_support::traits::fungibles::Inspect< + T::AccountId, + AssetId = CurrencyId, + Balance = Balance, + >, +{ + type Output = (Balance, Weight); + + fn get_balance_in_currency(to_currency: CurrencyId, account: &T::AccountId) -> Self::Output { + let from_currency = AC::get(account); + let account_balance = + I::reducible_balance(from_currency, account, Preservation::Preserve, Fortitude::Polite); + let price_weight = T::DbWeight::get().reads(2); // 1 read to get currency and 1 read to get balance + + if from_currency == to_currency { + return (account_balance, price_weight); + } + + let Some((converted, _)) = C::convert((from_currency, to_currency, account_balance)) else { + return (0, price_weight); + }; + (converted, price_weight) + } +} + +pub struct ConvertAmount

(PhantomData

); + +// Converts `amount` of `from_currency` to `to_currency` using given oracle +// Input: (from_currency, to_currency, amount) +// Output: Option<(converted_amount, price)> +impl

Convert<(CurrencyId, CurrencyId, Balance), Option<(Balance, Ratio)>> for ConvertAmount

+where + P: PriceProvider, +{ + fn convert( + (from_currency, to_currency, amount): (CurrencyId, CurrencyId, Balance), + ) -> Option<(Balance, Ratio)> { + if from_currency == to_currency { + return Some((amount, Ratio::one())); + } + let price = P::get_price(from_currency, to_currency)?; + let converted = multiply_by_rational_with_rounding(amount, price.n, price.d, Rounding::Up)?; + Some((converted, price)) + } +} diff --git a/runtime/common/src/ratio.rs b/runtime/common/src/ratio.rs new file mode 100644 index 000000000..01022e8e7 --- /dev/null +++ b/runtime/common/src/ratio.rs @@ -0,0 +1,154 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use core::cmp::{Ord, Ordering, PartialOrd}; +use num_traits::Zero; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; +use sp_arithmetic::helpers_128bit; + +/// A rational number represented by a `n`umerator and `d`enominator. +#[derive( + Clone, + Copy, + Default, + PartialEq, + Eq, + Encode, + Decode, + Serialize, + Deserialize, + TypeInfo, + MaxEncodedLen, +)] +pub struct Ratio { + pub n: u128, + pub d: u128, +} + +impl Ratio { + /// Build from a raw `n/d`. Ensures that `d > 0`. + pub const fn new(n: u128, d: u128) -> Self { + // reimplement `.max(1)` so this can be `const` + let d = if d > 0 { d } else { 1 }; + Self { n, d } + } + + /// Build from a raw `n/d`. This could lead to / 0 if not properly handled. + pub const fn new_unchecked(n: u128, d: u128) -> Self { + Self { n, d } + } + + /// Return a representation of one. + /// + /// Note that more than one combination of `n` and `d` can be one. + pub const fn one() -> Self { + Self::new_unchecked(1, 1) + } + + /// Return whether `self` is one. + /// + /// Should a denominator of 0 happen, this function will return `false`. + /// + /// Note that more than one combination of `n` and `d` can be one. + pub const fn is_one(&self) -> bool { + self.d > 0 && self.n == self.d + } + + /// Return a representation of zero. + /// + /// Note that any combination of `n == 0` and `d` represents zero. + pub const fn zero() -> Self { + Self::new_unchecked(0, 1) + } + + /// Return whether `self` is zero. + /// + /// Note that any combination of `n == 0` and `d` represents zero. + pub const fn is_zero(&self) -> bool { + self.n == 0 + } + + /// Invert `n/d` to `d/n`. + /// + /// NOTE: Zero inverts to zero. + pub const fn inverted(self) -> Self { + if self.is_zero() { + self + } else { + Self { n: self.d, d: self.n } + } + } +} + +impl From for (u128, u128) { + fn from(ratio: Ratio) -> (u128, u128) { + (ratio.n, ratio.d) + } +} + +impl From for Ratio { + fn from(n: u128) -> Self { + Self::new(n, 1) + } +} + +impl From<(u128, u128)> for Ratio { + fn from((n, d): (u128, u128)) -> Self { + Self::new(n, d) + } +} + +impl PartialOrd for Ratio { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + +// Taken from Substrate's `Rational128`. +impl Ord for Ratio { + fn cmp(&self, other: &Self) -> Ordering { + if self.d == other.d { + self.n.cmp(&other.n) + } else if self.d.is_zero() { + Ordering::Greater + } else if other.d.is_zero() { + Ordering::Less + } else { + let self_n = helpers_128bit::to_big_uint(self.n) * helpers_128bit::to_big_uint(other.d); + let other_n = + helpers_128bit::to_big_uint(other.n) * helpers_128bit::to_big_uint(self.d); + self_n.cmp(&other_n) + } + } +} + +#[cfg(feature = "std")] +impl sp_std::fmt::Debug for Ratio { + fn fmt(&self, f: &mut sp_std::fmt::Formatter<'_>) -> sp_std::fmt::Result { + write!(f, "Ratio({} / {} ≈ {:.8})", self.n, self.d, self.n as f64 / self.d as f64) + } +} + +#[cfg(not(feature = "std"))] +impl sp_std::fmt::Debug for Ratio { + fn fmt(&self, f: &mut sp_std::fmt::Formatter<'_>) -> sp_std::fmt::Result { + write!(f, "Ratio({} / {})", self.n, self.d) + } +} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 9c6ff81de..b365e13a8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.74.0" +channel = "1.77.0" components = ["rust-src", "rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"] diff --git a/scripts/init.sh b/scripts/init.sh index 94ef2963e..3f6ed0ed1 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -4,6 +4,6 @@ set -e echo "*** Initializing WASM build environment" -rustup default 1.74.0 +rustup default 1.77.0 -rustup target add wasm32-unknown-unknown --toolchain 1.74.0 +rustup target add wasm32-unknown-unknown --toolchain 1.77.0