From f93e208a7986e5196b14edc159c0163c3259a87d Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Wed, 2 Nov 2022 15:25:34 +0100 Subject: [PATCH] Connectors POC (#861) * connectors: POC v0 * fixup! Use orml 0.9.29 * nix --- Cargo.lock | 1485 ++++++++++++----- Cargo.toml | 1 + flake.nix | 2 +- libs/traits/src/lib.rs | 2 +- pallets/connectors/Cargo.toml | 102 ++ pallets/connectors/src/contract.rs | 63 + pallets/connectors/src/lib.rs | 473 ++++++ pallets/connectors/src/message.rs | 282 ++++ pallets/connectors/src/routers.rs | 30 + pallets/connectors/src/weights.rs | 117 ++ runtime/altair/src/xcm.rs | 2 +- runtime/centrifuge/src/xcm.rs | 2 +- runtime/development/Cargo.toml | 8 + runtime/development/src/lib.rs | 53 +- runtime/development/src/xcm.rs | 2 +- runtime/integration-tests/Cargo.toml | 4 + .../src/xcm/development/mod.rs | 3 + .../src/xcm/development/setup.rs | 121 ++ .../src/xcm/development/test_net.rs | 158 ++ .../src/xcm/development/tests/connectors.rs | 220 +++ .../src/xcm/development/tests/mod.rs | 1 + runtime/integration-tests/src/xcm/mod.rs | 1 + 22 files changed, 2673 insertions(+), 459 deletions(-) create mode 100644 pallets/connectors/Cargo.toml create mode 100644 pallets/connectors/src/contract.rs create mode 100644 pallets/connectors/src/lib.rs create mode 100644 pallets/connectors/src/message.rs create mode 100644 pallets/connectors/src/routers.rs create mode 100644 pallets/connectors/src/weights.rs create mode 100644 runtime/integration-tests/src/xcm/development/mod.rs create mode 100644 runtime/integration-tests/src/xcm/development/setup.rs create mode 100644 runtime/integration-tests/src/xcm/development/test_net.rs create mode 100644 runtime/integration-tests/src/xcm/development/tests/connectors.rs create mode 100644 runtime/integration-tests/src/xcm/development/tests/mod.rs diff --git a/Cargo.lock b/Cargo.lock index f7c4abd85f..c530753edb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.8", "once_cell", "version_check", ] @@ -159,7 +159,7 @@ dependencies = [ "pallet-vesting", "pallet-xcm", "parachain-info", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-runtime-common", "runtime-common", @@ -217,9 +217,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" [[package]] name = "approx" @@ -341,11 +341,12 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" dependencies = [ "event-listener", + "futures-lite", ] [[package]] @@ -456,6 +457,18 @@ dependencies = [ "winapi", ] +[[package]] +name = "auto_impl" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -497,9 +510,9 @@ checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "beef" @@ -518,11 +531,11 @@ dependencies = [ "async-trait", "beefy-primitives", "fnv", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "hex", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-chain-spec", "sc-client-api", @@ -553,10 +566,10 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "beefy-gadget", "beefy-primitives", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-rpc", "sc-utils", @@ -580,7 +593,7 @@ name = "beefy-primitives" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-api", "sp-application-crypto", @@ -629,16 +642,28 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitvec" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +dependencies = [ + "funty 1.1.0", + "radium 0.6.2", + "tap", + "wyz 0.2.0", +] + [[package]] name = "bitvec" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ - "funty", - "radium", + "funty 2.0.0", + "radium 0.7.0", "tap", - "wyz", + "wyz 0.5.0", ] [[package]] @@ -702,7 +727,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding", + "block-padding 0.1.5", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -714,6 +739,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ + "block-padding 0.2.1", "generic-array 0.14.6", ] @@ -735,6 +761,12 @@ dependencies = [ "byte-tools", ] +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + [[package]] name = "blocking" version = "1.2.0" @@ -892,7 +924,7 @@ dependencies = [ "frame-benchmarking", "frame-benchmarking-cli", "frame-system", - "futures 0.3.24", + "futures 0.3.25", "hex-literal 0.2.2", "jsonrpsee", "log", @@ -904,7 +936,7 @@ dependencies = [ "pallet-pools", "pallet-transaction-payment", "pallet-transaction-payment-rpc", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-cli", "polkadot-parachain", "polkadot-primitives", @@ -1041,7 +1073,7 @@ dependencies = [ "pallet-vesting", "pallet-xcm", "parachain-info", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-runtime-common", "runtime-common", @@ -1110,7 +1142,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-collective", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-consensus-aura", @@ -1129,7 +1161,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -1148,7 +1180,7 @@ dependencies = [ "mockall", "orml-asset-registry", "orml-traits", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-arithmetic", @@ -1166,7 +1198,7 @@ dependencies = [ "frame-support", "frame-system", "orml-asset-registry", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-parachain", "scale-info", "serde", @@ -1216,7 +1248,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -1295,9 +1327,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.22" +version = "3.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" dependencies = [ "atty", "bitflags", @@ -1365,9 +1397,9 @@ dependencies = [ [[package]] name = "comfy-table" -version = "6.1.1" +version = "6.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b3d16bb3da60be2f7c7acfc438f2ae6f3496897ce68c291d0509bb67b4e248e" +checksum = "1090f39f45786ec6dc6286f8ea9c75d0a7ef0a0d3cda674cef0c3af7b307fbc2" dependencies = [ "strum", "strum_macros", @@ -1686,7 +1718,7 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "clap", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-chain-spec", "sc-cli", "sc-service", @@ -1704,8 +1736,8 @@ dependencies = [ "cumulus-client-network", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.24", - "parity-scale-codec", + "futures 0.3.25", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -1727,8 +1759,8 @@ dependencies = [ "async-trait", "cumulus-client-consensus-common", "cumulus-primitives-core", - "futures 0.3.24", - "parity-scale-codec", + "futures 0.3.25", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-consensus", "sc-consensus-aura", @@ -1756,8 +1788,8 @@ dependencies = [ "async-trait", "cumulus-relay-chain-interface", "dyn-clone", - "futures 0.3.24", - "parity-scale-codec", + "futures 0.3.25", + "parity-scale-codec 3.2.1", "polkadot-primitives", "sc-client-api", "sc-consensus", @@ -1778,7 +1810,7 @@ dependencies = [ "cumulus-client-consensus-common", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.24", + "futures 0.3.25", "parking_lot 0.12.1", "sc-client-api", "sc-consensus", @@ -1801,9 +1833,9 @@ dependencies = [ "async-trait", "cumulus-relay-chain-interface", "derive_more", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-node-primitives", "polkadot-parachain", @@ -1825,9 +1857,9 @@ source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa9 dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", @@ -1879,7 +1911,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-aura", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-application-crypto", @@ -1897,7 +1929,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -1921,7 +1953,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-parachain", "scale-info", "serde", @@ -1956,7 +1988,7 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -1974,7 +2006,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "rand_chacha 0.3.1", "scale-info", "sp-runtime", @@ -1989,7 +2021,7 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "frame-support", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", @@ -2008,7 +2040,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", "cumulus-test-relay-sproof-builder", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-client-api", "scale-info", "sp-api", @@ -2028,8 +2060,8 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", - "futures 0.3.24", - "parity-scale-codec", + "futures 0.3.25", + "parity-scale-codec 3.2.1", "sp-inherents", "sp-std", "sp-timestamp", @@ -2043,7 +2075,7 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", @@ -2063,7 +2095,7 @@ dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "polkadot-cli", "polkadot-client", @@ -2092,9 +2124,9 @@ dependencies = [ "async-trait", "cumulus-primitives-core", "derive_more", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee-core", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-overseer", "polkadot-service", @@ -2113,7 +2145,7 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-primitives", "sp-runtime", "sp-state-machine", @@ -2161,9 +2193,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f83d0ebf42c6eafb8d7c52f7e5f2d3003b89c7aa4fd2b79229209459a849af8" +checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" dependencies = [ "cc", "cxxbridge-flags", @@ -2173,9 +2205,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d050484b55975889284352b0ffc2ecbda25c0c55978017c132b29ba0818a86" +checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" dependencies = [ "cc", "codespan-reporting", @@ -2188,15 +2220,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d2199b00553eda8012dfec8d3b1c75fce747cf27c169a270b3b99e3448ab78" +checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" [[package]] name = "cxxbridge-macro" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb67a6de1f602736dd7eaead0080cf3435df806c61b24b13328db128c58868f" +checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" dependencies = [ "proc-macro2", "quote", @@ -2303,6 +2335,7 @@ dependencies = [ "pallet-collator-allowlist", "pallet-collator-selection", "pallet-collective", + "pallet-connectors", "pallet-crowdloan-claim", "pallet-crowdloan-reward", "pallet-democracy", @@ -2344,8 +2377,9 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", + "pallet-xcm-transactor", "parachain-info", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-runtime-common", "runtime-common", @@ -2375,6 +2409,7 @@ dependencies = [ "xcm", "xcm-builder", "xcm-executor", + "xcm-primitives", ] [[package]] @@ -2545,15 +2580,15 @@ dependencies = [ [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" dependencies = [ "curve25519-dalek 3.2.0", + "hashbrown 0.12.3", "hex", "rand_core 0.6.4", "sha2 0.9.9", - "thiserror", "zeroize", ] @@ -2664,19 +2699,159 @@ dependencies = [ "libc", ] +[[package]] +name = "ethabi" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c98847055d934070b90e806e12d3936b787d0a115068981c1d8dfd5dfef5a5" +dependencies = [ + "ethereum-types 0.12.1", + "hex", + "sha3 0.9.1", + "thiserror", + "uint", +] + +[[package]] +name = "ethbloom" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb684ac8fa8f6c5759f788862bb22ec6fe3cb392f6bfd08e3c64b603661e3f8" +dependencies = [ + "crunchy", + "fixed-hash", + "tiny-keccak", +] + +[[package]] +name = "ethbloom" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11da94e443c60508eb62cf256243a64da87304c2802ac2528847f79d750007ef" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-codec 0.6.0", + "impl-rlp", + "impl-serde", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23750149fe8834c0e24bb9adcbacbe06c45b9861f15df53e09f26cb7c4ab91ef" +dependencies = [ + "bytes", + "ethereum-types 0.13.1", + "hash-db", + "hash256-std-hasher", + "parity-scale-codec 3.2.1", + "rlp", + "rlp-derive", + "scale-info", + "serde", + "sha3 0.10.6", + "triehash", +] + +[[package]] +name = "ethereum-types" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05136f7057fe789f06e6d41d07b34e6f70d8c86e5693b60f97aaa6553553bdaf" +dependencies = [ + "ethbloom 0.11.1", + "fixed-hash", + "primitive-types 0.10.1", + "uint", +] + +[[package]] +name = "ethereum-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2827b94c556145446fcce834ca86b7abf0c39a805883fe20e72c5bfdb5a0dc6" +dependencies = [ + "ethbloom 0.12.1", + "fixed-hash", + "impl-codec 0.6.0", + "impl-rlp", + "impl-serde", + "primitive-types 0.11.1", + "scale-info", + "uint", +] + [[package]] name = "event-listener" version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "evm" +version = "0.35.0" +source = "git+https://github.com/NunoAlexandre/evm?branch=unfork-v0.9.29#6534c1dd8ad77b53d05032f80e8a5f2de4d37fd2" +dependencies = [ + "auto_impl", + "environmental", + "ethereum", + "evm-core", + "evm-gasometer", + "evm-runtime", + "log", + "parity-scale-codec 3.2.1", + "primitive-types 0.11.1", + "rlp", + "scale-info", + "serde", + "sha3 0.10.6", +] + +[[package]] +name = "evm-core" +version = "0.35.0" +source = "git+https://github.com/NunoAlexandre/evm?branch=unfork-v0.9.29#6534c1dd8ad77b53d05032f80e8a5f2de4d37fd2" +dependencies = [ + "parity-scale-codec 3.2.1", + "primitive-types 0.11.1", + "scale-info", + "serde", +] + +[[package]] +name = "evm-gasometer" +version = "0.35.0" +source = "git+https://github.com/NunoAlexandre/evm?branch=unfork-v0.9.29#6534c1dd8ad77b53d05032f80e8a5f2de4d37fd2" +dependencies = [ + "environmental", + "evm-core", + "evm-runtime", + "primitive-types 0.11.1", +] + +[[package]] +name = "evm-runtime" +version = "0.35.0" +source = "git+https://github.com/NunoAlexandre/evm?branch=unfork-v0.9.29#6534c1dd8ad77b53d05032f80e8a5f2de4d37fd2" +dependencies = [ + "auto_impl", + "environmental", + "evm-core", + "primitive-types 0.11.1", + "sha3 0.10.6", +] + [[package]] name = "exit-future" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", ] [[package]] @@ -2781,14 +2956,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] @@ -2798,11 +2973,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b22349c6a11563a202d95772a68e0fcf56119e74ea8a2a19cf2301460fcd0df5" dependencies = [ "either", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", "num-traits", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "scale-info", ] @@ -2856,7 +3031,7 @@ name = "fork-tree" version = "3.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", ] [[package]] @@ -2868,6 +3043,86 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fp-consensus" +version = "2.0.0-dev" +source = "git+https://github.com/NunoAlexandre/frontier?branch=unfork-v0.9.29#35f18b27cbfbadee686234f5c5fefed115419579" +dependencies = [ + "ethereum", + "parity-scale-codec 3.2.1", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "fp-ethereum" +version = "1.0.0-dev" +source = "git+https://github.com/NunoAlexandre/frontier?branch=unfork-v0.9.29#35f18b27cbfbadee686234f5c5fefed115419579" +dependencies = [ + "ethereum", + "ethereum-types 0.13.1", + "fp-evm", + "frame-support", + "num_enum", + "parity-scale-codec 3.2.1", + "sp-core", + "sp-std", +] + +[[package]] +name = "fp-evm" +version = "3.0.0-dev" +source = "git+https://github.com/NunoAlexandre/frontier?branch=unfork-v0.9.29#35f18b27cbfbadee686234f5c5fefed115419579" +dependencies = [ + "evm", + "frame-support", + "parity-scale-codec 3.2.1", + "serde", + "sp-core", + "sp-std", +] + +[[package]] +name = "fp-rpc" +version = "3.0.0-dev" +source = "git+https://github.com/NunoAlexandre/frontier?branch=unfork-v0.9.29#35f18b27cbfbadee686234f5c5fefed115419579" +dependencies = [ + "ethereum", + "ethereum-types 0.13.1", + "fp-evm", + "parity-scale-codec 3.2.1", + "scale-info", + "sp-api", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "fp-self-contained" +version = "1.0.0-dev" +source = "git+https://github.com/NunoAlexandre/frontier?branch=unfork-v0.9.29#35f18b27cbfbadee686234f5c5fefed115419579" +dependencies = [ + "ethereum", + "frame-support", + "parity-scale-codec 3.2.1", + "parity-util-mem", + "scale-info", + "serde", + "sp-runtime", +] + +[[package]] +name = "fp-storage" +version = "2.0.0" +source = "git+https://github.com/NunoAlexandre/frontier?branch=unfork-v0.9.29#35f18b27cbfbadee686234f5c5fefed115419579" +dependencies = [ + "parity-scale-codec 3.2.1", + "serde", +] + [[package]] name = "fragile" version = "2.0.0" @@ -2883,7 +3138,7 @@ dependencies = [ "frame-system", "linregress", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "paste", "scale-info", "serde", @@ -2919,7 +3174,7 @@ dependencies = [ "linked-hash-map", "log", "memory-db", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "rand 0.8.5", "rand_pcg 0.3.1", "sc-block-builder", @@ -2967,7 +3222,7 @@ dependencies = [ "frame-election-provider-solution-type", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-arithmetic", "sp-npos-elections", @@ -2983,7 +3238,7 @@ dependencies = [ "frame-support", "frame-system", "frame-try-runtime", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -2999,7 +3254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" dependencies = [ "cfg-if 1.0.0", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", ] @@ -3016,7 +3271,7 @@ dependencies = [ "k256", "log", "once_cell", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "paste", "scale-info", "serde", @@ -3078,7 +3333,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "frame-support", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -3096,7 +3351,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-runtime", @@ -3108,7 +3363,7 @@ name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-api", ] @@ -3118,7 +3373,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-api", "sp-runtime", "sp-std", @@ -3193,11 +3448,11 @@ dependencies = [ "frame-support", "frame-system", "fudge-companion", - "futures 0.3.24", + "futures 0.3.25", "lazy_static", "node-primitives", "pallet-babe", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-cli", "polkadot-core-primitives", @@ -3237,6 +3492,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + [[package]] name = "funty" version = "2.0.0" @@ -3251,9 +3512,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -3266,9 +3527,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -3276,15 +3537,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -3294,9 +3555,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-lite" @@ -3315,9 +3576,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", @@ -3337,15 +3598,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-timer" @@ -3355,9 +3616,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures 0.1.31", "futures-channel", @@ -3425,9 +3686,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if 1.0.0", "libc", @@ -3499,9 +3760,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ "bytes", "fnv", @@ -3738,9 +3999,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.51" +version = "0.1.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" +checksum = "c422fb4f6e80490d0afcacf5c3de2c22ab8e631e0cd7cb2d4a3baf844720a52a" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3800,7 +4061,7 @@ dependencies = [ "async-io", "core-foundation", "fnv", - "futures 0.3.24", + "futures 0.3.25", "if-addrs", "ipnet", "log", @@ -3809,13 +4070,31 @@ dependencies = [ "windows", ] +[[package]] +name = "impl-codec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" +dependencies = [ + "parity-scale-codec 2.3.1", +] + [[package]] name = "impl-codec" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", ] [[package]] @@ -3890,9 +4169,9 @@ checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" [[package]] name = "io-lifetimes" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" +checksum = "e6e481ccbe3dea62107216d0d1138bb8ad8e5e5c43009a098bd1990272c497b0" [[package]] name = "ip_network" @@ -4119,7 +4398,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-primitives", - "bitvec", + "bitvec 1.0.1", "frame-election-provider-support", "frame-executive", "frame-support", @@ -4165,7 +4444,7 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -4275,9 +4554,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.135" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "libloading" @@ -4312,9 +4591,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" dependencies = [ "bytes", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", - "getrandom 0.2.7", + "getrandom 0.2.8", "instant", "lazy_static", "libp2p-autonat", @@ -4356,7 +4635,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", @@ -4379,7 +4658,7 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "lazy_static", @@ -4410,7 +4689,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" dependencies = [ "flate2", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", ] @@ -4421,7 +4700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" dependencies = [ "async-std-resolver", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "log", "parking_lot 0.12.1", @@ -4437,7 +4716,7 @@ checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "libp2p-swarm", "log", @@ -4458,7 +4737,7 @@ dependencies = [ "byteorder", "bytes", "fnv", - "futures 0.3.24", + "futures 0.3.25", "hex_fmt", "instant", "libp2p-core", @@ -4482,7 +4761,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" dependencies = [ "asynchronous-codec", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "libp2p-core", "libp2p-swarm", @@ -4507,7 +4786,7 @@ dependencies = [ "bytes", "either", "fnv", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", @@ -4533,7 +4812,7 @@ dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.24", + "futures 0.3.25", "if-watch", "lazy_static", "libp2p-core", @@ -4569,7 +4848,7 @@ checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" dependencies = [ "asynchronous-codec", "bytes", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "log", "nohash-hasher", @@ -4587,7 +4866,7 @@ checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" dependencies = [ "bytes", "curve25519-dalek 3.2.0", - "futures 0.3.24", + "futures 0.3.25", "lazy_static", "libp2p-core", "log", @@ -4607,7 +4886,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", @@ -4625,7 +4904,7 @@ checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" dependencies = [ "asynchronous-codec", "bytes", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "log", "prost", @@ -4640,12 +4919,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a5a702574223aa55d8878bdc8bf55c84a6086f87ddaddc28ce730b4caa81538" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "log", "pin-project", "rand 0.8.5", "salsa20", - "sha3", + "sha3 0.10.6", ] [[package]] @@ -4657,7 +4936,7 @@ dependencies = [ "asynchronous-codec", "bytes", "either", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", @@ -4682,7 +4961,7 @@ checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" dependencies = [ "asynchronous-codec", "bimap", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", @@ -4705,7 +4984,7 @@ checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" dependencies = [ "async-trait", "bytes", - "futures 0.3.24", + "futures 0.3.25", "instant", "libp2p-core", "libp2p-swarm", @@ -4723,7 +5002,7 @@ checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" dependencies = [ "either", "fnv", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", @@ -4752,7 +5031,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" dependencies = [ "async-io", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "if-watch", "ipnet", @@ -4769,7 +5048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" dependencies = [ "async-std", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "log", ] @@ -4780,7 +5059,7 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -4795,7 +5074,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" dependencies = [ "either", - "futures 0.3.24", + "futures 0.3.25", "futures-rustls", "libp2p-core", "log", @@ -4813,7 +5092,7 @@ version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "parking_lot 0.12.1", "thiserror", @@ -5123,7 +5402,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "rand 0.8.5", "thrift", ] @@ -5145,14 +5424,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] @@ -5230,7 +5509,7 @@ dependencies = [ "digest 0.10.5", "multihash-derive", "sha2 0.10.6", - "sha3", + "sha3 0.10.6", "unsigned-varint", ] @@ -5261,7 +5540,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" dependencies = [ "bytes", - "futures 0.3.24", + "futures 0.3.25", "log", "pin-project", "smallvec", @@ -5357,7 +5636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ "bytes", - "futures 0.3.24", + "futures 0.3.25", "log", "netlink-packet-core", "netlink-sys", @@ -5373,7 +5652,7 @@ checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" dependencies = [ "async-io", "bytes", - "futures 0.3.24", + "futures 0.3.25", "libc", "log", ] @@ -5395,7 +5674,7 @@ version = "0.9.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "clap", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-cli", "sc-client-api", "sc-executor", @@ -5412,7 +5691,7 @@ version = "2.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-core", @@ -5530,6 +5809,27 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "object" version = "0.28.4" @@ -5582,7 +5882,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "async-trait", "dyn-clonable", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "orchestra-proc-macro", "pin-project", @@ -5623,7 +5923,7 @@ dependencies = [ "frame-system", "orml-traits", "pallet-xcm", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -5641,7 +5941,7 @@ dependencies = [ "frame-support", "frame-system", "orml-traits", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -5657,7 +5957,7 @@ dependencies = [ "impl-trait-for-tuples", "num-traits", "orml-utilities", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -5672,7 +5972,7 @@ version = "0.4.1-dev" source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.29#44fda4432b71f49ee59a650cf4775db895ab97af" dependencies = [ "frame-support", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -5688,7 +5988,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-xcm", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-std", "xcm", @@ -5701,7 +6001,7 @@ source = "git+https://github.com/open-web3-stack/open-runtime-module-library?bra dependencies = [ "frame-support", "orml-traits", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-runtime", "sp-std", "xcm", @@ -5719,7 +6019,7 @@ dependencies = [ "orml-traits", "orml-xcm-support", "pallet-xcm", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -5731,9 +6031,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.3.0" +version = "6.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9" [[package]] name = "owning_ref" @@ -5756,7 +6056,7 @@ dependencies = [ "pallet-balances", "pallet-randomness-collective-flip", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-arithmetic", @@ -5774,7 +6074,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-transaction-payment", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -5790,7 +6090,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-consensus-aura", @@ -5806,7 +6106,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-authority-discovery", @@ -5822,7 +6122,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-authorship", "sp-runtime", @@ -5841,7 +6141,7 @@ dependencies = [ "pallet-authorship", "pallet-session", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-consensus-babe", @@ -5862,7 +6162,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-std", @@ -5877,7 +6177,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-std", @@ -5892,7 +6192,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -5913,7 +6213,7 @@ dependencies = [ "pallet-beefy", "pallet-mmr", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -5931,7 +6231,7 @@ dependencies = [ "frame-system", "log", "pallet-treasury", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -5953,7 +6253,7 @@ dependencies = [ "pallet-balances", "pallet-fees", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "runtime-common", "scale-info", "sp-core", @@ -5972,7 +6272,7 @@ dependencies = [ "log", "pallet-bounties", "pallet-treasury", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -5991,7 +6291,7 @@ dependencies = [ "frame-system", "node-primitives", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6007,7 +6307,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6026,7 +6326,7 @@ dependencies = [ "log", "pallet-authorship", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "rand 0.8.5", "scale-info", "serde", @@ -6044,7 +6344,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6052,6 +6352,42 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-connectors" +version = "0.0.1" +dependencies = [ + "cfg-primitives", + "cfg-traits", + "cfg-types", + "ethabi", + "frame-benchmarking", + "frame-support", + "frame-system", + "hex", + "orml-tokens", + "orml-traits", + "pallet-balances", + "pallet-ethereum", + "pallet-ethereum-xcm", + "pallet-interest-accrual", + "pallet-loans", + "pallet-permissions", + "pallet-pools", + "pallet-timestamp", + "pallet-uniques", + "pallet-xcm-transactor", + "parity-scale-codec 3.2.1", + "runtime-common", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-primitives", +] + [[package]] name = "pallet-crowdloan-claim" version = "0.1.0" @@ -6065,7 +6401,7 @@ dependencies = [ "pallet-balances", "pallet-crowdloan-reward", "pallet-vesting", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "proofs", "scale-info", "serde", @@ -6089,7 +6425,7 @@ dependencies = [ "pallet-balances", "pallet-indices", "pallet-vesting", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6106,7 +6442,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -6124,7 +6460,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "rand 0.7.3", "scale-info", "sp-arithmetic", @@ -6146,7 +6482,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6155,6 +6491,83 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-ethereum" +version = "4.0.0-dev" +source = "git+https://github.com/NunoAlexandre/frontier?branch=unfork-v0.9.29#35f18b27cbfbadee686234f5c5fefed115419579" +dependencies = [ + "ethereum", + "ethereum-types 0.13.1", + "evm", + "fp-consensus", + "fp-ethereum", + "fp-evm", + "fp-rpc", + "fp-self-contained", + "fp-storage", + "frame-support", + "frame-system", + "pallet-evm", + "pallet-timestamp", + "parity-scale-codec 3.2.1", + "rlp", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-ethereum-xcm" +version = "1.0.0-dev" +source = "git+https://github.com/NunoAlexandre/moonbeam?branch=unfork-v0.9.29#1b32dfe52897697146bde4927ce9551439a91548" +dependencies = [ + "ethereum", + "ethereum-types 0.13.1", + "fp-ethereum", + "fp-evm", + "fp-rpc", + "fp-self-contained", + "frame-support", + "frame-system", + "pallet-evm", + "pallet-timestamp", + "parity-scale-codec 3.2.1", + "rlp", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", + "xcm-primitives", +] + +[[package]] +name = "pallet-evm" +version = "6.0.0-dev" +source = "git+https://github.com/NunoAlexandre/frontier?branch=unfork-v0.9.29#35f18b27cbfbadee686234f5c5fefed115419579" +dependencies = [ + "environmental", + "evm", + "fp-evm", + "frame-benchmarking", + "frame-support", + "frame-system", + "hex", + "log", + "pallet-timestamp", + "parity-scale-codec 3.2.1", + "primitive-types 0.11.1", + "rlp", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-fees" version = "2.0.0" @@ -6166,7 +6579,7 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-treasury", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6182,7 +6595,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-arithmetic", "sp-runtime", @@ -6200,7 +6613,7 @@ dependencies = [ "log", "pallet-authorship", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-core", @@ -6221,7 +6634,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6237,7 +6650,7 @@ dependencies = [ "frame-system", "log", "pallet-authorship", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-core", @@ -6254,7 +6667,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6275,7 +6688,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-arithmetic", @@ -6300,7 +6713,7 @@ dependencies = [ "orml-traits", "pallet-balances", "pallet-restricted-tokens", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "rand 0.8.5", "runtime-common", "scale-info", @@ -6320,7 +6733,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6338,7 +6751,7 @@ dependencies = [ "frame-support", "frame-system", "num-traits", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6367,7 +6780,7 @@ dependencies = [ "pallet-timestamp", "pallet-uniques", "parachain-info", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-arithmetic", @@ -6387,7 +6800,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6407,7 +6820,7 @@ dependencies = [ "pallet-balances", "pallet-proxy", "pallet-vesting", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "rand 0.8.5", "scale-info", "sp-core", @@ -6426,7 +6839,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6441,7 +6854,7 @@ version = "3.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "jsonrpsee", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "serde", "sp-api", "sp-blockchain", @@ -6458,7 +6871,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6480,7 +6893,7 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "proofs", "scale-info", "sp-core", @@ -6503,7 +6916,7 @@ dependencies = [ "orml-traits", "pallet-balances", "pallet-uniques", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6519,7 +6932,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6533,7 +6946,7 @@ name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-api", "sp-std", ] @@ -6547,7 +6960,7 @@ dependencies = [ "frame-system", "log", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -6565,7 +6978,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -6593,7 +7006,7 @@ dependencies = [ "pallet-restricted-tokens", "pallet-timestamp", "parachain-info", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-parachain", "rand 0.8.5", "rev_slice", @@ -6615,7 +7028,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6631,7 +7044,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6645,7 +7058,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "safe-mix", "scale-info", "sp-runtime", @@ -6660,7 +7073,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6681,7 +7094,7 @@ dependencies = [ "orml-traits", "pallet-balances", "pallet-permissions", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -6700,7 +7113,7 @@ dependencies = [ "num-traits", "orml-tokens", "orml-traits", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6718,7 +7131,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6735,7 +7148,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6769,7 +7182,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "rand_chacha 0.2.2", "scale-info", "sp-runtime", @@ -6788,7 +7201,7 @@ dependencies = [ "log", "pallet-authorship", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "rand_chacha 0.2.2", "scale-info", "serde", @@ -6826,7 +7239,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6842,7 +7255,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-inherents", "sp-io", @@ -6860,7 +7273,7 @@ dependencies = [ "frame-system", "log", "pallet-treasury", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6876,7 +7289,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6892,7 +7305,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-api", "sp-blockchain", "sp-core", @@ -6906,7 +7319,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "pallet-transaction-payment", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-api", "sp-runtime", ] @@ -6921,7 +7334,7 @@ dependencies = [ "frame-system", "impl-trait-for-tuples", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -6937,7 +7350,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-std", @@ -6951,7 +7364,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6968,7 +7381,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-std", @@ -6982,7 +7395,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6992,6 +7405,29 @@ dependencies = [ "xcm-executor", ] +[[package]] +name = "pallet-xcm-transactor" +version = "0.2.0" +source = "git+https://github.com/NunoAlexandre/moonbeam?branch=unfork-v0.9.29#1b32dfe52897697146bde4927ce9551439a91548" +dependencies = [ + "cumulus-primitives-core", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "orml-traits", + "parity-scale-codec 3.2.1", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-builder", + "xcm-executor", + "xcm-primitives", +] + [[package]] name = "parachain-info" version = "0.1.0" @@ -7000,7 +7436,7 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", ] @@ -7024,6 +7460,20 @@ dependencies = [ "snap", ] +[[package]] +name = "parity-scale-codec" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +dependencies = [ + "arrayvec 0.7.2", + "bitvec 0.20.4", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive 2.3.1", + "serde", +] + [[package]] name = "parity-scale-codec" version = "3.2.1" @@ -7031,14 +7481,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" dependencies = [ "arrayvec 0.7.2", - "bitvec", + "bitvec 1.0.1", "byte-slice-cast", "bytes", "impl-trait-for-tuples", - "parity-scale-codec-derive", + "parity-scale-codec-derive 3.1.3", "serde", ] +[[package]] +name = "parity-scale-codec-derive" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "parity-scale-codec-derive" version = "3.1.3" @@ -7064,11 +7526,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ "cfg-if 1.0.0", + "ethereum-types 0.13.1", "hashbrown 0.12.3", "impl-trait-for-tuples", + "lru 0.7.8", "parity-util-mem-derive", "parking_lot 0.12.1", - "primitive-types", + "primitive-types 0.11.1", "smallvec", "winapi", ] @@ -7283,9 +7747,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "platforms" @@ -7298,7 +7762,7 @@ name = "polkadot-approval-distribution" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7313,7 +7777,7 @@ name = "polkadot-availability-bitfield-distribution" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7329,9 +7793,9 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "derive_more", "fatality", - "futures 0.3.24", + "futures 0.3.25", "lru 0.7.8", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7351,9 +7815,9 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "fatality", - "futures 0.3.24", + "futures 0.3.25", "lru 0.7.8", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7373,7 +7837,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "clap", "frame-benchmarking-cli", - "futures 0.3.24", + "futures 0.3.25", "log", "polkadot-client", "polkadot-node-core-pvf", @@ -7439,7 +7903,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "always-assert", "fatality", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7458,7 +7922,7 @@ name = "polkadot-core-primitives" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-util-mem", "scale-info", "sp-core", @@ -7473,9 +7937,9 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "derive_more", "fatality", - "futures 0.3.24", + "futures 0.3.25", "lru 0.7.8", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7494,7 +7958,7 @@ name = "polkadot-erasure-coding" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-node-primitives", "polkadot-primitives", "reed-solomon-novelpoly", @@ -7508,7 +7972,7 @@ name = "polkadot-gossip-support" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -7532,8 +7996,8 @@ dependencies = [ "async-trait", "bytes", "fatality", - "futures 0.3.24", - "parity-scale-codec", + "futures 0.3.25", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -7552,8 +8016,8 @@ name = "polkadot-node-collation-generation" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.24", - "parity-scale-codec", + "futures 0.3.25", + "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7570,14 +8034,14 @@ name = "polkadot-node-core-approval-voting" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "bitvec", + "bitvec 1.0.1", "derive_more", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "kvdb", "lru 0.7.8", "merlin", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7599,11 +8063,11 @@ name = "polkadot-node-core-av-store" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "bitvec", - "futures 0.3.24", + "bitvec 1.0.1", + "futures 0.3.25", "futures-timer", "kvdb", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7619,9 +8083,9 @@ name = "polkadot-node-core-backing" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "bitvec", + "bitvec 1.0.1", "fatality", - "futures 0.3.24", + "futures 0.3.25", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7638,7 +8102,7 @@ name = "polkadot-node-core-bitfield-signing" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -7654,8 +8118,8 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", - "futures 0.3.24", - "parity-scale-codec", + "futures 0.3.25", + "parity-scale-codec 3.2.1", "polkadot-node-core-pvf", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7671,7 +8135,7 @@ name = "polkadot-node-core-chain-api" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -7686,10 +8150,10 @@ name = "polkadot-node-core-chain-selection" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "kvdb", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7704,10 +8168,10 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "fatality", - "futures 0.3.24", + "futures 0.3.25", "kvdb", "lru 0.7.8", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7723,7 +8187,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "polkadot-node-subsystem", "polkadot-primitives", @@ -7739,9 +8203,9 @@ name = "polkadot-node-core-provisioner" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "bitvec", + "bitvec 1.0.1", "fatality", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7761,9 +8225,9 @@ dependencies = [ "assert_matches", "async-process", "async-std", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "pin-project", "polkadot-core-primitives", "polkadot-node-subsystem-util", @@ -7789,7 +8253,7 @@ name = "polkadot-node-core-pvf-checker" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7805,7 +8269,7 @@ name = "polkadot-node-core-runtime-api" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "memory-lru", "parity-util-mem", "polkadot-node-subsystem", @@ -7825,7 +8289,7 @@ dependencies = [ "lazy_static", "log", "mick-jaeger", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-node-primitives", "polkadot-primitives", @@ -7840,10 +8304,10 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bs58", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-primitives", "prioritized-metered-channel", "sc-cli", @@ -7861,9 +8325,9 @@ dependencies = [ "async-trait", "derive_more", "fatality", - "futures 0.3.24", + "futures 0.3.25", "hex", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-primitives", @@ -7881,8 +8345,8 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bounded-vec", - "futures 0.3.24", - "parity-scale-codec", + "futures 0.3.25", + "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-primitives", "schnorrkel", @@ -7914,7 +8378,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "async-trait", "derive_more", - "futures 0.3.24", + "futures 0.3.25", "orchestra", "polkadot-node-jaeger", "polkadot-node-network-protocol", @@ -7938,12 +8402,12 @@ dependencies = [ "async-trait", "derive_more", "fatality", - "futures 0.3.24", + "futures 0.3.25", "itertools", "kvdb", "lru 0.7.8", "parity-db", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-util-mem", "parking_lot 0.11.2", "pin-project", @@ -7969,7 +8433,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "lru 0.7.8", "orchestra", @@ -7993,7 +8457,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "derive_more", "frame-support", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-util-mem", "polkadot-core-primitives", "scale-info", @@ -8023,10 +8487,10 @@ name = "polkadot-primitives" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "bitvec", + "bitvec 1.0.1", "frame-system", "hex-literal 0.3.4", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-util-mem", "polkadot-core-primitives", "polkadot-parachain", @@ -8086,7 +8550,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-primitives", - "bitvec", + "bitvec 1.0.1", "frame-election-provider-support", "frame-executive", "frame-support", @@ -8128,7 +8592,7 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-constants", @@ -8167,7 +8631,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-primitives", - "bitvec", + "bitvec 1.0.1", "frame-election-provider-support", "frame-support", "frame-system", @@ -8185,7 +8649,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-treasury", "pallet-vesting", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-primitives", "polkadot-runtime-parachains", "rustc-hex", @@ -8224,7 +8688,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bs58", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-primitives", "sp-std", "sp-tracing", @@ -8236,7 +8700,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bitflags", - "bitvec", + "bitvec 1.0.1", "derive_more", "frame-support", "frame-system", @@ -8249,7 +8713,7 @@ dependencies = [ "pallet-staking", "pallet-timestamp", "pallet-vesting", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-primitives", "polkadot-runtime-metrics", "rand 0.8.5", @@ -8280,7 +8744,7 @@ dependencies = [ "beefy-primitives", "frame-support", "frame-system-rpc-runtime-api", - "futures 0.3.24", + "futures 0.3.25", "hex-literal 0.3.4", "kvdb", "kvdb-rocksdb", @@ -8378,9 +8842,9 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "arrayvec 0.5.2", "fatality", - "futures 0.3.24", + "futures 0.3.25", "indexmap", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -8397,16 +8861,16 @@ name = "polkadot-statement-table" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-primitives", "sp-core", ] [[package]] name = "polling" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899b00b9c8ab553c743b3e11e87c5c7d423b2a2de229ba95b24a756344748011" +checksum = "ab4609a838d88b73d8238967b60dd115cc08d38e2bbaf51ee1e4b695f89122e2" dependencies = [ "autocfg", "cfg-if 1.0.0", @@ -8475,6 +8939,17 @@ dependencies = [ "termtree", ] +[[package]] +name = "primitive-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" +dependencies = [ + "fixed-hash", + "impl-codec 0.5.1", + "uint", +] + [[package]] name = "primitive-types" version = "0.11.1" @@ -8482,7 +8957,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" dependencies = [ "fixed-hash", - "impl-codec", + "impl-codec 0.6.0", + "impl-rlp", "impl-serde", "scale-info", "uint", @@ -8496,7 +8972,7 @@ dependencies = [ "coarsetime", "crossbeam-queue", "derive_more", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "nanorand", "thiserror", @@ -8555,9 +9031,9 @@ dependencies = [ [[package]] name = "prometheus" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c8babc29389186697fe5a2a4859d697825496b83db5d0b65271cdc0488e88c" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ "cfg-if 1.0.0", "fnv", @@ -8594,7 +9070,7 @@ dependencies = [ name = "proofs" version = "2.0.0" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-std", @@ -8703,6 +9179,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" + [[package]] name = "radium" version = "0.7.0" @@ -8769,7 +9251,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.8", ] [[package]] @@ -8854,7 +9336,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.8", "redox_syscall", "thiserror", ] @@ -8950,7 +9432,7 @@ dependencies = [ "env_logger", "jsonrpsee", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "serde", "serde_json", "sp-core", @@ -9010,6 +9492,27 @@ dependencies = [ "winapi", ] +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rlp-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "rocksdb" version = "0.18.0" @@ -9055,7 +9558,7 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-utility", "pallet-xcm", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-primitives", "polkadot-runtime-common", @@ -9100,9 +9603,9 @@ dependencies = [ [[package]] name = "rpassword" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b763cb66df1c928432cc35053f8bd4cec3335d8559fc16010017d16b3c1680" +checksum = "20c9f5d2a0c3e2ea729ab3706d22217177770654c3ef5056b68b69d07332d3f5" dependencies = [ "libc", "winapi", @@ -9115,7 +9618,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ "async-global-executor", - "futures 0.3.24", + "futures 0.3.25", "log", "netlink-packet-route", "netlink-proto", @@ -9141,7 +9644,7 @@ dependencies = [ "pallet-permissions", "pallet-pools", "pallet-treasury", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "smallvec", @@ -9170,6 +9673,7 @@ dependencies = [ "frame-support", "frame-system", "fudge", + "hex", "kusama-runtime", "lazy_static", "node-primitives", @@ -9182,6 +9686,7 @@ dependencies = [ "pallet-aura", "pallet-babe", "pallet-balances", + "pallet-connectors", "pallet-loans", "pallet-permissions", "pallet-pools", @@ -9189,7 +9694,7 @@ dependencies = [ "pallet-uniques", "pallet-xcm", "parachain-info", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", @@ -9275,13 +9780,13 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.11" +version = "0.35.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb2fda4666def1433b1b05431ab402e42a1084285477222b72d6c564c417cef" +checksum = "985947f9b6423159c4726323f373be0a21bdb514c5af06a849cb3d2dce2d01e8" dependencies = [ "bitflags", "errno", - "io-lifetimes 0.7.3", + "io-lifetimes 0.7.4", "libc", "linux-raw-sys 0.0.46", "windows-sys 0.36.1", @@ -9332,7 +9837,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "pin-project", "static_assertions", ] @@ -9387,12 +9892,12 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "ip_network", "libp2p", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "prost", "prost-build", "rand 0.7.3", @@ -9413,10 +9918,10 @@ name = "sc-basic-authorship" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-block-builder", "sc-client-api", "sc-proposer-metrics", @@ -9436,7 +9941,7 @@ name = "sc-block-builder" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-client-api", "sp-api", "sp-block-builder", @@ -9454,7 +9959,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "impl-trait-for-tuples", "memmap2", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-chain-spec-derive", "sc-network-common", "sc-telemetry", @@ -9483,12 +9988,12 @@ dependencies = [ "chrono", "clap", "fdlimit", - "futures 0.3.24", + "futures 0.3.25", "hex", "libp2p", "log", "names", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "rand 0.7.3", "regex", "rpassword", @@ -9520,10 +10025,10 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "fnv", - "futures 0.3.24", + "futures 0.3.25", "hash-db", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-executor", "sc-transaction-pool-api", @@ -9554,7 +10059,7 @@ dependencies = [ "linked-hash-map", "log", "parity-db", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-client-api", "sc-state-db", @@ -9573,7 +10078,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "libp2p", "log", @@ -9597,9 +10102,9 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-block-builder", "sc-client-api", "sc-consensus", @@ -9627,13 +10132,13 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "async-trait", "fork-tree", - "futures 0.3.24", + "futures 0.3.25", "log", "merlin", "num-bigint", "num-rational 0.2.4", "num-traits", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "rand 0.7.3", "sc-client-api", @@ -9667,7 +10172,7 @@ name = "sc-consensus-babe-rpc" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "sc-consensus-babe", "sc-consensus-epochs", @@ -9690,7 +10195,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "fork-tree", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-consensus", "sp-blockchain", @@ -9703,10 +10208,10 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-consensus", "sc-telemetry", @@ -9740,7 +10245,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "lazy_static", "lru 0.7.8", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-executor-common", "sc-executor-wasmi", @@ -9766,7 +10271,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "environmental", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-allocator", "sp-maybe-compressed-blob", "sp-sandbox", @@ -9782,7 +10287,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -9800,10 +10305,10 @@ dependencies = [ "libc", "log", "once_cell", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-wasm 0.42.2", "rustix 0.33.7", - "rustix 0.35.11", + "rustix 0.35.12", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -9822,11 +10327,11 @@ dependencies = [ "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "hex", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "rand 0.8.5", "sc-block-builder", @@ -9859,10 +10364,10 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "finality-grandpa", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-finality-grandpa", "sc-rpc", @@ -9880,7 +10385,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ansi_term", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", "parity-util-mem", @@ -9919,7 +10424,7 @@ dependencies = [ "either", "fnv", "fork-tree", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "hex", "ip_network", @@ -9928,7 +10433,7 @@ dependencies = [ "linked_hash_set", "log", "lru 0.7.8", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "pin-project", "prost", @@ -9963,9 +10468,9 @@ dependencies = [ "async-trait", "bitflags", "bytes", - "futures 0.3.24", + "futures 0.3.25", "libp2p", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "prost-build", "sc-consensus", "sc-peerset", @@ -9984,7 +10489,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ahash", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "libp2p", "log", @@ -10001,11 +10506,11 @@ name = "sc-network-light" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "hex", "libp2p", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "prost", "prost-build", "sc-client-api", @@ -10023,12 +10528,12 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "fork-tree", - "futures 0.3.24", + "futures 0.3.25", "hex", "libp2p", "log", "lru 0.7.8", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "prost", "prost-build", "sc-client-api", @@ -10052,7 +10557,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "bytes", "fnv", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "hex", "hyper", @@ -10060,7 +10565,7 @@ dependencies = [ "libp2p", "num_cpus", "once_cell", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "rand 0.7.3", "sc-client-api", @@ -10080,7 +10585,7 @@ name = "sc-peerset" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "libp2p", "log", "sc-utils", @@ -10102,11 +10607,11 @@ name = "sc-rpc" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "hash-db", "jsonrpsee", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-block-builder", "sc-chain-spec", @@ -10132,10 +10637,10 @@ name = "sc-rpc-api" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-chain-spec", "sc-transaction-pool-api", @@ -10155,7 +10660,7 @@ name = "sc-rpc-server" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", "serde_json", @@ -10171,12 +10676,12 @@ dependencies = [ "async-trait", "directories", "exit-future", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "hash-db", "jsonrpsee", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-util-mem", "parking_lot 0.12.1", "pin-project", @@ -10236,11 +10741,11 @@ version = "2.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "fdlimit", - "futures 0.3.24", + "futures 0.3.25", "hex", "hex-literal 0.3.4", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-block-builder", "sc-client-api", @@ -10274,7 +10779,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-util-mem", "parity-util-mem-derive", "parking_lot 0.12.1", @@ -10288,7 +10793,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "jsonrpsee", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-chain-spec", "sc-client-api", "sc-consensus-babe", @@ -10306,7 +10811,7 @@ name = "sc-sysinfo" version = "6.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "libc", "log", "rand 0.7.3", @@ -10326,7 +10831,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "chrono", - "futures 0.3.24", + "futures 0.3.25", "libp2p", "log", "parking_lot 0.12.1", @@ -10385,11 +10890,11 @@ name = "sc-transaction-pool" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "linked-hash-map", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-util-mem", "parking_lot 0.12.1", "sc-client-api", @@ -10411,7 +10916,7 @@ name = "sc-transaction-pool-api" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "log", "serde", "sp-blockchain", @@ -10424,7 +10929,7 @@ name = "sc-utils" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "lazy_static", "log", @@ -10438,10 +10943,10 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "333af15b02563b8182cd863f925bd31ef8fa86a0e095d30c091956057d436153" dependencies = [ - "bitvec", + "bitvec 1.0.1", "cfg-if 1.0.0", "derive_more", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info-derive", "serde", ] @@ -10522,9 +11027,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff" +checksum = "ff55dc09d460954e9ef2fa8a7ced735a964be9981fd50e870b2b3b0705e14964" dependencies = [ "secp256k1-sys", ] @@ -10605,18 +11110,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.145" +version = "1.0.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" +checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.145" +version = "1.0.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" +checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" dependencies = [ "proc-macro2", "quote", @@ -10625,9 +11130,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" +checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" dependencies = [ "itoa", "ryu", @@ -10703,6 +11208,31 @@ dependencies = [ "digest 0.10.5", ] +[[package]] +name = "sha3" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" +dependencies = [ + "block-buffer 0.7.3", + "byte-tools", + "digest 0.8.1", + "keccak", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug 0.3.0", +] + [[package]] name = "sha3" version = "0.10.6" @@ -10790,7 +11320,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "enumn", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "paste", "sp-runtime", "sp-std", @@ -10853,7 +11383,7 @@ dependencies = [ "base64", "bytes", "flate2", - "futures 0.3.24", + "futures 0.3.25", "httparse", "log", "rand 0.8.5", @@ -10867,7 +11397,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "hash-db", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-api-proc-macro", "sp-core", "sp-runtime", @@ -10895,7 +11425,7 @@ name = "sp-application-crypto" version = "6.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -10910,7 +11440,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-debug-derive", @@ -10923,7 +11453,7 @@ name = "sp-authority-discovery" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-api", "sp-application-crypto", @@ -10937,7 +11467,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-inherents", "sp-runtime", "sp-std", @@ -10948,7 +11478,7 @@ name = "sp-block-builder" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-api", "sp-inherents", "sp-runtime", @@ -10960,10 +11490,10 @@ name = "sp-blockchain" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "log", "lru 0.7.8", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sp-api", "sp-consensus", @@ -10979,10 +11509,10 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-core", "sp-inherents", "sp-runtime", @@ -10998,7 +11528,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-api", "sp-application-crypto", @@ -11017,7 +11547,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "async-trait", "merlin", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-api", @@ -11038,7 +11568,7 @@ name = "sp-consensus-slots" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-arithmetic", @@ -11052,7 +11582,7 @@ name = "sp-consensus-vrf" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "schnorrkel", "sp-core", @@ -11071,7 +11601,7 @@ dependencies = [ "byteorder", "dyn-clonable", "ed25519-zebra", - "futures 0.3.24", + "futures 0.3.25", "hash-db", "hash256-std-hasher", "hex", @@ -11081,10 +11611,10 @@ dependencies = [ "log", "merlin", "num-traits", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-util-mem", "parking_lot 0.12.1", - "primitive-types", + "primitive-types 0.11.1", "rand 0.7.3", "regex", "scale-info", @@ -11115,7 +11645,7 @@ dependencies = [ "byteorder", "digest 0.10.5", "sha2 0.10.6", - "sha3", + "sha3 0.10.6", "sp-std", "twox-hash", ] @@ -11156,7 +11686,7 @@ version = "0.12.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "environmental", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-std", "sp-storage", ] @@ -11168,7 +11698,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "finality-grandpa", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-api", @@ -11186,7 +11716,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "async-trait", "impl-trait-for-tuples", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-core", "sp-runtime", "sp-std", @@ -11199,11 +11729,11 @@ version = "6.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "bytes", - "futures 0.3.24", + "futures 0.3.25", "hash-db", "libsecp256k1", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "secp256k1", "sp-core", @@ -11236,9 +11766,9 @@ version = "0.12.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "merlin", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "schnorrkel", "serde", @@ -11262,7 +11792,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "serde", "sp-api", "sp-core", @@ -11276,7 +11806,7 @@ name = "sp-npos-elections" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-arithmetic", @@ -11324,7 +11854,7 @@ dependencies = [ "hash256-std-hasher", "impl-trait-for-tuples", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-util-mem", "paste", "rand 0.7.3", @@ -11344,8 +11874,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "bytes", "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types", + "parity-scale-codec 3.2.1", + "primitive-types 0.11.1", "sp-externalities", "sp-runtime-interface-proc-macro", "sp-std", @@ -11373,7 +11903,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-core", "sp-io", "sp-std", @@ -11386,7 +11916,7 @@ name = "sp-session" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-api", "sp-core", @@ -11400,7 +11930,7 @@ name = "sp-staking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-std", @@ -11414,7 +11944,7 @@ dependencies = [ "hash-db", "log", "num-traits", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "rand 0.7.3", "smallvec", @@ -11439,7 +11969,7 @@ version = "6.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "impl-serde", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "ref-cast", "serde", "sp-debug-derive", @@ -11467,7 +11997,7 @@ dependencies = [ "async-trait", "futures-timer", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-api", "sp-inherents", "sp-runtime", @@ -11480,7 +12010,7 @@ name = "sp-tracing" version = "5.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-std", "tracing", "tracing-core", @@ -11503,7 +12033,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "async-trait", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-inherents", @@ -11524,7 +12054,7 @@ dependencies = [ "lru 0.7.8", "memory-db", "nohash-hasher", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "scale-info", "sp-core", @@ -11541,7 +12071,7 @@ version = "5.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "impl-serde", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-wasm 0.42.2", "scale-info", "serde", @@ -11557,7 +12087,7 @@ name = "sp-version-proc-macro" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 3.2.1", "proc-macro2", "quote", "syn", @@ -11570,7 +12100,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "impl-trait-for-tuples", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-std", "wasmi", "wasmtime", @@ -11702,10 +12232,10 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-rpc-api", "sc-transaction-pool-api", @@ -11737,7 +12267,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc dependencies = [ "jsonrpsee", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-rpc-api", "scale-info", @@ -11757,9 +12287,9 @@ version = "2.0.1" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "hex", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-client-db", "sc-consensus", @@ -11792,7 +12322,7 @@ dependencies = [ "memory-db", "pallet-babe", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "parity-util-mem", "sc-service", "scale-info", @@ -11826,8 +12356,8 @@ name = "substrate-test-runtime-client" version = "2.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ - "futures 0.3.24", - "parity-scale-codec", + "futures 0.3.25", + "parity-scale-codec 3.2.1", "sc-block-builder", "sc-client-api", "sc-consensus", @@ -11871,9 +12401,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", @@ -11956,9 +12486,9 @@ checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b" [[package]] name = "textwrap" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" @@ -12058,6 +12588,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -12288,6 +12827,16 @@ dependencies = [ "hash-db", ] +[[package]] +name = "triehash" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" +dependencies = [ + "hash-db", + "rlp", +] + [[package]] name = "trust-dns-proto" version = "0.21.2" @@ -12346,7 +12895,7 @@ dependencies = [ "frame-try-runtime", "jsonrpsee", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "remote-externalities", "sc-chain-spec", "sc-cli", @@ -12676,7 +13225,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "js-sys", "parking_lot 0.11.2", "pin-utils", @@ -13125,6 +13674,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + [[package]] name = "wyz" version = "0.5.0" @@ -13153,7 +13708,7 @@ dependencies = [ "derivative", "impl-trait-for-tuples", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "xcm-procedural", @@ -13168,7 +13723,7 @@ dependencies = [ "frame-system", "log", "pallet-transaction-payment", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "polkadot-parachain", "scale-info", "sp-arithmetic", @@ -13193,7 +13748,7 @@ dependencies = [ "frame-support", "frame-system", "parachain-info", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "paste", "polkadot-primitives", "polkadot-runtime-parachains", @@ -13213,7 +13768,7 @@ dependencies = [ "frame-support", "impl-trait-for-tuples", "log", - "parity-scale-codec", + "parity-scale-codec 3.2.1", "sp-arithmetic", "sp-core", "sp-io", @@ -13222,6 +13777,30 @@ dependencies = [ "xcm", ] +[[package]] +name = "xcm-primitives" +version = "0.1.0" +source = "git+https://github.com/NunoAlexandre/moonbeam?branch=unfork-v0.9.29#1b32dfe52897697146bde4927ce9551439a91548" +dependencies = [ + "ethereum", + "ethereum-types 0.13.1", + "frame-support", + "frame-system", + "hex", + "log", + "orml-traits", + "parity-scale-codec 3.2.1", + "scale-info", + "serde", + "sha3 0.8.2", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "xcm-procedural" version = "0.9.29" @@ -13239,7 +13818,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "log", "nohash-hasher", "parking_lot 0.12.1", diff --git a/Cargo.toml b/Cargo.toml index 7aec3334e9..ad00b4bcd8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,7 @@ members = [ "libs/types", "pallets/anchors", "pallets/bridge", + "pallets/connectors", "pallets/claims", "pallets/collator-allowlist", "pallets/crowdloan-claim", diff --git a/flake.nix b/flake.nix index 8dd0fe6cf5..64564911dc 100644 --- a/flake.nix +++ b/flake.nix @@ -93,7 +93,7 @@ }; # This is a hash of all the Cargo dependencies, for reproducibility. - cargoSha256 = "sha256-0PYFTi+gH8T1NocZAC+rdnpuGg9s10ObyFC5ebp8iRs="; + cargoSha256 = "sha256-OzVeIy/zwXJv4BCwOxauc18G8jVaB4+75yDyvRE3XfA="; nativeBuildInputs = with pkgs; [ clang git-mock pkg-config ]; buildInputs = with pkgs; [ openssl ] ++ ( diff --git a/libs/traits/src/lib.rs b/libs/traits/src/lib.rs index 4b50711f70..241f7a658e 100644 --- a/libs/traits/src/lib.rs +++ b/libs/traits/src/lib.rs @@ -111,7 +111,7 @@ pub trait PoolNAV { /// A trait that support pool inspection operations such as pool existence checks and pool admin of permission set. pub trait PoolInspect { - type PoolId: Parameter + Member + Debug + Copy + Default + TypeInfo; + type PoolId: Parameter + Member + Debug + Copy + Default + TypeInfo + Encode + Decode; type TrancheId: Parameter + Member + Debug + Copy + Default + TypeInfo; type Rate; type Moment; diff --git a/pallets/connectors/Cargo.toml b/pallets/connectors/Cargo.toml new file mode 100644 index 0000000000..5a1da21a24 --- /dev/null +++ b/pallets/connectors/Cargo.toml @@ -0,0 +1,102 @@ +[package] +authors = ["Centrifuge "] +description = 'Centrifuge Connectors Pallet' +edition = '2018' +license = "LGPL-3.0" +name = 'pallet-connectors' +repository = "https://github.com/centrifuge/centrifuge-chain/pallets/connectors" +version = '0.0.1' + +[package.metadata.docs.rs] +targets = ['x86_64-unknown-linux-gnu'] + +[dependencies] +codec = { package = 'parity-scale-codec', version = '3.0.0', features = ['derive'], default-features = false } +ethabi = { version = "16.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +hex = { version = "0.4.3", default_features = false } +scale-info = { version = "2.0", default-features = false, features = ["derive"] } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } + +# Substrate crates +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" } + +# Optional dependencies for benchmarking +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.29" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, optional = true, branch = "polkadot-v0.9.29" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, optional = true, branch = "polkadot-v0.9.29" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.29" } +pallet-uniques = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.29" } + +# Our custom pallets +cfg-primitives = { path = "../../libs/primitives", default-features = false } +cfg-traits = { path = "../../libs/traits", default-features = false } +cfg-types = { path = "../../libs/types", default-features = false } +runtime-common = { path = "../../runtime/common", default-features = false } + +# Polkadot +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.29" } + +pallet-ethereum = { git = "https://github.com/NunoAlexandre/frontier", branch = "unfork-v0.9.29", default-features = false } +pallet-ethereum-xcm = { git = "https://github.com/NunoAlexandre/moonbeam", default-features = false, branch = "unfork-v0.9.29" } +pallet-xcm-transactor = { git = "https://github.com/NunoAlexandre/moonbeam", default-features = false, branch = "unfork-v0.9.29" } +xcm-primitives = { git = "https://github.com/NunoAlexandre/moonbeam", default-features = false, branch = "unfork-v0.9.29" } + +[dev-dependencies] +hex = "0.4.3" +serde = { version = "1.0.102" } + +# Our pallets +pallet-interest-accrual = { path = "../interest-accrual", default-features = true } +pallet-loans = { path = "../loans", default-features = true } +pallet-permissions = { path = "../permissions", default-features = true } +pallet-pools = { path = "../pools", default-features = true } + +# Substrate crates & pallets +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.29" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.29" } +pallet-uniques = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.29" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.29" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.29" } + +# Orml crates +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = true, branch = "polkadot-v0.9.29" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = true, branch = "polkadot-v0.9.29" } + +# Local crates +runtime-common = { path = "../../runtime/common", default-features = true } + +[features] +default = ['std'] +runtime-benchmarks = [ + "frame-benchmarking", + "pallet-balances", + "orml-tokens", + "orml-traits", +] +std = [ + 'codec/std', + 'cfg-types/std', + 'cfg-traits/std', + 'frame-support/std', + 'frame-system/std', + 'sp-std/std', + 'sp-runtime/std', + 'orml-tokens/std', + 'orml-traits/std', + 'pallet-balances/std', + 'runtime-common/std', + 'xcm/std', + 'pallet-xcm-transactor/std', + 'pallet-ethereum-xcm/std', + 'pallet-ethereum/std', + 'xcm-primitives/std', + 'ethabi/std', + 'pallet-interest-accrual/std', + 'pallet-permissions/std', + 'pallet-loans/std', + 'pallet-pools/std', + 'pallet-uniques/std', +] diff --git a/pallets/connectors/src/contract.rs b/pallets/connectors/src/contract.rs new file mode 100644 index 0000000000..d30e57c256 --- /dev/null +++ b/pallets/connectors/src/contract.rs @@ -0,0 +1,63 @@ +// Copyright 2022 Centrifuge Foundation (centrifuge.io). +// This file is part of Centrifuge chain project. + +// Centrifuge 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 (see http://www.gnu.org/licenses). + +// Centrifuge 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. +#![cfg_attr(not(feature = "std"), no_std)] +use ethabi::{Bytes, Contract}; +use sp_std::{vec, vec::Vec}; + +/// The ConnectorsXcmContract handle function name +static HANDLE_FUNCTION: &str = "handle"; + +/// Return the encoded contract call, i.e, ConnectorsXcmRouter::handle(encoded_msg). +pub fn encoded_contract_call(encoded_msg: Vec) -> Bytes { + let contract = xcm_router_contract(); + let encoded_contract_call = contract + .function(HANDLE_FUNCTION) + .expect("Known at compilation time") + .encode_input(&[ethabi::Token::Bytes(encoded_msg)]) + .expect("Known at compilation time"); + + encoded_contract_call +} + +/// The ConnectorsXcmRouter Abi as in ethabi::Contract +/// Note: We only concern ourselves with the `handle` function of the contract +/// since that's all we need to build the calls for remote EVM execution. +pub fn xcm_router_contract() -> Contract { + use sp_std::collections::btree_map::BTreeMap; + + let mut functions = BTreeMap::new(); + #[allow(deprecated)] + functions.insert( + "handle".into(), + vec![ethabi::Function { + name: HANDLE_FUNCTION.into(), + inputs: vec![ethabi::Param { + name: "message".into(), + kind: ethabi::ParamType::Bytes, + internal_type: None, + }], + outputs: vec![], + constant: false, + state_mutability: Default::default(), + }], + ); + + ethabi::Contract { + constructor: None, + functions, + events: Default::default(), + errors: Default::default(), + receive: false, + fallback: false, + } +} diff --git a/pallets/connectors/src/lib.rs b/pallets/connectors/src/lib.rs new file mode 100644 index 0000000000..d30eaac862 --- /dev/null +++ b/pallets/connectors/src/lib.rs @@ -0,0 +1,473 @@ +// Copyright 2022 Centrifuge Foundation (centrifuge.io). +// This file is part of Centrifuge chain project. + +// Centrifuge 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 (see http://www.gnu.org/licenses). + +// Centrifuge 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. +#![cfg_attr(not(feature = "std"), no_std)] +use core::convert::TryFrom; + +use cfg_traits::PoolInspect; +use codec::{Decode, Encode}; +use frame_support::traits::{ + fungibles::{Inspect, Mutate, Transfer}, + OriginTrait, +}; +pub use pallet::*; +use scale_info::TypeInfo; +use sp_core::{TypeId, U256}; +use sp_runtime::{traits::AtLeast32BitUnsigned, FixedPointNumber}; +use sp_std::{boxed::Box, convert::TryInto, vec::Vec}; +pub mod weights; + +mod message; +pub use message::*; + +mod routers; +pub use routers::*; + +mod contract; +pub use contract::*; + +/// The Parachains that Centrifuge Connectors support. +#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] +#[cfg_attr(feature = "std", derive(Debug))] +pub enum ParachainId { + /// Moonbeam - It may be Moonbeam on Polkadot, Moonriver on Kusama, or Moonbase on a testnet. + Moonbeam, +} + +/// The EVM chain ID +/// The type should accomodate all chain ids listed on https://chainlist.org/. +type EVMChainId = u64; + +/// A Domain is a chain or network we can send a Connectors message to. +/// The domain indices need to match those used in the EVM contracts and these +/// need to pass the Centrifuge domain to send tranche tokens from the other +/// domain here. Therefore, DO NOT remove or move variants around. +#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] +#[cfg_attr(feature = "std", derive(Debug))] +pub enum Domain { + /// An EVM domain, identified by its EVM Chain Id + EVM(EVMChainId), + /// A Polkadot Parachain domain + Parachain(ParachainId), +} + +#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)] +pub struct DomainLocator { + pub domain: Domain, +} + +impl TypeId for DomainLocator { + const TYPE_ID: [u8; 4] = *b"domn"; +} + +#[derive(Encode, Decode, Default, Clone, PartialEq, TypeInfo)] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct DomainAddress { + pub domain: Domain, + pub address: [u8; 32], +} + +impl TypeId for DomainAddress { + const TYPE_ID: [u8; 4] = *b"dadr"; +} + +// Type aliases +pub type PoolIdOf = <::PoolInspect as PoolInspect< + ::AccountId, + ::CurrencyId, +>>::PoolId; + +pub type TrancheIdOf = <::PoolInspect as PoolInspect< + ::AccountId, + ::CurrencyId, +>>::TrancheId; + +pub type MessageOf = + Message, TrancheIdOf, ::Balance, ::Rate>; + +pub type CurrencyIdOf = ::CurrencyId; + +#[frame_support::pallet] +pub mod pallet { + use cfg_primitives::Moment; + use cfg_traits::{Permissions, PoolInspect}; + use cfg_types::{PermissionScope, PoolRole, Role}; + use frame_support::{error::BadOrigin, pallet_prelude::*, traits::UnixTime}; + use frame_system::pallet_prelude::*; + use pallet_xcm_transactor::{Currency, CurrencyPayment, TransactWeights}; + use sp_runtime::traits::{AccountIdConversion, Zero}; + use xcm::latest::OriginKind; + + use super::*; + use crate::weights::WeightInfo; + + #[pallet::pallet] + #[pallet::generate_store(pub (super) trait Store)] + #[pallet::without_storage_info] + pub struct Pallet(_); + + #[pallet::config] + pub trait Config: frame_system::Config + pallet_xcm_transactor::Config { + type Event: From> + IsType<::Event>; + + type WeightInfo: WeightInfo; + + type Balance: Parameter + + Member + + AtLeast32BitUnsigned + + Default + + Copy + + MaybeSerializeDeserialize + + MaxEncodedLen; + + type Rate: Parameter + Member + MaybeSerializeDeserialize + FixedPointNumber + TypeInfo; + + type CurrencyId: Parameter + + Copy + + Default + + IsType<::CurrencyId>; + + /// The origin allowed to make admin-like changes, such calling `set_domain_router`. + type AdminOrigin: EnsureOrigin; + + type PoolInspect: PoolInspect< + Self::AccountId, + ::CurrencyId, + Rate = Self::Rate, + >; + + type Permission: Permissions< + Self::AccountId, + Scope = PermissionScope, ::CurrencyId>, + Role = Role, Moment>, + Error = DispatchError, + >; + + type Time: UnixTime; + + type Tokens: Mutate + + Inspect< + Self::AccountId, + AssetId = ::CurrencyId, + Balance = ::Balance, + > + Transfer; + } + + #[pallet::event] + #[pallet::generate_deposit(pub (super) fn deposit_event)] + pub enum Event { + /// A message was sent to a domain + MessageSent { + message: MessageOf, + domain: Domain, + }, + + /// The Router for a given domain was set + SetDomainRouter { + domain: Domain, + router: Router>, + }, + } + + #[pallet::storage] + pub(crate) type DomainRouter = + StorageMap<_, Blake2_128Concat, Domain, Router>>; + + #[pallet::error] + pub enum Error { + /// A pool could not be found + PoolNotFound, + /// A tranche could not be found + TrancheNotFound, + /// Failed to fetch a tranche token price. + /// This can occur if `TrancheNotFound` or if effectively + /// the price for this tranche has not yet been set. + MissingTranchePrice, + /// Router not set for a given domain + MissingRouter, + /// Transfer amount must be non-zero + InvalidTransferAmount, + /// A transfer to a non-whitelisted destination was attempted + UnauthorizedTransfer, + /// Failed to build Ethereum_Xcm call + FailedToBuildEthereumXcmCall, + } + + #[pallet::call] + impl Pallet { + /// Set a Domain's router + #[pallet::weight(< T as Config >::WeightInfo::set_domain_router())] + pub fn set_domain_router( + origin: OriginFor, + domain: Domain, + router: Router>, + ) -> DispatchResult { + T::AdminOrigin::ensure_origin(origin.clone())?; + + >::insert(domain.clone(), router.clone()); + Self::deposit_event(Event::SetDomainRouter { domain, router }); + + Ok(()) + } + + /// Add a pool to a given domain + #[pallet::weight(< T as Config >::WeightInfo::add_pool())] + pub fn add_pool( + origin: OriginFor, + pool_id: PoolIdOf, + domain: Domain, + ) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + + ensure!( + T::PoolInspect::pool_exists(pool_id), + Error::::PoolNotFound + ); + + Self::do_send_message(who, Message::AddPool { pool_id }, domain)?; + + Ok(()) + } + + /// Add a tranche to a given domain + #[pallet::weight(< T as Config >::WeightInfo::add_tranche())] + pub fn add_tranche( + origin: OriginFor, + pool_id: PoolIdOf, + tranche_id: TrancheIdOf, + domain: Domain, + ) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + + ensure!( + T::PoolInspect::tranche_exists(pool_id, tranche_id), + Error::::TrancheNotFound + ); + + // Send the message through the router + // + // TODO: retrieve token name and symbol from asset-registry + // Depends on https://github.com/centrifuge/centrifuge-chain/issues/842 + // + Self::do_send_message( + who, + Message::AddTranche { + pool_id, + tranche_id, + token_name: [0; 32], + token_symbol: [0; 32], + }, + domain, + )?; + + Ok(()) + } + + /// Update a token price + #[pallet::weight(< T as Config >::WeightInfo::update_token_price())] + pub fn update_token_price( + origin: OriginFor, + pool_id: PoolIdOf, + tranche_id: TrancheIdOf, + domain: Domain, + ) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + + let latest_price = T::PoolInspect::get_tranche_token_price(pool_id, tranche_id) + .ok_or(Error::::MissingTranchePrice)?; + + Self::do_send_message( + who, + Message::UpdateTokenPrice { + pool_id, + tranche_id, + price: latest_price.price, + }, + domain, + )?; + + Ok(()) + } + + /// Update a member + #[pallet::weight(< T as Config >::WeightInfo::update_member())] + pub fn update_member( + origin: OriginFor, + address: DomainAddress, + pool_id: PoolIdOf, + tranche_id: TrancheIdOf, + valid_until: Moment, + ) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + + // Check that the origin is a member of this tranche token or + // is a MemberListAdmin and thus allowed to add other members. + ensure!( + T::Permission::has( + PermissionScope::Pool(pool_id), + who.clone(), + Role::PoolRole(PoolRole::MemberListAdmin) + ), + BadOrigin + ); + + T::Permission::add( + PermissionScope::Pool(pool_id), + address.into_account_truncating(), + Role::PoolRole(PoolRole::TrancheInvestor(tranche_id, valid_until)), + )?; + + Self::do_send_message( + who, + Message::UpdateMember { + pool_id, + tranche_id, + valid_until, + address: address.address, + }, + address.domain, + )?; + + Ok(()) + } + + /// Transfer tranche tokens to a given address + #[pallet::weight(< T as Config >::WeightInfo::transfer())] + pub fn transfer( + origin: OriginFor, + pool_id: PoolIdOf, + tranche_id: TrancheIdOf, + address: DomainAddress, + amount: ::Balance, + ) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + + // Check that the destination is a member of this tranche token + ensure!( + T::Permission::has( + PermissionScope::Pool(pool_id), + address.into_account_truncating(), + Role::PoolRole(PoolRole::TrancheInvestor(tranche_id, Self::now())) + ), + Error::::UnauthorizedTransfer + ); + + ensure!(!amount.is_zero(), Error::::InvalidTransferAmount); + + // TODO: Transfer to the domain account for bookkeeping + // T::Tokens::transfer( + // T::CurrencyId::Tranche(pool_id, tranche_id), + // &who, + // &DomainLocator { + // domain: address.domain, + // } + // .into_account_truncating(), + // amount, + // false, + // )?; + + Self::do_send_message( + who, + Message::Transfer { + pool_id, + tranche_id, + amount, + domain: address.clone().domain, + destination: address.clone().address, + }, + address.domain, + )?; + + Ok(()) + } + } + + impl Pallet { + pub(crate) fn now() -> Moment { + T::Time::now().as_secs() + } + + /// Send the `message` to the given domain. + pub fn do_send_message( + fee_payer: T::AccountId, + message: MessageOf, + domain: Domain, + ) -> DispatchResult { + let Router::Xcm(xcm_domain) = + >::get(domain.clone()).ok_or(Error::::MissingRouter)?; + + let contract_call = contract::encoded_contract_call(message.encode()); + let ethereum_xcm_call = + Self::encoded_ethereum_xcm_call(xcm_domain.clone(), contract_call); + + pallet_xcm_transactor::Pallet::::transact_through_sovereign( + T::Origin::root(), + // The destination to which the message should be sent + Box::new(xcm_domain.location), + fee_payer, + // The currency in which we want to pay fees + CurrencyPayment { + currency: Currency::AsCurrencyId(xcm_domain.fee_currency), + fee_amount: None, + }, + // The call to be executed in the destination chain + ethereum_xcm_call, + OriginKind::SovereignAccount, + TransactWeights { + // Specify a conservative max weight + transact_required_weight_at_most: 8_000_000_000, + overall_weight: None, + }, + )?; + + Self::deposit_event(Event::MessageSent { message, domain }); + + Ok(()) + } + + /// Build the encoded `ethereum_xcm::transact(eth_tx)` call that should + /// request to execute `evm_call`. + /// + /// * `xcm_domain` - All the necessary info regarding the xcm-based domain + /// where this `ethereum_xcm` call is to be executed + /// * `evm_call` - The encoded EVM call calling ConnectorsXcmRouter::handle(msg) + pub fn encoded_ethereum_xcm_call( + xcm_domain: XcmDomain>, + evm_call: Vec, + ) -> Vec { + let mut encoded: Vec = Vec::new(); + + encoded.append(&mut xcm_domain.ethereum_xcm_transact_call_index.clone()); + encoded.append( + &mut xcm_primitives::EthereumXcmTransaction::V1( + xcm_primitives::EthereumXcmTransactionV1 { + gas_limit: U256::from(80_000), + fee_payment: xcm_primitives::EthereumXcmFee::Auto, + action: pallet_ethereum::TransactionAction::Call( + xcm_domain.contract_address, + ), + value: U256::zero(), + input: BoundedVec::< + u8, + ConstU32<{ xcm_primitives::MAX_ETHEREUM_XCM_INPUT_SIZE }>, + >::try_from(evm_call) + .unwrap(), + access_list: None, + }, + ) + .encode(), + ); + + encoded + } + } +} diff --git a/pallets/connectors/src/message.rs b/pallets/connectors/src/message.rs new file mode 100644 index 0000000000..5328e5c895 --- /dev/null +++ b/pallets/connectors/src/message.rs @@ -0,0 +1,282 @@ +use cfg_primitives::Moment; +use sp_std::{vec, vec::Vec}; + +use crate::*; + +#[derive(Decode, Clone, PartialEq, TypeInfo)] +#[cfg_attr(feature = "std", derive(Debug))] +pub enum Message +where + Domain: Encode + Decode, + PoolId: Encode + Decode, + TrancheId: Encode + Decode, + Balance: Encode + Decode, + Rate: Encode + Decode, +{ + Invalid, + AddPool { + pool_id: PoolId, + }, + AddTranche { + pool_id: PoolId, + tranche_id: TrancheId, + token_name: [u8; 32], + token_symbol: [u8; 32], + }, + UpdateTokenPrice { + pool_id: PoolId, + tranche_id: TrancheId, + price: Rate, + }, + UpdateMember { + pool_id: PoolId, + tranche_id: TrancheId, + address: [u8; 32], + valid_until: Moment, + }, + Transfer { + pool_id: PoolId, + tranche_id: TrancheId, + domain: Domain, + destination: [u8; 32], + amount: Balance, + }, +} + +impl< + Domain: Encode + Decode, + PoolId: Encode + Decode, + TrancheId: Encode + Decode, + Balance: Encode + Decode, + Rate: Encode + Decode, + > Message +{ + /// The call type that identifies a specific Message variant. This value is used + /// to encode/decode a Message to/from a bytearray, whereas the head of the bytearray + /// is the call type, followed by each message's param values. + /// + /// NOTE: Each message must immutably map to the same u8. Messages are decoded + /// in other domains and MUST follow the defined standard. + fn call_type(&self) -> u8 { + match self { + Self::Invalid => 0, + Self::AddPool { .. } => 1, + Self::AddTranche { .. } => 2, + Self::UpdateTokenPrice { .. } => 3, + Self::UpdateMember { .. } => 4, + Self::Transfer { .. } => 5, + } + } +} + +impl< + Domain: Encode + Decode, + PoolId: Encode + Decode, + TrancheId: Encode + Decode, + Balance: Encode + Decode, + Rate: Encode + Decode, + > Encode for Message +{ + fn encode(&self) -> Vec { + match self { + Message::Invalid => vec![self.call_type()], + Message::AddPool { pool_id } => { + let mut message: Vec = vec![]; + message.push(self.call_type()); + + let mut encoded_pool_id = pool_id.encode(); + encoded_pool_id.reverse(); + message.append(&mut encoded_pool_id); + + message + } + Message::AddTranche { + pool_id, + tranche_id, + token_name, + token_symbol, + } => { + let mut message: Vec = vec![]; + message.push(self.call_type()); + + let mut encoded_pool_id = pool_id.encode(); + encoded_pool_id.reverse(); + message.append(&mut encoded_pool_id); + + message.append(&mut tranche_id.encode()); + message.append(&mut token_name.encode()); + message.append(&mut token_symbol.encode()); + + message + } + Message::UpdateTokenPrice { + pool_id, + tranche_id, + price, + } => { + let mut message: Vec = vec![]; + message.push(self.call_type()); + + let mut encoded_pool_id = pool_id.encode(); + encoded_pool_id.reverse(); + message.append(&mut encoded_pool_id); + + message.append(&mut tranche_id.encode()); + message.append(&mut price.encode()); + + message + } + Message::UpdateMember { + pool_id, + tranche_id, + address, + valid_until, + } => { + let mut message: Vec = vec![]; + message.push(self.call_type()); + + let mut encoded_pool_id = pool_id.encode(); + encoded_pool_id.reverse(); + message.append(&mut encoded_pool_id); + + message.append(&mut tranche_id.encode()); + message.append(&mut address.encode()); + message.append(&mut valid_until.encode()); + + message + } + Message::Transfer { + pool_id, + tranche_id, + domain, + destination, + amount, + } => { + let mut message: Vec = vec![]; + message.push(self.call_type()); + + let mut encoded_pool_id = pool_id.encode(); + encoded_pool_id.reverse(); + message.append(&mut encoded_pool_id); + + message.append(&mut tranche_id.encode()); + message.append(&mut domain.encode()); + message.append(&mut destination.encode()); + message.append(&mut amount.encode()); + + message + } + } + } +} + +#[cfg(test)] +mod tests { + use codec::Encode; + use hex::FromHex; + use sp_runtime::traits::One; + + use crate::Message; + + type PoolId = u64; + type TrancheId = [u8; 16]; + type Balance = cfg_primitives::Balance; + type Rate = cfg_types::Rate; + + const CURRENCY: Balance = 1_000_000_000_000_000_000; + + pub mod encode { + use super::*; + use crate::{Domain, ParachainId}; + + #[test] + fn invalid() { + let msg = Message::::Invalid; + assert_eq!(msg.encode(), vec![msg.call_type()]); + assert_eq!(msg.encode(), vec![0]); + } + + #[test] + fn add_pool_zero() { + let msg = Message::::AddPool { pool_id: 0 }; + let encoded = msg.encode(); + + let expected_hex = "010000000000000000"; + let expected = <[u8; 9]>::from_hex(expected_hex).expect("Decoding failed"); + assert_eq!(encoded, expected); + } + + #[test] + fn add_pool_long() { + let msg = + Message::::AddPool { pool_id: 12378532 }; + let encoded = msg.encode(); + + let expected_hex = "010000000000bce1a4"; + let expected = <[u8; 9]>::from_hex(expected_hex).expect("Decoding failed"); + assert_eq!(encoded, expected); + } + + #[test] + fn add_tranche() { + let msg = Message::::AddTranche { + pool_id: 12378532, + tranche_id: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + token_name: [0; 32], + token_symbol: [0; 32], + }; + let encoded = msg.encode(); + + let expected_hex = "020000000000bce1a40000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + let expected = <[u8; 89]>::from_hex(expected_hex).expect("Decoding failed"); + assert_eq!(encoded, expected); + } + + #[test] + fn update_token_price() { + let msg = Message::::UpdateTokenPrice { + pool_id: 1, + tranche_id: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + price: Rate::one(), + }; + let encoded = msg.encode(); + + let input = "03000000000000000100000000000000000000000000000001000000e83c80d09f3c2e3b0300000000"; + let expected = <[u8; 41]>::from_hex(input).expect("Decoding failed"); + assert_eq!(encoded, expected); + } + + #[test] + fn update_member() { + let msg = Message::::UpdateMember { + pool_id: 1, + tranche_id: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + address: [1; 32], + valid_until: 100, + }; + let encoded = msg.encode(); + + let input = "0400000000000000010000000000000000000000000000000101010101010101010101010101010101010101010101010101010101010101016400000000000000"; + let expected = <[u8; 65]>::from_hex(input).expect("Decoding failed"); + assert_eq!(encoded, expected); + } + + #[test] + #[ignore = "wip"] + fn transfer() { + let msg = Message::::Transfer { + pool_id: 1, + tranche_id: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + domain: Domain::Parachain(ParachainId::Moonbeam), + destination: [1; 32], + amount: 100 * CURRENCY, + }; + let encoded = msg.encode(); + println!("{}", hex::encode(encoded.clone())); + + let input = "0500000000000000010000000000000000000000000000000101010101010101010101010101010101010101010101010101010101010101016400000000000000"; + let expected = <[u8; 65]>::from_hex(input).expect("Decoding failed"); + assert_eq!(encoded, expected); + } + } +} diff --git a/pallets/connectors/src/routers.rs b/pallets/connectors/src/routers.rs new file mode 100644 index 0000000000..5f1d170f6a --- /dev/null +++ b/pallets/connectors/src/routers.rs @@ -0,0 +1,30 @@ +use codec::{Decode, Encode}; +use scale_info::TypeInfo; +use sp_core::H160; +use sp_std::vec::Vec; +use xcm::VersionedMultiLocation; + +#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] +#[cfg_attr(feature = "std", derive(Debug))] +pub enum Router { + // An XCM-based router + Xcm(XcmDomain), +} + +/// XcmDomain gathers all the required fields to build and send remote +/// calls to a specific XCM-based Domain. +#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct XcmDomain { + /// the xcm multilocation of the domain + pub location: VersionedMultiLocation, + /// The ethereum_xcm::Call::transact call index on a given domain. + /// It should contain the pallet index + the `transact` call index, to which + /// we will append the eth_tx param. You can obtain this value by building + /// an ethereum_xcm::transact call with Polkadot JS on the target chain. + pub ethereum_xcm_transact_call_index: Vec, + /// The ConnectorsXcmRouter contract address on a given domain + pub contract_address: H160, + /// The currency in which execution fees will be paid on + pub fee_currency: CurrencyId, +} diff --git a/pallets/connectors/src/weights.rs b/pallets/connectors/src/weights.rs new file mode 100644 index 0000000000..96746452c6 --- /dev/null +++ b/pallets/connectors/src/weights.rs @@ -0,0 +1,117 @@ +//! Autogenerated weights for pallet_connectors +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-03-02, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("development-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/centrifuge-chain +// benchmark +// --chain=development-local +// --steps=50 +// --repeat=20 +// --pallet=pallet-connectors +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./pallets/connectors/src/weights.rs +// --template=./scripts/frame-weight-template.hbs + +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{ + traits::Get, + weights::{constants::RocksDbWeight, Weight}, +}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_connectors. +pub trait WeightInfo { + fn add_pool() -> Weight; + fn add_tranche() -> Weight; + fn update_token_price() -> Weight; + fn update_member() -> Weight; + fn transfer() -> Weight; + fn set_domain_router() -> Weight; +} + +/// Weights for pallet_connectors using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + fn set_domain_router() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64))) + } + + fn add_pool() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64))) + } + + fn add_tranche() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64))) + } + + fn update_token_price() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64))) + } + + fn update_member() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64))) + } + + fn transfer() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64))) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn set_domain_router() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64))) + } + + fn add_pool() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64))) + } + + fn add_tranche() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64))) + } + + fn update_token_price() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64))) + } + + fn update_member() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64))) + } + + fn transfer() -> Weight { + (Weight::from_ref_time(32_000_000_u64) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64))) + } +} diff --git a/runtime/altair/src/xcm.rs b/runtime/altair/src/xcm.rs index 1f5c32f13f..d507457b1b 100644 --- a/runtime/altair/src/xcm.rs +++ b/runtime/altair/src/xcm.rs @@ -146,7 +146,7 @@ pub type Barrier = ( AllowSubscriptionsFrom, ); -/// Means for transacting the fungibles assets of ths parachain. +/// Means for transacting the fungibles assets of this parachain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation Tokens, diff --git a/runtime/centrifuge/src/xcm.rs b/runtime/centrifuge/src/xcm.rs index 6bd7968482..f806646747 100644 --- a/runtime/centrifuge/src/xcm.rs +++ b/runtime/centrifuge/src/xcm.rs @@ -143,7 +143,7 @@ pub type Barrier = ( AllowSubscriptionsFrom, ); -/// Means for transacting the fungibles assets of ths parachain. +/// Means for transacting the fungibles assets of this parachain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation Tokens, diff --git a/runtime/development/Cargo.toml b/runtime/development/Cargo.toml index e78cae81de..99b54f3c48 100644 --- a/runtime/development/Cargo.toml +++ b/runtime/development/Cargo.toml @@ -118,6 +118,7 @@ pallet-anchors = { path = "../../pallets/anchors", default-features = false } pallet-bridge = { path = "../../pallets/bridge", default-features = false } pallet-claims = { path = "../../pallets/claims", default-features = false } pallet-collator-allowlist = { path = "../../pallets/collator-allowlist", default-features = false } +pallet-connectors = { path = "../../pallets/connectors", default-features = false } pallet-crowdloan-claim = { path = "../../pallets/crowdloan-claim", default-features = false } pallet-crowdloan-reward = { path = "../../pallets/crowdloan-reward", default-features = false } pallet-fees = { path = "../../pallets/fees", default-features = false } @@ -134,6 +135,10 @@ pallet-pools = { path = "../../pallets/pools", default-features = false } pallet-restricted-tokens = { path = "../../pallets/restricted-tokens", default-features = false } pallet-rewards = { path = "../../pallets/rewards", default-features = false } +# Connectors 3rd-party dependencies +pallet-xcm-transactor = { git = "https://github.com/NunoAlexandre/moonbeam", default-features = false, branch = "unfork-v0.9.29" } +xcm-primitives = { git = "https://github.com/NunoAlexandre/moonbeam", default-features = false, branch = "unfork-v0.9.29" } + [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } @@ -168,6 +173,7 @@ std = [ "pallet-collator-allowlist/std", "pallet-collator-selection/std", "pallet-collective/std", + "pallet-connectors/std", "pallet-crowdloan-claim/std", "pallet-crowdloan-reward/std", "pallet-democracy/std", @@ -232,6 +238,8 @@ std = [ "xcm-builder/std", "xcm-executor/std", "xcm/std", + "xcm-primitives/std", + "pallet-xcm-transactor/std", ] runtime-benchmarks = [ diff --git a/runtime/development/src/lib.rs b/runtime/development/src/lib.rs index c59f450c0a..de3a15b25a 100644 --- a/runtime/development/src/lib.rs +++ b/runtime/development/src/lib.rs @@ -18,6 +18,7 @@ // Allow things like `1 * CFG` #![allow(clippy::identity_op)] +use ::xcm::v2::MultiLocation; pub use cfg_primitives::{ constants::*, types::{PoolId, *}, @@ -87,6 +88,7 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; use static_assertions::const_assert; use xcm_executor::XcmExecutor; +use xcm_primitives::{UtilityAvailableCalls, UtilityEncodeCall}; pub mod xcm; pub use crate::xcm::*; @@ -109,7 +111,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("centrifuge-devel"), impl_name: create_runtime_str!("centrifuge-devel"), authoring_version: 1, - spec_version: 1004, + spec_version: 1007, impl_version: 1, #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, @@ -1119,6 +1121,40 @@ impl pallet_collator_selection::Config for Runtime { type WeightInfo = pallet_collator_selection::weights::SubstrateWeight; } +#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)] +pub struct NullTransactor {} + +impl UtilityEncodeCall for NullTransactor { + fn encode_call(self, _call: UtilityAvailableCalls) -> Vec { + unimplemented!("XcmTransactor feature not used") + } +} + +impl xcm_primitives::XcmTransact for NullTransactor { + fn destination(self) -> MultiLocation { + unimplemented!("XcmTransactor feature not used") + } +} + +impl pallet_xcm_transactor::Config for Runtime { + type AccountIdToMultiLocation = xcm::AccountIdToMultiLocation; + type AssetTransactor = xcm::FungiblesTransactor; + type Balance = Balance; + type BaseXcmWeight = BaseXcmWeight; + type CurrencyId = CurrencyId; + type CurrencyIdToMultiLocation = xcm::CurrencyIdConvert; + type DerivativeAddressRegistrationOrigin = EnsureRoot; + type Event = Event; + type LocationInverter = xcm_builder::LocationInverter; + type ReserveProvider = xcm_primitives::AbsoluteAndRelativeReserve; + type SelfLocation = SelfLocation; + type SovereignAccountDispatcherOrigin = EnsureRoot; + type Transactor = NullTransactor; + type Weigher = xcm_builder::FixedWeightBounds; + type WeightInfo = (); + type XcmSender = XcmRouter; +} + parameter_types! { pub const LoansPalletId: PalletId = cfg_types::ids::LOANS_PALLET_ID; pub const MaxActiveLoansPerPool: u32 = 50; @@ -1316,6 +1352,19 @@ impl pallet_interest_accrual::Config for Runtime { type Weights = (); } +impl pallet_connectors::Config for Runtime { + type AdminOrigin = EnsureRoot; + type Balance = Balance; + type CurrencyId = CurrencyId; + type Event = Event; + type Permission = Permissions; + type PoolInspect = Pools; + type Rate = Rate; + type Time = Timestamp; + type Tokens = Tokens; + type WeightInfo = (); +} + parameter_types! { pub const BridgePalletId: PalletId = cfg_types::ids::BRIDGE_PALLET_ID; pub NativeTokenId: chainbridge::ResourceId = chainbridge::derive_resource_id(1, &sp_io::hashing::blake2_128(b"xRAD")); @@ -1565,6 +1614,7 @@ construct_runtime!( Investments: pallet_investments::{Pallet, Call, Storage, Event} = 105, Rewards: pallet_rewards::{Pallet, Storage, Event} = 106, LiquidityRewards: pallet_liquidity_rewards::{Pallet, Call, Storage, Event} = 107, + Connectors: pallet_connectors::{Pallet, Call, Storage, Event} = 108, // XCM XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 120, @@ -1572,6 +1622,7 @@ construct_runtime!( CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 122, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 123, XTokens: orml_xtokens::{Pallet, Storage, Call, Event} = 124, + XcmTransactor: pallet_xcm_transactor::{Pallet, Call, Storage, Event} = 125, // 3rd party pallets OrmlTokens: orml_tokens::{Pallet, Storage, Event, Config} = 150, diff --git a/runtime/development/src/xcm.rs b/runtime/development/src/xcm.rs index 1361439c52..bc140783d6 100644 --- a/runtime/development/src/xcm.rs +++ b/runtime/development/src/xcm.rs @@ -146,7 +146,7 @@ pub type Barrier = ( AllowSubscriptionsFrom, ); -/// Means for transacting the fungibles assets of ths parachain. +/// Means for transacting the fungibles assets of this parachain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation Tokens, diff --git a/runtime/integration-tests/Cargo.toml b/runtime/integration-tests/Cargo.toml index 79197b07ff..8d514fadbf 100644 --- a/runtime/integration-tests/Cargo.toml +++ b/runtime/integration-tests/Cargo.toml @@ -83,11 +83,15 @@ development-runtime = { path = "../development" } runtime-common = { path = "../common" } [dev-dependencies] +hex = { version = "0.4.3", default_features = false } + cfg-traits = { path = "../../libs/traits" } cfg-types = { path = "../../libs/types" } +pallet-connectors = { path = "../../pallets/connectors" } pallet-loans = { path = "../../pallets/loans" } pallet-permissions = { path = "../../pallets/permissions" } pallet-pools = { path = "../../pallets/pools" } + sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-std = { git = "https://github.com/paritytech/substrate", default-features = true, branch = "polkadot-v0.9.29" } xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = true, branch = "release-v0.9.29" } diff --git a/runtime/integration-tests/src/xcm/development/mod.rs b/runtime/integration-tests/src/xcm/development/mod.rs new file mode 100644 index 0000000000..34f13591a7 --- /dev/null +++ b/runtime/integration-tests/src/xcm/development/mod.rs @@ -0,0 +1,3 @@ +mod setup; +mod test_net; +mod tests; diff --git a/runtime/integration-tests/src/xcm/development/setup.rs b/runtime/integration-tests/src/xcm/development/setup.rs new file mode 100644 index 0000000000..cb7d0c94cb --- /dev/null +++ b/runtime/integration-tests/src/xcm/development/setup.rs @@ -0,0 +1,121 @@ +// Copyright 2021 Centrifuge Foundation (centrifuge.io). +// +// This file is part of the Centrifuge chain project. +// Centrifuge 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 (see http://www.gnu.org/licenses). +// Centrifuge 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. + +pub use altair_runtime::{AccountId, CurrencyId, Origin, Runtime, System}; +use cfg_primitives::{currency_decimals, parachains, Balance}; +use cfg_types::CustomMetadata; +use frame_support::traits::GenesisBuild; +use orml_traits::asset_registry::AssetMetadata; + +/// Accounts +pub const ALICE: [u8; 32] = [4u8; 32]; +pub const BOB: [u8; 32] = [5u8; 32]; + +/// A PARA ID used for a sibling parachain emulating Moonbeam. +/// It must be one that doesn't collide with any other in use. +pub const PARA_ID_MOONBEAM: u32 = 2023; + +pub struct ExtBuilder { + balances: Vec<(AccountId, CurrencyId, Balance)>, + parachain_id: u32, +} + +impl Default for ExtBuilder { + fn default() -> Self { + Self { + balances: vec![], + parachain_id: parachains::polkadot::centrifuge::ID, + } + } +} + +impl ExtBuilder { + pub fn balances(mut self, balances: Vec<(AccountId, CurrencyId, Balance)>) -> Self { + self.balances = balances; + self + } + + pub fn parachain_id(mut self, parachain_id: u32) -> Self { + self.parachain_id = parachain_id; + self + } + + pub fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::default() + .build_storage::() + .unwrap(); + let native_currency_id = development_runtime::NativeToken::get(); + pallet_balances::GenesisConfig:: { + balances: self + .balances + .clone() + .into_iter() + .filter(|(_, currency_id, _)| *currency_id == native_currency_id) + .map(|(account_id, _, initial_balance)| (account_id, initial_balance)) + .collect::>(), + } + .assimilate_storage(&mut t) + .unwrap(); + + orml_tokens::GenesisConfig:: { + balances: self + .balances + .into_iter() + .filter(|(_, currency_id, _)| *currency_id != native_currency_id) + .collect::>(), + } + .assimilate_storage(&mut t) + .unwrap(); + + >::assimilate_storage( + ¶chain_info::GenesisConfig { + parachain_id: self.parachain_id.into(), + }, + &mut t, + ) + .unwrap(); + + >::assimilate_storage( + &pallet_xcm::GenesisConfig { + safe_xcm_version: Some(2), + }, + &mut t, + ) + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} + +pub fn cfg(amount: Balance) -> Balance { + amount * dollar(currency_decimals::NATIVE) +} + +pub fn dollar(decimals: u32) -> Balance { + 10u128.saturating_pow(decimals.into()) +} + +pub fn moonbeam_account() -> AccountId { + parachain_account(PARA_ID_MOONBEAM.into()) +} + +pub fn centrifuge_account() -> AccountId { + parachain_account(parachains::polkadot::centrifuge::ID.into()) +} + +fn parachain_account(id: u32) -> AccountId { + use sp_runtime::traits::AccountIdConversion; + + polkadot_parachain::primitives::Sibling::from(id).into_account_truncating() +} diff --git a/runtime/integration-tests/src/xcm/development/test_net.rs b/runtime/integration-tests/src/xcm/development/test_net.rs new file mode 100644 index 0000000000..d8c7566803 --- /dev/null +++ b/runtime/integration-tests/src/xcm/development/test_net.rs @@ -0,0 +1,158 @@ +// Copyright 2021 Centrifuge GmbH (centrifuge.io). +// This file is part of Centrifuge chain project. + +// Centrifuge 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 (see http://www.gnu.org/licenses). + +// Centrifuge 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. + +//! Relay chain and parachains emulation. + +use cfg_primitives::{parachains, AccountId}; +use cumulus_primitives_core::ParaId; +use development_runtime::CurrencyId; +use frame_support::{traits::GenesisBuild, weights::Weight}; +use polkadot_primitives::v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}; +use polkadot_runtime_parachains::configuration::HostConfiguration; +use sp_runtime::traits::AccountIdConversion; +use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; + +use super::setup::{cfg, ExtBuilder, ALICE, BOB, PARA_ID_MOONBEAM}; + +decl_test_relay_chain! { + pub struct RelayChain { + Runtime = polkadot_runtime::Runtime, + XcmConfig = polkadot_runtime::xcm_config::XcmConfig, + new_ext = relay_ext(), + } +} + +decl_test_parachain! { + pub struct Development { + Runtime = development_runtime::Runtime, + Origin = development_runtime::Origin, + XcmpMessageHandler = development_runtime::XcmpQueue, + DmpMessageHandler = development_runtime::DmpQueue, + new_ext = para_ext(parachains::polkadot::centrifuge::ID), + } +} + +decl_test_parachain! { + pub struct Moonbeam { + Runtime = development_runtime::Runtime, + Origin = development_runtime::Origin, + XcmpMessageHandler = development_runtime::XcmpQueue, + DmpMessageHandler = development_runtime::DmpQueue, + new_ext = para_ext(PARA_ID_MOONBEAM), + } +} + +decl_test_network! { + pub struct TestNet { + relay_chain = RelayChain, + parachains = vec![ + // N.B: Ideally, we could use the defined para id constants but doing so + // fails with: "error: arbitrary expressions aren't allowed in patterns" + + // Be sure to use `parachains::polkadot::centrifuge::ID` + (2031, Development), + // Be sure to use `PARA_ID_MOONBEAM` + (2023, Moonbeam), + ], + } +} + +pub fn relay_ext() -> sp_io::TestExternalities { + use polkadot_runtime::{Runtime, System}; + + let mut t = frame_system::GenesisConfig::default() + .build_storage::() + .unwrap(); + + pallet_balances::GenesisConfig:: { + balances: vec![ + (AccountId::from(ALICE), cfg(2002)), + ( + ParaId::from(parachains::polkadot::centrifuge::ID).into_account_truncating(), + cfg(7), + ), + ( + ParaId::from(PARA_ID_MOONBEAM).into_account_truncating(), + cfg(7), + ), + ], + } + .assimilate_storage(&mut t) + .unwrap(); + + polkadot_runtime_parachains::configuration::GenesisConfig:: { + config: default_parachains_host_configuration(), + } + .assimilate_storage(&mut t) + .unwrap(); + + >::assimilate_storage( + &pallet_xcm::GenesisConfig { + safe_xcm_version: Some(2), + }, + &mut t, + ) + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext +} + +pub fn para_ext(parachain_id: u32) -> sp_io::TestExternalities { + ExtBuilder::default() + .balances(vec![ + (AccountId::from(ALICE), CurrencyId::Native, cfg(10_000)), + (AccountId::from(BOB), CurrencyId::Native, cfg(10_000)), + ]) + .parachain_id(parachain_id) + .build() +} + +fn default_parachains_host_configuration() -> HostConfiguration { + HostConfiguration { + minimum_validation_upgrade_delay: 5, + validation_upgrade_cooldown: 5u32, + validation_upgrade_delay: 5, + code_retention_period: 1200, + max_code_size: MAX_CODE_SIZE, + max_pov_size: MAX_POV_SIZE, + max_head_data_size: 32 * 1024, + group_rotation_frequency: 20, + chain_availability_period: 4, + thread_availability_period: 4, + max_upward_queue_count: 8, + max_upward_queue_size: 1024 * 1024, + max_downward_message_size: 1024, + ump_service_total_weight: Weight::from_ref_time(4 * 1_000_000_000), + max_upward_message_size: 50 * 1024, + max_upward_message_num_per_candidate: 5, + hrmp_sender_deposit: 0, + hrmp_recipient_deposit: 0, + hrmp_channel_max_capacity: 8, + hrmp_channel_max_total_size: 8 * 1024, + hrmp_max_parachain_inbound_channels: 4, + hrmp_max_parathread_inbound_channels: 4, + hrmp_channel_max_message_size: 1024 * 1024, + hrmp_max_parachain_outbound_channels: 4, + hrmp_max_parathread_outbound_channels: 4, + hrmp_max_message_num_per_candidate: 5, + dispute_period: 6, + no_show_slots: 2, + n_delay_tranches: 25, + needed_approvals: 2, + relay_vrf_modulo_samples: 2, + zeroth_delay_tranche_width: 0, + ..Default::default() + } +} diff --git a/runtime/integration-tests/src/xcm/development/tests/connectors.rs b/runtime/integration-tests/src/xcm/development/tests/connectors.rs new file mode 100644 index 0000000000..cba305345b --- /dev/null +++ b/runtime/integration-tests/src/xcm/development/tests/connectors.rs @@ -0,0 +1,220 @@ +// Copyright 2021 Centrifuge GmbH (centrifuge.io). +// This file is part of Centrifuge chain project. +// +// Centrifuge 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 (see http://www.gnu.org/licenses). +// Centrifuge 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. + +// Copyright 2021 Centrifuge GmbH (centrifuge.io). +// This file is part of Centrifuge chain project. +// +// Centrifuge 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 (see http://www.gnu.org/licenses). +// Centrifuge 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. + +use ::xcm::{ + latest::{Junction, Junction::*, Junctions::*, MultiLocation, NetworkId}, + prelude::{Parachain, X1, X2}, + VersionedMultiLocation, +}; +use cfg_primitives::{currency_decimals, parachains, Balance, PoolId, TrancheId}; +use cfg_types::{ + CurrencyId, CurrencyId::ForeignAsset, CustomMetadata, ForeignAssetId, Rate, XcmMetadata, +}; +use codec::Encode; +use development_runtime::{ + Balances, Connectors, Origin, OrmlAssetRegistry, OrmlTokens, Pools, XTokens, XcmTransactor, +}; +use frame_support::{assert_noop, assert_ok, dispatch::Weight}; +use hex::FromHex; +use orml_traits::{asset_registry::AssetMetadata, FixedConversionRateProvider, MultiCurrency}; +use pallet_connectors::{encoded_contract_call, Domain, Message, ParachainId, Router, XcmDomain}; +use pallet_pools::{TrancheInput, TrancheMetadata, TrancheType}; +use runtime_common::{xcm::general_key, xcm_fees::default_per_second}; +use sp_core::H160; +use sp_runtime::{ + traits::{BadOrigin, One}, + BoundedVec, Perquintill, +}; +use xcm_emulator::TestExt; + +use crate::{ + xcm::development::{ + setup::{cfg, dollar, ALICE, BOB, PARA_ID_MOONBEAM}, + test_net::{Development, Moonbeam, RelayChain, TestNet}, + }, + *, +}; + +/// Verify that `Connectors::add_pool` succeeds when called with all the necessary requirements. +/// We can't actually verify that the call hits the ConnectorsXcmRouter contract on Moonbeam +/// since that would require a very heavy e2e setup to emulate. Instead, here we test that we +/// can send the extrinsic and we have other unit tests verifying the encoding of the remote +/// EVM call to be executed on Moonbeam. +#[test] +fn add_pool_works() { + TestNet::reset(); + + let moonbeam_location = MultiLocation { + parents: 1, + interior: X1(Parachain(PARA_ID_MOONBEAM)), + }; + let moonbeam_native_token = MultiLocation { + parents: 1, + interior: X2(Parachain(PARA_ID_MOONBEAM), general_key(&[0, 1])), + }; + + Development::execute_with(|| { + // We need to set the Transact info for Moonbeam in the XcmTransact pallet + assert_ok!(XcmTransactor::set_transact_info( + Origin::root(), + Box::new(VersionedMultiLocation::V1(moonbeam_location.clone())), + 1, + 8_000_000_000_000_000, + Some(3) + )); + + assert_ok!(XcmTransactor::set_fee_per_second( + Origin::root(), + Box::new(VersionedMultiLocation::V1(moonbeam_native_token.clone())), + default_per_second(18), // default fee_per_second for this token which has 18 decimals + )); + + /// Register Moonbeam's native token + let glmr_currency_id = CurrencyId::ForeignAsset(1); + let meta: AssetMetadata = AssetMetadata { + decimals: 18, + name: "Glimmer".into(), + symbol: "GLMR".into(), + existential_deposit: 1_000_000, + location: Some(VersionedMultiLocation::V1(moonbeam_native_token)), + additional: CustomMetadata::default(), + }; + + assert_ok!(OrmlAssetRegistry::register_asset( + Origin::root(), + meta, + Some(glmr_currency_id.clone()) + )); + + // Give Alice enough glimmer to pay for fees + OrmlTokens::deposit(glmr_currency_id, &ALICE.into(), 10 * dollar(18)); + + assert_ok!(Connectors::set_domain_router( + Origin::root(), + Domain::Parachain(ParachainId::Moonbeam), + Router::Xcm(XcmDomain { + location: moonbeam_location + .clone() + .try_into() + .expect("Bad xcm version"), + ethereum_xcm_transact_call_index: vec![38, 0], + contract_address: H160::from( + <[u8; 20]>::from_hex("cE0Cb9BB900dfD0D378393A041f3abAb6B182882") + .expect("Invalid address"), + ), + fee_currency: glmr_currency_id, + }), + )); + + // Register the pool + let pool_id = 42; + + // we first need to register AUSD in the asset registry + let ausd_meta: AssetMetadata = AssetMetadata { + decimals: 12, + name: "Acala Dollar".into(), + symbol: "AUSD".into(), + existential_deposit: 1_000, + location: None, + additional: CustomMetadata::default(), + }; + assert_ok!(OrmlAssetRegistry::register_asset( + Origin::root(), + ausd_meta, + Some(CurrencyId::AUSD) + )); + + // then we can create the pool + assert_ok!(Pools::create( + Origin::signed(BOB.into()), + BOB.into(), + pool_id, + vec![ + TrancheInput { + tranche_type: TrancheType::Residual, + seniority: None, + metadata: TrancheMetadata { + token_name: BoundedVec::default(), + token_symbol: BoundedVec::default(), + } + }, + TrancheInput { + tranche_type: TrancheType::NonResidual { + interest_rate_per_sec: One::one(), + min_risk_buffer: Perquintill::from_percent(10), + }, + seniority: None, + metadata: TrancheMetadata { + token_name: BoundedVec::default(), + token_symbol: BoundedVec::default(), + } + } + ], + CurrencyId::AUSD, + 10_000 * dollar(currency_decimals::AUSD), + None + )); + + // Finally, verify that with all the requirements set in place, + // we can call Connectors::add_pool. + assert_ok!(Connectors::add_pool( + Origin::signed(ALICE.into()), + pool_id, + Domain::Parachain(ParachainId::Moonbeam), + )); + }); +} + +#[test] +fn encoded_ethereum_xcm_add_pool() { + // Ethereum_xcm with Connectors::hande(Message::AddPool) as `input` - this was our first + // successfully ethereum_xcm encoded call tested in Moonbase. + let expected_encoded_hex = "26000080380100000000000000000000000000000000000000000000000000000000000100ce0cb9bb900dfd0d378393a041f3abab6b18288200000000000000000000000000000000000000000000000000000000000000009101bf48bcb600000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000009010000000000bce1a4000000000000000000000000000000000000000000000000"; + let _expected_encoded = hex::decode(expected_encoded_hex).expect("Decode failed"); + + let moonbase_location = MultiLocation { + parents: 1, + interior: X1(Parachain(1000)), + }; + // 38 is the pallet index, 0 is the `transact` extrinsic index. + let ethereum_xcm_transact_call_index = vec![38, 0]; + let contract_address = H160::from( + <[u8; 20]>::from_hex("cE0Cb9BB900dfD0D378393A041f3abAb6B182882").expect("Decoding failed"), + ); + let domain_info = XcmDomain { + location: VersionedMultiLocation::V1(moonbase_location.clone()), + ethereum_xcm_transact_call_index, + contract_address, + fee_currency: ForeignAsset(1), + }; + + let connectors_message = + Message::::AddPool { pool_id: 12378532 }; + + let contract_call = encoded_contract_call(connectors_message.encode()); + let encoded_call = Connectors::encoded_ethereum_xcm_call(domain_info, contract_call); + let encoded_call_hex = hex::encode(encoded_call); + + assert_eq!(encoded_call_hex, expected_encoded_hex); +} diff --git a/runtime/integration-tests/src/xcm/development/tests/mod.rs b/runtime/integration-tests/src/xcm/development/tests/mod.rs new file mode 100644 index 0000000000..ac836b2611 --- /dev/null +++ b/runtime/integration-tests/src/xcm/development/tests/mod.rs @@ -0,0 +1 @@ +mod connectors; diff --git a/runtime/integration-tests/src/xcm/mod.rs b/runtime/integration-tests/src/xcm/mod.rs index b283ad27df..112833ead3 100644 --- a/runtime/integration-tests/src/xcm/mod.rs +++ b/runtime/integration-tests/src/xcm/mod.rs @@ -10,5 +10,6 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. +mod development; mod kusama; mod polkadot;