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

cli: enable BEEFY by default on test networks #7293

Merged
merged 3 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ pub struct RunCmd {
#[arg(long = "grandpa-pause", num_args = 2)]
pub grandpa_pause: Vec<u32>,

/// Enable the BEEFY gadget (only on Rococo or Wococo for now).
#[arg(long)]
pub beefy: bool,
acatangiu marked this conversation as resolved.
Show resolved Hide resolved

/// Add the destination address to the jaeger agent.
///
/// Must be valid socket address, of format `IP:Port`
Expand Down
10 changes: 3 additions & 7 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,8 @@ 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();

set_default_ss58_version(chain_spec);

Expand Down Expand Up @@ -346,7 +342,7 @@ where
config,
service::IsCollator::No,
grandpa_pause,
cli.run.beefy,
enable_beefy,
jaeger_agent,
None,
false,
Expand Down
12 changes: 4 additions & 8 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions zombienet_tests/functional/0003-beefy-and-mmr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]