diff --git a/cli/src/cli.rs b/cli/src/cli.rs index b775bb6b77ad..69c54b428a92 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -114,9 +114,10 @@ pub struct RunCmd { #[arg(long = "grandpa-pause", num_args = 2)] pub grandpa_pause: Vec, - /// 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)] - pub beefy: bool, + pub no_beefy: bool, /// Add the destination address to the jaeger agent. /// diff --git a/cli/src/command.rs b/cli/src/command.rs index 132d8279eb13..378e8e7650c2 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -298,12 +298,9 @@ where .map_err(Error::from)?; let chain_spec = &runner.config().chain_spec; - // Disallow BEEFY on production networks. - if cli.run.beefy && - (chain_spec.is_polkadot() || chain_spec.is_kusama() || chain_spec.is_westend()) - { - return Err(Error::Other("BEEFY disallowed on production networks".to_string())) - } + // By default, enable BEEFY on test networks. + let enable_beefy = (chain_spec.is_rococo() || chain_spec.is_wococo() || chain_spec.is_versi()) && + !cli.run.no_beefy; set_default_ss58_version(chain_spec); @@ -346,7 +343,7 @@ where config, service::IsCollator::No, grandpa_pause, - cli.run.beefy, + enable_beefy, jaeger_agent, None, false, diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 800a8af9e2a0..e55f2456160b 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -1158,15 +1158,11 @@ where 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. - if chain_spec.is_wococo() { - task_manager - .spawn_essential_handle() - .spawn_blocking("beefy-gadget", None, gadget); - } else { - task_manager.spawn_handle().spawn_blocking("beefy-gadget", None, gadget); - } + task_manager + .spawn_essential_handle() + .spawn_blocking("beefy-gadget", None, gadget); if is_offchain_indexing_enabled { task_manager.spawn_handle().spawn_blocking( diff --git a/zombienet_tests/functional/0003-beefy-and-mmr.toml b/zombienet_tests/functional/0003-beefy-and-mmr.toml index bea5ac1ba64f..a8d97bc30f85 100644 --- a/zombienet_tests/functional/0003-beefy-and-mmr.toml +++ b/zombienet_tests/functional/0003-beefy-and-mmr.toml @@ -9,8 +9,8 @@ command = "polkadot" [[relaychain.node_groups]] name = "validator" count = 3 -args = ["--log=beefy=debug", "--beefy", "--enable-offchain-indexing=true"] +args = ["--log=beefy=debug", "--enable-offchain-indexing=true"] [[relaychain.nodes]] name = "validator-unstable" -args = ["--log=beefy=debug", "--beefy", "--enable-offchain-indexing=true"] +args = ["--log=beefy=debug", "--enable-offchain-indexing=true"]