From 0d8c41390e25d21cb4cf8ccdf08ec1220f6e1539 Mon Sep 17 00:00:00 2001 From: Kolby Moroz Liebl <31669092+KolbyML@users.noreply.github.com> Date: Mon, 27 Jan 2025 11:46:24 -0700 Subject: [PATCH 1/2] feat: add benchmark for trin --- .circleci/config.yml | 2 +- .gitignore | 2 +- Cargo.lock | 22 ++++ Cargo.toml | 20 +++- bin/trin-bench/Cargo.toml | 29 +++++ bin/trin-bench/Makefile | 7 ++ bin/trin-bench/README.md | 16 +++ bin/trin-bench/run-bench.sh | 122 +++++++++++++++++++ bin/trin-bench/src/cli.rs | 43 +++++++ bin/trin-bench/src/lib.rs | 1 + bin/trin-bench/src/main.rs | 227 ++++++++++++++++++++++++++++++++++++ 11 files changed, 487 insertions(+), 4 deletions(-) create mode 100644 bin/trin-bench/Cargo.toml create mode 100644 bin/trin-bench/Makefile create mode 100644 bin/trin-bench/README.md create mode 100755 bin/trin-bench/run-bench.sh create mode 100644 bin/trin-bench/src/cli.rs create mode 100644 bin/trin-bench/src/lib.rs create mode 100644 bin/trin-bench/src/main.rs diff --git a/.circleci/config.yml b/.circleci/config.yml index f069bfe58..74e2a4a15 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -235,7 +235,7 @@ jobs: # parallelism level should be set to the amount of simulators we have or greater # The reason for this is the CI code currently only supports 1 input at a time # if we have a parallelism level of 5 and 6 sims one test runner will get 2 test sims and fail - parallelism: 19 + parallelism: 20 steps: - checkout - run: diff --git a/.gitignore b/.gitignore index 2e67878ba..6804a003c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ .vscode/ # Ignore downloaded consensus specs test data testing/ef-tests/mainnet* - +bin/trin-bench/logs diff --git a/Cargo.lock b/Cargo.lock index 82e8a5fe6..44c002fea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6708,6 +6708,28 @@ dependencies = [ "utp-rs", ] +[[package]] +name = "trin-bench" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "e2store", + "ethportal-api", + "futures", + "humanize-duration", + "jsonrpsee", + "portal-bridge", + "reqwest", + "tokio", + "tracing", + "tracing-subscriber 0.3.19", + "trin-execution", + "trin-utils", + "trin-validation", + "url", +] + [[package]] name = "trin-evm" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 37a4f4183..3805a2c94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,8 @@ [workspace] members = [ "bin/portal-bridge", - "bin/trin", + "bin/trin", + "bin/trin-bench", "bin/trin-execution", "crates/ethportal-api", "crates/e2store", @@ -15,7 +16,7 @@ members = [ "crates/subnetworks/history", "crates/subnetworks/state", "crates/utils", - "crates/validation", + "crates/validation", "testing/ef-tests", "testing/ethportal-peertest", "testing/utp", @@ -120,3 +121,18 @@ trin-validation = { path = "crates/validation" } # # See: https://github.com/eira-fransham/crunchy/issues/13 crunchy = "=0.2.2" + +[profile.release] +opt-level = 3 +lto = "thin" +debug = "none" +strip = "symbols" +panic = "unwind" +codegen-units = 16 + +# Use the `--profile profiling` flag to show symbols in release mode. +# e.g. `cargo build --profile profiling` +[profile.profiling] +inherits = "release" +debug = "full" +strip = "none" diff --git a/bin/trin-bench/Cargo.toml b/bin/trin-bench/Cargo.toml new file mode 100644 index 000000000..8b413d908 --- /dev/null +++ b/bin/trin-bench/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "trin-bench" +authors.workspace = true +categories.workspace = true +edition.workspace = true +keywords.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true + +[dependencies] +anyhow.workspace = true +clap.workspace = true +ethportal-api.workspace = true +e2store.workspace = true +futures.workspace = true +humanize-duration.workspace = true +jsonrpsee.workspace = true +portal-bridge.workspace = true +reqwest.workspace = true +tokio.workspace = true +tracing.workspace = true +tracing-subscriber.workspace = true +trin-execution.workspace = true +trin-utils.workspace = true +trin-validation.workspace = true +url.workspace = true diff --git a/bin/trin-bench/Makefile b/bin/trin-bench/Makefile new file mode 100644 index 000000000..89dd33af9 --- /dev/null +++ b/bin/trin-bench/Makefile @@ -0,0 +1,7 @@ +test: + @echo "Running Trin Bench" + @./run-bench.sh + @echo "Down running Trin Bench" + +clean: + sudo rm -r logs diff --git a/bin/trin-bench/README.md b/bin/trin-bench/README.md new file mode 100644 index 000000000..991a014c7 --- /dev/null +++ b/bin/trin-bench/README.md @@ -0,0 +1,16 @@ +# Trin Bench +Trin bench is for testing Trin performance and being able to recreate situations reliably to verify if performance improvements or regressions happen + +## To run +```sh +make run +``` + +## Clean results +```sh +make clean +``` + +## View the results + +The results will be available in the logs folder. After running the test there will be 2 svg's containing flamegraphs `trin_sender.svg` and `trin_receiver.svg`, please open in it a web browser for the best experience. diff --git a/bin/trin-bench/run-bench.sh b/bin/trin-bench/run-bench.sh new file mode 100755 index 000000000..c6a766c96 --- /dev/null +++ b/bin/trin-bench/run-bench.sh @@ -0,0 +1,122 @@ +#!/bin/bash + +# Define log directories +LOG_DIR="logs" +mkdir -p "$LOG_DIR" + +# Create data directories for trin instances +DATA_DIR_SENDER="./data_sender" +DATA_DIR_RECEIVER="./data_receiver" +mkdir -p "$LOG_DIR/$DATA_DIR_SENDER" "$LOG_DIR/$DATA_DIR_RECEIVER" + +# Clone portal-accumulators repository if not already present +if [ ! -d "../../portal-accumulators" ]; then + git clone https://github.com/ethereum/portal-accumulators ../../portal-accumulators || { echo "Failed to clone portal-accumulators"; exit 1; } +fi + +# Build trin-benchmark-cordinator with release profile +pushd ../.. || { echo "Failed to change directory"; exit 1; } +cargo build --release -p trin-bench || { echo "Failed to build trin-benchmark-cordinator"; exit 1; } +popd || { echo "Failed to return to original directory"; exit 1; } + +# Define process PIDs +PIDS=() + +# Find available ports dynamically and ensure they are unique +find_unused_port() { + local port=$1 + while ss -tuln | awk '{print $4}' | grep -q ":$port$"; do + port=$((port + 1)) + done + echo $port +} + +PORT_SENDER=$(find_unused_port 9050) +PORT_RECEIVER=$(find_unused_port $((PORT_SENDER + 10))) +EXT_PORT_SENDER=$(find_unused_port 9100) +EXT_PORT_RECEIVER=$(find_unused_port $((EXT_PORT_SENDER + 10))) + +# Run trin sender with perf profiling +cargo flamegraph --profile profiling -c "record -F 97 --call-graph dwarf,64000 -g -o $LOG_DIR/trin_sender.perf" --root --output "$LOG_DIR/trin_sender.svg" -p trin -- \ + --web3-transport http \ + --web3-http-address http://127.0.0.1:$PORT_SENDER/ \ + --mb 0 \ + --bootnodes none \ + --external-address 127.0.0.1:$EXT_PORT_SENDER \ + --discovery-port $EXT_PORT_SENDER \ + --data-dir "$LOG_DIR/$DATA_DIR_SENDER" \ + > "$LOG_DIR/trin_sender.log" 2>&1 & +PIDS+=("$!") + +# Run trin receiver with perf profiling +cargo flamegraph --profile profiling -c "record -F 97 --call-graph dwarf,64000 -g -o $LOG_DIR/trin_receiver.perf" --root --output "$LOG_DIR/trin_receiver.svg" -p trin -- \ + --web3-transport http \ + --web3-http-address http://127.0.0.1:$PORT_RECEIVER/ \ + --mb 10000 \ + --bootnodes none \ + --external-address 127.0.0.1:$EXT_PORT_RECEIVER \ + --discovery-port $EXT_PORT_RECEIVER \ + --data-dir "$LOG_DIR/$DATA_DIR_RECEIVER" \ + > "$LOG_DIR/trin_receiver.log" 2>&1 & +PIDS+=("$!") + +# Run trin benchmark coordinator without perf profiling +../../target/release/trin-bench \ + --web3-http-address-node-1 http://127.0.0.1:$PORT_SENDER/ \ + --web3-http-address-node-2 http://127.0.0.1:$PORT_RECEIVER/ \ + --epoch-accumulator-path ../../portal-accumulators \ + --start-era1 1000 \ + --end-era1 1002 \ + > "$LOG_DIR/trin_benchmark.log" 2>&1 & +TRIN_BENCH_PID=$! + +echo "Started Benchmark" + +CLEANED_UP=false +# Function to clean up processes on SIGINT and SIGTERM +cleanup() { + if $CLEANED_UP; then + return + fi + CLEANED_UP=true + echo "Finished benchmark. Stopping processes..." + + # Stop trin sender and receiver + for PID in "${PIDS[@]}"; do + if kill -0 "$PID" 2>/dev/null; then + echo "Killing process with PID $PID..." + pkill -SIGINT -P "$PID" + fi + done + + # Wait for trin sender and receiver to finish + for PID in "${PIDS[@]}"; do + if kill -0 "$PID" 2>/dev/null; then + echo "Waiting process with PID $PID..." + wait "$PID" 2>/dev/null + fi + done + + # Stop trin-bench process separately + if kill -0 "$TRIN_BENCH_PID" 2>/dev/null; then + echo "Stopping trin-bench with PID $TRIN_BENCH_PID..." + kill -SIGINT "$TRIN_BENCH_PID" + wait "$TRIN_BENCH_PID" 2>/dev/null + fi + + echo "All processes stopped." + + # Remove data directories + sudo rm -rf "$LOG_DIR/$DATA_DIR_SENDER" "$LOG_DIR/$DATA_DIR_RECEIVER" "$LOG_DIR/trin_sender.perf" "$LOG_DIR/trin_receiver.perf" +} + +# Trap signals +trap cleanup SIGINT SIGTERM ERR + +# Wait for trin-bench to finish +wait "$TRIN_BENCH_PID" + +# unset the trap +trap - SIGINT SIGTERM ERR + +cleanup diff --git a/bin/trin-bench/src/cli.rs b/bin/trin-bench/src/cli.rs new file mode 100644 index 000000000..fb5e45431 --- /dev/null +++ b/bin/trin-bench/src/cli.rs @@ -0,0 +1,43 @@ +use std::path::PathBuf; + +use clap::Parser; +use url::Url; + +pub const APP_NAME: &str = "trin-bench"; +const DEFAULT_EPOCH_ACC_PATH: &str = "./portal-accumulators"; + +#[derive(Parser, Debug, Clone)] +#[command( + name = "Trin Bench", + about = "Benchmarks sending blocks from one trin client to another" +)] +pub struct TrinBenchConfig { + #[arg( + long = "web3-http-address-node-1", + help = "address to accept json-rpc http connections" + )] + pub web3_http_address_node_1: Url, + + #[arg( + long = "web3-http-address-node-2", + help = "address to accept json-rpc http connections" + )] + pub web3_http_address_node_2: Url, + + #[arg( + long, + help = "The first era to start sending blocks from", + default_value = "1" + )] + pub start_era1: u16, + + #[arg(long, help = "The last era to send blocks from", default_value = "5")] + pub end_era1: u16, + + #[arg( + long = "epoch-accumulator-path", + help = "Path to epoch accumulator repo for bridge mode", + default_value = DEFAULT_EPOCH_ACC_PATH + )] + pub epoch_acc_path: PathBuf, +} diff --git a/bin/trin-bench/src/lib.rs b/bin/trin-bench/src/lib.rs new file mode 100644 index 000000000..4f773726a --- /dev/null +++ b/bin/trin-bench/src/lib.rs @@ -0,0 +1 @@ +pub mod cli; diff --git a/bin/trin-bench/src/main.rs b/bin/trin-bench/src/main.rs new file mode 100644 index 000000000..eaef2e2ad --- /dev/null +++ b/bin/trin-bench/src/main.rs @@ -0,0 +1,227 @@ +use std::{sync::Arc, thread::sleep, time::Instant}; + +use clap::Parser; +use e2store::{era1::Era1, utils::get_era1_files}; +use ethportal_api::{ + types::portal_wire::OfferTrace, BlockBodyLegacy, ContentValue, Discv5ApiClient, Enr, + HistoryContentKey, HistoryContentValue, HistoryNetworkApiClient, Receipts, +}; +use futures::future::join_all; +use humanize_duration::{prelude::DurationExt, Truncate}; +use jsonrpsee::http_client::{HttpClient, HttpClientBuilder}; +use portal_bridge::{ + api::execution::construct_proof, + bridge::{history::SERVE_BLOCK_TIMEOUT, utils::lookup_epoch_acc}, +}; +use reqwest::Client; +use tokio::{ + sync::{OwnedSemaphorePermit, Semaphore}, + task::JoinHandle, + time::timeout, +}; +use tracing::{debug, error, info, warn, Instrument}; +use trin_bench::cli::TrinBenchConfig; +use trin_execution::era::utils::download_raw_era; +use trin_utils::log::init_tracing_logger; +use trin_validation::{constants::EPOCH_SIZE, oracle::HeaderOracle}; + +#[tokio::main] +async fn main() -> anyhow::Result<()> { + init_tracing_logger(); + + let start_timer = Instant::now(); + let mut offer_count = 0; + + sleep(std::time::Duration::from_secs(10)); + + let trin_bench_config = TrinBenchConfig::parse(); + let send_node_client = HttpClientBuilder::default() + .build(trin_bench_config.web3_http_address_node_1.clone()) + .expect("Failed to build send_node_client"); + + let receiver_node_client = HttpClientBuilder::default() + .build(trin_bench_config.web3_http_address_node_2.clone()) + .expect("Failed to build receiver_node_client"); + + let receiver_node_enr = match receiver_node_client.node_info().await { + Ok(node_info) => node_info.enr, + Err(err) => panic!("Error getting receiver_node_enr: {err:?}"), + }; + + // ping receiver node, to exchange radius's, as if we just start with offers, the other node + // will assume a 100% radius by default + send_node_client.ping(receiver_node_enr.clone()).await?; + + let http_client = Client::new(); + let era1_files = get_era1_files(&http_client).await?; + let mut blocks = vec![]; + for era1_index in trin_bench_config.start_era1..=trin_bench_config.end_era1 { + let era1_path = era1_files[&(era1_index as u64)].clone(); + let raw_era1 = download_raw_era(era1_path, http_client.clone()).await?; + let block_tuples = Era1::deserialize(&raw_era1)?; + blocks.extend(block_tuples.block_tuples); + } + + // gossip blocks to receiver node + let gossip_semaphore = Arc::new(Semaphore::new(10)); + let header_oracle = HeaderOracle::default(); + + let mut epoch_acc = None; + let mut serve_full_block_handles = vec![]; + let mut current_epoch_index = u64::MAX; + // gossip headers + for block in blocks.clone() { + let height = block.header.header.number; + // Using epoch_size chunks & epoch boundaries ensures that every + // "chunk" shares an epoch accumulator avoiding the need to + // look up the epoch acc on a header by header basis + if current_epoch_index != height / EPOCH_SIZE { + current_epoch_index = height / EPOCH_SIZE; + epoch_acc = match lookup_epoch_acc( + current_epoch_index, + &header_oracle.header_validator.pre_merge_acc, + &trin_bench_config.epoch_acc_path, + ) + .await + { + Ok(epoch_acc) => Some(epoch_acc), + Err(msg) => { + unreachable!("Error looking up epoch acc: {msg:?}"); + } + }; + } + + let permit = gossip_semaphore + .clone() + .acquire_owned() + .await + .expect("to be able to acquire semaphore"); + + let content_key = HistoryContentKey::new_block_header_by_hash(block.header.header.hash()); + let content_value = if let Some(epoch_acc) = &epoch_acc { + // Construct HeaderWithProof + let header_with_proof = construct_proof(block.header.header.clone(), epoch_acc).await?; + // Double check that the proof is valid + header_oracle + .header_validator + .validate_header_with_proof(&header_with_proof)?; + HistoryContentValue::BlockHeaderWithProof(header_with_proof) + } else { + unreachable!("epoch_acc should be Some(epoch_acc) at this point"); + }; + serve_full_block_handles.push(spawn_serve_history_content( + send_node_client.clone(), + receiver_node_enr.clone(), + content_key, + content_value, + Some(permit), + )); + offer_count += 1; + } + + // gossip bodies + for block in blocks.clone() { + let permit = gossip_semaphore + .clone() + .acquire_owned() + .await + .expect("to be able to acquire semaphore"); + + let content_key = HistoryContentKey::new_block_body(block.header.header.hash()); + let content_value = + HistoryContentValue::BlockBody(ethportal_api::BlockBody::Legacy(BlockBodyLegacy { + txs: block.body.body.transactions().to_vec(), + uncles: block.body.body.uncles().to_vec(), + })); + serve_full_block_handles.push(spawn_serve_history_content( + send_node_client.clone(), + receiver_node_enr.clone(), + content_key, + content_value, + Some(permit), + )); + offer_count += 1; + } + + // gossip receipts + for block in blocks.clone() { + let permit = gossip_semaphore + .clone() + .acquire_owned() + .await + .expect("to be able to acquire semaphore"); + + let content_key = HistoryContentKey::new_block_receipts(block.header.header.hash()); + let content_value = HistoryContentValue::Receipts(Receipts { + receipt_list: block.receipts.receipts.receipt_list, + }); + serve_full_block_handles.push(spawn_serve_history_content( + send_node_client.clone(), + receiver_node_enr.clone(), + content_key, + content_value, + Some(permit), + )); + offer_count += 1; + } + + // Wait till all blocks are done gossiping. + // This can't deadlock, because the tokio::spawn has a timeout. + join_all(serve_full_block_handles).await; + + info!( + "Finished gossiping blocks in {}, with {} offers", + start_timer.elapsed().human(Truncate::Second), + offer_count + ); + + Ok(()) +} + +fn spawn_serve_history_content( + portal_client: HttpClient, + enr: Enr, + content_key: HistoryContentKey, + content_value: HistoryContentValue, + permit: Option, +) -> JoinHandle<()> { + tokio::spawn(async move { + match timeout( + SERVE_BLOCK_TIMEOUT, + offer_content(&portal_client, enr, content_key.clone(), content_value) + .in_current_span(), + ) + .await { + Ok(result) => match result { + Ok(_) => debug!("Successfully served block: {content_key:?}"), + Err(msg) => warn!("Error serving block: {content_key:?}: {msg:?}"), + }, + Err(_) => error!("serve_full_block() timed out on height {content_key:?}: this is an indication a bug is present") + }; + if let Some(permit) = permit { + drop(permit); + } + }) +} + +async fn offer_content( + client: &HttpClient, + enr: Enr, + content_key: HistoryContentKey, + content_value: HistoryContentValue, +) -> anyhow::Result<()> { + let result = HistoryNetworkApiClient::trace_offer( + client, + enr.clone(), + content_key.clone(), + content_value.encode(), + ) + .await?; + if OfferTrace::Declined == result || OfferTrace::Failed == result { + warn!("Error offering content: {enr:?} ||| {result:?}"); + } else { + // info!("Successful offer: {content_key:?} ||| {enr:?}"); + } + + Ok(()) +} From 4aa50208046d3226987db7e8f0c93d0d644723e8 Mon Sep 17 00:00:00 2001 From: Kolby Moroz Liebl <31669092+KolbyML@users.noreply.github.com> Date: Mon, 3 Feb 2025 09:07:19 -0700 Subject: [PATCH 2/2] fix: push updates --- .gitignore | 2 +- Cargo.toml | 12 +----------- bin/trin-bench/run-bench.sh | 10 +++++++--- bin/trin-bench/src/main.rs | 7 ++++--- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 6804a003c..812d766f2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ .vscode/ # Ignore downloaded consensus specs test data testing/ef-tests/mainnet* -bin/trin-bench/logs +bin/trin-bench/logs* diff --git a/Cargo.toml b/Cargo.toml index 3805a2c94..aadf43ceb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -122,17 +122,7 @@ trin-validation = { path = "crates/validation" } # See: https://github.com/eira-fransham/crunchy/issues/13 crunchy = "=0.2.2" -[profile.release] -opt-level = 3 -lto = "thin" -debug = "none" -strip = "symbols" -panic = "unwind" -codegen-units = 16 -# Use the `--profile profiling` flag to show symbols in release mode. -# e.g. `cargo build --profile profiling` [profile.profiling] inherits = "release" -debug = "full" -strip = "none" +debug = true diff --git a/bin/trin-bench/run-bench.sh b/bin/trin-bench/run-bench.sh index c6a766c96..15dc0b873 100755 --- a/bin/trin-bench/run-bench.sh +++ b/bin/trin-bench/run-bench.sh @@ -16,6 +16,7 @@ fi # Build trin-benchmark-cordinator with release profile pushd ../.. || { echo "Failed to change directory"; exit 1; } +cargo build --release -p trin || { echo "Failed to build trin"; exit 1; } cargo build --release -p trin-bench || { echo "Failed to build trin-benchmark-cordinator"; exit 1; } popd || { echo "Failed to return to original directory"; exit 1; } @@ -37,7 +38,8 @@ EXT_PORT_SENDER=$(find_unused_port 9100) EXT_PORT_RECEIVER=$(find_unused_port $((EXT_PORT_SENDER + 10))) # Run trin sender with perf profiling -cargo flamegraph --profile profiling -c "record -F 97 --call-graph dwarf,64000 -g -o $LOG_DIR/trin_sender.perf" --root --output "$LOG_DIR/trin_sender.svg" -p trin -- \ +# cargo flamegraph --profile release -c "record -F 997 --call-graph dwarf,64000 -g -o $LOG_DIR/trin_sender.perf" --release --output "$LOG_DIR/trin_sender.svg" -p trin -- \ +../../target/release/trin \ --web3-transport http \ --web3-http-address http://127.0.0.1:$PORT_SENDER/ \ --mb 0 \ @@ -49,7 +51,8 @@ cargo flamegraph --profile profiling -c "record -F 97 --call-graph dwarf,64000 - PIDS+=("$!") # Run trin receiver with perf profiling -cargo flamegraph --profile profiling -c "record -F 97 --call-graph dwarf,64000 -g -o $LOG_DIR/trin_receiver.perf" --root --output "$LOG_DIR/trin_receiver.svg" -p trin -- \ +# cargo flamegraph --profile release -c "record -F 997 --call-graph dwarf,64000 -g -o $LOG_DIR/trin_receiver.perf" --release --output "$LOG_DIR/trin_receiver.svg" -p trin -- \ +../../target/release/trin \ --web3-transport http \ --web3-http-address http://127.0.0.1:$PORT_RECEIVER/ \ --mb 10000 \ @@ -66,7 +69,7 @@ PIDS+=("$!") --web3-http-address-node-2 http://127.0.0.1:$PORT_RECEIVER/ \ --epoch-accumulator-path ../../portal-accumulators \ --start-era1 1000 \ - --end-era1 1002 \ + --end-era1 1010 \ > "$LOG_DIR/trin_benchmark.log" 2>&1 & TRIN_BENCH_PID=$! @@ -85,6 +88,7 @@ cleanup() { for PID in "${PIDS[@]}"; do if kill -0 "$PID" 2>/dev/null; then echo "Killing process with PID $PID..." + kill -SIGINT "$PID" pkill -SIGINT -P "$PID" fi done diff --git a/bin/trin-bench/src/main.rs b/bin/trin-bench/src/main.rs index eaef2e2ad..bad128801 100644 --- a/bin/trin-bench/src/main.rs +++ b/bin/trin-bench/src/main.rs @@ -29,9 +29,6 @@ use trin_validation::{constants::EPOCH_SIZE, oracle::HeaderOracle}; async fn main() -> anyhow::Result<()> { init_tracing_logger(); - let start_timer = Instant::now(); - let mut offer_count = 0; - sleep(std::time::Duration::from_secs(10)); let trin_bench_config = TrinBenchConfig::parse(); @@ -62,6 +59,10 @@ async fn main() -> anyhow::Result<()> { blocks.extend(block_tuples.block_tuples); } + info!("Beginning benchmark"); + let start_timer = Instant::now(); + let mut offer_count = 0; + // gossip blocks to receiver node let gossip_semaphore = Arc::new(Semaphore::new(10)); let header_oracle = HeaderOracle::default();