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

Commit

Permalink
Revert "companion for 14754: cli: move no-beefy flag to sc-cli (#7600)…
Browse files Browse the repository at this point in the history
…" (#7613)

* Revert "companion for 14754: cli: move no-beefy flag to sc-cli (#7600)"

This reverts commit 8f05479.

* update lockfile for {"substrate"}

* fix merge damage

---------

Co-authored-by: parity-processbot <>
  • Loading branch information
acatangiu authored Aug 15, 2023
1 parent 1bddab1 commit 964330d
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 193 deletions.
372 changes: 188 additions & 184 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ pub struct RunCmd {
#[arg(long = "grandpa-pause", num_args = 2)]
pub grandpa_pause: Vec<u32>,

/// Disable the BEEFY gadget
/// (currently enabled by default on Rococo, Wococo and Versi).
#[arg(long)]
pub no_beefy: bool,

/// Add the destination address to the jaeger agent.
///
/// Must be valid socket address, of format `IP:Port`
Expand Down
11 changes: 6 additions & 5 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,15 @@ fn run_node_inner<F>(
where
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
{
let mut runner = cli
let runner = cli
.create_runner_with_logger_hook::<sc_cli::RunCmd, F>(&cli.run.base, logger_hook)
.map_err(Error::from)?;
let chain_spec = &runner.config().chain_spec;

// 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);

let grandpa_pause = if cli.run.grandpa_pause.is_empty() {
Expand All @@ -255,10 +259,6 @@ where
info!(" KUSAMA FOUNDATION ");
info!("----------------------------");
}
// BEEFY allowed only on test networks.
if !(chain_spec.is_rococo() || chain_spec.is_wococo() || chain_spec.is_versi()) {
runner.config_mut().disable_beefy = true;
}

let jaeger_agent = if let Some(ref jaeger_agent) = cli.run.jaeger_agent {
Some(
Expand Down Expand Up @@ -289,6 +289,7 @@ where
service::NewFullParams {
is_parachain_node: service::IsParachainNode::No,
grandpa_pause,
enable_beefy,
jaeger_agent,
telemetry_worker_handle: None,
node_version,
Expand Down
3 changes: 2 additions & 1 deletion node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ where
pub struct NewFullParams<OverseerGenerator: OverseerGen> {
pub is_parachain_node: IsParachainNode,
pub grandpa_pause: Option<(u32, u32)>,
pub enable_beefy: bool,
pub jaeger_agent: Option<std::net::SocketAddr>,
pub telemetry_worker_handle: Option<TelemetryWorkerHandle>,
/// The version of the node. TESTING ONLY: `None` can be passed to skip the node/worker version
Expand Down Expand Up @@ -719,6 +720,7 @@ pub fn new_full<OverseerGenerator: OverseerGen>(
NewFullParams {
is_parachain_node,
grandpa_pause,
enable_beefy,
jaeger_agent,
telemetry_worker_handle,
node_version,
Expand Down Expand Up @@ -752,7 +754,6 @@ pub fn new_full<OverseerGenerator: OverseerGen>(
Some(backoff)
};

let enable_beefy = !config.disable_beefy;
// If not on a known test network, warn the user that BEEFY is still experimental.
if enable_beefy &&
!config.chain_spec.is_rococo() &&
Expand Down
2 changes: 1 addition & 1 deletion node/test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub fn new_full(
polkadot_service::NewFullParams {
is_parachain_node,
grandpa_pause: None,
enable_beefy: true,
jaeger_agent: None,
telemetry_worker_handle: None,
node_version: None,
Expand Down Expand Up @@ -186,7 +187,6 @@ pub fn node_config(
offchain_worker: Default::default(),
force_authoring: false,
disable_grandpa: false,
disable_beefy: false,
dev_key_seed: Some(key_seed),
tracing_targets: None,
tracing_receiver: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/adder/collator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ fn main() -> Result<()> {
runner.run_node_until_exit(|mut config| async move {
let collator = Collator::new();

config.disable_beefy = true;
// Zombienet is spawning all collators currently with the same CLI, this means it
// sets `--validator` and this is wrong here.
config.role = Role::Full;
Expand All @@ -68,6 +67,7 @@ fn main() -> Result<()> {
collator.collator_key(),
),
grandpa_pause: None,
enable_beefy: false,
jaeger_agent: None,
telemetry_worker_handle: None,

Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/undying/collator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ fn main() -> Result<()> {
runner.run_node_until_exit(|mut config| async move {
let collator = Collator::new(cli.run.pov_size, cli.run.pvf_complexity);

config.disable_beefy = true;
// Zombienet is spawning all collators currently with the same CLI, this means it
// sets `--validator` and this is wrong here.
config.role = Role::Full;
Expand All @@ -68,6 +67,7 @@ fn main() -> Result<()> {
collator.collator_key(),
),
grandpa_pause: None,
enable_beefy: false,
jaeger_agent: None,
telemetry_worker_handle: None,

Expand Down

0 comments on commit 964330d

Please sign in to comment.