use clap::{Parser, Subcommand};
use reth_cli_runner::CliContext;
use reth_node_core::args::LogArgs;
use reth_tracing::FileWorkerGuard;
mod context;
mod new_payload_fcu;
mod new_payload_only;
mod output;
#[derive(Debug, Parser)]
pub struct BenchmarkCommand {
#[command(subcommand)]
command: Subcommands,
#[command(flatten)]
logs: LogArgs,
}
#[derive(Subcommand, Debug)]
pub enum Subcommands {
NewPayloadFcu(new_payload_fcu::Command),
NewPayloadOnly(new_payload_only::Command),
}
impl BenchmarkCommand {
pub async fn execute(self, ctx: CliContext) -> eyre::Result<()> {
let _guard = self.init_tracing()?;
match self.command {
Subcommands::NewPayloadFcu(command) => command.execute(ctx).await,
Subcommands::NewPayloadOnly(command) => command.execute(ctx).await,
}
}
pub fn init_tracing(&self) -> eyre::Result<Option<FileWorkerGuard>> {
let guard = self.logs.init_tracing()?;
Ok(guard)
}
}