From f0f64e54329bb287920a5ff822e3deb42fcdb28b Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Tue, 22 Mar 2022 09:27:17 +0800 Subject: [PATCH 01/18] init --- Cargo.lock | 2543 +++++++++++------ Cargo.toml | 12 +- runtime/common/Cargo.toml | 47 + .../common/src/helixbridge/benchmarking.rs | 69 + runtime/common/src/helixbridge/mod.rs | 473 +++ runtime/common/src/helixbridge/weight.rs | 172 ++ runtime/common/src/lib.rs | 21 + 7 files changed, 2382 insertions(+), 955 deletions(-) mode change 100644 => 100755 Cargo.lock create mode 100644 runtime/common/Cargo.toml create mode 100644 runtime/common/src/helixbridge/benchmarking.rs create mode 100644 runtime/common/src/helixbridge/mod.rs create mode 100644 runtime/common/src/helixbridge/weight.rs create mode 100644 runtime/common/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock old mode 100644 new mode 100755 index f600d28f..fa7f5150 --- a/Cargo.lock +++ b/Cargo.lock @@ -401,12 +401,24 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" +[[package]] +name = "base58" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" + [[package]] name = "base58" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + [[package]] name = "base64" version = "0.13.0" @@ -439,13 +451,13 @@ dependencies = [ "sc-network", "sc-network-gossip", "sc-utils", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", + "sp-arithmetic 4.0.0", "sp-blockchain", - "sp-core", - "sp-keystore", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", "substrate-prometheus-endpoint", "thiserror", "wasm-timer", @@ -470,8 +482,8 @@ dependencies = [ "sc-rpc", "sc-utils", "serde", - "sp-core", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", "thiserror", ] @@ -487,11 +499,11 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "parity-scale-codec", "scale-info", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -679,14 +691,26 @@ version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "finality-grandpa", - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", "serde", - "sp-core", + "sp-core 4.1.0-dev", "sp-finality-grandpa", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", +] + +[[package]] +name = "bp-message-dispatch" +version = "0.1.0" +source = "git+https://github.com/darwinia-network/parity-bridges-common?branch=darwinia-v0.12.1#55b88ea4a0a675535dc05cf17c0b027df999524a" +dependencies = [ + "bp-runtime 0.1.0 (git+https://github.com/darwinia-network/parity-bridges-common?branch=darwinia-v0.12.1)", + "frame-support 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "parity-scale-codec", + "scale-info", + "sp-std 4.0.0-dev", ] [[package]] @@ -694,11 +718,28 @@ name = "bp-message-dispatch" version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "bp-runtime", - "frame-support", + "bp-runtime 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "parity-scale-codec", + "scale-info", + "sp-std 4.0.0", +] + +[[package]] +name = "bp-messages" +version = "0.1.0" +source = "git+https://github.com/darwinia-network/parity-bridges-common?branch=darwinia-v0.12.1#55b88ea4a0a675535dc05cf17c0b027df999524a" +dependencies = [ + "bitvec", + "bp-runtime 0.1.0 (git+https://github.com/darwinia-network/parity-bridges-common?branch=darwinia-v0.12.1)", + "frame-support 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "frame-system 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-std", + "serde", + "sp-core 4.0.0-dev", + "sp-std 4.0.0-dev", ] [[package]] @@ -707,14 +748,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "bitvec", - "bp-runtime", - "frame-support", - "frame-system", + "bp-runtime 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 4.0.0", ] [[package]] @@ -722,17 +763,17 @@ name = "bp-polkadot-core" version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "bp-messages", - "bp-runtime", - "frame-support", - "frame-system", + "bp-messages 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "bp-runtime 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", - "sp-version", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", ] [[package]] @@ -740,16 +781,34 @@ name = "bp-rococo" version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "bp-messages", + "bp-messages 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", "bp-polkadot-core", - "bp-runtime", - "frame-support", + "bp-runtime 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "smallvec", - "sp-api", - "sp-runtime", - "sp-std", - "sp-version", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", +] + +[[package]] +name = "bp-runtime" +version = "0.1.0" +source = "git+https://github.com/darwinia-network/parity-bridges-common?branch=darwinia-v0.12.1#55b88ea4a0a675535dc05cf17c0b027df999524a" +dependencies = [ + "frame-support 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "hash-db", + "num-traits", + "parity-scale-codec", + "scale-info", + "sp-core 4.0.0-dev", + "sp-io 4.0.0-dev", + "sp-runtime 4.0.0-dev", + "sp-state-machine 0.10.0-dev", + "sp-std 4.0.0-dev", + "sp-trie 4.0.0-dev", ] [[package]] @@ -757,17 +816,17 @@ name = "bp-runtime" version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "hash-db", "num-traits", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-std 4.0.0", + "sp-trie 4.0.0", ] [[package]] @@ -779,10 +838,10 @@ dependencies = [ "ed25519-dalek", "finality-grandpa", "parity-scale-codec", - "sp-application-crypto", + "sp-application-crypto 4.0.0", "sp-finality-grandpa", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -790,14 +849,14 @@ name = "bp-wococo" version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "bp-messages", + "bp-messages 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", "bp-polkadot-core", "bp-rococo", - "bp-runtime", + "bp-runtime 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", "parity-scale-codec", - "sp-api", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -805,10 +864,10 @@ name = "bridge-runtime-common" version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "bp-message-dispatch", - "bp-messages", - "bp-runtime", - "frame-support", + "bp-message-dispatch 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "bp-messages 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "bp-runtime 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "hash-db", "pallet-bridge-dispatch", "pallet-bridge-grandpa", @@ -816,11 +875,11 @@ dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-std 4.0.0", + "sp-trie 4.0.0", ] [[package]] @@ -1141,8 +1200,8 @@ dependencies = [ "cumulus-primitives-utility", "darwinia-collator-primitives", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "frame-system-rpc-runtime-api", "frame-try-runtime", "pallet-aura", @@ -1163,17 +1222,17 @@ dependencies = [ "polkadot-parachain", "scale-info", "smallvec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-block-builder", "sp-consensus-aura", - "sp-core", - "sp-inherents", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-offchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-std", + "sp-std 4.0.0", "sp-transaction-pool", - "sp-version", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "substrate-wasm-builder", "xcm", "xcm-builder", @@ -1423,10 +1482,10 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sc-client-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-consensus", - "sp-core", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", "tracing", ] @@ -1445,16 +1504,16 @@ dependencies = [ "sc-consensus-aura", "sc-consensus-slots", "sc-telemetry", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", "substrate-prometheus-endpoint", "tracing", ] @@ -1472,11 +1531,11 @@ dependencies = [ "polkadot-primitives", "sc-client-api", "sc-consensus", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", "sp-consensus", - "sp-runtime", - "sp-trie", + "sp-runtime 4.1.0-dev", + "sp-trie 4.0.0", "tracing", ] @@ -1493,13 +1552,13 @@ dependencies = [ "parking_lot 0.10.2", "sc-client-api", "sc-consensus", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", "substrate-prometheus-endpoint", "tracing", ] @@ -1520,12 +1579,12 @@ dependencies = [ "polkadot-parachain", "polkadot-primitives", "sc-client-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", "tracing", ] @@ -1546,10 +1605,10 @@ dependencies = [ "rand 0.8.5", "sc-client-api", "sc-consensus", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-consensus", "sp-maybe-compressed-blob", - "sp-runtime", + "sp-runtime 4.1.0-dev", "tracing", ] @@ -1574,11 +1633,11 @@ dependencies = [ "sc-service", "sc-telemetry", "sc-tracing", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", "tracing", ] @@ -1588,16 +1647,16 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c5619c64d1300315612695ad4b4fcd0f562" dependencies = [ "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "pallet-aura", "parity-scale-codec", "scale-info", "serde", - "sp-application-crypto", + "sp-application-crypto 4.0.0", "sp-consensus-aura", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -1606,14 +1665,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c5619c64d1300315612695ad4b4fcd0f562" dependencies = [ "cumulus-primitives-core", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "xcm", "xcm-executor", ] @@ -1627,8 +1686,8 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "environmental", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "impl-trait-for-tuples", "log", "pallet-balances", @@ -1636,15 +1695,15 @@ dependencies = [ "polkadot-parachain", "scale-info", "serde", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", - "sp-version", + "sp-core 4.1.0-dev", + "sp-externalities 0.10.0", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-std 4.0.0", + "sp-trie 4.0.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "xcm", ] @@ -1665,14 +1724,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c5619c64d1300315612695ad4b4fcd0f562" dependencies = [ "cumulus-primitives-core", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", "serde", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "xcm", ] @@ -1682,14 +1741,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c5619c64d1300315612695ad4b4fcd0f562" dependencies = [ "cumulus-primitives-core", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "rand_chacha 0.3.1", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "xcm", "xcm-executor", ] @@ -1699,15 +1758,15 @@ name = "cumulus-primitives-core" version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c5619c64d1300315612695ad4b4fcd0f562" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", - "sp-api", - "sp-runtime", - "sp-std", - "sp-trie", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", + "sp-trie 4.0.0", ] [[package]] @@ -1722,14 +1781,14 @@ dependencies = [ "parity-scale-codec", "sc-client-api", "scale-info", - "sp-api", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-storage", - "sp-trie", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-std 4.0.0", + "sp-storage 4.0.0", + "sp-trie 4.0.0", "tracing", ] @@ -1739,8 +1798,8 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c5619c64d1300315612695ad4b4fcd0f562" dependencies = [ "cumulus-primitives-core", - "sp-inherents", - "sp-std", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", "sp-timestamp", ] @@ -1750,14 +1809,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c5619c64d1300315612695ad4b4fcd0f562" dependencies = [ "cumulus-primitives-core", - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", - "sp-runtime", - "sp-std", - "sp-trie", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", + "sp-trie 4.0.0", "xcm", ] @@ -1774,11 +1833,11 @@ dependencies = [ "polkadot-overseer", "sc-client-api", "sc-service", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", "thiserror", ] @@ -1801,12 +1860,12 @@ dependencies = [ "sc-service", "sc-telemetry", "sc-tracing", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", "tracing", ] @@ -1818,9 +1877,9 @@ dependencies = [ "cumulus-primitives-core", "parity-scale-codec", "polkadot-primitives", - "sp-runtime", - "sp-state-machine", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-std 4.0.0", ] [[package]] @@ -1869,6 +1928,7 @@ dependencies = [ "darwinia-collator-primitives", "darwinia-collator-rpc", "darwinia-parachain-runtime", + "darwinia-parachain-runtime-common", "futures 0.3.21", "jsonrpc-core", "log", @@ -1893,15 +1953,15 @@ dependencies = [ "sc-tracing", "sc-transaction-pool", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-block-builder", "sp-consensus", "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-keystore", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-keystore 0.10.0", "sp-offchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", "sp-timestamp", "sp-transaction-pool", @@ -1918,8 +1978,8 @@ dependencies = [ name = "darwinia-collator-primitives" version = "5.1.0" dependencies = [ - "sp-core", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -1932,7 +1992,7 @@ dependencies = [ "sc-client-api", "sc-rpc", "sc-transaction-pool-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-block-builder", "sp-blockchain", "substrate-frame-rpc-system", @@ -1952,8 +2012,8 @@ dependencies = [ "cumulus-primitives-utility", "darwinia-collator-primitives", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "frame-system-rpc-runtime-api", "pallet-aura", "pallet-authorship", @@ -1973,23 +2033,41 @@ dependencies = [ "polkadot-parachain", "scale-info", "smallvec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-block-builder", "sp-consensus-aura", - "sp-core", - "sp-inherents", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-offchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-std", + "sp-std 4.0.0", "sp-transaction-pool", - "sp-version", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "substrate-wasm-builder", "xcm", "xcm-builder", "xcm-executor", ] +[[package]] +name = "darwinia-parachain-runtime-common" +version = "5.1.0" +dependencies = [ + "array-bytes", + "bp-message-dispatch 0.1.0 (git+https://github.com/darwinia-network/parity-bridges-common?branch=darwinia-v0.12.1)", + "bp-messages 0.1.0 (git+https://github.com/darwinia-network/parity-bridges-common?branch=darwinia-v0.12.1)", + "bp-runtime 0.1.0 (git+https://github.com/darwinia-network/parity-bridges-common?branch=darwinia-v0.12.1)", + "ethereum-types", + "frame-benchmarking 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "frame-support 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "frame-system 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "parity-scale-codec", + "scale-info", + "sp-runtime 4.0.0-dev", + "sp-std 4.0.0-dev", +] + [[package]] name = "data-encoding" version = "2.3.2" @@ -2249,6 +2327,15 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" +[[package]] +name = "erased-serde" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad132dd8d0d0b546348d7d86cb3191aad14b34e5f979781fc005c80d4ac67ffd" +dependencies = [ + "serde", +] + [[package]] name = "errno" version = "0.2.8" @@ -2423,25 +2510,45 @@ dependencies = [ "percent-encoding 2.1.0", ] +[[package]] +name = "frame-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "frame-support 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "frame-system 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "linregress", + "log", + "parity-scale-codec", + "paste", + "scale-info", + "sp-api 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "sp-io 4.0.0-dev", + "sp-runtime 4.0.0-dev", + "sp-runtime-interface 4.0.0-dev", + "sp-std 4.0.0-dev", + "sp-storage 4.0.0-dev", +] + [[package]] name = "frame-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "linregress", "log", "parity-scale-codec", "paste", "scale-info", - "sp-api", - "sp-application-crypto", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-runtime-interface 4.1.0-dev", + "sp-std 4.0.0", + "sp-storage 4.0.0", ] [[package]] @@ -2451,8 +2558,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "Inflector", "chrono", - "frame-benchmarking", - "frame-support", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "handlebars", "linked-hash-map", "log", @@ -2462,11 +2569,11 @@ dependencies = [ "sc-executor", "sc-service", "serde", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime", - "sp-state-machine", + "sp-core 4.1.0-dev", + "sp-externalities 0.10.0", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", "structopt", ] @@ -2475,13 +2582,13 @@ name = "frame-election-provider-support" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-arithmetic", + "sp-arithmetic 4.0.0", "sp-npos-elections", - "sp-std", + "sp-std 4.0.0", ] [[package]] @@ -2489,15 +2596,15 @@ name = "frame-executive" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-tracing", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", + "sp-tracing 4.0.0", ] [[package]] @@ -2512,6 +2619,33 @@ dependencies = [ "serde", ] +[[package]] +name = "frame-support" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "bitflags", + "frame-metadata", + "frame-support-procedural 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "impl-trait-for-tuples", + "log", + "once_cell", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 4.0.0-dev", + "sp-core 4.0.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "sp-io 4.0.0-dev", + "sp-runtime 4.0.0-dev", + "sp-staking 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "sp-state-machine 0.10.0-dev", + "sp-std 4.0.0-dev", + "sp-tracing 4.0.0-dev", +] + [[package]] name = "frame-support" version = "4.0.0-dev" @@ -2519,7 +2653,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "bitflags", "frame-metadata", - "frame-support-procedural", + "frame-support-procedural 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "impl-trait-for-tuples", "log", "once_cell", @@ -2528,26 +2662,50 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic", - "sp-core", + "sp-arithmetic 4.0.0", + "sp-core 4.1.0-dev", "sp-core-hashing-proc-macro", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-state-machine", - "sp-std", - "sp-tracing", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-state-machine 0.10.0", + "sp-std 4.0.0", + "sp-tracing 4.0.0", "tt-call", ] +[[package]] +name = "frame-support-procedural" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "Inflector", + "frame-support-procedural-tools 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "frame-support-procedural" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "Inflector", - "frame-support-procedural-tools", + "frame-support-procedural-tools 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "proc-macro-crate 1.1.0", "proc-macro2", "quote", "syn", @@ -2558,13 +2716,23 @@ name = "frame-support-procedural-tools" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support-procedural-tools-derive", + "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "proc-macro-crate 1.1.0", "proc-macro2", "quote", "syn", ] +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" @@ -2575,21 +2743,38 @@ dependencies = [ "syn", ] +[[package]] +name = "frame-system" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "frame-support 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 4.0.0-dev", + "sp-io 4.0.0-dev", + "sp-runtime 4.0.0-dev", + "sp-std 4.0.0-dev", + "sp-version 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", +] + [[package]] name = "frame-system" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-version", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", ] [[package]] @@ -2598,7 +2783,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "parity-scale-codec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", ] [[package]] @@ -2606,10 +2791,10 @@ name = "frame-try-runtime" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "sp-api", - "sp-runtime", - "sp-std", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -3560,8 +3745,8 @@ dependencies = [ "bitvec", "frame-election-provider-support", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "frame-system-rpc-runtime-api", "frame-try-runtime", "kusama-runtime-constants", @@ -3611,22 +3796,22 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-arithmetic 4.0.0", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-io 4.0.0", "sp-npos-elections", "sp-offchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", "sp-transaction-pool", - "sp-version", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "static_assertions", "substrate-wasm-builder", "xcm", @@ -3639,11 +3824,11 @@ name = "kusama-runtime-constants" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -3794,7 +3979,7 @@ dependencies = [ "futures-timer", "instant", "lazy_static", - "libsecp256k1", + "libsecp256k1 0.7.0", "log", "multiaddr", "multihash 0.14.0", @@ -3864,7 +4049,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfeead619eb5dac46e65acc78c535a60aaec803d1428cca6407c3a4fc74d698d" dependencies = [ "asynchronous-codec 0.6.0", - "base64", + "base64 0.13.0", "byteorder", "bytes 1.1.0", "fnv", @@ -4223,6 +4408,25 @@ dependencies = [ "libc", ] +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core 0.2.2", + "libsecp256k1-gen-ecmult 0.2.1", + "libsecp256k1-gen-genmult 0.2.1", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "typenum", +] + [[package]] name = "libsecp256k1" version = "0.7.0" @@ -4230,18 +4434,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0452aac8bab02242429380e9b2f94ea20cea2b37e2c1777a1358799bbe97f37" dependencies = [ "arrayref", - "base64", + "base64 0.13.0", "digest 0.9.0", "hmac-drbg", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", + "libsecp256k1-core 0.3.0", + "libsecp256k1-gen-ecmult 0.3.0", + "libsecp256k1-gen-genmult 0.3.0", "rand 0.8.5", "serde", "sha2 0.9.9", "typenum", ] +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + [[package]] name = "libsecp256k1-core" version = "0.3.0" @@ -4253,13 +4468,31 @@ dependencies = [ "subtle", ] +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core 0.2.2", +] + [[package]] name = "libsecp256k1-gen-ecmult" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" dependencies = [ - "libsecp256k1-core", + "libsecp256k1-core 0.3.0", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core 0.2.2", ] [[package]] @@ -4268,7 +4501,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" dependencies = [ - "libsecp256k1-core", + "libsecp256k1-core 0.3.0", ] [[package]] @@ -4466,6 +4699,17 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memory-db" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de006e09d04fc301a5f7e817b75aa49801c4479a8af753764416b085337ddcc5" +dependencies = [ + "hash-db", + "hashbrown 0.11.2", + "parity-util-mem", +] + [[package]] name = "memory-db" version = "0.28.0" @@ -4942,15 +5186,15 @@ name = "pallet-aura" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 4.0.0", "sp-consensus-aura", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -4958,15 +5202,15 @@ name = "pallet-authority-discovery" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "pallet-session", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 4.0.0", "sp-authority-discovery", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -4974,14 +5218,14 @@ name = "pallet-authorship" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "sp-authorship", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -4989,23 +5233,23 @@ name = "pallet-babe" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "pallet-authorship", "pallet-session", "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 4.0.0", "sp-consensus-babe", "sp-consensus-vrf", - "sp-io", - "sp-runtime", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", ] [[package]] @@ -5014,13 +5258,13 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5028,14 +5272,14 @@ name = "pallet-balances" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5044,14 +5288,14 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "beefy-primitives", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "pallet-session", "parity-scale-codec", "scale-info", "serde", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5061,10 +5305,10 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "beefy-merkle-tree", "beefy-primitives", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "hex", - "libsecp256k1", + "libsecp256k1 0.7.0", "log", "pallet-beefy", "pallet-mmr", @@ -5073,10 +5317,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5084,16 +5328,16 @@ name = "pallet-bounties" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "pallet-treasury", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5101,16 +5345,16 @@ name = "pallet-bridge-dispatch" version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "bp-message-dispatch", - "bp-runtime", - "frame-support", - "frame-system", + "bp-message-dispatch 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "bp-runtime 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5119,20 +5363,20 @@ version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "bp-header-chain", - "bp-runtime", + "bp-runtime 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", "bp-test-utils", "finality-grandpa", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "num-traits", "parity-scale-codec", "scale-info", "serde", "sp-finality-grandpa", - "sp-runtime", - "sp-std", - "sp-trie", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", + "sp-trie 4.0.0", ] [[package]] @@ -5141,19 +5385,19 @@ version = "0.1.0" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "bitvec", - "bp-message-dispatch", - "bp-messages", - "bp-runtime", - "frame-support", - "frame-system", + "bp-message-dispatch 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "bp-messages 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "bp-runtime 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5161,9 +5405,9 @@ name = "pallet-collator-selection" version = "3.0.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c5619c64d1300315612695ad4b4fcd0f562" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "pallet-authorship", "pallet-session", @@ -5171,9 +5415,9 @@ dependencies = [ "rand 0.7.3", "scale-info", "serde", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", ] [[package]] @@ -5181,16 +5425,16 @@ name = "pallet-collective" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5198,15 +5442,15 @@ name = "pallet-democracy" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", "serde", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5215,17 +5459,17 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-arithmetic", - "sp-core", - "sp-io", + "sp-arithmetic 4.0.0", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", "sp-npos-elections", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "static_assertions", ] @@ -5234,16 +5478,16 @@ name = "pallet-elections-phragmen" version = "5.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", "sp-npos-elections", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5251,14 +5495,14 @@ name = "pallet-gilt" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-arithmetic", - "sp-runtime", - "sp-std", + "sp-arithmetic 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5266,22 +5510,22 @@ name = "pallet-grandpa" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "pallet-authorship", "pallet-session", "parity-scale-codec", "scale-info", - "sp-application-crypto", - "sp-core", + "sp-application-crypto 4.0.0", + "sp-core 4.1.0-dev", "sp-finality-grandpa", - "sp-io", - "sp-runtime", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", ] [[package]] @@ -5290,14 +5534,14 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "enumflags2", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5305,18 +5549,18 @@ name = "pallet-im-online" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "pallet-authorship", "parity-scale-codec", "scale-info", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-application-crypto 4.0.0", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", ] [[package]] @@ -5324,15 +5568,15 @@ name = "pallet-indices" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", "sp-keyring", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5340,16 +5584,16 @@ name = "pallet-membership" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5358,16 +5602,16 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "ckb-merkle-mountain-range", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "pallet-mmr-primitives", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5375,15 +5619,15 @@ name = "pallet-mmr-primitives" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "serde", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5397,10 +5641,10 @@ dependencies = [ "pallet-mmr-primitives", "parity-scale-codec", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -5408,13 +5652,13 @@ name = "pallet-multisig" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5422,13 +5666,13 @@ name = "pallet-nicks" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5436,16 +5680,16 @@ name = "pallet-offences" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "pallet-balances", "parity-scale-codec", "scale-info", "serde", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", ] [[package]] @@ -5453,15 +5697,15 @@ name = "pallet-preimage" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5469,13 +5713,13 @@ name = "pallet-proxy" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5483,13 +5727,13 @@ name = "pallet-recovery" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5497,15 +5741,15 @@ name = "pallet-scheduler" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5513,20 +5757,20 @@ name = "pallet-session" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "impl-trait-for-tuples", "log", "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-staking", - "sp-std", - "sp-trie", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", + "sp-trie 4.0.0", ] [[package]] @@ -5534,13 +5778,13 @@ name = "pallet-society" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "rand_chacha 0.2.2", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5549,19 +5793,19 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "pallet-authorship", "pallet-session", "parity-scale-codec", "scale-info", "serde", - "sp-application-crypto", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-application-crypto 4.0.0", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", ] [[package]] @@ -5581,7 +5825,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "log", - "sp-arithmetic", + "sp-arithmetic 4.0.0", ] [[package]] @@ -5589,13 +5833,13 @@ name = "pallet-sudo" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5603,15 +5847,15 @@ name = "pallet-timestamp" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-inherents", - "sp-runtime", - "sp-std", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "sp-timestamp", ] @@ -5620,17 +5864,17 @@ name = "pallet-tips" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "pallet-treasury", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5638,16 +5882,16 @@ name = "pallet-transaction-payment" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5660,11 +5904,11 @@ dependencies = [ "jsonrpc-derive", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", - "sp-core", + "sp-core 4.1.0-dev", "sp-rpc", - "sp-runtime", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -5674,8 +5918,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "pallet-transaction-payment", "parity-scale-codec", - "sp-api", - "sp-runtime", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -5683,15 +5927,15 @@ name = "pallet-treasury" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "impl-trait-for-tuples", "pallet-balances", "parity-scale-codec", "scale-info", "serde", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5699,14 +5943,14 @@ name = "pallet-utility" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5714,13 +5958,13 @@ name = "pallet-vesting" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -5728,15 +5972,15 @@ name = "pallet-xcm" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "xcm", "xcm-executor", ] @@ -5755,8 +5999,8 @@ dependencies = [ "cumulus-primitives-utility", "darwinia-collator-primitives", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "frame-system-rpc-runtime-api", "pallet-aura", "pallet-authorship", @@ -5776,17 +6020,17 @@ dependencies = [ "polkadot-parachain", "scale-info", "smallvec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-block-builder", "sp-consensus-aura", - "sp-core", - "sp-inherents", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-offchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-std", + "sp-std 4.0.0", "sp-transaction-pool", - "sp-version", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "substrate-wasm-builder", "xcm", "xcm-builder", @@ -5799,8 +6043,8 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c5619c64d1300315612695ad4b4fcd0f562" dependencies = [ "cumulus-primitives-core", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "scale-info", "serde", @@ -6196,8 +6440,8 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "rand 0.8.5", - "sp-core", - "sp-keystore", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", "thiserror", "tracing", ] @@ -6237,8 +6481,8 @@ dependencies = [ "sc-cli", "sc-service", "sc-tracing", - "sp-core", - "sp-trie", + "sp-core 4.1.0-dev", + "sp-trie 4.0.0", "structopt", "substrate-build-script-utils", "thiserror", @@ -6251,7 +6495,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "beefy-primitives", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "frame-system-rpc-runtime-api", "pallet-mmr-primitives", "pallet-transaction-payment-rpc-runtime-api", @@ -6262,7 +6506,7 @@ dependencies = [ "sc-consensus", "sc-executor", "sc-service", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-authority-discovery", "sp-block-builder", "sp-blockchain", @@ -6270,9 +6514,9 @@ dependencies = [ "sp-consensus-babe", "sp-finality-grandpa", "sp-offchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-storage", + "sp-storage 4.0.0", "sp-transaction-pool", ] @@ -6290,9 +6534,9 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-core", - "sp-keystore", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", "thiserror", "tracing", ] @@ -6305,9 +6549,9 @@ dependencies = [ "parity-scale-codec", "parity-util-mem", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -6326,8 +6570,8 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "sc-network", - "sp-application-crypto", - "sp-keystore", + "sp-application-crypto 4.0.0", + "sp-keystore 0.10.0", "thiserror", "tracing", ] @@ -6341,8 +6585,8 @@ dependencies = [ "polkadot-node-primitives", "polkadot-primitives", "reed-solomon-novelpoly", - "sp-core", - "sp-trie", + "sp-core 4.1.0-dev", + "sp-trie 4.0.0", "thiserror", ] @@ -6360,9 +6604,9 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "sc-network", - "sp-application-crypto", - "sp-core", - "sp-keystore", + "sp-application-crypto 4.0.0", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", "tracing", ] @@ -6397,7 +6641,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-core", + "sp-core 4.1.0-dev", "sp-maybe-compressed-blob", "thiserror", "tracing", @@ -6424,10 +6668,10 @@ dependencies = [ "polkadot-primitives", "sc-keystore", "schnorrkel", - "sp-application-crypto", + "sp-application-crypto 4.0.0", "sp-consensus", "sp-consensus-slots", - "sp-runtime", + "sp-runtime 4.1.0-dev", "tracing", ] @@ -6464,7 +6708,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "polkadot-statement-table", - "sp-keystore", + "sp-keystore 0.10.0", "thiserror", "tracing", ] @@ -6478,7 +6722,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-keystore", + "sp-keystore 0.10.0", "thiserror", "tracing", "wasm-timer", @@ -6563,8 +6807,8 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-primitives", "sp-blockchain", - "sp-inherents", - "sp-runtime", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", "thiserror", "tracing", ] @@ -6607,12 +6851,12 @@ dependencies = [ "sc-executor-common", "sc-executor-wasmtime", "slotmap", - "sp-core", - "sp-externalities", - "sp-io", + "sp-core 4.1.0-dev", + "sp-externalities 0.10.0", + "sp-io 4.0.0", "sp-maybe-compressed-blob", - "sp-tracing", - "sp-wasm-interface", + "sp-tracing 4.0.0", + "sp-wasm-interface 4.1.0-dev", "tracing", ] @@ -6627,7 +6871,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", - "sp-keystore", + "sp-keystore 0.10.0", "thiserror", "tracing", ] @@ -6643,10 +6887,10 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-authority-discovery", "sp-consensus-babe", - "sp-core", + "sp-core 4.1.0-dev", "tracing", ] @@ -6664,7 +6908,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-primitives", "sc-network", - "sp-core", + "sp-core 4.1.0-dev", "thiserror", ] @@ -6717,11 +6961,11 @@ dependencies = [ "polkadot-primitives", "schnorrkel", "serde", - "sp-application-crypto", + "sp-application-crypto 4.0.0", "sp-consensus-babe", "sp-consensus-vrf", - "sp-core", - "sp-keystore", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", "sp-maybe-compressed-blob", "thiserror", "zstd", @@ -6777,9 +7021,9 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "rand 0.8.5", - "sp-application-crypto", - "sp-core", - "sp-keystore", + "sp-application-crypto 4.0.0", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", "thiserror", "tracing", ] @@ -6801,7 +7045,7 @@ dependencies = [ "polkadot-overseer-gen", "polkadot-primitives", "sc-client-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "tracing", ] @@ -6839,15 +7083,15 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "derive_more", - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", "parity-util-mem", "polkadot-core-primitives", "scale-info", "serde", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -6871,7 +7115,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "bitvec", - "frame-system", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "hex-literal", "parity-scale-codec", "parity-util-mem", @@ -6879,20 +7123,20 @@ dependencies = [ "polkadot-parachain", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", + "sp-arithmetic 4.0.0", "sp-authority-discovery", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-staking", - "sp-std", - "sp-trie", - "sp-version", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-io 4.0.0", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", + "sp-trie 4.0.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", ] [[package]] @@ -6916,13 +7160,13 @@ dependencies = [ "sc-rpc", "sc-sync-state-rpc", "sc-transaction-pool-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-keystore", - "sp-runtime", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", "substrate-frame-rpc-system", ] @@ -6935,8 +7179,8 @@ dependencies = [ "bitvec", "frame-election-provider-support", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "frame-system-rpc-runtime-api", "frame-try-runtime", "log", @@ -6983,21 +7227,21 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-io 4.0.0", "sp-npos-elections", "sp-offchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", "sp-transaction-pool", - "sp-version", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "static_assertions", "substrate-wasm-builder", "xcm", @@ -7013,10 +7257,10 @@ dependencies = [ "beefy-primitives", "bitvec", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "impl-trait-for-tuples", - "libsecp256k1", + "libsecp256k1 0.7.0", "log", "pallet-authorship", "pallet-bags-list", @@ -7037,15 +7281,15 @@ dependencies = [ "serde", "serde_derive", "slot-range-helper", - "sp-api", - "sp-core", - "sp-inherents", - "sp-io", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-io 4.0.0", "sp-npos-elections", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", "static_assertions", "xcm", ] @@ -7055,11 +7299,11 @@ name = "polkadot-runtime-constants" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -7070,8 +7314,8 @@ dependencies = [ "bs58", "parity-scale-codec", "polkadot-primitives", - "sp-std", - "sp-tracing", + "sp-std 4.0.0", + "sp-tracing 4.0.0", ] [[package]] @@ -7082,8 +7326,8 @@ dependencies = [ "bitflags", "bitvec", "derive_more", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "pallet-authority-discovery", "pallet-authorship", @@ -7101,15 +7345,15 @@ dependencies = [ "rustc-hex", "scale-info", "serde", - "sp-api", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-io 4.0.0", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", "xcm", "xcm-executor", ] @@ -7189,25 +7433,25 @@ dependencies = [ "sc-telemetry", "sc-transaction-pool", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-authority-discovery", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core", + "sp-core 4.1.0-dev", "sp-finality-grandpa", - "sp-inherents", - "sp-io", - "sp-keystore", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-io 4.0.0", + "sp-keystore 0.10.0", "sp-offchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-state-machine", - "sp-storage", + "sp-state-machine 0.10.0", + "sp-storage 4.0.0", "sp-timestamp", "sp-transaction-pool", - "sp-trie", + "sp-trie 4.0.0", "substrate-prometheus-endpoint", "thiserror", "tracing", @@ -7228,8 +7472,8 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-keystore", - "sp-staking", + "sp-keystore 0.10.0", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "thiserror", "tracing", ] @@ -7241,7 +7485,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab dependencies = [ "parity-scale-codec", "polkadot-primitives", - "sp-core", + "sp-core 4.1.0-dev", ] [[package]] @@ -7706,10 +7950,10 @@ dependencies = [ "parity-scale-codec", "serde", "serde_json", - "sp-core", - "sp-io", - "sp-runtime", - "sp-version", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", ] [[package]] @@ -7778,14 +8022,14 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "beefy-primitives", - "bp-messages", + "bp-messages 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", "bp-rococo", - "bp-runtime", + "bp-runtime 0.1.0 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.16)", "bp-wococo", "bridge-runtime-common", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "frame-system-rpc-runtime-api", "log", "pallet-authority-discovery", @@ -7825,20 +8069,20 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-io 4.0.0", "sp-offchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", "sp-transaction-pool", - "sp-version", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "substrate-wasm-builder", "xcm", "xcm-builder", @@ -7850,11 +8094,11 @@ name = "rococo-runtime-constants" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -7923,7 +8167,7 @@ version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ - "base64", + "base64 0.13.0", "log", "ring", "sct", @@ -7989,8 +8233,8 @@ version = "4.1.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "log", - "sp-core", - "sp-wasm-interface", + "sp-core 4.1.0-dev", + "sp-wasm-interface 4.1.0-dev", "thiserror", ] @@ -8012,12 +8256,12 @@ dependencies = [ "rand 0.7.3", "sc-client-api", "sc-network", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-authority-discovery", "sp-blockchain", - "sp-core", - "sp-keystore", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", "substrate-prometheus-endpoint", ] @@ -8035,12 +8279,12 @@ dependencies = [ "sc-proposer-metrics", "sc-telemetry", "sc-transaction-pool-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", "substrate-prometheus-endpoint", ] @@ -8051,13 +8295,13 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "parity-scale-codec", "sc-client-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-block-builder", "sp-blockchain", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", ] [[package]] @@ -8073,8 +8317,8 @@ dependencies = [ "sc-telemetry", "serde", "serde_json", - "sp-core", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -8114,12 +8358,12 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core", + "sp-core 4.1.0-dev", "sp-keyring", - "sp-keystore", - "sp-panic-handler", - "sp-runtime", - "sp-version", + "sp-keystore 0.10.0", + "sp-panic-handler 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "structopt", "thiserror", "tiny-bip39", @@ -8140,17 +8384,17 @@ dependencies = [ "sc-executor", "sc-transaction-pool-api", "sc-utils", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 4.1.0-dev", "sp-database", - "sp-externalities", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-storage", - "sp-trie", + "sp-externalities 0.10.0", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-storage 4.0.0", + "sp-trie 4.0.0", "substrate-prometheus-endpoint", ] @@ -8170,13 +8414,13 @@ dependencies = [ "parking_lot 0.11.2", "sc-client-api", "sc-state-db", - "sp-arithmetic", + "sp-arithmetic 4.0.0", "sp-blockchain", - "sp-core", + "sp-core 4.1.0-dev", "sp-database", - "sp-runtime", - "sp-state-machine", - "sp-trie", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-trie 4.0.0", ] [[package]] @@ -8193,12 +8437,12 @@ dependencies = [ "sc-client-api", "sc-utils", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", "substrate-prometheus-endpoint", "thiserror", ] @@ -8218,17 +8462,17 @@ dependencies = [ "sc-consensus", "sc-consensus-slots", "sc-telemetry", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", "substrate-prometheus-endpoint", ] @@ -8258,20 +8502,20 @@ dependencies = [ "sc-telemetry", "schnorrkel", "serde", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", "sp-consensus-slots", "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-version", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-io 4.0.0", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "substrate-prometheus-endpoint", ] @@ -8289,14 +8533,14 @@ dependencies = [ "sc-consensus-epochs", "sc-rpc-api", "serde", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core", - "sp-keystore", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -8309,7 +8553,7 @@ dependencies = [ "sc-client-api", "sc-consensus", "sp-blockchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -8325,14 +8569,14 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-telemetry", - "sp-arithmetic", + "sp-arithmetic 4.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", "sp-timestamp", "thiserror", ] @@ -8344,7 +8588,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "sc-client-api", "sp-authorship", - "sp-runtime", + "sp-runtime 4.1.0-dev", "thiserror", ] @@ -8354,7 +8598,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "lazy_static", - "libsecp256k1", + "libsecp256k1 0.7.0", "log", "lru 0.6.6", "parity-scale-codec", @@ -8362,17 +8606,17 @@ dependencies = [ "sc-executor-common", "sc-executor-wasmi", "sc-executor-wasmtime", - "sp-api", - "sp-core", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-core 4.1.0-dev", "sp-core-hashing-proc-macro", - "sp-externalities", - "sp-io", - "sp-panic-handler", - "sp-runtime-interface", + "sp-externalities 0.10.0", + "sp-io 4.0.0", + "sp-panic-handler 4.0.0", + "sp-runtime-interface 4.1.0-dev", "sp-tasks", - "sp-trie", - "sp-version", - "sp-wasm-interface", + "sp-trie 4.0.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-wasm-interface 4.1.0-dev", "wasmi", ] @@ -8385,10 +8629,10 @@ dependencies = [ "environmental", "parity-scale-codec", "sc-allocator", - "sp-core", + "sp-core 4.1.0-dev", "sp-maybe-compressed-blob", "sp-serializer", - "sp-wasm-interface", + "sp-wasm-interface 4.1.0-dev", "thiserror", "wasm-instrument", "wasmi", @@ -8404,9 +8648,9 @@ dependencies = [ "sc-allocator", "sc-executor-common", "scoped-tls", - "sp-core", - "sp-runtime-interface", - "sp-wasm-interface", + "sp-core 4.1.0-dev", + "sp-runtime-interface 4.1.0-dev", + "sp-wasm-interface 4.1.0-dev", "wasmi", ] @@ -8422,9 +8666,9 @@ dependencies = [ "parity-wasm 0.42.2", "sc-allocator", "sc-executor-common", - "sp-core", - "sp-runtime-interface", - "sp-wasm-interface", + "sp-core 4.1.0-dev", + "sp-runtime-interface 4.1.0-dev", + "sp-wasm-interface 4.1.0-dev", "wasmtime", ] @@ -8454,15 +8698,15 @@ dependencies = [ "sc-telemetry", "sc-utils", "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", + "sp-arithmetic 4.0.0", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 4.1.0-dev", "sp-finality-grandpa", - "sp-keystore", - "sp-runtime", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", "substrate-prometheus-endpoint", ] @@ -8486,8 +8730,8 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -8504,7 +8748,7 @@ dependencies = [ "sc-network", "sc-transaction-pool-api", "sp-blockchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -8517,9 +8761,9 @@ dependencies = [ "hex", "parking_lot 0.11.2", "serde_json", - "sp-application-crypto", - "sp-core", - "sp-keystore", + "sp-application-crypto 4.0.0", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", ] [[package]] @@ -8560,12 +8804,12 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-arithmetic", + "sp-arithmetic 4.0.0", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 4.1.0-dev", "sp-finality-grandpa", - "sp-runtime", + "sp-runtime 4.1.0-dev", "substrate-prometheus-endpoint", "thiserror", "unsigned-varint 0.6.0", @@ -8584,7 +8828,7 @@ dependencies = [ "log", "lru 0.7.2", "sc-network", - "sp-runtime", + "sp-runtime 4.1.0-dev", "substrate-prometheus-endpoint", "tracing", ] @@ -8609,10 +8853,10 @@ dependencies = [ "sc-client-api", "sc-network", "sc-utils", - "sp-api", - "sp-core", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-core 4.1.0-dev", "sp-offchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "threadpool", "tracing", ] @@ -8659,15 +8903,15 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde_json", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", - "sp-core", - "sp-keystore", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", "sp-offchain", "sp-rpc", - "sp-runtime", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-version", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", ] [[package]] @@ -8687,11 +8931,11 @@ dependencies = [ "sc-transaction-pool-api", "serde", "serde_json", - "sp-core", + "sp-core 4.1.0-dev", "sp-rpc", - "sp-runtime", - "sp-tracing", - "sp-version", + "sp-runtime 4.1.0-dev", + "sp-tracing 4.0.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "thiserror", ] @@ -8750,24 +8994,24 @@ dependencies = [ "sc-utils", "serde", "serde_json", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-externalities 0.10.0", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", "sp-session", - "sp-state-machine", - "sp-storage", - "sp-tracing", + "sp-state-machine 0.10.0", + "sp-storage 4.0.0", + "sp-tracing 4.0.0", "sp-transaction-pool", "sp-transaction-storage-proof", - "sp-trie", - "sp-version", + "sp-trie 4.0.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -8787,7 +9031,7 @@ dependencies = [ "parity-util-mem-derive", "parking_lot 0.11.2", "sc-client-api", - "sp-core", + "sp-core 4.1.0-dev", ] [[package]] @@ -8808,7 +9052,7 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "thiserror", ] @@ -8849,12 +9093,12 @@ dependencies = [ "sc-rpc-server", "sc-tracing-proc-macro", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", - "sp-core", + "sp-core 4.1.0-dev", "sp-rpc", - "sp-runtime", - "sp-tracing", + "sp-runtime 4.1.0-dev", + "sp-tracing 4.0.0", "thiserror", "tracing", "tracing-log", @@ -8889,11 +9133,11 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-tracing", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-tracing 4.0.0", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror", @@ -8909,7 +9153,7 @@ dependencies = [ "log", "serde", "sp-blockchain", - "sp-runtime", + "sp-runtime 4.1.0-dev", "thiserror", ] @@ -9001,6 +9245,15 @@ dependencies = [ "untrusted", ] +[[package]] +name = "secrecy" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0673d6a6449f5e7d12a1caf424fd9363e2af3a4953023ed455e3c4beef4597c0" +dependencies = [ + "zeroize", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -9237,6 +9490,15 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" +[[package]] +name = "slog" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" +dependencies = [ + "erased-serde", +] + [[package]] name = "slot-range-helper" version = "0.9.16" @@ -9245,8 +9507,8 @@ dependencies = [ "enumn", "parity-scale-codec", "paste", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -9315,7 +9577,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ - "base64", + "base64 0.13.0", "bytes 1.1.0", "flate2", "futures 0.3.21", @@ -9325,6 +9587,23 @@ dependencies = [ "sha-1 0.9.8", ] +[[package]] +name = "sp-api" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "sp-api-proc-macro 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "sp-core 4.0.0-dev", + "sp-runtime 4.0.0-dev", + "sp-state-machine 0.10.0-dev", + "sp-std 4.0.0-dev", + "sp-version 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "thiserror", +] + [[package]] name = "sp-api" version = "4.0.0-dev" @@ -9333,15 +9612,27 @@ dependencies = [ "hash-db", "log", "parity-scale-codec", - "sp-api-proc-macro", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-version", + "sp-api-proc-macro 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-std 4.0.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "thiserror", ] +[[package]] +name = "sp-api-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "blake2-rfc", + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" @@ -9354,6 +9645,19 @@ dependencies = [ "syn", ] +[[package]] +name = "sp-application-crypto" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 4.0.0-dev", + "sp-io 4.0.0-dev", + "sp-std 4.0.0-dev", +] + [[package]] name = "sp-application-crypto" version = "4.0.0" @@ -9362,9 +9666,24 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-std", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-std 4.0.0", +] + +[[package]] +name = "sp-arithmetic" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-debug-derive 3.0.0", + "sp-std 4.0.0-dev", + "static_assertions", ] [[package]] @@ -9377,8 +9696,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 4.0.0", + "sp-std 4.0.0", "static_assertions", ] @@ -9389,10 +9708,10 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "parity-scale-codec", "scale-info", - "sp-api", - "sp-application-crypto", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -9402,9 +9721,9 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "async-trait", "parity-scale-codec", - "sp-inherents", - "sp-runtime", - "sp-std", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -9413,10 +9732,10 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "parity-scale-codec", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -9429,11 +9748,11 @@ dependencies = [ "lru 0.7.2", "parity-scale-codec", "parking_lot 0.11.2", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-consensus", "sp-database", - "sp-runtime", - "sp-state-machine", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", "thiserror", ] @@ -9447,12 +9766,12 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-version", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-std 4.0.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "thiserror", ] @@ -9464,13 +9783,13 @@ dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", "sp-consensus", "sp-consensus-slots", - "sp-inherents", - "sp-runtime", - "sp-std", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "sp-timestamp", ] @@ -9484,16 +9803,16 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", "sp-consensus", "sp-consensus-slots", "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "sp-timestamp", ] @@ -9505,8 +9824,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic", - "sp-runtime", + "sp-arithmetic 4.0.0", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -9516,9 +9835,54 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "parity-scale-codec", "schnorrkel", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", +] + +[[package]] +name = "sp-core" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "base58 0.1.0", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures 0.3.21", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1 0.6.0", + "log", + "merlin", + "num-traits", + "parity-scale-codec", + "parity-util-mem", + "parking_lot 0.11.2", + "primitive-types", + "rand 0.7.3", + "regex", + "scale-info", + "schnorrkel", + "secrecy 0.7.0", + "serde", + "sha2 0.9.9", + "sp-debug-derive 3.0.0", + "sp-externalities 0.10.0-dev", + "sp-runtime-interface 4.0.0-dev", + "sp-std 4.0.0-dev", + "sp-storage 4.0.0-dev", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "tiny-keccak", + "twox-hash", + "wasmi", + "zeroize", ] [[package]] @@ -9526,7 +9890,7 @@ name = "sp-core" version = "4.1.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "base58", + "base58 0.2.0", "bitflags", "blake2-rfc", "byteorder", @@ -9538,7 +9902,7 @@ dependencies = [ "hex", "impl-serde", "lazy_static", - "libsecp256k1", + "libsecp256k1 0.7.0", "log", "merlin", "num-traits", @@ -9550,15 +9914,15 @@ dependencies = [ "regex", "scale-info", "schnorrkel", - "secrecy", + "secrecy 0.8.0", "serde", "sha2 0.10.1", "sp-core-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-debug-derive 4.0.0", + "sp-externalities 0.10.0", + "sp-runtime-interface 4.1.0-dev", + "sp-std 4.0.0", + "sp-storage 4.0.0", "ss58-registry", "substrate-bip39", "thiserror", @@ -9577,7 +9941,7 @@ dependencies = [ "blake2-rfc", "byteorder", "sha2 0.10.1", - "sp-std", + "sp-std 4.0.0", "tiny-keccak", "twox-hash", ] @@ -9602,6 +9966,16 @@ dependencies = [ "parking_lot 0.11.2", ] +[[package]] +name = "sp-debug-derive" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "sp-debug-derive" version = "4.0.0" @@ -9612,6 +9986,17 @@ dependencies = [ "syn", ] +[[package]] +name = "sp-externalities" +version = "0.10.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std 4.0.0-dev", + "sp-storage 4.0.0-dev", +] + [[package]] name = "sp-externalities" version = "0.10.0" @@ -9619,8 +10004,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "environmental", "parity-scale-codec", - "sp-std", - "sp-storage", + "sp-std 4.0.0", + "sp-storage 4.0.0", ] [[package]] @@ -9633,12 +10018,26 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-application-crypto 4.0.0", + "sp-core 4.1.0-dev", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", +] + +[[package]] +name = "sp-inherents" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "sp-core 4.0.0-dev", + "sp-runtime 4.0.0-dev", + "sp-std 4.0.0-dev", + "thiserror", ] [[package]] @@ -9649,12 +10048,36 @@ dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "thiserror", ] +[[package]] +name = "sp-io" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "futures 0.3.21", + "hash-db", + "libsecp256k1 0.6.0", + "log", + "parity-scale-codec", + "parking_lot 0.11.2", + "sp-core 4.0.0-dev", + "sp-externalities 0.10.0-dev", + "sp-keystore 0.10.0-dev", + "sp-runtime-interface 4.0.0-dev", + "sp-state-machine 0.10.0-dev", + "sp-std 4.0.0-dev", + "sp-tracing 4.0.0-dev", + "sp-trie 4.0.0-dev", + "sp-wasm-interface 4.0.0-dev", + "tracing", + "tracing-core", +] + [[package]] name = "sp-io" version = "4.0.0" @@ -9662,19 +10085,19 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "futures 0.3.21", "hash-db", - "libsecp256k1", + "libsecp256k1 0.7.0", "log", "parity-scale-codec", "parking_lot 0.11.2", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-trie", - "sp-wasm-interface", + "sp-core 4.1.0-dev", + "sp-externalities 0.10.0", + "sp-keystore 0.10.0", + "sp-runtime-interface 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-std 4.0.0", + "sp-tracing 4.0.0", + "sp-trie 4.0.0", + "sp-wasm-interface 4.1.0-dev", "tracing", "tracing-core", ] @@ -9685,11 +10108,27 @@ version = "4.1.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "lazy_static", - "sp-core", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", "strum 0.22.0", ] +[[package]] +name = "sp-keystore" +version = "0.10.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "async-trait", + "derive_more", + "futures 0.3.21", + "merlin", + "parity-scale-codec", + "parking_lot 0.11.2", + "schnorrkel", + "sp-core 4.0.0-dev", + "sp-externalities 0.10.0-dev", +] + [[package]] name = "sp-keystore" version = "0.10.0" @@ -9703,8 +10142,8 @@ dependencies = [ "parking_lot 0.11.2", "schnorrkel", "serde", - "sp-core", - "sp-externalities", + "sp-core 4.1.0-dev", + "sp-externalities 0.10.0", ] [[package]] @@ -9723,11 +10162,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic", - "sp-core", + "sp-arithmetic 4.0.0", + "sp-core 4.1.0-dev", "sp-npos-elections-solution-type", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -9746,9 +10185,17 @@ name = "sp-offchain" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "sp-api", - "sp-core", - "sp-runtime", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", +] + +[[package]] +name = "sp-panic-handler" +version = "3.0.0" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "backtrace", ] [[package]] @@ -9768,7 +10215,29 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "rustc-hash", "serde", - "sp-core", + "sp-core 4.1.0-dev", +] + +[[package]] +name = "sp-runtime" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "parity-util-mem", + "paste", + "rand 0.7.3", + "scale-info", + "serde", + "sp-application-crypto 4.0.0-dev", + "sp-arithmetic 4.0.0-dev", + "sp-core 4.0.0-dev", + "sp-io 4.0.0-dev", + "sp-std 4.0.0-dev", ] [[package]] @@ -9786,11 +10255,28 @@ dependencies = [ "rand 0.7.3", "scale-info", "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std", + "sp-application-crypto 4.0.0", + "sp-arithmetic 4.0.0", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-std 4.0.0", +] + +[[package]] +name = "sp-runtime-interface" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities 0.10.0-dev", + "sp-runtime-interface-proc-macro 4.0.0-dev", + "sp-std 4.0.0-dev", + "sp-storage 4.0.0-dev", + "sp-tracing 4.0.0-dev", + "sp-wasm-interface 4.0.0-dev", + "static_assertions", ] [[package]] @@ -9801,15 +10287,27 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-externalities 0.10.0", + "sp-runtime-interface-proc-macro 4.0.0", + "sp-std 4.0.0", + "sp-storage 4.0.0", + "sp-tracing 4.0.0", + "sp-wasm-interface 4.1.0-dev", "static_assertions", ] +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "Inflector", + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0" @@ -9838,11 +10336,22 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "parity-scale-codec", "scale-info", - "sp-api", - "sp-core", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-std 4.0.0", +] + +[[package]] +name = "sp-staking" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-runtime 4.0.0-dev", + "sp-std 4.0.0-dev", ] [[package]] @@ -9852,8 +10361,31 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4a dependencies = [ "parity-scale-codec", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", +] + +[[package]] +name = "sp-state-machine" +version = "0.10.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "hash-db", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot 0.11.2", + "rand 0.7.3", + "smallvec", + "sp-core 4.0.0-dev", + "sp-externalities 0.10.0-dev", + "sp-panic-handler 3.0.0", + "sp-std 4.0.0-dev", + "sp-trie 4.0.0-dev", + "thiserror", + "tracing", + "trie-db 0.22.6", + "trie-root 0.16.0", ] [[package]] @@ -9868,22 +10400,40 @@ dependencies = [ "parking_lot 0.11.2", "rand 0.7.3", "smallvec", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std", - "sp-trie", + "sp-core 4.1.0-dev", + "sp-externalities 0.10.0", + "sp-panic-handler 4.0.0", + "sp-std 4.0.0", + "sp-trie 4.0.0", "thiserror", "tracing", - "trie-db", - "trie-root", + "trie-db 0.23.1", + "trie-root 0.17.0", ] +[[package]] +name = "sp-std" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" + [[package]] name = "sp-std" version = "4.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" +[[package]] +name = "sp-storage" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 3.0.0", + "sp-std 4.0.0-dev", +] + [[package]] name = "sp-storage" version = "4.0.0" @@ -9893,8 +10443,8 @@ dependencies = [ "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 4.0.0", + "sp-std 4.0.0", ] [[package]] @@ -9903,11 +10453,11 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "log", - "sp-core", - "sp-externalities", - "sp-io", - "sp-runtime-interface", - "sp-std", + "sp-core 4.1.0-dev", + "sp-externalities 0.10.0", + "sp-io 4.0.0", + "sp-runtime-interface 4.1.0-dev", + "sp-std 4.0.0", ] [[package]] @@ -9919,20 +10469,38 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "thiserror", ] +[[package]] +name = "sp-tracing" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "erased-serde", + "log", + "parity-scale-codec", + "parking_lot 0.10.2", + "serde", + "serde_json", + "slog", + "sp-std 4.0.0-dev", + "tracing", + "tracing-core", + "tracing-subscriber", +] + [[package]] name = "sp-tracing" version = "4.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "parity-scale-codec", - "sp-std", + "sp-std 4.0.0", "tracing", "tracing-core", "tracing-subscriber", @@ -9943,8 +10511,8 @@ name = "sp-transaction-pool" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ - "sp-api", - "sp-runtime", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -9956,11 +10524,26 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-std", - "sp-trie", + "sp-core 4.1.0-dev", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", + "sp-trie 4.0.0", +] + +[[package]] +name = "sp-trie" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "hash-db", + "memory-db 0.27.0", + "parity-scale-codec", + "scale-info", + "sp-core 4.0.0-dev", + "sp-std 4.0.0-dev", + "trie-db 0.22.6", + "trie-root 0.16.0", ] [[package]] @@ -9969,13 +10552,29 @@ version = "4.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "hash-db", - "memory-db", + "memory-db 0.28.0", "parity-scale-codec", "scale-info", - "sp-core", - "sp-std", - "trie-db", - "trie-root", + "sp-core 4.1.0-dev", + "sp-std 4.0.0", + "trie-db 0.23.1", + "trie-root 0.17.0", +] + +[[package]] +name = "sp-version" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm 0.42.2", + "scale-info", + "serde", + "sp-runtime 4.0.0-dev", + "sp-std 4.0.0-dev", + "sp-version-proc-macro 4.0.0-dev (git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1)", + "thiserror", ] [[package]] @@ -9989,12 +10588,23 @@ dependencies = [ "scale-info", "serde", "sp-core-hashing-proc-macro", - "sp-runtime", - "sp-std", - "sp-version-proc-macro", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", + "sp-version-proc-macro 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "thiserror", ] +[[package]] +name = "sp-version-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" @@ -10006,6 +10616,17 @@ dependencies = [ "syn", ] +[[package]] +name = "sp-wasm-interface" +version = "4.0.0-dev" +source = "git+https://github.com/darwinia-network/substrate?branch=darwinia-v0.12.1#5cb17b488d600befa4918915e18d40c28a25353d" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "sp-std 4.0.0-dev", + "wasmi", +] + [[package]] name = "sp-wasm-interface" version = "4.1.0-dev" @@ -10014,7 +10635,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std", + "sp-std 4.0.0", "wasmi", "wasmtime", ] @@ -10198,11 +10819,11 @@ dependencies = [ "sc-client-api", "sc-rpc-api", "sc-transaction-pool-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "sp-block-builder", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 4.1.0-dev", + "sp-runtime 4.1.0-dev", ] [[package]] @@ -10580,6 +11201,19 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "trie-db" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eac131e334e81b6b3be07399482042838adcd7957aa0010231d0813e39e02fa" +dependencies = [ + "hash-db", + "hashbrown 0.11.2", + "log", + "rustc-hex", + "smallvec", +] + [[package]] name = "trie-db" version = "0.23.1" @@ -10593,6 +11227,15 @@ dependencies = [ "smallvec", ] +[[package]] +name = "trie-root" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "652931506d2c1244d7217a70b99f56718a7b4161b37f04e7cd868072a99f68cd" +dependencies = [ + "hash-db", +] + [[package]] name = "trie-root" version = "0.17.0" @@ -10665,13 +11308,13 @@ dependencies = [ "sc-executor", "sc-service", "serde", - "sp-core", - "sp-externalities", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-version", + "sp-core 4.1.0-dev", + "sp-externalities 0.10.0", + "sp-io 4.0.0", + "sp-keystore 0.10.0", + "sp-runtime 4.1.0-dev", + "sp-state-machine 0.10.0", + "sp-version 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "structopt", "zstd", ] @@ -11077,7 +11720,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9b4cd1949206fda9241faf8c460a7d797aa1692594d3dd6bc1cbfa57ee20d0" dependencies = [ "anyhow", - "base64", + "base64 0.13.0", "bincode", "directories-next", "file-per-thread-logger", @@ -11343,17 +11986,17 @@ name = "xcm-builder" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "log", "pallet-transaction-payment", "parity-scale-codec", "polkadot-parachain", "scale-info", - "sp-arithmetic", - "sp-io", - "sp-runtime", - "sp-std", + "sp-arithmetic 4.0.0", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "xcm", "xcm-executor", ] @@ -11363,15 +12006,15 @@ name = "xcm-executor" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16)", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-arithmetic 4.0.0", + "sp-core 4.1.0-dev", + "sp-io 4.0.0", + "sp-runtime 4.1.0-dev", + "sp-std 4.0.0", "xcm", ] diff --git a/Cargo.toml b/Cargo.toml index 489d921c..ee994537 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,11 +37,12 @@ structopt = { version = "0.3" } tempfile = { version = "3.2" } # parachain -crab-parachain-runtime = { path = "runtime/crab-parachain" } -darwinia-collator-primitives = { path = "primitives" } -darwinia-collator-rpc = { path = "rpc" } -darwinia-parachain-runtime = { path = "runtime/darwinia-parachain" } -pangolin-parachain-runtime = { path = "runtime/pangolin-parachain" } +crab-parachain-runtime = { path = "runtime/crab-parachain" } +darwinia-collator-primitives = { path = "primitives" } +darwinia-collator-rpc = { path = "rpc" } +darwinia-parachain-runtime = { path = "runtime/darwinia-parachain" } +pangolin-parachain-runtime = { path = "runtime/pangolin-parachain" } +darwinia-parachain-runtime-common = { path = "runtime/common" } # substrate pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } @@ -102,6 +103,7 @@ members = [ "primitives", "rpc", "runtime/crab-parachain", + "runtime/common", "runtime/darwinia-parachain", "runtime/pangolin-parachain", ] diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml new file mode 100644 index 00000000..6e915a80 --- /dev/null +++ b/runtime/common/Cargo.toml @@ -0,0 +1,47 @@ +[package] +authors = ["Darwinia Network "] +description = "Darwinia Parachain Runtime Common" +edition = "2021" +homepage = "https://darwinia.network/" +license = "GPL-3.0" +name = "darwinia-parachain-runtime-common" +readme = "README.md" +repository = "https://github.com/darwinia-network/darwinia-parachain" +version = "5.1.0" + +[dependencies] +# crates.io +array-bytes = { version = "1.5" } +codec = { package = "parity-scale-codec", version = "2.3", default-features = false, features = ["derive"] } +ethereum-types = { version = "0.12", default-features = false } +scale-info = { version = "1.0", default-features = false, features = ["derive"] } +# paritytech +bp-message-dispatch = { default-features = false, git = "https://github.com/darwinia-network/parity-bridges-common", branch = "darwinia-v0.12.1" } +bp-messages = { default-features = false, git = "https://github.com/darwinia-network/parity-bridges-common", branch = "darwinia-v0.12.1" } +bp-runtime = { default-features = false, git = "https://github.com/darwinia-network/parity-bridges-common", branch = "darwinia-v0.12.1" } +frame-benchmarking = { optional = true, default-features = false, git = "https://github.com/darwinia-network/substrate", branch = "darwinia-v0.12.1" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate", branch = "darwinia-v0.12.1" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate", branch = "darwinia-v0.12.1" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate", branch = "darwinia-v0.12.1" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate", branch = "darwinia-v0.12.1" } + +[features] +default = ["std"] + +std = [ + # crates.io + "codec/std", + "ethereum-types/std", + "scale-info/std", + # paritytech + "bp-messages/std", + "bp-message-dispatch/std", + "bp-runtime/std", + "frame-benchmarking/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std", +] + +runtime-benchmarks = ["frame-benchmarking"] diff --git a/runtime/common/src/helixbridge/benchmarking.rs b/runtime/common/src/helixbridge/benchmarking.rs new file mode 100644 index 00000000..023e99fe --- /dev/null +++ b/runtime/common/src/helixbridge/benchmarking.rs @@ -0,0 +1,69 @@ +// This file is part of Darwinia. +// +// Copyright (C) 2018-2022 Darwinia Network +// SPDX-License-Identifier: GPL-3.0 +// +// Darwinia 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. +// +// Darwinia is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Darwinia. If not, see . + +#![cfg(feature = "runtime-benchmarks")] + +// --- crates.io --- +use array_bytes::hex2bytes_unchecked; +// --- paritytech --- +use frame_benchmarking::benchmarks; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; +use frame_support::assert_ok; +use sp_runtime::traits::Zero; +// --- darwinia-network --- +use crate::*; + +use crate::Pallet as ParaIssuing; + +benchmarks! { + issue_from_remote { + let caller_bytes = hex2bytes_unchecked("0x28f900e9928c356287bb8806c9044168560dee80b91d2015653c9639a4998d8d"); + let caller: T::AccountId = T::AccountId::decode(&mut &caller_bytes[..]).unwrap_or_default(); + let addr_bytes = hex2bytes_unchecked("0x6d6f646c64612f73327362610000000000000000000000000000000000000000"); + let pallet_account_id: T::AccountId = T::AccountId::decode(&mut &addr_bytes[..]).unwrap_or_default(); + ::RingCurrency::deposit_creating(&pallet_account_id, U256::from(5000).low_u128().saturated_into()); + let recipient_bytes = hex2bytes_unchecked("0x8e13b96a9c9e3b1832f07935be76c2b331251e26445f520ad1c56b24477ed8d6"); + let token_address = ::RingAddress::get(); + assert_ok!(>::set_remote_backing_account( + RawOrigin::Root.into(), + pallet_account_id + )); + }:_(RawOrigin::Signed(caller), token_address, recipient_bytes, 1000.into()) + + burn_and_remote_unlock { + let caller_bytes = hex2bytes_unchecked("0x28f900e9928c356287bb8806c9044168560dee80b91d2015653c9639a4998d8d"); + let caller: T::AccountId = T::AccountId::decode(&mut &caller_bytes[..]).unwrap_or_default(); + ::RingCurrency::deposit_creating(&caller, U256::from(5000).low_u128().saturated_into()); + let recipient = caller.clone(); + }:_(RawOrigin::Signed(caller), 1, 1, + 100u128.saturated_into(), + 10u128.saturated_into(), + recipient) + + set_remote_backing_account { + let backing: T::AccountId = Default::default(); + }:_(RawOrigin::Root, backing) + + set_secure_limited_period { + let period: BlockNumberFor = Zero::zero(); + }:_(RawOrigin::Root, period) + + set_security_limitation_ring_amount { + let limitation: RingBalance = Zero::zero(); + }:_(RawOrigin::Root, limitation) +} diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs new file mode 100644 index 00000000..6220fe49 --- /dev/null +++ b/runtime/common/src/helixbridge/mod.rs @@ -0,0 +1,473 @@ +// This file is part of Darwinia. +// +// Copyright (C) 2018-2022 Darwinia Network +// SPDX-License-Identifier: GPL-3.0 +// +// Darwinia 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. +// +// Darwinia is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Darwinia. If not, see . + +//! Prototype module for s2s cross chain assets issuing. + +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod weight; +pub use weight::WeightInfo; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + +// --- crates.io --- +use ethereum_types::{H160, H256, U256}; +// --- paritytech --- +use bp_messages::{ + BridgeMessageId, + DeliveredMessages, + LaneId, + MessageNonce, + source_chain::{OnDeliveryConfirmed, MessagesBridge}, +}; +use bp_message_dispatch::CallOrigin; +use bp_runtime::{ + ChainId, + derive_account_id, + messages::DispatchFeePayment, + SourceAccount, +}; +use frame_support::{ + log, + ensure, + pallet_prelude::*, + PalletId, + traits::{ + Currency, + ExistenceRequirement, + Get, + WithdrawReasons, + }, + transactional, + weights::PostDispatchInfo, +}; +use frame_system::{RawOrigin, ensure_signed}; +use sp_runtime::{ + DispatchErrorWithPostInfo, + MultiSignature, + MultiSigner, + SaturatedConversion, + traits::{ + AccountIdConversion, + BadOrigin, + Convert, + Saturating, + Zero, + }, +}; +use sp_std::{str, vec, vec::Vec}; + +pub use pallet::*; +pub type ChainName = Vec; +pub type AccountId = ::AccountId; +pub type RingBalance = <::RingCurrency as Currency>>::Balance; + +/// The parameters box for the pallet runtime call. +#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)] +pub enum CallParams { + #[codec(index = 2)] + S2sBackingPalletUnlockFromRemote(H160, U256, Vec), +} +/// Creating a concrete message payload which would be relay to target chain. +pub trait CreatePayload { + type Payload: Encode; + + fn encode_call(pallet_index: u8, call_params: CallParams) -> Result, &'static str> { + let mut encoded = vec![pallet_index]; + encoded.append(&mut call_params.encode()); + Ok(encoded) + } + + fn create( + origin: CallOrigin, + spec_version: u32, + weight: u64, + call_params: CallParams, + dispatch_fee_payment: DispatchFeePayment, + ) -> Result; +} + +pub trait LatestMessageNoncer { + fn outbound_latest_generated_nonce(lane_id: LaneId) -> u64; + fn inbound_latest_received_nonce(lane_id: LaneId) -> u64; +} + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_system::pallet_prelude::*; + + #[pallet::config] + #[pallet::disable_frame_system_supertrait_check] + pub trait Config: frame_system::Config { + /// The pallet id of this pallet + #[pallet::constant] + type PalletId: Get; + + /// The overarching event type. + type Event: From> + IsType<::Event>; + + /// Weight information for extrinsics in this pallet. + type WeightInfo: WeightInfo; + + /// The *RING* currency. + type RingCurrency: Currency>; + + /// The bridge account id converter. + /// `remote account` + `remote chain id` derive the new account + type BridgedAccountIdConverter: Convert; + + /// The bridged chain id + type BridgedChainId: Get; + + /// Outbound payload creator used for s2s message + type OutboundPayloadCreator: Parameter + + CreatePayload; + + /// The remote chain name where the backing module in + type BackingChainName: Get; + + /// The lane id of the s2s bridge + type MessageLaneId: Get; + + /// The local ring address + #[pallet::constant] + type RingAddress: Get; + + type MessagesBridge: MessagesBridge< + Self::AccountId, + RingBalance, + <::OutboundPayloadCreator as CreatePayload< + Self::AccountId, + MultiSigner, + MultiSignature, + >>::Payload, + Error = DispatchErrorWithPostInfo, + >; + type MessageNoncer: LatestMessageNoncer; + } + + /// Remote Backing Address, this used to verify the remote caller + #[pallet::storage] + #[pallet::getter(fn remote_backing_account)] + pub type RemoteBackingAccount = StorageValue<_, AccountId, ValueQuery>; + + /// `(sender, amount)` the user *sender* lock and remote issuing amount of asset + #[pallet::storage] + #[pallet::getter(fn transaction_infos)] + pub type TransactionInfos = StorageMap< + _, + Blake2_128Concat, + BridgeMessageId, + (AccountId, RingBalance), + OptionQuery, + >; + + /// Period between security limitation. Zero means there is no period limitation. + #[pallet::storage] + #[pallet::getter(fn secure_limited_period)] + pub type SecureLimitedPeriod = StorageValue<_, BlockNumberFor, ValueQuery>; + + #[pallet::storage] + #[pallet::getter(fn secure_limited_ring_amount)] + pub type SecureLimitedRingAmount = + StorageValue<_, (RingBalance, RingBalance), ValueQuery>; + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(PhantomData); + + #[pallet::hooks] + impl Hooks> for Pallet { + fn on_initialize(now: BlockNumberFor) -> Weight { + let secure_limited_period = >::get(); + + if !secure_limited_period.is_zero() && (now % secure_limited_period).is_zero() { + >::mutate(|(used, _)| *used = Zero::zero()); + + T::DbWeight::get().reads_writes(2, 1) + } else { + T::DbWeight::get().reads(1) + } + } + } + + #[pallet::call] + impl Pallet { + /// Handle relay message sent from the source backing pallet with relay message + #[pallet::weight( + ::WeightInfo::issue_from_remote() + )] + #[transactional] + pub fn issue_from_remote( + origin: OriginFor, + token_address: H160, + recipient: Vec, + value: U256, + ) -> DispatchResultWithPostInfo { + let user = ensure_signed(origin)?; + + let target_id = Self::derived_backing_id(); + ensure!(&target_id == &user, BadOrigin); + + ensure!( + token_address == T::RingAddress::get(), + >::UnsupportedToken + ); + let value = value.low_u128().saturated_into(); + // Make sure the total transfer is less than the security limitation + { + let (used, limitation) = >::get(); + ensure!( + >::get().is_zero() + || used.saturating_add(value) <= limitation, + >::RingDailyLimited + ); + } + // Make sure the recipient is valid(AccountId32). + ensure!(recipient.len() == 32, Error::::InvalidRecipient); + let recipient_id = T::AccountId::decode(&mut &recipient[..]) + .map_err(|_| Error::::InvalidRecipient)?; + + T::RingCurrency::deposit_creating(&recipient_id, value); + Self::deposit_event(Event::TokenIssued( + recipient_id, + value, + )); + Ok(().into()) + } + + #[pallet::weight( + ::WeightInfo::burn_and_remote_unlock() + )] + #[transactional] + pub fn burn_and_remote_unlock( + origin: OriginFor, + spec_version: u32, + weight: u64, + #[pallet::compact] value: RingBalance, + #[pallet::compact] fee: RingBalance, + recipient: AccountId, + ) -> DispatchResultWithPostInfo { + let user = ensure_signed(origin)?; + + // Make sure the user's balance is enough to lock + ensure!( + T::RingCurrency::free_balance(&user) > value + fee, + >::InsufficientBalance + ); + + T::RingCurrency::transfer(&user, &Self::pallet_account_id(), value, ExistenceRequirement::KeepAlive)?; + + // Send to the target chain + let amount: U256 = value.saturated_into::().into(); + let token_address = T::RingAddress::get(); + + let payload = T::OutboundPayloadCreator::create( + CallOrigin::SourceAccount(Self::pallet_account_id()), + spec_version, + weight, + CallParams::S2sBackingPalletUnlockFromRemote(T::RingAddress::get(), amount, recipient.encode()), + DispatchFeePayment::AtSourceChain, + )?; + // this pallet account as the submitter of the remote message + // we need to transfer fee from user to this account to pay the bridge fee + T::RingCurrency::transfer(&user, &Self::pallet_account_id(), fee, ExistenceRequirement::KeepAlive)?; + T::MessagesBridge::send_message( + RawOrigin::Signed(Self::pallet_account_id()), + T::MessageLaneId::get(), + payload, + fee, + )?; + + let message_nonce = + T::MessageNoncer::outbound_latest_generated_nonce(T::MessageLaneId::get()); + let message_id: BridgeMessageId = (T::MessageLaneId::get(), message_nonce); + ensure!( + !>::contains_key(message_id), + Error::::NonceDuplicated + ); + >::insert(message_id, (user.clone(), value)); + Self::deposit_event(Event::TokenBurnAndRemoteUnlocked( + T::MessageLaneId::get(), + message_nonce, + token_address, + user, + recipient, + value, + )); + Ok(().into()) + } + + #[pallet::weight( + ::WeightInfo::set_remote_backing_account() + )] + pub fn set_remote_backing_account( + origin: OriginFor, + account: AccountId, + ) -> DispatchResultWithPostInfo { + ensure_root(origin)?; + >::put(account.clone()); + Self::deposit_event(Event::RemoteBackingAccountUpdated(account)); + Ok(().into()) + } + + #[pallet::weight( + ::WeightInfo::set_secure_limited_period() + )] + pub fn set_secure_limited_period( + origin: OriginFor, + period: BlockNumberFor, + ) -> DispatchResultWithPostInfo { + ensure_root(origin)?; + + >::put(period); + + Ok(().into()) + } + + #[pallet::weight( + ::WeightInfo::set_security_limitation_ring_amount() + )] + pub fn set_security_limitation_ring_amount( + origin: OriginFor, + limitation: RingBalance, + ) -> DispatchResultWithPostInfo { + ensure_root(origin)?; + + >::mutate(|(_, limitation_)| *limitation_ = limitation); + + Ok(().into()) + } + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// TokenBurnAndRemoteUnlocked \[lane_id, message_nonce, token address, sender, recipient, amount\] + TokenBurnAndRemoteUnlocked( + LaneId, + MessageNonce, + H160, + AccountId, + AccountId, + RingBalance, + ), + /// [backing_address, mapping_token, recipient, amount] + TokenIssued(AccountId, RingBalance), + /// Update remote backing address \[account\] + RemoteBackingAccountUpdated(AccountId), + /// Token unlocked confirmed from remote \[lane_id, message_nonce, user, amount, result\] + TokenUnlockedConfirmed(LaneId, MessageNonce, AccountId, RingBalance, bool), + } + + #[pallet::error] + /// Issuing pallet errors. + pub enum Error { + /// Redeem Daily Limited + RingDailyLimited, + /// Insufficient balance. + InsufficientBalance, + /// Message nonce duplicated. + NonceDuplicated, + /// Unsupported token + UnsupportedToken, + /// Invalid recipient + InvalidRecipient, + } + + #[pallet::genesis_config] + pub struct GenesisConfig { + pub secure_limited_period: BlockNumberFor, + pub secure_limited_ring_amount: RingBalance, + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + Self { + secure_limited_period: Zero::zero(), + secure_limited_ring_amount: Zero::zero(), + } + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + >::put(self.secure_limited_period); + >::put(( + >::zero(), + self.secure_limited_ring_amount, + )); + } + } + + impl Pallet { + pub fn pallet_account_id() -> T::AccountId { + T::PalletId::get().into_account() + } + + pub fn derived_backing_id() -> T::AccountId { + let hex_id = + derive_account_id::( + T::BridgedChainId::get(), + SourceAccount::Account(>::get()) + ); + log::info!("===== hexid {:?}", hex_id); + T::BridgedAccountIdConverter::convert(hex_id) + } + } + + impl OnDeliveryConfirmed for Pallet { + fn on_messages_delivered(lane: &LaneId, messages: &DeliveredMessages) -> Weight { + if *lane != T::MessageLaneId::get() { + return 0; + } + for nonce in messages.begin..=messages.end { + let result = messages.message_dispatch_result(nonce); + if let Some((user, value)) = >::take((*lane, nonce)) { + if !result { + // if remote backing unlock failed, this fund need to transfer back to the user. + // otherwise burn it. + let _ = T::RingCurrency::transfer( + &Self::pallet_account_id(), + &user, + value, + ExistenceRequirement::KeepAlive, + ); + } else { + let _ = T::RingCurrency::withdraw( + &Self::pallet_account_id(), + value, + WithdrawReasons::TRANSFER, + ExistenceRequirement::AllowDeath + ); + } + Self::deposit_event(Event::TokenUnlockedConfirmed( + *lane, nonce, user, value, result, + )); + } + } + ::DbWeight::get().reads_writes(1, 1) + } + } +} + + diff --git a/runtime/common/src/helixbridge/weight.rs b/runtime/common/src/helixbridge/weight.rs new file mode 100644 index 00000000..3fc848f4 --- /dev/null +++ b/runtime/common/src/helixbridge/weight.rs @@ -0,0 +1,172 @@ +// This file is part of Darwinia. +// +// Copyright (C) 2018-2022 Darwinia Network +// SPDX-License-Identifier: GPL-3.0 +// +// Darwinia 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. +// +// Darwinia is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Darwinia. If not, see . + +//! Autogenerated weights for from_substrate_issuing_test +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-03-20, STEPS: `100`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// ./target/release/drml +// benchmark +// --chain +// dev +// --wasm-execution +// compiled +// --pallet +// from_substrate_issuing_test +// --execution +// wasm +// --extrinsic=* +// --steps +// 100 +// --repeat +// 10 +// --raw +// --heap-pages=4096 +// --output=./frame/wormhole/xxx/s2s/src/weight.rs +// --template=./.maintain/frame-weight-template.hbs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for from_substrate_issuing_test. +pub trait WeightInfo { + fn issue_from_remote() -> Weight; + fn burn_and_remote_unlock() -> Weight; + fn set_remote_backing_account() -> Weight; + fn set_secure_limited_period() -> Weight; + fn set_security_limitation_ring_amount() -> Weight; +} + +/// Weights for from_substrate_issuing_test using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + // Storage: ParaChainIssuing RemoteBackingAccount (r:1 w:0) + // Storage: ParaChainIssuing SecureLimitedRingAmount (r:1 w:0) + // Storage: ParaChainIssuing SecureLimitedPeriod (r:1 w:0) + // Storage: System Account (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + // Storage: Balances TotalIssuance (r:1 w:1) + fn issue_from_remote() -> Weight { + (172_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(9 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + // Storage: System Account (r:3 w:3) + // Storage: System Number (r:1 w:0) + // Storage: Balances Locks (r:2 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + // Storage: BridgePangoroMessages PalletOperatingMode (r:1 w:0) + // Storage: BridgePangoroMessages OutboundLanes (r:1 w:1) + // Storage: FeeMarket AssignedRelayers (r:1 w:0) + // Storage: ParaChainIssuing TransactionInfos (r:1 w:1) + // Storage: BridgePangoroMessages OutboundMessages (r:0 w:1) + fn burn_and_remote_unlock() -> Weight { + (424_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(13 as Weight)) + .saturating_add(T::DbWeight::get().writes(8 as Weight)) + } + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + // Storage: ParaChainIssuing RemoteBackingAccount (r:0 w:1) + fn set_remote_backing_account() -> Weight { + (43_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + // Storage: ParaChainIssuing SecureLimitedPeriod (r:0 w:1) + fn set_secure_limited_period() -> Weight { + (5_000_000 as Weight) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: ParaChainIssuing SecureLimitedRingAmount (r:1 w:1) + fn set_security_limitation_ring_amount() -> Weight { + (15_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + // Storage: ParaChainIssuing RemoteBackingAccount (r:1 w:0) + // Storage: ParaChainIssuing SecureLimitedRingAmount (r:1 w:0) + // Storage: ParaChainIssuing SecureLimitedPeriod (r:1 w:0) + // Storage: System Account (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + // Storage: Balances TotalIssuance (r:1 w:1) + fn issue_from_remote() -> Weight { + (172_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(9 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + // Storage: System Account (r:3 w:3) + // Storage: System Number (r:1 w:0) + // Storage: Balances Locks (r:2 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + // Storage: BridgePangoroMessages PalletOperatingMode (r:1 w:0) + // Storage: BridgePangoroMessages OutboundLanes (r:1 w:1) + // Storage: FeeMarket AssignedRelayers (r:1 w:0) + // Storage: ParaChainIssuing TransactionInfos (r:1 w:1) + // Storage: BridgePangoroMessages OutboundMessages (r:0 w:1) + fn burn_and_remote_unlock() -> Weight { + (424_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(13 as Weight)) + .saturating_add(RocksDbWeight::get().writes(8 as Weight)) + } + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + // Storage: ParaChainIssuing RemoteBackingAccount (r:0 w:1) + fn set_remote_backing_account() -> Weight { + (43_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + } + // Storage: ParaChainIssuing SecureLimitedPeriod (r:0 w:1) + fn set_secure_limited_period() -> Weight { + (5_000_000 as Weight) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: ParaChainIssuing SecureLimitedRingAmount (r:1 w:1) + fn set_security_limitation_ring_amount() -> Weight { + (15_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } +} diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs new file mode 100644 index 00000000..e1b6d0be --- /dev/null +++ b/runtime/common/src/lib.rs @@ -0,0 +1,21 @@ +// This file is part of Darwinia. +// +// Copyright (C) 2018-2022 Darwinia Network +// SPDX-License-Identifier: GPL-3.0 +// +// Darwinia 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. +// +// Darwinia is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Darwinia. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod helixbridge; From e98373f98280912ed182dee2708adacc7c25b36a Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Tue, 12 Apr 2022 10:19:31 +0800 Subject: [PATCH 02/18] fix accountid no default --- .../common/src/helixbridge/benchmarking.rs | 42 ++--- runtime/common/src/helixbridge/mod.rs | 171 +++++++++--------- 2 files changed, 102 insertions(+), 111 deletions(-) diff --git a/runtime/common/src/helixbridge/benchmarking.rs b/runtime/common/src/helixbridge/benchmarking.rs index 023e99fe..ad348b1e 100644 --- a/runtime/common/src/helixbridge/benchmarking.rs +++ b/runtime/common/src/helixbridge/benchmarking.rs @@ -22,8 +22,8 @@ use array_bytes::hex2bytes_unchecked; // --- paritytech --- use frame_benchmarking::benchmarks; -use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use frame_support::assert_ok; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use sp_runtime::traits::Zero; // --- darwinia-network --- use crate::*; @@ -31,33 +31,33 @@ use crate::*; use crate::Pallet as ParaIssuing; benchmarks! { - issue_from_remote { + issue_from_remote { let caller_bytes = hex2bytes_unchecked("0x28f900e9928c356287bb8806c9044168560dee80b91d2015653c9639a4998d8d"); let caller: T::AccountId = T::AccountId::decode(&mut &caller_bytes[..]).unwrap_or_default(); - let addr_bytes = hex2bytes_unchecked("0x6d6f646c64612f73327362610000000000000000000000000000000000000000"); - let pallet_account_id: T::AccountId = T::AccountId::decode(&mut &addr_bytes[..]).unwrap_or_default(); - ::RingCurrency::deposit_creating(&pallet_account_id, U256::from(5000).low_u128().saturated_into()); + let addr_bytes = hex2bytes_unchecked("0x6d6f646c64612f73327362610000000000000000000000000000000000000000"); + let pallet_account_id: T::AccountId = T::AccountId::decode(&mut &addr_bytes[..]).unwrap_or_default(); + ::RingCurrency::deposit_creating(&pallet_account_id, U256::from(5000).low_u128().saturated_into()); let recipient_bytes = hex2bytes_unchecked("0x8e13b96a9c9e3b1832f07935be76c2b331251e26445f520ad1c56b24477ed8d6"); - let token_address = ::RingAddress::get(); - assert_ok!(>::set_remote_backing_account( - RawOrigin::Root.into(), - pallet_account_id - )); - }:_(RawOrigin::Signed(caller), token_address, recipient_bytes, 1000.into()) + let token_address = ::RingAddress::get(); + assert_ok!(>::set_remote_backing_account( + RawOrigin::Root.into(), + pallet_account_id + )); + }:_(RawOrigin::Signed(caller), token_address, recipient_bytes, 1000.into()) - burn_and_remote_unlock { + burn_and_remote_unlock { let caller_bytes = hex2bytes_unchecked("0x28f900e9928c356287bb8806c9044168560dee80b91d2015653c9639a4998d8d"); let caller: T::AccountId = T::AccountId::decode(&mut &caller_bytes[..]).unwrap_or_default(); - ::RingCurrency::deposit_creating(&caller, U256::from(5000).low_u128().saturated_into()); - let recipient = caller.clone(); - }:_(RawOrigin::Signed(caller), 1, 1, - 100u128.saturated_into(), - 10u128.saturated_into(), - recipient) + ::RingCurrency::deposit_creating(&caller, U256::from(5000).low_u128().saturated_into()); + let recipient = caller.clone(); + }:_(RawOrigin::Signed(caller), 1, 1, + 100u128.saturated_into(), + 10u128.saturated_into(), + recipient) - set_remote_backing_account { - let backing: T::AccountId = Default::default(); - }:_(RawOrigin::Root, backing) + set_remote_backing_account { + let backing: T::AccountId = Default::default(); + }:_(RawOrigin::Root, backing) set_secure_limited_period { let period: BlockNumberFor = Zero::zero(); diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index e84eb7ce..47f9fa0f 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -29,47 +29,24 @@ mod benchmarking; // --- crates.io --- use ethereum_types::{H160, H256, U256}; // --- paritytech --- -use bp_messages::{ - BridgeMessageId, - DeliveredMessages, - LaneId, - MessageNonce, - source_chain::{OnDeliveryConfirmed, MessagesBridge}, -}; use bp_message_dispatch::CallOrigin; -use bp_runtime::{ - ChainId, - derive_account_id, - messages::DispatchFeePayment, - SourceAccount, +use bp_messages::{ + source_chain::{MessagesBridge, OnDeliveryConfirmed}, + BridgeMessageId, DeliveredMessages, LaneId, MessageNonce, }; +use bp_runtime::{derive_account_id, messages::DispatchFeePayment, ChainId, SourceAccount}; use frame_support::{ - log, ensure, pallet_prelude::*, - PalletId, - traits::{ - Currency, - ExistenceRequirement, - Get, - WithdrawReasons, - }, + traits::{Currency, ExistenceRequirement, Get, WithdrawReasons}, transactional, - weights::PostDispatchInfo, + weights::PostDispatchInfo, + PalletId, }; -use frame_system::{RawOrigin, ensure_signed}; +use frame_system::{ensure_signed, RawOrigin}; use sp_runtime::{ - DispatchErrorWithPostInfo, - MultiSignature, - MultiSigner, - SaturatedConversion, - traits::{ - AccountIdConversion, - BadOrigin, - Convert, - Saturating, - Zero, - }, + traits::{AccountIdConversion, BadOrigin, Convert, Saturating, Zero}, + DispatchErrorWithPostInfo, MultiSignature, MultiSigner, SaturatedConversion, }; use sp_std::{str, vec, vec::Vec}; @@ -104,8 +81,8 @@ pub trait CreatePayload u64; - fn inbound_latest_received_nonce(lane_id: LaneId) -> u64; + fn outbound_latest_generated_nonce(lane_id: LaneId) -> u64; + fn inbound_latest_received_nonce(lane_id: LaneId) -> u64; } #[frame_support::pallet] @@ -150,25 +127,25 @@ pub mod pallet { #[pallet::constant] type RingAddress: Get; - type MessagesBridge: MessagesBridge< - Self::AccountId, - RingBalance, - <::OutboundPayloadCreator as CreatePayload< - Self::AccountId, - MultiSigner, - MultiSignature, - >>::Payload, - Error = DispatchErrorWithPostInfo, - >; + type MessagesBridge: MessagesBridge< + Self::AccountId, + RingBalance, + <::OutboundPayloadCreator as CreatePayload< + Self::AccountId, + MultiSigner, + MultiSignature, + >>::Payload, + Error = DispatchErrorWithPostInfo, + >; type MessageNoncer: LatestMessageNoncer; } /// Remote Backing Address, this used to verify the remote caller #[pallet::storage] #[pallet::getter(fn remote_backing_account)] - pub type RemoteBackingAccount = StorageValue<_, AccountId, ValueQuery>; + pub type RemoteBackingAccount = StorageValue<_, AccountId, OptionQuery>; - /// `(sender, amount)` the user *sender* lock and remote issuing amount of asset + /// `(sender, amount)` the user *sender* lock and remote issuing amount of asset #[pallet::storage] #[pallet::getter(fn transaction_infos)] pub type TransactionInfos = StorageMap< @@ -218,20 +195,24 @@ pub mod pallet { pub fn issue_from_remote( origin: OriginFor, token_address: H160, - recipient: Vec, + recipient: Vec, value: U256, ) -> DispatchResultWithPostInfo { let user = ensure_signed(origin)?; - let target_id = Self::derived_backing_id(); - ensure!(&target_id == &user, BadOrigin); - - ensure!( + if let Some(backing) = >::get() { + let target_id = Self::derived_backing_id(backing); + ensure!(&target_id == &user, BadOrigin); + } else { + return Err(Error::::BackingAccountNone.into()); + } + + ensure!( token_address == T::RingAddress::get(), >::UnsupportedToken ); let value = value.low_u128().saturated_into(); - // Make sure the total transfer is less than the security limitation + // Make sure the total transfer is less than the security limitation { let (used, limitation) = >::get(); ensure!( @@ -245,11 +226,8 @@ pub mod pallet { let recipient_id = T::AccountId::decode(&mut &recipient[..]) .map_err(|_| Error::::InvalidRecipient)?; - T::RingCurrency::deposit_creating(&recipient_id, value); - Self::deposit_event(Event::TokenIssued( - recipient_id, - value, - )); + T::RingCurrency::deposit_creating(&recipient_id, value); + Self::deposit_event(Event::TokenIssued(recipient_id, value)); Ok(().into()) } @@ -257,7 +235,7 @@ pub mod pallet { ::WeightInfo::burn_and_remote_unlock() )] #[transactional] - pub fn burn_and_remote_unlock( + pub fn burn_and_remote_unlock( origin: OriginFor, spec_version: u32, weight: u64, @@ -273,7 +251,12 @@ pub mod pallet { >::InsufficientBalance ); - T::RingCurrency::transfer(&user, &Self::pallet_account_id(), value, ExistenceRequirement::KeepAlive)?; + T::RingCurrency::transfer( + &user, + &Self::pallet_account_id(), + value, + ExistenceRequirement::KeepAlive, + )?; // Send to the target chain let amount: U256 = value.saturated_into::().into(); @@ -283,12 +266,21 @@ pub mod pallet { CallOrigin::SourceAccount(Self::pallet_account_id()), spec_version, weight, - CallParams::S2sBackingPalletUnlockFromRemote(T::RingAddress::get(), amount, recipient.encode()), + CallParams::S2sBackingPalletUnlockFromRemote( + T::RingAddress::get(), + amount, + recipient.encode(), + ), DispatchFeePayment::AtSourceChain, )?; // this pallet account as the submitter of the remote message // we need to transfer fee from user to this account to pay the bridge fee - T::RingCurrency::transfer(&user, &Self::pallet_account_id(), fee, ExistenceRequirement::KeepAlive)?; + T::RingCurrency::transfer( + &user, + &Self::pallet_account_id(), + fee, + ExistenceRequirement::KeepAlive, + )?; T::MessagesBridge::send_message( RawOrigin::Signed(Self::pallet_account_id()), T::MessageLaneId::get(), @@ -313,7 +305,7 @@ pub mod pallet { value, )); Ok(().into()) - } + } #[pallet::weight( ::WeightInfo::set_remote_backing_account() @@ -328,7 +320,7 @@ pub mod pallet { Ok(().into()) } - #[pallet::weight( + #[pallet::weight( ::WeightInfo::set_secure_limited_period() )] pub fn set_secure_limited_period( @@ -342,7 +334,7 @@ pub mod pallet { Ok(().into()) } - #[pallet::weight( + #[pallet::weight( ::WeightInfo::set_security_limitation_ring_amount() )] pub fn set_security_limitation_ring_amount( @@ -361,7 +353,7 @@ pub mod pallet { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// TokenBurnAndRemoteUnlocked \[lane_id, message_nonce, token address, sender, recipient, amount\] - TokenBurnAndRemoteUnlocked( + TokenBurnAndRemoteUnlocked( LaneId, MessageNonce, H160, @@ -390,6 +382,8 @@ pub mod pallet { UnsupportedToken, /// Invalid recipient InvalidRecipient, + /// Backing not configured + BackingAccountNone, } #[pallet::genesis_config] @@ -412,26 +406,25 @@ pub mod pallet { impl GenesisBuild for GenesisConfig { fn build(&self) { >::put(self.secure_limited_period); - >::put(( + >::put(( >::zero(), self.secure_limited_ring_amount, )); } } - impl Pallet { + impl Pallet { pub fn pallet_account_id() -> T::AccountId { T::PalletId::get().into_account() } - pub fn derived_backing_id() -> T::AccountId { - let hex_id = - derive_account_id::( - T::BridgedChainId::get(), - SourceAccount::Account(>::get()) - ); - T::BridgedAccountIdConverter::convert(hex_id) - } + pub fn derived_backing_id(backing_account: T::AccountId) -> T::AccountId { + let hex_id = derive_account_id::( + T::BridgedChainId::get(), + SourceAccount::Account(backing_account), + ); + T::BridgedAccountIdConverter::convert(hex_id) + } } impl OnDeliveryConfirmed for Pallet { @@ -441,10 +434,10 @@ pub mod pallet { } for nonce in messages.begin..=messages.end { let result = messages.message_dispatch_result(nonce); - if let Some((user, value)) = >::take((*lane, nonce)) { + if let Some((user, value)) = >::take((*lane, nonce)) { if !result { // if remote backing unlock failed, this fund need to transfer back to the user. - // otherwise burn it. + // otherwise burn it. let _ = T::RingCurrency::transfer( &Self::pallet_account_id(), &user, @@ -452,21 +445,19 @@ pub mod pallet { ExistenceRequirement::KeepAlive, ); } else { - let _ = T::RingCurrency::withdraw( - &Self::pallet_account_id(), - value, - WithdrawReasons::TRANSFER, - ExistenceRequirement::AllowDeath - ); - } - Self::deposit_event(Event::TokenUnlockedConfirmed( - *lane, nonce, user, value, result, - )); + let _ = T::RingCurrency::withdraw( + &Self::pallet_account_id(), + value, + WithdrawReasons::TRANSFER, + ExistenceRequirement::AllowDeath, + ); + } + Self::deposit_event(Event::TokenUnlockedConfirmed( + *lane, nonce, user, value, result, + )); } } ::DbWeight::get().reads_writes(1, 1) } } } - - From 0ce78b7aebe4a75c0f72c95259cd431ac5f0ef75 Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Tue, 12 Apr 2022 19:00:26 +0800 Subject: [PATCH 03/18] runtime add issuing --- runtime/common/src/helixbridge/mod.rs | 2 - .../src/bridges_message/pangolin.rs | 3 + runtime/pangolin-parachain/src/lib.rs | 2 + .../src/pallets/from_substrate_issuing_.rs | 93 +++++++++++++++++++ runtime/pangolin-parachain/src/pallets/mod.rs | 3 + 5 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index 47f9fa0f..8601fff1 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -18,8 +18,6 @@ //! Prototype module for s2s cross chain assets issuing. -#![cfg_attr(not(feature = "std"), no_std)] - pub mod weight; pub use weight::WeightInfo; diff --git a/runtime/pangolin-parachain/src/bridges_message/pangolin.rs b/runtime/pangolin-parachain/src/bridges_message/pangolin.rs index c64a0eea..8788ebf0 100644 --- a/runtime/pangolin-parachain/src/bridges_message/pangolin.rs +++ b/runtime/pangolin-parachain/src/bridges_message/pangolin.rs @@ -229,3 +229,6 @@ impl SourceHeaderChain for Pangolin { ) } } + +/// The s2s backing pallet index in the pangoro chain runtime. +pub const PANGOLIN_S2S_BACKING_PALLET_INDEX: u8 = 20; diff --git a/runtime/pangolin-parachain/src/lib.rs b/runtime/pangolin-parachain/src/lib.rs index a4456f4e..f8dbcd61 100644 --- a/runtime/pangolin-parachain/src/lib.rs +++ b/runtime/pangolin-parachain/src/lib.rs @@ -158,6 +158,8 @@ frame_support::construct_runtime! { BridgePangolinDispatch: pallet_bridge_dispatch::::{Pallet, Event} = 22, FeeMarket: pallet_fee_market::{Pallet, Call, Storage, Event} = 23, + + FromPangolinIssuing: dc_common_runtime::helixbridge::{Pallet, Call, Storage, Event} = 24, } } diff --git a/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs b/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs new file mode 100644 index 00000000..736c2470 --- /dev/null +++ b/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs @@ -0,0 +1,93 @@ +// --- paritytech -- +use bp_messages::LaneId; +use bp_runtime::ChainId; +use frame_support::PalletId; +use pallet_bridge_messages::Instance1 as WithPangolinMessages; +use sp_core::H160; +// --- darwinia-network --- +use crate::*; +use bp_message_dispatch::CallOrigin; +use bp_pangolin::AccountIdConverter; +use bp_runtime::{messages::DispatchFeePayment, PANGOLIN_CHAIN_ID}; +use bridges_message::pangolin::{ + ToPangolinMessagePayload, PANGOLIN_PANGOLIN_PARACHAIN_LANE, PANGOLIN_S2S_BACKING_PALLET_INDEX, +}; +use codec::{Decode, Encode}; +use dc_common_runtime::helixbridge::{ + CallParams, ChainName, Config, CreatePayload, LatestMessageNoncer, +}; +use frame_support::RuntimeDebug; +use scale_info::TypeInfo; +use sp_runtime::{traits::AccountIdConversion, AccountId32}; + +use pallet_bridge_messages::{inbound_lane, outbound_lane}; + +pub struct ToPangoroMessageSender; +impl LatestMessageNoncer for ToPangoroMessageSender { + fn outbound_latest_generated_nonce(lane_id: LaneId) -> u64 { + outbound_lane::(lane_id) + .data() + .latest_generated_nonce + .into() + } + + fn inbound_latest_received_nonce(lane_id: LaneId) -> u64 { + inbound_lane::(lane_id) + .data() + .last_delivered_nonce() + .into() + } +} + +#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +pub struct ToPangoroOutboundPayLoad; +impl CreatePayload for ToPangoroOutboundPayLoad { + type Payload = ToPangolinMessagePayload; + + fn create( + origin: CallOrigin, + spec_version: u32, + weight: u64, + call_params: CallParams, + dispatch_fee_payment: DispatchFeePayment, + ) -> Result { + let call = Self::encode_call(PANGOLIN_S2S_BACKING_PALLET_INDEX, call_params)?; + Ok(ToPangolinMessagePayload { + spec_version, + weight, + origin, + call, + dispatch_fee_payment, + }) + } +} + +fn into_h160(pallet_id: &PalletId) -> H160 { + let account_id: AccountId32 = pallet_id.into_account(); + let bytes: &[u8] = account_id.as_ref(); + H160::from_slice(&bytes[0..20]) +} + +frame_support::parameter_types! { + pub const ParachainIssuingPalletId: PalletId = PalletId(*b"da/paais"); + pub const PangolinChainId: ChainId = PANGOLIN_CHAIN_ID; + pub const BridgePangolinLaneId: LaneId = PANGOLIN_PANGOLIN_PARACHAIN_LANE; + pub BackingChainName: ChainName = (b"Pangoro").to_vec(); + //pub RingAddress: H160 = PalletId(*b"da/bring").into_h160(); + pub RingAddress: H160 = into_h160(&PalletId(*b"da/bring")); +} + +impl Config for Runtime { + type PalletId = ParachainIssuingPalletId; + type Event = Event; + type WeightInfo = (); + type RingCurrency = Ring; + type BridgedAccountIdConverter = AccountIdConverter; + type BridgedChainId = PangolinChainId; + type OutboundPayloadCreator = ToPangoroOutboundPayLoad; + type BackingChainName = BackingChainName; + type MessageLaneId = BridgePangolinLaneId; + type RingAddress = RingAddress; + type MessagesBridge = BridgePangolinMessages; + type MessageNoncer = ToPangoroMessageSender; +} diff --git a/runtime/pangolin-parachain/src/pallets/mod.rs b/runtime/pangolin-parachain/src/pallets/mod.rs index 9bcd4b41..7dad1a07 100644 --- a/runtime/pangolin-parachain/src/pallets/mod.rs +++ b/runtime/pangolin-parachain/src/pallets/mod.rs @@ -66,3 +66,6 @@ pub use bridge_messages::*; pub mod fee_market; pub use fee_market::*; + +pub mod from_substrate_issuing_; +pub use from_substrate_issuing_::*; From 29d1564267ab61c4dad8a46188d6c3bcb7414f0f Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Wed, 13 Apr 2022 10:25:55 +0800 Subject: [PATCH 04/18] add deliver confirm --- runtime/pangolin-parachain/src/pallets/bridge_messages.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/pangolin-parachain/src/pallets/bridge_messages.rs b/runtime/pangolin-parachain/src/pallets/bridge_messages.rs index 27d6b962..2bed8361 100644 --- a/runtime/pangolin-parachain/src/pallets/bridge_messages.rs +++ b/runtime/pangolin-parachain/src/pallets/bridge_messages.rs @@ -49,7 +49,7 @@ impl Config for Runtime { >; type OnMessageAccepted = FeeMarketMessageAcceptedHandler; - type OnDeliveryConfirmed = (FeeMarketMessageConfirmedHandler,); + type OnDeliveryConfirmed = (FromPangolinIssuing, FeeMarketMessageConfirmedHandler); type SourceHeaderChain = bm_pangolin::Pangolin; type MessageDispatch = bm_pangolin::FromPangolinMessageDispatch; From eb9b3757f4409431751a5d9d4ea393f92fa16c4a Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Wed, 13 Apr 2022 17:51:52 +0800 Subject: [PATCH 05/18] add unit test --- Cargo.lock | 34 ++-- runtime/common/Cargo.toml | 4 + runtime/common/src/helixbridge/mock.rs | 213 ++++++++++++++++++++++++ runtime/common/src/helixbridge/mod.rs | 16 +- runtime/common/src/helixbridge/tests.rs | 147 ++++++++++++++++ 5 files changed, 389 insertions(+), 25 deletions(-) create mode 100644 runtime/common/src/helixbridge/mock.rs create mode 100644 runtime/common/src/helixbridge/tests.rs diff --git a/Cargo.lock b/Cargo.lock index a066d093..ae373491 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -688,7 +688,7 @@ dependencies = [ [[package]] name = "bp-darwinia-core" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-messages 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", "bp-runtime 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", @@ -704,7 +704,7 @@ dependencies = [ [[package]] name = "bp-header-chain" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-runtime 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", "finality-grandpa", @@ -737,7 +737,7 @@ dependencies = [ [[package]] name = "bp-message-dispatch" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-runtime 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", "frame-support", @@ -761,7 +761,7 @@ dependencies = [ [[package]] name = "bp-messages" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bitvec 0.20.4", "bp-runtime 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", @@ -794,7 +794,7 @@ dependencies = [ [[package]] name = "bp-pangolin" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-darwinia-core", "bp-messages 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", @@ -809,7 +809,7 @@ dependencies = [ [[package]] name = "bp-pangolin-parachain" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-darwinia-core", "bp-messages 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", @@ -824,7 +824,7 @@ dependencies = [ [[package]] name = "bp-polkadot-core" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-messages 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", "bp-runtime 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", @@ -877,7 +877,7 @@ dependencies = [ [[package]] name = "bp-runtime" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "frame-support", "hash-db", @@ -913,7 +913,7 @@ dependencies = [ [[package]] name = "bp-test-utils" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-header-chain 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", "ed25519-dalek", @@ -958,7 +958,7 @@ dependencies = [ [[package]] name = "bridge-runtime-common" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-message-dispatch 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", "bp-messages 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", @@ -2195,10 +2195,12 @@ dependencies = [ "pallet-bridge-dispatch 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", "pallet-collator-selection", "pallet-fee-market", + "pallet-timestamp", "pallet-transaction-payment", "parity-scale-codec", "scale-info", "smallvec", + "sp-io", "sp-runtime", "sp-std", ] @@ -5334,7 +5336,7 @@ dependencies = [ [[package]] name = "pallet-bridge-dispatch" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-message-dispatch 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", "bp-runtime 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", @@ -5368,7 +5370,7 @@ dependencies = [ [[package]] name = "pallet-bridge-grandpa" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-header-chain 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", "bp-runtime 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", @@ -5412,7 +5414,7 @@ dependencies = [ [[package]] name = "pallet-bridge-messages" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bitvec 0.20.4", "bp-message-dispatch 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", @@ -5544,7 +5546,7 @@ dependencies = [ [[package]] name = "pallet-fee-market" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bitvec 1.0.0", "bp-messages 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", @@ -5564,7 +5566,7 @@ dependencies = [ [[package]] name = "pallet-fee-market-rpc" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5579,7 +5581,7 @@ dependencies = [ [[package]] name = "pallet-fee-market-rpc-runtime-api" version = "0.1.0" -source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#87760516fa833649c99871d8b92849bfc2c7acd2" +source = "git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16#fb7e13dd0a9058eac120a22bca97d4464e86b34d" dependencies = [ "bp-messages 0.1.0 (git+https://github.com/darwinia-network/darwinia-bridges-substrate?branch=polkadot-v0.9.16)", "parity-scale-codec", diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 9fb88026..10ba10e4 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -36,6 +36,10 @@ pallet-transaction-payment = { default-features = false, git = "https://github.c sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +[dev-dependencies] +pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } + [features] default = ["std"] diff --git a/runtime/common/src/helixbridge/mock.rs b/runtime/common/src/helixbridge/mock.rs new file mode 100644 index 00000000..acbb5457 --- /dev/null +++ b/runtime/common/src/helixbridge/mock.rs @@ -0,0 +1,213 @@ +// This file is part of Darwinia. +// +// Copyright (C) 2018-2022 Darwinia Network +// SPDX-License-Identifier: GPL-3.0 +// +// Darwinia 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. +// +// Darwinia is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Darwinia. If not, see . +// +// use frame_support::traits::ConstU32; + +// --- std --- +use std::str::FromStr; +// --- crates.io --- +use codec::Decode; +// --- paritytech --- +use frame_support::{ + traits::{Everything, GenesisBuild}, + PalletId, +}; +use frame_system::mocking::*; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + AccountId32, +}; +// --- darwinia-network --- +use crate::helixbridge::{ + *, {self as s2s_issuing}, +}; +use bp_messages::source_chain::SendMessageArtifacts; +use pallet_balances::AccountData; + +type Block = MockBlock; +type SignedExtra = (frame_system::CheckSpecVersion,); +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Balance = u64; + +pub fn build_account(x: u8) -> (AccountId32, Vec) { + let origin = [x; 32]; + ( + AccountId32::decode(&mut &origin.clone()[..]).unwrap_or_default(), + origin.to_vec(), + ) +} + +frame_support::parameter_types! { + pub const ExistentialDeposit: u64 = 1; +} + +impl pallet_balances::Config for Test { + type Balance = Balance; + type Event = (); + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type WeightInfo = (); +} + +frame_support::parameter_types! { + pub const MinimumPeriod: u64 = 6000 / 2; +} +impl pallet_timestamp::Config for Test { + type Moment = u64; + type OnTimestampSet = (); + type MinimumPeriod = MinimumPeriod; + type WeightInfo = (); +} + +impl frame_system::Config for Test { + type BaseCallFilter = Everything; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type Origin = Origin; + type Call = Call; + type Index = u64; + type BlockNumber = u64; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId32; + type Lookup = IdentityLookup; + type Header = Header; + type Event = (); + type BlockHashCount = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); + type MaxConsumers = ConstU32<16>; +} + +frame_support::parameter_types! { + pub const S2sRelayPalletId: PalletId = PalletId(*b"da/s2sre"); + pub const PangolinChainId: bp_runtime::ChainId = *b"pagl"; + pub PangoroName: Vec = (b"Pangoro").to_vec(); + pub MessageLaneId: [u8; 4] = *b"ltor"; + pub RingAddress: H160 = H160::from_str("1000000000000000000000000000000000000001").unwrap(); +} + +pub struct AccountIdConverter; +impl Convert for AccountIdConverter { + fn convert(hash: H256) -> AccountId32 { + hash.to_fixed_bytes().into() + } +} +pub struct MockS2sMessageSender; +impl LatestMessageNoncer for MockS2sMessageSender { + fn outbound_latest_generated_nonce(_lane_id: [u8; 4]) -> u64 { + 0 + } + fn inbound_latest_received_nonce(_lane_id: [u8; 4]) -> u64 { + 0 + } +} + +pub struct MockMessagesBridge; +impl MessagesBridge, Balance, ()> for MockMessagesBridge { + type Error = DispatchErrorWithPostInfo; + fn send_message( + submitter: RawOrigin>, + _laneid: [u8; 4], + _payload: (), + fee: Balance, + ) -> Result { + // send fee to fund account [2;32] + Balances::transfer(submitter.into(), build_account(2).0, fee)?; + Ok(SendMessageArtifacts { + nonce: 0, + weight: 0, + }) + } +} + +impl CreatePayload for () { + type Payload = (); + + fn create( + _: CallOrigin, + _: u32, + _: u64, + _: CallParams, + _: DispatchFeePayment, + ) -> Result { + Ok(()) + } +} + +impl Config for Test { + type Event = (); + type PalletId = S2sRelayPalletId; + type WeightInfo = (); + + type RingCurrency = Balances; + type BridgedAccountIdConverter = AccountIdConverter; + type BridgedChainId = PangolinChainId; + type OutboundPayloadCreator = (); + type BackingChainName = PangoroName; + type MessageLaneId = MessageLaneId; + type RingAddress = RingAddress; + type MessagesBridge = MockMessagesBridge; + type MessageNoncer = MockS2sMessageSender; +} + +frame_support::construct_runtime! { + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Timestamp: pallet_timestamp::{Pallet, Call, Storage}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 5, + S2sIssuing: s2s_issuing::{Pallet, Call, Storage, Config, Event}, + } +} + +pub fn new_test_ext() -> sp_io::TestExternalities { + let mut storage = frame_system::GenesisConfig::default() + .build_storage::() + .unwrap(); + + s2s_issuing::GenesisConfig:: { + secure_limited_period: 10, + secure_limited_ring_amount: 1_000_000, + } + .assimilate_storage(&mut storage) + .unwrap(); + + // add some balance to backing account 10 ring + let balances = vec![(build_account(1).0, 100)]; + pallet_balances::GenesisConfig:: { balances } + .assimilate_storage(&mut storage) + .unwrap(); + + storage.into() +} diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index 8601fff1..2f0fc424 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -23,6 +23,10 @@ pub use weight::WeightInfo; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; +#[cfg(test)] +mod mock; +#[cfg(test)] +mod tests; // --- crates.io --- use ethereum_types::{H160, H256, U256}; @@ -249,10 +253,12 @@ pub mod pallet { >::InsufficientBalance ); + // this pallet account as the submitter of the remote message + // we need to transfer fee from user to this account to pay the bridge fee T::RingCurrency::transfer( &user, &Self::pallet_account_id(), - value, + value + fee, ExistenceRequirement::KeepAlive, )?; @@ -271,14 +277,6 @@ pub mod pallet { ), DispatchFeePayment::AtSourceChain, )?; - // this pallet account as the submitter of the remote message - // we need to transfer fee from user to this account to pay the bridge fee - T::RingCurrency::transfer( - &user, - &Self::pallet_account_id(), - fee, - ExistenceRequirement::KeepAlive, - )?; T::MessagesBridge::send_message( RawOrigin::Signed(Self::pallet_account_id()), T::MessageLaneId::get(), diff --git a/runtime/common/src/helixbridge/tests.rs b/runtime/common/src/helixbridge/tests.rs new file mode 100644 index 00000000..4af50604 --- /dev/null +++ b/runtime/common/src/helixbridge/tests.rs @@ -0,0 +1,147 @@ +// This file is part of Darwinia. +// +// Copyright (C) 2018-2022 Darwinia Network +// SPDX-License-Identifier: GPL-3.0 +// +// Darwinia 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. +// +// Darwinia is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Darwinia. If not, see . + +// --- crates.io --- +use crate::helixbridge::*; +use std::str::FromStr; + +// --- paritytech --- +use super::mock::*; +use frame_support::{assert_err, assert_ok}; +use frame_system::RawOrigin; + +#[test] +fn issue_from_remote_backing_not_configured() { + new_test_ext().execute_with(|| { + let token_address = H160::zero(); + let (recipient, recipient_vec) = build_account(10); + assert_err!( + S2sIssuing::issue_from_remote( + Origin::signed(build_account(1).0), + token_address, + recipient_vec, + U256::from(1u128), + ), + >::BackingAccountNone + ); + assert_eq!(Balances::free_balance(recipient), 0); + }); +} + +#[test] +fn issue_from_remote_backing_remote_sender_invalid() { + new_test_ext().execute_with(|| { + let token_address = H160::zero(); + let (recipient, recipient_vec) = build_account(10); + let (remote_backing_account, _) = build_account(3); + assert_ok!(S2sIssuing::set_remote_backing_account( + RawOrigin::Root.into(), + remote_backing_account.clone() + )); + assert_err!( + S2sIssuing::issue_from_remote( + Origin::signed(build_account(1).0), + token_address, + recipient_vec, + U256::from(1u128), + ), + BadOrigin + ); + assert_eq!(Balances::free_balance(recipient), 0); + }); +} + +#[test] +fn issue_from_remote_backing_token_address_invalid() { + new_test_ext().execute_with(|| { + let token_address = H160::zero(); + let (recipient, recipient_vec) = build_account(10); + let (remote_backing_account, _) = build_account(3); + let drived_remote_backing_account = + S2sIssuing::derived_backing_id(remote_backing_account.clone()); + assert_ok!(S2sIssuing::set_remote_backing_account( + RawOrigin::Root.into(), + remote_backing_account.clone() + )); + assert_err!( + S2sIssuing::issue_from_remote( + Origin::signed(drived_remote_backing_account.clone()), + token_address, + recipient_vec, + U256::from(1u128), + ), + >::UnsupportedToken + ); + assert_eq!(Balances::free_balance(recipient), 0); + }); +} + +#[test] +fn issue_from_remote_backing_success() { + new_test_ext().execute_with(|| { + let token_address = H160::from_str("1000000000000000000000000000000000000001").unwrap(); + let (recipient, recipient_vec) = build_account(10); + let (remote_backing_account, _) = build_account(3); + let drived_remote_backing_account = + S2sIssuing::derived_backing_id(remote_backing_account.clone()); + assert_ok!(S2sIssuing::set_remote_backing_account( + RawOrigin::Root.into(), + remote_backing_account.clone() + )); + assert_ok!(S2sIssuing::issue_from_remote( + Origin::signed(drived_remote_backing_account.clone()), + token_address, + recipient_vec, + U256::from(1024u128), + )); + assert_eq!(Balances::free_balance(recipient), 1024); + }); +} + +#[test] +fn burn_and_remote_unlock_insufficient_balance() { + new_test_ext().execute_with(|| { + assert_err!( + S2sIssuing::burn_and_remote_unlock( + Origin::signed(build_account(1).0), + 1, + 1, + 100, + 1, + build_account(1).0, + ), + >::InsufficientBalance + ); + }) +} + +#[test] +fn burn_and_remote_unlock_success() { + new_test_ext().execute_with(|| { + assert_ok!(S2sIssuing::burn_and_remote_unlock( + Origin::signed(build_account(1).0), + 1, + 1, + 10, + 1, + build_account(1).0, + )); + assert_eq!(Balances::free_balance(build_account(1).0), 89); + assert_eq!(Balances::free_balance(S2sIssuing::pallet_account_id()), 10); + }) +} From 0af6f52b7959208bb9682a829e1d69dd0b3865f3 Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Wed, 13 Apr 2022 19:43:04 +0800 Subject: [PATCH 06/18] format --- runtime/common/src/helixbridge/mock.rs | 15 ++++++--------- runtime/common/src/helixbridge/tests.rs | 6 +++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/runtime/common/src/helixbridge/mock.rs b/runtime/common/src/helixbridge/mock.rs index acbb5457..80de342a 100644 --- a/runtime/common/src/helixbridge/mock.rs +++ b/runtime/common/src/helixbridge/mock.rs @@ -16,18 +16,17 @@ // You should have received a copy of the GNU General Public License // along with Darwinia. If not, see . // -// use frame_support::traits::ConstU32; // --- std --- use std::str::FromStr; -// --- crates.io --- -use codec::Decode; // --- paritytech --- +use bp_messages::source_chain::SendMessageArtifacts; use frame_support::{ traits::{Everything, GenesisBuild}, PalletId, }; use frame_system::mocking::*; +use pallet_balances::AccountData; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, @@ -37,8 +36,6 @@ use sp_runtime::{ use crate::helixbridge::{ *, {self as s2s_issuing}, }; -use bp_messages::source_chain::SendMessageArtifacts; -use pallet_balances::AccountData; type Block = MockBlock; type SignedExtra = (frame_system::CheckSpecVersion,); @@ -109,8 +106,8 @@ impl frame_system::Config for Test { frame_support::parameter_types! { pub const S2sRelayPalletId: PalletId = PalletId(*b"da/s2sre"); pub const PangolinChainId: bp_runtime::ChainId = *b"pagl"; - pub PangoroName: Vec = (b"Pangoro").to_vec(); - pub MessageLaneId: [u8; 4] = *b"ltor"; + pub PangolinName: Vec = (b"Pangolin").to_vec(); + pub MessageLaneId: [u8; 4] = *b"ptol"; pub RingAddress: H160 = H160::from_str("1000000000000000000000000000000000000001").unwrap(); } @@ -171,7 +168,7 @@ impl Config for Test { type BridgedAccountIdConverter = AccountIdConverter; type BridgedChainId = PangolinChainId; type OutboundPayloadCreator = (); - type BackingChainName = PangoroName; + type BackingChainName = PangolinName; type MessageLaneId = MessageLaneId; type RingAddress = RingAddress; type MessagesBridge = MockMessagesBridge; @@ -186,7 +183,7 @@ frame_support::construct_runtime! { { System: frame_system::{Pallet, Call, Config, Storage, Event}, Timestamp: pallet_timestamp::{Pallet, Call, Storage}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 5, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, S2sIssuing: s2s_issuing::{Pallet, Call, Storage, Config, Event}, } } diff --git a/runtime/common/src/helixbridge/tests.rs b/runtime/common/src/helixbridge/tests.rs index 4af50604..685d0529 100644 --- a/runtime/common/src/helixbridge/tests.rs +++ b/runtime/common/src/helixbridge/tests.rs @@ -16,12 +16,12 @@ // You should have received a copy of the GNU General Public License // along with Darwinia. If not, see . -// --- crates.io --- -use crate::helixbridge::*; +use crate::helixbridge::{mock::*, *}; + +// --- std --- use std::str::FromStr; // --- paritytech --- -use super::mock::*; use frame_support::{assert_err, assert_ok}; use frame_system::RawOrigin; From 4e06981ffcebe541874c001926850ef5f562cc03 Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Wed, 27 Apr 2022 14:10:33 +0800 Subject: [PATCH 07/18] params --- runtime/common/src/helixbridge/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index 2f0fc424..ebe36a34 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -197,8 +197,8 @@ pub mod pallet { pub fn issue_from_remote( origin: OriginFor, token_address: H160, - recipient: Vec, value: U256, + recipient: Vec, ) -> DispatchResultWithPostInfo { let user = ensure_signed(origin)?; From 54fe206a522dec2d2b3131af037c139a5f0e2e73 Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Wed, 27 Apr 2022 14:24:55 +0800 Subject: [PATCH 08/18] rmv inbound --- runtime/common/src/helixbridge/mock.rs | 3 --- runtime/common/src/helixbridge/mod.rs | 1 - runtime/common/src/helixbridge/tests.rs | 8 ++++---- .../src/pallets/from_substrate_issuing_.rs | 7 ------- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/runtime/common/src/helixbridge/mock.rs b/runtime/common/src/helixbridge/mock.rs index 80de342a..4eaad240 100644 --- a/runtime/common/src/helixbridge/mock.rs +++ b/runtime/common/src/helixbridge/mock.rs @@ -122,9 +122,6 @@ impl LatestMessageNoncer for MockS2sMessageSender { fn outbound_latest_generated_nonce(_lane_id: [u8; 4]) -> u64 { 0 } - fn inbound_latest_received_nonce(_lane_id: [u8; 4]) -> u64 { - 0 - } } pub struct MockMessagesBridge; diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index ebe36a34..d2b2b184 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -84,7 +84,6 @@ pub trait CreatePayload u64; - fn inbound_latest_received_nonce(lane_id: LaneId) -> u64; } #[frame_support::pallet] diff --git a/runtime/common/src/helixbridge/tests.rs b/runtime/common/src/helixbridge/tests.rs index 685d0529..62c18cbd 100644 --- a/runtime/common/src/helixbridge/tests.rs +++ b/runtime/common/src/helixbridge/tests.rs @@ -34,8 +34,8 @@ fn issue_from_remote_backing_not_configured() { S2sIssuing::issue_from_remote( Origin::signed(build_account(1).0), token_address, - recipient_vec, U256::from(1u128), + recipient_vec, ), >::BackingAccountNone ); @@ -57,8 +57,8 @@ fn issue_from_remote_backing_remote_sender_invalid() { S2sIssuing::issue_from_remote( Origin::signed(build_account(1).0), token_address, - recipient_vec, U256::from(1u128), + recipient_vec, ), BadOrigin ); @@ -82,8 +82,8 @@ fn issue_from_remote_backing_token_address_invalid() { S2sIssuing::issue_from_remote( Origin::signed(drived_remote_backing_account.clone()), token_address, - recipient_vec, U256::from(1u128), + recipient_vec, ), >::UnsupportedToken ); @@ -106,8 +106,8 @@ fn issue_from_remote_backing_success() { assert_ok!(S2sIssuing::issue_from_remote( Origin::signed(drived_remote_backing_account.clone()), token_address, - recipient_vec, U256::from(1024u128), + recipient_vec, )); assert_eq!(Balances::free_balance(recipient), 1024); }); diff --git a/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs b/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs index 736c2470..6b312381 100644 --- a/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs +++ b/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs @@ -30,13 +30,6 @@ impl LatestMessageNoncer for ToPangoroMessageSender { .latest_generated_nonce .into() } - - fn inbound_latest_received_nonce(lane_id: LaneId) -> u64 { - inbound_lane::(lane_id) - .data() - .last_delivered_nonce() - .into() - } } #[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] From c84f9153fc3aa7ab3575d4d037dac6d8a37bc9e4 Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Fri, 20 May 2022 09:45:13 +0800 Subject: [PATCH 09/18] decimals convert --- runtime/common/src/helixbridge/mock.rs | 78 +++++++++---------- runtime/common/src/helixbridge/mod.rs | 64 +++++++++++---- runtime/common/src/helixbridge/tests.rs | 2 +- .../src/pallets/bridge_messages.rs | 4 +- .../src/pallets/from_substrate_issuing_.rs | 37 ++++----- 5 files changed, 102 insertions(+), 83 deletions(-) diff --git a/runtime/common/src/helixbridge/mock.rs b/runtime/common/src/helixbridge/mock.rs index 4eaad240..e11d1e73 100644 --- a/runtime/common/src/helixbridge/mock.rs +++ b/runtime/common/src/helixbridge/mock.rs @@ -44,10 +44,7 @@ type Balance = u64; pub fn build_account(x: u8) -> (AccountId32, Vec) { let origin = [x; 32]; - ( - AccountId32::decode(&mut &origin.clone()[..]).unwrap_or_default(), - origin.to_vec(), - ) + (AccountId32::decode(&mut &origin.clone()[..]).unwrap_or_default(), origin.to_vec()) } frame_support::parameter_types! { @@ -55,11 +52,11 @@ frame_support::parameter_types! { } impl pallet_balances::Config for Test { + type AccountStore = System; type Balance = Balance; - type Event = (); type DustRemoval = (); + type Event = (); type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; type MaxLocks = (); type MaxReserves = (); type ReserveIdentifier = [u8; 8]; @@ -70,37 +67,37 @@ frame_support::parameter_types! { pub const MinimumPeriod: u64 = 6000 / 2; } impl pallet_timestamp::Config for Test { + type MinimumPeriod = MinimumPeriod; type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; type WeightInfo = (); } impl frame_system::Config for Test { + type AccountData = AccountData; + type AccountId = AccountId32; type BaseCallFilter = Everything; - type BlockWeights = (); + type BlockHashCount = (); type BlockLength = (); - type DbWeight = (); - type Origin = Origin; - type Call = Call; - type Index = u64; type BlockNumber = u64; + type BlockWeights = (); + type Call = Call; + type DbWeight = (); + type Event = (); type Hash = H256; type Hashing = BlakeTwo256; - type AccountId = AccountId32; - type Lookup = IdentityLookup; type Header = Header; - type Event = (); - type BlockHashCount = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = AccountData; - type OnNewAccount = (); + type Index = u64; + type Lookup = IdentityLookup; + type MaxConsumers = ConstU32<16>; type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); + type OnNewAccount = (); type OnSetCode = (); - type MaxConsumers = ConstU32<16>; + type Origin = Origin; + type PalletInfo = PalletInfo; + type SS58Prefix = (); + type SystemWeightInfo = (); + type Version = (); } frame_support::parameter_types! { @@ -109,6 +106,7 @@ frame_support::parameter_types! { pub PangolinName: Vec = (b"Pangolin").to_vec(); pub MessageLaneId: [u8; 4] = *b"ptol"; pub RingAddress: H160 = H160::from_str("1000000000000000000000000000000000000001").unwrap(); + pub RelativeDecimals: u128 = 1_000_000_000u128; } pub struct AccountIdConverter; @@ -127,6 +125,7 @@ impl LatestMessageNoncer for MockS2sMessageSender { pub struct MockMessagesBridge; impl MessagesBridge, Balance, ()> for MockMessagesBridge { type Error = DispatchErrorWithPostInfo; + fn send_message( submitter: RawOrigin>, _laneid: [u8; 4], @@ -135,10 +134,7 @@ impl MessagesBridge, Balance, ()> for MockMessagesBridge { ) -> Result { // send fee to fund account [2;32] Balances::transfer(submitter.into(), build_account(2).0, fee)?; - Ok(SendMessageArtifacts { - nonce: 0, - weight: 0, - }) + Ok(SendMessageArtifacts { nonce: 0, weight: 0 }) } } @@ -157,19 +153,19 @@ impl CreatePayload f } impl Config for Test { - type Event = (); - type PalletId = S2sRelayPalletId; - type WeightInfo = (); - - type RingCurrency = Balances; + type BackingChainName = PangolinName; type BridgedAccountIdConverter = AccountIdConverter; type BridgedChainId = PangolinChainId; - type OutboundPayloadCreator = (); - type BackingChainName = PangolinName; + type Event = (); type MessageLaneId = MessageLaneId; - type RingAddress = RingAddress; - type MessagesBridge = MockMessagesBridge; type MessageNoncer = MockS2sMessageSender; + type MessagesBridge = MockMessagesBridge; + type OutboundPayloadCreator = (); + type PalletId = S2sRelayPalletId; + type RelativeDecimals = RelativeDecimals; + type RingAddress = RingAddress; + type RingCurrency = Balances; + type WeightInfo = (); } frame_support::construct_runtime! { @@ -179,16 +175,14 @@ frame_support::construct_runtime! { UncheckedExtrinsic = UncheckedExtrinsic, { System: frame_system::{Pallet, Call, Config, Storage, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage}, + Timestamp: pallet_timestamp::{Pallet, Call, Inherent, Storage}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, S2sIssuing: s2s_issuing::{Pallet, Call, Storage, Config, Event}, } } pub fn new_test_ext() -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap(); + let mut storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); s2s_issuing::GenesisConfig:: { secure_limited_period: 10, @@ -199,9 +193,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { // add some balance to backing account 10 ring let balances = vec![(build_account(1).0, 100)]; - pallet_balances::GenesisConfig:: { balances } - .assimilate_storage(&mut storage) - .unwrap(); + pallet_balances::GenesisConfig:: { balances }.assimilate_storage(&mut storage).unwrap(); storage.into() } diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index d2b2b184..9b5e92f8 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -128,6 +128,14 @@ pub mod pallet { #[pallet::constant] type RingAddress: Get; + /// The local token decimals. + #[pallet::constant] + type LocalDecimals: Get; + + /// The remote token decimals. + #[pallet::constant] + type RemoteDecimals: Get; + type MessagesBridge: MessagesBridge< Self::AccountId, RingBalance, @@ -208,10 +216,9 @@ pub mod pallet { return Err(Error::::BackingAccountNone.into()); } - ensure!( - token_address == T::RingAddress::get(), - >::UnsupportedToken - ); + ensure!(token_address == T::RingAddress::get(), >::UnsupportedToken); + let value = Self::convert_to_local_decimals(&value).ok_or(>::ValueOverFlow)?; + let value = value.low_u128().saturated_into(); // Make sure the total transfer is less than the security limitation { @@ -263,6 +270,8 @@ pub mod pallet { // Send to the target chain let amount: U256 = value.saturated_into::().into(); + let remote_amount = + Self::convert_to_remote_decimals(&amount).ok_or(>::ValueOverFlow)?; let token_address = T::RingAddress::get(); let payload = T::OutboundPayloadCreator::create( @@ -271,7 +280,7 @@ pub mod pallet { weight, CallParams::S2sBackingPalletUnlockFromRemote( T::RingAddress::get(), - amount, + remote_amount, recipient.encode(), ), DispatchFeePayment::AtSourceChain, @@ -286,10 +295,7 @@ pub mod pallet { let message_nonce = T::MessageNoncer::outbound_latest_generated_nonce(T::MessageLaneId::get()); let message_id: BridgeMessageId = (T::MessageLaneId::get(), message_nonce); - ensure!( - !>::contains_key(message_id), - Error::::NonceDuplicated - ); + ensure!(!>::contains_key(message_id), Error::::NonceDuplicated); >::insert(message_id, (user.clone(), value)); Self::deposit_event(Event::TokenBurnAndRemoteUnlocked( T::MessageLaneId::get(), @@ -347,7 +353,8 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// TokenBurnAndRemoteUnlocked \[lane_id, message_nonce, token address, sender, recipient, amount\] + /// TokenBurnAndRemoteUnlocked \[lane_id, message_nonce, token address, sender, recipient, + /// amount\] TokenBurnAndRemoteUnlocked( LaneId, MessageNonce, @@ -379,6 +386,8 @@ pub mod pallet { InvalidRecipient, /// Backing not configured BackingAccountNone, + /// Issue value overflow + ValueOverFlow, } #[pallet::genesis_config] @@ -390,10 +399,7 @@ pub mod pallet { #[cfg(feature = "std")] impl Default for GenesisConfig { fn default() -> Self { - Self { - secure_limited_period: Zero::zero(), - secure_limited_ring_amount: Zero::zero(), - } + Self { secure_limited_period: Zero::zero(), secure_limited_ring_amount: Zero::zero() } } } @@ -420,6 +426,32 @@ pub mod pallet { ); T::BridgedAccountIdConverter::convert(hex_id) } + + pub fn convert_to_local_decimals(amount: &U256) -> Option { + let local = T::LocalDecimals::get(); + let remote = T::RemoteDecimals::get(); + if remote == 0 || local == 0 { + return None; + } + if local > remote { + amount.checked_mul(U256::from(local / remote)) + } else { + amount.checked_div(U256::from(remote / local)) + } + } + + pub fn convert_to_remote_decimals(amount: &U256) -> Option { + let local = T::LocalDecimals::get(); + let remote = T::RemoteDecimals::get(); + if remote == 0 || local == 0 { + return None; + } + if local > remote { + amount.checked_div(U256::from(local / remote)) + } else { + amount.checked_mul(U256::from(remote / local)) + } + } } impl OnDeliveryConfirmed for Pallet { @@ -431,8 +463,8 @@ pub mod pallet { let result = messages.message_dispatch_result(nonce); if let Some((user, value)) = >::take((*lane, nonce)) { if !result { - // if remote backing unlock failed, this fund need to transfer back to the user. - // otherwise burn it. + // if remote backing unlock failed, this fund need to transfer back to the + // user. otherwise burn it. let _ = T::RingCurrency::transfer( &Self::pallet_account_id(), &user, diff --git a/runtime/common/src/helixbridge/tests.rs b/runtime/common/src/helixbridge/tests.rs index 62c18cbd..3faa79d4 100644 --- a/runtime/common/src/helixbridge/tests.rs +++ b/runtime/common/src/helixbridge/tests.rs @@ -109,7 +109,7 @@ fn issue_from_remote_backing_success() { U256::from(1024u128), recipient_vec, )); - assert_eq!(Balances::free_balance(recipient), 1024); + assert_eq!(Balances::free_balance(recipient), 1024_000_000_000); }); } diff --git a/runtime/pangolin-parachain/src/pallets/bridge_messages.rs b/runtime/pangolin-parachain/src/pallets/bridge_messages.rs index 7ce20a82..8c1ecf07 100644 --- a/runtime/pangolin-parachain/src/pallets/bridge_messages.rs +++ b/runtime/pangolin-parachain/src/pallets/bridge_messages.rs @@ -39,9 +39,9 @@ impl Config for Runtime { GetDeliveryConfirmationTransactionFee, RootAccountForPayments, >; - type OnMessageAccepted = FeeMarketMessageAcceptedHandler; - type OnDeliveryConfirmed = (FromPangolinIssuing, FeeMarketMessageConfirmedHandler); type MessageDispatch = bm_pangolin::FromPangolinMessageDispatch; + type OnDeliveryConfirmed = (FromPangolinIssuing, FeeMarketMessageConfirmedHandler); + type OnMessageAccepted = FeeMarketMessageAcceptedHandler; type OutboundMessageFee = Balance; type OutboundPayload = bm_pangolin::ToPangolinMessagePayload; type Parameter = bm_pangolin::PangolinParachainToPangolinParameter; diff --git a/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs b/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs index dc8ca33c..35de0b75 100644 --- a/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs +++ b/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs @@ -25,10 +25,7 @@ use pallet_bridge_messages::outbound_lane; pub struct ToPangoroMessageSender; impl LatestMessageNoncer for ToPangoroMessageSender { fn outbound_latest_generated_nonce(lane_id: LaneId) -> u64 { - outbound_lane::(lane_id) - .data() - .latest_generated_nonce - .into() + outbound_lane::(lane_id).data().latest_generated_nonce.into() } } @@ -45,13 +42,7 @@ impl CreatePayload for ToPangoroOutboundPay dispatch_fee_payment: DispatchFeePayment, ) -> Result { let call = Self::encode_call(PANGOLIN_S2S_BACKING_PALLET_INDEX, call_params)?; - Ok(ToPangolinMessagePayload { - spec_version, - weight, - origin, - call, - dispatch_fee_payment, - }) + Ok(ToPangolinMessagePayload { spec_version, weight, origin, call, dispatch_fee_payment }) } } @@ -65,22 +56,26 @@ frame_support::parameter_types! { pub const ParachainIssuingPalletId: PalletId = PalletId(*b"da/paais"); pub const PangolinChainId: ChainId = PANGOLIN_CHAIN_ID; pub const BridgePangolinLaneId: LaneId = PANGOLIN_PANGOLIN_PARACHAIN_LANE; - pub BackingChainName: ChainName = (b"Pangoro").to_vec(); + pub BackingChainName: ChainName = (b"Pangolin").to_vec(); //pub RingAddress: H160 = PalletId(*b"da/bring").into_h160(); - pub RingAddress: H160 = into_h160(&PalletId(*b"da/bring")); + pub RingAddress: H160 = into_h160(&PalletId(*b"da/pring")); + pub LocalDecimals: u128 = 1_000_000_000_000_000_000u128; + pub RemoteDecimals: u128 = 1_000_000_000u128; } impl Config for Runtime { - type PalletId = ParachainIssuingPalletId; - type Event = Event; - type WeightInfo = (); - type RingCurrency = Ring; + type BackingChainName = BackingChainName; type BridgedAccountIdConverter = AccountIdConverter; type BridgedChainId = PangolinChainId; - type OutboundPayloadCreator = ToPangoroOutboundPayLoad; - type BackingChainName = BackingChainName; + type Event = Event; + type LocalDecimals = LocalDecimals; type MessageLaneId = BridgePangolinLaneId; - type RingAddress = RingAddress; - type MessagesBridge = BridgePangolinMessages; type MessageNoncer = ToPangoroMessageSender; + type MessagesBridge = BridgePangolinMessages; + type OutboundPayloadCreator = ToPangoroOutboundPayLoad; + type PalletId = ParachainIssuingPalletId; + type RemoteDecimals = RemoteDecimals; + type RingAddress = RingAddress; + type RingCurrency = Ring; + type WeightInfo = (); } From dc979bb77f0aea4ff47ffb16e4f3ec57d357c761 Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Mon, 23 May 2022 15:15:03 +0800 Subject: [PATCH 10/18] pallet idx --- runtime/pangolin-parachain/src/bridges_message/pangolin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/pangolin-parachain/src/bridges_message/pangolin.rs b/runtime/pangolin-parachain/src/bridges_message/pangolin.rs index 662a5f06..83616fa2 100644 --- a/runtime/pangolin-parachain/src/bridges_message/pangolin.rs +++ b/runtime/pangolin-parachain/src/bridges_message/pangolin.rs @@ -230,4 +230,4 @@ impl SourceHeaderChain<::Balance> for Pangolin { } /// The s2s backing pallet index in the pangoro chain runtime. -pub const PANGOLIN_S2S_BACKING_PALLET_INDEX: u8 = 20; +pub const PANGOLIN_S2S_BACKING_PALLET_INDEX: u8 = 65; From 7cb22357a945531694da10e459c6b3d0f2880fe4 Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Mon, 30 May 2022 15:28:55 +0800 Subject: [PATCH 11/18] init --- runtime/common/src/helixbridge/mod.rs | 95 ++++++------------- .../src/pallets/from_substrate_issuing_.rs | 11 +-- 2 files changed, 32 insertions(+), 74 deletions(-) diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index 9b5e92f8..dd611169 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -29,7 +29,7 @@ mod mock; mod tests; // --- crates.io --- -use ethereum_types::{H160, H256, U256}; +use ethereum_types::H256; // --- paritytech --- use bp_message_dispatch::CallOrigin; use bp_messages::{ @@ -47,8 +47,8 @@ use frame_support::{ }; use frame_system::{ensure_signed, RawOrigin}; use sp_runtime::{ - traits::{AccountIdConversion, BadOrigin, Convert, Saturating, Zero}, - DispatchErrorWithPostInfo, MultiSignature, MultiSigner, SaturatedConversion, + traits::{AccountIdConversion, BadOrigin, CheckedDiv, CheckedMul, Convert, Saturating, Zero}, + DispatchErrorWithPostInfo, MultiSignature, MultiSigner, }; use sp_std::{str, vec, vec::Vec}; @@ -59,15 +59,21 @@ pub type RingBalance = <::RingCurrency as Currency> /// The parameters box for the pallet runtime call. #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)] -pub enum CallParams { +pub enum CallParams { #[codec(index = 2)] - S2sBackingPalletUnlockFromRemote(H160, U256, Vec), + S2sBackingPalletUnlockFromRemote(RingBalance, AccountId), } /// Creating a concrete message payload which would be relay to target chain. -pub trait CreatePayload { +pub trait CreatePayload< + SourceChainAccountId, + TargetChainAccountPublic, + TargetChainSignature, + T: Config, +> +{ type Payload: Encode; - fn encode_call(pallet_index: u8, call_params: CallParams) -> Result, &'static str> { + fn encode_call(pallet_index: u8, call_params: CallParams) -> Result, &'static str> { let mut encoded = vec![pallet_index]; encoded.append(&mut call_params.encode()); Ok(encoded) @@ -77,7 +83,7 @@ pub trait CreatePayload, spec_version: u32, weight: u64, - call_params: CallParams, + call_params: CallParams, dispatch_fee_payment: DispatchFeePayment, ) -> Result; } @@ -116,7 +122,7 @@ pub mod pallet { /// Outbound payload creator used for s2s message type OutboundPayloadCreator: Parameter - + CreatePayload; + + CreatePayload; /// The remote chain name where the backing module in type BackingChainName: Get; @@ -124,17 +130,9 @@ pub mod pallet { /// The lane id of the s2s bridge type MessageLaneId: Get; - /// The local ring address - #[pallet::constant] - type RingAddress: Get; - /// The local token decimals. #[pallet::constant] - type LocalDecimals: Get; - - /// The remote token decimals. - #[pallet::constant] - type RemoteDecimals: Get; + type DecimalsDifference: Get>; type MessagesBridge: MessagesBridge< Self::AccountId, @@ -143,6 +141,7 @@ pub mod pallet { Self::AccountId, MultiSigner, MultiSignature, + Self, >>::Payload, Error = DispatchErrorWithPostInfo, >; @@ -203,9 +202,8 @@ pub mod pallet { #[transactional] pub fn issue_from_remote( origin: OriginFor, - token_address: H160, - value: U256, - recipient: Vec, + value: RingBalance, + recipient: AccountId, ) -> DispatchResultWithPostInfo { let user = ensure_signed(origin)?; @@ -216,10 +214,10 @@ pub mod pallet { return Err(Error::::BackingAccountNone.into()); } - ensure!(token_address == T::RingAddress::get(), >::UnsupportedToken); - let value = Self::convert_to_local_decimals(&value).ok_or(>::ValueOverFlow)?; + let value = value + .checked_mul(&T::DecimalsDifference::get()) + .ok_or(>::ValueOverFlow)?; - let value = value.low_u128().saturated_into(); // Make sure the total transfer is less than the security limitation { let (used, limitation) = >::get(); @@ -229,13 +227,9 @@ pub mod pallet { >::RingDailyLimited ); } - // Make sure the recipient is valid(AccountId32). - ensure!(recipient.len() == 32, Error::::InvalidRecipient); - let recipient_id = T::AccountId::decode(&mut &recipient[..]) - .map_err(|_| Error::::InvalidRecipient)?; - T::RingCurrency::deposit_creating(&recipient_id, value); - Self::deposit_event(Event::TokenIssued(recipient_id, value)); + T::RingCurrency::deposit_creating(&recipient, value); + Self::deposit_event(Event::TokenIssued(recipient, value)); Ok(().into()) } @@ -269,20 +263,15 @@ pub mod pallet { )?; // Send to the target chain - let amount: U256 = value.saturated_into::().into(); - let remote_amount = - Self::convert_to_remote_decimals(&amount).ok_or(>::ValueOverFlow)?; - let token_address = T::RingAddress::get(); + let remote_amount = value + .checked_div(&T::DecimalsDifference::get()) + .ok_or(>::ValueOverFlow)?; let payload = T::OutboundPayloadCreator::create( CallOrigin::SourceAccount(Self::pallet_account_id()), spec_version, weight, - CallParams::S2sBackingPalletUnlockFromRemote( - T::RingAddress::get(), - remote_amount, - recipient.encode(), - ), + CallParams::S2sBackingPalletUnlockFromRemote(remote_amount, recipient.clone()), DispatchFeePayment::AtSourceChain, )?; T::MessagesBridge::send_message( @@ -300,7 +289,6 @@ pub mod pallet { Self::deposit_event(Event::TokenBurnAndRemoteUnlocked( T::MessageLaneId::get(), message_nonce, - token_address, user, recipient, value, @@ -358,7 +346,6 @@ pub mod pallet { TokenBurnAndRemoteUnlocked( LaneId, MessageNonce, - H160, AccountId, AccountId, RingBalance, @@ -426,32 +413,6 @@ pub mod pallet { ); T::BridgedAccountIdConverter::convert(hex_id) } - - pub fn convert_to_local_decimals(amount: &U256) -> Option { - let local = T::LocalDecimals::get(); - let remote = T::RemoteDecimals::get(); - if remote == 0 || local == 0 { - return None; - } - if local > remote { - amount.checked_mul(U256::from(local / remote)) - } else { - amount.checked_div(U256::from(remote / local)) - } - } - - pub fn convert_to_remote_decimals(amount: &U256) -> Option { - let local = T::LocalDecimals::get(); - let remote = T::RemoteDecimals::get(); - if remote == 0 || local == 0 { - return None; - } - if local > remote { - amount.checked_div(U256::from(local / remote)) - } else { - amount.checked_mul(U256::from(remote / local)) - } - } } impl OnDeliveryConfirmed for Pallet { diff --git a/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs b/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs index 35de0b75..c3a5c095 100644 --- a/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs +++ b/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs @@ -31,14 +31,14 @@ impl LatestMessageNoncer for ToPangoroMessageSender { #[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct ToPangoroOutboundPayLoad; -impl CreatePayload for ToPangoroOutboundPayLoad { +impl CreatePayload for ToPangoroOutboundPayLoad { type Payload = ToPangolinMessagePayload; fn create( origin: CallOrigin, spec_version: u32, weight: u64, - call_params: CallParams, + call_params: CallParams, dispatch_fee_payment: DispatchFeePayment, ) -> Result { let call = Self::encode_call(PANGOLIN_S2S_BACKING_PALLET_INDEX, call_params)?; @@ -59,23 +59,20 @@ frame_support::parameter_types! { pub BackingChainName: ChainName = (b"Pangolin").to_vec(); //pub RingAddress: H160 = PalletId(*b"da/bring").into_h160(); pub RingAddress: H160 = into_h160(&PalletId(*b"da/pring")); - pub LocalDecimals: u128 = 1_000_000_000_000_000_000u128; - pub RemoteDecimals: u128 = 1_000_000_000u128; + pub DecimalsDifference: Balance = 1_000_000_000u128; } impl Config for Runtime { type BackingChainName = BackingChainName; type BridgedAccountIdConverter = AccountIdConverter; type BridgedChainId = PangolinChainId; + type DecimalsDifference = DecimalsDifference; type Event = Event; - type LocalDecimals = LocalDecimals; type MessageLaneId = BridgePangolinLaneId; type MessageNoncer = ToPangoroMessageSender; type MessagesBridge = BridgePangolinMessages; type OutboundPayloadCreator = ToPangoroOutboundPayLoad; type PalletId = ParachainIssuingPalletId; - type RemoteDecimals = RemoteDecimals; - type RingAddress = RingAddress; type RingCurrency = Ring; type WeightInfo = (); } From bcf9651ed9483e44117246218ae4dd9c81edb7d9 Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Tue, 31 May 2022 11:39:26 +0800 Subject: [PATCH 12/18] index --- runtime/common/src/helixbridge/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index dd611169..2e1802cd 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -60,7 +60,7 @@ pub type RingBalance = <::RingCurrency as Currency> /// The parameters box for the pallet runtime call. #[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)] pub enum CallParams { - #[codec(index = 2)] + #[codec(index = 1)] S2sBackingPalletUnlockFromRemote(RingBalance, AccountId), } /// Creating a concrete message payload which would be relay to target chain. From c0b5b91ed43a3acee8b4c4e28c0827e73468146b Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Tue, 31 May 2022 17:23:09 +0800 Subject: [PATCH 13/18] repair test --- Cargo.toml | 1 - runtime/common/src/helixbridge/mock.rs | 28 ++++++------- runtime/common/src/helixbridge/mod.rs | 20 ++++------ runtime/common/src/helixbridge/tests.rs | 52 +++++-------------------- 4 files changed, 29 insertions(+), 72 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 743bc4c4..85e06816 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,6 @@ darwinia-parachain-runtime = { path = "runtime/darwinia-parachain" } dc-primitives = { path = "primitives" } dc-rpc = { path = "rpc" } pangolin-parachain-runtime = { path = "runtime/pangolin-parachain" } -#darwinia-parachain-runtime-common = { path = "runtime/common" } # substrate frame-benchmarking = { optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } diff --git a/runtime/common/src/helixbridge/mock.rs b/runtime/common/src/helixbridge/mock.rs index e11d1e73..6bce6a79 100644 --- a/runtime/common/src/helixbridge/mock.rs +++ b/runtime/common/src/helixbridge/mock.rs @@ -17,8 +17,6 @@ // along with Darwinia. If not, see . // -// --- std --- -use std::str::FromStr; // --- paritytech --- use bp_messages::source_chain::SendMessageArtifacts; use frame_support::{ @@ -38,13 +36,13 @@ use crate::helixbridge::{ }; type Block = MockBlock; -type SignedExtra = (frame_system::CheckSpecVersion,); -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +//type SignedExtra = (frame_system::CheckSpecVersion,); +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Balance = u64; pub fn build_account(x: u8) -> (AccountId32, Vec) { let origin = [x; 32]; - (AccountId32::decode(&mut &origin.clone()[..]).unwrap_or_default(), origin.to_vec()) + (AccountId32::decode(&mut &origin.clone()[..]).unwrap(), origin.to_vec()) } frame_support::parameter_types! { @@ -105,8 +103,7 @@ frame_support::parameter_types! { pub const PangolinChainId: bp_runtime::ChainId = *b"pagl"; pub PangolinName: Vec = (b"Pangolin").to_vec(); pub MessageLaneId: [u8; 4] = *b"ptol"; - pub RingAddress: H160 = H160::from_str("1000000000000000000000000000000000000001").unwrap(); - pub RelativeDecimals: u128 = 1_000_000_000u128; + pub DecimalsDifference: Balance = 1_000_000_000; } pub struct AccountIdConverter; @@ -138,14 +135,14 @@ impl MessagesBridge, Balance, ()> for MockMessagesBridge { } } -impl CreatePayload for () { +impl CreatePayload for () { type Payload = (); fn create( _: CallOrigin, _: u32, _: u64, - _: CallParams, + _: CallParams, _: DispatchFeePayment, ) -> Result { Ok(()) @@ -156,14 +153,13 @@ impl Config for Test { type BackingChainName = PangolinName; type BridgedAccountIdConverter = AccountIdConverter; type BridgedChainId = PangolinChainId; + type DecimalsDifference = DecimalsDifference; type Event = (); type MessageLaneId = MessageLaneId; type MessageNoncer = MockS2sMessageSender; type MessagesBridge = MockMessagesBridge; type OutboundPayloadCreator = (); type PalletId = S2sRelayPalletId; - type RelativeDecimals = RelativeDecimals; - type RingAddress = RingAddress; type RingCurrency = Balances; type WeightInfo = (); } @@ -174,10 +170,10 @@ frame_support::construct_runtime! { NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Inherent, Storage}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - S2sIssuing: s2s_issuing::{Pallet, Call, Storage, Config, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + Timestamp: pallet_timestamp::{Pallet, Call, Inherent, Storage} = 1, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 2, + S2sIssuing: s2s_issuing::{Pallet, Call, Storage, Config, Event} = 3, } } @@ -186,7 +182,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { s2s_issuing::GenesisConfig:: { secure_limited_period: 10, - secure_limited_ring_amount: 1_000_000, + secure_limited_ring_amount: 1_000_000_000_000_000, } .assimilate_storage(&mut storage) .unwrap(); diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index c8fa558d..b96f999b 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -196,8 +196,8 @@ pub mod pallet { impl Pallet { /// Handle relay message sent from the source backing pallet with relay message #[pallet::weight( - ::WeightInfo::issue_from_remote() - )] + ::WeightInfo::issue_from_remote() + )] #[transactional] pub fn issue_from_remote( origin: OriginFor, @@ -233,8 +233,8 @@ pub mod pallet { } #[pallet::weight( - ::WeightInfo::burn_and_remote_unlock() - )] + ::WeightInfo::burn_and_remote_unlock() + )] #[transactional] pub fn burn_and_remote_unlock( origin: OriginFor, @@ -296,8 +296,8 @@ pub mod pallet { } #[pallet::weight( - ::WeightInfo::set_remote_backing_account() - )] + ::WeightInfo::set_remote_backing_account() + )] pub fn set_remote_backing_account( origin: OriginFor, account: AccountId, @@ -323,8 +323,8 @@ pub mod pallet { } #[pallet::weight( - ::WeightInfo::set_security_limitation_ring_amount() - )] + ::WeightInfo::set_security_limitation_ring_amount() + )] pub fn set_security_limitation_ring_amount( origin: OriginFor, limitation: RingBalance, @@ -366,10 +366,6 @@ pub mod pallet { InsufficientBalance, /// Message nonce duplicated. NonceDuplicated, - /// Unsupported token - UnsupportedToken, - /// Invalid recipient - InvalidRecipient, /// Backing not configured BackingAccountNone, /// Issue value overflow diff --git a/runtime/common/src/helixbridge/tests.rs b/runtime/common/src/helixbridge/tests.rs index 3faa79d4..cc09fe60 100644 --- a/runtime/common/src/helixbridge/tests.rs +++ b/runtime/common/src/helixbridge/tests.rs @@ -18,9 +18,6 @@ use crate::helixbridge::{mock::*, *}; -// --- std --- -use std::str::FromStr; - // --- paritytech --- use frame_support::{assert_err, assert_ok}; use frame_system::RawOrigin; @@ -28,14 +25,12 @@ use frame_system::RawOrigin; #[test] fn issue_from_remote_backing_not_configured() { new_test_ext().execute_with(|| { - let token_address = H160::zero(); - let (recipient, recipient_vec) = build_account(10); + let (recipient, _recipient_vec) = build_account(10); assert_err!( S2sIssuing::issue_from_remote( Origin::signed(build_account(1).0), - token_address, - U256::from(1u128), - recipient_vec, + 1u64, + recipient.clone(), ), >::BackingAccountNone ); @@ -46,8 +41,7 @@ fn issue_from_remote_backing_not_configured() { #[test] fn issue_from_remote_backing_remote_sender_invalid() { new_test_ext().execute_with(|| { - let token_address = H160::zero(); - let (recipient, recipient_vec) = build_account(10); + let (recipient, _recipient_vec) = build_account(10); let (remote_backing_account, _) = build_account(3); assert_ok!(S2sIssuing::set_remote_backing_account( RawOrigin::Root.into(), @@ -56,9 +50,8 @@ fn issue_from_remote_backing_remote_sender_invalid() { assert_err!( S2sIssuing::issue_from_remote( Origin::signed(build_account(1).0), - token_address, - U256::from(1u128), - recipient_vec, + 1u64, + recipient.clone(), ), BadOrigin ); @@ -66,36 +59,10 @@ fn issue_from_remote_backing_remote_sender_invalid() { }); } -#[test] -fn issue_from_remote_backing_token_address_invalid() { - new_test_ext().execute_with(|| { - let token_address = H160::zero(); - let (recipient, recipient_vec) = build_account(10); - let (remote_backing_account, _) = build_account(3); - let drived_remote_backing_account = - S2sIssuing::derived_backing_id(remote_backing_account.clone()); - assert_ok!(S2sIssuing::set_remote_backing_account( - RawOrigin::Root.into(), - remote_backing_account.clone() - )); - assert_err!( - S2sIssuing::issue_from_remote( - Origin::signed(drived_remote_backing_account.clone()), - token_address, - U256::from(1u128), - recipient_vec, - ), - >::UnsupportedToken - ); - assert_eq!(Balances::free_balance(recipient), 0); - }); -} - #[test] fn issue_from_remote_backing_success() { new_test_ext().execute_with(|| { - let token_address = H160::from_str("1000000000000000000000000000000000000001").unwrap(); - let (recipient, recipient_vec) = build_account(10); + let (recipient, _recipient_vec) = build_account(10); let (remote_backing_account, _) = build_account(3); let drived_remote_backing_account = S2sIssuing::derived_backing_id(remote_backing_account.clone()); @@ -105,9 +72,8 @@ fn issue_from_remote_backing_success() { )); assert_ok!(S2sIssuing::issue_from_remote( Origin::signed(drived_remote_backing_account.clone()), - token_address, - U256::from(1024u128), - recipient_vec, + 1024u64, + recipient.clone(), )); assert_eq!(Balances::free_balance(recipient), 1024_000_000_000); }); From a3a418556297fdebec7ce7b084537988d5933710 Mon Sep 17 00:00:00 2001 From: HackFisher Date: Wed, 1 Jun 2022 14:59:04 +0800 Subject: [PATCH 14/18] use nightly-2022-01-22 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index be373b01..7b9386fb 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2021-11-07" +channel = "nightly-2022-01-22" components = ["cargo", "clippy", "rustc", "rustfmt", "rust-src"] profile = "minimal" targets = ["wasm32-unknown-unknown"] From 06a5ec0c74e2a5ff94fe41a03a7f77bfa32ae98e Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Wed, 1 Jun 2022 15:53:28 +0800 Subject: [PATCH 15/18] update decimals type --- runtime/common/src/helixbridge/mod.rs | 8 ++++---- .../src/pallets/from_substrate_issuing_.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index b96f999b..8242b6e2 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -47,7 +47,7 @@ use frame_system::{ensure_signed, RawOrigin}; use sp_core::H256; use sp_runtime::{ traits::{AccountIdConversion, BadOrigin, CheckedDiv, CheckedMul, Convert, Saturating, Zero}, - DispatchErrorWithPostInfo, MultiSignature, MultiSigner, + DispatchErrorWithPostInfo, MultiSignature, MultiSigner, SaturatedConversion, }; use sp_std::{str, vec, vec::Vec}; @@ -131,7 +131,7 @@ pub mod pallet { /// The local token decimals. #[pallet::constant] - type DecimalsDifference: Get>; + type DecimalMultiplier: Get; type MessagesBridge: MessagesBridge< Self::AccountId, @@ -214,7 +214,7 @@ pub mod pallet { } let value = value - .checked_mul(&T::DecimalsDifference::get()) + .checked_mul(&T::DecimalMultiplier::get().saturated_into()) .ok_or(>::ValueOverFlow)?; // Make sure the total transfer is less than the security limitation @@ -263,7 +263,7 @@ pub mod pallet { // Send to the target chain let remote_amount = value - .checked_div(&T::DecimalsDifference::get()) + .checked_div(&T::DecimalMultiplier::get().saturated_into()) .ok_or(>::ValueOverFlow)?; let payload = T::OutboundPayloadCreator::create( diff --git a/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs b/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs index c0b52bc7..66c21feb 100644 --- a/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs +++ b/runtime/pangolin-parachain/src/pallets/from_substrate_issuing_.rs @@ -45,18 +45,18 @@ impl CreatePayload for ToPangoroOu } frame_support::parameter_types! { + pub const BridgePangolinLaneId: LaneId = PANGOLIN_PANGOLIN_PARACHAIN_LANE; + pub const DecimalMultiplier: u128 = 1_000_000_000u128; pub const ParachainIssuingPalletId: PalletId = PalletId(*b"da/paais"); pub const PangolinChainId: ChainId = PANGOLIN_CHAIN_ID; - pub const BridgePangolinLaneId: LaneId = PANGOLIN_PANGOLIN_PARACHAIN_LANE; pub BackingChainName: ChainName = (b"Pangolin").to_vec(); - pub DecimalsDifference: Balance = 1_000_000_000u128; } impl Config for Runtime { type BackingChainName = BackingChainName; type BridgedAccountIdConverter = AccountIdConverter; type BridgedChainId = PangolinChainId; - type DecimalsDifference = DecimalsDifference; + type DecimalMultiplier = DecimalMultiplier; type Event = Event; type MessageLaneId = BridgePangolinLaneId; type MessageNoncer = ToPangoroMessageSender; From d33b218965ab33ea775493b22cc32664b72695fd Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Thu, 2 Jun 2022 16:59:58 +0800 Subject: [PATCH 16/18] docs --- runtime/common/src/helixbridge/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime/common/src/helixbridge/mod.rs b/runtime/common/src/helixbridge/mod.rs index 8242b6e2..b435b996 100644 --- a/runtime/common/src/helixbridge/mod.rs +++ b/runtime/common/src/helixbridge/mod.rs @@ -340,8 +340,7 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// TokenBurnAndRemoteUnlocked \[lane_id, message_nonce, token address, sender, recipient, - /// amount\] + /// TokenBurnAndRemoteUnlocked \[lane_id, message_nonce, sender, recipient, amount\] TokenBurnAndRemoteUnlocked( LaneId, MessageNonce, @@ -349,7 +348,7 @@ pub mod pallet { AccountId, RingBalance, ), - /// [backing_address, mapping_token, recipient, amount] + /// [recipient, amount] TokenIssued(AccountId, RingBalance), /// Update remote backing address \[account\] RemoteBackingAccountUpdated(AccountId), From 228d2ed8f5577893c3629063e66efd14e093d009 Mon Sep 17 00:00:00 2001 From: HackFisher Date: Mon, 6 Jun 2022 14:15:16 +0800 Subject: [PATCH 17/18] fix ci --- runtime/common/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 91b895b3..20e084f3 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -68,7 +68,7 @@ std = [ "pallet-transaction-payment/std", "sp-runtime/std", "sp-std/std", - + "sp-core/std", ] runtime-benchmarks = ["frame-benchmarking"] From 3d2f776c8be0cbdbce527f4e7e0c5f5d7ffb3366 Mon Sep 17 00:00:00 2001 From: xiaocheng Date: Mon, 6 Jun 2022 14:58:11 +0800 Subject: [PATCH 18/18] fmt --- runtime/common/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 20e084f3..a7ca1e32 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -66,9 +66,9 @@ std = [ "frame-system/std", "pallet-balances/std", "pallet-transaction-payment/std", + "sp-core/std", "sp-runtime/std", "sp-std/std", - "sp-core/std", ] runtime-benchmarks = ["frame-benchmarking"]