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>
This commit is contained in:
Adrian Catangiu
2023-05-26 12:22:35 +03:00
committed by GitHub
parent 3d008cd074
commit 035b24866c
4 changed files with 13 additions and 19 deletions
+3 -2
View File
@@ -114,9 +114,10 @@ pub struct RunCmd {
#[arg(long = "grandpa-pause", num_args = 2)] #[arg(long = "grandpa-pause", num_args = 2)]
pub grandpa_pause: Vec<u32>, pub grandpa_pause: Vec<u32>,
/// Enable the BEEFY gadget (only on Rococo or Wococo for now). /// Disable the BEEFY gadget
/// (currently enabled by default on Rococo, Wococo and Versi).
#[arg(long)] #[arg(long)]
pub beefy: bool, pub no_beefy: bool,
/// Add the destination address to the jaeger agent. /// Add the destination address to the jaeger agent.
/// ///
+4 -7
View File
@@ -298,12 +298,9 @@ where
.map_err(Error::from)?; .map_err(Error::from)?;
let chain_spec = &runner.config().chain_spec; let chain_spec = &runner.config().chain_spec;
// Disallow BEEFY on production networks. // By default, enable BEEFY on test networks.
if cli.run.beefy && let enable_beefy = (chain_spec.is_rococo() || chain_spec.is_wococo() || chain_spec.is_versi()) &&
(chain_spec.is_polkadot() || chain_spec.is_kusama() || chain_spec.is_westend()) !cli.run.no_beefy;
{
return Err(Error::Other("BEEFY disallowed on production networks".to_string()))
}
set_default_ss58_version(chain_spec); set_default_ss58_version(chain_spec);
@@ -346,7 +343,7 @@ where
config, config,
service::IsCollator::No, service::IsCollator::No,
grandpa_pause, grandpa_pause,
cli.run.beefy, enable_beefy,
jaeger_agent, jaeger_agent,
None, None,
false, false,
+1 -5
View File
@@ -1158,15 +1158,11 @@ where
let gadget = beefy::start_beefy_gadget::<_, _, _, _, _, _, _>(beefy_params); let gadget = beefy::start_beefy_gadget::<_, _, _, _, _, _, _>(beefy_params);
// Wococo's purpose is to be a testbed for BEEFY, so if it fails we'll // BEEFY currently only runs on testnets, if it fails we'll
// bring the node down with it to make sure it is noticed. // bring the node down with it to make sure it is noticed.
if chain_spec.is_wococo() {
task_manager task_manager
.spawn_essential_handle() .spawn_essential_handle()
.spawn_blocking("beefy-gadget", None, gadget); .spawn_blocking("beefy-gadget", None, gadget);
} else {
task_manager.spawn_handle().spawn_blocking("beefy-gadget", None, gadget);
}
if is_offchain_indexing_enabled { if is_offchain_indexing_enabled {
task_manager.spawn_handle().spawn_blocking( task_manager.spawn_handle().spawn_blocking(
@@ -9,8 +9,8 @@ command = "polkadot"
[[relaychain.node_groups]] [[relaychain.node_groups]]
name = "validator" name = "validator"
count = 3 count = 3
args = ["--log=beefy=debug", "--beefy", "--enable-offchain-indexing=true"] args = ["--log=beefy=debug", "--enable-offchain-indexing=true"]
[[relaychain.nodes]] [[relaychain.nodes]]
name = "validator-unstable" name = "validator-unstable"
args = ["--log=beefy=debug", "--beefy", "--enable-offchain-indexing=true"] args = ["--log=beefy=debug", "--enable-offchain-indexing=true"]