diff --git a/Cargo.lock b/Cargo.lock index 243f5f1e..b0a29690 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -456,7 +456,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "beefy-primitives", "fnv", @@ -484,7 +484,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -504,12 +504,12 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "scale-info", @@ -1956,7 +1956,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", ] @@ -1974,7 +1974,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -1994,7 +1994,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "Inflector", "chrono", @@ -2020,7 +2020,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -2034,7 +2034,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -2062,7 +2062,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "bitflags", "frame-metadata", @@ -2077,6 +2077,7 @@ dependencies = [ "smallvec 1.7.0", "sp-arithmetic", "sp-core", + "sp-core-hashing-proc-macro", "sp-inherents", "sp-io", "sp-runtime", @@ -2090,7 +2091,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2102,7 +2103,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.1.0", @@ -2114,7 +2115,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "proc-macro2", "quote", @@ -2124,7 +2125,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "log", @@ -2141,7 +2142,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-benchmarking", "frame-support", @@ -2156,7 +2157,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "sp-api", @@ -2165,7 +2166,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "sp-api", @@ -4248,6 +4249,7 @@ dependencies = [ "polkadot-client", "sc-client-api", "sc-consensus", + "sc-consensus-manual-seal", "sp-api", "sp-application-crypto", "sp-block-builder", @@ -4257,7 +4259,6 @@ dependencies = [ "sp-inherents", "sp-keystore", "sp-runtime", - "sp-std", "substrate-prometheus-endpoint", "tracing", ] @@ -4500,7 +4501,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4516,7 +4517,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4531,7 +4532,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4555,7 +4556,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4570,7 +4571,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4585,7 +4586,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "beefy-primitives", "frame-support", @@ -4601,7 +4602,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -4626,7 +4627,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4663,7 +4664,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4680,7 +4681,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4696,7 +4697,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4716,7 +4717,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4733,7 +4734,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4756,7 +4757,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4772,7 +4773,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4791,7 +4792,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4807,7 +4808,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4824,7 +4825,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -4842,7 +4843,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4858,7 +4859,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4875,7 +4876,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4889,7 +4890,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4903,7 +4904,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4920,7 +4921,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4934,7 +4935,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4948,7 +4949,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-benchmarking", "frame-support", @@ -4964,7 +4965,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -4985,7 +4986,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-election-provider-support", "frame-support", @@ -5006,7 +5007,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -5017,7 +5018,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -5046,7 +5047,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5064,7 +5065,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -5082,7 +5083,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -5099,7 +5100,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5116,7 +5117,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5127,7 +5128,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -5143,7 +5144,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -5158,7 +5159,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-support", "frame-system", @@ -5232,6 +5233,7 @@ dependencies = [ "sc-cli", "sc-client-api", "sc-consensus", + "sc-consensus-manual-seal", "sc-executor", "sc-keystore", "sc-network", @@ -7343,7 +7345,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "env_logger 0.9.0", "jsonrpsee-proc-macros", @@ -7536,7 +7538,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "log", "sp-core", @@ -7547,7 +7549,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "derive_more", @@ -7574,7 +7576,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "futures 0.3.17", "futures-timer 3.0.2", @@ -7597,7 +7599,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7613,7 +7615,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -7630,7 +7632,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -7641,7 +7643,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "chrono", "fdlimit", @@ -7679,7 +7681,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "fnv", "futures 0.3.17", @@ -7707,7 +7709,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "hash-db", "kvdb", @@ -7732,7 +7734,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "futures 0.3.17", @@ -7756,7 +7758,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "derive_more", @@ -7799,7 +7801,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "derive_more", "futures 0.3.17", @@ -7823,7 +7825,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7833,10 +7835,44 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "sc-consensus-manual-seal" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" +dependencies = [ + "assert_matches", + "async-trait", + "derive_more", + "futures 0.3.17", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-transaction-pool", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-timestamp", + "substrate-prometheus-endpoint", +] + [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "futures 0.3.17", @@ -7862,7 +7898,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "sc-client-api", "sp-authorship", @@ -7873,7 +7909,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "lazy_static", "libsecp256k1 0.6.0", @@ -7885,6 +7921,7 @@ dependencies = [ "sc-executor-wasmtime", "sp-api", "sp-core", + "sp-core-hashing-proc-macro", "sp-externalities", "sp-io", "sp-panic-handler", @@ -7899,7 +7936,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "derive_more", "environmental", @@ -7917,7 +7954,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "log", "parity-scale-codec", @@ -7933,7 +7970,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "cfg-if 1.0.0", "libc", @@ -7951,7 +7988,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "derive_more", @@ -7988,7 +8025,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "derive_more", "finality-grandpa", @@ -8012,7 +8049,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "ansi_term 0.12.1", "futures 0.3.17", @@ -8029,7 +8066,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "derive_more", @@ -8044,7 +8081,7 @@ dependencies = [ [[package]] name = "sc-light" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "hash-db", "parity-scale-codec", @@ -8062,7 +8099,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-std", "async-trait", @@ -8113,7 +8150,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "futures 0.3.17", "futures-timer 3.0.2", @@ -8129,7 +8166,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "bytes 1.1.0", "fnv", @@ -8157,7 +8194,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "futures 0.3.17", "libp2p", @@ -8170,7 +8207,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8179,7 +8216,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "futures 0.3.17", "hash-db", @@ -8210,7 +8247,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "futures 0.3.17", "jsonrpc-core", @@ -8235,7 +8272,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "futures 0.3.17", "jsonrpc-core", @@ -8252,7 +8289,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "directories", @@ -8316,7 +8353,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "log", "parity-scale-codec", @@ -8330,7 +8367,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -8352,7 +8389,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "chrono", "futures 0.3.17", @@ -8370,7 +8407,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "ansi_term 0.12.1", "atty", @@ -8401,7 +8438,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -8412,7 +8449,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "futures 0.3.17", "intervalier", @@ -8439,7 +8476,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "derive_more", "futures 0.3.17", @@ -8453,7 +8490,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "futures 0.3.17", "futures-timer 3.0.2", @@ -8878,7 +8915,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "hash-db", "log", @@ -8895,7 +8932,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "blake2-rfc", "proc-macro-crate 1.1.0", @@ -8907,7 +8944,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "scale-info", @@ -8920,7 +8957,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "integer-sqrt", "num-traits", @@ -8935,7 +8972,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "scale-info", @@ -8948,7 +8985,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "parity-scale-codec", @@ -8960,7 +8997,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "sp-api", @@ -8972,7 +9009,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "futures 0.3.17", "log", @@ -8990,7 +9027,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "futures 0.3.17", @@ -9009,7 +9046,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "merlin", @@ -9032,7 +9069,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "scale-info", @@ -9043,7 +9080,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9055,7 +9092,7 @@ dependencies = [ [[package]] name = "sp-core" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "base58", "bitflags", @@ -9084,6 +9121,7 @@ dependencies = [ "secrecy", "serde", "sha2 0.9.8", + "sp-core-hashing", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", @@ -9099,10 +9137,34 @@ dependencies = [ "zeroize", ] +[[package]] +name = "sp-core-hashing" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" +dependencies = [ + "blake2-rfc", + "byteorder", + "sha2 0.9.8", + "sp-std", + "tiny-keccak", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" +dependencies = [ + "proc-macro2", + "quote", + "sp-core-hashing", + "syn", +] + [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "kvdb", "parking_lot 0.11.2", @@ -9111,7 +9173,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "proc-macro2", "quote", @@ -9121,7 +9183,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "environmental", "parity-scale-codec", @@ -9132,7 +9194,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "finality-grandpa", "log", @@ -9150,7 +9212,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9164,7 +9226,7 @@ dependencies = [ [[package]] name = "sp-io" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "futures 0.3.17", "hash-db", @@ -9188,7 +9250,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "lazy_static", "sp-core", @@ -9199,7 +9261,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "derive_more", @@ -9216,7 +9278,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "zstd", ] @@ -9224,7 +9286,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "scale-info", @@ -9239,7 +9301,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -9250,7 +9312,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "sp-api", "sp-core", @@ -9260,7 +9322,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "backtrace", "lazy_static", @@ -9270,7 +9332,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "rustc-hash", "serde", @@ -9280,7 +9342,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "either", "hash256-std-hasher", @@ -9302,7 +9364,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9319,7 +9381,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "Inflector", "proc-macro-crate 1.1.0", @@ -9331,7 +9393,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "serde", "serde_json", @@ -9340,7 +9402,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "scale-info", @@ -9354,7 +9416,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "scale-info", @@ -9365,7 +9427,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "hash-db", "log", @@ -9388,12 +9450,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" [[package]] name = "sp-storage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9406,7 +9468,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "log", "sp-core", @@ -9419,7 +9481,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "futures-timer 3.0.2", @@ -9435,7 +9497,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "sp-std", @@ -9447,7 +9509,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "sp-api", "sp-runtime", @@ -9456,7 +9518,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "log", @@ -9472,7 +9534,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "hash-db", "memory-db", @@ -9487,7 +9549,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9503,7 +9565,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -9514,7 +9576,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9680,7 +9742,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "platforms", ] @@ -9688,7 +9750,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.17", @@ -9710,7 +9772,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-std", "derive_more", @@ -9724,7 +9786,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "async-trait", "futures 0.3.17", @@ -9751,7 +9813,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "ansi_term 0.12.1", "build-helper", @@ -10107,7 +10169,7 @@ dependencies = [ "chrono", "lazy_static", "matchers", - "parking_lot 0.11.2", + "parking_lot 0.9.0", "regex", "serde", "serde_json", @@ -10194,7 +10256,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4b40c2aa05930a0aae5a7eb0c50a596a44eb6fb1" +source = "git+https://github.com/paritytech/substrate?branch=master#635c187e8f92a239772ffd70d7a445e073f8920f" dependencies = [ "jsonrpsee-ws-client", "log", diff --git a/nimbus-consensus/Cargo.toml b/nimbus-consensus/Cargo.toml index eb526ac8..964e05db 100644 --- a/nimbus-consensus/Cargo.toml +++ b/nimbus-consensus/Cargo.toml @@ -15,10 +15,10 @@ sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = " sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "master" } substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "master" } # Polkadot dependencies polkadot-client = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false } diff --git a/nimbus-consensus/src/import_queue.rs b/nimbus-consensus/src/import_queue.rs index 18a42875..72423405 100644 --- a/nimbus-consensus/src/import_queue.rs +++ b/nimbus-consensus/src/import_queue.rs @@ -32,7 +32,7 @@ use sp_runtime::{ traits::{Block as BlockT, Header as HeaderT}, DigestItem, }; -use nimbus_primitives::{NimbusId, NimbusPair, digests::CompatibleDigestItem}; +use nimbus_primitives::{NimbusId, NimbusPair, digests::CompatibleDigestItem, NIMBUS_ENGINE_ID}; use sp_application_crypto::{Pair as _, Public as _}; use log::debug; @@ -76,24 +76,20 @@ where debug!(target: crate::LOG_TARGET, "🪲 Signature according to verifier is {:?}", signature); - // Grab the digest from the runtime - //TODO use the trait. Maybe this code should move to the trait. - let consensus_digest = block_params.header + // Grab the author information from either the preruntime digest or the consensus digest + //TODO use the trait + let claimed_author = block_params.header .digest() .logs .iter() - .find(|digest| { + .find_map(|digest| { match *digest { - DigestItem::Consensus(id, _) if id == b"nmbs" => true, - _ => false, + DigestItem::Consensus(id, ref author_id) if id == NIMBUS_ENGINE_ID => Some(author_id.clone()), + DigestItem::PreRuntime(id, ref author_id) if id == NIMBUS_ENGINE_ID => Some(author_id.clone()), + _ => None, } }) - .expect("A single consensus digest should be added by the runtime when executing the author inherent."); - - let claimed_author = match *consensus_digest { - DigestItem::Consensus(id, ref author_id) if id == *b"nmbs" => author_id.clone(), - _ => panic!("Expected consensus digest to contains author id bytes"), - }; + .expect("Expected one consensus or pre-runtime digest that contains author id bytes"); debug!(target: crate::LOG_TARGET, "🪲 Claimed Author according to verifier is {:?}", claimed_author); @@ -152,6 +148,9 @@ where block_params.post_digests.push(seal); + // The standard is to use the longest chain rule. This is overridden by the `NimbusBlockImport` in the parachain context. + block_params.fork_choice = Some(sc_consensus::ForkChoiceStrategy::LongestChain); + debug!(target: crate::LOG_TARGET, "🪲 Just finished verifier. posthash from params is {:?}", &block_params.post_hash()); Ok((block_params, None)) @@ -165,6 +164,7 @@ pub fn import_queue( create_inherent_data_providers: CIDP, spawner: &impl sp_core::traits::SpawnEssentialNamed, registry: Option<&substrate_prometheus_endpoint::Registry>, + parachain: bool, ) -> ClientResult> where I: BlockImport + Send + Sync + 'static, @@ -181,11 +181,70 @@ where Ok(BasicQueue::new( verifier, - Box::new(cumulus_client_consensus_common::ParachainBlockImport::new( + Box::new(NimbusBlockImport::new( block_import, + parachain, )), None, spawner, registry, )) } + +/// Nimbus specific block import. +/// +/// Nimbus supports both parachain and non-parachain contexts. In the parachain +/// context, new blocks should not be imported as best. Cumulus's ParachainBlockImport +/// handles this correctly, but does not work in non-parachain contexts. +/// This block import has a field indicating whether we should apply parachain rules or not. +/// +/// There may be additional nimbus-specific logic here in the future, but for now it is +/// only the conditional parachain logic +pub struct NimbusBlockImport{ + inner: I, + parachain_context: bool, +} + +impl NimbusBlockImport { + /// Create a new instance. + pub fn new(inner: I, parachain_context: bool) -> Self { + Self{ + inner, + parachain_context, + } + } +} + +#[async_trait::async_trait] +impl BlockImport for NimbusBlockImport +where + Block: BlockT, + I: BlockImport + Send, +{ + type Error = I::Error; + type Transaction = I::Transaction; + + async fn check_block( + &mut self, + block: sc_consensus::BlockCheckParams, + ) -> Result { + self.inner.check_block(block).await + } + + async fn import_block( + &mut self, + mut block_import_params: sc_consensus::BlockImportParams, + cache: std::collections::HashMap>, + ) -> Result { + // If we are in the parachain context, best block is determined by the relay chain + // except during initial sync + if self.parachain_context { + block_import_params.fork_choice = Some(sc_consensus::ForkChoiceStrategy::Custom( + block_import_params.origin == sp_consensus::BlockOrigin::NetworkInitialSync, + )); + } + + // Now continue on to the rest of the import pipeline. + self.inner.import_block(block_import_params, cache).await + } +} \ No newline at end of file diff --git a/nimbus-consensus/src/lib.rs b/nimbus-consensus/src/lib.rs index 413751dd..f66b6e7b 100644 --- a/nimbus-consensus/src/lib.rs +++ b/nimbus-consensus/src/lib.rs @@ -32,21 +32,24 @@ use log::{info, warn, debug}; use parking_lot::Mutex; use polkadot_client::ClientHandle; use sc_client_api::Backend; -use sp_api::{ProvideRuntimeApi, BlockId, ApiExt as _}; +use sp_api::{ProvideRuntimeApi, BlockId, ApiExt}; +use sp_application_crypto::CryptoTypePublicPair; use sp_consensus::{ BlockOrigin, EnableProofRecording, Environment, ProofRecording, Proposal, Proposer, }; use sc_consensus::{BlockImport, BlockImportParams}; use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider}; -use sp_runtime::traits::{Block as BlockT, HashFor, Header as HeaderT}; +use sp_runtime::traits::{Block as BlockT, HashFor, Header as HeaderT, DigestItemFor}; use std::{marker::PhantomData, sync::Arc, time::Duration}; use tracing::error; use sp_keystore::{SyncCryptoStorePtr, SyncCryptoStore}; use sp_core::crypto::Public; -use sp_std::convert::TryInto; -use nimbus_primitives::{AuthorFilterAPI, NimbusApi, NIMBUS_KEY_ID, NimbusId}; +use std::convert::TryInto; +use nimbus_primitives::{AuthorFilterAPI, NIMBUS_KEY_ID, NimbusId, NimbusApi, CompatibleDigestItem}; mod import_queue; +mod manual_seal; +pub use manual_seal::NimbusManualSealConsensusDataProvider; const LOG_TARGET: &str = "filtering-consensus"; @@ -153,6 +156,133 @@ where } } +/// Grabs any available nimbus key from the keystore. +/// This may be useful in situations where you expect exactly one key +/// and intend to perform an operation with it regardless of whether it is +/// expected to be eligible. Concretely, this is used in the consensus worker +/// to implement the `skip_prediction` feature. +pub(crate) fn first_available_key(keystore: &dyn SyncCryptoStore) -> Option { + // Get all the available keys + let available_keys = + SyncCryptoStore::keys(keystore, NIMBUS_KEY_ID) + .expect("keystore should return the keys it has"); + + // Print a more helpful message than "not eligible" when there are no keys at all. + if available_keys.is_empty() { + warn!(target: LOG_TARGET, "🔏 No Nimbus keys available. We will not be able to author."); + return None; + } + + Some(available_keys[0].clone()) +} + +/// Grab the first eligible nimbus key from the keystore +/// If multiple keys are eligible this function still only returns one +/// and makes no guarantees which one as that depends on the keystore's iterator behavior. +/// This is the standard way of determining which key to author with. +pub(crate) fn first_eligible_key(client: Arc, keystore: &dyn SyncCryptoStore, parent: &B::Header, slot_number: u32) -> Option +where + C: ProvideRuntimeApi, + C::Api: NimbusApi, + C::Api: AuthorFilterAPI, +{ + // Get all the available keys + let available_keys = + SyncCryptoStore::keys(keystore, NIMBUS_KEY_ID) + .expect("keystore should return the keys it has"); + + // Print a more helpful message than "not eligible" when there are no keys at all. + if available_keys.is_empty() { + warn!(target: LOG_TARGET, "🔏 No Nimbus keys available. We will not be able to author."); + return None; + }let at = BlockId::Hash(parent.hash()); + + // helper function for calling the various runtime apis and versions + let prediction_helper = |at, nimbus_id: NimbusId, slot: u32, parent| -> bool { + + let has_nimbus_api = client + .runtime_api() + .has_api::>(at) + .expect("should be able to dynamically detect the api"); + + if has_nimbus_api { + NimbusApi::can_author(&*client.runtime_api(), at, nimbus_id, slot, parent) + .expect("NimbusAPI should not return error") + } else { + // There are two versions of the author filter, so we do that dynamically also. + let api_version = client.runtime_api() + .api_version::>(&at) + .expect("Runtime api access to not error.") + .expect("Should be able to detect author filter version"); + + if api_version >= 2 { + AuthorFilterAPI::can_author(&*client.runtime_api(), at, nimbus_id, slot, parent) + .expect("Author API should not return error") + } else { + #[allow(deprecated)] + client.runtime_api().can_author_before_version_2( + &at, + nimbus_id, + slot_number, + ) + .expect("Author API version 2 should not return error") + } + } + }; + + // Iterate keys until we find an eligible one, or run out of candidates. + // If we are skipping prediction, then we author with the first key we find. + // prediction skipping only really makes sense when there is a single key in the keystore. + let maybe_key = available_keys.into_iter().find(|type_public_pair| { + // Have to convert to a typed NimbusId to pass to the runtime API. Maybe this is a clue + // That I should be passing Vec across the wasm boundary? + prediction_helper( + &at, + NimbusId::from_slice(&type_public_pair.1), + slot_number, + parent, + ) + }); + + // If there are no eligible keys, print the log, and exit early. + if maybe_key.is_none() { + info!( + target: LOG_TARGET, + "🔮 Skipping candidate production because we are not eligible" + ); + } + + maybe_key +} + +pub(crate) fn seal_header(header: &B::Header, keystore: &dyn SyncCryptoStore, type_public_pair: &CryptoTypePublicPair) -> DigestItemFor +where + B: BlockT, +{ + let pre_hash = header.hash(); + + let raw_sig = SyncCryptoStore::sign_with( + &*keystore, + NIMBUS_KEY_ID, + type_public_pair, + pre_hash.as_ref(), + ) + .expect("Keystore should be able to sign") + .expect("We already checked that the key was present"); + + debug!( + target: LOG_TARGET, + "The signature is \n{:?}", raw_sig + ); + + let signature = raw_sig + .clone() + .try_into() + .expect("signature bytes produced by keystore should be right length"); + + as CompatibleDigestItem>::nimbus_seal(signature) +} + #[async_trait::async_trait] impl ParachainConsensus for NimbusConsensus @@ -181,85 +311,18 @@ where relay_parent: PHash, validation_data: &PersistedValidationData, ) -> Option> { - // Design decision: We will check the keystore for any available keys. Then we will iterate - // those keys until we find one that is eligible. If none are eligible, we skip this slot. - // If multiple are eligible, we only author with the first one. - - // Get all the available keys - let available_keys = - SyncCryptoStore::keys(&*self.keystore, NIMBUS_KEY_ID) - .expect("keystore should return the keys it has"); - - // Print a more helpful message than "not eligible" when there are no keys at all. - if available_keys.is_empty() { - warn!(target: LOG_TARGET, "🔏 No Nimbus keys available. We will not be able to author."); - return None; - } - - let at = BlockId::Hash(parent.hash()); - // helper function for calling the various runtime apis and versions - let prediction_helper = |at, nimbus_id: NimbusId, slot: u32, parent| -> bool { - - let has_nimbus_api = self - .parachain_client - .runtime_api() - .has_api::>(at) - .expect("should be able to dynamically detect the api"); - - if has_nimbus_api { - NimbusApi::can_author(&*self.parachain_client.runtime_api(), at, nimbus_id, slot, parent) - .expect("NimbusAPI should not return error") - } else { - // There are two versions of the author filter, so we do that dynamically also. - let api_version = self.parachain_client.runtime_api() - .api_version::>(&at) - .expect("Runtime api access to not error.") - .expect("Should be able to detect author filter version"); - - if api_version >= 2 { - AuthorFilterAPI::can_author(&*self.parachain_client.runtime_api(), at, nimbus_id, slot, parent) - .expect("Author API should not return error") - } else { - #[allow(deprecated)] - self.parachain_client.runtime_api().can_author_before_version_2( - &at, - nimbus_id, - slot, - ) - .expect("Author API version 2 should not return error") - } - } + let maybe_key = if self.skip_prediction { + first_available_key(&*self.keystore) + } + else { + first_eligible_key::(self.parachain_client.clone(), &*self.keystore, parent, validation_data.relay_parent_number) }; - // Iterate keys until we find an eligible one, or run out of candidates. - // If we are skipping prediction, then we author withthe first key we find. - // prediction skipping only really amkes sense when there is a single key in the keystore. - let maybe_key = available_keys.into_iter().find(|type_public_pair| { - - // If we are not predicting, just return the first one we find. - self.skip_prediction || - - // Have to convert to a typed NimbusId to pass to the runtime API. Maybe this is a clue - // That I should be passing Vec across the wasm boundary? - prediction_helper( - &at, - NimbusId::from_slice(&type_public_pair.1), - validation_data.relay_parent_number, - parent, - ) - }); - // If there are no eligible keys, print the log, and exit early. let type_public_pair = match maybe_key { Some(p) => p, - None => { - info!( - target: LOG_TARGET, - "🔮 Skipping candidate production because we are not eligible" - ); - return None; - } + None => { return None; } }; let proposer_future = self.proposer_factory.lock().init(&parent); @@ -273,6 +336,12 @@ where let inherent_data = self.inherent_data(parent.hash(),&validation_data, relay_parent, NimbusId::from_slice(&type_public_pair.1)).await?; + let inherent_digests = sp_runtime::generic::Digest { + logs: vec![ + CompatibleDigestItem::nimbus_pre_digest(NimbusId::from_slice(&type_public_pair.1)), + ] + }; + let Proposal { block, storage_changes, @@ -280,7 +349,7 @@ where } = proposer .propose( inherent_data, - Default::default(), + inherent_digests, //TODO: Fix this. Duration::from_millis(500), // Set the block limit to 50% of the maximum PoV size. @@ -295,27 +364,7 @@ where let (header, extrinsics) = block.clone().deconstruct(); - let pre_hash = header.hash(); - - let raw_sig = SyncCryptoStore::sign_with( - &*self.keystore, - NIMBUS_KEY_ID, - &type_public_pair, - pre_hash.as_ref(), - ) - .expect("Keystore should be able to sign") - .expect("We already checked that the key was present"); - - debug!( - target: LOG_TARGET, - "The signature is \n{:?}", raw_sig - ); - - let signature = raw_sig - .clone() - .try_into().ok()?; - - let sig_digest = as nimbus_primitives::digests::CompatibleDigestItem>::nimbus_seal(signature); + let sig_digest = seal_header::(&header, &*self.keystore, &type_public_pair); let mut block_import_params = BlockImportParams::new(BlockOrigin::Own, header.clone()); block_import_params.post_digests.push(sig_digest.clone()); @@ -329,7 +378,7 @@ where "🔖 Sealed block for proposal at {}. Hash now {:?}, previously {:?}.", *header.number(), block_import_params.post_hash(), - pre_hash, + header.hash(), ); if let Err(err) = self diff --git a/nimbus-consensus/src/manual_seal.rs b/nimbus-consensus/src/manual_seal.rs new file mode 100644 index 00000000..fe8efff8 --- /dev/null +++ b/nimbus-consensus/src/manual_seal.rs @@ -0,0 +1,120 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Nimbus. + +// Nimbus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Nimbus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Nimbus. If not, see . + +use std::sync::Arc; +use sp_keystore::SyncCryptoStorePtr; +use sp_runtime::{ + traits::{Block as BlockT, DigestFor}, + generic::{Digest, DigestItem}, +}; +use sp_core::crypto::Public; +use sc_consensus::BlockImportParams; +use sc_consensus_manual_seal::{ConsensusDataProvider, Error}; +use sp_api::{TransactionFor, ProvideRuntimeApi, HeaderT}; +use sp_inherents::InherentData; +use nimbus_primitives::{AuthorFilterAPI, NimbusApi, NimbusId, CompatibleDigestItem, NIMBUS_ENGINE_ID}; +use cumulus_primitives_parachain_inherent::{ParachainInherentData, INHERENT_IDENTIFIER as PARACHAIN_INHERENT_IDENTIFIER}; + +/// Provides nimbus-compatible pre-runtime digests for use with manual seal consensus +pub struct NimbusManualSealConsensusDataProvider { + /// Shared reference to keystore + pub keystore: SyncCryptoStorePtr, + + /// Shared reference to the client + pub client: Arc, + + // Could have a skip_prediction field here if it becomes desireable +} + +impl ConsensusDataProvider for NimbusManualSealConsensusDataProvider +where + B: BlockT, + C: ProvideRuntimeApi + Send + Sync, + C::Api: NimbusApi, + C::Api: AuthorFilterAPI, + { + type Transaction = TransactionFor; + + fn create_digest( + &self, + parent: &B::Header, + inherents: &InherentData, + ) -> Result, Error> { + // Retrieve the relay chain block number to use as the slot number from the parachain inherent + let slot_number = inherents + .get_data::(&PARACHAIN_INHERENT_IDENTIFIER) + .expect("Parachain inherent should decode correctly") + .expect("Parachain inherent should be present because we are mocking it") + .validation_data + .relay_parent_number; + + // Fetch first eligible key from keystore + let maybe_key = crate::first_eligible_key::( + self.client.clone(), + &*self.keystore, + parent, + // For now we author all blocks in slot zero, which is consistent with how we are + // mocking the relay chain height which the runtime uses for slot beacon. + // This should improve. See https://github.com/PureStake/nimbus/issues/3 + slot_number, + ); + + // If we aren't eligible, return an appropriate error + match maybe_key { + Some(key) => { + Ok(Digest{ + logs: vec![DigestItem::nimbus_pre_digest(NimbusId::from_slice(&key.1))], + }) + }, + None => { + Err(Error::StringError(String::from("no nimbus keys available to manual seal"))) + }, + } + + } + + // This is where we actually sign with the nimbus key and attach the seal + fn append_block_import( + &self, + _parent: &B::Header, + params: &mut BlockImportParams, + _inherents: &InherentData, + ) -> Result<(), Error> { + + // We have to reconstruct the type-public pair which is only communicated through the pre-runtime digest + let claimed_author = params + .header + .digest() + .logs + .iter() + .find_map(|digest| { + match *digest { + // We do not support the older author inherent in manual seal + DigestItem::PreRuntime(id, ref author_id) if id == NIMBUS_ENGINE_ID => Some(author_id.clone()), + _ => None, + } + }) + .expect("Expected one pre-runtime digest that contains author id bytes"); + + let nimbus_public = NimbusId::from_slice(&claimed_author); + + let sig_digest = crate::seal_header::(¶ms.header, &*self.keystore, &nimbus_public.into()); + + params.post_digests.push(sig_digest); + + Ok(()) + } +} diff --git a/nimbus-primitives/src/digests.rs b/nimbus-primitives/src/digests.rs index c9d4703f..6d96cddc 100644 --- a/nimbus-primitives/src/digests.rs +++ b/nimbus-primitives/src/digests.rs @@ -30,22 +30,38 @@ use sp_std::fmt::Debug; /// A digest item which is usable with aura consensus. pub trait CompatibleDigestItem: Sized { + /// Construct a pre-runtime digest from the given AuthorId + fn nimbus_pre_digest(author: NimbusId) -> Self; + + /// If this item is a nimbus pre-runtime digest, return the author + fn as_nimbus_pre_digest(&self) -> Option; + /// Construct a seal digest item from the given signature fn nimbus_seal(signature: NimbusSignature) -> Self; /// If this item is a nimbus seal, return the signature. fn as_nimbus_seal(&self) -> Option; + /// This will be deprecated in the future /// Construct a consensus digest from the given AuthorId fn nimbus_consensus_digest(author: NimbusId) -> Self; - /// If this item is a nimbus consensus digest, return the author + /// This will be deprecated in the future + /// If this item is a nimbus consensus digest, return the author fn as_nimbus_consensus_digest(&self) -> Option; } impl CompatibleDigestItem for DigestItem where Hash: Debug + Send + Sync + Eq + Clone + Codec + 'static { + fn nimbus_pre_digest(author: NimbusId) -> Self { + DigestItem::PreRuntime(NIMBUS_ENGINE_ID, author.encode()) + } + + fn as_nimbus_pre_digest(&self) -> Option { + self.pre_runtime_try_to(&NIMBUS_ENGINE_ID) + } + fn nimbus_seal(signature: NimbusSignature) -> Self { DigestItem::Seal(NIMBUS_ENGINE_ID, signature.encode()) } @@ -54,10 +70,13 @@ impl CompatibleDigestItem for DigestItem where self.seal_try_to(&NIMBUS_ENGINE_ID) } + // Remove this once deprecated fn nimbus_consensus_digest(author: NimbusId) -> Self { DigestItem::Consensus(NIMBUS_ENGINE_ID, author.encode()) } + // Remove this once deprecated. I don't think it is used anyway. + // Notice that it calls the pre_runtime helper function. fn as_nimbus_consensus_digest(&self) -> Option { self.pre_runtime_try_to(&NIMBUS_ENGINE_ID) } diff --git a/nimbus-primitives/src/lib.rs b/nimbus-primitives/src/lib.rs index d24be87d..6d1d63f8 100644 --- a/nimbus-primitives/src/lib.rs +++ b/nimbus-primitives/src/lib.rs @@ -29,6 +29,8 @@ use sp_runtime::traits::BlockNumberProvider; pub mod digests; mod inherents; +pub use digests::CompatibleDigestItem; + pub use inherents::{INHERENT_IDENTIFIER, InherentDataProvider}; /// The given account ID is the author of the current block. diff --git a/pallets/author-inherent/src/exec.rs b/pallets/author-inherent/src/exec.rs index 6052257f..ccd45b4a 100644 --- a/pallets/author-inherent/src/exec.rs +++ b/pallets/author-inherent/src/exec.rs @@ -57,34 +57,25 @@ where debug!(target: "executive", "In hacked Executive. digests after stripping {:?}", header.digest()); debug!(target: "executive", "The seal we got {:?}", seal); - // let sig = match seal { - // DigestItem::Seal(id, ref sig) if id == NIMBUS_ENGINE_ID => sig.clone(), - // _ => panic!("HeaderUnsealed"), - // }; let signature = seal.as_nimbus_seal().unwrap_or_else(||panic!("HeaderUnsealed")); debug!(target: "executive", "🪲 Header hash after popping digest {:?}", header.hash()); debug!(target: "executive", "🪲 Signature according to executive is {:?}", signature); - // Grab the digest from the runtime - //TODO use the CompatibleDigest trait. Maybe this code should move to the trait. - let consensus_digest = header + // Grab the author information from the preruntime digest + //TODO use the trait + let claimed_author = header .digest() .logs .iter() - .find(|digest| { + .find_map(|digest| { match *digest { - DigestItem::Consensus(id, _) if id == &NIMBUS_ENGINE_ID => true, - _ => false, + DigestItem::PreRuntime(id, ref author_id) if id == NIMBUS_ENGINE_ID => Some(author_id.clone()), + _ => None, } }) - .expect("A single consensus digest should be added by the runtime when executing the author inherent."); - - let claimed_author = match *consensus_digest { - DigestItem::Consensus(id, ref author_id) if id == NIMBUS_ENGINE_ID => author_id.clone(), - _ => panic!("Expected consensus digest to contains author id bytes"), - }; + .expect("Expected pre-runtime digest that contains author id bytes"); debug!(target: "executive", "🪲 Claimed Author according to executive is {:?}", claimed_author); diff --git a/pallets/author-inherent/src/lib.rs b/pallets/author-inherent/src/lib.rs index b6ca0f0c..70d1f9b7 100644 --- a/pallets/author-inherent/src/lib.rs +++ b/pallets/author-inherent/src/lib.rs @@ -20,16 +20,13 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{ - traits::FindAuthor, +use frame_support::traits::FindAuthor; +use nimbus_primitives::{ + AccountLookup, CanAuthor, EventHandler, SlotBeacon, INHERENT_IDENTIFIER, NIMBUS_ENGINE_ID, NimbusId, }; use parity_scale_codec::{Decode, Encode}; use sp_inherents::{InherentIdentifier, IsFatalError}; -use sp_runtime::{ - ConsensusEngineId, DigestItem, RuntimeString, -}; -use log::debug; -use nimbus_primitives::{AccountLookup, CanAuthor, NimbusId, NIMBUS_ENGINE_ID, SlotBeacon, EventHandler, INHERENT_IDENTIFIER}; +use sp_runtime::{ConsensusEngineId, RuntimeString}; mod exec; pub use exec::BlockExecutor; @@ -81,7 +78,6 @@ pub mod pallet { CannotBeAuthor, } - /// Author of current block. #[pallet::storage] pub type Author = StorageValue<_, T::AccountId, OptionQuery>; @@ -89,44 +85,45 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { fn on_initialize(_: T::BlockNumber) -> Weight { + // Start by clearing out the previous block's author >::kill(); - 0 + + // Now extract the author from the digest + let digest = >::digest(); + + let pre_runtime_digests = digest.logs.iter().filter_map(|d| d.as_pre_runtime()); + Self::find_author(pre_runtime_digests).map(|author_account|{ + // Store the author so we can confirm eligibility after the inherents have executed + >::put(&author_account); + + //TODO, should we reuse the same trait that Pallet Authorship uses? + // Notify any other pallets that are listening (eg rewards) about the author + T::EventHandler::note_author(author_account); + }); + + T::DbWeight::get().write * 2 } } #[pallet::call] impl Pallet { - /// Inherent to set the author of a block - #[pallet::weight((0, DispatchClass::Mandatory))] - pub fn set_author(origin: OriginFor, author: NimbusId) -> DispatchResult { - + /// This inherent is a workaround to run code after the "real" inherents have executed, + /// but before transactions are executed. + /// This this should go into on_post_inherents when it is ready https://github.com/paritytech/substrate/pull/10128 + /// TODO better weight. For now we jsut set a somewhat soncervative fudge factor + #[pallet::weight((10 * T::DbWeight::get().write, DispatchClass::Mandatory))] + pub fn kick_off_authorship_validation(origin: OriginFor) -> DispatchResultWithPostInfo { ensure_none(origin)?; - ensure!(>::get().is_none(), Error::::AuthorAlreadySet); - debug!(target: "author-inherent", "Author was not already set"); - - let slot = T::SlotBeacon::slot(); - debug!(target: "author-inherent", "Slot is {:?}", slot); - - let account = T::AccountLookup::lookup_account(&author).ok_or( - Error::::NoAccountId - )?; - - ensure!(T::CanAuthor::can_author(&account, &slot), Error::::CannotBeAuthor); - - // Update storage - Author::::put(&account); - - // Add a consensus digest so the client-side worker can verify the block is signed by the right person. - frame_system::Pallet::::deposit_log(DigestItem::::Consensus( - NIMBUS_ENGINE_ID, - author.encode(), - )); - - // Notify any other pallets that are listening (eg rewards) about the author - T::EventHandler::note_author(account); + let author = >::get() + .expect("Block invalid, no authorship information supplied in preruntime digest."); + + assert!( + T::CanAuthor::can_author(&author, &T::SlotBeacon::slot()), + "Block invalid, supplied author is not eligible." + ); - Ok(()) + Ok(Pays::No.into()) } } @@ -140,36 +137,39 @@ pub mod pallet { // Return Ok(Some(_)) unconditionally because this inherent is required in every block // If it is not found, throw an AuthorInherentRequired error. Ok(Some(InherentError::Other( - sp_runtime::RuntimeString::Borrowed("AuthorInherentRequired"), + sp_runtime::RuntimeString::Borrowed("Inherent required to manually initiate author validation"), ))) } - fn create_inherent(data: &InherentData) -> Option { - let author_raw = data - .get_data::(&INHERENT_IDENTIFIER); - - debug!("In create_inherent (runtime side). data is"); - debug!("{:?}", author_raw); - - let author = author_raw - .expect("Gets and decodes authorship inherent data")?; - - Some(Call::set_author{author}) + // Regardless of whether the client is still supplying the author id, + // we will create the new empty-payload inherent extrinsic. + fn create_inherent(_data: &InherentData) -> Option { + Some(Call::kick_off_authorship_validation{}) } fn is_inherent(call: &Self::Call) -> bool { - matches!(call, Call::set_author{..}) + matches!(call, Call::kick_off_authorship_validation{..}) } } impl FindAuthor for Pallet { - fn find_author<'a, I>(_digests: I) -> Option + fn find_author<'a, I>(digests: I) -> Option where I: 'a + IntoIterator, { - // We don't use the digests at all. - // This will only return the correct author _after_ the authorship inherent is processed. - >::get() + for (id, mut data) in digests.into_iter() { + if id == NIMBUS_ENGINE_ID { + let author_id = NimbusId::decode(&mut data) + .expect("NimbusId encoded in preruntime digest must be valid"); + + let author_account = T::AccountLookup::lookup_account(&author_id) + .expect("No Account Mapped to this NimbusId"); + + return Some(author_account); + } + } + + None } } @@ -216,7 +216,6 @@ impl InherentError { } } - #[cfg(test)] mod tests { use super::*; @@ -226,13 +225,13 @@ mod tests { assert_noop, assert_ok, parameter_types, traits::{OnFinalize, OnInitialize}, }; + use sp_core::Public; use sp_core::H256; use sp_io::TestExternalities; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, }; - use sp_core::Public; const TEST_AUTHOR_ID: [u8; 32] = [0u8; 32]; const BOGUS_AUTHOR_ID: [u8; 32] = [1u8; 32]; diff --git a/parachain-template/node/Cargo.toml b/parachain-template/node/Cargo.toml index 9b95c922..2075a104 100644 --- a/parachain-template/node/Cargo.toml +++ b/parachain-template/node/Cargo.toml @@ -50,6 +50,7 @@ substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate ## Substrate Client Dependencies sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/parachain-template/node/src/chain_spec.rs b/parachain-template/node/src/chain_spec.rs index b00c984e..270fe695 100644 --- a/parachain-template/node/src/chain_spec.rs +++ b/parachain-template/node/src/chain_spec.rs @@ -72,10 +72,6 @@ pub fn development_config(id: ParaId) -> ChainSpec { get_account_id_from_seed::("Alice"), get_collator_keys_from_seed("Alice"), ), - ( - get_account_id_from_seed::("Bob"), - get_collator_keys_from_seed("Bob"), - ), ], vec![ get_account_id_from_seed::("Alice"), diff --git a/parachain-template/node/src/cli.rs b/parachain-template/node/src/cli.rs index 319893a0..fe5b1e58 100644 --- a/parachain-template/node/src/cli.rs +++ b/parachain-template/node/src/cli.rs @@ -34,6 +34,9 @@ pub enum Subcommand { /// Revert the chain to a previous state. Revert(sc_cli::RevertCmd), + /// Run Instant Seal + RunInstantSeal(sc_cli::RunCmd), + /// The custom benchmark subcommmand benchmarking runtime pallets. #[structopt(name = "benchmark", about = "Benchmark runtime pallets.")] Benchmark(frame_benchmarking_cli::BenchmarkCmd), diff --git a/parachain-template/node/src/command.rs b/parachain-template/node/src/command.rs index 03594e2b..c6df62b8 100644 --- a/parachain-template/node/src/command.rs +++ b/parachain-template/node/src/command.rs @@ -126,7 +126,8 @@ macro_rules! construct_async_run { RuntimeApi, TemplateRuntimeExecutor, >( - &$config, + // We default to the non-parachain import queue and select chain. + &$config, false, )?; let task_manager = $components.task_manager; { $( $code )* }.map(|v| (v, task_manager)) @@ -242,6 +243,13 @@ pub fn run() -> Result<()> { You can enable it with `--features runtime-benchmarks`." .into()) }, + Some(Subcommand::RunInstantSeal(run_cmd)) => { + let runner = cli.create_runner(run_cmd)?; + runner.run_node_until_exit(|config| async move { + crate::service::start_instant_seal_node(config) + .map_err(sc_cli::Error::Service) + }) + }, None => { let runner = cli.create_runner(&cli.run.normalize())?; diff --git a/parachain-template/node/src/service.rs b/parachain-template/node/src/service.rs index 78e0a12e..2508962a 100644 --- a/parachain-template/node/src/service.rs +++ b/parachain-template/node/src/service.rs @@ -9,7 +9,7 @@ use parachain_template_runtime::{ }; use nimbus_consensus::{ - build_nimbus_consensus, BuildNimbusConsensusParams, + build_nimbus_consensus, BuildNimbusConsensusParams, NimbusManualSealConsensusDataProvider, }; // Cumulus Imports @@ -19,6 +19,7 @@ use cumulus_client_service::{ prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams, }; use cumulus_primitives_core::ParaId; +use cumulus_primitives_parachain_inherent::MockValidationDataInherentDataProvider; // Substrate Imports use sc_executor::NativeElseWasmExecutor; @@ -29,6 +30,7 @@ use sp_api::ConstructRuntimeApi; use sp_keystore::SyncCryptoStorePtr; use sp_runtime::traits::BlakeTwo256; use substrate_prometheus_endpoint::Registry; +use sc_consensus_manual_seal::{run_instant_seal, InstantSealParams}; /// Native executor instance. pub struct TemplateRuntimeExecutor; @@ -52,11 +54,12 @@ impl sc_executor::NativeExecutionDispatch for TemplateRuntimeExecutor { #[allow(clippy::type_complexity)] pub fn new_partial( config: &Configuration, + parachain: bool, ) -> Result< PartialComponents< TFullClient>, TFullBackend, - (), + sc_consensus::LongestChain, Block>, sc_consensus::DefaultImportQueue< Block, TFullClient>, @@ -117,6 +120,10 @@ where telemetry }); + // Although this will not be used by the parachain collator, it will be used by the instant seal + // And sovereign nodes, so we create it anyway. + let select_chain = sc_consensus::LongestChain::new(backend.clone()); + let transaction_pool = sc_transaction_pool::BasicPool::new_full( config.transaction_pool.clone(), config.role.is_authority().into(), @@ -135,6 +142,7 @@ where }, &task_manager.spawn_essential_handle(), config.prometheus_registry().clone(), + parachain, )?; let params = PartialComponents { @@ -144,7 +152,7 @@ where keystore_container, task_manager, transaction_pool, - select_chain: (), + select_chain, other: (telemetry, telemetry_worker_handle), }; @@ -211,7 +219,7 @@ where let parachain_config = prepare_node_config(parachain_config); - let params = new_partial::(¶chain_config)?; + let params = new_partial::(¶chain_config, true)?; let (mut telemetry, telemetry_worker_handle) = params.other; let relay_chain_full_node = @@ -403,3 +411,118 @@ pub async fn start_parachain_node( ) .await } + +/// Builds a new service for a full client. +pub fn start_instant_seal_node(config: Configuration) -> Result { + let sc_service::PartialComponents { + client, + backend, + mut task_manager, + import_queue, + keystore_container, + select_chain, + transaction_pool, + other: (mut telemetry, _), + } = new_partial::(&config, false)?; + + let (network, system_rpc_tx, network_starter) = + sc_service::build_network(sc_service::BuildNetworkParams { + config: &config, + client: client.clone(), + transaction_pool: transaction_pool.clone(), + spawn_handle: task_manager.spawn_handle(), + import_queue, + on_demand: None, + block_announce_validator_builder: None, + warp_sync: None, + })?; + + if config.offchain_worker.enabled { + sc_service::build_offchain_workers( + &config, + task_manager.spawn_handle(), + client.clone(), + network.clone(), + ); + } + + let is_authority = config.role.is_authority(); + let prometheus_registry = config.prometheus_registry().cloned(); + + let rpc_extensions_builder = { + let client = client.clone(); + let transaction_pool = transaction_pool.clone(); + + Box::new(move |deny_unsafe, _| { + let deps = crate::rpc::FullDeps { + client: client.clone(), + pool: transaction_pool.clone(), + deny_unsafe, + }; + + Ok(crate::rpc::create_full(deps)) + }) + }; + + sc_service::spawn_tasks(sc_service::SpawnTasksParams { + network, + client: client.clone(), + keystore: keystore_container.sync_keystore(), + task_manager: &mut task_manager, + transaction_pool: transaction_pool.clone(), + rpc_extensions_builder, + on_demand: None, + remote_blockchain: None, + backend, + system_rpc_tx, + config, + telemetry: telemetry.as_mut(), + })?; + + if is_authority { + let proposer = sc_basic_authorship::ProposerFactory::new( + task_manager.spawn_handle(), + client.clone(), + transaction_pool.clone(), + prometheus_registry.as_ref(), + telemetry.as_ref().map(|t| t.handle()), + ); + + let authorship_future = run_instant_seal(InstantSealParams { + block_import: client.clone(), + env: proposer, + client: client.clone(), + pool: transaction_pool.clone(), + select_chain, + consensus_data_provider: Some(Box::new( + NimbusManualSealConsensusDataProvider{ + keystore: keystore_container.sync_keystore(), + client: client.clone() + } + )), + create_inherent_data_providers: |_block, _extra_args| { + async move { + let time = sp_timestamp::InherentDataProvider::from_system_time(); + + // The nimbus runtime is shared among all nodes including the parachain node. + // Because this is not a parachain context, we need to mock the parachain inherent data provider. + //TODO might need to go back and get the block number like how I do in Moonbeam + let mocked_parachain = MockValidationDataInherentDataProvider { + current_para_block: 0, + relay_offset: 0, + relay_blocks_per_para_block: 0, + }; + + Ok((time, mocked_parachain)) + } + } + }); + + task_manager + .spawn_essential_handle() + .spawn_blocking("instant-seal", authorship_future); + }; + + network_starter.start_network(); + Ok(task_manager) +}