reth_bench/main.rs
1//! # reth-benchmark
2//!
3//! This is a tool that converts existing blocks into a stream of blocks for benchmarking purposes.
4//! These blocks are then fed into reth as a stream of execution payloads.
5
6#![doc(
7 // TODO: seismic
8 html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
9 html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
10 issue_tracker_base_url = "https://github.com/SeismicSystems/seismic-reth/issues/"
11)]
12#![cfg_attr(not(test), warn(unused_crate_dependencies))]
13#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
14
15#[global_allocator]
16static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();
17
18pub mod authenticated_transport;
19pub mod bench;
20pub mod bench_mode;
21pub mod valid_payload;
22
23use bench::BenchmarkCommand;
24use clap::Parser;
25use reth_cli_runner::CliRunner;
26
27fn main() {
28 // Enable backtraces unless a RUST_BACKTRACE value has already been explicitly provided.
29 if std::env::var_os("RUST_BACKTRACE").is_none() {
30 std::env::set_var("RUST_BACKTRACE", "1");
31 }
32
33 // Run until either exit or sigint or sigterm
34 let runner = CliRunner::default();
35 runner
36 .run_command_until_exit(|ctx| {
37 let command = BenchmarkCommand::parse();
38 command.execute(ctx)
39 })
40 .unwrap();
41}