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]]
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",

View File

@ -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"

View File

@ -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)?;