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

* cli: move no-beefy flag to substrate sc-cli config

* bump substrate ref

---------

Signed-off-by: Adrian Catangiu <adrian@parity.io>
This commit is contained in:
Adrian Catangiu
2023-08-11 18:30:58 +03:00
committed by GitHub
parent 693a29da1a
commit 26adab4f7c
7 changed files with 195 additions and 202 deletions
-5
View File
@@ -99,11 +99,6 @@ 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`
+5 -6
View File
@@ -235,15 +235,11 @@ fn run_node_inner<F>(
where
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
{
let runner = cli
let mut 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() {
@@ -259,6 +255,10 @@ 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(
@@ -289,7 +289,6 @@ where
service::NewFullParams {
is_collator: service::IsCollator::No,
grandpa_pause,
enable_beefy,
jaeger_agent,
telemetry_worker_handle: None,
node_version,