From 5b77a8987451d55929ad3ca7848e33d77f8fd1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Thu, 1 Apr 2021 12:50:04 +0200 Subject: [PATCH] Merkle Mountain Range & BEEFY integration (#2101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Switch branch. * Implement basic MMR leaf. * Revert "Switch branch." This reverts commit 7f4d41c67f27ca560c53fc63fd3bd06ac182403c. * Bump substrate. * Integrate BEEFY. Bump all. Fix missing imports. * Use beefy pallet to get authorities. * Bump BEEFY repo. * Use next authority set instead of the current one. * Start BEEFY service. * Fix BEEFY start up. * Cache BEEFY authority set. * Add BEEFY ValidatorSetId to MMR * Fix code. * Apply suggestions from code review Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by: Hernando Castano * Review grumbles. * Update beefy repo. * Work-around missing protocol. * Revert "Work-around missing protocol." This reverts commit 0a6257a8bccc1c67e966898cdedc408c6469ffd6. * Add beefy peers set config. * Expose storage of BEEFY. * Uncompress BEEFY keys for merkle tree. * Update ordering. * Switch to branch. * Bump deps. * Switch to custom beefy. * Add MMR RuntimeApi and custom rpc. * Add set length details. * Fix compilation. * Expose MmrLeaf storage. * Expose MmrLeaf storage. * Don't use session handler, and rather compute & cache beefy details on call. * Don't use session handler, and rather compute & cache beefy details on call. * Fixes. * Update Cargo.lock. * Switch back to master. * Update lockfile. * Fix xcm print issue. * Cargo.lock. * Use master branch. * Remove extra dep. * Fix tests. * Update Cargo.lock * Add BEEFY & MMR to westend. * Implement session keys migration. * Update testnet script. * start BEEFY for all node types * Update Cargo.lock * fix Cargo.toml * resolve another merge conflict * add Westend BEEFY keys * Apply suggestions from code review Co-authored-by: Hernando Castano * Update BEEFY. * Add Rococo BEEFY keys * resolve merge issue * fix pallet indices * fix Westend OldSessionKey * remove unused imports in Westend runtime * Fix compilation for Westend. * address review * start BEEFY gadget conditionally * address review again * fix typo * remove duplicate * remove another duplicate * well * add missing stuff * cleanup Cargo.toml files - revert unnecessary changes - add missing /std dependencies - remove unused dependencies * runtime: remove unused structs from rococo runtime * node: cleanup service Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by: Hernando Castano Co-authored-by: adoerr <0xad@gmx.net> Co-authored-by: André Silva --- polkadot/Cargo.lock | 464 ++++++++++++++------- polkadot/node/service/Cargo.toml | 3 + polkadot/node/service/src/chain_spec.rs | 501 ++++++++++++----------- polkadot/node/service/src/client.rs | 7 +- polkadot/node/service/src/lib.rs | 50 ++- polkadot/rpc/Cargo.toml | 29 +- polkadot/rpc/src/lib.rs | 31 +- polkadot/runtime/common/Cargo.toml | 14 +- polkadot/runtime/common/src/lib.rs | 4 +- polkadot/runtime/common/src/mmr.rs | 216 ++++++++++ polkadot/runtime/kusama/Cargo.toml | 4 + polkadot/runtime/kusama/src/lib.rs | 34 ++ polkadot/runtime/parachains/Cargo.toml | 2 +- polkadot/runtime/polkadot/Cargo.toml | 4 + polkadot/runtime/polkadot/src/lib.rs | 34 ++ polkadot/runtime/rococo/Cargo.toml | 18 +- polkadot/runtime/rococo/src/lib.rs | 117 +++++- polkadot/runtime/test-runtime/Cargo.toml | 2 + polkadot/runtime/test-runtime/src/lib.rs | 34 ++ polkadot/runtime/westend/Cargo.toml | 9 + polkadot/runtime/westend/src/lib.rs | 110 ++++- polkadot/scripts/prepare-test-net.sh | 12 + 22 files changed, 1282 insertions(+), 417 deletions(-) create mode 100644 polkadot/runtime/common/src/mmr.rs diff --git a/polkadot/Cargo.lock b/polkadot/Cargo.lock index 3954423333..ad099b4331 100644 --- a/polkadot/Cargo.lock +++ b/polkadot/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "Inflector" version = "0.11.4" @@ -443,6 +445,67 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "beefy-gadget" +version = "0.1.0" +source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#8213c08e3dcf7fc732b3be6c73f8c6d3619abae2" +dependencies = [ + "beefy-primitives", + "futures 0.3.13", + "hex", + "log", + "parity-scale-codec", + "parking_lot 0.11.1", + "sc-client-api", + "sc-keystore", + "sc-network", + "sc-network-gossip", + "sp-api", + "sp-application-crypto", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-utils", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "beefy-gadget-rpc" +version = "0.1.0" +source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#8213c08e3dcf7fc732b3be6c73f8c6d3619abae2" +dependencies = [ + "beefy-gadget", + "beefy-primitives", + "futures 0.3.13", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "jsonrpc-pubsub", + "log", + "parity-scale-codec", + "sc-rpc", + "serde", + "serde_json", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "beefy-primitives" +version = "0.1.0" +source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#8213c08e3dcf7fc732b3be6c73f8c6d3619abae2" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "bincode" version = "1.3.1" @@ -850,6 +913,15 @@ dependencies = [ "generic-array 0.14.4", ] +[[package]] +name = "ckb-merkle-mountain-range" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e486fe53bb9f2ca0f58cb60e8679a5354fd6687a839942ef0a75967250289ca6" +dependencies = [ + "cfg-if 0.1.10", +] + [[package]] name = "clang-sys" version = "0.29.3" @@ -1684,7 +1756,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", ] @@ -1702,7 +1774,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "3.1.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -1721,7 +1793,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "Inflector", "chrono", @@ -1744,7 +1816,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -1757,7 +1829,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -1773,7 +1845,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "serde", @@ -1784,7 +1856,7 @@ dependencies = [ [[package]] name = "frame-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "bitflags", "frame-metadata", @@ -1810,7 +1882,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -1822,7 +1894,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -1834,7 +1906,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "proc-macro2", "quote", @@ -1844,7 +1916,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-metadata", "frame-support", @@ -1865,7 +1937,7 @@ dependencies = [ [[package]] name = "frame-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -1882,7 +1954,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -1896,7 +1968,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "sp-api", @@ -1905,7 +1977,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "parity-scale-codec", @@ -3010,6 +3082,7 @@ dependencies = [ name = "kusama-runtime" version = "0.8.30" dependencies = [ + "beefy-primitives", "bitvec", "frame-benchmarking", "frame-executive", @@ -3035,6 +3108,7 @@ dependencies = [ "pallet-im-online", "pallet-indices", "pallet-membership", + "pallet-mmr-primitives", "pallet-multisig", "pallet-nicks", "pallet-offences", @@ -4290,7 +4364,7 @@ checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" [[package]] name = "pallet-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -4306,7 +4380,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -4321,7 +4395,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4345,7 +4419,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4357,10 +4431,25 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-beefy" +version = "0.1.0" +source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#8213c08e3dcf7fc732b3be6c73f8c6d3619abae2" +dependencies = [ + "beefy-primitives", + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec", + "serde", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-bounties" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4375,7 +4464,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4392,7 +4481,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4407,7 +4496,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4428,7 +4517,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4444,7 +4533,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4466,7 +4555,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4482,7 +4571,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4502,7 +4591,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4519,7 +4608,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -4530,10 +4619,62 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-mmr" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#099ee1486aa9acbcfa05f16ae114d316632824f9" +dependencies = [ + "ckb-merkle-mountain-range", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-mmr-primitives", + "parity-scale-codec", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-mmr-primitives" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#099ee1486aa9acbcfa05f16ae114d316632824f9" +dependencies = [ + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "serde", + "sp-api", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-mmr-rpc" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#099ee1486aa9acbcfa05f16ae114d316632824f9" +dependencies = [ + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "pallet-mmr-primitives", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", +] + [[package]] name = "pallet-multisig" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4549,7 +4690,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -4563,7 +4704,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -4579,7 +4720,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4601,7 +4742,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4617,7 +4758,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -4630,7 +4771,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "enumflags2", "frame-support", @@ -4645,7 +4786,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4661,7 +4802,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -4681,7 +4822,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4697,7 +4838,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -4711,7 +4852,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4735,7 +4876,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -4746,7 +4887,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -4760,7 +4901,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4779,7 +4920,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4794,7 +4935,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-support", "frame-system", @@ -4810,7 +4951,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4827,7 +4968,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -4838,7 +4979,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4854,7 +4995,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-benchmarking", "frame-support", @@ -4870,7 +5011,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5978,7 +6119,10 @@ dependencies = [ name = "polkadot-rpc" version = "0.8.30" dependencies = [ + "beefy-gadget", + "beefy-gadget-rpc", "jsonrpc-core", + "pallet-mmr-rpc", "pallet-transaction-payment-rpc", "parity-scale-codec", "polkadot-primitives", @@ -6007,6 +6151,7 @@ dependencies = [ name = "polkadot-runtime" version = "0.8.30" dependencies = [ + "beefy-primitives", "bitvec", "frame-benchmarking", "frame-executive", @@ -6032,6 +6177,7 @@ dependencies = [ "pallet-im-online", "pallet-indices", "pallet-membership", + "pallet-mmr-primitives", "pallet-multisig", "pallet-nicks", "pallet-offences", @@ -6086,6 +6232,7 @@ dependencies = [ name = "polkadot-runtime-common" version = "0.8.30" dependencies = [ + "beefy-primitives", "bitvec", "frame-benchmarking", "frame-support", @@ -6098,6 +6245,8 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-balances", + "pallet-beefy", + "pallet-mmr", "pallet-offences", "pallet-randomness-collective-flip", "pallet-session", @@ -6186,6 +6335,8 @@ dependencies = [ name = "polkadot-service" version = "0.8.30" dependencies = [ + "beefy-gadget", + "beefy-primitives", "env_logger 0.8.2", "frame-benchmarking", "frame-system-rpc-runtime-api", @@ -6194,6 +6345,7 @@ dependencies = [ "kusama-runtime", "pallet-babe", "pallet-im-online", + "pallet-mmr-primitives", "pallet-staking", "pallet-transaction-payment-rpc-runtime-api", "polkadot-approval-distribution", @@ -6329,6 +6481,7 @@ dependencies = [ name = "polkadot-test-runtime" version = "0.8.30" dependencies = [ + "beefy-primitives", "bitvec", "frame-election-provider-support", "frame-executive", @@ -6344,6 +6497,7 @@ dependencies = [ "pallet-balances", "pallet-grandpa", "pallet-indices", + "pallet-mmr-primitives", "pallet-nicks", "pallet-offences", "pallet-randomness-collective-flip", @@ -7040,7 +7194,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "env_logger 0.8.2", "hex-literal", @@ -7118,6 +7272,7 @@ dependencies = [ name = "rococo-runtime" version = "0.8.30" dependencies = [ + "beefy-primitives", "frame-executive", "frame-support", "frame-system", @@ -7128,9 +7283,12 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-balances", + "pallet-beefy", "pallet-grandpa", "pallet-im-online", "pallet-indices", + "pallet-mmr", + "pallet-mmr-primitives", "pallet-offences", "pallet-proxy", "pallet-session", @@ -7309,7 +7467,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-trait", "derive_more", @@ -7337,7 +7495,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", @@ -7360,7 +7518,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7376,7 +7534,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -7397,7 +7555,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -7408,7 +7566,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "chrono", "fdlimit", @@ -7446,7 +7604,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "derive_more", "fnv", @@ -7480,7 +7638,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "blake2-rfc", "hash-db", @@ -7510,7 +7668,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parking_lot 0.11.1", "sc-client-api", @@ -7522,7 +7680,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-trait", "derive_more", @@ -7569,7 +7727,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "derive_more", "futures 0.3.13", @@ -7593,7 +7751,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7606,7 +7764,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-trait", "futures 0.3.13", @@ -7633,7 +7791,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "log", "sc-client-api", @@ -7647,7 +7805,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "derive_more", "lazy_static", @@ -7676,7 +7834,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "derive_more", "parity-scale-codec", @@ -7692,7 +7850,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "log", "parity-scale-codec", @@ -7707,7 +7865,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "log", "parity-scale-codec", @@ -7725,7 +7883,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-trait", "derive_more", @@ -7765,7 +7923,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "derive_more", "finality-grandpa", @@ -7789,7 +7947,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-warp-sync" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "derive_more", "futures 0.3.13", @@ -7810,7 +7968,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "ansi_term 0.12.1", "futures 0.3.13", @@ -7828,7 +7986,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-trait", "derive_more", @@ -7848,7 +8006,7 @@ dependencies = [ [[package]] name = "sc-light" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "hash-db", "lazy_static", @@ -7867,7 +8025,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-std", "async-trait", @@ -7920,7 +8078,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "futures 0.3.13", "futures-timer 3.0.2", @@ -7937,7 +8095,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "bytes 0.5.6", "fnv", @@ -7965,7 +8123,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "futures 0.3.13", "libp2p", @@ -7978,7 +8136,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7987,7 +8145,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "futures 0.3.13", "hash-db", @@ -8021,7 +8179,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "derive_more", "futures 0.3.13", @@ -8045,7 +8203,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "futures 0.1.29", "jsonrpc-core", @@ -8063,7 +8221,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-trait", "directories", @@ -8127,7 +8285,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "log", "parity-scale-codec", @@ -8142,7 +8300,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -8162,7 +8320,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "chrono", "futures 0.3.13", @@ -8182,7 +8340,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "ansi_term 0.12.1", "atty", @@ -8209,7 +8367,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -8220,7 +8378,7 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "derive_more", "futures 0.3.13", @@ -8242,7 +8400,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "futures 0.3.13", "futures-diagnose", @@ -8432,18 +8590,18 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5" [[package]] name = "serde" -version = "1.0.123" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" +checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.123" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" +checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" dependencies = [ "proc-macro2", "quote", @@ -8452,9 +8610,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.61" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" +checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" dependencies = [ "itoa", "ryu", @@ -8658,7 +8816,7 @@ dependencies = [ [[package]] name = "sp-allocator" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "log", "sp-core", @@ -8670,7 +8828,7 @@ dependencies = [ [[package]] name = "sp-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "hash-db", "log", @@ -8687,7 +8845,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -8699,7 +8857,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "serde", @@ -8711,7 +8869,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "integer-sqrt", "num-traits", @@ -8724,7 +8882,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "sp-api", @@ -8736,7 +8894,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -8747,7 +8905,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "sp-api", @@ -8759,7 +8917,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "futures 0.3.13", "log", @@ -8777,7 +8935,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "serde", "serde_json", @@ -8786,7 +8944,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-trait", "futures 0.3.13", @@ -8813,7 +8971,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "merlin", "parity-scale-codec", @@ -8834,7 +8992,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -8844,7 +9002,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -8856,7 +9014,7 @@ dependencies = [ [[package]] name = "sp-core" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "base58", "blake2-rfc", @@ -8900,7 +9058,7 @@ dependencies = [ [[package]] name = "sp-database" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -8909,7 +9067,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "proc-macro2", "quote", @@ -8919,7 +9077,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "environmental", "parity-scale-codec", @@ -8930,7 +9088,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "finality-grandpa", "log", @@ -8947,7 +9105,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "parking_lot 0.11.1", @@ -8959,7 +9117,7 @@ dependencies = [ [[package]] name = "sp-io" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "futures 0.3.13", "hash-db", @@ -8983,7 +9141,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "lazy_static", "sp-core", @@ -8994,7 +9152,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-trait", "derive_more", @@ -9011,7 +9169,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "serde", @@ -9024,7 +9182,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9035,7 +9193,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "sp-api", "sp-core", @@ -9045,7 +9203,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "backtrace", ] @@ -9053,7 +9211,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "serde", "sp-core", @@ -9062,7 +9220,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "either", "hash256-std-hasher", @@ -9083,7 +9241,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9100,7 +9258,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -9112,7 +9270,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "serde", "serde_json", @@ -9121,7 +9279,7 @@ dependencies = [ [[package]] name = "sp-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "sp-api", @@ -9134,7 +9292,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -9144,7 +9302,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "hash-db", "log", @@ -9166,12 +9324,12 @@ dependencies = [ [[package]] name = "sp-std" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" [[package]] name = "sp-storage" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9184,7 +9342,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "log", "sp-core", @@ -9197,7 +9355,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "parity-scale-codec", "sp-api", @@ -9210,7 +9368,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "log", "parity-scale-codec", @@ -9223,7 +9381,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "derive_more", "futures 0.3.13", @@ -9239,7 +9397,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "hash-db", "memory-db", @@ -9253,7 +9411,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "futures 0.3.13", "futures-core", @@ -9265,7 +9423,7 @@ dependencies = [ [[package]] name = "sp-version" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9277,7 +9435,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9434,7 +9592,7 @@ dependencies = [ [[package]] name = "substrate-browser-utils" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "chrono", "console_error_panic_hook", @@ -9460,7 +9618,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "platforms", ] @@ -9468,7 +9626,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.13", @@ -9491,7 +9649,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-std", "derive_more", @@ -9505,7 +9663,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "async-trait", "futures 0.1.29", @@ -9534,7 +9692,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "futures 0.3.13", "substrate-test-utils-derive", @@ -9544,7 +9702,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "proc-macro-crate 1.0.0", "quote", @@ -10285,7 +10443,7 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "try-runtime-cli" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate#d3f204439220df98a59011674615d462ae667713" +source = "git+https://github.com/paritytech/substrate?branch=master#d3f204439220df98a59011674615d462ae667713" dependencies = [ "frame-try-runtime", "log", @@ -10933,6 +11091,7 @@ dependencies = [ name = "westend-runtime" version = "0.8.30" dependencies = [ + "beefy-primitives", "bitvec", "frame-benchmarking", "frame-executive", @@ -10948,6 +11107,7 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-balances", + "pallet-beefy", "pallet-collective", "pallet-democracy", "pallet-election-provider-multi-phase", @@ -10957,6 +11117,8 @@ dependencies = [ "pallet-im-online", "pallet-indices", "pallet-membership", + "pallet-mmr", + "pallet-mmr-primitives", "pallet-multisig", "pallet-nicks", "pallet-offences", diff --git a/polkadot/node/service/Cargo.toml b/polkadot/node/service/Cargo.toml index dcc71d283d..dc2cc2ae94 100644 --- a/polkadot/node/service/Cargo.toml +++ b/polkadot/node/service/Cargo.toml @@ -8,6 +8,8 @@ edition = "2018" # Substrate Client sc-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master" } babe = { package = "sc-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" } +beefy-primitives = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master" } +beefy-gadget = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master" } grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" } sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -48,6 +50,7 @@ pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "maste pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master" } # Substrate Other frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/polkadot/node/service/src/chain_spec.rs b/polkadot/node/service/src/chain_spec.rs index 21eaa8442f..2c07878986 100644 --- a/polkadot/node/service/src/chain_spec.rs +++ b/polkadot/node/service/src/chain_spec.rs @@ -18,6 +18,7 @@ use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use babe_primitives::AuthorityId as BabeId; +use beefy_primitives::ecdsa::AuthorityId as BeefyId; use grandpa::AuthorityId as GrandpaId; use hex_literal::hex; use kusama::constants::currency::DOTS as KSM; @@ -153,6 +154,7 @@ fn westend_session_keys( para_validator: ValidatorId, para_assignment: AssignmentId, authority_discovery: AuthorityDiscoveryId, + beefy: BeefyId, ) -> westend::SessionKeys { westend::SessionKeys { babe, @@ -161,6 +163,7 @@ fn westend_session_keys( para_validator, para_assignment, authority_discovery, + beefy, } } @@ -170,7 +173,8 @@ fn rococo_session_keys( im_online: ImOnlineId, para_validator: ValidatorId, para_assignment: AssignmentId, - authority_discovery: AuthorityDiscoveryId + authority_discovery: AuthorityDiscoveryId, + beefy: BeefyId, ) -> rococo_runtime::SessionKeys { rococo_runtime::SessionKeys { babe, @@ -179,6 +183,7 @@ fn rococo_session_keys( para_validator, para_assignment, authority_discovery, + beefy, } } @@ -290,6 +295,7 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi // for i in 1 2 3 4; do for j in grandpa; do subkey --ed25519 inspect "$SECRET//$i//$j"; done; done // for i in 1 2 3 4; do for j in im_online; do subkey --sr25519 inspect "$SECRET//$i//$j"; done; done // for i in 1 2 3 4; do for j in para_validator para_assignment; do subkey --sr25519 inspect "$SECRET//$i//$j"; done; done + // for i in 1 2 3 4; do for j in beefy; do subkey --ecdsa inspect "$SECRET//$i//$j"; done; done let initial_authorities: Vec<( AccountId, AccountId, @@ -299,103 +305,89 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi ValidatorId, AssignmentId, AuthorityDiscoveryId, + BeefyId, )> = vec![ ( - // 5FZoQhgUCmqBxnkHX7jCqThScS2xQWiwiF61msg63CFL3Y8f + //5FZoQhgUCmqBxnkHX7jCqThScS2xQWiwiF61msg63CFL3Y8f hex!["9ae581fef1fc06828723715731adcf810e42ce4dadad629b1b7fa5c3c144a81d"].into(), - // 5ExdKyXFhtrjiFhexnyQPDyGSP8xU9qHc4KDwVrtWxaP2RP6 + //5ExdKyXFhtrjiFhexnyQPDyGSP8xU9qHc4KDwVrtWxaP2RP6 hex!["8011fb3641f0641f5570ba8787a64a0ff7d9c9999481f333d7207c4abd7e981c"].into(), - // 5Ef8qY8LRV6RFd4bThrwxBhhWfLjzqmd4rK8nX3Xs7zJqqp7 - hex!["72bae70a1398c0ba52f815cc5dfbc9ec5c013771e541ae28e05d1129243e3001"] - .unchecked_into(), - // 5FSscBiPfaPaEhFbAt2qRhcYjryKBKf714X76F5nFfwtdXLa - hex!["959cebf18fecb305b96fd998c95f850145f52cbbb64b3ef937c0575cc7ebd652"] - .unchecked_into(), - // 5Ef8qY8LRV6RFd4bThrwxBhhWfLjzqmd4rK8nX3Xs7zJqqp7 - hex!["72bae70a1398c0ba52f815cc5dfbc9ec5c013771e541ae28e05d1129243e3001"] - .unchecked_into(), - // 5Ef8qY8LRV6RFd4bThrwxBhhWfLjzqmd4rK8nX3Xs7zJqqp7 - hex!["72bae70a1398c0ba52f815cc5dfbc9ec5c013771e541ae28e05d1129243e3001"] - .unchecked_into(), - // 5Ef8qY8LRV6RFd4bThrwxBhhWfLjzqmd4rK8nX3Xs7zJqqp7 - hex!["72bae70a1398c0ba52f815cc5dfbc9ec5c013771e541ae28e05d1129243e3001"] - .unchecked_into(), - // 5Ef8qY8LRV6RFd4bThrwxBhhWfLjzqmd4rK8nX3Xs7zJqqp7 - hex!["72bae70a1398c0ba52f815cc5dfbc9ec5c013771e541ae28e05d1129243e3001"] - .unchecked_into(), + //5Ef8qY8LRV6RFd4bThrwxBhhWfLjzqmd4rK8nX3Xs7zJqqp7 + hex!["72bae70a1398c0ba52f815cc5dfbc9ec5c013771e541ae28e05d1129243e3001"].unchecked_into(), + //5FSscBiPfaPaEhFbAt2qRhcYjryKBKf714X76F5nFfwtdXLa + hex!["959cebf18fecb305b96fd998c95f850145f52cbbb64b3ef937c0575cc7ebd652"].unchecked_into(), + //5CMC5eE4XvPLVTv8e4miXTvfMDEj1gGofT9ymAybwTZWU4Uu + hex!["0c92ef9543bd3d8ce7e31356ec19d1f539beb3bed293b056bfbe77c2627c1944"].unchecked_into(), + //5FRidgyc13cnzVZrav9gCamgdwoiy34er9ea6Hhk8wSzGnLQ + hex!["94bb7784e5d7f4e03f474d76bd00563b05968ba1c8a842f3f45c531cfe389329"].unchecked_into(), + //5CFHEhVjscbquPvaPmrH4yUxGfxC9xq2bDYJAK6ccQzMVZQb + hex!["0810d2113438bb14856b06383a4f0da4e5cc2f92a3fc18ef03a54b34c6007662"].unchecked_into(), + //5CkAdj1MpkMtQikrGXuzgzrRLvUnfLQH2JsnZa16u4cK2Xhf + hex!["1e18b5a9f872727189934a6988ff2a6732c87b9e31e2d694dd011aff9dfb2332"].unchecked_into(), + //5E6ogZEZyc5YZ3ijWUPB9M6Xtx6E9FabhmP9J4rwcEH6pLGv + hex!["0293be7cdb81f25039dfd01aac905da8a5e50113366bc4b5dc5eb888cf5552b8a9"].unchecked_into(), ), ( - // 5G1ojzh47Yt8KoYhuAjXpHcazvsoCXe3G8LZchKDvumozJJJ + //5G1ojzh47Yt8KoYhuAjXpHcazvsoCXe3G8LZchKDvumozJJJ hex!["aebb0211dbb07b4d335a657257b8ac5e53794c901e4f616d4a254f2490c43934"].into(), - // 5GeoZ1Mzix6Xnj32X8Xpj7q89X1SQHU5XTK1cnUVNXKTvXdK + //5GeoZ1Mzix6Xnj32X8Xpj7q89X1SQHU5XTK1cnUVNXKTvXdK hex!["caf27345aebc2fefeca85c9a67f4859eab3178d28ef92244714402290f3f415a"].into(), - // 5Et8y49AyE7ncVKiSRgzN6zbqbYtMK6y7kKuUaS8YqvfLBD9 - hex!["7ca58770eb41c1a68ef77e92255e4635fc11f665cb89aee469e920511c48343a"] - .unchecked_into(), - // 5Hpn3HVViECsuxMDFtinWjRj2dNfpRp1kB24nZHvQCJsSUek - hex!["feca0be2c87141f6074b221c919c0161a1c468d9173c5c1be59b68fab9a0ff93"] - .unchecked_into(), - // 5Et8y49AyE7ncVKiSRgzN6zbqbYtMK6y7kKuUaS8YqvfLBD9 - hex!["7ca58770eb41c1a68ef77e92255e4635fc11f665cb89aee469e920511c48343a"] - .unchecked_into(), - // 5Et8y49AyE7ncVKiSRgzN6zbqbYtMK6y7kKuUaS8YqvfLBD9 - hex!["7ca58770eb41c1a68ef77e92255e4635fc11f665cb89aee469e920511c48343a"] - .unchecked_into(), - // 5Et8y49AyE7ncVKiSRgzN6zbqbYtMK6y7kKuUaS8YqvfLBD9 - hex!["7ca58770eb41c1a68ef77e92255e4635fc11f665cb89aee469e920511c48343a"] - .unchecked_into(), - // 5Et8y49AyE7ncVKiSRgzN6zbqbYtMK6y7kKuUaS8YqvfLBD9 - hex!["7ca58770eb41c1a68ef77e92255e4635fc11f665cb89aee469e920511c48343a"] - .unchecked_into(), + //5Et8y49AyE7ncVKiSRgzN6zbqbYtMK6y7kKuUaS8YqvfLBD9 + hex!["7ca58770eb41c1a68ef77e92255e4635fc11f665cb89aee469e920511c48343a"].unchecked_into(), + //5Hpn3HVViECsuxMDFtinWjRj2dNfpRp1kB24nZHvQCJsSUek + hex!["feca0be2c87141f6074b221c919c0161a1c468d9173c5c1be59b68fab9a0ff93"].unchecked_into(), + //5HHHSvewgWiwEBX5BWeeeYBXTn5qNDZSsbk1WvWGum1ohp3t + hex!["e6c53033eabfad2f519eecfcb01e89cf86b014d0b9c2fad93d84fb59d759115f"].unchecked_into(), + //5GjwEr3FMP9hWd3WSrLccfCna7xEKnQhShp15F4UGGyB7X2j + hex!["cedc8dbcba3c51aab26a043306366c28791533df33b6d92b822b626939cf2217"].unchecked_into(), + //5Gv7xHsEeAivjxH4tniXQ3MonKBRWs88xEgHAWym2XzZxb5n + hex!["d6a113804a98728bb2af4f3721ab31a3644731292bffe0268995d8f8fb073b57"].unchecked_into(), + //5DUrcztb1pRz6DfA8Vo8JSUSpoQVr27Yo6gjPmnumhhubLeN + hex!["3ea7a06009d1b9b1d4233dea3e6bb6494b9aeda91edc443629a28afa9fab8c62"].unchecked_into(), + //5HUYyVYXjm5mdEpDiykmhxZGzQjY4LLxyTPD7hfMjfLUy3VT + hex!["020e0ba5e112f0d3356ff8c78a37e2d7f76f90ab8dc9ed2eac98c87c5ffb2b0ebe"].unchecked_into(), ), ( - // 5HYYWyhyUQ7Ae11f8fCid58bhJ7ikLHM9bU8A6Ynwoc3dStR + //5HYYWyhyUQ7Ae11f8fCid58bhJ7ikLHM9bU8A6Ynwoc3dStR hex!["f268995cc38974ce0686df1364875f26f2c32b246ddc18835512c3f9969f5836"].into(), - // 5DnUXT3xiQn6ZRttFT6eSCJbT9P2tiLdexr5WsvnbLG8igqW + //5DnUXT3xiQn6ZRttFT6eSCJbT9P2tiLdexr5WsvnbLG8igqW hex!["4c17a9bfdd19411f452fa32420fa7acab622e87e57351f4ba3248ae40ce75123"].into(), - // 5EhnN1SumSv5KxwLAdwE8ugJaw1S8xARZb8V2BMYCKaD7ure - hex!["74bfb70627416e6e6c4785e928ced384c6c06e5c8dd173a094bc3118da7b673e"] - .unchecked_into(), - // 5Hmvd2qjb1zatrJTkPwgFicxPfZuwaTwa2L7adSRmz6mVxfb - hex!["fc9d33059580a69454179ffa41cbae6de2bc8d2bd2c3f1d018fe5484a5a91956"] - .unchecked_into(), - // 5EhnN1SumSv5KxwLAdwE8ugJaw1S8xARZb8V2BMYCKaD7ure - hex!["74bfb70627416e6e6c4785e928ced384c6c06e5c8dd173a094bc3118da7b673e"] - .unchecked_into(), - // 5EhnN1SumSv5KxwLAdwE8ugJaw1S8xARZb8V2BMYCKaD7ure - hex!["74bfb70627416e6e6c4785e928ced384c6c06e5c8dd173a094bc3118da7b673e"] - .unchecked_into(), - // 5EhnN1SumSv5KxwLAdwE8ugJaw1S8xARZb8V2BMYCKaD7ure - hex!["74bfb70627416e6e6c4785e928ced384c6c06e5c8dd173a094bc3118da7b673e"] - .unchecked_into(), - // 5EhnN1SumSv5KxwLAdwE8ugJaw1S8xARZb8V2BMYCKaD7ure - hex!["74bfb70627416e6e6c4785e928ced384c6c06e5c8dd173a094bc3118da7b673e"] - .unchecked_into(), + //5EhnN1SumSv5KxwLAdwE8ugJaw1S8xARZb8V2BMYCKaD7ure + hex!["74bfb70627416e6e6c4785e928ced384c6c06e5c8dd173a094bc3118da7b673e"].unchecked_into(), + //5Hmvd2qjb1zatrJTkPwgFicxPfZuwaTwa2L7adSRmz6mVxfb + hex!["fc9d33059580a69454179ffa41cbae6de2bc8d2bd2c3f1d018fe5484a5a91956"].unchecked_into(), + //5G1YwfKpir3fW3C4pHk1c8MX2XYpo1mQaTDxkpxyu8cQthEg + hex!["ae8930d06f23b0f0e1f31717f12b9f31e7150ceb735b22e35ad86fd94e10125f"].unchecked_into(), + //5GF6xvz37CmPyRsNgpQMFjBDv3crmh2rVRtxkASR8YWNJSKy + hex!["b8df2d1ea3d352cb818868c71e21c06e7929b3c7fda62bb93f2cff9152efc844"].unchecked_into(), + //5CPYVGRq4Gbntijd9FyoGX9QYVKXdeen4K9sFb8v3SuYoRWx + hex!["0e5e1fb2c0fa7db11cd83fef3493900292badf02f35812ba738efeab9978a46c"].unchecked_into(), + //5GvKehGrFVea8rywSeJhTopmpBDNHSFBoZp32g3CecppYa3V + hex!["d6c8735316211321cd85ccd7c583222ab024393b8c86c7c8d1192a1d4f35bb2e"].unchecked_into(), + //5FpX3V5qCGehdTBRxkpHzGjwK9nvihLYj6gwR4NWn8DjbAoL + hex!["020b4bc2972761bd1abf20d5f83f79ff546ef63094e193d21758566c58dea9642f"].unchecked_into(), ), ( - // 5CFPcUJgYgWryPaV1aYjSbTpbTLu42V32Ytw1L9rfoMAsfGh + //5CFPcUJgYgWryPaV1aYjSbTpbTLu42V32Ytw1L9rfoMAsfGh hex!["08264834504a64ace1373f0c8ed5d57381ddf54a2f67a318fa42b1352681606d"].into(), - // 5F6z64cYZFRAmyMUhp7rnge6jaZmbY6o7XfA9czJyuAUiaFD + //5F6z64cYZFRAmyMUhp7rnge6jaZmbY6o7XfA9czJyuAUiaFD hex!["8671d451c3d4f6de8c16ea0bc61cf714914d6b2ffa2899872620525419327478"].into(), - // 5Ft7o2uqDq5pXCK4g5wR94BctmtLEzCBy5MvPqRa8753ZemD - hex!["a8ddd0891e14725841cd1b5581d23806a97f41c28a25436db6473c86e15dcd4f"] - .unchecked_into(), - // 5FgBijJLL6p7nDZgQed56L3BM7ovgwc4t4FYsv9apYtRGAGv - hex!["9fc415cce1d0b2eed702c9e05f476217d23b46a8723fd56f08cddad650be7c2d"] - .unchecked_into(), - // 5Ft7o2uqDq5pXCK4g5wR94BctmtLEzCBy5MvPqRa8753ZemD - hex!["a8ddd0891e14725841cd1b5581d23806a97f41c28a25436db6473c86e15dcd4f"] - .unchecked_into(), - // 5Ft7o2uqDq5pXCK4g5wR94BctmtLEzCBy5MvPqRa8753ZemD - hex!["a8ddd0891e14725841cd1b5581d23806a97f41c28a25436db6473c86e15dcd4f"] - .unchecked_into(), - // 5Ft7o2uqDq5pXCK4g5wR94BctmtLEzCBy5MvPqRa8753ZemD - hex!["a8ddd0891e14725841cd1b5581d23806a97f41c28a25436db6473c86e15dcd4f"] - .unchecked_into(), - // 5Ft7o2uqDq5pXCK4g5wR94BctmtLEzCBy5MvPqRa8753ZemD - hex!["a8ddd0891e14725841cd1b5581d23806a97f41c28a25436db6473c86e15dcd4f"] - .unchecked_into(), + //5Ft7o2uqDq5pXCK4g5wR94BctmtLEzCBy5MvPqRa8753ZemD + hex!["a8ddd0891e14725841cd1b5581d23806a97f41c28a25436db6473c86e15dcd4f"].unchecked_into(), + //5FgBijJLL6p7nDZgQed56L3BM7ovgwc4t4FYsv9apYtRGAGv + hex!["9fc415cce1d0b2eed702c9e05f476217d23b46a8723fd56f08cddad650be7c2d"].unchecked_into(), + //5DwPxYdY9FcNjMPptwrcGeeu1jbpWYwCdGc8cvjQNkY7nE8m + hex!["52e57f2e1451ced7431c810cb4c3ad532ac4a37aeb9303f9a4a34d77a05aa269"].unchecked_into(), + //5Ew1qAPRe3oGVynud5eDg2aXdJUtV3Wy16MWfjzbqv9cnLbe + hex!["7ed73e3c97c7cf6a24d074e49d4ad750ecb2ed28886398a1b2916142c2bf5f62"].unchecked_into(), + //5GVzBxaAf7au8VKnsKFNvFvzamdqbnuzXUxDfp5xkFivfqKv + hex!["c4390ca0274f0262a4ef7cd4d3aa6cab0875a6efdd40d38c21be4f770b6c4b1a"].unchecked_into(), + //5CZd519gfE3gALMtFWa283VHikXwoGFmT92B3Nu3iN7YGcaR + hex!["160e0049b62d368c59d286275697e8d5e68d34ee8663ac4c3da646b0abb4a86f"].unchecked_into(), + //5Fnu4YYBx9V71ihCBkJyFGsKw9Q2jjNzRQL9kRNpKTPNSAhc + hex!["03e9393ee30ae95fc2b7864230f53e45409a807949390140ce2bc77756cdb4bb83"].unchecked_into(), ), + ]; const ENDOWMENT: u128 = 1_000_000 * WND; @@ -413,6 +405,7 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), }, + pallet_beefy: Default::default(), pallet_indices: westend::IndicesConfig { indices: vec![] }, pallet_session: westend::SessionConfig { keys: initial_authorities @@ -428,6 +421,7 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi x.5.clone(), x.6.clone(), x.7.clone(), + x.8.clone(), ), ) }) @@ -683,151 +677,170 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime:: ImOnlineId, ValidatorId, AssignmentId, - AuthorityDiscoveryId - )> = vec![( - //5EHZkbp22djdbuMFH9qt1DVzSCvqi3zWpj6DAYfANa828oei - hex!["62475fe5406a7cb6a64c51d0af9d3ab5c2151bcae982fb812f7a76b706914d6a"].into(), - //5FeSEpi9UYYaWwXXb3tV88qtZkmSdB3mvgj3pXkxKyYLGhcd - hex!["9e6e781a76810fe93187af44c79272c290c2b9e2b8b92ee11466cd79d8023f50"].into(), - //5Fh6rDpMDhM363o1Z3Y9twtaCPfizGQWCi55BSykTQjGbP7H - hex!["a076ef1280d768051f21d060623da3ab5b56944d681d303ed2d4bf658c5bed35"].unchecked_into(), - //5CPd3zoV9Aaah4xWucuDivMHJ2nEEmpdi864nPTiyRZp4t87 - hex!["0e6d7d1afbcc6547b92995a394ba0daed07a2420be08220a5a1336c6731f0bfa"].unchecked_into(), - //5F7BEa1LGFksUihyatf3dCDYneB8pWzVyavnByCsm5nBgezi - hex!["86975a37211f8704e947a365b720f7a3e2757988eaa7d0f197e83dba355ef743"].unchecked_into(), - //5CP6oGfwqbEfML8efqm1tCZsUgRsJztp9L8ZkEUxA16W8PPz - hex!["0e07a51d3213842f8e9363ce8e444255990a225f87e80a3d651db7841e1a0205"].unchecked_into(), - //5HQdwiDh8Qtd5dSNWajNYpwDvoyNWWA16Y43aEkCNactFc2b - hex!["ec60e71fe4a567ef9fef99d4bbf37ffae70564b41aa6f94ef0317c13e0a5477b"].unchecked_into(), - //5HbSgM72xVuscsopsdeG3sCSCYdAeM1Tay9p79N6ky6vwDGq - hex!["f49eae66a0ac9f610316906ec8f1a0928e20d7059d76a5ca53cbcb5a9b50dd3c"].unchecked_into(), - ), - ( - //5DvH8oEjQPYhzCoQVo7WDU91qmQfLZvxe9wJcrojmJKebCmG - hex!["520b48452969f6ddf263b664de0adb0c729d0e0ad3b0e5f3cb636c541bc9022a"].into(), - //5ENZvCRzyXJJYup8bM6yEzb2kQHEb1NDpY2ZEyVGBkCfRdj3 - hex!["6618289af7ae8621981ffab34591e7a6486e12745dfa3fd3b0f7e6a3994c7b5b"].into(), - //5DLjSUfqZVNAADbwYLgRvHvdzXypiV1DAEaDMjcESKTcqMoM - hex!["38757d0de00a0c739e7d7984ef4bc01161bd61e198b7c01b618425c16bb5bd5f"].unchecked_into(), - //5HnDVBN9mD6mXyx8oryhDbJtezwNSj1VRXgLoYCBA6uEkiao - hex!["fcd5f87a6fd5707a25122a01b4dac0a8482259df7d42a9a096606df1320df08d"].unchecked_into(), - //5DhyXZiuB1LvqYKFgT5tRpgGsN3is2cM9QxgW7FikvakbAZP - hex!["48a910c0af90898f11bd57d37ceaea53c78994f8e1833a7ade483c9a84bde055"].unchecked_into(), - //5EPEWRecy2ApL5n18n3aHyU1956zXTRqaJpzDa9DoqiggNwF - hex!["669a10892119453e9feb4e3f1ee8e028916cc3240022920ad643846fbdbee816"].unchecked_into(), - //5ES3fw5X4bndSgLNmtPfSbM2J1kLqApVB2CCLS4CBpM1UxUZ - hex!["68bf52c482630a8d1511f2edd14f34127a7d7082219cccf7fd4c6ecdb535f80d"].unchecked_into(), - //5HeXbwb5PxtcRoopPZTp5CQun38atn2UudQ8p2AxR5BzoaXw - hex!["f6f8fe475130d21165446a02fb1dbce3a7bf36412e5d98f4f0473aed9252f349"].unchecked_into(), - ), - ( - //5FPMzsezo1PRxYbVpJMWK7HNbR2kUxidsAAxH4BosHa4wd6S - hex!["92ef83665b39d7a565e11bf8d18d41d45a8011601c339e57a8ea88c8ff7bba6f"].into(), - //5G6NQidFG7YiXsvV7hQTLGArir9tsYqD4JDxByhgxKvSKwRx - hex!["b235f57244230589523271c27b8a490922ffd7dccc83b044feaf22273c1dc735"].into(), - //5GpZhzAVg7SAtzLvaAC777pjquPEcNy1FbNUAG2nZvhmd6eY - hex!["d2644c1ab2c63a3ad8d40ad70d4b260969e3abfe6d7e6665f50dc9f6365c9d2a"].unchecked_into(), - //5HAes2RQYPbYKbLBfKb88f4zoXv6pPA6Ke8CjN7dob3GpmSP - hex!["e1b68fbd84333e31486c08e6153d9a1415b2e7e71b413702b7d64e9b631184a1"].unchecked_into(), - //5HTXBf36LXmkFWJLokNUK6fPxVpkr2ToUnB1pvaagdGu4c1T - hex!["ee93e26259decb89afcf17ef2aa0fa2db2e1042fb8f56ecfb24d19eae8629878"].unchecked_into(), - //5FtAGDZYJKXkhVhAxCQrXmaP7EE2mGbBMfmKDHjfYDgq2BiU - hex!["a8e61ffacafaf546283dc92d14d7cc70ea0151a5dd81fdf73ff5a2951f2b6037"].unchecked_into(), - //5CtK7JHv3h6UQZ44y54skxdwSVBRtuxwPE1FYm7UZVhg8rJV - hex!["244f3421b310c68646e99cdbf4963e02067601f57756b072a4b19431448c186e"].unchecked_into(), - //5D4r6YaB6F7A7nvMRHNFNF6zrR9g39bqDJFenrcaFmTCRwfa - hex!["2c57f81fd311c1ab53813c6817fe67f8947f8d39258252663b3384ab4195494d"].unchecked_into(), - ), - ( - //5DMNx7RoX6d7JQ38NEM7DWRcW2THu92LBYZEWvBRhJeqcWgR - hex!["38f3c2f38f6d47f161e98c697bbe3ca0e47c033460afda0dda314ab4222a0404"].into(), - //5GGdKNDr9P47dpVnmtq3m8Tvowwf1ot1abw6tPsTYYFoKm2v - hex!["ba0898c1964196474c0be08d364cdf4e9e1d47088287f5235f70b0590dfe1704"].into(), - //5EjkyPCzR2SjhDZq8f7ufsw6TfkvgNRepjCRQFc4TcdXdaB1 - hex!["764186bc30fd5a02477f19948dc723d6d57ab174debd4f80ed6038ec960bfe21"].unchecked_into(), - //5DJV3zCBTJBLGNDCcdWrYxWDacSz84goGTa4pFeKVvehEBte - hex!["36be9069cdb4a8a07ecd51f257875150f0a8a1be44a10d9d98dabf10a030aef4"].unchecked_into(), - //5FHf8kpK4fPjEJeYcYon2gAPwEBubRvtwpzkUbhMWSweKPUY - hex!["8e95b9b5b4dc69790b67b566567ca8bf8cdef3a3a8bb65393c0d1d1c87cd2d2c"].unchecked_into(), - //5F9FsRjpecP9GonktmtFL3kjqNAMKjHVFjyjRdTPa4hbQRZA - hex!["882d72965e642677583b333b2d173ac94b5fd6c405c76184bb14293be748a13b"].unchecked_into(), - //5F1FZWZSj3JyTLs8sRBxU6QWyGLSL9BMRtmSKDmVEoiKFxSP - hex!["821271c99c958b9220f1771d9f5e29af969edfa865631dba31e1ab7bc0582b75"].unchecked_into(), - //5CtgRR74VypK4h154s369abs78hDUxZSJqcbWsfXvsjcHJNA - hex!["2496f28d887d84705c6dae98aee8bf90fc5ad10bb5545eca1de6b68425b70f7c"].unchecked_into(), + AuthorityDiscoveryId, + BeefyId, + )> = vec![ + ( + //5EHZkbp22djdbuMFH9qt1DVzSCvqi3zWpj6DAYfANa828oei + hex!["62475fe5406a7cb6a64c51d0af9d3ab5c2151bcae982fb812f7a76b706914d6a"].into(), + //5FeSEpi9UYYaWwXXb3tV88qtZkmSdB3mvgj3pXkxKyYLGhcd + hex!["9e6e781a76810fe93187af44c79272c290c2b9e2b8b92ee11466cd79d8023f50"].into(), + //5Fh6rDpMDhM363o1Z3Y9twtaCPfizGQWCi55BSykTQjGbP7H + hex!["a076ef1280d768051f21d060623da3ab5b56944d681d303ed2d4bf658c5bed35"].unchecked_into(), + //5CPd3zoV9Aaah4xWucuDivMHJ2nEEmpdi864nPTiyRZp4t87 + hex!["0e6d7d1afbcc6547b92995a394ba0daed07a2420be08220a5a1336c6731f0bfa"].unchecked_into(), + //5F7BEa1LGFksUihyatf3dCDYneB8pWzVyavnByCsm5nBgezi + hex!["86975a37211f8704e947a365b720f7a3e2757988eaa7d0f197e83dba355ef743"].unchecked_into(), + //5CP6oGfwqbEfML8efqm1tCZsUgRsJztp9L8ZkEUxA16W8PPz + hex!["0e07a51d3213842f8e9363ce8e444255990a225f87e80a3d651db7841e1a0205"].unchecked_into(), + //5HQdwiDh8Qtd5dSNWajNYpwDvoyNWWA16Y43aEkCNactFc2b + hex!["ec60e71fe4a567ef9fef99d4bbf37ffae70564b41aa6f94ef0317c13e0a5477b"].unchecked_into(), + //5HbSgM72xVuscsopsdeG3sCSCYdAeM1Tay9p79N6ky6vwDGq + hex!["f49eae66a0ac9f610316906ec8f1a0928e20d7059d76a5ca53cbcb5a9b50dd3c"].unchecked_into(), + //5DPSWdgw38Spu315r6LSvYCggeeieBAJtP5A1qzuzKhqmjVu + hex!["034f68c5661a41930c82f26a662276bf89f33467e1c850f2fb8ef687fe43d62276"].unchecked_into(), ), ( - //5C8AL1Zb4bVazgT3EgDxFgcow1L4SJjVu44XcLC9CrYqFN4N - hex!["02a2d8cfcf75dda85fafc04ace3bcb73160034ed1964c43098fb1fe831de1b16"].into(), - //5FLYy3YKsAnooqE4hCudttAsoGKbVG3hYYBtVzwMjJQrevPa - hex!["90cab33f0bb501727faa8319f0845faef7d31008f178b65054b6629fe531b772"].into(), - //5Et3tfbVf1ByFThNAuUq5pBssdaPPskip5yob5GNyUFojXC7 - hex!["7c94715e5dd8ab54221b1b6b2bfa5666f593f28a92a18e28052531de1bd80813"].unchecked_into(), - //5EX1JBghGbQqWohTPU6msR9qZ2nYPhK9r3RTQ2oD1K8TCxaG - hex!["6c878e33b83c20324238d22240f735457b6fba544b383e70bb62a27b57380c81"].unchecked_into(), - //5GqL8RbVAuNXpDhjQi1KrS1MyNuKhvus2AbmQwRGjpuGZmFu - hex!["d2f9d537ffa59919a4028afdb627c14c14c97a1547e13e8e82203d2049b15b1a"].unchecked_into(), - //5EUNaBpX9mJgcmLQHyG5Pkms6tbDiKuLbeTEJS924Js9cA1N - hex!["6a8570b9c6408e54bacf123cc2bb1b0f087f9c149147d0005badba63a5a4ac01"].unchecked_into(), - //5CaZuueRVpMATZG4hkcrgDoF4WGixuz7zu83jeBdY3bgWGaG - hex!["16c69ea8d595e80b6736f44be1eaeeef2ac9c04a803cc4fd944364cb0d617a33"].unchecked_into(), - //5DABsdQCDUGuhzVGWe5xXzYQ9rtrVxRygW7RXf9Tsjsw1aGJ - hex!["306ac5c772fe858942f92b6e28bd82fb7dd8cdd25f9a4626c1b0eee075fcb531"].unchecked_into(), - ), - ( - //5C8XbDXdMNKJrZSrQURwVCxdNdk8AzG6xgLggbzuA399bBBF - hex!["02ea6bfa8b23b92fe4b5db1063a1f9475e3acd0ab61e6b4f454ed6ba00b5f864"].into(), - //5GsyzFP8qtF8tXPSsjhjxAeU1v7D1PZofuQKN9TdCc7Dp1JM - hex!["d4ffc4c05b47d1115ad200f7f86e307b20b46c50e1b72a912ec4f6f7db46b616"].into(), - //5GHWB8ZDzegLcMW7Gdd1BS6WHVwDdStfkkE4G7KjPjZNJBtD - hex!["bab3cccdcc34401e9b3971b96a662686cf755aa869a5c4b762199ce531b12c5b"].unchecked_into(), - //5GzDPGbUM9uH52ZEwydasTj8edokGUJ7vEpoFWp9FE1YNuFB - hex!["d9c056c98ca0e6b4eb7f5c58c007c1db7be0fe1f3776108f797dd4990d1ccc33"].unchecked_into(), - //5GWZbVkJEfWZ7fRca39YAQeqri2Z7pkeHyd7rUctUHyQifLp - hex!["c4a980da30939d5bb9e4a734d12bf81259ae286aa21fa4b65405347fa40eff35"].unchecked_into(), - //5CmLCFeSurRXXtwMmLcVo7sdJ9EqDguvJbuCYDcHkr3cpqyE - hex!["1efc23c0b51ad609ab670ecf45807e31acbd8e7e5cb7c07cf49ee42992d2867c"].unchecked_into(), - //5DnsSy8a8pfE2aFjKBDtKw7WM1V4nfE5sLzP15MNTka53GqS - hex!["4c64d3f06d28adeb36a892fdaccecace150bec891f04694448a60b74fa469c22"].unchecked_into(), - //5CZdFnyzZvKetZTeUwj5APAYskVJe4QFiTezo5dQNsrnehGd - hex!["160ea09c5717270e958a3da42673fa011613a9539b2e4ebcad8626bc117ca04a"].unchecked_into(), - ), - ( - //5HinEonzr8MywkqedcpsmwpxKje2jqr9miEwuzyFXEBCvVXM - hex!["fa373e25a1c4fe19c7148acde13bc3db1811cf656dc086820f3dda736b9c4a00"].into(), - //5EHJbj6Td6ks5HDnyfN4ttTSi57osxcQsQexm7XpazdeqtV7 - hex!["62145d721967bd88622d08625f0f5681463c0f1b8bcd97eb3c2c53f7660fd513"].into(), - //5EeCsC58XgJ1DFaoYA1WktEpP27jvwGpKdxPMFjicpLeYu96 - hex!["720537e2c1c554654d73b3889c3ef4c3c2f95a65dd3f7c185ebe4afebed78372"].unchecked_into(), - //5DnEySxbnppWEyN8cCLqvGjAorGdLRg2VmkY96dbJ1LHFK8N - hex!["4bea0b37e0cce9bddd80835fa2bfd5606f5dcfb8388bbb10b10c483f0856cf14"].unchecked_into(), - //5E1Y1FJ7dVP7qtE3wm241pTm72rTMcDT5Jd8Czv7Pwp7N3AH - hex!["560d90ca51e9c9481b8a9810060e04d0708d246714960439f804e5c6f40ca651"].unchecked_into(), - //5CAC278tFCHAeHYqE51FTWYxHmeLcENSS1RG77EFRTvPZMJT - hex!["042f07fc5268f13c026bbe199d63e6ac77a0c2a780f71cda05cee5a6f1b3f11f"].unchecked_into(), - //5HjRTLWcQjZzN3JDvaj1UzjNSayg5ZD9ZGWMstaL7Ab2jjAa - hex!["fab485e87ed1537d089df521edf983a777c57065a702d7ed2b6a2926f31da74f"].unchecked_into(), - //5ELv74v7QcsS6FdzvG4vL2NnYDGWmRnJUSMKYwdyJD7Xcdi7 - hex!["64d59feddb3d00316a55906953fb3db8985797472bd2e6c7ea1ab730cc339d7f"].unchecked_into(), - ), - ( - //5Ey3NQ3dfabaDc16NUv7wRLsFCMDFJSqZFzKVycAsWuUC6Di - hex!["8062e9c21f1d92926103119f7e8153cebdb1e5ab3e52d6f395be80bb193eab47"].into(), - //5HiWsuSBqt8nS9pnggexXuHageUifVPKPHDE2arTKqhTp1dV - hex!["fa0388fa88f3f0cb43d583e2571fbc0edad57dff3a6fd89775451dd2c2b8ea00"].into(), - //5H168nKX2Yrfo3bxj7rkcg25326Uv3CCCnKUGK6uHdKMdPt8 - hex!["da6b2df18f0f9001a6dcf1d301b92534fe9b1f3ccfa10c49449fee93adaa8349"].unchecked_into(), - //5DrA2fZdzmNqT5j6DXNwVxPBjDV9jhkAqvjt6Us3bQHKy3cF - hex!["4ee66173993dd0db5d628c4c9cb61a27b76611ad3c3925947f0d0011ee2c5dcc"].unchecked_into(), - //5FNFDUGNLUtqg5LgrwYLNmBiGoP8KRxsvQpBkc7GQP6qaBUG - hex!["92156f54a114ee191415898f2da013d9db6a5362d6b36330d5fc23e27360ab66"].unchecked_into(), - //5Gx6YeNhynqn8qkda9QKpc9S7oDr4sBrfAu516d3sPpEt26F - hex!["d822d4088b20dca29a580a577a97d6f024bb24c9550bebdfd7d2d18e946a1c7d"].unchecked_into(), - //5DhDcHqwxoes5s89AyudGMjtZXx1nEgrk5P45X88oSTR3iyx - hex!["481538f8c2c011a76d7d57db11c2789a5e83b0f9680dc6d26211d2f9c021ae4c"].unchecked_into(), - //5DqAvikdpfRdk5rR35ZobZhqaC5bJXZcEuvzGtexAZP1hU3T - hex!["4e262811acdfe94528bfc3c65036080426a0e1301b9ada8d687a70ffcae99c26"].unchecked_into(), - )]; + //5DvH8oEjQPYhzCoQVo7WDU91qmQfLZvxe9wJcrojmJKebCmG + hex!["520b48452969f6ddf263b664de0adb0c729d0e0ad3b0e5f3cb636c541bc9022a"].into(), + //5ENZvCRzyXJJYup8bM6yEzb2kQHEb1NDpY2ZEyVGBkCfRdj3 + hex!["6618289af7ae8621981ffab34591e7a6486e12745dfa3fd3b0f7e6a3994c7b5b"].into(), + //5DLjSUfqZVNAADbwYLgRvHvdzXypiV1DAEaDMjcESKTcqMoM + hex!["38757d0de00a0c739e7d7984ef4bc01161bd61e198b7c01b618425c16bb5bd5f"].unchecked_into(), + //5HnDVBN9mD6mXyx8oryhDbJtezwNSj1VRXgLoYCBA6uEkiao + hex!["fcd5f87a6fd5707a25122a01b4dac0a8482259df7d42a9a096606df1320df08d"].unchecked_into(), + //5DhyXZiuB1LvqYKFgT5tRpgGsN3is2cM9QxgW7FikvakbAZP + hex!["48a910c0af90898f11bd57d37ceaea53c78994f8e1833a7ade483c9a84bde055"].unchecked_into(), + //5EPEWRecy2ApL5n18n3aHyU1956zXTRqaJpzDa9DoqiggNwF + hex!["669a10892119453e9feb4e3f1ee8e028916cc3240022920ad643846fbdbee816"].unchecked_into(), + //5ES3fw5X4bndSgLNmtPfSbM2J1kLqApVB2CCLS4CBpM1UxUZ + hex!["68bf52c482630a8d1511f2edd14f34127a7d7082219cccf7fd4c6ecdb535f80d"].unchecked_into(), + //5HeXbwb5PxtcRoopPZTp5CQun38atn2UudQ8p2AxR5BzoaXw + hex!["f6f8fe475130d21165446a02fb1dbce3a7bf36412e5d98f4f0473aed9252f349"].unchecked_into(), + //5F7nTtN8MyJV4UsXpjg7tHSnfANXZ5KRPJmkASc1ZSH2Xoa5 + hex!["03a90c2bb6d3b7000020f6152fe2e5002fa970fd1f42aafb6c8edda8dacc2ea77e"].unchecked_into(), + ), + ( + //5FPMzsezo1PRxYbVpJMWK7HNbR2kUxidsAAxH4BosHa4wd6S + hex!["92ef83665b39d7a565e11bf8d18d41d45a8011601c339e57a8ea88c8ff7bba6f"].into(), + //5G6NQidFG7YiXsvV7hQTLGArir9tsYqD4JDxByhgxKvSKwRx + hex!["b235f57244230589523271c27b8a490922ffd7dccc83b044feaf22273c1dc735"].into(), + //5GpZhzAVg7SAtzLvaAC777pjquPEcNy1FbNUAG2nZvhmd6eY + hex!["d2644c1ab2c63a3ad8d40ad70d4b260969e3abfe6d7e6665f50dc9f6365c9d2a"].unchecked_into(), + //5HAes2RQYPbYKbLBfKb88f4zoXv6pPA6Ke8CjN7dob3GpmSP + hex!["e1b68fbd84333e31486c08e6153d9a1415b2e7e71b413702b7d64e9b631184a1"].unchecked_into(), + //5HTXBf36LXmkFWJLokNUK6fPxVpkr2ToUnB1pvaagdGu4c1T + hex!["ee93e26259decb89afcf17ef2aa0fa2db2e1042fb8f56ecfb24d19eae8629878"].unchecked_into(), + //5FtAGDZYJKXkhVhAxCQrXmaP7EE2mGbBMfmKDHjfYDgq2BiU + hex!["a8e61ffacafaf546283dc92d14d7cc70ea0151a5dd81fdf73ff5a2951f2b6037"].unchecked_into(), + //5CtK7JHv3h6UQZ44y54skxdwSVBRtuxwPE1FYm7UZVhg8rJV + hex!["244f3421b310c68646e99cdbf4963e02067601f57756b072a4b19431448c186e"].unchecked_into(), + //5D4r6YaB6F7A7nvMRHNFNF6zrR9g39bqDJFenrcaFmTCRwfa + hex!["2c57f81fd311c1ab53813c6817fe67f8947f8d39258252663b3384ab4195494d"].unchecked_into(), + //5EPoHj8uV4fFKQHYThc6Z9fDkU7B6ih2ncVzQuDdNFb8UyhF + hex!["039d065fe4f9234f0a4f13cc3ae585f2691e9c25afa469618abb6645111f607a53"].unchecked_into(), + ), + ( + //5DMNx7RoX6d7JQ38NEM7DWRcW2THu92LBYZEWvBRhJeqcWgR + hex!["38f3c2f38f6d47f161e98c697bbe3ca0e47c033460afda0dda314ab4222a0404"].into(), + //5GGdKNDr9P47dpVnmtq3m8Tvowwf1ot1abw6tPsTYYFoKm2v + hex!["ba0898c1964196474c0be08d364cdf4e9e1d47088287f5235f70b0590dfe1704"].into(), + //5EjkyPCzR2SjhDZq8f7ufsw6TfkvgNRepjCRQFc4TcdXdaB1 + hex!["764186bc30fd5a02477f19948dc723d6d57ab174debd4f80ed6038ec960bfe21"].unchecked_into(), + //5DJV3zCBTJBLGNDCcdWrYxWDacSz84goGTa4pFeKVvehEBte + hex!["36be9069cdb4a8a07ecd51f257875150f0a8a1be44a10d9d98dabf10a030aef4"].unchecked_into(), + //5FHf8kpK4fPjEJeYcYon2gAPwEBubRvtwpzkUbhMWSweKPUY + hex!["8e95b9b5b4dc69790b67b566567ca8bf8cdef3a3a8bb65393c0d1d1c87cd2d2c"].unchecked_into(), + //5F9FsRjpecP9GonktmtFL3kjqNAMKjHVFjyjRdTPa4hbQRZA + hex!["882d72965e642677583b333b2d173ac94b5fd6c405c76184bb14293be748a13b"].unchecked_into(), + //5F1FZWZSj3JyTLs8sRBxU6QWyGLSL9BMRtmSKDmVEoiKFxSP + hex!["821271c99c958b9220f1771d9f5e29af969edfa865631dba31e1ab7bc0582b75"].unchecked_into(), + //5CtgRR74VypK4h154s369abs78hDUxZSJqcbWsfXvsjcHJNA + hex!["2496f28d887d84705c6dae98aee8bf90fc5ad10bb5545eca1de6b68425b70f7c"].unchecked_into(), + //5CPx6dsr11SCJHKFkcAQ9jpparS7FwXQBrrMznRo4Hqv1PXz + hex!["0307d29bbf6a5c4061c2157b44fda33b7bb4ec52a5a0305668c74688cedf288d58"].unchecked_into(), + ), + ( + //5C8AL1Zb4bVazgT3EgDxFgcow1L4SJjVu44XcLC9CrYqFN4N + hex!["02a2d8cfcf75dda85fafc04ace3bcb73160034ed1964c43098fb1fe831de1b16"].into(), + //5FLYy3YKsAnooqE4hCudttAsoGKbVG3hYYBtVzwMjJQrevPa + hex!["90cab33f0bb501727faa8319f0845faef7d31008f178b65054b6629fe531b772"].into(), + //5Et3tfbVf1ByFThNAuUq5pBssdaPPskip5yob5GNyUFojXC7 + hex!["7c94715e5dd8ab54221b1b6b2bfa5666f593f28a92a18e28052531de1bd80813"].unchecked_into(), + //5EX1JBghGbQqWohTPU6msR9qZ2nYPhK9r3RTQ2oD1K8TCxaG + hex!["6c878e33b83c20324238d22240f735457b6fba544b383e70bb62a27b57380c81"].unchecked_into(), + //5GqL8RbVAuNXpDhjQi1KrS1MyNuKhvus2AbmQwRGjpuGZmFu + hex!["d2f9d537ffa59919a4028afdb627c14c14c97a1547e13e8e82203d2049b15b1a"].unchecked_into(), + //5EUNaBpX9mJgcmLQHyG5Pkms6tbDiKuLbeTEJS924Js9cA1N + hex!["6a8570b9c6408e54bacf123cc2bb1b0f087f9c149147d0005badba63a5a4ac01"].unchecked_into(), + //5CaZuueRVpMATZG4hkcrgDoF4WGixuz7zu83jeBdY3bgWGaG + hex!["16c69ea8d595e80b6736f44be1eaeeef2ac9c04a803cc4fd944364cb0d617a33"].unchecked_into(), + //5DABsdQCDUGuhzVGWe5xXzYQ9rtrVxRygW7RXf9Tsjsw1aGJ + hex!["306ac5c772fe858942f92b6e28bd82fb7dd8cdd25f9a4626c1b0eee075fcb531"].unchecked_into(), + //5H91T5mHhoCw9JJG4NjghDdQyhC6L7XcSuBWKD3q3TAhEVvQ + hex!["02fb0330356e63a35dd930bc74525edf28b3bf5eb44aab9e9e4962c8309aaba6a6"].unchecked_into(), + ), + ( + //5C8XbDXdMNKJrZSrQURwVCxdNdk8AzG6xgLggbzuA399bBBF + hex!["02ea6bfa8b23b92fe4b5db1063a1f9475e3acd0ab61e6b4f454ed6ba00b5f864"].into(), + //5GsyzFP8qtF8tXPSsjhjxAeU1v7D1PZofuQKN9TdCc7Dp1JM + hex!["d4ffc4c05b47d1115ad200f7f86e307b20b46c50e1b72a912ec4f6f7db46b616"].into(), + //5GHWB8ZDzegLcMW7Gdd1BS6WHVwDdStfkkE4G7KjPjZNJBtD + hex!["bab3cccdcc34401e9b3971b96a662686cf755aa869a5c4b762199ce531b12c5b"].unchecked_into(), + //5GzDPGbUM9uH52ZEwydasTj8edokGUJ7vEpoFWp9FE1YNuFB + hex!["d9c056c98ca0e6b4eb7f5c58c007c1db7be0fe1f3776108f797dd4990d1ccc33"].unchecked_into(), + //5GWZbVkJEfWZ7fRca39YAQeqri2Z7pkeHyd7rUctUHyQifLp + hex!["c4a980da30939d5bb9e4a734d12bf81259ae286aa21fa4b65405347fa40eff35"].unchecked_into(), + //5CmLCFeSurRXXtwMmLcVo7sdJ9EqDguvJbuCYDcHkr3cpqyE + hex!["1efc23c0b51ad609ab670ecf45807e31acbd8e7e5cb7c07cf49ee42992d2867c"].unchecked_into(), + //5DnsSy8a8pfE2aFjKBDtKw7WM1V4nfE5sLzP15MNTka53GqS + hex!["4c64d3f06d28adeb36a892fdaccecace150bec891f04694448a60b74fa469c22"].unchecked_into(), + //5CZdFnyzZvKetZTeUwj5APAYskVJe4QFiTezo5dQNsrnehGd + hex!["160ea09c5717270e958a3da42673fa011613a9539b2e4ebcad8626bc117ca04a"].unchecked_into(), + //5HgoR9JJkdBusxKrrs3zgd3ToppgNoGj1rDyAJp4e7eZiYyT + hex!["020019a8bb188f8145d02fa855e9c36e9914457d37c500e03634b5223aa5702474"].unchecked_into(), + ), + ( + //5HinEonzr8MywkqedcpsmwpxKje2jqr9miEwuzyFXEBCvVXM + hex!["fa373e25a1c4fe19c7148acde13bc3db1811cf656dc086820f3dda736b9c4a00"].into(), + //5EHJbj6Td6ks5HDnyfN4ttTSi57osxcQsQexm7XpazdeqtV7 + hex!["62145d721967bd88622d08625f0f5681463c0f1b8bcd97eb3c2c53f7660fd513"].into(), + //5EeCsC58XgJ1DFaoYA1WktEpP27jvwGpKdxPMFjicpLeYu96 + hex!["720537e2c1c554654d73b3889c3ef4c3c2f95a65dd3f7c185ebe4afebed78372"].unchecked_into(), + //5DnEySxbnppWEyN8cCLqvGjAorGdLRg2VmkY96dbJ1LHFK8N + hex!["4bea0b37e0cce9bddd80835fa2bfd5606f5dcfb8388bbb10b10c483f0856cf14"].unchecked_into(), + //5E1Y1FJ7dVP7qtE3wm241pTm72rTMcDT5Jd8Czv7Pwp7N3AH + hex!["560d90ca51e9c9481b8a9810060e04d0708d246714960439f804e5c6f40ca651"].unchecked_into(), + //5CAC278tFCHAeHYqE51FTWYxHmeLcENSS1RG77EFRTvPZMJT + hex!["042f07fc5268f13c026bbe199d63e6ac77a0c2a780f71cda05cee5a6f1b3f11f"].unchecked_into(), + //5HjRTLWcQjZzN3JDvaj1UzjNSayg5ZD9ZGWMstaL7Ab2jjAa + hex!["fab485e87ed1537d089df521edf983a777c57065a702d7ed2b6a2926f31da74f"].unchecked_into(), + //5ELv74v7QcsS6FdzvG4vL2NnYDGWmRnJUSMKYwdyJD7Xcdi7 + hex!["64d59feddb3d00316a55906953fb3db8985797472bd2e6c7ea1ab730cc339d7f"].unchecked_into(), + //5FaUcPt4fPz93vBhcrCJqmDkjYZ7jCbzAF56QJoCmvPaKrmx + hex!["033f1a6d47fe86f88934e4b83b9fae903b92b5dcf4fec97d5e3e8bf4f39df03685"].unchecked_into(), + ), + ( + //5Ey3NQ3dfabaDc16NUv7wRLsFCMDFJSqZFzKVycAsWuUC6Di + hex!["8062e9c21f1d92926103119f7e8153cebdb1e5ab3e52d6f395be80bb193eab47"].into(), + //5HiWsuSBqt8nS9pnggexXuHageUifVPKPHDE2arTKqhTp1dV + hex!["fa0388fa88f3f0cb43d583e2571fbc0edad57dff3a6fd89775451dd2c2b8ea00"].into(), + //5H168nKX2Yrfo3bxj7rkcg25326Uv3CCCnKUGK6uHdKMdPt8 + hex!["da6b2df18f0f9001a6dcf1d301b92534fe9b1f3ccfa10c49449fee93adaa8349"].unchecked_into(), + //5DrA2fZdzmNqT5j6DXNwVxPBjDV9jhkAqvjt6Us3bQHKy3cF + hex!["4ee66173993dd0db5d628c4c9cb61a27b76611ad3c3925947f0d0011ee2c5dcc"].unchecked_into(), + //5FNFDUGNLUtqg5LgrwYLNmBiGoP8KRxsvQpBkc7GQP6qaBUG + hex!["92156f54a114ee191415898f2da013d9db6a5362d6b36330d5fc23e27360ab66"].unchecked_into(), + //5Gx6YeNhynqn8qkda9QKpc9S7oDr4sBrfAu516d3sPpEt26F + hex!["d822d4088b20dca29a580a577a97d6f024bb24c9550bebdfd7d2d18e946a1c7d"].unchecked_into(), + //5DhDcHqwxoes5s89AyudGMjtZXx1nEgrk5P45X88oSTR3iyx + hex!["481538f8c2c011a76d7d57db11c2789a5e83b0f9680dc6d26211d2f9c021ae4c"].unchecked_into(), + //5DqAvikdpfRdk5rR35ZobZhqaC5bJXZcEuvzGtexAZP1hU3T + hex!["4e262811acdfe94528bfc3c65036080426a0e1301b9ada8d687a70ffcae99c26"].unchecked_into(), + //5E41Znrr2YtZu8bZp3nvRuLVHg3jFksfQ3tXuviLku4wsao7 + hex!["025e84e95ed043e387ddb8668176b42f8e2773ddd84f7f58a6d9bf436a4b527986"].unchecked_into(), + ), + ]; const ENDOWMENT: u128 = 1_000_000 * ROC; const STASH: u128 = 100 * ROC; @@ -843,6 +856,7 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime:: .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), }, + pallet_beefy: Default::default(), pallet_indices: rococo_runtime::IndicesConfig { indices: vec![], }, @@ -857,6 +871,7 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime:: x.5.clone(), x.6.clone(), x.7.clone(), + x.8.clone(), ), )).collect::>(), }, @@ -1022,6 +1037,26 @@ where /// Helper function to generate stash, controller and session key from seed pub fn get_authority_keys_from_seed( seed: &str, +) -> ( + AccountId, + AccountId, + BabeId, + GrandpaId, + ImOnlineId, + ValidatorId, + AssignmentId, + AuthorityDiscoveryId, + BeefyId, +) { + let keys = get_authority_keys_from_seed_no_beefy(seed); + ( + keys.0, keys.1, keys.2, keys.3, keys.4, keys.5, keys.6, keys.7, get_from_seed::(seed) + ) +} + +/// Helper function to generate stash, controller and session key from seed +pub fn get_authority_keys_from_seed_no_beefy( + seed: &str, ) -> ( AccountId, AccountId, @@ -1269,6 +1304,7 @@ pub fn westend_testnet_genesis( ValidatorId, AssignmentId, AuthorityDiscoveryId, + BeefyId, )>, root_key: AccountId, endowed_accounts: Option>, @@ -1290,6 +1326,7 @@ pub fn westend_testnet_genesis( .map(|k| (k.clone(), ENDOWMENT)) .collect(), }, + pallet_beefy: Default::default(), pallet_session: westend::SessionConfig { keys: initial_authorities .iter() @@ -1304,6 +1341,7 @@ pub fn westend_testnet_genesis( x.5.clone(), x.6.clone(), x.7.clone(), + x.8.clone(), ), ) }) @@ -1352,6 +1390,7 @@ pub fn rococo_testnet_genesis( ValidatorId, AssignmentId, AuthorityDiscoveryId, + BeefyId, )>, root_key: AccountId, endowed_accounts: Option>, @@ -1365,6 +1404,7 @@ pub fn rococo_testnet_genesis( code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }, + pallet_beefy: Default::default(), pallet_indices: rococo_runtime::IndicesConfig { indices: vec![], }, @@ -1382,6 +1422,7 @@ pub fn rococo_testnet_genesis( x.5.clone(), x.6.clone(), x.7.clone(), + x.8.clone(), ), )).collect::>(), }, @@ -1443,7 +1484,7 @@ pub fn rococo_testnet_genesis( fn polkadot_development_config_genesis(wasm_binary: &[u8]) -> polkadot::GenesisConfig { polkadot_testnet_genesis( wasm_binary, - vec![get_authority_keys_from_seed("Alice")], + vec![get_authority_keys_from_seed_no_beefy("Alice")], get_account_id_from_seed::("Alice"), None, ) @@ -1452,7 +1493,7 @@ fn polkadot_development_config_genesis(wasm_binary: &[u8]) -> polkadot::GenesisC fn kusama_development_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisConfig { kusama_testnet_genesis( wasm_binary, - vec![get_authority_keys_from_seed("Alice")], + vec![get_authority_keys_from_seed_no_beefy("Alice")], get_account_id_from_seed::("Alice"), None, ) @@ -1522,8 +1563,8 @@ fn polkadot_local_testnet_genesis(wasm_binary: &[u8]) -> polkadot::GenesisConfig polkadot_testnet_genesis( wasm_binary, vec![ - get_authority_keys_from_seed("Alice"), - get_authority_keys_from_seed("Bob"), + get_authority_keys_from_seed_no_beefy("Alice"), + get_authority_keys_from_seed_no_beefy("Bob"), ], get_account_id_from_seed::("Alice"), None, @@ -1551,8 +1592,8 @@ fn kusama_local_testnet_genesis(wasm_binary: &[u8]) -> kusama::GenesisConfig { kusama_testnet_genesis( wasm_binary, vec![ - get_authority_keys_from_seed("Alice"), - get_authority_keys_from_seed("Bob"), + get_authority_keys_from_seed_no_beefy("Alice"), + get_authority_keys_from_seed_no_beefy("Bob"), ], get_account_id_from_seed::("Alice"), None, diff --git a/polkadot/node/service/src/client.rs b/polkadot/node/service/src/client.rs index 8ab89b6e94..a964ee5d8e 100644 --- a/polkadot/node/service/src/client.rs +++ b/polkadot/node/service/src/client.rs @@ -17,6 +17,7 @@ //! Polkadot Client meta trait use std::sync::Arc; +use beefy_primitives::ecdsa::AuthorityId as BeefyId; use sp_api::{ProvideRuntimeApi, CallApiAt, NumberFor}; use sp_blockchain::HeaderBackend; use sp_runtime::{ @@ -36,11 +37,13 @@ pub trait RuntimeApiCollection: + ParachainHost + sp_block_builder::BlockBuilder + frame_system_rpc_runtime_api::AccountNonceApi + + pallet_mmr_primitives::MmrApi::Hash> + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::Metadata + sp_offchain::OffchainWorkerApi + sp_session::SessionKeys + sp_authority_discovery::AuthorityDiscoveryApi + + beefy_primitives::BeefyApi where >::StateBackend: sp_api::StateBackend, {} @@ -54,11 +57,13 @@ where + ParachainHost + sp_block_builder::BlockBuilder + frame_system_rpc_runtime_api::AccountNonceApi + + pallet_mmr_primitives::MmrApi::Hash> + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::Metadata + sp_offchain::OffchainWorkerApi + sp_session::SessionKeys - + sp_authority_discovery::AuthorityDiscoveryApi, + + sp_authority_discovery::AuthorityDiscoveryApi + + beefy_primitives::BeefyApi, >::StateBackend: sp_api::StateBackend, {} diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs index aba1333a9f..0390341760 100644 --- a/polkadot/node/service/src/lib.rs +++ b/polkadot/node/service/src/lib.rs @@ -40,6 +40,7 @@ use { sc_keystore::LocalKeystore, babe_primitives::BabeApi, grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}, + beefy_primitives::ecdsa::AuthoritySignature as BeefySignature, sp_runtime::traits::Header as HeaderT, }; #[cfg(feature = "real-overseer")] @@ -243,7 +244,8 @@ fn new_partial( Block, FullClient, FullGrandpaBlockImport >, grandpa::LinkHalf, FullSelectChain>, - babe::BabeLink + babe::BabeLink, + beefy_gadget::notification::BeefySignedCommitmentSender, ), grandpa::SharedVoterState, std::time::Duration, // slot-duration @@ -342,6 +344,9 @@ fn new_partial( telemetry.as_ref().map(|x| x.handle()), )?; + let (beefy_link, beefy_commitment_stream) = + beefy_gadget::notification::BeefySignedCommitmentStream::channel(); + let justification_stream = grandpa_link.justification_stream(); let shared_authority_set = grandpa_link.shared_authority_set().clone(); let shared_voter_state = grandpa::SharedVoterState::empty(); @@ -350,7 +355,7 @@ fn new_partial( Some(shared_authority_set.clone()), ); - let import_setup = (block_import.clone(), grandpa_link, babe_link.clone()); + let import_setup = (block_import.clone(), grandpa_link, babe_link.clone(), beefy_link); let rpc_setup = shared_voter_state.clone(); let shared_epoch_changes = babe_link.epoch_changes().clone(); @@ -363,7 +368,9 @@ fn new_partial( let select_chain = select_chain.clone(); let chain_spec = config.chain_spec.cloned_box(); - move |deny_unsafe, subscription_executor| -> polkadot_rpc::RpcExtension { + move |deny_unsafe, subscription_executor: polkadot_rpc::SubscriptionTaskExecutor| + -> polkadot_rpc::RpcExtension + { let deps = polkadot_rpc::FullDeps { client: client.clone(), pool: transaction_pool.clone(), @@ -379,9 +386,13 @@ fn new_partial( shared_voter_state: shared_voter_state.clone(), shared_authority_set: shared_authority_set.clone(), justification_stream: justification_stream.clone(), - subscription_executor, + subscription_executor: subscription_executor.clone(), finality_provider: finality_proof_provider.clone(), }, + beefy: polkadot_rpc::BeefyDeps { + beefy_commitment_stream: beefy_commitment_stream.clone(), + subscription_executor, + }, }; polkadot_rpc::create_full(deps) @@ -731,6 +742,11 @@ pub fn new_full( // anything in terms of behaviour, but makes the logs more consistent with the other // Substrate nodes. config.network.extra_sets.push(grandpa::grandpa_peers_set_config()); + + if config.chain_spec.is_westend() || config.chain_spec.is_rococo() { + config.network.extra_sets.push(beefy_gadget::beefy_peers_set_config()); + } + #[cfg(feature = "real-overseer")] { use polkadot_network_bridge::{peer_sets_info, IsAuthority}; @@ -824,6 +840,7 @@ pub fn new_full( } let availability_config = config.database.clone().try_into().map_err(Error::Availability)?; + let chain_spec = config.chain_spec.cloned_box(); let approval_voting_config = ApprovalVotingConfig { path: config.database.path() @@ -849,7 +866,7 @@ pub fn new_full( telemetry: telemetry.as_mut(), })?; - let (block_import, link_half, babe_link) = import_setup; + let (block_import, link_half, babe_link, beefy_link) = import_setup; let overseer_client = client.clone(); let spawner = task_manager.spawn_handle(); @@ -967,6 +984,29 @@ pub fn new_full( task_manager.spawn_essential_handle().spawn_blocking("babe", babe); } + // We currently only run the BEEFY gadget on Rococo and Westend test + // networks. On Rococo we start the BEEFY gadget as a normal (non-essential) + // task for now, since BEEFY is still experimental and we don't want a + // failure to bring down the whole node. Westend test network is less used + // than Rococo and therefore a failure there will be less problematic, this + // will be the main testing target for BEEFY for now. + if chain_spec.is_westend() || chain_spec.is_rococo() { + let gadget = beefy_gadget::start_beefy_gadget::<_, beefy_primitives::ecdsa::AuthorityPair, _, _, _, _>( + client.clone(), + keystore_container.sync_keystore(), + network.clone(), + beefy_link, + network.clone(), + prometheus_registry.clone() + ); + + if chain_spec.is_westend() { + task_manager.spawn_essential_handle().spawn_blocking("beefy-gadget", gadget); + } else { + task_manager.spawn_handle().spawn_blocking("beefy-gadget", gadget); + } + } + // if the node isn't actively participating in consensus then it doesn't // need a keystore, regardless of which protocol we use below. let keystore_opt = if role.is_authority() { diff --git a/polkadot/rpc/Cargo.toml b/polkadot/rpc/Cargo.toml index 3a51aea9e0..87178e5cf0 100644 --- a/polkadot/rpc/Cargo.toml +++ b/polkadot/rpc/Cargo.toml @@ -7,24 +7,27 @@ edition = "2018" [dependencies] jsonrpc-core = "15.1.0" polkadot-primitives = { path = "../primitives" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master"} -sc-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate", branch = "master"} -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "master"} +sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master"} -sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "master"} +sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" } txpool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master" } -frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "master" } +frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-mmr-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" } parity-scale-codec = { version = "2.0.0", default-features = false } sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } +beefy-gadget = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master" } +beefy-gadget-rpc = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master" } diff --git a/polkadot/rpc/src/lib.rs b/polkadot/rpc/src/lib.rs index 2f036563d4..7be156aaaf 100644 --- a/polkadot/rpc/src/lib.rs +++ b/polkadot/rpc/src/lib.rs @@ -74,8 +74,16 @@ pub struct GrandpaDeps { pub finality_provider: Arc>, } +/// Dependencies for BEEFY +pub struct BeefyDeps { + /// Receives notifications about signed commitment events from BEEFY. + pub beefy_commitment_stream: beefy_gadget::notification::BeefySignedCommitmentStream, + /// Executor to drive the subscription manager in the BEEFY RPC handler. + pub subscription_executor: sc_rpc::SubscriptionTaskExecutor, +} + /// Full client dependencies -pub struct FullDeps { +pub struct FullDeps { /// The client instance to use. pub client: Arc, /// Transaction pool instance. @@ -90,13 +98,16 @@ pub struct FullDeps { pub babe: BabeDeps, /// GRANDPA specific dependencies. pub grandpa: GrandpaDeps, + /// BEEFY specific dependencies. + pub beefy: BeefyDeps, } /// Instantiate all RPC extensions. -pub fn create_full(deps: FullDeps) -> RpcExtension where +pub fn create_full(deps: FullDeps) -> RpcExtension where C: ProvideRuntimeApi + HeaderBackend + AuxStore + HeaderMetadata + Send + Sync + 'static, C::Api: frame_rpc_system::AccountNonceApi, + C::Api: pallet_mmr_rpc::MmrRuntimeApi::Hash>, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BabeApi, C::Api: BlockBuilder, @@ -104,11 +115,13 @@ pub fn create_full(deps: FullDeps) -> RpcExtension whe SC: SelectChain + 'static, B: sc_client_api::Backend + Send + Sync + 'static, B::State: sc_client_api::StateBackend>, + BS: Clone + Send + parity_scale_codec::Encode + 'static, { use frame_rpc_system::{FullSystem, SystemApi}; + use pallet_mmr_rpc::{MmrApi, Mmr}; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; - use sc_finality_grandpa_rpc::{GrandpaApi, GrandpaRpcHandler}; use sc_consensus_babe_rpc::BabeRpcHandler; + use sc_finality_grandpa_rpc::{GrandpaApi, GrandpaRpcHandler}; let mut io = jsonrpc_core::IoHandler::default(); let FullDeps { @@ -119,6 +132,7 @@ pub fn create_full(deps: FullDeps) -> RpcExtension whe deny_unsafe, babe, grandpa, + beefy, } = deps; let BabeDeps { keystore, @@ -139,6 +153,9 @@ pub fn create_full(deps: FullDeps) -> RpcExtension whe io.extend_with( TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone())) ); + io.extend_with( + MmrApi::to_delegate(Mmr::new(client.clone())) + ); io.extend_with( sc_consensus_babe_rpc::BabeApi::to_delegate( BabeRpcHandler::new( @@ -169,6 +186,14 @@ pub fn create_full(deps: FullDeps) -> RpcExtension whe deny_unsafe, )) ); + + io.extend_with(beefy_gadget_rpc::BeefyApi::to_delegate( + beefy_gadget_rpc::BeefyRpcHandler::new( + beefy.beefy_commitment_stream, + beefy.subscription_executor, + ), + )); + io } diff --git a/polkadot/runtime/common/Cargo.toml b/polkadot/runtime/common/Cargo.toml index c26ec67fe6..e2e8e621f4 100644 --- a/polkadot/runtime/common/Cargo.toml +++ b/polkadot/runtime/common/Cargo.toml @@ -8,12 +8,13 @@ edition = "2018" impl-trait-for-tuples = "0.2.0" bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } parity-scale-codec = { version = "2.0.0", default-features = false, features = ["derive"] } -log = { version = "0.4.13", optional = true } +log = { version = "0.4.13", default-features = false } rustc-hex = { version = "2.1.0", default-features = false } serde = { version = "1.0.123", default-features = false } serde_derive = { version = "1.0.117", optional = true } static_assertions = "1.1.0" +beefy-primitives = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-std = { package = "sp-std", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -35,11 +36,14 @@ pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "m pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-beefy = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } +pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } + frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features=false, optional = true } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } -libsecp256k1 = { version = "0.3.5", default-features = false, optional = true } +libsecp256k1 = { version = "0.3.5", default-features = false } runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parachains", default-features = false } xcm = { path = "../../xcm", default-features = false } @@ -63,9 +67,10 @@ libsecp256k1 = "0.3.5" default = ["std"] no_std = [] std = [ + "beefy-primitives/std", "bitvec/std", "parity-scale-codec/std", - "log", + "log/std", "rustc-hex/std", "serde_derive", "serde/std", @@ -78,6 +83,8 @@ std = [ "frame-support/std", "pallet-authorship/std", "pallet-balances/std", + "pallet-beefy/std", + "pallet-mmr/std", "pallet-session/std", "pallet-staking/std", "pallet-timestamp/std", @@ -88,6 +95,7 @@ std = [ "sp-session/std", "sp-staking/std", "frame-system/std", + "libsecp256k1/std", "runtime-parachains/std", "xcm/std", ] diff --git a/polkadot/runtime/common/src/lib.rs b/polkadot/runtime/common/src/lib.rs index 8f4a591a52..9bb348b829 100644 --- a/polkadot/runtime/common/src/lib.rs +++ b/polkadot/runtime/common/src/lib.rs @@ -25,14 +25,16 @@ pub mod auctions; pub mod crowdloan; pub mod purchase; pub mod impls; +pub mod mmr; pub mod paras_sudo_wrapper; pub mod paras_registrar; pub mod traits; +pub mod xcm_sender; + #[cfg(test)] mod mock; #[cfg(test)] mod integration_tests; -pub mod xcm_sender; use primitives::v1::{BlockNumber, ValidatorId, AssignmentId}; use sp_runtime::{Perquintill, Perbill, FixedPointNumber}; diff --git a/polkadot/runtime/common/src/mmr.rs b/polkadot/runtime/common/src/mmr.rs new file mode 100644 index 0000000000..a4f982bfd4 --- /dev/null +++ b/polkadot/runtime/common/src/mmr.rs @@ -0,0 +1,216 @@ +// Copyright 2020 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 . + +//! A pallet responsible for creating Merkle Mountain Range (MMR) leaf for current block. + +use beefy_primitives::ValidatorSetId; +use sp_core::H256; +use sp_runtime::traits::Convert; +use sp_std::prelude::*; +use frame_support::{decl_module, decl_storage, RuntimeDebug}; +use pallet_mmr::primitives::LeafDataProvider; +use parity_scale_codec::{Encode, Decode}; +use runtime_parachains::paras; + +/// A BEEFY consensus digest item with MMR root hash. +pub struct DepositBeefyDigest(sp_std::marker::PhantomData); + +impl pallet_mmr::primitives::OnNewRoot for DepositBeefyDigest where + T: pallet_mmr::Config, + T: pallet_beefy::Config, +{ + fn on_new_root(root: &::Hash) { + let digest = sp_runtime::generic::DigestItem::Consensus( + beefy_primitives::BEEFY_ENGINE_ID, + parity_scale_codec::Encode::encode( + &beefy_primitives::ConsensusLog::<::AuthorityId>::MmrRoot(*root) + ), + ); + >::deposit_log(digest); + } +} + +/// Convert BEEFY secp256k1 public keys into uncompressed form +pub struct UncompressBeefyEcdsaKeys; +impl Convert> for UncompressBeefyEcdsaKeys { + fn convert(a: beefy_primitives::ecdsa::AuthorityId) -> Vec { + use sp_core::crypto::Public; + let compressed_key = a.as_slice(); + // TODO [ToDr] Temporary workaround until we have a better way to get uncompressed keys. + secp256k1::PublicKey::parse_slice(compressed_key, Some(secp256k1::PublicKeyFormat::Compressed)) + .map(|pub_key| pub_key.serialize().to_vec()) + .map_err(|_| { + log::error!(target: "runtime::beefy", "Invalid BEEFY PublicKey format!"); + }) + .unwrap_or_default() + } +} + +/// A leaf that gets added every block to the MMR constructed by [pallet_mmr]. +#[derive(RuntimeDebug, PartialEq, Eq, Clone, Encode, Decode)] +pub struct MmrLeaf { + /// Current block parent number and hash. + pub parent_number_and_hash: (BlockNumber, Hash), + /// A merkle root of all registered parachain heads. + pub parachain_heads: MerkleRoot, + /// A merkle root of the next BEEFY authority set. + pub beefy_next_authority_set: BeefyNextAuthoritySet, +} + +/// Details of the next BEEFY authority set. +#[derive(RuntimeDebug, Default, PartialEq, Eq, Clone, Encode, Decode)] +pub struct BeefyNextAuthoritySet { + /// Id of the next set. + /// + /// Id is required to correlate BEEFY signed commitments with the validator set. + /// Light Client can easily verify that the commitment witness it is getting is + /// produced by the latest validator set. + pub id: ValidatorSetId, + /// Number of validators in the set. + /// + /// Some BEEFY Light Clients may use an interactive protocol to verify only subset + /// of signatures. We put set length here, so that these clients can verify the minimal + /// number of required signatures. + pub len: u32, + /// Merkle Root Hash build from BEEFY AuthorityIds. + /// + /// This is used by Light Clients to confirm that the commitments are signed by the correct + /// validator set. Light Clients using interactive protocol, might verify only subset of + /// signatures, hence don't require the full list here (will receive inclusion proofs). + pub root: MerkleRoot, +} + +type MerkleRootOf = ::Hash; + +/// The module's configuration trait. +pub trait Config: pallet_mmr::Config + pallet_beefy::Config { + /// Convert BEEFY AuthorityId to a form that would end up in the Merkle Tree. + /// + /// For instance for ECDSA (secp256k1) we want to store uncompressed public keys (65 bytes) + /// to simplify using them on Ethereum chain, but the rest of the Substrate codebase + /// is storing them compressed (33 bytes) for efficiency reasons. + type BeefyAuthorityToMerkleLeaf: Convert<::AuthorityId, Vec>; + + /// Retrieve a list of current parachain heads. + /// + /// The trait is implemented for `paras` module, but since not all chains might have parachains, + /// and we want to keep the MMR leaf structure uniform, it's possible to use `()` as well to + /// simply put dummy data to the leaf. + type ParachainHeads: ParachainHeadsProvider; +} + +/// A type that is able to return current list of parachain heads that end up in the MMR leaf. +pub trait ParachainHeadsProvider { + /// Return a list of encoded parachain heads. + fn encoded_heads() -> Vec>; +} + +/// A default implementation for runtimes without parachains. +impl ParachainHeadsProvider for () { + fn encoded_heads() -> Vec> { + Default::default() + } +} + +impl ParachainHeadsProvider for paras::Pallet { + fn encoded_heads() -> Vec> { + paras::Pallet::::parachains() + .into_iter() + .map(paras::Pallet::::para_head) + .map(|maybe_para_head| maybe_para_head.encode()) + .collect() + } +} + +decl_storage! { + trait Store for Pallet as Beefy { + /// Details of next BEEFY authority set. + /// + /// This storage entry is used as cache for calls to [`update_beefy_next_authority_set`]. + pub BeefyNextAuthorities get(fn beefy_next_authorities): BeefyNextAuthoritySet>; + } +} + +decl_module! { + pub struct Module for enum Call where origin: ::Origin { + } +} + +impl LeafDataProvider for Pallet where + MerkleRootOf: From, +{ + type LeafData = MmrLeaf< + ::BlockNumber, + ::Hash, + MerkleRootOf, + >; + + fn leaf_data() -> Self::LeafData { + MmrLeaf { + parent_number_and_hash: frame_system::Pallet::::leaf_data(), + parachain_heads: Pallet::::parachain_heads_merkle_root(), + beefy_next_authority_set: Pallet::::update_beefy_next_authority_set(), + } + } +} + +impl Pallet where + MerkleRootOf: From, + ::AuthorityId: +{ + /// Returns latest root hash of a merkle tree constructed from all registered parachain headers. + /// + /// NOTE this does not include parathreads - only parachains are part of the merkle tree. + /// + /// NOTE This is an initial and inefficient implementation, which re-constructs + /// the merkle tree every block. Instead we should update the merkle root in [Self::on_initialize] + /// call of this pallet and update the merkle tree efficiently (use on-chain storage to persist inner nodes). + fn parachain_heads_merkle_root() -> MerkleRootOf { + let para_heads = T::ParachainHeads::encoded_heads(); + sp_io::trie::keccak_256_ordered_root(para_heads).into() + } + + /// Returns details of the next BEEFY authority set. + /// + /// Details contain authority set id, authority set length and a merkle root, + /// constructed from uncompressed secp256k1 public keys of the next BEEFY authority set. + /// + /// This function will use a storage-cached entry in case the set didn't change, or compute and cache + /// new one in case it did. + fn update_beefy_next_authority_set() -> BeefyNextAuthoritySet> { + let id = pallet_beefy::Pallet::::validator_set_id() + 1; + let current_next = Self::beefy_next_authorities(); + // avoid computing the merkle tree if validator set id didn't change. + if id == current_next.id { + return current_next; + } + + let beefy_public_keys = pallet_beefy::Pallet::::next_authorities() + .into_iter() + .map(T::BeefyAuthorityToMerkleLeaf::convert) + .collect::>(); + let len = beefy_public_keys.len() as u32; + let root: MerkleRootOf = sp_io::trie::keccak_256_ordered_root(beefy_public_keys).into(); + let next_set = BeefyNextAuthoritySet { + id, + len, + root, + }; + // cache the result + BeefyNextAuthorities::::put(&next_set); + next_set + } +} diff --git a/polkadot/runtime/kusama/Cargo.toml b/polkadot/runtime/kusama/Cargo.toml index c8ba35aba1..ed73808b22 100644 --- a/polkadot/runtime/kusama/Cargo.toml +++ b/polkadot/runtime/kusama/Cargo.toml @@ -17,6 +17,7 @@ smallvec = "1.6.1" authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +beefy-primitives = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -48,6 +49,7 @@ pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "m pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -154,6 +156,8 @@ std = [ "runtime-common/std", "frame-try-runtime/std", "sp-npos-elections/std", + "beefy-primitives/std", + "pallet-mmr-primitives/std", ] runtime-benchmarks = [ "runtime-common/runtime-benchmarks", diff --git a/polkadot/runtime/kusama/src/lib.rs b/polkadot/runtime/kusama/src/lib.rs index 9624c66983..95b5c07468 100644 --- a/polkadot/runtime/kusama/src/lib.rs +++ b/polkadot/runtime/kusama/src/lib.rs @@ -66,6 +66,8 @@ use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pallet_session::historical as session_historical; use static_assertions::const_assert; +use beefy_primitives::ecdsa::AuthorityId as BeefyId; +use pallet_mmr_primitives as mmr; #[cfg(feature = "std")] pub use pallet_staking::StakerStatus; @@ -1217,6 +1219,38 @@ sp_api::impl_runtime_apis! { } } + impl beefy_primitives::BeefyApi for Runtime { + fn validator_set() -> beefy_primitives::ValidatorSet { + // dummy implementation due to lack of BEEFY pallet. + beefy_primitives::ValidatorSet { validators: Vec::new(), id: 0 } + } + } + + impl mmr::MmrApi for Runtime { + fn generate_proof(_leaf_index: u64) + -> Result<(mmr::EncodableOpaqueLeaf, mmr::Proof), mmr::Error> + { + // dummy implementation due to lack of MMR pallet. + Err(mmr::Error::GenerateProof) + } + + fn verify_proof(_leaf: mmr::EncodableOpaqueLeaf, _proof: mmr::Proof) + -> Result<(), mmr::Error> + { + // dummy implementation due to lack of MMR pallet. + Err(mmr::Error::Verify) + } + + fn verify_proof_stateless( + _root: Hash, + _leaf: mmr::EncodableOpaqueLeaf, + _proof: mmr::Proof + ) -> Result<(), mmr::Error> { + // dummy implementation due to lack of MMR pallet. + Err(mmr::Error::Verify) + } + } + impl fg_primitives::GrandpaApi for Runtime { fn grandpa_authorities() -> Vec<(GrandpaId, u64)> { Grandpa::grandpa_authorities() diff --git a/polkadot/runtime/parachains/Cargo.toml b/polkadot/runtime/parachains/Cargo.toml index d760b37eb6..172f32fdb1 100644 --- a/polkadot/runtime/parachains/Cargo.toml +++ b/polkadot/runtime/parachains/Cargo.toml @@ -56,7 +56,7 @@ pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "m serde_json = "1.0.61" libsecp256k1 = "0.3.5" sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master"} +sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } [features] diff --git a/polkadot/runtime/polkadot/Cargo.toml b/polkadot/runtime/polkadot/Cargo.toml index 865503b49c..83976a3012 100644 --- a/polkadot/runtime/polkadot/Cargo.toml +++ b/polkadot/runtime/polkadot/Cargo.toml @@ -17,6 +17,7 @@ smallvec = "1.6.1" authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +beefy-primitives = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -48,6 +49,7 @@ pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "m pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -150,6 +152,8 @@ std = [ "runtime-common/std", "frame-try-runtime/std", "sp-npos-elections/std", + "beefy-primitives/std", + "pallet-mmr-primitives/std", ] runtime-benchmarks = [ "runtime-common/runtime-benchmarks", diff --git a/polkadot/runtime/polkadot/src/lib.rs b/polkadot/runtime/polkadot/src/lib.rs index 5db5d37f97..3aa9c46162 100644 --- a/polkadot/runtime/polkadot/src/lib.rs +++ b/polkadot/runtime/polkadot/src/lib.rs @@ -66,6 +66,8 @@ use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pallet_session::historical as session_historical; use static_assertions::const_assert; +use beefy_primitives::ecdsa::AuthorityId as BeefyId; +use pallet_mmr_primitives as mmr; #[cfg(feature = "std")] pub use pallet_staking::StakerStatus; @@ -1243,6 +1245,38 @@ sp_api::impl_runtime_apis! { } + impl beefy_primitives::BeefyApi for Runtime { + fn validator_set() -> beefy_primitives::ValidatorSet { + // dummy implementation due to lack of BEEFY pallet. + beefy_primitives::ValidatorSet { validators: Vec::new(), id: 0 } + } + } + + impl mmr::MmrApi for Runtime { + fn generate_proof(_leaf_index: u64) + -> Result<(mmr::EncodableOpaqueLeaf, mmr::Proof), mmr::Error> + { + // dummy implementation due to lack of MMR pallet. + Err(mmr::Error::GenerateProof) + } + + fn verify_proof(_leaf: mmr::EncodableOpaqueLeaf, _proof: mmr::Proof) + -> Result<(), mmr::Error> + { + // dummy implementation due to lack of MMR pallet. + Err(mmr::Error::Verify) + } + + fn verify_proof_stateless( + _root: Hash, + _leaf: mmr::EncodableOpaqueLeaf, + _proof: mmr::Proof + ) -> Result<(), mmr::Error> { + // dummy implementation due to lack of MMR pallet. + Err(mmr::Error::Verify) + } + } + impl fg_primitives::GrandpaApi for Runtime { fn grandpa_authorities() -> Vec<(GrandpaId, u64)> { Grandpa::grandpa_authorities() diff --git a/polkadot/runtime/rococo/Cargo.toml b/polkadot/runtime/rococo/Cargo.toml index b5d0078e0a..e7c4b5581e 100644 --- a/polkadot/runtime/rococo/Cargo.toml +++ b/polkadot/runtime/rococo/Cargo.toml @@ -28,21 +28,25 @@ block-builder-api = { package = "sp-block-builder", git = "https://github.com/pa inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +beefy-primitives = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } +frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-beefy = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-staking-reward-curve = { package = "pallet-staking-reward-curve", git = "https://github.com/paritytech/substrate", branch = "master" } -frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -75,9 +79,13 @@ std = [ "pallet-authority-discovery/std", "pallet-authorship/std", "pallet-babe/std", + "beefy-primitives/std", "pallet-balances/std", + "pallet-beefy/std", "pallet-grandpa/std", "pallet-sudo/std", + "pallet-mmr/std", + "pallet-mmr-primitives/std", "pallet-indices/std", "pallet-im-online/std", "pallet-session/std", diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index e841939c02..092630a377 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -32,6 +32,7 @@ use primitives::v1::{ SessionInfo as SessionInfoData, }; use runtime_common::{ + mmr as mmr_common, SlowAdjustingFeeUpdate, impls::ToAuthor, BlockHashCount, BlockWeights, BlockLength, RocksDbWeight, }; use runtime_parachains::{ @@ -44,7 +45,7 @@ use sp_runtime::{ ApplyExtrinsicResult, KeyTypeId, Perbill, ModuleId, transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority}, traits::{ - BlakeTwo256, Block as BlockT, OpaqueKeys, AccountIdLookup, + self, Keccak256, BlakeTwo256, Block as BlockT, OpaqueKeys, AccountIdLookup, Extrinsic as ExtrinsicT, SaturatedConversion, Verify, }, }; @@ -58,6 +59,8 @@ use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; use sp_core::{OpaqueMetadata, RuntimeDebug}; use sp_staking::SessionIndex; use pallet_session::historical as session_historical; +use beefy_primitives::ecdsa::AuthorityId as BeefyId; +use pallet_mmr_primitives as mmr; use frame_system::EnsureRoot; use runtime_common::{paras_sudo_wrapper, paras_registrar, xcm_sender, auctions, crowdloan, slots}; @@ -151,10 +154,29 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive, Runtime, AllPallets>; +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPallets, + UpgradeSessionKeys, +>; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; +// TODO [ToDr] Remove while BEEFY runtime upgrade is done. +impl_opaque_keys! { + pub struct OldSessionKeys { + pub grandpa: Grandpa, + pub babe: Babe, + pub im_online: ImOnline, + pub para_validator: Initializer, + pub para_assignment: SessionInfo, + pub authority_discovery: AuthorityDiscovery, + } +} + impl_opaque_keys! { pub struct SessionKeys { pub grandpa: Grandpa, @@ -163,6 +185,35 @@ impl_opaque_keys! { pub para_validator: Initializer, pub para_assignment: SessionInfo, pub authority_discovery: AuthorityDiscovery, + pub beefy: Beefy, + } +} + +fn transform_session_keys(v: AccountId, old: OldSessionKeys) -> SessionKeys { + SessionKeys { + grandpa: old.grandpa, + babe: old.babe, + im_online: old.im_online, + para_validator: old.para_validator, + para_assignment: old.para_assignment, + authority_discovery: old.authority_discovery, + beefy: { + // We need to produce a dummy value that's unique for the validator. + let mut id = BeefyId::default(); + let id_raw: &mut [u8] = id.as_mut(); + id_raw.copy_from_slice(v.as_ref()); + id_raw[0..4].copy_from_slice(b"beef"); + id + }, + } +} + +// When this is removed, should also remove `OldSessionKeys`. +pub struct UpgradeSessionKeys; +impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + Session::upgrade_keys::(transform_session_keys); + Perbill::from_percent(50) * BlockWeights::get().max_block } } @@ -215,6 +266,11 @@ construct_runtime! { // Sudo Sudo: pallet_sudo::{Pallet, Call, Storage, Event, Config}, + // Bridges support. + Mmr: pallet_mmr::{Pallet, Call, Storage}, + Beefy: pallet_beefy::{Pallet, Config, Storage}, + MmrLeaf: mmr_common::{Pallet, Storage}, + // Validator Manager pallet. ValidatorManager: validator_manager::{Pallet, Call, Storage, Event}, @@ -619,6 +675,24 @@ impl paras_registrar::Config for Runtime { /// THIS SHOULD ONLY BE USED FOR TESTING PURPOSES. pub struct ParentHashRandomness; +impl pallet_beefy::Config for Runtime { + type AuthorityId = BeefyId; +} + +impl pallet_mmr::Config for Runtime { + const INDEXING_PREFIX: &'static [u8] = b"mmr"; + type Hashing = Keccak256; + type Hash = ::Output; + type OnNewRoot = mmr_common::DepositBeefyDigest; + type WeightInfo = (); + type LeafData = mmr_common::Pallet; +} + +impl mmr_common::Config for Runtime { + type BeefyAuthorityToMerkleLeaf = mmr_common::UncompressBeefyEcdsaKeys; + type ParachainHeads = Paras; +} + impl Randomness for ParentHashRandomness { fn random(subject: &[u8]) -> (Hash, BlockNumber) { ( @@ -981,6 +1055,45 @@ sp_api::impl_runtime_apis! { } } + impl beefy_primitives::BeefyApi for Runtime { + fn validator_set() -> beefy_primitives::ValidatorSet { + Beefy::validator_set() + } + } + + impl pallet_mmr_primitives::MmrApi for Runtime { + fn generate_proof(leaf_index: u64) + -> Result<(mmr::EncodableOpaqueLeaf, mmr::Proof), mmr::Error> + { + Mmr::generate_proof(leaf_index) + .map(|(leaf, proof)| (mmr::EncodableOpaqueLeaf::from_leaf(&leaf), proof)) + } + + fn verify_proof(leaf: mmr::EncodableOpaqueLeaf, proof: mmr::Proof) + -> Result<(), mmr::Error> + { + pub type Leaf = < + ::LeafData as mmr::LeafDataProvider + >::LeafData; + + let leaf: Leaf = leaf + .into_opaque_leaf() + .try_decode() + .ok_or(mmr::Error::Verify)?; + Mmr::verify_leaf(leaf, proof) + } + + fn verify_proof_stateless( + root: Hash, + leaf: mmr::EncodableOpaqueLeaf, + proof: mmr::Proof + ) -> Result<(), mmr::Error> { + type MmrHashing = ::Hashing; + let node = mmr::DataOrHash::Data(leaf.into_opaque_leaf()); + pallet_mmr::verify_leaf_proof::(root, node, proof) + } + } + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) diff --git a/polkadot/runtime/test-runtime/Cargo.toml b/polkadot/runtime/test-runtime/Cargo.toml index 9cb7e198e6..1db092d8e9 100644 --- a/polkadot/runtime/test-runtime/Cargo.toml +++ b/polkadot/runtime/test-runtime/Cargo.toml @@ -16,6 +16,7 @@ smallvec = "1.6.1" authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +beefy-primitives = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -39,6 +40,7 @@ pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/parityt frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/polkadot/runtime/test-runtime/src/lib.rs b/polkadot/runtime/test-runtime/src/lib.rs index 685c5918c5..567b244c01 100644 --- a/polkadot/runtime/test-runtime/src/lib.rs +++ b/polkadot/runtime/test-runtime/src/lib.rs @@ -69,6 +69,8 @@ use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pallet_session::historical as session_historical; use polkadot_runtime_parachains::reward_points::RewardValidatorsWithEraPoints; +use beefy_primitives::ecdsa::AuthorityId as BeefyId; +use pallet_mmr_primitives as mmr; #[cfg(feature = "std")] pub use pallet_staking::StakerStatus; @@ -701,6 +703,38 @@ sp_api::impl_runtime_apis! { } } + impl beefy_primitives::BeefyApi for Runtime { + fn validator_set() -> beefy_primitives::ValidatorSet { + // dummy implementation due to lack of BEEFY pallet. + beefy_primitives::ValidatorSet { validators: Vec::new(), id: 0 } + } + } + + impl mmr::MmrApi for Runtime { + fn generate_proof(_leaf_index: u64) + -> Result<(mmr::EncodableOpaqueLeaf, mmr::Proof), mmr::Error> + { + // dummy implementation due to lack of MMR pallet. + Err(mmr::Error::GenerateProof) + } + + fn verify_proof(_leaf: mmr::EncodableOpaqueLeaf, _proof: mmr::Proof) + -> Result<(), mmr::Error> + { + // dummy implementation due to lack of MMR pallet. + Err(mmr::Error::Verify) + } + + fn verify_proof_stateless( + _root: Hash, + _leaf: mmr::EncodableOpaqueLeaf, + _proof: mmr::Proof + ) -> Result<(), mmr::Error> { + // dummy implementation due to lack of MMR pallet. + Err(mmr::Error::Verify) + } + } + impl fg_primitives::GrandpaApi for Runtime { fn grandpa_authorities() -> Vec<(GrandpaId, u64)> { Grandpa::grandpa_authorities() diff --git a/polkadot/runtime/westend/Cargo.toml b/polkadot/runtime/westend/Cargo.toml index 6760162e22..93cc15d10b 100644 --- a/polkadot/runtime/westend/Cargo.toml +++ b/polkadot/runtime/westend/Cargo.toml @@ -17,6 +17,7 @@ static_assertions = "1.1.0" authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +beefy-primitives = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -34,6 +35,7 @@ sp-npos-elections = { git = "https://github.com/paritytech/substrate", branch = pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-beefy = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master", default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -47,6 +49,8 @@ pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "m pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -124,6 +128,10 @@ std = [ "pallet-im-online/std", "pallet-indices/std", "pallet-membership/std", + "pallet-beefy/std", + "pallet-mmr/std", + "pallet-mmr-primitives/std", + "beefy-primitives/std", "pallet-multisig/std", "pallet-nicks/std", "pallet-offences/std", @@ -171,6 +179,7 @@ runtime-benchmarks = [ "pallet-identity/runtime-benchmarks", "pallet-im-online/runtime-benchmarks", "pallet-indices/runtime-benchmarks", + "pallet-mmr/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 9709366306..0615fcb828 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -31,6 +31,7 @@ use primitives::v1::{ InboundDownwardMessage, InboundHrmpMessage, SessionInfo, }; use runtime_common::{ + mmr as mmr_common, SlowAdjustingFeeUpdate, CurrencyToVote, impls::ToAuthor, BlockHashCount, BlockWeights, BlockLength, RocksDbWeight, OffchainSolutionWeightLimit, @@ -41,7 +42,7 @@ use sp_runtime::{ ApplyExtrinsicResult, KeyTypeId, Perbill, curve::PiecewiseLinear, transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority}, traits::{ - BlakeTwo256, Block as BlockT, OpaqueKeys, ConvertInto, AccountIdLookup, + Keccak256, BlakeTwo256, Block as BlockT, OpaqueKeys, ConvertInto, AccountIdLookup, Extrinsic as ExtrinsicT, SaturatedConversion, Verify, }, }; @@ -63,6 +64,8 @@ use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pallet_session::historical as session_historical; use frame_system::{EnsureRoot}; +use beefy_primitives::ecdsa::AuthorityId as BeefyId; +use pallet_mmr_primitives as mmr; #[cfg(feature = "std")] pub use pallet_staking::StakerStatus; @@ -263,6 +266,18 @@ parameter_types! { pub const Offset: BlockNumber = 0; } +// TODO [ToDr] Remove while BEEFY runtime upgrade is done. +impl_opaque_keys! { + pub struct OldSessionKeys { + pub grandpa: Grandpa, + pub babe: Babe, + pub im_online: ImOnline, + pub para_validator: ParachainSessionKeyPlaceholder, + pub para_assignment: AssignmentSessionKeyPlaceholder, + pub authority_discovery: AuthorityDiscovery, + } +} + impl_opaque_keys! { pub struct SessionKeys { pub grandpa: Grandpa, @@ -271,6 +286,35 @@ impl_opaque_keys! { pub para_validator: ParachainSessionKeyPlaceholder, pub para_assignment: AssignmentSessionKeyPlaceholder, pub authority_discovery: AuthorityDiscovery, + pub beefy: Beefy, + } +} + +fn transform_session_keys(v: AccountId, old: OldSessionKeys) -> SessionKeys { + SessionKeys { + grandpa: old.grandpa, + babe: old.babe, + im_online: old.im_online, + para_validator: old.para_validator, + para_assignment: old.para_assignment, + authority_discovery: old.authority_discovery, + beefy: { + // We need to produce a dummy value that's unique for the validator. + let mut id = BeefyId::default(); + let id_raw: &mut [u8] = id.as_mut(); + id_raw.copy_from_slice(v.as_ref()); + id_raw[0..4].copy_from_slice(b"beef"); + id + }, + } +} + +// When this is removed, should also remove `OldSessionKeys`. +pub struct UpgradeSessionKeys; +impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + Session::upgrade_keys::(transform_session_keys); + Perbill::from_percent(50) * BlockWeights::get().max_block } } @@ -581,6 +625,24 @@ impl pallet_sudo::Config for Runtime { type Call = Call; } +impl pallet_beefy::Config for Runtime { + type AuthorityId = BeefyId; +} + +impl pallet_mmr::Config for Runtime { + const INDEXING_PREFIX: &'static [u8] = b"mmr"; + type Hashing = Keccak256; + type Hash = ::Output; + type OnNewRoot = mmr_common::DepositBeefyDigest; + type WeightInfo = (); + type LeafData = mmr_common::Pallet; +} + +impl mmr_common::Config for Runtime { + type BeefyAuthorityToMerkleLeaf = mmr_common::UncompressBeefyEcdsaKeys; + type ParachainHeads = (); +} + parameter_types! { // One storage item; key size 32, value size 8; . pub const ProxyDepositBase: Balance = deposit(1, 8); @@ -739,6 +801,11 @@ construct_runtime! { // Election pallet. Only works with staking, but placed here to maintain indices. ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Pallet, Call, Storage, Event, ValidateUnsigned} = 24, + + // Bridges support. + Mmr: pallet_mmr::{Pallet, Call, Storage} = 28, + Beefy: pallet_beefy::{Pallet, Config, Storage} = 29, + MmrLeaf: mmr_common::{Pallet, Storage} = 30, } } @@ -788,7 +855,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPallets, - BabeEpochConfigMigrations + (BabeEpochConfigMigrations, UpgradeSessionKeys), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; @@ -917,6 +984,45 @@ sp_api::impl_runtime_apis! { } } + impl beefy_primitives::BeefyApi for Runtime { + fn validator_set() -> beefy_primitives::ValidatorSet { + Beefy::validator_set() + } + } + + impl pallet_mmr_primitives::MmrApi for Runtime { + fn generate_proof(leaf_index: u64) + -> Result<(mmr::EncodableOpaqueLeaf, mmr::Proof), mmr::Error> + { + Mmr::generate_proof(leaf_index) + .map(|(leaf, proof)| (mmr::EncodableOpaqueLeaf::from_leaf(&leaf), proof)) + } + + fn verify_proof(leaf: mmr::EncodableOpaqueLeaf, proof: mmr::Proof) + -> Result<(), mmr::Error> + { + pub type Leaf = < + ::LeafData as mmr::LeafDataProvider + >::LeafData; + + let leaf: Leaf = leaf + .into_opaque_leaf() + .try_decode() + .ok_or(mmr::Error::Verify)?; + Mmr::verify_leaf(leaf, proof) + } + + fn verify_proof_stateless( + root: Hash, + leaf: mmr::EncodableOpaqueLeaf, + proof: mmr::Proof + ) -> Result<(), mmr::Error> { + type MmrHashing = ::Hashing; + let node = mmr::DataOrHash::Data(leaf.into_opaque_leaf()); + pallet_mmr::verify_leaf_proof::(root, node, proof) + } + } + impl fg_primitives::GrandpaApi for Runtime { fn grandpa_authorities() -> Vec<(GrandpaId, u64)> { Grandpa::grandpa_authorities() diff --git a/polkadot/scripts/prepare-test-net.sh b/polkadot/scripts/prepare-test-net.sh index 2cf45f496e..14bbd680d6 100755 --- a/polkadot/scripts/prepare-test-net.sh +++ b/polkadot/scripts/prepare-test-net.sh @@ -14,6 +14,17 @@ generate_address() { subkey inspect ${3:-} ${4:-} "$SECRET//$1//$2" | grep "SS58 Address" | awk '{ print $3 }' } +generate_public_key() { + subkey inspect ${3:-} ${4:-} "$SECRET//$1//$2" | grep "Public" | awk '{ print $4 }' +} + +generate_address_and_public_key() { + ADDRESS=$(generate_address $1 $2 $3) + PUBLIC_KEY=$(generate_public_key $1 $2 $3) + + printf "//$ADDRESS\nhex![\"${PUBLIC_KEY#'0x'}\"].unchecked_into()," +} + generate_address_and_account_id() { ACCOUNT=$(generate_account_id $1 $2 $3) ADDRESS=$(generate_address $1 $2 $3) @@ -40,6 +51,7 @@ for i in $(seq 1 $V_NUM); do AUTHORITIES+="$(generate_address_and_account_id $i para_validator '--scheme sr25519' true)\n" AUTHORITIES+="$(generate_address_and_account_id $i para_assignment '--scheme sr25519' true)\n" AUTHORITIES+="$(generate_address_and_account_id $i authority_discovery '--scheme sr25519' true)\n" + AUTHORITIES+="$(generate_address_and_public_key $i beefy '--scheme ecdsa' true)\n" AUTHORITIES+="),\n" done