make benchmarking flag available based on the feature flag

Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
This commit is contained in:
Uncle Stinky 2026-09-05 23:29:03 +03:00
parent 4d836ee8ac
commit 3b8030527b
Signed by: st1nky
GPG Key ID: 016064BD97603B40
3 changed files with 13 additions and 23 deletions

16
Cargo.lock generated
View File

@ -3628,7 +3628,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-cli" name = "ghost-cli"
version = "0.9.1" version = "0.9.2"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"clap 4.5.4", "clap 4.5.4",
@ -3684,7 +3684,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-exodus" name = "ghost-exodus"
version = "0.0.2" version = "0.0.3"
dependencies = [ dependencies = [
"chacha20poly1305", "chacha20poly1305",
"frame-benchmarking", "frame-benchmarking",
@ -3775,7 +3775,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-machine-primitives" name = "ghost-machine-primitives"
version = "0.9.1" version = "0.9.2"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"sc-sysinfo", "sc-sysinfo",
@ -3784,7 +3784,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-metrics" name = "ghost-metrics"
version = "0.9.1" version = "0.9.2"
dependencies = [ dependencies = [
"assert_cmd", "assert_cmd",
"bs58 0.5.1", "bs58 0.5.1",
@ -3862,7 +3862,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-node" name = "ghost-node"
version = "0.9.1" version = "0.9.2"
dependencies = [ dependencies = [
"assert_cmd", "assert_cmd",
"color-eyre", "color-eyre",
@ -3945,7 +3945,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-rpc" name = "ghost-rpc"
version = "0.9.1" version = "0.9.2"
dependencies = [ dependencies = [
"ghost-core-primitives", "ghost-core-primitives",
"jsonrpsee", "jsonrpsee",
@ -3974,7 +3974,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-service" name = "ghost-service"
version = "0.9.1" version = "0.9.2"
dependencies = [ dependencies = [
"assert_matches", "assert_matches",
"async-trait", "async-trait",
@ -4085,7 +4085,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-traits" name = "ghost-traits"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"frame-support", "frame-support",
"frost-core", "frost-core",

View File

@ -17,7 +17,7 @@ homepage.workspace = true
[workspace.package] [workspace.package]
license = "GPL-3.0-only" license = "GPL-3.0-only"
authors = ["571nky", "57r37ch", "f4750"] authors = ["571nky", "57r37ch", "f4750"]
version = "0.9.1" version = "0.9.2"
edition = "2021" edition = "2021"
homepage = "https://ghostchain.io" homepage = "https://ghostchain.io"
repository = "https://git.ghostchain.io/ghostchain/ghost-node" repository = "https://git.ghostchain.io/ghostchain/ghost-node"

View File

@ -1,13 +1,8 @@
use crate::cli::{Cli, Subcommand}; use crate::cli::{Cli, Subcommand};
use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory}; use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory};
use futures::future::TryFutureExt; use futures::future::TryFutureExt;
use keyring::Sr25519Keyring;
use sc_cli::SubstrateCli; use sc_cli::SubstrateCli;
use service::{ use service::{self, IdentifyVariant};
self,
benchmarking::{benchmark_inherent_data, RemarkBuilder, TransferKeepAliveBuilder},
IdentifyVariant,
};
pub use crate::{error::Error, service::BlockId}; pub use crate::{error::Error, service::BlockId};
#[cfg(feature = "pyroscope")] #[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 // These commands are very similar and can be handled in nearly the same way
BenchmarkCmd::Extrinsic(_) | BenchmarkCmd::Overhead(_) => { BenchmarkCmd::Extrinsic(_) | BenchmarkCmd::Overhead(_) => {
use service::benchmarking::{benchmark_inherent_data, RemarkBuilder, TransferKeepAliveBuilder};
runner.sync_run(|mut config| { runner.sync_run(|mut config| {
let (client, _, _, _) = service::new_chain_ops(&mut config)?; let (client, _, _, _) = service::new_chain_ops(&mut config)?;
@ -313,7 +310,7 @@ pub fn run() -> Result<()> {
BenchmarkCmd::Extrinsic(cmd) => { BenchmarkCmd::Extrinsic(cmd) => {
let tka_builder = TransferKeepAliveBuilder::new( let tka_builder = TransferKeepAliveBuilder::new(
client.clone(), client.clone(),
Sr25519Keyring::Alice.to_account_id(), keyring::Sr25519Keyring::Alice.to_account_id(),
config.chain_spec.identify_chain(), config.chain_spec.identify_chain(),
); );
@ -360,13 +357,6 @@ pub fn run() -> Result<()> {
_ => Err(Error::CommandNotImplemented), _ => 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::Key(cmd)) => Ok(cmd.run(&cli)?),
Some(Subcommand::ChainInfo(cmd)) => { Some(Subcommand::ChainInfo(cmd)) => {
let runner = cli.create_runner(cmd)?; let runner = cli.create_runner(cmd)?;