diff --git a/Cargo.lock b/Cargo.lock index 8eefd7209eff..c29dd8479c68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1912,7 +1912,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", ] @@ -1930,7 +1930,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "3.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -1949,7 +1949,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "Inflector", "chrono", @@ -1972,7 +1972,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -1985,7 +1985,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -2000,7 +2000,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "serde", @@ -2011,7 +2011,7 @@ dependencies = [ [[package]] name = "frame-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "bitflags", "frame-metadata", @@ -2038,7 +2038,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2050,7 +2050,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -2062,7 +2062,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "proc-macro2", "quote", @@ -2072,7 +2072,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-metadata", "frame-support", @@ -2092,7 +2092,7 @@ dependencies = [ [[package]] name = "frame-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -2109,7 +2109,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -2123,7 +2123,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "sp-api", @@ -2132,7 +2132,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "parity-scale-codec", @@ -3181,6 +3181,12 @@ dependencies = [ "slab", ] +[[package]] +name = "jsonrpsee" +version = "0.2.0-alpha.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e48ecdd757b22fae87e87aad2dbadf11c56499c6509763c8ef20db16ffb0e9" + [[package]] name = "jsonrpsee-proc-macros" version = "0.2.0" @@ -4064,7 +4070,7 @@ dependencies = [ [[package]] name = "max-encoded-len" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "impl-trait-for-tuples", "max-encoded-len-derive", @@ -4075,7 +4081,7 @@ dependencies = [ [[package]] name = "max-encoded-len-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -4578,7 +4584,7 @@ checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" [[package]] name = "pallet-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -4593,7 +4599,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -4607,7 +4613,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4630,7 +4636,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4660,7 +4666,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4696,7 +4702,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4712,7 +4718,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4727,7 +4733,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4748,7 +4754,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4765,7 +4771,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4779,7 +4785,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "3.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4801,7 +4807,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4816,7 +4822,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4835,7 +4841,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4851,7 +4857,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4866,7 +4872,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -4883,7 +4889,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -4899,7 +4905,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4917,7 +4923,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4932,7 +4938,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -4945,7 +4951,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -4961,7 +4967,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4983,7 +4989,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -4999,7 +5005,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "enumflags2", "frame-support", @@ -5013,7 +5019,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5028,7 +5034,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -5048,7 +5054,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5064,7 +5070,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -5077,7 +5083,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5101,7 +5107,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -5112,7 +5118,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "log", "sp-arithmetic", @@ -5121,7 +5127,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -5134,7 +5140,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5152,7 +5158,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5167,7 +5173,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-support", "frame-system", @@ -5183,7 +5189,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5200,7 +5206,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5211,7 +5217,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5227,7 +5233,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5242,7 +5248,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7575,7 +7581,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "env_logger 0.8.4", "hex", @@ -7869,7 +7875,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "log", "sp-core", @@ -7881,7 +7887,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "derive_more", @@ -7910,7 +7916,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "futures 0.3.15", "futures-timer 3.0.2", @@ -7933,7 +7939,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7949,7 +7955,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -7969,7 +7975,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -7980,7 +7986,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "chrono", "fdlimit", @@ -8018,7 +8024,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "derive_more", "fnv", @@ -8052,7 +8058,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "blake2-rfc", "hash-db", @@ -8082,7 +8088,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "parking_lot 0.11.1", @@ -8095,7 +8101,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "derive_more", @@ -8141,7 +8147,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "derive_more", "futures 0.3.15", @@ -8165,7 +8171,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8178,7 +8184,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "futures 0.3.15", @@ -8206,7 +8212,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "sc-client-api", "sp-authorship", @@ -8217,7 +8223,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "derive_more", "lazy_static", @@ -8246,7 +8252,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "derive_more", "parity-scale-codec", @@ -8263,7 +8269,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "log", "parity-scale-codec", @@ -8278,7 +8284,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8297,7 +8303,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "derive_more", @@ -8338,7 +8344,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "derive_more", "finality-grandpa", @@ -8362,7 +8368,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-warp-sync" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "derive_more", "futures 0.3.15", @@ -8383,7 +8389,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "ansi_term 0.12.1", "futures 0.3.15", @@ -8401,7 +8407,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "derive_more", @@ -8421,7 +8427,7 @@ dependencies = [ [[package]] name = "sc-light" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "hash-db", "lazy_static", @@ -8440,7 +8446,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-std", "async-trait", @@ -8493,7 +8499,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "futures 0.3.15", "futures-timer 3.0.2", @@ -8510,7 +8516,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "bytes 0.5.6", "fnv", @@ -8538,7 +8544,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "futures 0.3.15", "libp2p", @@ -8551,7 +8557,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8560,7 +8566,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "futures 0.3.15", "hash-db", @@ -8595,7 +8601,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "derive_more", "futures 0.3.15", @@ -8620,7 +8626,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "futures 0.1.29", "jsonrpc-core", @@ -8638,7 +8644,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "directories", @@ -8704,7 +8710,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "log", "parity-scale-codec", @@ -8719,7 +8725,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -8739,7 +8745,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "chrono", "futures 0.3.15", @@ -8759,7 +8765,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "ansi_term 0.12.1", "atty", @@ -8796,7 +8802,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8807,7 +8813,7 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "derive_more", "futures 0.3.15", @@ -8829,7 +8835,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "futures 0.3.15", "intervalier", @@ -9308,7 +9314,7 @@ dependencies = [ [[package]] name = "sp-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "hash-db", "log", @@ -9325,7 +9331,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -9337,7 +9343,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "max-encoded-len", "parity-scale-codec", @@ -9350,7 +9356,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "integer-sqrt", "num-traits", @@ -9364,7 +9370,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "sp-api", @@ -9376,7 +9382,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "parity-scale-codec", @@ -9388,7 +9394,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "sp-api", @@ -9400,7 +9406,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "futures 0.3.15", "log", @@ -9418,7 +9424,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "futures 0.3.15", @@ -9445,7 +9451,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "merlin", @@ -9467,7 +9473,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -9477,7 +9483,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9489,7 +9495,7 @@ dependencies = [ [[package]] name = "sp-core" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "base58", "blake2-rfc", @@ -9534,7 +9540,7 @@ dependencies = [ [[package]] name = "sp-database" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -9543,7 +9549,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "proc-macro2", "quote", @@ -9553,7 +9559,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "environmental", "parity-scale-codec", @@ -9564,7 +9570,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "finality-grandpa", "log", @@ -9581,7 +9587,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9595,7 +9601,7 @@ dependencies = [ [[package]] name = "sp-io" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "futures 0.3.15", "hash-db", @@ -9620,7 +9626,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "lazy_static", "sp-core", @@ -9631,7 +9637,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "derive_more", @@ -9648,7 +9654,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "ruzstd", "zstd", @@ -9657,7 +9663,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "serde", @@ -9670,7 +9676,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9681,7 +9687,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "sp-api", "sp-core", @@ -9691,7 +9697,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "backtrace", ] @@ -9699,7 +9705,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "rustc-hash", "serde", @@ -9710,7 +9716,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "either", "hash256-std-hasher", @@ -9732,7 +9738,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9749,7 +9755,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -9761,7 +9767,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "serde", "serde_json", @@ -9770,7 +9776,7 @@ dependencies = [ [[package]] name = "sp-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "sp-api", @@ -9783,7 +9789,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -9793,7 +9799,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "hash-db", "log", @@ -9816,12 +9822,12 @@ dependencies = [ [[package]] name = "sp-std" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" [[package]] name = "sp-storage" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9834,7 +9840,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "log", "sp-core", @@ -9847,7 +9853,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "futures-timer 3.0.2", @@ -9864,7 +9870,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "erased-serde", "log", @@ -9882,7 +9888,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "derive_more", "futures 0.3.15", @@ -9898,7 +9904,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "log", @@ -9913,7 +9919,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "hash-db", "memory-db", @@ -9927,7 +9933,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "futures 0.3.15", "futures-core", @@ -9939,7 +9945,7 @@ dependencies = [ [[package]] name = "sp-version" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9952,7 +9958,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "parity-scale-codec", "proc-macro-crate 1.0.0", @@ -9964,7 +9970,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9984,6 +9990,44 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +[[package]] +name = "staking-miner" +version = "0.9.0" +dependencies = [ + "env_logger 0.8.4", + "frame-election-provider-support", + "frame-support", + "frame-system", + "hex", + "jsonrpsee", + "jsonrpsee-types", + "jsonrpsee-ws-client", + "kusama-runtime", + "lazy_static", + "log", + "pallet-election-provider-multi-phase", + "pallet-staking", + "pallet-transaction-payment", + "parity-scale-codec", + "paste 1.0.5", + "polkadot-core-primitives", + "polkadot-runtime", + "polkadot-runtime-common", + "remote-externalities", + "serde", + "serde_json", + "sp-core", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-transaction-pool", + "sp-version", + "structopt", + "thiserror", + "tokio 0.2.21", + "westend-runtime", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -10109,7 +10153,7 @@ dependencies = [ [[package]] name = "substrate-browser-utils" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "chrono", "console_error_panic_hook", @@ -10135,7 +10179,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "platforms", ] @@ -10143,7 +10187,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.15", @@ -10166,7 +10210,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-std", "derive_more", @@ -10180,7 +10224,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "async-trait", "futures 0.1.29", @@ -10209,7 +10253,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "futures 0.3.15", "substrate-test-utils-derive", @@ -10219,7 +10263,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "proc-macro-crate 1.0.0", "quote", @@ -10229,7 +10273,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "ansi_term 0.12.1", "atty", @@ -10974,7 +11018,7 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "try-runtime-cli" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#4b5c2f7007833f347dbed52ff9d3dd79ee3744d8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#1b758b2a8d151d97d2242260c465b6df9cb8a7a4" dependencies = [ "frame-try-runtime", "log", diff --git a/Cargo.toml b/Cargo.toml index 54681c52ebe1..a9cd823c8d25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,6 +79,7 @@ members = [ "parachain/test-parachains", "parachain/test-parachains/adder", "parachain/test-parachains/adder/collator", + "utils/staking-miner", ] # We want to be able to build the bridge relayer without pulling it (and all of its diff --git a/node/service/src/chain_spec.rs b/node/service/src/chain_spec.rs index 676762b7e536..2eee6b5f4cea 100644 --- a/node/service/src/chain_spec.rs +++ b/node/service/src/chain_spec.rs @@ -1213,7 +1213,7 @@ pub fn polkadot_testnet_genesis( }, staking: polkadot::StakingConfig { minimum_validator_count: 1, - validator_count: 2, + validator_count: initial_authorities.len() as u32, stakers: initial_authorities .iter() .map(|x| { @@ -1312,7 +1312,7 @@ pub fn kusama_testnet_genesis( }, staking: kusama::StakingConfig { minimum_validator_count: 1, - validator_count: 2, + validator_count: initial_authorities.len() as u32, stakers: initial_authorities .iter() .map(|x| { @@ -1416,7 +1416,7 @@ pub fn westend_testnet_genesis( }, staking: westend::StakingConfig { minimum_validator_count: 1, - validator_count: 2, + validator_count: initial_authorities.len() as u32, stakers: initial_authorities .iter() .map(|x| { diff --git a/runtime/common/src/elections.rs b/runtime/common/src/elections.rs index 3b7086fcfd5d..b2109b598ebd 100644 --- a/runtime/common/src/elections.rs +++ b/runtime/common/src/elections.rs @@ -18,10 +18,14 @@ use frame_support::{ parameter_types, - traits::Get, - weights::{DispatchClass, Weight, WeightToFeePolynomial}, + weights::{DispatchClass, Weight}, }; -use sp_runtime::Perbill; +use sp_runtime::{ + traits::{Zero, Dispatchable}, + FixedU128, FixedPointNumber, Perbill, +}; +use pallet_transaction_payment::OnChargeTransaction; +use frame_support::weights::{DispatchInfo, Pays}; use super::{BlockExecutionWeight, BlockLength, BlockWeights}; parameter_types! { @@ -44,18 +48,21 @@ parameter_types! { .get(DispatchClass::Normal); } -/// Compute the expected fee for submitting an election solution. -/// -/// This is `multiplier` multiplied by the fee for the expected submission weight according to the -/// weight info. -/// -/// Assumes that the signed submission queue is full. -pub fn fee_for_submit_call(multiplier: Perbill) -> WeightToFee::Balance +pub fn fee_for_submit_call( + multiplier: FixedU128, + weight: Weight, + length: u32, +) -> primitives::v1::Balance where - T: pallet_election_provider_multi_phase::Config, - WeightToFee: WeightToFeePolynomial, - WeightInfo: pallet_election_provider_multi_phase::WeightInfo, + T: pallet_transaction_payment::Config, + ::OnChargeTransaction: + OnChargeTransaction, + ::Call: Dispatchable, { - let expected_weight = WeightInfo::submit(T::SignedMaxSubmissions::get()); - multiplier * WeightToFee::calc(&expected_weight) + let info = DispatchInfo { weight, class: DispatchClass::Normal, pays_fee: Pays::Yes }; + multiplier.saturating_mul_int(pallet_transaction_payment::Pallet::::compute_fee( + length, + &info, + Zero::zero(), + )) } diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 77cbcfcde33a..33e7b3697fe8 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -65,8 +65,8 @@ use xcm_builder::{ use xcm_executor::XcmExecutor; use sp_arithmetic::Perquintill; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, - ApplyExtrinsicResult, KeyTypeId, Percent, Permill, Perbill, + create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, KeyTypeId, Percent, + Permill, Perbill, FixedPointNumber, transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority}, traits::{ BlakeTwo256, Block as BlockT, OpaqueKeys, ConvertInto, AccountIdLookup, @@ -101,6 +101,7 @@ pub use pallet_staking::StakerStatus; pub use sp_runtime::BuildStorage; pub use pallet_timestamp::Call as TimestampCall; pub use pallet_balances::Call as BalancesCall; +pub use pallet_election_provider_multi_phase::Call as EPMCall; /// Constant values used within the runtime. pub mod constants; @@ -348,6 +349,7 @@ impl pallet_session::historical::Config for Runtime { type FullIdentificationOf = pallet_staking::ExposureOf; } +use pallet_election_provider_multi_phase::WeightInfo; parameter_types! { // phase durations. 1/4 of the last session for each. pub const SignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4; @@ -360,11 +362,14 @@ parameter_types! { // This formula is currently adjusted such that a typical solution will spend an amount equal // to the base deposit for every 50 kb. pub const SignedDepositByte: Balance = deposit(1, 0) / (50 * 1024); - pub SignedRewardBase: Balance = fee_for_submit_call::< - Runtime, - crate::constants::fee::WeightToFee, - crate::weights::pallet_election_provider_multi_phase::WeightInfo, - >(Perbill::from_perthousand(1500)); + pub SignedRewardBase: Balance = fee_for_submit_call::( + // give 20% threshold. + sp_runtime::FixedU128::saturating_from_rational(12, 10), + // maximum weight possible. + weights::pallet_election_provider_multi_phase::WeightInfo::::submit(SignedMaxSubmissions::get()), + // assume a solution of 100kb length. + 100 * 1024 + ); // fallback: emergency phase. pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 518c24fb3754..a0bb4f1dc485 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -41,7 +41,7 @@ use primitives::v1::{ ValidatorIndex, InboundDownwardMessage, InboundHrmpMessage, SessionInfo, }; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, + create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, FixedPointNumber, KeyTypeId, Percent, Permill, Perbill, curve::PiecewiseLinear, transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority}, traits::{ @@ -77,6 +77,7 @@ pub use pallet_staking::StakerStatus; pub use sp_runtime::BuildStorage; pub use pallet_timestamp::Call as TimestampCall; pub use pallet_balances::Call as BalancesCall; +pub use pallet_election_provider_multi_phase::Call as EPMCall; /// Constant values used within the runtime. pub mod constants; @@ -328,6 +329,7 @@ impl pallet_session::historical::Config for Runtime { type FullIdentificationOf = pallet_staking::ExposureOf; } +use pallet_election_provider_multi_phase::WeightInfo; parameter_types! { // phase durations. 1/4 of the last session for each. pub const SignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4; @@ -340,11 +342,14 @@ parameter_types! { // This formula is currently adjusted such that a typical solution will spend an amount equal // to the base deposit for every 50 kb. pub const SignedDepositByte: Balance = deposit(1, 0) / (50 * 1024); - pub SignedRewardBase: Balance = fee_for_submit_call::< - Runtime, - crate::constants::fee::WeightToFee, - crate::weights::pallet_election_provider_multi_phase::WeightInfo, - >(Perbill::from_perthousand(1500)); + pub SignedRewardBase: Balance = fee_for_submit_call::( + // give 20% threshold. + sp_runtime::FixedU128::saturating_from_rational(12, 10), + // maximum weight possible. + weights::pallet_election_provider_multi_phase::WeightInfo::::submit(SignedMaxSubmissions::get()), + // assume a solution of 200kb length. + 200 * 1024 + ); // fallback: emergency phase. pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 4a312cec5d7f..499825520ddf 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -65,7 +65,7 @@ use xcm_builder::{ }; use sp_runtime::{ - create_runtime_str, generic, impl_opaque_keys, + create_runtime_str, generic, impl_opaque_keys, FixedPointNumber, ApplyExtrinsicResult, KeyTypeId, Perbill, curve::PiecewiseLinear, transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority}, traits::{ @@ -100,6 +100,7 @@ pub use pallet_staking::StakerStatus; pub use sp_runtime::BuildStorage; pub use pallet_timestamp::Call as TimestampCall; pub use pallet_balances::Call as BalancesCall; +pub use pallet_election_provider_multi_phase::Call as EPMCall; /// Constant values used within the runtime. pub mod constants; @@ -333,6 +334,7 @@ impl pallet_session::historical::Config for Runtime { type FullIdentificationOf = pallet_staking::ExposureOf; } +use pallet_election_provider_multi_phase::WeightInfo; parameter_types! { // phase durations. 1/4 of the last session for each. pub const SignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4; @@ -345,11 +347,14 @@ parameter_types! { // This formula is currently adjusted such that a typical solution will spend an amount equal // to the base deposit for every 50 kb. pub const SignedDepositByte: Balance = deposit(1, 0) / (50 * 1024); - pub SignedRewardBase: Balance = fee_for_submit_call::< - Runtime, - crate::constants::fee::WeightToFee, - crate::weights::pallet_election_provider_multi_phase::WeightInfo, - >(Perbill::from_perthousand(1500)); + pub SignedRewardBase: Balance = fee_for_submit_call::( + // give 20% threshold. + sp_runtime::FixedU128::saturating_from_rational(12, 10), + // maximum weight possible. + weights::pallet_election_provider_multi_phase::WeightInfo::::submit(SignedMaxSubmissions::get()), + // assume a solution of 100kb length. + 100 * 1024 + ); // fallback: emergency phase. pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = diff --git a/utils/staking-miner/.gitignore b/utils/staking-miner/.gitignore new file mode 100644 index 000000000000..db7cff848330 --- /dev/null +++ b/utils/staking-miner/.gitignore @@ -0,0 +1,2 @@ +*.key +*.bin diff --git a/utils/staking-miner/Cargo.toml b/utils/staking-miner/Cargo.toml new file mode 100644 index 000000000000..15f69c02040f --- /dev/null +++ b/utils/staking-miner/Cargo.toml @@ -0,0 +1,47 @@ +[package] +name = "staking-miner" +version = "0.9.0" +authors = ["Parity Technologies "] +edition = "2018" + +[dependencies] +codec = { package = "parity-scale-codec", version = "2.0.0" } +tokio = { version = "0.2", features = ["macros"] } +log = "0.4.11" +env_logger = "0.8.3" +structopt = "0.3.0" +jsonrpsee-ws-client = { version = "0.2.0", default-features = false, features = ["tokio02"] } +jsonrpsee-types = { version = "0.2.0" } +jsonrpsee = "=0.2.0-alpha.6" +serde_json = "1.0" +serde = "1.0.0" +hex = "0.4.0" +lazy_static = "1.4.0" +paste = "1.0.5" +thiserror = "1.0.0" + +remote-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } + +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +sp-npos-elections = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } + + +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +frame-election-provider-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } + +core-primitives = { package = "polkadot-core-primitives", path = "../../core-primitives" } + +runtime-common = { package = "polkadot-runtime-common", path = "../../runtime/common" } +polkadot-runtime = { path = "../../runtime/polkadot" } +kusama-runtime = { path = "../../runtime/kusama" } +westend-runtime = { path = "../../runtime/westend" } + +[dev-dependencies] +sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } diff --git a/utils/staking-miner/src/dry_run.rs b/utils/staking-miner/src/dry_run.rs new file mode 100644 index 000000000000..853e8da588b8 --- /dev/null +++ b/utils/staking-miner/src/dry_run.rs @@ -0,0 +1,105 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! The dry-run command. + +use crate::{ + params, prelude::*, rpc_helpers::*, signer::Signer, DryRunConfig, Error, SharedConfig, WsClient, +}; +use codec::Encode; + +/// Forcefully create the snapshot. This can be used to compute the election at anytime. +fn force_create_snapshot(ext: &mut Ext) -> Result<(), Error> { + ext.execute_with(|| { + if >::exists() { + log::info!(target: LOG_TARGET, "snapshot already exists."); + Ok(()) + } else { + log::info!(target: LOG_TARGET, "creating a fake snapshot now."); + >::create_snapshot().map(|_| ()).map_err(Into::into) + } + }) +} + +/// Helper method to print the encoded size of the snapshot. +fn measure_snapshot_size(ext: &mut Ext) { + ext.execute_with(|| { + log::info!(target: LOG_TARGET, "Metadata: {:?}", >::snapshot_metadata()); + log::info!( + target: LOG_TARGET, + "Encoded Length: {:?}", + >::snapshot() + .expect("snapshot must exist before calling `measure_snapshot_size`") + .encode() + .len() + ); + }) +} + +/// Find the stake threshold in order to have at most `count` voters. +#[allow(unused)] +fn find_threshold(ext: &mut Ext, count: usize) { + ext.execute_with(|| { + let mut voters = >::snapshot() + .expect("snapshot must exist before calling `measure_snapshot_size`") + .voters; + voters.sort_by_key(|(_voter, weight, _targets)| std::cmp::Reverse(*weight)); + match voters.get(count) { + Some(threshold_voter) => println!("smallest allowed voter is {:?}", threshold_voter), + None => { + println!("requested truncation to {} voters but had only {}", count, voters.len()); + println!("smallest current voter: {:?}", voters.last()); + } + } + }) +} + +macro_rules! dry_run_cmd_for { ($runtime:ident) => { paste::paste! { + /// Execute the dry-run command. + pub(crate) async fn []( + client: &WsClient, + shared: SharedConfig, + config: DryRunConfig, + signer: Signer, + ) -> Result<(), Error> { + use $crate::[<$runtime _runtime_exports>]::*; + let mut ext = crate::create_election_ext::(shared.uri.clone(), config.at, true).await?; + force_create_snapshot::(&mut ext)?; + measure_snapshot_size::(&mut ext); + let (raw_solution, witness) = crate::mine_unchecked::(&mut ext, config.iterations, false)?; + log::info!(target: LOG_TARGET, "mined solution with {:?}", &raw_solution.score); + + let nonce = crate::get_account_info::(client, &signer.account, config.at) + .await? + .map(|i| i.nonce) + .expect("signer account is checked to exist upon startup; it can only die if it \ + transfers funds out of it, or get slashed. If it does not exist at this point, \ + it is likely due to a bug, or the signer got slashed. Terminating." + ); + let tip = 0 as Balance; + let era = sp_runtime::generic::Era::Immortal; + let extrinsic = ext.execute_with(|| create_uxt(raw_solution, witness, signer.clone(), nonce, tip, era)); + + let bytes = sp_core::Bytes(extrinsic.encode().to_vec()); + let outcome = rpc_decode::(client, "system_dryRun", params!{ bytes }).await?; + log::info!(target: LOG_TARGET, "dry-run outcome is {:?}", outcome); + Ok(()) + } +}}} + +dry_run_cmd_for!(polkadot); +dry_run_cmd_for!(kusama); +dry_run_cmd_for!(westend); diff --git a/utils/staking-miner/src/emergency_solution.rs b/utils/staking-miner/src/emergency_solution.rs new file mode 100644 index 000000000000..b41c69e1e0e6 --- /dev/null +++ b/utils/staking-miner/src/emergency_solution.rs @@ -0,0 +1,52 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! The emergency-solution command. + +use crate::{prelude::*, SharedConfig, Error}; +use std::io::Write; +use codec::Encode; + +macro_rules! emergency_solution_cmd_for { ($runtime:ident) => { paste::paste! { + /// Execute the emergency-solution command. + pub(crate) async fn []( + shared: SharedConfig, + ) -> Result<(), Error> { + use $crate::[<$runtime _runtime_exports>]::*; + let mut ext = crate::create_election_ext::(shared.uri.clone(), None, false).await?; + ext.execute_with(|| { + assert!(EPM::Pallet::::current_phase().is_emergency()); + // NOTE: this internally calls feasibility_check, but we just re-do it here as an easy way + // to get a `ReadySolution`. + let (raw_solution, _) = >::mine_solution(50)?; + log::info!(target: LOG_TARGET, "mined solution with {:?}", &raw_solution.score); + let ready_solution = EPM::Pallet::::feasibility_check(raw_solution, EPM::ElectionCompute::Signed)?; + let encoded_ready = ready_solution.encode(); + let encoded_support = ready_solution.supports.encode(); + let mut solution_file = std::fs::File::create("solution.bin")?; + let mut supports_file = std::fs::File::create("solution.supports.bin")?; + solution_file.write_all(&encoded_ready)?; + supports_file.write_all(&encoded_support)?; + log::info!(target: LOG_TARGET, "ReadySolution: size {:?} / score = {:?}", encoded_ready.len(), ready_solution.score); + log::trace!(target: LOG_TARGET, "Supports: {}", sp_core::hexdisplay::HexDisplay::from(&encoded_support)); + Ok(()) + }) + } +}}} + +emergency_solution_cmd_for!(polkadot); +emergency_solution_cmd_for!(kusama); +emergency_solution_cmd_for!(westend); diff --git a/utils/staking-miner/src/main.rs b/utils/staking-miner/src/main.rs new file mode 100644 index 000000000000..0bc83866f977 --- /dev/null +++ b/utils/staking-miner/src/main.rs @@ -0,0 +1,493 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! # Polkadot Staking Miner. +//! +//! Simple bot capable of monitoring a polkadot (and cousins) chain and submitting solutions to the +//! 'pallet-election-provider-multi-phase'. See `--help` for more details. +//! +//! # Implementation Notes: +//! +//! - First draft: Be aware that this is the first draft and there might be bugs, or undefined +//! behaviors. Don't attach this bot to an account with lots of funds. +//! - Quick to crash: The bot is written so that it only continues to work if everything goes well. +//! In case of any failure (RPC, logic, IO), it will crash. This was a decision to simplify the +//! development. It is intended to run this bot with a `restart = true` way, so that it reports it +//! crash, but resumes work thereafter. + +mod dry_run; +mod emergency_solution; +mod monitor; +mod prelude; +mod rpc_helpers; +mod signer; + +pub(crate) use prelude::*; +pub(crate) use signer::get_account_info; + +use jsonrpsee_ws_client::{WsClient, WsClientBuilder}; +use remote_externalities::{Builder, Mode, OnlineConfig}; +use sp_runtime::traits::Block as BlockT; +use structopt::StructOpt; + +pub(crate) enum AnyRuntime { + Polkadot, + Kusama, + Westend, +} + +pub(crate) static mut RUNTIME: AnyRuntime = AnyRuntime::Polkadot; + +macro_rules! construct_runtime_prelude { + ($runtime:ident) => { paste::paste! { + #[allow(unused_import)] + pub(crate) mod [<$runtime _runtime_exports>] { + pub(crate) use crate::prelude::EPM; + pub(crate) use [<$runtime _runtime>]::*; + pub(crate) use crate::monitor::[] as monitor_cmd; + pub(crate) use crate::dry_run::[] as dry_run_cmd; + pub(crate) use crate::emergency_solution::[] as emergency_solution_cmd; + pub(crate) use private::{[] as create_uxt}; + + mod private { + use super::*; + pub(crate) fn []( + raw_solution: EPM::RawSolution>, + witness: u32, + signer: crate::signer::Signer, + nonce: crate::prelude::Index, + tip: crate::prelude::Balance, + era: sp_runtime::generic::Era, + ) -> UncheckedExtrinsic { + use codec::Encode as _; + use sp_core::Pair as _; + use sp_runtime::traits::StaticLookup as _; + + let crate::signer::Signer { account, pair, .. } = signer; + + let local_call = EPMCall::::submit(raw_solution, witness); + let call: Call = as std::convert::TryInto>::try_into(local_call) + .expect("election provider pallet must exist in the runtime, thus \ + inner call can be converted, qed." + ); + + let extra: SignedExtra = crate::[](nonce, tip, era); + let raw_payload = SignedPayload::new(call, extra).expect("creating signed payload infallible; qed."); + let signature = raw_payload.using_encoded(|payload| { + pair.clone().sign(payload) + }); + let (call, extra, _) = raw_payload.deconstruct(); + let address = ::Lookup::unlookup(account.clone()); + let extrinsic = UncheckedExtrinsic::new_signed(call, address, signature.into(), extra); + log::debug!( + target: crate::LOG_TARGET, "constructed extrinsic {}", + sp_core::hexdisplay::HexDisplay::from(&extrinsic.encode()) + ); + extrinsic + } + } + }} + }; +} + +// NOTE: we might be able to use some code from the bridges repo here. +fn signed_ext_builder_polkadot( + nonce: Index, + tip: Balance, + era: sp_runtime::generic::Era, +) -> polkadot_runtime_exports::SignedExtra { + use polkadot_runtime_exports::Runtime; + ( + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckMortality::::from(era), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(tip), + runtime_common::claims::PrevalidateAttests::::new(), + ) +} + +fn signed_ext_builder_kusama( + nonce: Index, + tip: Balance, + era: sp_runtime::generic::Era, +) -> kusama_runtime_exports::SignedExtra { + use kusama_runtime_exports::Runtime; + ( + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckMortality::::from(era), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(tip), + ) +} + +fn signed_ext_builder_westend( + nonce: Index, + tip: Balance, + era: sp_runtime::generic::Era, +) -> westend_runtime_exports::SignedExtra { + use westend_runtime_exports::Runtime; + ( + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckMortality::::from(era), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(tip), + ) +} + +construct_runtime_prelude!(polkadot); +construct_runtime_prelude!(kusama); +construct_runtime_prelude!(westend); + +// NOTE: this is no longer used extensively, most of the per-runtime stuff us delegated to +// `construct_runtime_prelude` and macro's the import directly from it. A part of the code is also +// still generic over `T`. My hope is to still make everything generic over a `Runtime`, but sadly +// that is not currently possible as each runtime has its unique `Call`, and all Calls are not +// sharing any generic trait. In other words, to create the `UncheckedExtrinsic` of each chain, you +// need the concrete `Call` of that chain as well. +#[macro_export] +macro_rules! any_runtime { + ($($code:tt)*) => { + unsafe { + match $crate::RUNTIME { + $crate::AnyRuntime::Polkadot => { + use $crate::polkadot_runtime_exports::*; + $($code)* + }, + $crate::AnyRuntime::Kusama => { + use $crate::kusama_runtime_exports::*; + $($code)* + }, + $crate::AnyRuntime::Westend => { + use $crate::westend_runtime_exports::*; + $($code)* + } + } + } + } +} + +#[derive(Debug, thiserror::Error)] +enum Error { + Io(#[from] std::io::Error), + Jsonrpsee(#[from] jsonrpsee_ws_client::Error), + Codec(#[from] codec::Error), + Crypto(sp_core::crypto::SecretStringError), + RemoteExternalities(&'static str), + PalletMiner(EPM::unsigned::MinerError), + PalletElection(EPM::ElectionError), + PalletFeasibility(EPM::FeasibilityError), + AccountDoesNotExists, + IncorrectPhase, + AlreadySubmitted, +} + +impl From for Error { + fn from(e: sp_core::crypto::SecretStringError) -> Error { + Error::Crypto(e) + } +} + +impl From for Error { + fn from(e: EPM::unsigned::MinerError) -> Error { + Error::PalletMiner(e) + } +} + +impl From for Error { + fn from(e: EPM::ElectionError) -> Error { + Error::PalletElection(e) + } +} + +impl From for Error { + fn from(e: EPM::FeasibilityError) -> Error { + Error::PalletFeasibility(e) + } +} + +impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::fmt(self, f) + } +} + +#[derive(Debug, Clone, StructOpt)] +enum Command { + /// Monitor for the phase being signed, then compute. + Monitor(MonitorConfig), + /// Just compute a solution now, and don't submit it. + DryRun(DryRunConfig), + /// Provide a solution that can be submitted to the chian as an emergency response. + EmergencySolution, +} + +#[derive(Debug, Clone, StructOpt)] +struct MonitorConfig { + /// They type of event to listen to. + /// + /// Typically, finalized is safer and there is no chance of anything going wrong, but it can be + /// slower. It is recommended to use finalized, if the duration of the signed phase is longer + /// than the the finality delay. + #[structopt(long, default_value = "head", possible_values = &["head", "finalized"])] + listen: String, + + #[structopt(long, short, default_value = "10")] + iterations: usize, +} + +#[derive(Debug, Clone, StructOpt)] +struct DryRunConfig { + /// The block hash at which scraping happens. If none is provided, the latest head is used. + #[structopt(long)] + at: Option, + + #[structopt(long, short, default_value = "10")] + iterations: usize, +} + +#[derive(Debug, Clone, StructOpt)] +struct SharedConfig { + /// The ws node to connect to. + #[structopt(long, default_value = DEFAULT_URI)] + uri: String, + + /// The file from which we read the account seed. + /// + /// WARNING: don't use an account with a large stash for this. Based on how the bot is + /// configured, it might re-try lose funds through transaction fees/deposits. + #[structopt(long)] + account_seed: std::path::PathBuf, +} + +#[derive(Debug, Clone, StructOpt)] +struct Opt { + /// The ws node to connect to. + #[structopt(flatten)] + shared: SharedConfig, + + #[structopt(subcommand)] + command: Command, +} + +/// Build the `Ext` at `hash` with all the data of `ElectionProviderMultiPhase` and `Staking` +/// stored. +async fn create_election_ext( + uri: String, + at: Option, + with_staking: bool, +) -> Result { + use frame_support::{storage::generator::StorageMap, traits::PalletInfo}; + let system_block_hash_key = >::prefix_hash(); + + Builder::::new() + .mode(Mode::Online(OnlineConfig { + transport: uri.into(), + at, + modules: if with_staking { + vec![ + ::PalletInfo::name::>() + .expect("Pallet always has name; qed.") + .to_string(), + ::PalletInfo::name::>() + .expect("Pallet always has name; qed.") + .to_string(), + ] + } else { + vec![::PalletInfo::name::>() + .expect("Pallet always has name; qed.") + .to_string() + ] + }, + ..Default::default() + })) + .inject_hashed_prefix(&system_block_hash_key) + .build() + .await + .map_err(|why| Error::RemoteExternalities(why)) +} + +/// Compute the election at the given block number. It expects to NOT be `Phase::Off`. In other +/// words, the snapshot must exists on the given externalities. +fn mine_unchecked( + ext: &mut Ext, + iterations: usize, + do_feasibility: bool, +) -> Result<(EPM::RawSolution>, u32), Error> { + ext.execute_with(|| { + let (solution, _) = >::mine_solution(iterations)?; + if do_feasibility { + let _ = >::feasibility_check(solution.clone(), EPM::ElectionCompute::Signed)?; + } + let witness = >::decode_len().unwrap_or_default(); + Ok((solution, witness as u32)) + }) +} + +#[allow(unused)] +fn mine_dpos(ext: &mut Ext) -> Result<(), Error> { + ext.execute_with(|| { + use std::collections::BTreeMap; + use EPM::RoundSnapshot; + let RoundSnapshot { voters, .. } = EPM::Snapshot::::get().unwrap(); + let desired_targets = EPM::DesiredTargets::::get().unwrap(); + let mut candidates_and_backing = BTreeMap::::new(); + voters.into_iter().for_each(|(who, stake, targets)| { + if targets.len() == 0 { + println!("target = {:?}", (who, stake, targets)); + return; + } + let share: u128 = (stake as u128) / (targets.len() as u128); + for target in targets { + *candidates_and_backing.entry(target.clone()).or_default() += share + } + }); + + let mut candidates_and_backing = + candidates_and_backing.into_iter().collect::>(); + candidates_and_backing.sort_by_key(|(_, total_stake)| *total_stake); + let winners = candidates_and_backing + .into_iter() + .rev() + .take(desired_targets as usize) + .collect::>(); + let score = { + let min_staker = *winners.last().map(|(_, stake)| stake).unwrap(); + let sum_stake = winners.iter().fold(0u128, |acc, (_, stake)| acc + stake); + let sum_squared = winners.iter().fold(0u128, |acc, (_, stake)| acc + stake); + [min_staker, sum_stake, sum_squared] + }; + println!("mined a dpos-like solution with score = {:?}", score); + Ok(()) + }) +} + +#[tokio::main] +async fn main() { + env_logger::Builder::from_default_env().format_module_path(true).format_level(true).init(); + let Opt { shared, command } = Opt::from_args(); + log::debug!(target: LOG_TARGET, "attempting to connect to {:?}", shared.uri); + + let client = loop { + let maybe_client = WsClientBuilder::default() + .connection_timeout(std::time::Duration::new(20, 0)) + .max_request_body_size(u32::MAX) + .build(&shared.uri) + .await; + match maybe_client { + Ok(client) => break client, + Err(why) => { + log::warn!( + target: LOG_TARGET, + "failed to connect to client due to {:?}, retrying soon..", + why + ); + std::thread::sleep(std::time::Duration::from_millis(2500)); + } + } + }; + + let chain = rpc_helpers::rpc::(&client, "system_chain", params! {}) + .await + .expect("system_chain infallible; qed."); + match chain.to_lowercase().as_str() { + "polkadot" | "development" => { + sp_core::crypto::set_default_ss58_version( + sp_core::crypto::Ss58AddressFormat::PolkadotAccount, + ); + // safety: this program will always be single threaded, thus accessing global static is + // safe. + unsafe { + RUNTIME = AnyRuntime::Polkadot; + } + } + "kusama" | "kusama-dev" => { + sp_core::crypto::set_default_ss58_version( + sp_core::crypto::Ss58AddressFormat::KusamaAccount, + ); + // safety: this program will always be single threaded, thus accessing global static is + // safe. + unsafe { + RUNTIME = AnyRuntime::Kusama; + } + } + "westend" => { + sp_core::crypto::set_default_ss58_version( + sp_core::crypto::Ss58AddressFormat::PolkadotAccount, + ); + // safety: this program will always be single threaded, thus accessing global static is + // safe. + unsafe { + RUNTIME = AnyRuntime::Westend; + } + } + _ => { + eprintln!("unexpected chain: {:?}", chain); + return; + } + } + log::info!(target: LOG_TARGET, "connected to chain {:?}", chain); + + let signer_account = any_runtime! { + signer::read_signer_uri::<_, Runtime>(&shared.account_seed, &client) + .await + .expect("Provided account is invalid, terminating.") + }; + + let outcome = any_runtime! { + match command.clone() { + Command::Monitor(c) => monitor_cmd(&client, shared, c, signer_account).await, + // --------------------^^ comes from the macro prelude, needs no generic. + Command::DryRun(c) => dry_run_cmd(&client, shared, c, signer_account).await, + Command::EmergencySolution => emergency_solution_cmd(shared.clone()).await, + } + }; + log::info!(target: LOG_TARGET, "round of execution finished. outcome = {:?}", outcome); +} + +#[cfg(test)] +mod tests { + use super::*; + + fn get_version() -> sp_version::RuntimeVersion { + use frame_support::traits::Get; + T::Version::get() + } + + #[test] + fn any_runtime_works() { + unsafe { + RUNTIME = AnyRuntime::Polkadot; + } + let polkadot_version = any_runtime! { get_version::() }; + + unsafe { + RUNTIME = AnyRuntime::Kusama; + } + let kusama_version = any_runtime! { get_version::() }; + + assert_eq!(polkadot_version.spec_name, "polkadot".into()); + assert_eq!(kusama_version.spec_name, "kusama".into()); + } +} diff --git a/utils/staking-miner/src/monitor.rs b/utils/staking-miner/src/monitor.rs new file mode 100644 index 000000000000..502b5a0bc55e --- /dev/null +++ b/utils/staking-miner/src/monitor.rs @@ -0,0 +1,163 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! The monitor command. + +use crate::{ + params, prelude::*, rpc_helpers::*, signer::Signer, Error, MonitorConfig, SharedConfig, +}; +use codec::Encode; +use jsonrpsee_ws_client::{ + traits::SubscriptionClient, v2::params::JsonRpcParams, Subscription, WsClient, +}; +use sp_transaction_pool::TransactionStatus; + +/// Ensure that now is the signed phase. +async fn ensure_signed_phase( + client: &WsClient, + at: B::Hash, +) -> Result<(), Error> { + let key = sp_core::storage::StorageKey(EPM::CurrentPhase::::hashed_key().to_vec()); + let phase = get_storage::>(client, params! {key, at}) + .await? + .unwrap_or_default(); + + if phase.is_signed() { + Ok(()) + } else { + Err(Error::IncorrectPhase) + } +} + +/// Ensure that our current `us` have not submitted anything previously. +async fn ensure_no_previous_solution< + T: EPM::Config + frame_system::Config, + B: BlockT, +>( + ext: &mut Ext, + us: &AccountId, +) -> Result<(), Error> { + use EPM::signed::SignedSubmissions; + ext.execute_with(|| { + if >::get().iter().any(|ss| &ss.who == us) { + Err(Error::AlreadySubmitted) + } else { + Ok(()) + } + }) +} + +macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! { + /// The monitor command. + pub(crate) async fn []( + client: &WsClient, + shared: SharedConfig, + config: MonitorConfig, + signer: Signer, + ) -> Result<(), Error> { + use $crate::[<$runtime _runtime_exports>]::*; + let (sub, unsub) = if config.listen == "head" { + ("chain_subscribeNewHeads", "chain_unsubscribeNewHeads") + } else { + ("chain_subscribeFinalizedHeads", "chain_unsubscribeFinalizedHeads") + }; + + log::info!(target: LOG_TARGET, "subscribing to {:?} / {:?}", sub, unsub); + let mut subscription: Subscription
= client + .subscribe(&sub, JsonRpcParams::NoParams, &unsub) + .await + .unwrap(); + + while let Some(now) = subscription.next().await? { + let hash = now.hash(); + log::debug!(target: LOG_TARGET, "new event at #{:?} ({:?})", now.number, hash); + + // we prefer doing this check before fetching anything into a remote-ext. + if ensure_signed_phase::(client, hash).await.is_err() { + log::debug!(target: LOG_TARGET, "phase closed, not interested in this block at all."); + continue; + }; + + // NOTE: we don't check the score of any of the submitted solutions. If we submit a weak + // one, as long as we are valid, we will end up getting our deposit back, so not a big + // deal for now. Note that to avoid an unfeasible solution, we should make sure that we + // only start the process on a finalized snapshot. If the signed phase is long enough, + // this will not be a solution. + + // grab an externalities without staking, just the election snapshot. + let mut ext = crate::create_election_ext::(shared.uri.clone(), Some(hash), false).await?; + + if ensure_no_previous_solution::(&mut ext, &signer.account).await.is_err() { + log::debug!(target: LOG_TARGET, "We already have a solution in this phase, skipping."); + continue; + } + + let (raw_solution, witness) = crate::mine_unchecked::(&mut ext, config.iterations, true)?; + log::info!(target: LOG_TARGET, "mined solution with {:?}", &raw_solution.score); + + let nonce = crate::get_account_info::(client, &signer.account, Some(hash)) + .await? + .map(|i| i.nonce) + .expect(crate::signer::SIGNER_ACCOUNT_WILL_EXIST); + let tip = 0 as Balance; + let period = ::BlockHashCount::get() / 2; + let current_block = now.number.saturating_sub(1); + let era = sp_runtime::generic::Era::mortal(period.into(), current_block.into()); + log::trace!(target: LOG_TARGET, "transaction mortality: {:?} -> {:?}", era.birth(current_block.into()), era.death(current_block.into())); + let extrinsic = ext.execute_with(|| create_uxt(raw_solution, witness, signer.clone(), nonce, tip, era)); + let bytes = sp_core::Bytes(extrinsic.encode()); + + let mut tx_subscription: Subscription< + TransactionStatus<::Hash, ::Hash> + > = client + .subscribe(&"author_submitAndWatchExtrinsic", params! { bytes }, "author_unwatchExtrinsic") + .await + .unwrap(); + + let _success = while let Some(status_update) = tx_subscription.next().await? { + log::trace!(target: LOG_TARGET, "status update {:?}", status_update); + match status_update { + TransactionStatus::Ready | TransactionStatus::Broadcast(_) | TransactionStatus::Future => continue, + TransactionStatus::InBlock(hash) => { + log::info!(target: LOG_TARGET, "included at {:?}", hash); + let key = sp_core::storage::StorageKey(frame_system::Events::::hashed_key().to_vec()); + let events =get_storage::< + Vec::Hash>> + >(client, params!{ key, hash }).await?.unwrap_or_default(); + log::info!(target: LOG_TARGET, "events at inclusion {:?}", events); + } + TransactionStatus::Retracted(hash) => { + log::info!(target: LOG_TARGET, "Retracted at {:?}", hash); + } + TransactionStatus::Finalized(hash) => { + log::info!(target: LOG_TARGET, "Finalized at {:?}", hash); + break + } + _ => { + log::warn!(target: LOG_TARGET, "Stopping listen due to other status {:?}", status_update); + break + } + } + }; + } + + Ok(()) + } +}}} + +monitor_cmd_for!(polkadot); +monitor_cmd_for!(kusama); +monitor_cmd_for!(westend); diff --git a/utils/staking-miner/src/prelude.rs b/utils/staking-miner/src/prelude.rs new file mode 100644 index 000000000000..7989c2e3c66b --- /dev/null +++ b/utils/staking-miner/src/prelude.rs @@ -0,0 +1,48 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! Types that we don't fetch from a particular runtime and just assume that they are constant all +//! of the place. +//! +//! It is actually easy to convert the rest as well, but it'll be a lot of noise in our codebase, +//! needing to sprinkle `any_runtime` in a few extra places. + +/// The account id type. +pub type AccountId = core_primitives::AccountId; +/// The block number type. +pub type BlockNumber = core_primitives::BlockNumber; +/// The balance type. +pub type Balance = core_primitives::Balance; +/// The index of an account. +pub type Index = core_primitives::AccountIndex; +/// The hash type. We re-export it here, but we can easily get it from block as well. +pub type Hash = core_primitives::Hash; + +pub use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; + +/// Default URI to connect to. +pub const DEFAULT_URI: &'static str = "wss://rpc.polkadot.io"; +/// The logging target. +pub const LOG_TARGET: &'static str = "staking-miner"; + +/// The election provider pallet. +pub use pallet_election_provider_multi_phase as EPM; + +/// The externalities type. +pub type Ext = sp_io::TestExternalities; + +/// The key pair type being used. We 'strongly' assume sr25519 for simplicity. +pub type Pair = sp_core::sr25519::Pair; diff --git a/utils/staking-miner/src/rpc_helpers.rs b/utils/staking-miner/src/rpc_helpers.rs new file mode 100644 index 000000000000..c2590d1f8406 --- /dev/null +++ b/utils/staking-miner/src/rpc_helpers.rs @@ -0,0 +1,107 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! Helper method for RPC. + +use super::*; +use jsonrpsee_ws_client::traits::Client; +pub(crate) use jsonrpsee_ws_client::v2::params::JsonRpcParams; + +#[macro_export] +macro_rules! params { + ($($param:expr),*) => { + { + let mut __params = vec![]; + $( + __params.push(serde_json::to_value($param).expect("json serialization infallible; qed.")); + )* + $crate::rpc_helpers::JsonRpcParams::Array(__params) + } + }; + () => { + $crate::rpc::JsonRpcParams::NoParams, + } +} + +/// Make the rpc request, returning `Ret`. +pub(crate) async fn rpc<'a, Ret: serde::de::DeserializeOwned>( + client: &WsClient, + method: &'a str, + params: JsonRpcParams<'a>, +) -> Result { + client.request::(method, params).await.map_err(Into::into) +} + +/// Make the rpc request, decode the outcome into `Dec`. Don't use for storage, it will fail for +/// non-existent storage items. +pub(crate) async fn rpc_decode<'a, Dec: codec::Decode>( + client: &WsClient, + method: &'a str, + params: JsonRpcParams<'a>, +) -> Result { + let bytes = rpc::(client, method, params).await?; + ::decode(&mut &*bytes.0).map_err(Into::into) +} + +/// Get the storage item. +pub(crate) async fn get_storage<'a, T: codec::Decode>( + client: &WsClient, + params: JsonRpcParams<'a>, +) -> Result, Error> { + let maybe_bytes = rpc::>(client, "state_getStorage", params).await?; + if let Some(bytes) = maybe_bytes { + let decoded = ::decode(&mut &*bytes.0)?; + Ok(Some(decoded)) + } else { + Ok(None) + } +} + +use codec::{EncodeLike, FullCodec}; +use frame_support::storage::{StorageMap, StorageValue}; +#[allow(unused)] +pub(crate) async fn get_storage_value_frame_v2<'a, V: StorageValue, T: FullCodec, Hash>( + client: &WsClient, + maybe_at: Option, +) -> Result, Error> +where + V::Query: codec::Decode, + Hash: serde::Serialize, +{ + let key = >::hashed_key(); + get_storage::(&client, params! { key, maybe_at }).await +} + +#[allow(unused)] +pub(crate) async fn get_storage_map_frame_v2< + 'a, + Hash, + KeyArg: EncodeLike, + K: FullCodec, + T: FullCodec, + M: StorageMap, +>( + client: &WsClient, + key: KeyArg, + maybe_at: Option, +) -> Result, Error> +where + M::Query: codec::Decode, + Hash: serde::Serialize, +{ + let key = >::hashed_key_for(key); + get_storage::(&client, params! { key, maybe_at }).await +} diff --git a/utils/staking-miner/src/signer.rs b/utils/staking-miner/src/signer.rs new file mode 100644 index 000000000000..409d7befab8a --- /dev/null +++ b/utils/staking-miner/src/signer.rs @@ -0,0 +1,73 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! Wrappers around creating a signer account. + +use crate::{rpc_helpers, AccountId, Error, Index, Pair, WsClient, LOG_TARGET}; +use sp_core::crypto::Pair as _; +use std::path::Path; + +pub(crate) const SIGNER_ACCOUNT_WILL_EXIST: &'static str = + "signer account is checked to exist upon startup; it can only die if it transfers funds out \ + of it, or get slashed. If it does not exist at this point, it is likely due to a bug, or the \ + signer got slashed. Terminating."; + +/// Some information about the signer. Redundant at this point, but makes life easier. +#[derive(Clone)] +pub(crate) struct Signer { + /// The account id. + pub(crate) account: AccountId, + /// The full crypto key-pair. + pub(crate) pair: Pair, + /// The raw uri read from file. + pub(crate) uri: String, +} + +pub(crate) async fn get_account_info( + client: &WsClient, + who: &T::AccountId, + maybe_at: Option, +) -> Result>, Error> { + rpc_helpers::get_storage::>( + client, + crate::params! { + sp_core::storage::StorageKey(>::hashed_key_for(&who)), + maybe_at + }, + ) + .await +} + +/// Read the signer account's uri from the given `path`. +pub(crate) async fn read_signer_uri< + P: AsRef, + T: frame_system::Config, +>( + path: P, + client: &WsClient, +) -> Result { + let uri = std::fs::read_to_string(path)?; + + // trim any trailing garbage. + let uri = uri.trim_end(); + + let pair = Pair::from_string(&uri, None)?; + let account = T::AccountId::from(pair.public()); + let _info = + get_account_info::(&client, &account, None).await?.ok_or(Error::AccountDoesNotExists)?; + log::info!(target: LOG_TARGET, "loaded account {:?}, info: {:?}", &account, _info); + Ok(Signer { account, pair, uri: uri.to_string() }) +}