Skip to content

Commit ce728be

Browse files
acatangiubkchr
andauthored
Add BEEFY capabilities to Westend and Kusama (#7591)
* runtime: add BEEFY and MMR to Westend Signed-off-by: Adrian Catangiu <[email protected]> * runtime: add BEEFY and MMR to Kusama Signed-off-by: Adrian Catangiu <[email protected]> * node/service: enable BEEFY for Westend and Kusama Signed-off-by: Adrian Catangiu <[email protected]> * node/service: regenerate genesis keys for westend-native and kusama-native Since these keys are only used for development/local chains, also publish the secret seeds used to generate the public keys, so that developers can recover/generate the private key pairs if needed. Signed-off-by: Adrian Catangiu <[email protected]> * runtime: add session keys migration to add BEEFY to Westend and Kusama * runtime: fix migration * fix try-runtime build * cargo fmt * fix parachains slashing benchmark * address review comments * Apply suggestions from code review Co-authored-by: Bastian Köcher <[email protected]> * runtime: fix session keys migration --------- Signed-off-by: Adrian Catangiu <[email protected]> Co-authored-by: parity-processbot <> Co-authored-by: Bastian Köcher <[email protected]>
1 parent 515ec1a commit ce728be

File tree

14 files changed

+638
-247
lines changed

14 files changed

+638
-247
lines changed

polkadot/Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polkadot/cli/src/command.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,8 @@ where
240240
.map_err(Error::from)?;
241241
let chain_spec = &runner.config().chain_spec;
242242

243-
// By default, enable BEEFY on test networks.
244-
let enable_beefy = (chain_spec.is_rococo() || chain_spec.is_wococo() || chain_spec.is_versi()) &&
245-
!cli.run.no_beefy;
243+
// By default, enable BEEFY on all networks except Polkadot (for now).
244+
let enable_beefy = !chain_spec.is_polkadot() && !cli.run.no_beefy;
246245

247246
set_default_ss58_version(chain_spec);
248247

polkadot/node/service/src/chain_spec.rs

Lines changed: 188 additions & 151 deletions
Large diffs are not rendered by default.

polkadot/node/service/src/lib.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -753,13 +753,9 @@ pub fn new_full<OverseerGenerator: OverseerGen>(
753753
Some(backoff)
754754
};
755755

756-
// If not on a known test network, warn the user that BEEFY is still experimental.
757-
if enable_beefy &&
758-
!config.chain_spec.is_rococo() &&
759-
!config.chain_spec.is_wococo() &&
760-
!config.chain_spec.is_versi()
761-
{
762-
gum::warn!("BEEFY is still experimental, usage on a production network is discouraged.");
756+
// Warn the user that BEEFY is still experimental for Polkadot.
757+
if enable_beefy && config.chain_spec.is_polkadot() {
758+
gum::warn!("BEEFY is still experimental, usage on Polkadot network is discouraged.");
763759
}
764760

765761
let disable_grandpa = config.disable_grandpa;
@@ -1204,14 +1200,14 @@ pub fn new_full<OverseerGenerator: OverseerGen>(
12041200

12051201
let gadget = beefy::start_beefy_gadget::<_, _, _, _, _, _, _>(beefy_params);
12061202

1207-
// BEEFY currently only runs on testnets, if it fails we'll
1208-
// bring the node down with it to make sure it is noticed.
1203+
// BEEFY is part of consensus, if it fails we'll bring the node down with it to make sure it
1204+
// is noticed.
12091205
task_manager
12101206
.spawn_essential_handle()
12111207
.spawn_blocking("beefy-gadget", None, gadget);
1212-
1208+
// When offchain indexing is enabled, MMR gadget should also run.
12131209
if is_offchain_indexing_enabled {
1214-
task_manager.spawn_handle().spawn_blocking(
1210+
task_manager.spawn_essential_handle().spawn_blocking(
12151211
"mmr-gadget",
12161212
None,
12171213
MmrGadget::start(

polkadot/runtime/kusama/Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ smallvec = "1.8.0"
2020
authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
2121
babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
2222
beefy-primitives = { package = "sp-consensus-beefy", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
23+
binary-merkle-tree = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
2324
kusama-runtime-constants = { package = "kusama-runtime-constants", path = "./constants", default-features = false }
2425
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
2526
inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
2627
offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
2728
sp-std = { package = "sp-std", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
29+
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
2830
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
2931
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
3032
sp-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -42,6 +44,8 @@ pallet-authorship = { git = "https://github.com/paritytech/substrate", branch =
4244
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
4345
pallet-bags-list = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
4446
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
47+
pallet-beefy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
48+
pallet-beefy-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
4549
pallet-bounties = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
4650
pallet-child-bounties = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
4751
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -61,6 +65,7 @@ pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "
6165
pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6266
pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6367
pallet-message-queue = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
68+
pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6469
pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6570
pallet-nomination-pools = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6671
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -144,6 +149,8 @@ std = [
144149
"pallet-authorship/std",
145150
"pallet-bags-list/std",
146151
"pallet-balances/std",
152+
"pallet-beefy/std",
153+
"pallet-beefy-mmr/std",
147154
"pallet-bounties/std",
148155
"pallet-child-bounties/std",
149156
"pallet-transaction-payment/std",
@@ -161,6 +168,7 @@ std = [
161168
"pallet-indices/std",
162169
"pallet-membership/std",
163170
"pallet-message-queue/std",
171+
"pallet-mmr/std",
164172
"pallet-multisig/std",
165173
"pallet-nomination-pools/std",
166174
"pallet-nomination-pools-runtime-api/std",
@@ -184,6 +192,7 @@ std = [
184192
"pallet-whitelist/std",
185193
"pallet-babe/std",
186194
"pallet-xcm/std",
195+
"sp-application-crypto/std",
187196
"sp-mmr-primitives/std",
188197
"sp-runtime/std",
189198
"sp-staking/std",
@@ -265,6 +274,8 @@ try-runtime = [
265274
"pallet-authorship/try-runtime",
266275
"pallet-bags-list/try-runtime",
267276
"pallet-balances/try-runtime",
277+
"pallet-beefy/try-runtime",
278+
"pallet-beefy-mmr/try-runtime",
268279
"pallet-bounties/try-runtime",
269280
"pallet-child-bounties/try-runtime",
270281
"pallet-transaction-payment/try-runtime",
@@ -281,6 +292,7 @@ try-runtime = [
281292
"pallet-indices/try-runtime",
282293
"pallet-membership/try-runtime",
283294
"pallet-message-queue/try-runtime",
295+
"pallet-mmr/try-runtime",
284296
"pallet-multisig/try-runtime",
285297
"pallet-nomination-pools/try-runtime",
286298
"pallet-offences/try-runtime",

0 commit comments

Comments
 (0)