mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Remove frame-benchmarking-cli
Not currently used, notably increases our dependency tree. I wouldn't remove it if we planned to use it. From my understanding, all benchmarking will be per pallet, voiding our need to have this for the node.
This commit is contained in:
@@ -26,7 +26,6 @@ sp-block-builder = { git = "https://github.com/serai-dex/substrate" }
|
||||
sp-consensus-babe = { git = "https://github.com/serai-dex/substrate" }
|
||||
|
||||
frame-benchmarking = { git = "https://github.com/serai-dex/substrate" }
|
||||
frame-benchmarking-cli = { git = "https://github.com/serai-dex/substrate" }
|
||||
|
||||
serai-runtime = { path = "../runtime", features = ["std"] }
|
||||
|
||||
@@ -60,7 +59,6 @@ substrate-build-script-utils = { git = "https://github.com/serai-dex/substrate"
|
||||
default = []
|
||||
runtime-benchmarks = [
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
"frame-benchmarking-cli/runtime-benchmarks",
|
||||
|
||||
"serai-runtime/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -37,10 +37,6 @@ pub enum Subcommand {
|
||||
// Revert the chain to a previous state
|
||||
Revert(sc_cli::RevertCmd),
|
||||
|
||||
// Sub-commands concerned with benchmarking
|
||||
#[clap(subcommand)]
|
||||
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
|
||||
|
||||
// DB meta columns information
|
||||
ChainInfo(sc_cli::ChainInfoCmd),
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ use serai_runtime::Block;
|
||||
use sc_service::{PruningMode, PartialComponents};
|
||||
|
||||
use sc_cli::SubstrateCli;
|
||||
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
|
||||
|
||||
use crate::{
|
||||
chain_spec,
|
||||
@@ -93,29 +92,6 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
Ok((cmd.run(client, backend, Some(aux_revert)), task_manager))
|
||||
}),
|
||||
|
||||
Some(Subcommand::Benchmark(cmd)) => cli.create_runner(cmd)?.sync_run(|config| match cmd {
|
||||
BenchmarkCmd::Pallet(cmd) => cmd.run::<Block, ()>(config),
|
||||
|
||||
BenchmarkCmd::Block(cmd) => cmd.run(service::new_partial(&config)?.client),
|
||||
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
BenchmarkCmd::Storage(_) => {
|
||||
Err("Storage benchmarking can be enabled with `--features runtime-benchmarks`.".into())
|
||||
}
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
BenchmarkCmd::Storage(cmd) => {
|
||||
let PartialComponents { client, backend, .. } = service::new_partial(&config)?;
|
||||
cmd.run(config, client, backend.expose_db(), backend.expose_storage())
|
||||
}
|
||||
|
||||
BenchmarkCmd::Overhead(_) => Err("Overhead benchmarking isn't supported.".into()),
|
||||
|
||||
BenchmarkCmd::Extrinsic(_) => Err("Extrinsic benchmarking isn't supported.".into()),
|
||||
|
||||
BenchmarkCmd::Machine(cmd) => cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()),
|
||||
}),
|
||||
|
||||
Some(Subcommand::ChainInfo(cmd)) => {
|
||||
cli.create_runner(cmd)?.sync_run(|config| cmd.run::<Block>(&config))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user