From 3b8030527bf3fbb86536625c29832a4a09931e57 Mon Sep 17 00:00:00 2001 From: Uncle Stinky Date: Sat, 5 Sep 2026 23:29:03 +0300 Subject: [PATCH] make benchmarking flag available based on the feature flag Signed-off-by: Uncle Stinky --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- cli/src/command.rs | 18 ++++-------------- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 19dfecb..d38f2f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3628,7 +3628,7 @@ dependencies = [ [[package]] name = "ghost-cli" -version = "0.9.1" +version = "0.9.2" dependencies = [ "cfg-if", "clap 4.5.4", @@ -3684,7 +3684,7 @@ dependencies = [ [[package]] name = "ghost-exodus" -version = "0.0.2" +version = "0.0.3" dependencies = [ "chacha20poly1305", "frame-benchmarking", @@ -3775,7 +3775,7 @@ dependencies = [ [[package]] name = "ghost-machine-primitives" -version = "0.9.1" +version = "0.9.2" dependencies = [ "lazy_static", "sc-sysinfo", @@ -3784,7 +3784,7 @@ dependencies = [ [[package]] name = "ghost-metrics" -version = "0.9.1" +version = "0.9.2" dependencies = [ "assert_cmd", "bs58 0.5.1", @@ -3862,7 +3862,7 @@ dependencies = [ [[package]] name = "ghost-node" -version = "0.9.1" +version = "0.9.2" dependencies = [ "assert_cmd", "color-eyre", @@ -3945,7 +3945,7 @@ dependencies = [ [[package]] name = "ghost-rpc" -version = "0.9.1" +version = "0.9.2" dependencies = [ "ghost-core-primitives", "jsonrpsee", @@ -3974,7 +3974,7 @@ dependencies = [ [[package]] name = "ghost-service" -version = "0.9.1" +version = "0.9.2" dependencies = [ "assert_matches", "async-trait", @@ -4085,7 +4085,7 @@ dependencies = [ [[package]] name = "ghost-traits" -version = "0.4.3" +version = "0.4.4" dependencies = [ "frame-support", "frost-core", diff --git a/Cargo.toml b/Cargo.toml index 920d26f..451076d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ homepage.workspace = true [workspace.package] license = "GPL-3.0-only" authors = ["571nky", "57r37ch", "f4750"] -version = "0.9.1" +version = "0.9.2" edition = "2021" homepage = "https://ghostchain.io" repository = "https://git.ghostchain.io/ghostchain/ghost-node" diff --git a/cli/src/command.rs b/cli/src/command.rs index e6e3ec6..6c7d69c 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -1,13 +1,8 @@ use crate::cli::{Cli, Subcommand}; use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory}; use futures::future::TryFutureExt; -use keyring::Sr25519Keyring; use sc_cli::SubstrateCli; -use service::{ - self, - benchmarking::{benchmark_inherent_data, RemarkBuilder, TransferKeepAliveBuilder}, - IdentifyVariant, -}; +use service::{self, IdentifyVariant}; pub use crate::{error::Error, service::BlockId}; #[cfg(feature = "pyroscope")] @@ -300,6 +295,8 @@ pub fn run() -> Result<()> { }), // These commands are very similar and can be handled in nearly the same way BenchmarkCmd::Extrinsic(_) | BenchmarkCmd::Overhead(_) => { + use service::benchmarking::{benchmark_inherent_data, RemarkBuilder, TransferKeepAliveBuilder}; + runner.sync_run(|mut config| { let (client, _, _, _) = service::new_chain_ops(&mut config)?; @@ -313,7 +310,7 @@ pub fn run() -> Result<()> { BenchmarkCmd::Extrinsic(cmd) => { let tka_builder = TransferKeepAliveBuilder::new( client.clone(), - Sr25519Keyring::Alice.to_account_id(), + keyring::Sr25519Keyring::Alice.to_account_id(), config.chain_spec.identify_chain(), ); @@ -360,13 +357,6 @@ pub fn run() -> Result<()> { _ => Err(Error::CommandNotImplemented), } } - #[cfg(not(feature = "runtime-benchmarks"))] - Some(Subcommand::Benchmark(_)) => { - return Err(sc_cli::Error::Input( - "Benchmarking wasn't enabled when building the node. \ - You can enable it with `--features=runtime-benchmarks`.".into(), - ).into()) - }, Some(Subcommand::Key(cmd)) => Ok(cmd.run(&cli)?), Some(Subcommand::ChainInfo(cmd)) => { let runner = cli.create_runner(cmd)?;