From 0fda8f9d44ee163c76a22a9a34eb0112844cd482 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Tue, 27 Aug 2019 14:47:56 +0200 Subject: [PATCH 1/2] Update to latest Substrate --- Cargo.lock | 235 +++++++++-------- cli/src/lib.rs | 39 +-- collator/Cargo.toml | 1 + collator/src/lib.rs | 14 +- service/Cargo.toml | 3 + service/src/lib.rs | 599 ++++++++++++++++++++------------------------ src/main.rs | 4 +- 7 files changed, 441 insertions(+), 454 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b52b978d23bf..fea58a6986be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -819,7 +819,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "fork-tree" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1223,6 +1223,16 @@ dependencies = [ "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "impl-codec" version = "0.4.0" @@ -1292,21 +1302,22 @@ dependencies = [ [[package]] name = "jsonrpc-client-transports" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-pubsub 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-pubsub 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-core" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1318,15 +1329,15 @@ dependencies = [ [[package]] name = "jsonrpc-core-client" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "jsonrpc-client-transports 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-client-transports 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "jsonrpc-derive" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1337,12 +1348,12 @@ dependencies = [ [[package]] name = "jsonrpc-http-server" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hyper 0.12.33 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-server-utils 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-server-utils 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1351,10 +1362,10 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "jsonrpc-core 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1362,12 +1373,12 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1378,15 +1389,15 @@ dependencies = [ [[package]] name = "jsonrpc-ws-server" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "jsonrpc-core 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-server-utils 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-server-utils 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ws 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ws 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2561,6 +2572,11 @@ name = "percent-encoding" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "pin-utils" version = "0.1.0-alpha.4" @@ -2619,6 +2635,7 @@ dependencies = [ "polkadot-network 0.6.0", "polkadot-primitives 0.6.0", "polkadot-runtime 0.6.0", + "polkadot-service 0.6.0", "polkadot-validation 0.6.0", "substrate-client 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-consensus-common 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -2781,13 +2798,16 @@ dependencies = [ "srml-im-online 0.1.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "srml-staking 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-client 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", + "substrate-client-db 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-consensus-babe 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-consensus-babe-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-consensus-common 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", + "substrate-executor 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-finality-grandpa 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-finality-grandpa-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-inherents 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-keystore 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", + "substrate-network 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-service 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-telemetry 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3536,7 +3556,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "sr-api-macros" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3548,7 +3568,7 @@ dependencies = [ [[package]] name = "sr-io" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "environmental 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3565,7 +3585,7 @@ dependencies = [ [[package]] name = "sr-primitives" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3583,7 +3603,7 @@ dependencies = [ [[package]] name = "sr-staking-primitives" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3593,7 +3613,7 @@ dependencies = [ [[package]] name = "sr-std" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3601,7 +3621,7 @@ dependencies = [ [[package]] name = "sr-version" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3613,7 +3633,7 @@ dependencies = [ [[package]] name = "srml-authorship" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3628,7 +3648,7 @@ dependencies = [ [[package]] name = "srml-babe" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3648,7 +3668,7 @@ dependencies = [ [[package]] name = "srml-balances" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3663,7 +3683,7 @@ dependencies = [ [[package]] name = "srml-collective" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3679,7 +3699,7 @@ dependencies = [ [[package]] name = "srml-democracy" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3694,7 +3714,7 @@ dependencies = [ [[package]] name = "srml-elections" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3710,7 +3730,7 @@ dependencies = [ [[package]] name = "srml-executive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3724,7 +3744,7 @@ dependencies = [ [[package]] name = "srml-finality-tracker" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3738,7 +3758,7 @@ dependencies = [ [[package]] name = "srml-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3757,7 +3777,7 @@ dependencies = [ [[package]] name = "srml-im-online" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3775,7 +3795,7 @@ dependencies = [ [[package]] name = "srml-indices" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3792,7 +3812,7 @@ dependencies = [ [[package]] name = "srml-membership" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3806,7 +3826,7 @@ dependencies = [ [[package]] name = "srml-metadata" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3817,7 +3837,7 @@ dependencies = [ [[package]] name = "srml-offences" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3832,7 +3852,7 @@ dependencies = [ [[package]] name = "srml-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3850,7 +3870,7 @@ dependencies = [ [[package]] name = "srml-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3869,7 +3889,7 @@ dependencies = [ [[package]] name = "srml-sudo" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3884,7 +3904,7 @@ dependencies = [ [[package]] name = "srml-support" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "bitmask 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3903,7 +3923,7 @@ dependencies = [ [[package]] name = "srml-support-procedural" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3915,7 +3935,7 @@ dependencies = [ [[package]] name = "srml-support-procedural-tools" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3927,7 +3947,7 @@ dependencies = [ [[package]] name = "srml-support-procedural-tools-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3937,7 +3957,7 @@ dependencies = [ [[package]] name = "srml-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3953,7 +3973,7 @@ dependencies = [ [[package]] name = "srml-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3967,7 +3987,7 @@ dependencies = [ [[package]] name = "srml-treasury" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4053,7 +4073,7 @@ dependencies = [ [[package]] name = "substrate-application-crypto" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4076,7 +4096,7 @@ dependencies = [ [[package]] name = "substrate-cli" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4111,7 +4131,7 @@ dependencies = [ [[package]] name = "substrate-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4139,7 +4159,7 @@ dependencies = [ [[package]] name = "substrate-client-db" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", @@ -4162,7 +4182,7 @@ dependencies = [ [[package]] name = "substrate-consensus-babe" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "fork-tree 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4197,7 +4217,7 @@ dependencies = [ [[package]] name = "substrate-consensus-babe-primitives" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "schnorrkel 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4211,7 +4231,7 @@ dependencies = [ [[package]] name = "substrate-consensus-common" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4230,7 +4250,7 @@ dependencies = [ [[package]] name = "substrate-consensus-slots" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "futures-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4248,7 +4268,7 @@ dependencies = [ [[package]] name = "substrate-consensus-uncles" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4262,7 +4282,7 @@ dependencies = [ [[package]] name = "substrate-executor" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4286,7 +4306,7 @@ dependencies = [ [[package]] name = "substrate-finality-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "finality-grandpa 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "fork-tree 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4306,7 +4326,6 @@ dependencies = [ "substrate-keystore 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-network 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", - "substrate-service 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-telemetry 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4315,7 +4334,7 @@ dependencies = [ [[package]] name = "substrate-finality-grandpa-primitives" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4328,7 +4347,7 @@ dependencies = [ [[package]] name = "substrate-inherents" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4339,7 +4358,7 @@ dependencies = [ [[package]] name = "substrate-keyring" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4351,7 +4370,7 @@ dependencies = [ [[package]] name = "substrate-keystore" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4366,7 +4385,7 @@ dependencies = [ [[package]] name = "substrate-network" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4407,7 +4426,7 @@ dependencies = [ [[package]] name = "substrate-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4432,7 +4451,7 @@ dependencies = [ [[package]] name = "substrate-offchain-primitives" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "sr-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "substrate-client 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4441,7 +4460,7 @@ dependencies = [ [[package]] name = "substrate-panic-handler" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "backtrace 0.3.34 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4450,7 +4469,7 @@ dependencies = [ [[package]] name = "substrate-peerset" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "futures-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4463,7 +4482,7 @@ dependencies = [ [[package]] name = "substrate-primitives" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4474,6 +4493,7 @@ dependencies = [ "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4495,15 +4515,15 @@ dependencies = [ [[package]] name = "substrate-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "futures-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core-client 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-derive 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-pubsub 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core-client 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-derive 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-pubsub 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4524,12 +4544,12 @@ dependencies = [ [[package]] name = "substrate-rpc-servers" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ - "jsonrpc-core 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-http-server 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-pubsub 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-ws-server 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-core 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-http-server 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-pubsub 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-ws-server 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4538,7 +4558,7 @@ dependencies = [ [[package]] name = "substrate-serializer" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4547,7 +4567,7 @@ dependencies = [ [[package]] name = "substrate-service" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "exit-future 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4586,7 +4606,7 @@ dependencies = [ [[package]] name = "substrate-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "sr-primitives 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sr-std 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4597,7 +4617,7 @@ dependencies = [ [[package]] name = "substrate-state-db" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4608,7 +4628,7 @@ dependencies = [ [[package]] name = "substrate-state-machine" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4625,7 +4645,7 @@ dependencies = [ [[package]] name = "substrate-telemetry" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4647,7 +4667,7 @@ dependencies = [ [[package]] name = "substrate-transaction-graph" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-preview 0.3.0-alpha.17 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4661,7 +4681,7 @@ dependencies = [ [[package]] name = "substrate-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4676,7 +4696,7 @@ dependencies = [ [[package]] name = "substrate-trie" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#3e975b30f4d162ac0b42b075ddc41ac537db4774" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#46b63afe5f593f1035bcc0d84e4619826c12881a" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "memory-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5156,6 +5176,16 @@ dependencies = [ "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "url" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "vcpkg" version = "0.2.7" @@ -5408,7 +5438,7 @@ dependencies = [ [[package]] name = "ws" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5420,7 +5450,7 @@ dependencies = [ "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5622,6 +5652,7 @@ dependencies = [ "checksum hyper 0.12.33 (registry+https://github.com/rust-lang/crates.io-index)" = "7cb44cbce9d8ee4fb36e4c0ad7b794ac44ebaad924b9c8291a63215bb44c2c8f" "checksum hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" "checksum impl-codec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "78c441b3d2b5e24b407161e76d482b7bbd29b5da357707839ac40d95152f031f" "checksum impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5158079de9d4158e0ce1de3ae0bd7be03904efc40b3d7dd8b8c301cbf6b52b56" "checksum impl-serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d26be4b97d738552ea423f76c4f681012ff06c3fa36fa968656b3679f60b4a1" @@ -5632,14 +5663,14 @@ dependencies = [ "checksum ipnet 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e61c2da0d0f700c77d2d313dbf4f93e41d235fa12c6681fee06621036df4c2af" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum js-sys 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)" = "da3ea71161651a4cd97d999b2da139109c537b15ab33abc8ae4ead38deac8a03" -"checksum jsonrpc-client-transports 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0bb6fd4acf48d1f17eb7b0e27ab7043c16f063ad0aa7020ec92a431648286c2f" -"checksum jsonrpc-core 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d379861584fe4e3678f6ae9ee60b41726df2989578c1dc0f90190dfc92dbe0" -"checksum jsonrpc-core-client 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6b0a3dc76953d88cdb47f5fe4ae21abcabc8d7edf4951ebce42db5c722d6698" -"checksum jsonrpc-derive 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9e2d4475549bc0126690788ed5107573c8917f97db5298f0043fb73d46fc498" -"checksum jsonrpc-http-server 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad55e8dd67c2c5b16436738b0baf319a6b353feba7401dbc1508a0bd8bd451f" -"checksum jsonrpc-pubsub 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "583f5930821dbc043236fe5d672d496ead7ff83d21351146598386c66fe8722a" -"checksum jsonrpc-server-utils 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04f18ca34046c249751fe90428e77e9570beaa03b33a108e74418a586063d07d" -"checksum jsonrpc-ws-server 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aee1265de937bd53ad0fc95ff5817314922ce009fa99a04a09fdf449b140ddf6" +"checksum jsonrpc-client-transports 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39577db48b004cffb4c5b8e5c9b993c177c52599ecbee88711e815acf65144db" +"checksum jsonrpc-core 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd42951eb35079520ee29b7efbac654d85821b397ef88c8151600ef7e2d00217" +"checksum jsonrpc-core-client 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f047c10738edee7c3c6acf5241a0ce33df32ef9230c1a7fb03e4a77ee72c992f" +"checksum jsonrpc-derive 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29f9149f785deaae92a4c834a9a1a83a4313b8cfedccf15362cd4cf039a64501" +"checksum jsonrpc-http-server 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4edd28922653d79e4f6c0f5d0a1034a4edbc5f9cf6cad8ec85e2a685713e3708" +"checksum jsonrpc-pubsub 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2c08b444cc0ed70263798834343d0ac875e664257df8079160f23ac1ea79446" +"checksum jsonrpc-server-utils 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44561bfdd31401bad790527f1e951dde144f2341ddc3e1b859d32945e1a34eff" +"checksum jsonrpc-ws-server 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d230ff76a8e4a3fb068aab6ba23d0c4e7d6e3b41bca524daa33988b04b065265" "checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=616b40150ded71f57f650067fcbc5c99d7c343e6)" = "" @@ -5746,6 +5777,7 @@ dependencies = [ "checksum pbkdf2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "006c038a43a45995a9670da19e67600114740e8511d4333bf97a56e66a7542d9" "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" "checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" "checksum pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c1d2cfa5a714db3b5f24f0915e74fcdf91d09d496ba61329705dda7774d2af" "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" @@ -5948,6 +5980,7 @@ dependencies = [ "checksum unsigned-varint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2c64cdf40b4a9645534a943668681bcb219faf51874d4b65d2e0abda1b10a2ab" "checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" "checksum vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "33dd455d0f96e90a75803cfeb7f948768c08d70a6de9a8d2362461935698bf95" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6aba5e34f93dc7051dfad05b98a18e9156f27e7b431fe1d2398cb6061c0a1dba" @@ -5977,7 +6010,7 @@ dependencies = [ "checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba" -"checksum ws 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ec91ea61b83ce033c43c06c52ddc7532f465c0153281610d44c58b74083aee1a" +"checksum ws 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a6f5bb86663ff4d1639408410f50bf6050367a8525d644d49a6894cd618a631" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum x25519-dalek 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ee1585dc1484373cbc1cee7aafda26634665cf449436fd6e24bfd1fad230538" "checksum xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 7d47af13089a..f3d707f5242c 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -21,17 +21,15 @@ mod chain_spec; -use std::ops::Deref; use chain_spec::ChainSpec; use futures::Future; use tokio::runtime::Runtime; -use service::{Service as BareService, Error as ServiceError}; use std::sync::Arc; use log::{info, error}; use structopt::StructOpt; pub use service::{ - Components as ServiceComponents, PolkadotService, CustomConfiguration, ServiceFactory, Factory, + AbstractService, CustomConfiguration, ProvideRuntimeApi, CoreApi, ParachainHost, }; @@ -63,7 +61,13 @@ pub trait Worker: IntoExit { fn configuration(&self) -> service::CustomConfiguration { Default::default() } /// Do work and schedule exit. - fn work(self, service: &S, executor: TaskExecutor) -> Self::Work; + fn work(self, service: &S, executor: TaskExecutor) -> Self::Work + where S: AbstractService, + SC: service::SelectChain + 'static, + B: service::Backend + 'static, + CE: service::CallExecutor + Clone + Send + Sync + 'static; } #[derive(Debug, StructOpt, Clone)] @@ -101,23 +105,24 @@ pub fn run(worker: W, version: cli::VersionInfo) -> error::Result<()> where service::Roles::LIGHT => run_until_exit( runtime, - Factory::new_light(config).map_err(|e| format!("{:?}", e))?, + service::new_light(config).map_err(|e| format!("{:?}", e))?, worker ), _ => run_until_exit( runtime, - Factory::new_full(config).map_err(|e| format!("{:?}", e))?, + service::new_full(config).map_err(|e| format!("{:?}", e))?, worker ), }.map_err(|e| format!("{:?}", e)) }), cli::ParseAndPrepare::BuildSpec(cmd) => cmd.run(load_spec), - cli::ParseAndPrepare::ExportBlocks(cmd) => - cmd.run::(load_spec, worker), - cli::ParseAndPrepare::ImportBlocks(cmd) => - cmd.run::(load_spec, worker), + cli::ParseAndPrepare::ExportBlocks(cmd) => cmd.run_with_builder::<(), _, _, _, _, _>(|config| + Ok(service::new_chain_ops(config)?), load_spec, worker), + cli::ParseAndPrepare::ImportBlocks(cmd) => cmd.run_with_builder::<(), _, _, _, _, _>(|config| + Ok(service::new_chain_ops(config)?), load_spec, worker), cli::ParseAndPrepare::PurgeChain(cmd) => cmd.run(load_spec), - cli::ParseAndPrepare::RevertChain(cmd) => cmd.run::(load_spec), + cli::ParseAndPrepare::RevertChain(cmd) => cmd.run_with_builder::<(), _, _, _, _>(|config| + Ok(service::new_chain_ops(config)?), load_spec), cli::ParseAndPrepare::CustomCommand(PolkadotSubCommands::ValidationWorker(args)) => { service::run_validation_worker(&args.mem_id)?; Ok(()) @@ -125,15 +130,17 @@ pub fn run(worker: W, version: cli::VersionInfo) -> error::Result<()> where } } -fn run_until_exit( +fn run_until_exit( mut runtime: Runtime, service: T, worker: W, ) -> error::Result<()> where - T: Deref> + Future + Send + 'static, - C: service::Components, - BareService: PolkadotService, + T: AbstractService, + SC: service::SelectChain + 'static, + B: service::Backend + 'static, + CE: service::CallExecutor + Clone + Send + Sync + 'static, W: Worker, { let (exit_send, exit) = exit_future::signal(); @@ -146,7 +153,7 @@ fn run_until_exit( // but we need to keep holding a reference to the global telemetry guard let _telemetry = service.telemetry(); - let work = worker.work(&*service, Arc::new(executor)); + let work = worker.work(&service, Arc::new(executor)); let service = service.map_err(|err| error!("Error while running Service: {}", err)); let _ = runtime.block_on(service.select(work)); exit_send.fire(); diff --git a/collator/Cargo.toml b/collator/Cargo.toml index b090bdc04a3c..19b79b5755d0 100644 --- a/collator/Cargo.toml +++ b/collator/Cargo.toml @@ -17,6 +17,7 @@ polkadot-primitives = { path = "../primitives" } polkadot-cli = { path = "../cli" } polkadot-network = { path = "../network" } polkadot-validation = { path = "../validation" } +polkadot-service = { path = "../service" } log = "0.4" tokio = "0.1.7" diff --git a/collator/src/lib.rs b/collator/src/lib.rs index 9aad4c0c03ae..f739f3060e0e 100644 --- a/collator/src/lib.rs +++ b/collator/src/lib.rs @@ -62,13 +62,12 @@ use polkadot_primitives::{ } }; use polkadot_cli::{ - Worker, IntoExit, ProvideRuntimeApi, TaskExecutor, PolkadotService, CustomConfiguration, - ParachainHost, + Worker, IntoExit, ProvideRuntimeApi, TaskExecutor, AbstractService, + CustomConfiguration, ParachainHost, }; use polkadot_network::validation::{SessionParams, ValidationNetwork}; -use polkadot_network::NetworkService; +use polkadot_network::{NetworkService, PolkadotProtocol}; use tokio::timer::Timeout; -use consensus_common::SelectChain; pub use polkadot_cli::VersionInfo; pub use polkadot_network::validation::Incoming; @@ -287,8 +286,11 @@ impl Worker for CollationNode where config } - fn work(self, service: &S, task_executor: TaskExecutor) -> Self::Work where - S: PolkadotService, + fn work(self, service: &S, task_executor: TaskExecutor) -> Self::Work + where S: AbstractService, + SC: polkadot_service::SelectChain + 'static, + B: polkadot_service::Backend + 'static, + CE: polkadot_service::CallExecutor + Clone + Send + Sync + 'static { let CollationNode { build_parachain_context, exit, para_id, key } = self; let client = service.client(); diff --git a/service/Cargo.toml b/service/Cargo.toml index 7e5d44726eec..0638b7027675 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -22,6 +22,9 @@ sr-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-ma sr-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } +client-db = { package = "substrate-client-db", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } +substrate-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } +substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } consensus_common = { package = "substrate-consensus-common", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } grandpa = { package = "substrate-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } grandpa_primitives = { package = "substrate-finality-grandpa-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } diff --git a/service/src/lib.rs b/service/src/lib.rs index e16f66035e8e..ca95f6164a2c 100644 --- a/service/src/lib.rs +++ b/service/src/lib.rs @@ -20,83 +20,46 @@ pub mod chain_spec; use futures::prelude::*; use client::LongestChain; -use consensus_common::SelectChain; use std::sync::Arc; use std::time::Duration; -use polkadot_primitives::{parachain, Block, Hash, BlockId}; -use polkadot_runtime::{GenesisConfig, RuntimeApi}; +use polkadot_primitives::{parachain, Hash, BlockId}; +use polkadot_runtime::GenesisConfig; use polkadot_network::{gossip::{self as network_gossip, Known}, validation::ValidationNetwork}; -use service::{ - FactoryFullConfiguration, FullBackend, LightBackend, FullExecutor, LightExecutor, - error::Error as ServiceError, TelemetryOnConnect -}; +use service::{error::{Error as ServiceError}, Configuration, ServiceBuilder}; use transaction_pool::txpool::{Pool as TransactionPool}; -use babe::{import_queue, start_babe, BabeImportQueue, Config}; +use babe::{import_queue, start_babe, Config}; use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}; use inherents::InherentDataProviders; use log::info; -pub use service::{ - Roles, PruningMode, TransactionPoolOptions, ComponentClient, - Error, ComponentBlock, LightComponents, FullComponents, - FullClient, LightClient, Components, Service, ServiceFactory -}; +pub use service::{AbstractService, Roles, PruningMode, TransactionPoolOptions, Error}; +pub use service::{ServiceBuilderExport, ServiceBuilderImport, ServiceBuilderRevert}; pub use service::config::full_version_from_strs; -pub use client::{backend::Backend, runtime_api::Core as CoreApi, ExecutionStrategy}; +pub use client::{backend::Backend, runtime_api::{Core as CoreApi, ConstructRuntimeApi}, ExecutionStrategy, CallExecutor}; +pub use consensus_common::SelectChain; pub use polkadot_network::{PolkadotProtocol, NetworkService}; pub use polkadot_primitives::parachain::{CollatorId, ParachainHost}; +pub use polkadot_primitives::Block; +pub use polkadot_runtime::RuntimeApi; pub use primitives::Blake2Hasher; pub use sr_primitives::traits::ProvideRuntimeApi; +pub use substrate_network::specialization::NetworkSpecialization; pub use chain_spec::ChainSpec; pub use consensus::run_validation_worker; -/// All configuration for the polkadot node. -pub type Configuration = FactoryFullConfiguration; - -type BabeBlockImportForService = babe::BabeBlockImport< - FullBackend, - FullExecutor, - ::Block, - grandpa::BlockImportForService, - ::RuntimeApi, - client::Client< - FullBackend, - FullExecutor, - ::Block, - ::RuntimeApi - >, ->; - /// Polkadot-specific configuration. pub struct CustomConfiguration { /// Set to `Some` with a collator `CollatorId` and desired parachain /// if the network protocol should be started in collator mode. pub collating_for: Option<(CollatorId, parachain::Id)>, - /// Intermediate state during setup. Will be removed in future. Set to `None`. - // FIXME: rather than putting this on the config, let's have an actual intermediate setup state - // https://github.com/paritytech/substrate/issues/1134 - pub import_setup: Option<( - BabeBlockImportForService, - grandpa::LinkHalfForService, - babe::BabeLink, - )>, - - /// Tasks that were created by previous setup steps and should be spawned. - pub tasks_to_spawn: Option + Send>>>, - /// Maximal `block_data` size. pub max_block_data_size: Option, - - inherent_data_providers: InherentDataProviders, } impl Default for CustomConfiguration { fn default() -> Self { Self { collating_for: None, - import_setup: None, - inherent_data_providers: InherentDataProviders::new(), - tasks_to_spawn: None, max_block_data_size: None, } } @@ -108,305 +71,283 @@ pub type TxChainApi = transaction_pool::ChainApi< Block, >; -/// Provides polkadot types. -pub trait PolkadotService { - /// The client's backend type. - type Backend: 'static + client::backend::Backend; - /// The client's call executor type. - type Executor: 'static + client::CallExecutor + Send + Sync + Clone; - - /// Get a handle to the client. - fn client(&self) -> Arc>; - - fn select_chain(&self) -> Option>; - - /// Get a handle to the network. - fn network(&self) -> Arc; - - /// Get a handle to the transaction pool. - fn transaction_pool(&self) -> Arc>>; -} - -impl PolkadotService for Service> { - type Backend = as Components>::Backend; - type Executor = as Components>::Executor; - - fn client(&self) -> Arc> { - Service::client(self) - } - - fn select_chain(&self) -> Option> { - Service::select_chain(self) - } - - fn network(&self) -> Arc { - Service::network(self) - } - - fn transaction_pool(&self) -> Arc>> { - Service::transaction_pool(self) - } -} - -impl PolkadotService for Service> { - type Backend = as Components>::Backend; - type Executor = as Components>::Executor; - - fn client(&self) -> Arc> { - Service::client(self) - } - - fn select_chain(&self) -> Option> { - None - } - - fn network(&self) -> Arc { - Service::network(self) - } - - fn transaction_pool(&self) -> Arc>> { - Service::transaction_pool(self) - } -} - -service::construct_service_factory! { - struct Factory { - Block = Block, - RuntimeApi = RuntimeApi, - NetworkProtocol = PolkadotProtocol { |config: &Configuration| Ok(PolkadotProtocol::new(config.custom.collating_for.clone())) }, - RuntimeDispatch = polkadot_executor::Executor, - FullTransactionPoolApi = transaction_pool::ChainApi, FullExecutor, Block, RuntimeApi>, Block> - { |config, client| Ok(TransactionPool::new(config, transaction_pool::ChainApi::new(client))) }, - LightTransactionPoolApi = transaction_pool::ChainApi, LightExecutor, Block, RuntimeApi>, Block> - { |config, client| Ok(TransactionPool::new(config, transaction_pool::ChainApi::new(client))) }, - Genesis = GenesisConfig, - Configuration = CustomConfiguration, - FullService = FullComponents { |config: FactoryFullConfiguration| FullComponents::::new(config) }, - AuthoritySetup = { - |mut service: Self::FullService| { - let (block_import, link_half, babe_link) = service.config_mut().custom.import_setup.take() - .expect("Link Half and Block Import are present for Full Services or setup failed before. qed"); - - // spawn any futures that were created in the previous setup steps - if let Some(tasks) = service.config_mut().custom.tasks_to_spawn.take() { - for task in tasks { - service.spawn_task( - task.select(service.on_exit()) - .map(|_| ()) - .map_err(|_| ()) - ); - } - } - - if service.config().custom.collating_for.is_some() { - info!( - "The node cannot start as an authority because it is also configured to run as a collator." - ); - return Ok(service); - } - - let client = service.client(); - let known_oracle = client.clone(); - let select_chain = if let Some(select_chain) = service.select_chain() { - select_chain - } else { - info!("The node cannot start as an authority because it can't select chain."); - return Ok(service); - }; - - let gossip_validator_select_chain = select_chain.clone(); - let gossip_validator = network_gossip::register_validator( - service.network(), - move |block_hash: &Hash| { - use client::BlockStatus; - - match known_oracle.block_status(&BlockId::hash(*block_hash)) { - Err(_) | Ok(BlockStatus::Unknown) | Ok(BlockStatus::Queued) => None, - Ok(BlockStatus::KnownBad) => Some(Known::Bad), - Ok(BlockStatus::InChainWithState) | Ok(BlockStatus::InChainPruned) => { - match gossip_validator_select_chain.leaves() { - Err(_) => None, - Ok(leaves) => if leaves.contains(block_hash) { - Some(Known::Leaf) - } else { - Some(Known::Old) - }, - } - } - } - }, - ); - - if service.config().roles.is_authority() { - let extrinsic_store = { - use std::path::PathBuf; - - let mut path = PathBuf::from(service.config().database_path.clone()); - path.push("availability"); - - av_store::Store::new(::av_store::Config { - cache_size: None, - path, - })? - }; - - // collator connections and validation network both fulfilled by this - let validation_network = ValidationNetwork::new( - service.network(), - service.on_exit(), - gossip_validator, - service.client(), - polkadot_network::validation::WrappedExecutor(service.spawn_task_handle()), - ); - let proposer = consensus::ProposerFactory::new( - client.clone(), - select_chain.clone(), - validation_network.clone(), - validation_network, - service.transaction_pool(), - Arc::new(service.spawn_task_handle()), - service.keystore(), - extrinsic_store, - polkadot_runtime::constants::time::SLOT_DURATION, - service.config().custom.max_block_data_size, - ); - - let client = service.client(); - let select_chain = service.select_chain().ok_or(ServiceError::SelectChainRequired)?; - - let babe_config = babe::BabeParams { - config: Config::get_or_compute(&*client)?, - keystore: service.keystore(), - client, - select_chain, - block_import, - env: proposer, - sync_oracle: service.network(), - inherent_data_providers: service.config().custom.inherent_data_providers.clone(), - force_authoring: service.config().force_authoring, - time_source: babe_link, - }; - - let babe = start_babe(babe_config)?; - let select = babe.select(service.on_exit()).then(|_| Ok(())); - service.spawn_essential_task(Box::new(select)); - } else { - network_gossip::register_non_authority_validator(service.network()); - } - - let config = grandpa::Config { - // FIXME substrate#1578 make this available through chainspec - gossip_duration: Duration::from_millis(333), - justification_period: 4096, - name: Some(service.config().name.clone()), - keystore: Some(service.keystore()), - }; - - match (service.config().roles.is_authority(), service.config().disable_grandpa) { - (false, false) => { - // start the lightweight GRANDPA observer - service.spawn_task(Box::new(grandpa::run_grandpa_observer( - config, - link_half, - service.network(), - service.on_exit(), - )?)); - }, - (true, false) => { - // start the full GRANDPA voter - let telemetry_on_connect = TelemetryOnConnect { - telemetry_connection_sinks: service.telemetry_on_connect_stream(), - }; - let grandpa_config = grandpa::GrandpaParams { - config: config, - link: link_half, - network: service.network(), - inherent_data_providers: service.config().custom.inherent_data_providers.clone(), - on_exit: service.on_exit(), - telemetry_on_connect: Some(telemetry_on_connect), - }; - service.spawn_essential_task(Box::new(grandpa::run_grandpa_voter(grandpa_config)?)); - }, - (_, true) => { - grandpa::setup_disabled_grandpa( - service.client(), - &service.config().custom.inherent_data_providers, - service.network(), - )?; - }, - } - - Ok(service) - } - }, - LightService = LightComponents - { |config| >::new(config) }, - FullImportQueue = BabeImportQueue - { | - config: &mut FactoryFullConfiguration, - client: Arc>, - select_chain: Self::SelectChain, - transaction_pool: Option>> - | { +/// Starts a `ServiceBuilder` for a full service. +/// +/// Use this macro if you don't actually need the full service, but just the builder in order to +/// be able to perform chain operations. +macro_rules! new_full_start { + ($config:expr) => {{ + let mut import_setup = None; + let inherent_data_providers = inherents::InherentDataProviders::new(); + let mut tasks_to_spawn = None; + + let builder = service::ServiceBuilder::new_full::< + Block, RuntimeApi, polkadot_executor::Executor + >($config)? + .with_select_chain(|_config, client| { + #[allow(deprecated)] + Ok(client::LongestChain::new(client.backend().clone())) + })? + .with_transaction_pool(|config, client| + Ok(transaction_pool::txpool::Pool::new(config, transaction_pool::ChainApi::new(client))) + )? + .with_import_queue(|_config, client, mut select_chain, transaction_pool| { + let select_chain = select_chain.take() + .ok_or_else(|| service::Error::SelectChainRequired)?; let (block_import, link_half) = - grandpa::block_import::<_, _, _, RuntimeApi, FullClient, _>( + grandpa::block_import::<_, _, _, RuntimeApi, _, _>( client.clone(), client.clone(), select_chain )?; let justification_import = block_import.clone(); - let (import_queue, babe_link, babe_block_import, pruning_task) = import_queue( - Config::get_or_compute(&*client)?, + let (import_queue, babe_link, babe_block_import, pruning_task) = babe::import_queue( + babe::Config::get_or_compute(&*client)?, block_import, Some(Box::new(justification_import)), None, client.clone(), client, - config.custom.inherent_data_providers.clone(), - transaction_pool, + inherent_data_providers.clone(), + Some(transaction_pool) )?; - config.custom.import_setup = Some((babe_block_import.clone(), link_half, babe_link)); - config.custom.tasks_to_spawn = Some(vec![Box::new(pruning_task)]); + import_setup = Some((babe_block_import.clone(), link_half, babe_link)); + tasks_to_spawn = Some(vec![Box::new(pruning_task)]); Ok(import_queue) - }}, - LightImportQueue = BabeImportQueue - { |config: &FactoryFullConfiguration, client: Arc>| { - #[allow(deprecated)] - let fetch_checker = client.backend().blockchain().fetcher() - .upgrade() - .map(|fetcher| fetcher.checker().clone()) - .ok_or_else(|| "Trying to start light import queue without active fetch checker")?; - let block_import = grandpa::light_block_import::<_, _, _, RuntimeApi, LightClient>( - client.clone(), Arc::new(fetch_checker), client.clone() - )?; + })?; + + (builder, import_setup, inherent_data_providers, tasks_to_spawn) + }} +} - let finality_proof_import = block_import.clone(); - let finality_proof_request_builder = finality_proof_import.create_finality_proof_request_builder(); +/// Builds a new object suitable for chain operations. +pub fn new_chain_ops(config: Configuration) + -> Result +{ + Ok(new_full_start!(config).0) +} - // FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`. - let (import_queue, ..) = import_queue::<_, _, _, _, _, _, TransactionPool>( - Config::get_or_compute(&*client)?, - block_import, - None, - Some(Box::new(finality_proof_import)), - client.clone(), - client, - config.custom.inherent_data_providers.clone(), - None, - )?; +/// Builds a new service for a full client. +pub fn new_full(config: Configuration) + -> Result + 'static, + SelectChain = impl SelectChain, + CallExecutor = impl CallExecutor + Clone + Send + Sync + 'static, + >, ServiceError> +{ + let (builder, mut import_setup, inherent_data_providers, mut tasks_to_spawn) = new_full_start!(config); + + let service = builder + .with_network_protocol(|config| Ok(PolkadotProtocol::new(config.custom.collating_for.clone())))? + .with_finality_proof_provider(|client| + Ok(Arc::new(GrandpaFinalityProofProvider::new(client.clone(), client)) as _) + )? + .build()?; + + 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"); + + // spawn any futures that were created in the previous setup steps + if let Some(tasks) = tasks_to_spawn.take() { + for task in tasks { + service.spawn_task( + task.select(service.on_exit()) + .map(|_| ()) + .map_err(|_| ()) + ); + } + } - Ok((import_queue, finality_proof_request_builder)) - }}, - SelectChain = LongestChain, Self::Block> - { |config: &FactoryFullConfiguration, client: Arc>| { - #[allow(deprecated)] - Ok(LongestChain::new(client.backend().clone())) + if service.config().custom.collating_for.is_some() { + info!( + "The node cannot start as an authority because it is also configured to run as a collator." + ); + return Ok(service); + } + + let client = service.client(); + let known_oracle = client.clone(); + let select_chain = if let Some(select_chain) = service.select_chain() { + select_chain + } else { + info!("The node cannot start as an authority because it can't select chain."); + return Ok(service); + }; + + let gossip_validator_select_chain = select_chain.clone(); + let gossip_validator = network_gossip::register_validator( + service.network(), + move |block_hash: &Hash| { + use client::BlockStatus; + + match known_oracle.block_status(&BlockId::hash(*block_hash)) { + Err(_) | Ok(BlockStatus::Unknown) | Ok(BlockStatus::Queued) => None, + Ok(BlockStatus::KnownBad) => Some(Known::Bad), + Ok(BlockStatus::InChainWithState) | Ok(BlockStatus::InChainPruned) => { + match gossip_validator_select_chain.leaves() { + Err(_) => None, + Ok(leaves) => if leaves.contains(block_hash) { + Some(Known::Leaf) + } else { + Some(Known::Old) + }, + } + } } }, - FinalityProofProvider = { |client: Arc>| { - Ok(Some(Arc::new(GrandpaFinalityProofProvider::new(client.clone(), client)) as _)) - }}, - RpcExtensions = (), + ); + + if service.config().roles.is_authority() { + let extrinsic_store = { + use std::path::PathBuf; + + let mut path = PathBuf::from(service.config().database_path.clone()); + path.push("availability"); + + av_store::Store::new(::av_store::Config { + cache_size: None, + path, + })? + }; + + // collator connections and validation network both fulfilled by this + let validation_network = ValidationNetwork::new( + service.network(), + service.on_exit(), + gossip_validator, + service.client(), + polkadot_network::validation::WrappedExecutor(service.spawn_task_handle()), + ); + let proposer = consensus::ProposerFactory::new( + client.clone(), + select_chain.clone(), + validation_network.clone(), + validation_network, + service.transaction_pool(), + Arc::new(service.spawn_task_handle()), + service.keystore(), + extrinsic_store, + polkadot_runtime::constants::time::SLOT_DURATION, + service.config().custom.max_block_data_size, + ); + + let client = service.client(); + let select_chain = service.select_chain().ok_or(ServiceError::SelectChainRequired)?; + + let babe_config = babe::BabeParams { + config: Config::get_or_compute(&*client)?, + keystore: service.keystore(), + client, + select_chain, + block_import, + env: proposer, + sync_oracle: service.network(), + inherent_data_providers: inherent_data_providers.clone(), + force_authoring: service.config().force_authoring, + time_source: babe_link, + }; + + let babe = start_babe(babe_config)?; + let select = babe.select(service.on_exit()).then(|_| Ok(())); + service.spawn_essential_task(Box::new(select)); + } else { + network_gossip::register_non_authority_validator(service.network()); } + + let config = grandpa::Config { + // FIXME substrate#1578 make this available through chainspec + gossip_duration: Duration::from_millis(333), + justification_period: 4096, + name: Some(service.config().name.clone()), + keystore: Some(service.keystore()), + }; + + match (service.config().roles.is_authority(), service.config().disable_grandpa) { + (false, false) => { + // start the lightweight GRANDPA observer + service.spawn_task(Box::new(grandpa::run_grandpa_observer( + config, + link_half, + service.network(), + service.on_exit(), + )?)); + }, + (true, false) => { + // start the full GRANDPA voter + let grandpa_config = grandpa::GrandpaParams { + config: config, + link: link_half, + network: service.network(), + inherent_data_providers: inherent_data_providers.clone(), + on_exit: service.on_exit(), + telemetry_on_connect: Some(service.telemetry_on_connect_stream()), + }; + service.spawn_essential_task(Box::new(grandpa::run_grandpa_voter(grandpa_config)?)); + }, + (_, true) => { + grandpa::setup_disabled_grandpa( + service.client(), + &inherent_data_providers, + service.network(), + )?; + }, + } + + Ok(service) +} + +/// Builds a new service for a light client. +pub fn new_light(config: Configuration) + -> Result + 'static, + SelectChain = impl SelectChain, + CallExecutor = impl CallExecutor + Clone + Send + Sync + 'static, + >, ServiceError> +{ + let inherent_data_providers = InherentDataProviders::new(); + + ServiceBuilder::new_light::(config)? + .with_select_chain(|_config, client| { + #[allow(deprecated)] + Ok(LongestChain::new(client.backend().clone())) + })? + .with_transaction_pool(|config, client| + Ok(TransactionPool::new(config, transaction_pool::ChainApi::new(client))) + )? + .with_import_queue_and_fprb(|_config, client, _select_chain, transaction_pool| { + #[allow(deprecated)] + let fetch_checker = client.backend().blockchain().fetcher() + .upgrade() + .map(|fetcher| fetcher.checker().clone()) + .ok_or_else(|| "Trying to start light import queue without active fetch checker")?; + let block_import = grandpa::light_block_import::<_, _, _, RuntimeApi, _>( + client.clone(), Arc::new(fetch_checker), client.clone() + )?; + + let finality_proof_import = block_import.clone(); + let finality_proof_request_builder = + finality_proof_import.create_finality_proof_request_builder(); + + // FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`. + let (import_queue, ..) = import_queue( + Config::get_or_compute(&*client)?, + block_import, + None, + Some(Box::new(finality_proof_import)), + client.clone(), + client, + inherent_data_providers.clone(), + Some(transaction_pool) + )?; + + Ok((import_queue, finality_proof_request_builder)) + })? + .with_network_protocol(|config| Ok(PolkadotProtocol::new(config.custom.collating_for.clone())))? + .with_finality_proof_provider(|client| + Ok(Arc::new(GrandpaFinalityProofProvider::new(client.clone(), client)) as _) + )? + .build() } diff --git a/src/main.rs b/src/main.rs index 480d30fcfd5e..ba3533d25f65 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,7 +18,7 @@ #![warn(missing_docs)] -use cli::{PolkadotService, VersionInfo, TaskExecutor}; +use cli::{AbstractService, VersionInfo, TaskExecutor}; use futures::sync::oneshot; use futures::{future, Future}; @@ -45,7 +45,7 @@ impl cli::IntoExit for Worker { impl cli::Worker for Worker { type Work = ::Exit; - fn work(self, _service: &S, _: TaskExecutor) -> Self::Work { + fn work(self, _service: &S, _: TaskExecutor) -> Self::Work { use cli::IntoExit; self.into_exit() } From cb60cfc7bf9f60253394a2b73a958913fbe7b572 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Tue, 27 Aug 2019 15:42:30 +0200 Subject: [PATCH 2/2] Fix main.rs --- Cargo.lock | 1 + Cargo.toml | 1 + src/main.rs | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index fea58a6986be..52aa4fc23fde 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2594,6 +2594,7 @@ dependencies = [ "ctrlc 3.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "polkadot-cli 0.6.0", + "polkadot-service 0.6.0", "vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/Cargo.toml b/Cargo.toml index 6b6d12f48ee4..58c207316a7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ edition = "2018" cli = { package = "polkadot-cli", path = "cli" } futures = "0.1" ctrlc = { version = "3.0", features = ["termination"] } +service = { package = "polkadot-service", path = "service" } [build-dependencies] vergen = "3" diff --git a/src/main.rs b/src/main.rs index ba3533d25f65..1cee21ae15a9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,7 +45,13 @@ impl cli::IntoExit for Worker { impl cli::Worker for Worker { type Work = ::Exit; - fn work(self, _service: &S, _: TaskExecutor) -> Self::Work { + fn work(self, _: &S, _: TaskExecutor) -> Self::Work + where S: AbstractService, + SC: service::SelectChain + 'static, + B: service::Backend + 'static, + CE: service::CallExecutor + Clone + Send + Sync + 'static { use cli::IntoExit; self.into_exit() }