Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 3e93b4c

Browse files
authored
cli: enable BEEFY by default on test networks (#7293)
We consider BEEFY mature enough to run by default on all nodes for test networks (Rococo/Wococo/Versi). Right now, most nodes are not running it since it's opt-in using --beefy flag. Switch to an opt-out model for test networks. Replace --beefy flag from CLI with --no-beefy and have BEEFY client start by default on test networks. Signed-off-by: acatangiu <adrian@parity.io>
1 parent b09937a commit 3e93b4c

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

cli/src/cli.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ pub struct RunCmd {
114114
#[arg(long = "grandpa-pause", num_args = 2)]
115115
pub grandpa_pause: Vec<u32>,
116116

117-
/// Enable the BEEFY gadget (only on Rococo or Wococo for now).
117+
/// Disable the BEEFY gadget
118+
/// (currently enabled by default on Rococo, Wococo and Versi).
118119
#[arg(long)]
119-
pub beefy: bool,
120+
pub no_beefy: bool,
120121

121122
/// Add the destination address to the jaeger agent.
122123
///

cli/src/command.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,9 @@ where
298298
.map_err(Error::from)?;
299299
let chain_spec = &runner.config().chain_spec;
300300

301-
// Disallow BEEFY on production networks.
302-
if cli.run.beefy &&
303-
(chain_spec.is_polkadot() || chain_spec.is_kusama() || chain_spec.is_westend())
304-
{
305-
return Err(Error::Other("BEEFY disallowed on production networks".to_string()))
306-
}
301+
// By default, enable BEEFY on test networks.
302+
let enable_beefy = (chain_spec.is_rococo() || chain_spec.is_wococo() || chain_spec.is_versi()) &&
303+
!cli.run.no_beefy;
307304

308305
set_default_ss58_version(chain_spec);
309306

@@ -346,7 +343,7 @@ where
346343
config,
347344
service::IsCollator::No,
348345
grandpa_pause,
349-
cli.run.beefy,
346+
enable_beefy,
350347
jaeger_agent,
351348
None,
352349
false,

node/service/src/lib.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,15 +1158,11 @@ where
11581158

11591159
let gadget = beefy::start_beefy_gadget::<_, _, _, _, _, _, _>(beefy_params);
11601160

1161-
// Wococo's purpose is to be a testbed for BEEFY, so if it fails we'll
1161+
// BEEFY currently only runs on testnets, if it fails we'll
11621162
// bring the node down with it to make sure it is noticed.
1163-
if chain_spec.is_wococo() {
1164-
task_manager
1165-
.spawn_essential_handle()
1166-
.spawn_blocking("beefy-gadget", None, gadget);
1167-
} else {
1168-
task_manager.spawn_handle().spawn_blocking("beefy-gadget", None, gadget);
1169-
}
1163+
task_manager
1164+
.spawn_essential_handle()
1165+
.spawn_blocking("beefy-gadget", None, gadget);
11701166

11711167
if is_offchain_indexing_enabled {
11721168
task_manager.spawn_handle().spawn_blocking(

zombienet_tests/functional/0003-beefy-and-mmr.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ command = "polkadot"
99
[[relaychain.node_groups]]
1010
name = "validator"
1111
count = 3
12-
args = ["--log=beefy=debug", "--beefy", "--enable-offchain-indexing=true"]
12+
args = ["--log=beefy=debug", "--enable-offchain-indexing=true"]
1313

1414
[[relaychain.nodes]]
1515
name = "validator-unstable"
16-
args = ["--log=beefy=debug", "--beefy", "--enable-offchain-indexing=true"]
16+
args = ["--log=beefy=debug", "--enable-offchain-indexing=true"]

0 commit comments

Comments
 (0)