From 55f151b43064c135e77f97fdc0525d409434b8c5 Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Wed, 12 Aug 2020 08:09:20 +0800 Subject: [PATCH] Release 0.6.6 (#490) * remove: unused doc * add: dev feature * fix: total supply * reorder: runtime * add: header-mmr rpc * bump: serde version * bump: common && substrate * update: runtime * remove: unused import * refactor: service * update: cli * one binary for all linux * ignore: .cargo-ok * update: docker * release: 0.6.6 * update: doc --- .dockerignore | 1 + .gitignore | 1 + .maintain/docker/Dockerfile.centos-7 | 12 - .maintain/docker/Dockerfile.x86_64-linux-gnu | 11 +- Cargo.lock | 1275 ++++++++++-------- Cargo.toml | 6 +- Cross.toml | 1 - cli/Cargo.toml | 25 +- cli/src/browser.rs | 15 +- cli/src/cli.rs | 4 + cli/src/command.rs | 111 +- primitives/Cargo.toml | 10 +- rpc/Cargo.toml | 35 +- rpc/src/lib.rs | 53 +- runtime/common/Cargo.toml | 14 +- runtime/crab/Cargo.toml | 91 +- runtime/crab/src/constants.rs | 23 +- runtime/crab/src/lib.rs | 426 +++--- service/Cargo.toml | 65 +- service/src/chain_spec.rs | 17 +- service/src/lib.rs | 521 ++++--- 21 files changed, 1510 insertions(+), 1207 deletions(-) create mode 100644 .dockerignore delete mode 100644 .maintain/docker/Dockerfile.centos-7 diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..eb5a316cb --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +target diff --git a/.gitignore b/.gitignore index a96f7e8e4..b35886097 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ expand.rs # Rust Things **/*.rs.bk **/target/ +.cargo-ok Cargo.toml.bak diff --git a/.maintain/docker/Dockerfile.centos-7 b/.maintain/docker/Dockerfile.centos-7 deleted file mode 100644 index 3405b8d69..000000000 --- a/.maintain/docker/Dockerfile.centos-7 +++ /dev/null @@ -1,12 +0,0 @@ -FROM centos:7 - -# only for centos-7 - -# change mirrorlist -RUN curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo && yum makecache \ - # update - yum -y update && yum -y upgrade && yum -y install \ - # tool - git make \ - # compiler - clang gcc gcc-c++ llvm diff --git a/.maintain/docker/Dockerfile.x86_64-linux-gnu b/.maintain/docker/Dockerfile.x86_64-linux-gnu index 38f87a8b2..55293508e 100644 --- a/.maintain/docker/Dockerfile.x86_64-linux-gnu +++ b/.maintain/docker/Dockerfile.x86_64-linux-gnu @@ -1,13 +1,12 @@ -FROM ubuntu:16.04 +FROM centos:7 -# only for x86_64 +# for gernal linux # change mirrorlist -RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list && \ +RUN curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo && yum makecache \ # update - apt update && apt upgrade -y && apt install -y \ + yum -y update && yum -y upgrade && yum -y install \ # tool git make \ # compiler - gcc g++ \ - clang llvm libclang-dev + clang gcc gcc-c++ llvm diff --git a/Cargo.lock b/Cargo.lock index d2565e967..fcc5dcc88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,7 +37,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" dependencies = [ - "generic-array 0.14.3", + "generic-array 0.14.4", ] [[package]] @@ -161,10 +161,10 @@ checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" [[package]] name = "array-bytes" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] @@ -226,47 +226,52 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" +[[package]] +name = "async-channel" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43de69555a39d52918e2bc33a408d3c0a86c829b212d898f4ca25d21a6387478" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + [[package]] name = "async-std" -version = "1.5.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "538ecb01eb64eecd772087e5b6f7540cbc917f047727339a472dafed2185b267" +checksum = "00d68a33ebc8b57800847d00787307f84a562224a14db069b0acefe4c2abbf5d" dependencies = [ "async-task", - "broadcaster", - "crossbeam-channel", - "crossbeam-deque", "crossbeam-utils", + "futures-channel", "futures-core", "futures-io", - "futures-timer 2.0.2", + "futures-timer 3.0.2", "kv-log-macro", "log", "memchr", - "mio", - "mio-uds", "num_cpus", "once_cell", "pin-project-lite", "pin-utils", "slab", + "smol", + "wasm-bindgen-futures", ] [[package]] name = "async-task" -version = "1.3.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ac2c016b079e771204030951c366db398864f5026f84a44dafb0ff20f02085d" -dependencies = [ - "libc", - "winapi 0.3.9", -] +checksum = "c17772156ef2829aadc587461c7753af20b7e8db1529bc66855add962a3b35d3" [[package]] name = "async-tls" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fd83426b89b034bf4e9ceb9c533c2f2386b813fd3dcae0a425ec6f1837d78a" +checksum = "df097e3f506bec0e1a24f06bb3c962c228f36671de841ff579cb99f371772634" dependencies = [ "futures 0.3.5", "rustls", @@ -274,6 +279,12 @@ dependencies = [ "webpki-roots 0.19.0", ] +[[package]] +name = "atomic-waker" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" + [[package]] name = "atty" version = "0.2.14" @@ -385,18 +396,6 @@ dependencies = [ "radium", ] -[[package]] -name = "blake2" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" -dependencies = [ - "byte-tools", - "crypto-mac 0.7.0", - "digest 0.8.1", - "opaque-debug 0.2.3", -] - [[package]] name = "blake2" version = "0.9.0" @@ -460,7 +459,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.3", + "generic-array 0.14.4", ] [[package]] @@ -469,7 +468,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10" dependencies = [ - "generic-array 0.14.3", + "generic-array 0.14.4", ] [[package]] @@ -482,17 +481,17 @@ dependencies = [ ] [[package]] -name = "broadcaster" -version = "1.0.0" +name = "blocking" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c972e21e0d055a36cf73e4daae870941fe7a8abcd5ac3396aab9e4c126bd87" +checksum = "d2468ff7bf85066b4a3678fede6fe66db31846d753ff0adfbfab2c6a6e81612b" dependencies = [ - "futures-channel", - "futures-core", - "futures-sink", - "futures-util", - "parking_lot 0.10.2", - "slab", + "async-channel", + "atomic-waker", + "futures-lite", + "once_cell", + "parking", + "waker-fn", ] [[package]] @@ -557,6 +556,12 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" +[[package]] +name = "cache-padded" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" + [[package]] name = "cc" version = "1.0.58" @@ -669,6 +674,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", +] + [[package]] name = "console_error_panic_hook" version = "0.1.6" @@ -739,7 +753,7 @@ checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" [[package]] name = "crab-runtime" -version = "0.6.5" +version = "0.6.6" dependencies = [ "darwinia-balances", "darwinia-balances-rpc-runtime-api", @@ -748,6 +762,7 @@ dependencies = [ "darwinia-ethereum-backing", "darwinia-ethereum-relay", "darwinia-header-mmr", + "darwinia-header-mmr-rpc-runtime-api", "darwinia-primitives", "darwinia-relayer-game", "darwinia-runtime-common", @@ -796,7 +811,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-transaction-pool", "sp-version", "static_assertions", @@ -904,16 +919,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ee0cc8804d5393478d743b035099520087a5186f3b93fa58cec08fa62407b6" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" version = "0.7.3" @@ -984,15 +989,15 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.3", + "generic-array 0.14.4", "subtle 2.2.3", ] [[package]] name = "ct-logs" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3686f5fa27dbc1d76c751300376e167c5a43387f44bb451fd1c24776e49113" +checksum = "8c8e13110a84b6315df212c045be706af261fd364791cad863285439ebba672e" dependencies = [ "sct", ] @@ -1012,10 +1017,10 @@ dependencies = [ [[package]] name = "darwinia" -version = "0.6.5" +version = "0.6.6" dependencies = [ "assert_cmd", - "darwinia-cli 0.6.5", + "darwinia-cli 0.6.6", "darwinia-service", "futures 0.3.5", "nix 0.18.0", @@ -1025,8 +1030,8 @@ dependencies = [ [[package]] name = "darwinia-balances" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "darwinia-balances-rpc-runtime-api", "darwinia-support", @@ -1035,13 +1040,13 @@ dependencies = [ "parity-scale-codec", "serde", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "darwinia-balances-rpc" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "darwinia-balances-rpc-runtime-api", "jsonrpc-core", @@ -1055,8 +1060,8 @@ dependencies = [ [[package]] name = "darwinia-balances-rpc-runtime-api" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "darwinia-support", "parity-scale-codec", @@ -1067,8 +1072,8 @@ dependencies = [ [[package]] name = "darwinia-claims" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "array-bytes", "darwinia-support", @@ -1079,27 +1084,14 @@ dependencies = [ "serde_json", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", -] - -[[package]] -name = "darwinia-cli" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" -dependencies = [ - "sc-cli", - "sc-client-api", - "sc-service", - "sc-tracing", - "serde", - "toml", + "sp-std 2.0.0-rc5", ] [[package]] name = "darwinia-cli" -version = "0.6.5" +version = "0.6.6" dependencies = [ - "darwinia-cli 0.6.4", + "darwinia-cli 1.0.0-alpha.1", "darwinia-service", "log", "sc-cli", @@ -1119,10 +1111,23 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "darwinia-cli" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" +dependencies = [ + "sc-cli", + "sc-client-api", + "sc-service", + "sc-tracing", + "serde", + "toml", +] + [[package]] name = "darwinia-elections-phragmen" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "darwinia-support", "frame-support", @@ -1131,13 +1136,13 @@ dependencies = [ "serde", "sp-npos-elections", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "darwinia-ethereum-backing" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "array-bytes", "darwinia-support", @@ -1149,13 +1154,13 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "darwinia-ethereum-relay" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "array-bytes", "blake2-rfc", @@ -1172,13 +1177,13 @@ dependencies = [ "serde_json", "sp-core", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "darwinia-header-mmr" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "ckb-merkle-mountain-range", "darwinia-header-mmr-rpc-runtime-api", @@ -1188,25 +1193,40 @@ dependencies = [ "parity-scale-codec", "serde", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", +] + +[[package]] +name = "darwinia-header-mmr-rpc" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" +dependencies = [ + "darwinia-header-mmr-rpc-runtime-api", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "parity-scale-codec", + "sp-api", + "sp-blockchain", + "sp-runtime", ] [[package]] name = "darwinia-header-mmr-rpc-runtime-api" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "darwinia-support", "parity-scale-codec", "serde", "sp-api", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "darwinia-primitives" -version = "0.6.5" +version = "0.6.6" dependencies = [ "frame-system", "parity-scale-codec", @@ -1217,8 +1237,8 @@ dependencies = [ [[package]] name = "darwinia-relayer-game" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "darwinia-support", "frame-support", @@ -1226,14 +1246,15 @@ dependencies = [ "parity-scale-codec", "serde", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "darwinia-rpc" -version = "0.6.5" +version = "0.6.6" dependencies = [ "darwinia-balances-rpc", + "darwinia-header-mmr-rpc", "darwinia-primitives", "darwinia-staking-rpc", "jsonrpc-core", @@ -1258,7 +1279,7 @@ dependencies = [ [[package]] name = "darwinia-runtime-common" -version = "0.6.5" +version = "0.6.6" dependencies = [ "darwinia-balances", "darwinia-primitives", @@ -1270,17 +1291,18 @@ dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "static_assertions", ] [[package]] name = "darwinia-service" -version = "0.6.5" +version = "0.6.6" dependencies = [ "array-bytes", "crab-runtime", "darwinia-balances-rpc-runtime-api", + "darwinia-header-mmr-rpc-runtime-api", "darwinia-primitives", "darwinia-rpc", "darwinia-staking-rpc-runtime-api", @@ -1317,13 +1339,14 @@ dependencies = [ "sp-runtime", "sp-session", "sp-transaction-pool", + "sp-trie", "substrate-prometheus-endpoint", ] [[package]] name = "darwinia-staking" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "darwinia-staking-rpc-runtime-api", "darwinia-support", @@ -1339,14 +1362,14 @@ dependencies = [ "sp-npos-elections", "sp-runtime", "sp-staking", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "static_assertions", ] [[package]] name = "darwinia-staking-rpc" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "darwinia-staking-rpc-runtime-api", "jsonrpc-core", @@ -1360,8 +1383,8 @@ dependencies = [ [[package]] name = "darwinia-staking-rpc-runtime-api" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "darwinia-support", "parity-scale-codec", @@ -1372,8 +1395,8 @@ dependencies = [ [[package]] name = "darwinia-support" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "ethereum-primitives", "frame-support", @@ -1381,13 +1404,13 @@ dependencies = [ "num-traits 0.2.12", "parity-scale-codec", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "darwinia-treasury" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "darwinia-support", "frame-support", @@ -1395,14 +1418,14 @@ dependencies = [ "parity-scale-codec", "serde", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "data-encoding" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72aa14c04dfae8dd7d8a2b1cb7ca2152618cd01336dbfe704b8dcbf8d41dbd69" +checksum = "d4d0e2d24e5ee3b23a01de38eefdcd978907890701f08ffffd4cb457ca4ee8d6" [[package]] name = "derive_more" @@ -1436,7 +1459,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.3", + "generic-array 0.14.4", ] [[package]] @@ -1476,23 +1499,34 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "ed25519" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf038a7b6fd7ef78ad3348b63f3a17550877b0e28f8d68bcc94894d1412158bc" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-dalek" -version = "1.0.0-pre.3" +version = "1.0.0-pre.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978710b352437433c97b2bff193f2fb1dfd58a093f863dd95e225a19baa599a2" +checksum = "21a8a37f4e8b35af971e6db5e3897e7a6344caa3f92f6544f88125a1f5f0035a" dependencies = [ - "clear_on_drop", "curve25519-dalek", + "ed25519", "rand 0.7.3", + "serde", "sha2 0.8.2", + "zeroize", ] [[package]] name = "either" -version = "1.5.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +checksum = "cd56b59865bce947ac5958779cfa508f6c3b9497cc762b7e24a12d11ccde2c4f" [[package]] name = "enum-primitive-derive" @@ -1615,8 +1649,8 @@ dependencies = [ [[package]] name = "ethereum-primitives" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ "array-bytes", "ethash", @@ -1634,7 +1668,7 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] @@ -1651,6 +1685,12 @@ dependencies = [ "uint 0.8.2", ] +[[package]] +name = "event-listener" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f14646a9e0430150a87951622ba9675472b68e384b7701b8423b30560805c7a" + [[package]] name = "exit-future" version = "0.2.0" @@ -1709,6 +1749,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fastrand" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bd3bdaaf0a72155260a1c098989b60db1cbb22d6a628e64f16237aa4da93cc7" + [[package]] name = "fdlimit" version = "0.1.4" @@ -1793,16 +1839,16 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", ] [[package]] name = "frame-benchmarking" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -1813,13 +1859,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-runtime-interface", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "frame-executive" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -1827,25 +1873,25 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-tracing", ] [[package]] name = "frame-metadata" -version = "11.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "11.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "serde", "sp-core", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "frame-support" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "bitmask", "frame-metadata", @@ -1863,14 +1909,14 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-tracing", ] [[package]] name = "frame-support-procedural" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support-procedural-tools", "proc-macro2", @@ -1880,8 +1926,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -1892,8 +1938,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "proc-macro2", "quote 1.0.7", @@ -1902,8 +1948,8 @@ dependencies = [ [[package]] name = "frame-system" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -1912,14 +1958,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-version", ] [[package]] name = "frame-system-rpc-runtime-api" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "sp-api", @@ -2061,6 +2107,21 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" +[[package]] +name = "futures-lite" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe71459749b2e8e66fb95df721b22fa08661ad384a0c5b519e11d3893b4692a" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-macro" version = "0.3.5" @@ -2137,18 +2198,6 @@ dependencies = [ "slab", ] -[[package]] -name = "futures_codec" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a73299e4718f5452e45980fc1d6957a070abe308d3700b63b8673f47e1c2b3" -dependencies = [ - "bytes 0.5.6", - "futures 0.3.5", - "memchr", - "pin-project", -] - [[package]] name = "futures_codec" version = "0.4.1" @@ -2178,9 +2227,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60fb4bb6bba52f78a471264d9a3b7d026cc0af47b22cd2cffbc0b787ca003e63" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" dependencies = [ "typenum", "version_check", @@ -2356,9 +2405,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34f595585f103464d8d2f6e9864682d74c1601fed5e07d62b1c9058dba8246fb" +checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" dependencies = [ "ahash 0.3.8", "autocfg 1.0.0", @@ -2543,9 +2592,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac965ea399ec3a25ac7d13b8affd4b8f39325cca00858ddf5eb29b79e6b14b08" +checksum = "37743cc83e8ee85eacfce90f2f4102030d9ff0a95244098d781e9bee4a90abb6" dependencies = [ "bytes 0.5.6", "ct-logs", @@ -2645,12 +2694,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b88cd59ee5f71fea89a62248fc8f387d44400cefe05ef548466d61ced9029a7" +checksum = "86b45e59b16c76b11bf9738fd5d38879d3bd28ad292d7b313608becb17ae2df9" dependencies = [ "autocfg 1.0.0", - "hashbrown 0.8.1", + "hashbrown 0.8.2", ] [[package]] @@ -2911,9 +2960,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e763b2a9b500ba47948061d1e8bc3b5f03a8a1f067dbcf822a4d2c84d2b54a3a" +checksum = "0315ef2f688e33844400b31f11c263f2b3dc21d8b9355c6891c5f185fae43f9a" dependencies = [ "parity-util-mem", "smallvec 1.4.1", @@ -2921,9 +2970,9 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73027d5e228de6f503b5b7335d530404fc26230a6ae3e09b33ec6e45408509a4" +checksum = "73de822b260a3bdfb889dbbb65bb2d473eee2253973d6fa4a5d149a2a4a7c66e" dependencies = [ "kvdb", "parity-util-mem", @@ -2932,9 +2981,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84384eca250c7ff67877eda5336f28a86586aaee24acb945643590671f6bfce1" +checksum = "7c341ef15cfb1f923fa3b5138bfbd2d4813a2c1640b473727a53351c7f0b0fa2" dependencies = [ "fs-swap", "kvdb", @@ -2950,9 +2999,9 @@ dependencies = [ [[package]] name = "kvdb-web" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c7f36acb1841d4c701d30ae1f2cfd242e805991443f75f6935479ed3de64903" +checksum = "2701a1369d6ea4f1b9f606db46e5e2a4a8e47f22530a07823d653f85ab1f6c34" dependencies = [ "futures 0.3.5", "js-sys", @@ -3025,9 +3074,9 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.19.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057eba5432d3e740e313c6e13c9153d0cb76b4f71bfc2e5242ae5bdb7d41af67" +checksum = "0306a49ee6a89468f96089906f36b0eef82c988dcfc8acf3e2dcd6ad1c859f85" dependencies = [ "bytes 0.5.6", "futures 0.3.5", @@ -3047,7 +3096,7 @@ dependencies = [ "libp2p-websocket", "libp2p-yamux", "multihash", - "parity-multiaddr 0.9.1", + "parity-multiaddr", "parking_lot 0.10.2", "pin-project", "smallvec 1.4.1", @@ -3056,9 +3105,9 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.19.2" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a0387b930c3d4c2533dc4893c1e0394185ddcc019846121b1b27491e45a2c08" +checksum = "6a694fd76d7c33a45a0e6e1525e9b9b5d11127c9c94e560ac0f8abba54ed80af" dependencies = [ "asn1_der", "bs58", @@ -3072,7 +3121,7 @@ dependencies = [ "log", "multihash", "multistream-select", - "parity-multiaddr 0.9.1", + "parity-multiaddr", "parking_lot 0.10.2", "pin-project", "prost", @@ -3090,9 +3139,9 @@ dependencies = [ [[package]] name = "libp2p-core-derive" -version = "0.19.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09548626b737ed64080fde595e06ce1117795b8b9fc4d2629fa36561c583171" +checksum = "f753d9324cd3ec14bf04b8a8cd0d269c87f294153d6bf2a84497a63a5ad22213" dependencies = [ "quote 1.0.7", "syn 1.0.38", @@ -3100,9 +3149,9 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc186d9a941fd0207cf8f08ef225a735e2d7296258f570155e525f6ee732f87" +checksum = "f751924b6b98e350005e0b87a822beb246792a3fb878c684e088f866158120ac" dependencies = [ "futures 0.3.5", "libp2p-core", @@ -3111,9 +3160,9 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f76075b170d908bae616f550ade410d9d27c013fa69042551dbfc757c7c094" +checksum = "912c00a7bf67e0e765daf0cc37e08f675ea26aba3d6d1fbfaee81f19a4c23049" dependencies = [ "futures 0.3.5", "libp2p-core", @@ -3127,16 +3176,16 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d6c1d5100973527ae70d82687465b17049c1b717a7964de38b8e65000878ff" +checksum = "44ed3a4c8111c570ab2bffb30c6353178d7603ce3787e3c5f2493c8d3d16d1f0" dependencies = [ "arrayvec 0.5.1", "bytes 0.5.6", "either", "fnv", "futures 0.3.5", - "futures_codec 0.3.4", + "futures_codec", "libp2p-core", "libp2p-swarm", "log", @@ -3147,16 +3196,16 @@ dependencies = [ "sha2 0.8.2", "smallvec 1.4.1", "uint 0.8.4", - "unsigned-varint 0.3.3", + "unsigned-varint 0.4.0", "void", "wasm-timer", ] [[package]] name = "libp2p-mdns" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f55b2d4b80986e5bf158270ab23268ec0e7f644ece5436fbaabc5155472f357" +checksum = "cd004c668160fd922f7268b2cd1e4550ff69165d9c744e9eb5770086eb753d02" dependencies = [ "async-std", "data-encoding", @@ -3176,14 +3225,14 @@ dependencies = [ [[package]] name = "libp2p-mplex" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be7d913a4cd57de2013257ec73f07d77bfce390b370023e2d59083e5ca079864" +checksum = "14ae0ffacd30f073f96cd518b2c9cd2cb18ac27c3d136a4b23cf1af99f33e541" dependencies = [ "bytes 0.5.6", "fnv", "futures 0.3.5", - "futures_codec 0.4.1", + "futures_codec", "libp2p-core", "log", "parking_lot 0.10.2", @@ -3192,10 +3241,11 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.19.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a03db664653369f46ee03fcec483a378c20195089bb43a26cb9fb0058009ac88" +checksum = "8f353f8966bbaaf7456535fffd3f366f153148773a0cf04b2ec3860955cb720e" dependencies = [ + "bytes 0.5.6", "curve25519-dalek", "futures 0.3.5", "lazy_static", @@ -3213,9 +3263,9 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.19.3" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dedd34e35a9728d52d59ef36a218e411359a353f9011b2574b86ee790978f6" +checksum = "70130cf130e4ba6dc177366e72dd9f86f9e3588fa1a0c4145247e676f16affad" dependencies = [ "futures 0.3.5", "libp2p-core", @@ -3228,9 +3278,9 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.19.1" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce53ff4d127cf8b39adf84dbd381ca32d49bd85788cee08e6669da2495993930" +checksum = "f88d5e2a090a2aadf042cd33484e2f015c6dab212567406a59deece5dedbd133" dependencies = [ "futures 0.3.5", "libp2p-core", @@ -3243,9 +3293,9 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481500c5774c62e8c413e9535b3f33a0e3dbacf2da63b8d3056c686a9df4146" +checksum = "9b1fa2bbad054020cb875546a577a66a65a5bf42eff55ed5265f92ffee3cc052" dependencies = [ "async-std", "futures 0.3.5", @@ -3259,9 +3309,9 @@ dependencies = [ [[package]] name = "libp2p-wasm-ext" -version = "0.19.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f59fdbb5706f2723ca108c088b1c7a37f735a8c328021f0508007162627e9885" +checksum = "0feb99e32fea20ffb1bbf56a6fb2614bff7325ff44a515728385170b3420d2c3" dependencies = [ "futures 0.3.5", "js-sys", @@ -3273,12 +3323,11 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.19.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "085fbe4c05c4116c2164ab4d5a521eb6e00516c444f61b3ee9f68c7b1e53580b" +checksum = "046a5201f6e471f22b22b394e4d084269ed1e28cf7300f7b49874385db84c7bd" dependencies = [ "async-tls", - "bytes 0.5.6", "either", "futures 0.3.5", "libp2p-core", @@ -3294,9 +3343,9 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.19.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da33e7b5f49c75c6a8afb0b8d1e229f5fa48be9f39bd14cdbc21459a02ac6fc" +checksum = "46ae9bf2f7d8a4be9c7e9b61df9de9dc1bd66419d669098f22f81f8d9571029a" dependencies = [ "futures 0.3.5", "libp2p-core", @@ -3455,13 +3504,12 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.21.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2999ff7a65d5a1d72172f6d51fa2ea03024b51aee709ba5ff81c3c629a2410" +checksum = "36f36ddb0b2cdc25d38babba472108798e3477f02be5165f038c5e393e50c57a" dependencies = [ - "ahash 0.2.18", "hash-db", - "hashbrown 0.6.3", + "hashbrown 0.8.2", "parity-util-mem", ] @@ -3473,13 +3521,13 @@ checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" [[package]] name = "merkle-patricia-trie" -version = "0.6.4" -source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f69ef3631194ec58208e378838a721699561b05d" +version = "1.0.0-alpha.1" +source = "git+https://github.com/darwinia-network/darwinia-common.git?branch=master#f2d372aaea4c3bff0ea14892e32d4628370ddd44" dependencies = [ - "hashbrown 0.8.1", + "hashbrown 0.8.2", "keccak-hash", "rlp 0.4.4", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] @@ -3852,8 +3900,8 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -3863,13 +3911,13 @@ dependencies = [ "sp-application-crypto", "sp-authority-discovery", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-authorship" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -3878,16 +3926,18 @@ dependencies = [ "sp-authorship", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-babe" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", + "pallet-authorship", "pallet-session", "pallet-timestamp", "parity-scale-codec", @@ -3898,15 +3948,16 @@ dependencies = [ "sp-inherents", "sp-io", "sp-runtime", + "sp-session", "sp-staking", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-timestamp", ] [[package]] name = "pallet-balances" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-benchmarking", "frame-support", @@ -3914,13 +3965,13 @@ dependencies = [ "parity-scale-codec", "serde", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-collective" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -3929,13 +3980,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-finality-tracker" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -3945,16 +3996,18 @@ dependencies = [ "sp-finality-tracker", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-grandpa" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", + "pallet-authorship", "pallet-finality-tracker", "pallet-session", "parity-scale-codec", @@ -3965,13 +4018,13 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-identity" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "enumflags2", "frame-benchmarking", @@ -3981,13 +4034,13 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-im-online" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4000,13 +4053,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-indices" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4016,13 +4069,13 @@ dependencies = [ "sp-io", "sp-keyring", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-membership" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4030,13 +4083,13 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-multisig" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4045,13 +4098,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-offences" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4060,13 +4113,13 @@ dependencies = [ "serde", "sp-runtime", "sp-staking", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-proxy" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4075,26 +4128,26 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-randomness-collective-flip" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "safe-mix", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-recovery" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "enumflags2", "frame-support", @@ -4103,26 +4156,26 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-scheduler" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-session" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4135,14 +4188,14 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-trie", ] [[package]] name = "pallet-society" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4150,13 +4203,13 @@ dependencies = [ "rand_chacha 0.2.2", "serde", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-sudo" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4164,13 +4217,13 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-timestamp" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4180,14 +4233,14 @@ dependencies = [ "serde", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4195,14 +4248,16 @@ dependencies = [ "parity-scale-codec", "serde", "smallvec 1.4.1", + "sp-core", + "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-transaction-payment-rpc" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4219,21 +4274,21 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "parity-scale-codec", "serde", "sp-api", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "pallet-utility" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-support", "frame-system", @@ -4242,7 +4297,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] @@ -4259,24 +4314,6 @@ dependencies = [ "parking_lot 0.10.2", ] -[[package]] -name = "parity-multiaddr" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77055f9e81921a8cc7bebeb6cded3d128931d51f1e3dd6251f0770a6d431477" -dependencies = [ - "arrayref", - "bs58", - "byteorder", - "data-encoding", - "parity-multihash", - "percent-encoding 2.1.0", - "serde", - "static_assertions", - "unsigned-varint 0.3.3", - "url 2.1.1", -] - [[package]] name = "parity-multiaddr" version = "0.9.1" @@ -4295,21 +4332,6 @@ dependencies = [ "url 2.1.1", ] -[[package]] -name = "parity-multihash" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a1cd2ba02391b81367bec529fb209019d718684fdc8ad6a712c2b536e46f775" -dependencies = [ - "blake2 0.8.1", - "bytes 0.5.6", - "rand 0.7.3", - "sha-1", - "sha2 0.8.2", - "sha3", - "unsigned-varint 0.3.3", -] - [[package]] name = "parity-scale-codec" version = "1.3.4" @@ -4362,11 +4384,12 @@ dependencies = [ [[package]] name = "parity-util-mem" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6e2583649a3ca84894d1d71da249abcfda54d5aca24733d72ca10d0f02361c" +checksum = "297ff91fa36aec49ce183484b102f6b75b46776822bd81525bfc4cc9b0dd0f5c" dependencies = [ "cfg-if", + "hashbrown 0.8.2", "impl-trait-for-tuples", "jemallocator", "parity-util-mem-derive", @@ -4393,6 +4416,12 @@ version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" +[[package]] +name = "parking" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb300f271742d4a2a66c01b6b2fa0c83dfebd2e0bf11addb879a3547b4ed87c" + [[package]] name = "parking_lot" version = "0.9.0" @@ -5162,6 +5191,12 @@ dependencies = [ "syn 1.0.38", ] +[[package]] +name = "retain_mut" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e005d658ad26eacc2b6c506dfde519f4e277e328d0eb3379ca61647d70a8f531" + [[package]] name = "ring" version = "0.16.15" @@ -5271,11 +5306,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" +checksum = "cac94b333ee2aac3284c5b8a1b7fb4dd11cba88c244e3fe33cdbd047af0eb693" dependencies = [ - "base64 0.11.0", + "base64 0.12.3", "log", "ring", "sct", @@ -5284,9 +5319,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75ffeb84a6bd9d014713119542ce415db3a3e4748f0bfce1e1416cd224a23a5" +checksum = "629d439a7672da82dd955498445e496ee2096fe2117b9f796558a43fdb9e59b8" dependencies = [ "openssl-probe", "rustls", @@ -5322,8 +5357,8 @@ dependencies = [ [[package]] name = "sc-authority-discovery" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "bytes 0.5.6", "derive_more", @@ -5349,8 +5384,8 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -5373,8 +5408,8 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -5383,14 +5418,15 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-core", + "sp-inherents", "sp-runtime", "sp-state-machine", ] [[package]] name = "sc-chain-spec" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "impl-trait-for-tuples", "sc-chain-spec-derive", @@ -5405,8 +5441,8 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5416,8 +5452,8 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "ansi_term 0.12.1", "atty", @@ -5439,6 +5475,7 @@ dependencies = [ "sc-service", "sc-telemetry", "sc-tracing", + "serde", "serde_json", "sp-blockchain", "sp-core", @@ -5456,8 +5493,8 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "fnv", @@ -5481,7 +5518,7 @@ dependencies = [ "sp-keyring", "sp-runtime", "sp-state-machine", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-storage", "sp-transaction-pool", "sp-trie", @@ -5492,8 +5529,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "blake2-rfc", "hash-db", @@ -5521,8 +5558,8 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "sc-client-api", "sp-blockchain", @@ -5532,8 +5569,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "fork-tree", @@ -5574,8 +5611,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "futures 0.3.5", @@ -5598,8 +5635,8 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "fork-tree", "parity-scale-codec", @@ -5611,8 +5648,8 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -5625,6 +5662,7 @@ dependencies = [ "sp-application-crypto", "sp-blockchain", "sp-consensus", + "sp-consensus-slots", "sp-core", "sp-inherents", "sp-runtime", @@ -5633,8 +5671,8 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "log", "sc-client-api", @@ -5647,8 +5685,8 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "lazy_static", @@ -5675,8 +5713,8 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "log", @@ -5692,8 +5730,8 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "log", "parity-scale-codec", @@ -5707,8 +5745,8 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "cranelift-codegen", "cranelift-wasm", @@ -5728,8 +5766,8 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "assert_matches", "derive_more", @@ -5766,8 +5804,8 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "finality-grandpa", @@ -5783,14 +5821,13 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "ansi_term 0.12.1", "futures 0.3.5", "log", "parity-util-mem", - "parking_lot 0.10.2", "sc-client-api", "sc-network", "sp-blockchain", @@ -5802,8 +5839,8 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "hex", @@ -5818,8 +5855,8 @@ dependencies = [ [[package]] name = "sc-light" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "hash-db", "lazy_static", @@ -5837,8 +5874,8 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "bitflags", "bs58", @@ -5850,7 +5887,7 @@ dependencies = [ "fork-tree", "futures 0.3.5", "futures-timer 3.0.2", - "futures_codec 0.3.4", + "futures_codec", "hex", "ip_network", "libp2p", @@ -5881,7 +5918,7 @@ dependencies = [ "sp-utils", "substrate-prometheus-endpoint", "thiserror", - "unsigned-varint 0.3.3", + "unsigned-varint 0.4.0", "void", "wasm-timer", "zeroize", @@ -5889,8 +5926,8 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -5904,8 +5941,8 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "bytes 0.5.6", "fnv", @@ -5931,8 +5968,8 @@ dependencies = [ [[package]] name = "sc-peerset" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "futures 0.3.5", "libp2p", @@ -5944,8 +5981,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -5953,8 +5990,8 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "futures 0.3.5", "hash-db", @@ -5985,8 +6022,8 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "futures 0.3.5", @@ -6009,8 +6046,8 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "jsonrpc-core", "jsonrpc-http-server", @@ -6025,8 +6062,8 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "directories", @@ -6039,7 +6076,6 @@ dependencies = [ "lazy_static", "log", "netstat2", - "parity-multiaddr 0.7.3", "parity-scale-codec", "parity-util-mem", "parking_lot 0.10.2", @@ -6088,8 +6124,8 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "log", "parity-scale-codec", @@ -6102,10 +6138,9 @@ dependencies = [ [[package]] name = "sc-telemetry" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ - "bytes 0.5.6", "futures 0.3.5", "futures-timer 3.0.2", "libp2p", @@ -6124,8 +6159,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "erased-serde", "log", @@ -6141,8 +6176,8 @@ dependencies = [ [[package]] name = "sc-transaction-graph" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "futures 0.3.5", @@ -6150,6 +6185,7 @@ dependencies = [ "log", "parity-util-mem", "parking_lot 0.10.2", + "retain_mut", "serde", "sp-blockchain", "sp-core", @@ -6161,8 +6197,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "futures 0.3.5", @@ -6255,11 +6291,20 @@ dependencies = [ "untrusted", ] +[[package]] +name = "secrecy" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9182278ed645df3477a9c27bfee0621c621aa16f6972635f7f795dae3d81070f" +dependencies = [ + "zeroize", +] + [[package]] name = "security-framework" -version = "0.4.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" +checksum = "ad502866817f0575705bd7be36e2b2535cc33262d493aa733a2ec862baa2bc2b" dependencies = [ "bitflags", "core-foundation", @@ -6270,9 +6315,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "0.4.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" +checksum = "51ceb04988b17b6d1dcd555390fa822ca5637b4a14e1f5099f13d351bed4d6c7" dependencies = [ "core-foundation-sys", "libc", @@ -6313,18 +6358,18 @@ checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" [[package]] name = "serde" -version = "1.0.114" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" +checksum = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.114" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" +checksum = "609feed1d0a73cc36a0182a840a9b37b4a82f0b1150369f0536a9e3f2a31dc48" dependencies = [ "proc-macro2", "quote 1.0.7", @@ -6354,12 +6399,6 @@ dependencies = [ "opaque-debug 0.2.3", ] -[[package]] -name = "sha1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" - [[package]] name = "sha2" version = "0.8.2" @@ -6414,6 +6453,12 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29f060a7d147e33490ec10da418795238fd7545bba241504d6b31a409f2e6210" + [[package]] name = "slab" version = "0.4.2" @@ -6479,6 +6524,27 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f" +[[package]] +name = "smol" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620cbb3c6e34da57d3a248cda0cd01cd5848164dc062e764e65d06fe3ea7aed5" +dependencies = [ + "async-task", + "blocking", + "concurrent-queue", + "fastrand", + "futures-io", + "futures-util", + "libc", + "once_cell", + "scoped-tls", + "slab", + "socket2", + "wepoll-sys-stjepang", + "winapi 0.3.9", +] + [[package]] name = "snow" version = "0.7.1" @@ -6486,7 +6552,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32bf8474159a95551661246cda4976e89356999e3cbfef36f493dacc3fae1e8e" dependencies = [ "aes-gcm", - "blake2 0.9.0", + "blake2", "chacha20poly1305", "rand 0.7.3", "rand_core 0.5.1", @@ -6511,40 +6577,36 @@ dependencies = [ [[package]] name = "soketto" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c9dab3f95c9ebdf3a88268c19af668f637a3c5039c2c56ff2d40b1b2d64a25b" +checksum = "85457366ae0c6ce56bf05a958aef14cd38513c236568618edbcd9a8c52cb80b0" dependencies = [ - "base64 0.11.0", + "base64 0.12.3", "bytes 0.5.6", "flate2", "futures 0.3.5", - "http 0.2.1", "httparse", "log", "rand 0.7.3", - "sha1", - "smallvec 1.4.1", - "static_assertions", - "thiserror", + "sha-1", ] [[package]] name = "sp-allocator" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "log", "sp-core", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-wasm-interface", ] [[package]] name = "sp-api" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "hash-db", "parity-scale-codec", @@ -6552,14 +6614,14 @@ dependencies = [ "sp-core", "sp-runtime", "sp-state-machine", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-version", ] [[package]] name = "sp-api-proc-macro" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "blake2-rfc", "proc-macro-crate", @@ -6570,68 +6632,68 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "serde", "sp-core", "sp-io", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-arithmetic" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "integer-sqrt", "num-traits 0.2.12", "parity-scale-codec", "serde", "sp-debug-derive", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-authority-discovery" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "sp-api", "sp-application-crypto", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-authorship" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-block-builder" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "sp-api", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-blockchain" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "log", @@ -6640,14 +6702,15 @@ dependencies = [ "parking_lot 0.10.2", "sp-block-builder", "sp-consensus", + "sp-database", "sp-runtime", "sp-state-machine", ] [[package]] name = "sp-chain-spec" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "serde", "serde_json", @@ -6655,8 +6718,8 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "futures 0.3.5", @@ -6670,7 +6733,8 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", + "sp-trie", "sp-utils", "sp-version", "substrate-prometheus-endpoint", @@ -6679,38 +6743,48 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "merlin", "parity-scale-codec", "sp-api", "sp-application-crypto", "sp-consensus", + "sp-consensus-slots", "sp-consensus-vrf", "sp-core", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-timestamp", ] +[[package]] +name = "sp-consensus-slots" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +dependencies = [ + "parity-scale-codec", + "sp-runtime", +] + [[package]] name = "sp-consensus-vrf" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "schnorrkel", "sp-core", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-core" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "base58", "blake2-rfc", @@ -6734,12 +6808,13 @@ dependencies = [ "rand 0.7.3", "regex", "schnorrkel", + "secrecy", "serde", "sha2 0.8.2", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-storage", "substrate-bip39", "tiny-bip39", @@ -6751,8 +6826,8 @@ dependencies = [ [[package]] name = "sp-database" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "kvdb", "parking_lot 0.10.2", @@ -6760,8 +6835,8 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "proc-macro2", "quote 1.0.7", @@ -6770,19 +6845,19 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "environmental", "parity-scale-codec", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-storage", ] [[package]] name = "sp-finality-grandpa" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "finality-grandpa", "log", @@ -6792,35 +6867,35 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-finality-tracker" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "sp-inherents", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-inherents" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "parity-scale-codec", "parking_lot 0.10.2", "sp-core", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-io" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "futures 0.3.5", "hash-db", @@ -6832,7 +6907,7 @@ dependencies = [ "sp-externalities", "sp-runtime-interface", "sp-state-machine", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-tracing", "sp-trie", "sp-wasm-interface", @@ -6840,8 +6915,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "lazy_static", "sp-core", @@ -6851,20 +6926,20 @@ dependencies = [ [[package]] name = "sp-npos-elections" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "serde", "sp-arithmetic", "sp-npos-elections-compact", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-npos-elections-compact" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6874,8 +6949,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "sp-api", "sp-core", @@ -6884,8 +6959,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "backtrace", "log", @@ -6893,8 +6968,8 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "serde", "sp-core", @@ -6902,8 +6977,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "either", "hash256-std-hasher", @@ -6919,19 +6994,19 @@ dependencies = [ "sp-core", "sp-inherents", "sp-io", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-runtime-interface" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "primitive-types 0.7.2", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "sp-tracing", "sp-wasm-interface", "static_assertions", @@ -6939,8 +7014,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "Inflector", "proc-macro-crate", @@ -6951,8 +7026,8 @@ dependencies = [ [[package]] name = "sp-serializer" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "serde", "serde_json", @@ -6960,31 +7035,31 @@ dependencies = [ [[package]] name = "sp-session" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "sp-api", "sp-core", "sp-runtime", "sp-staking", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-staking" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "parity-scale-codec", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-state-machine" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "hash-db", "itertools 0.9.0", @@ -7009,39 +7084,39 @@ source = "git+https://github.com/darwinia-network/substrate.git?branch=darwinia- [[package]] name = "sp-std" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" [[package]] name = "sp-storage" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "impl-serde 0.2.3", "ref-cast", "serde", "sp-debug-derive", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-timestamp" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "sp-api", "sp-inherents", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "wasm-timer", ] [[package]] name = "sp-tracing" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "log", "rental", @@ -7050,8 +7125,8 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "derive_more", "futures 0.3.5", @@ -7061,27 +7136,26 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-runtime", - "sp-utils", ] [[package]] name = "sp-trie" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "hash-db", "memory-db", "parity-scale-codec", "sp-core", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "trie-db", "trie-root", ] [[package]] name = "sp-utils" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "futures 0.3.5", "futures-core", @@ -7092,24 +7166,24 @@ dependencies = [ [[package]] name = "sp-version" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "impl-serde 0.2.3", "parity-scale-codec", "serde", "sp-runtime", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", ] [[package]] name = "sp-wasm-interface" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", - "sp-std 2.0.0-rc4", + "sp-std 2.0.0-rc5", "wasmi", ] @@ -7146,7 +7220,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09f8ed9974042b8c3672ff3030a69fcc03b74c47c3d1ecb7755e8a3626011e88" dependencies = [ - "generic-array 0.14.3", + "generic-array 0.14.4", ] [[package]] @@ -7232,8 +7306,8 @@ dependencies = [ [[package]] name = "substrate-browser-utils" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "chrono", "clear_on_drop", @@ -7259,16 +7333,16 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "platforms", ] [[package]] name = "substrate-frame-rpc-system" -version = "2.0.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "2.0.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.5", @@ -7290,8 +7364,8 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.8.0-rc4" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +version = "0.8.0-rc5" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" dependencies = [ "async-std", "derive_more", @@ -7305,7 +7379,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder-runner" version = "1.0.6" -source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.3#93a6a53061b9ecb8660c291ab43d083cf51c1f89" +source = "git+https://github.com/darwinia-network/substrate.git?tag=v2.0.0-rc.darwinia.4#065b0f321f223b4cb3b22cee0e71fa6930034e2a" [[package]] name = "substrate-wasmtime" @@ -7453,9 +7527,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.13.4" +version = "0.14.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac193374347e7c263c5f547524f36ff8ec6702d56c8799c8331d26dffe8c1e" +checksum = "2983daff11a197c7c406b130579bc362177aa54cf2cc1f34d6ac88fccaa6a5e1" dependencies = [ "cfg-if", "doc-comment", @@ -7753,9 +7827,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15cb62a0d2770787abc96e99c1cd98fcf17f94959f3af63ca85bdfb203f051b4" +checksum = "228139ddd4fea3fa345a29233009635235833e52807af7ea6448ead03890d6a9" dependencies = [ "futures-core", "rustls", @@ -7900,9 +7974,9 @@ checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" [[package]] name = "tracing" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0aae59226cf195d8e74d4b34beae1859257efb4e5fed3f147d2dc2c7d372178" +checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c" dependencies = [ "cfg-if", "log", @@ -7912,9 +7986,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0693bf8d6f2bf22c690fc61a9d21ac69efdbb894a17ed596b9af0f01e64b84b" +checksum = "1fe233f4227389ab7df5b32649239da7ebe0b281824b4e84b342d04d3fd8c25e" dependencies = [ "proc-macro2", "quote 1.0.7", @@ -7923,9 +7997,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d593f98af59ebc017c0648f0117525db358745a8894a8d684e185ba3f45954f9" +checksum = "db63662723c316b43ca36d833707cc93dff82a02ba3d7e354f342682cc8b3545" dependencies = [ "lazy_static", ] @@ -7938,12 +8012,12 @@ checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" [[package]] name = "trie-db" -version = "0.21.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb230c24c741993b04cfccbabb45acff6f6480c5f00d3ed8794ea43db3a9d727" +checksum = "9e55f7ace33d6237e14137e386f4e1672e2a5c6bbc97fef9f438581a143971f0" dependencies = [ "hash-db", - "hashbrown 0.6.3", + "hashbrown 0.8.2", "log", "rustc-hex", "smallvec 1.4.1", @@ -8059,7 +8133,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ - "generic-array 0.14.3", + "generic-array 0.14.4", "subtle 2.2.3", ] @@ -8068,12 +8142,6 @@ name = "unsigned-varint" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f67332660eb59a6f1eb24ff1220c9e8d01738a8503c6002e30bcfe4bd9f2b4a9" -dependencies = [ - "bytes 0.5.6", - "futures-io", - "futures-util", - "futures_codec 0.3.4", -] [[package]] name = "unsigned-varint" @@ -8082,7 +8150,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "669d776983b692a906c881fcd0cfb34271a48e197e4d6cb8df32b05bfc3d3fa5" dependencies = [ "bytes 0.5.6", - "futures_codec 0.4.1", + "futures-io", + "futures-util", + "futures_codec", ] [[package]] @@ -8146,6 +8216,12 @@ dependencies = [ "libc", ] +[[package]] +name = "waker-fn" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9571542c2ce85ce642e6b58b3364da2fb53526360dfb7c211add4f5c23105ff7" + [[package]] name = "want" version = "0.2.0" @@ -8337,18 +8413,18 @@ dependencies = [ [[package]] name = "wast" -version = "21.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1844f66a2bc8526d71690104c0e78a8e59ffa1597b7245769d174ebb91deb5" +checksum = "fe1220ed7f824992b426a76125a3403d048eaf0f627918e97ade0d9b9d510d20" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce85d72b74242c340e9e3492cfb602652d7bb324c3172dd441b5577e39a2e18c" +checksum = "f888158d9a4b7c39b859f72a435019835b64097c749f4f28d319004ca5a520b8" dependencies = [ "wast", ] @@ -8391,6 +8467,15 @@ dependencies = [ "webpki", ] +[[package]] +name = "wepoll-sys-stjepang" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fd319e971980166b53e17b1026812ad66c6b54063be879eb182342b55284694" +dependencies = [ + "cc", +] + [[package]] name = "which" version = "3.1.1" diff --git a/Cargo.toml b/Cargo.toml index 132dd2f88..032da542e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ path = "src/main.rs" [package] name = "darwinia" -version = "0.6.5" +version = "0.6.6" authors = ["Darwinia Network "] description = "Darwinia node implementation in Rust" edition = "2018" @@ -27,6 +27,10 @@ tempfile = { version = "3.1.0" } [features] default = ["darwinia-cli/wasmtime"] +dev = [ + "darwinia-service/dev", + "darwinia-cli/dev", +] [workspace] members = [ diff --git a/Cross.toml b/Cross.toml index e8f3d9075..1301c41b2 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,6 +1,5 @@ [target.x86_64-unknown-linux-gnu] image = "x86_64-linux-gnu" -# image = "centos-7" [target.aarch64-unknown-linux-gnu] image = "aarch64-linux-gnu" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 307131c4d..95873e837 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "darwinia-cli" -version = "0.6.5" +version = "0.6.6" authors = ["Darwinia Network "] description = "Darwinia Client Node" edition = "2018" @@ -20,30 +20,30 @@ crate-type = ["cdylib", "rlib"] [dependencies] # crates log = { version = "0.4.11" } -serde = { version = "1.0.114", optional = true } -structopt = { version = "0.3.15" } +serde = { version = "1.0.115", optional = true } +structopt = { version = "0.3.16" } tokio = { version = "0.2.22", features = ["rt-threaded"], optional = true } toml = { version = "0.5.6", optional = true } wasm-bindgen = { version = "0.2.67", optional = true } wasm-bindgen-futures = { version = "0.4.17", optional = true } # substrate client -sc-cli = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-executor = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-network = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-service = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-tracing = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +sc-cli = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-executor = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-network = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-service = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-tracing = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # substrate utils -substrate-browser-utils = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +substrate-browser-utils = { optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # substrate primitives -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # darwinia client darwinia-cli = { optional = true, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } # darwinia service darwinia-service = { default-features = false, path = "../service" } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +substrate-build-script-utils = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } [features] default = [ @@ -67,3 +67,4 @@ browser = [ "wasm-bindgen-futures", "substrate-browser-utils", ] +dev = ["darwinia-service/dev"] diff --git a/cli/src/browser.rs b/cli/src/browser.rs index 52e66411a..1d81a3bbf 100644 --- a/cli/src/browser.rs +++ b/cli/src/browser.rs @@ -1,10 +1,9 @@ // --- std --- -use std::str::FromStr; +use std::{error::Error, str::FromStr}; // --- crates --- use log::info; -// --- substrate --- use substrate_browser_utils::{ - browser_configuration, init_console_log, set_console_error_panic_hook, Client, + browser_configuration, init_console_log, set_console_error_panic_hook, start_client, Client, }; use wasm_bindgen::prelude::*; @@ -16,10 +15,7 @@ pub async fn start_client(chain_spec: String, log_level: String) -> Result Result> { +async fn start_inner(chain_spec: String, log_level: String) -> Result> { set_console_error_panic_hook(); init_console_log(log_level.parse()?)?; @@ -42,7 +38,8 @@ async fn start_inner( info!("👤 Role: {}", config.display_role()); // Create the service. This is the most heavy initialization step. - let service = darwinia_service::crab_new_light(config).map_err(|e| format!("{:?}", e))?; + let (task_manager, rpc_handlers) = + darwinia_service::crab_new_light(config).map_err(|e| format!("{:?}", e))?; - Ok(browser_utils::start_client(service)) + Ok(start_client(task_manager, rpc_handlers)) } diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 243072920..0fe5da51d 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -17,6 +17,10 @@ pub struct RunCmd { #[allow(missing_docs)] #[structopt(flatten)] pub base: sc_cli::RunCmd, + + /// Force using Crab native runtime. + #[structopt(long = "force-crab")] + pub force_crab: bool, } #[allow(missing_docs)] diff --git a/cli/src/command.rs b/cli/src/command.rs index 854e000a8..71844a376 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -3,62 +3,85 @@ use std::path::PathBuf; // --- crates --- use log::info; // --- substrate --- -use sc_cli::{RunCmd, SubstrateCli}; -use sc_executor::NativeExecutionDispatch; +use sc_cli::{Role, RunCmd, RuntimeVersion, SubstrateCli}; +use sp_core::crypto::Ss58AddressFormat; // --- darwinia --- use crate::cli::{Cli, Subcommand}; use darwinia_cli::{Configuration, DarwiniaCli}; use darwinia_service::{crab_runtime, IdentifyVariant}; impl SubstrateCli for Cli { - fn impl_name() -> &'static str { - "Crab" + fn impl_name() -> String { + "Crab".into() } - fn impl_version() -> &'static str { - env!("SUBSTRATE_CLI_IMPL_VERSION") + fn impl_version() -> String { + env!("SUBSTRATE_CLI_IMPL_VERSION").into() } - fn executable_name() -> &'static str { - "darwinia" + fn executable_name() -> String { + "darwinia".into() } - fn description() -> &'static str { - env!("CARGO_PKG_DESCRIPTION") + fn description() -> String { + env!("CARGO_PKG_DESCRIPTION").into() } - fn author() -> &'static str { - env!("CARGO_PKG_AUTHORS") + fn author() -> String { + env!("CARGO_PKG_AUTHORS").into() } - fn support_url() -> &'static str { - "https://github.com/darwinia-network/darwinia/issues/new" + fn support_url() -> String { + "https://github.com/darwinia-network/darwinia/issues/new".into() } fn copyright_start_year() -> i32 { 2018 } + fn native_runtime_version( + spec: &Box, + ) -> &'static RuntimeVersion { + if spec.is_crab() { + &darwinia_service::crab_runtime::VERSION + } else if spec.is_darwinia() { + // &service::westend_runtime::VERSION + unimplemented!() + } else { + unreachable!() + } + } + fn load_spec(&self, id: &str) -> std::result::Result, String> { let id = if id.is_empty() { let n = get_exec_name().unwrap_or_default(); - ["crab"] + ["darwinia", "crab"] .iter() .cloned() .find(|&chain| n.starts_with(chain)) - .unwrap_or("crab") + .unwrap_or("darwinia") } else { id }; Ok(match id.to_lowercase().as_ref() { - "crab-dev" | "dev" => Box::new(darwinia_service::chain_spec::crab_development_config()), + // "darwinia-dev" | "dev" => Box::new(darwinia_service::chain_spec::darwinia_development_config()), + // "darwinia-local" => Box::new(darwinia_service::chain_spec::darwinia_local_testnet_config()), + // "darwinia-genesis" => Box::new(darwinia_service::chain_spec::darwinia_build_spec_config()), + // "darwinia" => Box::new(darwinia_service::chain_spec::darwinia_config()?), + "crab-dev" => Box::new(darwinia_service::chain_spec::crab_development_config()), "crab-local" => Box::new(darwinia_service::chain_spec::crab_local_testnet_config()), "crab-genesis" => Box::new(darwinia_service::chain_spec::crab_build_spec_config()), "crab" => Box::new(darwinia_service::chain_spec::crab_config()?), - path => Box::new(darwinia_service::CrabChainSpec::from_json_file( - std::path::PathBuf::from(path), - )?), + path if self.run.force_crab => Box::new( + darwinia_service::CrabChainSpec::from_json_file(std::path::PathBuf::from(path))?, + ), + _path => { + // Box::new(darwinia_service::DarwiniaChainSpec::from_json_file( + // std::path::PathBuf::from(path), + // )?) + unimplemented!() + } }) } } @@ -89,13 +112,12 @@ pub fn run() -> sc_cli::Result<()> { let cli = Cli::from_args(); fn set_default_ss58_version(spec: &Box) { - // --- substrate --- - use sp_core::crypto::Ss58AddressFormat; - let ss58_version = if spec.is_crab() { Ss58AddressFormat::SubstrateAccount - } else { + } else if spec.is_darwinia() { Ss58AddressFormat::DarwiniaAccount + } else { + unreachable!() }; sp_core::crypto::set_default_ss58_version(ss58_version); @@ -103,7 +125,7 @@ pub fn run() -> sc_cli::Result<()> { match &cli.subcommand { None => { - let runtime = Configuration::create_runner_from_cli(cli)?; + let runtime = Configuration::create_runner(cli)?; let chain_spec = &runtime.config().chain_spec; set_default_ss58_version(chain_spec); @@ -116,17 +138,19 @@ pub fn run() -> sc_cli::Result<()> { info!(" |_____/ \\__,_|_| \\_/\\_/ |_|_| |_|_|\\__,_|"); if chain_spec.is_crab() { - runtime.run_node( - |config| darwinia_service::crab_new_light(config), - |config| darwinia_service::crab_new_full(config), - darwinia_service::CrabExecutor::native_version().runtime_version, - ) + runtime.run_node_until_exit(|config| match config.role { + Role::Light => darwinia_service::crab_new_light(config), + _ => darwinia_service::crab_new_full(config).map(|(components, _)| components), + }) + } else if chain_spec.is_darwinia() { + // runtime.run_node_until_exit(|config| match config.role { + // Role::Light => darwinia_service::darwinia_new_light(config), + // _ => darwinia_service::darwinia_new_full(config) + // .map(|(components, _)| components), + // }) + unimplemented!() } else { - runtime.run_node( - |config| darwinia_service::crab_new_light(config), - |config| darwinia_service::crab_new_full(config), - darwinia_service::CrabExecutor::native_version().runtime_version, - ) + unreachable!() } } Some(Subcommand::Base(subcommand)) => { @@ -143,14 +167,17 @@ pub fn run() -> sc_cli::Result<()> { crab_runtime::UncheckedExtrinsic, >(config) }) + } else if chain_spec.is_darwinia() { + // runtime.run_subcommand(subcommand, |config| { + // darwinia_service::new_chain_ops::< + // darwinia_runtime::RuntimeApi, + // darwinia_service::DarwiniaExecutor, + // darwinia_runtime::UncheckedExtrinsic, + // >(config) + // }) + unimplemented!() } else { - runtime.run_subcommand(subcommand, |config| { - darwinia_service::new_chain_ops::< - crab_runtime::RuntimeApi, - darwinia_service::CrabExecutor, - crab_runtime::UncheckedExtrinsic, - >(config) - }) + unreachable!() } } } diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 99b266dd5..9a9772fd4 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "darwinia-primitives" -version = "0.6.5" +version = "0.6.6" authors = ["Darwinia Network "] description = "Darwinia node runtime primitives" edition = "2018" @@ -12,11 +12,11 @@ repository = "https://github.com/darwinia-network/darwinia/" # crates codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } # substrate primitives -sp-application-crypto = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +sp-application-crypto = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # substrate frame -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } [features] default = ["std"] diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index f3feb07e0..441dfece2 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "darwinia-rpc" -version = "0.6.5" +version = "0.6.6" authors = ["Darwinia Network "] description = "Darwinia node rpc" edition = "2018" @@ -13,26 +13,27 @@ repository = "https://github.com/darwinia-network/darwinia/" codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } jsonrpc-core = { version = "14.2.0" } # substrate primitives -sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-block-builder = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-block-builder = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # darwinia primitives darwinia-primitives = { path = "../primitives" } # substrate frame -pallet-transaction-payment-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -substrate-frame-rpc-system = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +pallet-transaction-payment-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +substrate-frame-rpc-system = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # darwinia frame darwinia-balances-rpc = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } +darwinia-header-mmr-rpc = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } darwinia-staking-rpc = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } # substrate client -sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-consensus-babe-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-consensus-epochs = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-finality-grandpa = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-finality-grandpa-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-keystore = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-consensus-babe-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-consensus-epochs = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-finality-grandpa = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-finality-grandpa-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-keystore = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-rpc = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index dc52beabd..337082c1d 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -6,25 +6,12 @@ use std::sync::Arc; // --- substrate --- use sp_api::ProvideRuntimeApi; -use sp_blockchain::{HeaderBackend, HeaderMetadata}; // --- darwinia --- use darwinia_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Nonce, Power}; /// A type representing all RPC extensions. pub type RpcExtension = jsonrpc_core::IoHandler; -/// Light client extra dependencies. -pub struct LightDeps { - /// The client instance to use. - pub client: Arc, - /// Transaction pool instance. - pub pool: Arc

, - /// Remote access to the blockchain (async). - pub remote_blockchain: Arc>, - /// Fetcher instance. - pub fetcher: Arc, -} - /// Extra dependencies for BABE. pub struct BabeDeps { /// BABE protocol config. @@ -60,21 +47,35 @@ pub struct FullDeps { pub grandpa: GrandpaDeps, } +/// Light client extra dependencies. +pub struct LightDeps { + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// Remote access to the blockchain (async). + pub remote_blockchain: Arc>, + /// Fetcher instance. + pub fetcher: Arc, +} + /// Instantiate all RPC extensions. pub fn create_full(deps: FullDeps) -> RpcExtension where - C: ProvideRuntimeApi, - C: HeaderBackend + HeaderMetadata, C: 'static + Send + Sync, + C: ProvideRuntimeApi, + C: sp_blockchain::HeaderBackend + + sp_blockchain::HeaderMetadata, C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, - C::Api: sp_consensus_babe::BabeApi, + C::Api: sc_consensus_babe::BabeApi, C::Api: sp_block_builder::BlockBuilder, C::Api: darwinia_balances_rpc::BalancesRuntimeApi, + C::Api: darwinia_header_mmr_rpc::HeaderMMRRuntimeApi, C::Api: darwinia_staking_rpc::StakingRuntimeApi, - P: 'static + Sync + Send + sp_transaction_pool::TransactionPool, - UE: 'static + Send + Sync + codec::Codec, + P: 'static + sp_transaction_pool::TransactionPool, SC: 'static + sp_consensus::SelectChain, + UE: 'static + Send + Sync + codec::Codec, { // --- substrate --- use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; @@ -83,6 +84,7 @@ where use substrate_frame_rpc_system::{FullSystem, SystemApi}; // --- darwinia --- use darwinia_balances_rpc::{Balances, BalancesApi}; + use darwinia_header_mmr_rpc::{HeaderMMR, HeaderMMRApi}; use darwinia_staking_rpc::{Staking, StakingApi}; let FullDeps { @@ -93,8 +95,8 @@ where babe, grandpa, } = deps; - let mut io = jsonrpc_core::IoHandler::default(); + io.extend_with(SystemApi::to_delegate(FullSystem::new( client.clone(), pool, @@ -129,6 +131,7 @@ where ))); } io.extend_with(BalancesApi::to_delegate(Balances::new(client.clone()))); + io.extend_with(HeaderMMRApi::to_delegate(HeaderMMR::new(client.clone()))); io.extend_with(StakingApi::to_delegate(Staking::new(client))); io @@ -137,15 +140,13 @@ where /// Instantiate all RPC extensions for light node. pub fn create_light(deps: LightDeps) -> RpcExtension where - C: ProvideRuntimeApi, - C: HeaderBackend, C: 'static + Send + Sync, + C: ProvideRuntimeApi, + C: sp_blockchain::HeaderBackend, C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, - C::Api: darwinia_balances_rpc::BalancesRuntimeApi, - C::Api: darwinia_staking_rpc::StakingRuntimeApi, - P: 'static + Send + Sync + sp_transaction_pool::TransactionPool, - F: 'static + sc_client_api::light::Fetcher, + P: 'static + sp_transaction_pool::TransactionPool, + F: 'static + sc_client_api::Fetcher, UE: 'static + Send + Sync + codec::Codec, { // --- substrate --- @@ -157,8 +158,8 @@ where remote_blockchain, fetcher, } = deps; - let mut io = jsonrpc_core::IoHandler::default(); + io.extend_with(SystemApi::::to_delegate( LightSystem::new(client, remote_blockchain, fetcher, pool), )); diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 31c5d6791..fc6e8dbdb 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "darwinia-runtime-common" -version = "0.6.5" +version = "0.6.6" authors = ["Darwinia Network "] description = "Darwinia node runtime common" edition = "2018" @@ -13,15 +13,15 @@ repository = "https://github.com/darwinia-network/darwinia/" codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } static_assertions = { version = "1.1.0" } # substrate primitives -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # darwinia primitives darwinia-primitives = { default-features = false, path = "../../primitives" } # substrate frame -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-authorship = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-authorship = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # darwinia frame darwinia-balances = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } darwinia-staking = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } diff --git a/runtime/crab/Cargo.toml b/runtime/crab/Cargo.toml index 19361708f..53d403cae 100644 --- a/runtime/crab/Cargo.toml +++ b/runtime/crab/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crab-runtime" -version = "0.6.5" +version = "0.6.6" authors = ["Darwinia Network "] description = "Darwinia node runtime for Crab network" edition = "2018" @@ -12,54 +12,54 @@ build = "build.rs" [dependencies] # crates codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] } -serde = { version = "1.0.114", optional = true } +serde = { version = "1.0.115", optional = true } smallvec = { version = "1.4.1" } static_assertions = { version = "1.1.0" } # substrate primitives -sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-authority-discovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-block-builder = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-consensus-babe = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-inherents = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-offchain = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-session = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-staking = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-transaction-pool = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-version = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +sp-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-authority-discovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-block-builder = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-consensus-babe = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-core = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-inherents = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-offchain = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-runtime = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-session = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-staking = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-std = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-transaction-pool = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-version = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # darwinia primitives darwinia-primitives = { default-features = false, path = "../../primitives" } # substrate frame -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -frame-executive = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-authority-discovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-authorship = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-babe = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-collective = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-finality-tracker = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-grandpa = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-identity = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-im-online = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-indices = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-membership = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-multisig = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-offences = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-proxy = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-recovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-scheduler = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-session = { default-features = false, features = ["historical"], git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-society = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-sudo = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-utility = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +frame-executive = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +frame-support = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +frame-system = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-authority-discovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-authorship = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-babe = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-collective = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-finality-tracker = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-grandpa = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-identity = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-im-online = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-indices = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-membership = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-multisig = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-offences = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-proxy = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-recovery = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-scheduler = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-session = { default-features = false, features = ["historical"], git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-society = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-sudo = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-timestamp = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-utility = { default-features = false, git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # darwinia frame darwinia-balances = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } darwinia-balances-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } @@ -68,6 +68,7 @@ darwinia-elections-phragmen = { default-features = false, git = "https://github. darwinia-ethereum-backing = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } darwinia-ethereum-relay = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } darwinia-header-mmr = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } +darwinia-header-mmr-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } darwinia-relayer-game = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } darwinia-staking = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } darwinia-staking-rpc-runtime-api = { default-features = false, git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } @@ -77,7 +78,7 @@ darwinia-treasury = { default-features = false, git = "https://github.com/darwin darwinia-runtime-common = { default-features = false, path = "../common" } [build-dependencies] -wasm-builder-runner = { package = "substrate-wasm-builder-runner", git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +wasm-builder-runner = { package = "substrate-wasm-builder-runner", git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } [features] default = ["std"] @@ -138,6 +139,7 @@ std = [ "darwinia-ethereum-backing/std", "darwinia-ethereum-relay/std", "darwinia-header-mmr/std", + "darwinia-header-mmr-rpc-runtime-api/std", "darwinia-relayer-game/std", "darwinia-staking/std", "darwinia-staking-rpc-runtime-api/std", @@ -146,3 +148,4 @@ std = [ # darwinia runtime "darwinia-runtime-common/std", ] +dev = [] diff --git a/runtime/crab/src/constants.rs b/runtime/crab/src/constants.rs index 06ebdf2dc..8403146e3 100644 --- a/runtime/crab/src/constants.rs +++ b/runtime/crab/src/constants.rs @@ -25,24 +25,22 @@ pub mod time { // --- darwinia --- use darwinia_primitives::{BlockNumber, Moment}; - // Mainnet - // pub const MILLISECS_PER_BLOCK: Moment = 10000; - // Crab & Testnet + #[cfg(feature = "dev")] + pub const MILLISECS_PER_BLOCK: Moment = 3000; + #[cfg(not(feature = "dev"))] pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; - // Mainnet - // pub const BLOCKS_PER_SESSION: BlockNumber = 4 * HOURS; - // Crab + #[cfg(feature = "dev")] + pub const BLOCKS_PER_SESSION: BlockNumber = MINUTES / 2; + #[cfg(not(feature = "dev"))] pub const BLOCKS_PER_SESSION: BlockNumber = 1 * HOURS; - // Testnet - // pub const BLOCKS_PER_SESSION: BlockNumber = 10 * MINUTES; - // Crab & Mainnet + #[cfg(feature = "dev")] + pub const SESSIONS_PER_ERA: SessionIndex = 3; + #[cfg(not(feature = "dev"))] pub const SESSIONS_PER_ERA: SessionIndex = 6; - // Testnet - // pub const SESSIONS_PER_ERA: SessionIndex = 3; // These time units are defined in number of blocks. pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); @@ -67,9 +65,6 @@ pub mod fee { use darwinia_primitives::Balance; use darwinia_runtime_common::ExtrinsicBaseWeight; - /// The block saturation level. Fees will be updates based on this value. - pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); - /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the /// node's balance type. /// diff --git a/runtime/crab/src/lib.rs b/runtime/crab/src/lib.rs index de1ec9649..a6e73dfd4 100644 --- a/runtime/crab/src/lib.rs +++ b/runtime/crab/src/lib.rs @@ -40,7 +40,9 @@ use frame_support::{ weights::Weight, }; use frame_system::{EnsureOneOf, EnsureRoot}; -use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; +use pallet_grandpa::{ + fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, +}; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_session::historical as pallet_session_historical; use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo as TransactionPaymentRuntimeDispatchInfo; @@ -53,8 +55,8 @@ use sp_core::{ use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ - BlakeTwo256, Block as BlockT, Extrinsic as ExtrinsicT, IdentityLookup, OpaqueKeys, - SaturatedConversion, + BlakeTwo256, Block as BlockT, Extrinsic as ExtrinsicT, IdentityLookup, NumberFor, + OpaqueKeys, SaturatedConversion, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, KeyTypeId, ModuleId, Perbill, Percent, Permill, RuntimeDebug, @@ -67,6 +69,7 @@ use sp_version::RuntimeVersion; // --- darwinia --- use constants::{currency::*, fee::*, relay::*, time::*}; use darwinia_balances_rpc_runtime_api::RuntimeDispatchInfo as BalancesRuntimeDispatchInfo; +use darwinia_header_mmr_rpc_runtime_api::RuntimeDispatchInfo as HeaderMMRRuntimeDispatchInfo; use darwinia_primitives::*; use darwinia_runtime_common::*; use darwinia_staking::EraIndex; @@ -91,7 +94,6 @@ pub type SignedExtra = ( frame_system::CheckNonce, frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, - pallet_grandpa::ValidateEquivocationReport, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; @@ -104,6 +106,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllModules, + CustomOnRuntimeUpgrade, >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; @@ -115,7 +118,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("Crab"), impl_name: create_runtime_str!("Crab"), authoring_version: 0, - spec_version: 5, + spec_version: 6, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -158,6 +161,7 @@ impl frame_system::Trait for Runtime { type AccountData = AccountData; type OnNewAccount = (); type OnKilledAccount = (); + type SystemWeightInfo = (); } parameter_types! { @@ -169,6 +173,17 @@ impl pallet_babe::Trait for Runtime { type ExpectedBlockTime = ExpectedBlockTime; // session module is the trigger type EpochChangeTrigger = pallet_babe::ExternalTrigger; + type KeyOwnerProofSystem = Historical; + type KeyOwnerProof = >::Proof; + type KeyOwnerIdentification = >::IdentificationTuple; + type HandleEquivocation = + pallet_babe::EquivocationHandler; } parameter_types! { @@ -178,6 +193,7 @@ impl pallet_timestamp::Trait for Runtime { type Moment = Moment; type OnTimestampSet = Babe; type MinimumPeriod = MinimumPeriod; + type WeightInfo = (); } parameter_types! { @@ -188,6 +204,32 @@ impl pallet_indices::Trait for Runtime { type Currency = Ring; type Deposit = IndexDeposit; type Event = Event; + type WeightInfo = (); +} + +parameter_types! { + pub const RingExistentialDeposit: Balance = 100 * MILLI; + pub const KtonExistentialDeposit: Balance = 10 * MICRO; +} +impl darwinia_balances::Trait for Runtime { + type Balance = Balance; + type DustRemoval = (); + type Event = Event; + type ExistentialDeposit = RingExistentialDeposit; + type BalanceInfo = AccountData; + type AccountStore = System; + type WeightInfo = (); + type DustCollector = (Kton,); +} +impl darwinia_balances::Trait for Runtime { + type Balance = Balance; + type DustRemoval = (); + type Event = Event; + type ExistentialDeposit = KtonExistentialDeposit; + type BalanceInfo = AccountData; + type AccountStore = System; + type WeightInfo = (); + type DustCollector = (Ring,); } pub struct DealWithFees; @@ -227,6 +269,52 @@ impl pallet_authorship::Trait for Runtime { type EventHandler = (Staking, ImOnline); } +parameter_types! { + pub const SessionsPerEra: SessionIndex = SESSIONS_PER_ERA; + pub const BondingDurationInEra: EraIndex = 14 * DAYS + / (SESSIONS_PER_ERA as BlockNumber * BLOCKS_PER_SESSION); + pub const BondingDurationInBlockNumber: BlockNumber = 14 * DAYS; + pub const SlashDeferDuration: EraIndex = 14 * DAYS + / (SESSIONS_PER_ERA as BlockNumber * BLOCKS_PER_SESSION); + // quarter of the last session will be for election. + pub const ElectionLookahead: BlockNumber = BLOCKS_PER_SESSION / 4; + pub const MaxIterations: u32 = 5; + pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000); + pub const MaxNominatorRewardedPerValidator: u32 = 64; + pub const StakingUnsignedPriority: TransactionPriority = TransactionPriority::max_value() / 2; + // quarter of the last session will be for election. + pub const Cap: Balance = CAP; + pub const TotalPower: Power = TOTAL_POWER; +} +impl darwinia_staking::Trait for Runtime { + type Event = Event; + type UnixTime = Timestamp; + type SessionsPerEra = SessionsPerEra; + type BondingDurationInEra = BondingDurationInEra; + type BondingDurationInBlockNumber = BondingDurationInBlockNumber; + type SlashDeferDuration = SlashDeferDuration; + /// A super-majority of the council can cancel the slash. + type SlashCancelOrigin = EnsureRootOrHalfCouncil; + type SessionInterface = Self; + type NextNewSession = Session; + type ElectionLookahead = ElectionLookahead; + type Call = Call; + type MaxIterations = MaxIterations; + type MinSolutionScoreBump = MinSolutionScoreBump; + type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; + type UnsignedPriority = StakingUnsignedPriority; + type RingCurrency = Ring; + type RingRewardRemainder = Treasury; + type RingSlash = Treasury; + type RingReward = (); + type KtonCurrency = Kton; + type KtonSlash = Treasury; + type KtonReward = (); + type WeightInfo = (); + type Cap = Cap; + type TotalPower = TotalPower; +} + parameter_types! { pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); } @@ -235,6 +323,7 @@ impl pallet_offences::Trait for Runtime { type IdentificationTuple = pallet_session::historical::IdentificationTuple; type OnOffenceHandler = Staking; type WeightSoftLimit = OffencesWeightSoftLimit; + type WeightInfo = (); } impl pallet_session::historical::Trait for Runtime { @@ -263,6 +352,7 @@ impl pallet_session::Trait for Runtime { type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type DisabledValidatorsThreshold = DisabledValidatorsThreshold; + type WeightInfo = (); } parameter_types! { @@ -285,12 +375,8 @@ impl pallet_grandpa::Trait for Runtime { GrandpaId, )>>::IdentificationTuple; type KeyOwnerProofSystem = Historical; - type HandleEquivocation = pallet_grandpa::EquivocationHandler< - Self::KeyOwnerIdentification, - darwinia_primitives::fisherman::FishermanAppCrypto, - Runtime, - Offences, - >; + type HandleEquivocation = + pallet_grandpa::EquivocationHandler; } parameter_types! { @@ -303,6 +389,7 @@ impl pallet_im_online::Trait for Runtime { type SessionDuration = SessionDuration; type ReportUnresponsiveness = Offences; type UnsignedPriority = ImOnlineUnsignedPriority; + type WeightInfo = (); } impl pallet_authority_discovery::Trait for Runtime {} @@ -320,6 +407,7 @@ impl pallet_collective::Trait for Runtime { type Event = Event; type MotionDuration = CouncilMotionDuration; type MaxProposals = CouncilMaxProposals; + type WeightInfo = (); } type TechnicalCollective = pallet_collective::Instance1; impl pallet_collective::Trait for Runtime { @@ -328,6 +416,36 @@ impl pallet_collective::Trait for Runtime { type Event = Event; type MotionDuration = TechnicalMotionDuration; type MaxProposals = TechnicalMaxProposals; + type WeightInfo = (); +} + +parameter_types! { + pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect"; + pub const CandidacyBond: Balance = 1 * COIN; + pub const VotingBond: Balance = 5 * MILLI; + /// Daily council elections. + pub const TermDuration: BlockNumber = 24 * HOURS; + pub const DesiredMembers: u32 = 17; + pub const DesiredRunnersUp: u32 = 7; +} +// Make sure that there are no more than MAX_MEMBERS members elected via phragmen. +const_assert!(DesiredMembers::get() <= pallet_collective::MAX_MEMBERS); +impl darwinia_elections_phragmen::Trait for Runtime { + type Event = Event; + type ModuleId = ElectionsPhragmenModuleId; + type Currency = Ring; + type ChangeMembers = Council; + type InitializeMembers = Council; + type CurrencyToVote = support_kton_in_the_future::CurrencyToVoteHandler; + type CandidacyBond = CandidacyBond; + type VotingBond = VotingBond; + type LoserCandidate = Treasury; + type BadReport = Treasury; + type KickedMember = Treasury; + type DesiredMembers = DesiredMembers; + type DesiredRunnersUp = DesiredRunnersUp; + type TermDuration = TermDuration; + type WeightInfo = (); } type EnsureRootOrHalfCouncil = EnsureOneOf< @@ -346,25 +464,63 @@ impl pallet_membership::Trait for Runtime { type MembershipChanged = TechnicalCommittee; } -impl pallet_utility::Trait for Runtime { +type ApproveOrigin = EnsureOneOf< + AccountId, + EnsureRoot, + pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, +>; +parameter_types! { + pub const TreasuryModuleId: ModuleId = ModuleId(*b"da/trsry"); + pub const ProposalBond: Permill = Permill::from_percent(5); + pub const RingProposalBondMinimum: Balance = 20 * COIN; + pub const KtonProposalBondMinimum: Balance = 20 * COIN; + pub const SpendPeriod: BlockNumber = 6 * DAYS; + pub const Burn: Permill = Permill::from_percent(0); + pub const TipCountdown: BlockNumber = 1 * DAYS; + pub const TipFindersFee: Percent = Percent::from_percent(20); + pub const TipReportDepositBase: Balance = 1 * COIN; + pub const TipReportDepositPerByte: Balance = 1 * MILLI; +} +impl darwinia_treasury::Trait for Runtime { + type ModuleId = TreasuryModuleId; + type RingCurrency = Ring; + type KtonCurrency = Kton; + type ApproveOrigin = ApproveOrigin; + type RejectOrigin = EnsureRootOrHalfCouncil; + type Tippers = ElectionsPhragmen; + type TipCountdown = TipCountdown; + type TipFindersFee = TipFindersFee; + type TipReportDepositBase = TipReportDepositBase; + type TipReportDepositPerByte = TipReportDepositPerByte; type Event = Event; - type Call = Call; + type RingProposalRejection = Treasury; + type KtonProposalRejection = Treasury; + type ProposalBond = ProposalBond; + type RingProposalBondMinimum = RingProposalBondMinimum; + type KtonProposalBondMinimum = KtonProposalBondMinimum; + type SpendPeriod = SpendPeriod; + type Burn = Burn; + type RingBurnDestination = Society; + // TODO + type KtonBurnDestination = (); + type WeightInfo = (); } parameter_types! { - // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. - pub const DepositBase: Balance = deposit(1, 88); - // Additional storage item size of 32 bytes. - pub const DepositFactor: Balance = deposit(0, 32); - pub const MaxSignatories: u16 = 100; + pub const ClaimsModuleId: ModuleId = ModuleId(*b"da/claim"); + pub Prefix: &'static [u8] = b"Pay RINGs to the Crab account:"; } -impl pallet_multisig::Trait for Runtime { +impl darwinia_claims::Trait for Runtime { + type Event = Event; + type ModuleId = ClaimsModuleId; + type Prefix = Prefix; + type RingCurrency = Ring; +} + +impl pallet_utility::Trait for Runtime { type Event = Event; type Call = Call; - type Currency = Ring; - type DepositBase = DepositBase; - type DepositFactor = DepositFactor; - type MaxSignatories = MaxSignatories; + type WeightInfo = (); } parameter_types! { @@ -388,6 +544,7 @@ impl pallet_identity::Trait for Runtime { type Slashed = Treasury; type ForceOrigin = EnsureRootOrHalfCouncil; type RegistrarOrigin = EnsureRootOrHalfCouncil; + type WeightInfo = (); } parameter_types! { @@ -436,8 +593,11 @@ impl pallet_recovery::Trait for Runtime { impl pallet_scheduler::Trait for Runtime { type Event = Event; type Origin = Origin; + type PalletsOrigin = OriginCaller; type Call = Call; type MaximumWeight = MaximumBlockWeight; + type ScheduleOrigin = EnsureRoot; + type WeightInfo = (); } /// The type used to represent the kinds of proxying allowed. @@ -494,7 +654,7 @@ impl InstanceFilter for ProxyType { Call::Scheduler(..) | Call::Proxy(..) | Call::Multisig(..) | - // Call::EthereumBacking(..) | + Call::EthereumBacking(..) | Call::EthereumRelay(..) | Call::RelayerGame(..) | Call::HeaderMMR(..) @@ -532,155 +692,29 @@ impl pallet_proxy::Trait for Runtime { type ProxyDepositBase = ProxyDepositBase; type ProxyDepositFactor = ProxyDepositFactor; type MaxProxies = MaxProxies; -} - -impl pallet_sudo::Trait for Runtime { - type Event = Event; - type Call = Call; -} - -parameter_types! { - pub const RingExistentialDeposit: Balance = 100 * MILLI; - pub const KtonExistentialDeposit: Balance = 10 * MICRO; -} -impl darwinia_balances::Trait for Runtime { - type Balance = Balance; - type DustRemoval = (); - type Event = Event; - type ExistentialDeposit = RingExistentialDeposit; - type BalanceInfo = AccountData; - type AccountStore = System; - type DustCollector = (Kton,); -} -impl darwinia_balances::Trait for Runtime { - type Balance = Balance; - type DustRemoval = (); - type Event = Event; - type ExistentialDeposit = KtonExistentialDeposit; - type BalanceInfo = AccountData; - type AccountStore = System; - type DustCollector = (Ring,); + type WeightInfo = (); } parameter_types! { - pub const SessionsPerEra: SessionIndex = SESSIONS_PER_ERA; - pub const BondingDurationInEra: EraIndex = 14 * DAYS - / (SESSIONS_PER_ERA as BlockNumber * BLOCKS_PER_SESSION); - pub const BondingDurationInBlockNumber: BlockNumber = 14 * DAYS; - pub const SlashDeferDuration: EraIndex = 14 * DAYS - / (SESSIONS_PER_ERA as BlockNumber * BLOCKS_PER_SESSION); - pub const ElectionLookahead: BlockNumber = BLOCKS_PER_SESSION / 4; - pub const MaxIterations: u32 = 5; - pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000); - pub const MaxNominatorRewardedPerValidator: u32 = 64; - pub const StakingUnsignedPriority: TransactionPriority = TransactionPriority::max_value() / 2; - // quarter of the last session will be for election. - pub const Cap: Balance = CAP; - pub const TotalPower: Power = TOTAL_POWER; + // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. + pub const DepositBase: Balance = deposit(1, 88); + // Additional storage item size of 32 bytes. + pub const DepositFactor: Balance = deposit(0, 32); + pub const MaxSignatories: u16 = 100; } -impl darwinia_staking::Trait for Runtime { +impl pallet_multisig::Trait for Runtime { type Event = Event; - type UnixTime = Timestamp; - type SessionsPerEra = SessionsPerEra; - type BondingDurationInEra = BondingDurationInEra; - type BondingDurationInBlockNumber = BondingDurationInBlockNumber; - type SlashDeferDuration = SlashDeferDuration; - /// A super-majority of the council can cancel the slash. - type SlashCancelOrigin = EnsureRootOrHalfCouncil; - type SessionInterface = Self; - type NextNewSession = Session; - type ElectionLookahead = ElectionLookahead; type Call = Call; - type MaxIterations = MaxIterations; - type MinSolutionScoreBump = MinSolutionScoreBump; - type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; - type UnsignedPriority = StakingUnsignedPriority; - type RingCurrency = Ring; - type RingRewardRemainder = Treasury; - type RingSlash = Treasury; - type RingReward = (); - type KtonCurrency = Kton; - type KtonSlash = Treasury; - type KtonReward = (); - type Cap = Cap; - type TotalPower = TotalPower; -} - -parameter_types! { - pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect"; - pub const CandidacyBond: Balance = 1 * COIN; - pub const VotingBond: Balance = 5 * MILLI; - /// Daily council elections. - pub const TermDuration: BlockNumber = 24 * HOURS; - pub const DesiredMembers: u32 = 17; - pub const DesiredRunnersUp: u32 = 7; -} -// Make sure that there are no more than MAX_MEMBERS members elected via phragmen. -const_assert!(DesiredMembers::get() <= pallet_collective::MAX_MEMBERS); -impl darwinia_elections_phragmen::Trait for Runtime { - type Event = Event; - type ModuleId = ElectionsPhragmenModuleId; type Currency = Ring; - type ChangeMembers = Council; - type InitializeMembers = Council; - type CurrencyToVote = support_kton_in_the_future::CurrencyToVoteHandler; - type CandidacyBond = CandidacyBond; - type VotingBond = VotingBond; - type LoserCandidate = Treasury; - type BadReport = Treasury; - type KickedMember = Treasury; - type DesiredMembers = DesiredMembers; - type DesiredRunnersUp = DesiredRunnersUp; - type TermDuration = TermDuration; -} - -type ApproveOrigin = EnsureOneOf< - AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, ->; -parameter_types! { - pub const TreasuryModuleId: ModuleId = ModuleId(*b"da/trsry"); - pub const ProposalBond: Permill = Permill::from_percent(5); - pub const RingProposalBondMinimum: Balance = 20 * COIN; - pub const KtonProposalBondMinimum: Balance = 20 * COIN; - pub const SpendPeriod: BlockNumber = 6 * DAYS; - pub const Burn: Permill = Permill::from_percent(0); - pub const TipCountdown: BlockNumber = 1 * DAYS; - pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: Balance = 1 * COIN; - pub const TipReportDepositPerByte: Balance = 1 * MILLI; -} -impl darwinia_treasury::Trait for Runtime { - type ModuleId = TreasuryModuleId; - type RingCurrency = Ring; - type KtonCurrency = Kton; - type ApproveOrigin = ApproveOrigin; - type RejectOrigin = EnsureRootOrHalfCouncil; - type Tippers = ElectionsPhragmen; - type TipCountdown = TipCountdown; - type TipFindersFee = TipFindersFee; - type TipReportDepositBase = TipReportDepositBase; - type TipReportDepositPerByte = TipReportDepositPerByte; - type Event = Event; - type RingProposalRejection = Treasury; - type KtonProposalRejection = Treasury; - type ProposalBond = ProposalBond; - type RingProposalBondMinimum = RingProposalBondMinimum; - type KtonProposalBondMinimum = KtonProposalBondMinimum; - type SpendPeriod = SpendPeriod; - type Burn = Burn; + type DepositBase = DepositBase; + type DepositFactor = DepositFactor; + type MaxSignatories = MaxSignatories; + type WeightInfo = (); } -parameter_types! { - pub const ClaimsModuleId: ModuleId = ModuleId(*b"da/claim"); - pub Prefix: &'static [u8] = b"Pay RINGs to the Crab account:"; -} -impl darwinia_claims::Trait for Runtime { +impl pallet_sudo::Trait for Runtime { type Event = Event; - type ModuleId = ClaimsModuleId; - type Prefix = Prefix; - type RingCurrency = Ring; + type Call = Call; } parameter_types! { @@ -696,6 +730,7 @@ impl darwinia_ethereum_backing::Trait for Runtime { type RingCurrency = Ring; type KtonCurrency = Kton; type SubKeyPrefix = SubKeyPrefix; + type WeightInfo = (); } parameter_types! { @@ -705,6 +740,7 @@ impl darwinia_ethereum_relay::Trait for Runtime { type ModuleId = EthereumRelayModuleId; type Event = Event; type Currency = Ring; + type WeightInfo = (); } type EthereumRelayerGameInstance = darwinia_relayer_game::Instance0; @@ -720,10 +756,24 @@ impl darwinia_relayer_game::Trait for Runtime { type ConfirmPeriod = ConfirmPeriod; type ApproveOrigin = ApproveOrigin; type RejectOrigin = EnsureRootOrHalfCouncil; + type WeightInfo = (); } impl darwinia_header_mmr::Trait for Runtime {} +pub struct CustomOnRuntimeUpgrade; +impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + darwinia_treasury::Module::::migrate_retract_tip_for_tip_new(); + 500_000_000 + + if pallet_scheduler::Module::::migrate_v1_to_t2() { + ::MaximumBlockWeight::get() + } else { + ::DbWeight::get().reads(1) + 500_000_000 + } + } +} + construct_runtime!( pub enum Runtime where @@ -736,7 +786,7 @@ construct_runtime!( RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Storage}, // Must be before session. - Babe: pallet_babe::{Module, Call, Storage, Config, Inherent(Timestamp)}, + Babe: pallet_babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, Indices: pallet_indices::{Module, Call, Storage, Config, Event}, @@ -748,7 +798,7 @@ construct_runtime!( Historical: pallet_session_historical::{Module}, Session: pallet_session::{Module, Call, Storage, Config, Event}, FinalityTracker: pallet_finality_tracker::{Module, Call, Storage, Inherent}, - Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event}, + Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, ImOnline: pallet_im_online::{Module, Call, Storage, Config, Event, ValidateUnsigned}, AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config}, @@ -832,7 +882,6 @@ where frame_system::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), pallet_transaction_payment::ChargeTransactionPayment::::from(tip), - pallet_grandpa::ValidateEquivocationReport::::new(), ); let raw_payload = SignedPayload::new(call, extra) .map_err(|e| { @@ -919,20 +968,20 @@ impl_runtime_apis! { } impl fg_primitives::GrandpaApi for Runtime { - fn grandpa_authorities() -> Vec<(GrandpaId, u64)> { + fn grandpa_authorities() -> GrandpaAuthorityList { Grandpa::grandpa_authorities() } - fn submit_report_equivocation_extrinsic( + fn submit_report_equivocation_unsigned_extrinsic( equivocation_proof: fg_primitives::EquivocationProof< ::Hash, - sp_runtime::traits::NumberFor, + NumberFor, >, key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof, ) -> Option<()> { let key_owner_proof = key_owner_proof.decode()?; - Grandpa::submit_report_equivocation_extrinsic( + Grandpa::submit_unsigned_equivocation_report( equivocation_proof, key_owner_proof, ) @@ -940,10 +989,8 @@ impl_runtime_apis! { fn generate_key_ownership_proof( _set_id: fg_primitives::SetId, - authority_id: fg_primitives::AuthorityId, + authority_id: GrandpaId, ) -> Option { - use codec::Encode; - Historical::prove((fg_primitives::KEY_TYPE, authority_id)) .map(|p| p.encode()) .map(fg_primitives::OpaqueKeyOwnershipProof::new) @@ -952,7 +999,7 @@ impl_runtime_apis! { impl sp_consensus_babe::BabeApi for Runtime { fn configuration() -> sp_consensus_babe::BabeGenesisConfiguration { - // The choice of `c` parameter (where `1 - c` represents the + // The choice of `c` parameter (where `1 - c` represents the // probability of a slot being empty), is done in accordance to the // slot duration and expected target block time, for safely // resisting network delays of maximum two seconds. @@ -970,8 +1017,28 @@ impl_runtime_apis! { fn current_epoch_start() -> sp_consensus_babe::SlotNumber { Babe::current_epoch_start() } - } + fn generate_key_ownership_proof( + _slot_number: sp_consensus_babe::SlotNumber, + authority_id: sp_consensus_babe::AuthorityId, + ) -> Option { + Historical::prove((sp_consensus_babe::KEY_TYPE, authority_id)) + .map(|p| p.encode()) + .map(sp_consensus_babe::OpaqueKeyOwnershipProof::new) + } + + fn submit_report_equivocation_unsigned_extrinsic( + equivocation_proof: sp_consensus_babe::EquivocationProof<::Header>, + key_owner_proof: sp_consensus_babe::OpaqueKeyOwnershipProof, + ) -> Option<()> { + let key_owner_proof = key_owner_proof.decode()?; + + Babe::submit_unsigned_equivocation_report( + equivocation_proof, + key_owner_proof, + ) + } + } impl sp_authority_discovery::AuthorityDiscoveryApi for Runtime { fn authorities() -> Vec { AuthorityDiscovery::authorities() @@ -1021,6 +1088,15 @@ impl_runtime_apis! { } } + impl darwinia_header_mmr_rpc_runtime_api::HeaderMMRApi for Runtime { + fn gen_proof( + block_number_of_member_leaf: u64, + block_number_of_last_leaf: u64 + ) -> HeaderMMRRuntimeDispatchInfo { + HeaderMMR::gen_proof_rpc(block_number_of_member_leaf, block_number_of_last_leaf ) + } + } + impl darwinia_staking_rpc_runtime_api::StakingApi for Runtime { fn power_of(account: AccountId) -> StakingRuntimeDispatchInfo { Staking::power_of_rpc(account) diff --git a/service/Cargo.toml b/service/Cargo.toml index fe6b4f2e9..4581a39dd 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "darwinia-service" -version = "0.6.5" +version = "0.6.6" authors = ["Darwinia Network "] description = "Darwinia node service" edition = "2018" @@ -13,46 +13,48 @@ repository = "https://github.com/darwinia-network/darwinia/" codec = { package = "parity-scale-codec", version = "1.3.4", features = ["derive"] } futures = { version = "0.3.5" } log = { version = "0.4.11" } -serde = { version = "1.0.114", features = ["derive"] } +serde = { version = "1.0.115", features = ["derive"] } serde_json = { version = "1.0.57" } # substrate primitives -sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-authority-discovery = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-block-builder = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-inherents = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-offchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-session = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sp-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +sp-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-authority-discovery = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-blockchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-block-builder = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-core = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-inherents = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-offchain = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-runtime = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-session = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sp-trie = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # darwinia primitives darwinia-primitives = { path = "../primitives" } # substrate frame -frame-system-rpc-runtime-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-im-online = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -substrate-prometheus-endpoint = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +frame-system-rpc-runtime-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-im-online = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +substrate-prometheus-endpoint = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # darwinia frame array-bytes = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } darwinia-balances-rpc-runtime-api = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } +darwinia-header-mmr-rpc-runtime-api = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } darwinia-staking-rpc-runtime-api = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "master" } # substrate client -sc-authority-discovery = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-basic-authorship = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-chain-spec = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-client-db = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-executor = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-finality-grandpa = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-network = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-service = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-telemetry = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } -sc-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.3" } +sc-authority-discovery = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-basic-authorship = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-chain-spec = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-client-db = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-client-api = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-consensus = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-consensus-babe = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-executor = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-finality-grandpa = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-network = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-service = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-telemetry = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } +sc-transaction-pool = { git = "https://github.com/darwinia-network/substrate.git", tag = "v2.0.0-rc.darwinia.4" } # darwinia runtime crab-runtime = { path = "../runtime/crab" } # darwinia rpc @@ -62,3 +64,4 @@ darwinia-rpc = { path = "../rpc" } default = ["db", "full-node"] db = ["sc-service/db"] full-node = [] +dev = ["crab-runtime/dev"] diff --git a/service/src/chain_spec.rs b/service/src/chain_spec.rs index b2b6de12c..7e2c02cc0 100644 --- a/service/src/chain_spec.rs +++ b/service/src/chain_spec.rs @@ -411,7 +411,6 @@ pub fn crab_testnet_genesis( let endowed_accounts: Vec = endowed_accounts.unwrap_or_else(testnet_accounts); CrabGenesisConfig { - // --- substrate --- frame_system: Some(crab_runtime::SystemConfig { code: crab_runtime::WASM_BINARY.to_vec(), changes_trie_config: Default::default(), @@ -441,7 +440,7 @@ pub fn crab_testnet_genesis( .map(|x| (x.0, x.1, 1 << 60, crab_runtime::StakerStatus::Validator)) .collect(), invulnerables: initial_authorities.iter().cloned().map(|x| x.0).collect(), - force_era: crab_runtime::Forcing::NotForcing, + force_era: crab_runtime::Forcing::ForceAlways, slash_reward_fraction: Perbill::from_percent(10), payout_fraction: Perbill::from_percent(50), ..Default::default() @@ -505,7 +504,12 @@ pub fn crab_development_config() -> CrabChainSpec { crab_testnet_genesis( vec![get_authority_keys_from_seed("Alice")], get_account_id_from_seed::("Alice"), - None, + Some(vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + ]), ) } @@ -531,7 +535,12 @@ pub fn crab_local_testnet_config() -> CrabChainSpec { get_authority_keys_from_seed("Bob"), ], get_account_id_from_seed::("Alice"), - None, + Some(vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + ]), ) } diff --git a/service/src/lib.rs b/service/src/lib.rs index 0754fddc9..018e6baf3 100644 --- a/service/src/lib.rs +++ b/service/src/lib.rs @@ -16,21 +16,36 @@ pub use darwinia_primitives::Block; // --- std --- use std::{sync::Arc, time::Duration}; +// --- crates --- +use futures::stream::StreamExt; // --- substrate --- +use sc_authority_discovery::{AuthorityDiscovery, Role as AuthorityDiscoveryRole}; +use sc_basic_authorship::ProposerFactory; +use sc_client_api::{ExecutorProvider, StateBackendFor}; use sc_consensus::LongestChain; +use sc_consensus_babe::{BabeParams, Config as BabeConfig}; use sc_executor::native_executor_instance; use sc_finality_grandpa::{ - FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState, + Config as GrandpaConfig, FinalityProofProvider as GrandpaFinalityProofProvider, GrandpaParams, + SharedVoterState as GrandpaSharedVoterState, + StorageAndProofProvider as GrandpaStorageAndProofProvider, + VotingRulesBuilder as GrandpaVotingRulesBuilder, }; +use sc_network::Event as NetworkEvent; use sc_service::{ - config::PrometheusConfig, error::Error as ServiceError, AbstractService, Role, ServiceBuilder, - ServiceBuilderCommand, TLightCallExecutor, + config::{KeystoreConfig, PrometheusConfig}, + Error as ServiceError, Role as ServiceRole, ServiceBuilder, ServiceComponents, TaskManager, }; +use sc_transaction_pool::{BasicPool, FullChainApi, LightChainApi}; use sp_api::ConstructRuntimeApi; +use sp_consensus::import_queue::BasicQueue; +use sp_core::traits::BareCryptoStorePtr; +use sp_inherents::InherentDataProviders; use sp_runtime::traits::BlakeTwo256; +use sp_trie::PrefixedMemoryDB; use substrate_prometheus_endpoint::Registry; // --- darwinia --- -use darwinia_primitives::{AccountId, Balance, Nonce, Power}; +use darwinia_primitives::{AccountId, Balance, Hash, Nonce, Power}; native_executor_instance!( pub CrabExecutor, @@ -38,69 +53,12 @@ native_executor_instance!( crab_runtime::native_version, ); -/// A set of APIs that darwinia-like runtimes must implement. -pub trait RuntimeApiCollection: - sp_transaction_pool::runtime_api::TaggedTransactionQueue - + sp_api::ApiExt - + sp_consensus_babe::BabeApi - + sp_block_builder::BlockBuilder - + frame_system_rpc_runtime_api::AccountNonceApi - + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi - + darwinia_balances_rpc_runtime_api::BalancesApi - + darwinia_staking_rpc_runtime_api::StakingApi - + sp_api::Metadata - + sp_offchain::OffchainWorkerApi - + sp_session::SessionKeys - + sp_authority_discovery::AuthorityDiscoveryApi -where - Extrinsic: RuntimeExtrinsic, - >::StateBackend: sp_api::StateBackend, -{ -} - -impl RuntimeApiCollection for Api -where - Api: sp_transaction_pool::runtime_api::TaggedTransactionQueue - + sp_api::ApiExt - + sp_consensus_babe::BabeApi - + sp_block_builder::BlockBuilder - + frame_system_rpc_runtime_api::AccountNonceApi - + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi - + darwinia_balances_rpc_runtime_api::BalancesApi - + darwinia_staking_rpc_runtime_api::StakingApi - + sp_api::Metadata - + sp_offchain::OffchainWorkerApi - + sp_session::SessionKeys - + sp_authority_discovery::AuthorityDiscoveryApi, - Extrinsic: RuntimeExtrinsic, - >::StateBackend: sp_api::StateBackend, -{ -} - -pub trait RuntimeExtrinsic: 'static + Send + Sync + codec::Codec {} - -impl RuntimeExtrinsic for E where E: 'static + Send + Sync + codec::Codec {} - -/// Can be called for a `Configuration` to check if it is a configuration for the `Kusama` network. -pub trait IdentifyVariant { - /// Returns if this is a configuration for the `Crab` network. - fn is_crab(&self) -> bool; -} - -impl IdentifyVariant for Box { - fn is_crab(&self) -> bool { - self.id().starts_with("crab") - } -} - -// If we're using prometheus, use a registry with a prefix of `darwinia`. -fn set_prometheus_registry(config: &mut Configuration) -> Result<(), ServiceError> { - if let Some(PrometheusConfig { registry, .. }) = config.prometheus_config.as_mut() { - *registry = Registry::new_custom(Some("darwinia".into()), None)?; - } - - Ok(()) -} +// TODO: mainnet +// native_executor_instance!( +// pub DarwiniaExecutor, +// darwinia_runtime::api::dispatch, +// darwinia_runtime::native_version, +// ); /// Starts a `ServiceBuilder` for a full service. /// @@ -112,34 +70,35 @@ macro_rules! new_full_start { let mut import_setup = None; let mut rpc_setup = None; - let inherent_data_providers = sp_inherents::InherentDataProviders::new(); - let builder = sc_service::ServiceBuilder::new_full::($config)? + let inherent_data_providers = InherentDataProviders::new(); + let builder = ServiceBuilder::new_full::($config)? .with_select_chain(|_, backend| Ok(sc_consensus::LongestChain::new(backend.clone())))? .with_transaction_pool(|builder| { - let pool_api = sc_transaction_pool::FullChainApi::new(builder.client().clone()); - let pool = sc_transaction_pool::BasicPool::new( + let pool_api = + FullChainApi::new(builder.client().clone(), builder.prometheus_registry()); + let pool = BasicPool::new_full( builder.config().transaction_pool.clone(), - std::sync::Arc::new(pool_api), + Arc::new(pool_api), builder.prometheus_registry(), + builder.spawn_handle(), + builder.client().clone(), ); + Ok(pool) })? .with_import_queue( |_, client, mut select_chain, _, spawn_task_handle, registry| { let select_chain = select_chain .take() - .ok_or_else(|| sc_service::Error::SelectChainRequired)?; - + .ok_or_else(|| ServiceError::SelectChainRequired)?; let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( client.clone(), &(client.clone() as Arc<_>), - select_chain, + select_chain.clone(), )?; - let justification_import = grandpa_block_import.clone(); - let (block_import, babe_link) = sc_consensus_babe::block_import( - sc_consensus_babe::Config::get_or_compute(&*client)?, + BabeConfig::get_or_compute(&*client)?, grandpa_block_import, client.clone(), )?; @@ -150,12 +109,14 @@ macro_rules! new_full_start { Some(Box::new(justification_import)), None, client, + select_chain, inherent_data_providers.clone(), spawn_task_handle, registry, )?; import_setup = Some((block_import, grandpa_link, babe_link)); + Ok(import_queue) }, )? @@ -164,20 +125,17 @@ macro_rules! new_full_start { .as_ref() .map(|s| &s.1) .expect("GRANDPA LinkHalf is present for full services or set up failed; qed."); - let shared_authority_set = grandpa_link.shared_authority_set().clone(); - let shared_voter_state = SharedVoterState::empty(); + let shared_voter_state = GrandpaSharedVoterState::empty(); rpc_setup = Some((shared_voter_state.clone())); let babe_link = import_setup .as_ref() .map(|s| &s.2) - .expect("BabeLink is present for full services or set up faile; qed."); - + .expect("BabeLink is present for full services or set up failed; qed."); let babe_config = babe_link.config().clone(); let shared_epoch_changes = babe_link.epoch_changes().clone(); - let client = builder.client().clone(); let pool = builder.pool().clone(); let select_chain = builder @@ -214,113 +172,108 @@ macro_rules! new_full_start { /// Builds a new service for a full client. #[macro_export] macro_rules! new_full { - ( - $config:expr, - $runtime:ty, - $dispatch:ty - ) => {{ - // --- crates --- - use futures::stream::StreamExt; - // --- substrate --- - use sc_network::Event; - use sc_client_api::ExecutorProvider; - use sp_core::traits::BareCryptoStorePtr; - - let (role, is_authority, force_authoring, name, disable_grandpa) = ( + ($config:expr, $runtime:ty, $dispatch:ty) => {{ + let (role, force_authoring, name, disable_grandpa) = ( $config.role.clone(), - $config.role.is_authority(), $config.force_authoring, $config.network.node_name.clone(), $config.disable_grandpa, - ); - - let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) = new_full_start!($config, $runtime, $dispatch); - - let service = builder + ); + let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) = + new_full_start!($config, $runtime, $dispatch); + let ServiceComponents { + client, + network, + select_chain, + keystore, + transaction_pool, + prometheus_registry, + task_manager, + telemetry_on_connect_sinks, + .. + } = builder .with_finality_proof_provider(|client, backend| { - let provider = client as Arc>; + let provider = client as Arc>; Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _) })? .build_full()?; - - let (block_import, link_half, babe_link) = import_setup.take() - .expect("Link Half and Block Import are present for Full Services or setup failed before. qed"); - - let shared_voter_state = rpc_setup.take() - .expect("The SharedVoterState is present for Full Services or setup failed before. qed"); - - let client = service.client(); - - if is_authority { - let proposer = sc_basic_authorship::ProposerFactory::new( - service.client(), - service.transaction_pool(), - service.prometheus_registry().as_ref(), + let (block_import, link_half, babe_link) = import_setup.take().expect( + "Link Half and Block Import are present for Full Services or setup failed before. qed", + ); + let shared_voter_state = rpc_setup.take().expect( + "The SharedVoterState is present for Full Services or setup failed before. qed", ); - let select_chain = service.select_chain().ok_or(ServiceError::SelectChainRequired)?; + if role.is_authority() { + let select_chain = select_chain.ok_or(ServiceError::SelectChainRequired)?; let can_author_with = sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); - - let babe_config = sc_consensus_babe::BabeParams { - keystore: service.keystore(), + let proposer = ProposerFactory::new( + client.clone(), + transaction_pool, + prometheus_registry.as_ref(), + ); + let babe_config = BabeParams { + keystore: keystore.clone(), client: client.clone(), select_chain, block_import, env: proposer, - sync_oracle: service.network(), + sync_oracle: network.clone(), inherent_data_providers: inherent_data_providers.clone(), force_authoring, babe_link, can_author_with, }; - let babe = sc_consensus_babe::start_babe(babe_config)?; - service.spawn_essential_task_handle().spawn_blocking("babe", babe); - } - if matches!(role, Role::Authority{..} | Role::Sentry{..}) { + task_manager + .spawn_essential_handle() + .spawn_blocking("babe", babe); + } + + if matches!(role, ServiceRole::Authority { .. } | ServiceRole::Sentry { .. }) { let (sentries, authority_discovery_role) = match role { - Role::Authority { ref sentry_nodes } => ( + ServiceRole::Authority { ref sentry_nodes } => ( sentry_nodes.clone(), - sc_authority_discovery::Role::Authority ( - service.keystore(), + AuthorityDiscoveryRole::Authority ( + keystore.clone(), ), ), - Role::Sentry {..} => ( + ServiceRole::Sentry { .. } => ( vec![], - sc_authority_discovery::Role::Sentry, + AuthorityDiscoveryRole::Sentry, ), _ => unreachable!("Due to outer matches! constraint; qed."), }; - let network = service.network(); let network_event_stream = network.event_stream("authority-discovery"); let dht_event_stream = network_event_stream.filter_map(|e| async move { match e { - Event::Dht(e) => Some(e), + NetworkEvent::Dht(e) => Some(e), _ => None, }}).boxed(); - let authority_discovery = sc_authority_discovery::AuthorityDiscovery::new( - service.client(), - network, + let authority_discovery = AuthorityDiscovery::new( + client.clone(), + network.clone(), sentries, dht_event_stream, authority_discovery_role, - service.prometheus_registry(), + prometheus_registry.clone(), ); - service.spawn_task_handle().spawn("authority-discovery", authority_discovery); + task_manager + .spawn_essential_handle() + .spawn_blocking("authority-discovery", authority_discovery); } // if the node isn't actively participating in consensus then it doesn't // need a keystore, regardless of which protocol we use below. - let keystore = if is_authority { - Some(service.keystore() as BareCryptoStorePtr) + let keystore = if role.is_authority() { + Some(keystore.clone() as BareCryptoStorePtr) } else { None - }; - - let config = sc_finality_grandpa::Config { + }; + let grandpa_config = GrandpaConfig { // FIXME substrate#1578 make this available through chainspec gossip_duration: Duration::from_millis(1000), justification_period: 512, @@ -328,50 +281,49 @@ macro_rules! new_full { observer_enabled: false, keystore, is_authority: role.is_network_authority(), - }; - + }; let enable_grandpa = !disable_grandpa; + if enable_grandpa { // start the full GRANDPA voter - // NOTE: unlike in substrate we are currently running the full - // GRANDPA voter protocol for all full nodes (regardless of whether - // they're validators or not). at this point the full voter should - // provide better guarantees of block and vote data availability than - // the observer. - - let grandpa_config = sc_finality_grandpa::GrandpaParams { - config, + // NOTE: non-authorities could run the GRANDPA observer protocol, but at + // this point the full voter should provide better guarantees of block + // and vote data availability than the observer. The observer has not + // been tested extensively yet and having most nodes in a network run it + // could lead to finality stalls. + let grandpa_config = GrandpaParams { + config: grandpa_config, link: link_half, - network: service.network(), + network: network.clone(), inherent_data_providers: inherent_data_providers.clone(), - telemetry_on_connect: Some(service.telemetry_on_connect_stream()), - voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), - prometheus_registry: service.prometheus_registry(), + telemetry_on_connect: Some(telemetry_on_connect_sinks.on_connect_stream()), + voting_rule: GrandpaVotingRulesBuilder::default().build(), + prometheus_registry, shared_voter_state, }; - service.spawn_essential_task_handle().spawn_blocking( + task_manager.spawn_essential_handle().spawn_blocking( "grandpa-voter", - sc_finality_grandpa::run_grandpa_voter(grandpa_config)? + sc_finality_grandpa::run_grandpa_voter(grandpa_config)?, ); } else { sc_finality_grandpa::setup_disabled_grandpa( client.clone(), &inherent_data_providers, - service.network(), + network, )?; - } + } - service + (task_manager, client) }} } /// Builds a new service for a light client. -#[macro_export] macro_rules! new_light { ($config:expr, $runtime:ty, $dispatch:ty) => {{ - crate::set_prometheus_registry(&mut $config)?; - let inherent_data_providers = sp_inherents::InherentDataProviders::new(); + set_prometheus_registry(&mut $config)?; + + let inherent_data_providers = InherentDataProviders::new(); ServiceBuilder::new_light::($config)? .with_select_chain(|_, backend| Ok(LongestChain::new(backend.clone())))? @@ -379,18 +331,21 @@ macro_rules! new_light { let fetcher = builder.fetcher().ok_or_else(|| { "Trying to start light transaction pool without active fetcher" })?; - let pool_api = - sc_transaction_pool::LightChainApi::new(builder.client().clone(), fetcher); - let pool = sc_transaction_pool::BasicPool::with_revalidation_type( + let pool_api = LightChainApi::new(builder.client().clone(), fetcher); + let pool = Arc::new(BasicPool::new_light( builder.config().transaction_pool.clone(), Arc::new(pool_api), builder.prometheus_registry(), - sc_transaction_pool::RevalidationType::Light, - ); + builder.spawn_handle(), + )); + Ok(pool) })? .with_import_queue_and_fprb( - |_, client, backend, fetcher, _, _, spawn_task_handle, registry| { + |_, client, backend, fetcher, mut select_chain, _, spawn_task_handle, registry| { + let select_chain = select_chain + .take() + .ok_or_else(|| ServiceError::SelectChainRequired)?; let fetch_checker = fetcher .map(|fetcher| fetcher.checker().clone()) .ok_or_else(|| { @@ -402,17 +357,14 @@ macro_rules! new_light { &(client.clone() as Arc<_>), Arc::new(fetch_checker), )?; - let finality_proof_import = grandpa_block_import.clone(); let finality_proof_request_builder = finality_proof_import.create_finality_proof_request_builder(); - let (babe_block_import, babe_link) = sc_consensus_babe::block_import( - sc_consensus_babe::Config::get_or_compute(&*client)?, + BabeConfig::get_or_compute(&*client)?, grandpa_block_import, client.clone(), )?; - // FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`. let import_queue = sc_consensus_babe::import_queue( babe_link, @@ -420,6 +372,7 @@ macro_rules! new_light { None, Some(Box::new(finality_proof_import)), client, + select_chain, inherent_data_providers.clone(), spawn_task_handle, registry, @@ -429,11 +382,8 @@ macro_rules! new_light { }, )? .with_finality_proof_provider(|client, backend| { - let provider = - client as Arc>; - Ok(Arc::new(sc_finality_grandpa::FinalityProofProvider::new( - backend, provider, - )) as _) + let provider = client as Arc>; + Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _) })? .with_rpc_extensions(|builder| { let fetcher = builder @@ -442,58 +392,217 @@ macro_rules! new_light { let remote_blockchain = builder .remote_backend() .ok_or_else(|| "Trying to start node RPC without active remote blockchain")?; - let light_deps = darwinia_rpc::LightDeps { remote_blockchain, fetcher, client: builder.client().clone(), pool: builder.pool(), }; + Ok(darwinia_rpc::create_light(light_deps)) })? .build_light() + .map(|ServiceComponents { task_manager, .. }| task_manager) }}; } +/// A set of APIs that polkadot-like runtimes must implement. +pub trait RuntimeApiCollection: + sp_api::ApiExt + + sp_api::Metadata + + sp_authority_discovery::AuthorityDiscoveryApi + + sp_block_builder::BlockBuilder + + sp_consensus_babe::BabeApi + + sp_offchain::OffchainWorkerApi + + sp_session::SessionKeys + + sp_transaction_pool::runtime_api::TaggedTransactionQueue + + frame_system_rpc_runtime_api::AccountNonceApi + + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + + darwinia_balances_rpc_runtime_api::BalancesApi + + darwinia_header_mmr_rpc_runtime_api::HeaderMMRApi + + darwinia_staking_rpc_runtime_api::StakingApi +where + Extrinsic: RuntimeExtrinsic, + >::StateBackend: sp_api::StateBackend, +{ +} +impl RuntimeApiCollection for Api +where + Api: sp_transaction_pool::runtime_api::TaggedTransactionQueue + + sp_api::ApiExt + + sp_api::Metadata + + sp_authority_discovery::AuthorityDiscoveryApi + + sp_block_builder::BlockBuilder + + sp_consensus_babe::BabeApi + + sp_offchain::OffchainWorkerApi + + sp_session::SessionKeys + + frame_system_rpc_runtime_api::AccountNonceApi + + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + + darwinia_balances_rpc_runtime_api::BalancesApi + + darwinia_header_mmr_rpc_runtime_api::HeaderMMRApi + + darwinia_staking_rpc_runtime_api::StakingApi, + Extrinsic: RuntimeExtrinsic, + >::StateBackend: sp_api::StateBackend, +{ +} + +pub trait RuntimeExtrinsic: codec::Codec + Send + Sync + 'static {} +impl RuntimeExtrinsic for E where E: codec::Codec + Send + Sync + 'static {} + +/// Crab client abstraction, this super trait only pulls in functionality required for +/// Crab internal crates like Crab-collator. +pub trait CrabClient: + Sized + + Send + + Sync + + sc_client_api::BlockchainEvents + + sp_api::CallApiAt + + sp_api::ProvideRuntimeApi + + sp_blockchain::HeaderBackend +where + Backend: sc_client_api::Backend, + Block: sp_runtime::traits::Block, + Runtime: sp_api::ConstructRuntimeApi, +{ +} +impl CrabClient for Client +where + Backend: sc_client_api::Backend, + Block: sp_runtime::traits::Block, + Client: Sized + + Send + + Sync + + sp_api::CallApiAt + + sp_api::ProvideRuntimeApi + + sp_blockchain::HeaderBackend + + sc_client_api::BlockchainEvents, + Runtime: sp_api::ConstructRuntimeApi, +{ +} + +// /// Darwinia client abstraction, this super trait only pulls in functionality required for +// /// Darwinia internal crates like Darwinia-collator. +// pub trait DarwiniaClient: +// Sized +// + Send +// + Sync +// + sc_client_api::BlockchainEvents +// + sp_api::CallApiAt +// + sp_api::ProvideRuntimeApi +// + sp_blockchain::HeaderBackend +// where +// Backend: sc_client_api::Backend, +// Block: sp_runtime::traits::Block, +// Runtime: sp_api::ConstructRuntimeApi, +// { +// } +// impl DarwiniaClient for Client +// where +// Backend: sc_client_api::Backend, +// Block: sp_runtime::traits::Block, +// Client: Sized +// + Send +// + Sync +// + sp_api::CallApiAt +// + sp_api::ProvideRuntimeApi +// + sp_blockchain::HeaderBackend +// + sc_client_api::BlockchainEvents, +// Runtime: sp_api::ConstructRuntimeApi, +// { +// } + +/// Can be called for a `Configuration` to check if it is a configuration for the `Crab` network. +pub trait IdentifyVariant { + /// Returns if this is a configuration for the `Crab` network. + fn is_crab(&self) -> bool; + + /// Returns if this is a configuration for the `Darwinia` network. + fn is_darwinia(&self) -> bool; +} +impl IdentifyVariant for Box { + fn is_crab(&self) -> bool { + self.id().starts_with("crab") + } + + fn is_darwinia(&self) -> bool { + self.id().starts_with("darwinia") + } +} + /// Builds a new object suitable for chain operations. pub fn new_chain_ops( mut config: Configuration, -) -> Result, ServiceError> +) -> Result< + ( + Arc>, + Arc>, + BasicQueue>, + TaskManager, + ), + ServiceError, +> where - Runtime: 'static - + Send - + Sync - + ConstructRuntimeApi>, - Runtime::RuntimeApi: RuntimeApiCollection< - Extrinsic, - StateBackend = sc_client_api::StateBackendFor, Block>, - >, + Runtime: + 'static + Send + Sync + ConstructRuntimeApi>, + Runtime::RuntimeApi: + RuntimeApiCollection, Block>>, Dispatch: 'static + NativeExecutionDispatch, Extrinsic: RuntimeExtrinsic, - >::StateBackend: sp_api::StateBackend, { - config.keystore = sc_service::config::KeystoreConfig::InMemory; - Ok(new_full_start!(config, Runtime, Dispatch).0) + config.keystore = KeystoreConfig::InMemory; + + let (builder, _, _, _) = new_full_start!(config, Runtime, Dispatch); + + Ok(builder.to_chain_ops_parts()) } -/// Create a new Crab service for a full node. -#[cfg(feature = "full-node")] -pub fn crab_new_full(mut config: Configuration) -> Result { - Ok(new_full!(config, crab_runtime::RuntimeApi, CrabExecutor)) +// If we're using prometheus, use a registry with a prefix of `darwinia`. +fn set_prometheus_registry(config: &mut Configuration) -> Result<(), ServiceError> { + if let Some(PrometheusConfig { registry, .. }) = config.prometheus_config.as_mut() { + *registry = Registry::new_custom(Some("darwinia".into()), None)?; + } + + Ok(()) } -/// Create a new Crab service for a light client. -pub fn crab_new_light( +/// Create a new Crab service for a full node. +#[cfg(feature = "full-node")] +pub fn crab_new_full( mut config: Configuration, ) -> Result< - impl AbstractService< - Block = Block, - RuntimeApi = crab_runtime::RuntimeApi, - Backend = TLightBackend, - SelectChain = LongestChain, Block>, - CallExecutor = TLightCallExecutor, - >, + ( + TaskManager, + Arc, crab_runtime::RuntimeApi>>, + ), ServiceError, > { + let (components, client) = new_full!(config, crab_runtime::RuntimeApi, CrabExecutor); + + Ok((components, client)) +} + +/// Create a new Crab service for a light client. +pub fn crab_new_light(mut config: Configuration) -> Result { new_light!(config, crab_runtime::RuntimeApi, CrabExecutor) } + +// /// Create a new Darwinia service for a full node. +// #[cfg(feature = "full-node")] +// pub fn darwinia_new_full( +// mut config: Configuration, +// ) -> Result< +// ( +// TaskManager, +// Arc, darwinia_runtime::RuntimeApi>>, +// ), +// ServiceError, +// > { +// let (components, client) = new_full!(config, darwinia_runtime::RuntimeApi, DarwiniaExecutor); + +// Ok((components, client)) +// } + +// /// Create a new Darwinia service for a light client. +// pub fn darwinia_new_light(mut config: Configuration) -> Result { +// new_light!(config, darwinia_runtime::RuntimeApi, DarwiniaExecutor) +// }