From 7bc21c7913a0c79cf885d7c6c479c44f39af8f54 Mon Sep 17 00:00:00 2001 From: Mario Rugiero Date: Tue, 11 Nov 2025 11:42:23 -0300 Subject: [PATCH] feat(l1,l2): name rayon threads for easier debugging --- Cargo.lock | 1 + cmd/ethrex/Cargo.toml | 1 + cmd/ethrex/ethrex.rs | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 9812ca093ff..e653393ac15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3306,6 +3306,7 @@ dependencies = [ "lazy_static", "local-ip-address", "rand 0.8.5", + "rayon", "reqwest 0.12.24", "secp256k1", "serde", diff --git a/cmd/ethrex/Cargo.toml b/cmd/ethrex/Cargo.toml index 5092c49cc48..47b51f87129 100644 --- a/cmd/ethrex/Cargo.toml +++ b/cmd/ethrex/Cargo.toml @@ -43,6 +43,7 @@ serde_json.workspace = true tokio = { workspace = true, features = ["full"] } anyhow = "1.0.86" rand = "0.8.5" +rayon.workspace = true local-ip-address = "0.6" tokio-util.workspace = true lazy_static.workspace = true diff --git a/cmd/ethrex/ethrex.rs b/cmd/ethrex/ethrex.rs index aeeb16a20ea..15467714127 100644 --- a/cmd/ethrex/ethrex.rs +++ b/cmd/ethrex/ethrex.rs @@ -49,6 +49,11 @@ async fn server_shutdown( async fn main() -> eyre::Result<()> { let CLI { opts, command } = CLI::parse(); + rayon::ThreadPoolBuilder::default() + .thread_name(|i| format!("rayon-worker-{i}")) + .build_global() + .expect("failed to build rayon threadpool"); + if let Some(subcommand) = command { return subcommand.run(&opts).await; }