diff --git a/crates/cli/runner/src/lib.rs b/crates/cli/runner/src/lib.rs index 37ec8a7603a..71af165ab9d 100644 --- a/crates/cli/runner/src/lib.rs +++ b/crates/cli/runner/src/lib.rs @@ -11,15 +11,7 @@ //! Entrypoint for running commands. use reth_tasks::{TaskExecutor, TaskManager}; -use std::{ - future::Future, - pin::pin, - sync::{ - atomic::{AtomicUsize, Ordering}, - mpsc, - }, - time::Duration, -}; +use std::{future::Future, pin::pin, sync::mpsc, time::Duration}; use tracing::{debug, error, trace}; /// Executes CLI commands. @@ -167,14 +159,7 @@ pub struct CliContext { /// Creates a new default tokio multi-thread [Runtime](tokio::runtime::Runtime) with all features /// enabled pub fn tokio_runtime() -> Result { - tokio::runtime::Builder::new_multi_thread() - .enable_all() - .thread_name_fn(|| { - static IDX: AtomicUsize = AtomicUsize::new(0); - let id = IDX.fetch_add(1, Ordering::Relaxed); - format!("reth-cli-tokio-{id}") - }) - .build() + tokio::runtime::Builder::new_multi_thread().enable_all().build() } /// Runs the given future to completion or until a critical task panicked. diff --git a/crates/engine/tree/src/tree/payload_processor/executor.rs b/crates/engine/tree/src/tree/payload_processor/executor.rs index 18992812895..3013c5e1c72 100644 --- a/crates/engine/tree/src/tree/payload_processor/executor.rs +++ b/crates/engine/tree/src/tree/payload_processor/executor.rs @@ -2,10 +2,7 @@ use rayon::ThreadPool as RayonPool; use std::{ - sync::{ - atomic::{AtomicUsize, Ordering}, - Arc, OnceLock, - }, + sync::{Arc, OnceLock}, time::Duration, }; use tokio::{ @@ -74,7 +71,6 @@ impl WorkloadExecutorInner { Handle::try_current().unwrap_or_else(|_| { // Create a new runtime if no runtime is available static RT: OnceLock = OnceLock::new(); - static THREAD_COUNTER: AtomicUsize = AtomicUsize::new(0); let rt = RT.get_or_init(|| { Builder::new_multi_thread() @@ -86,10 +82,6 @@ impl WorkloadExecutorInner { // new block, and instead reuse the existing // threads. .thread_keep_alive(Duration::from_secs(15)) - .thread_name_fn(|| { - let id = THREAD_COUNTER.fetch_add(1, Ordering::Relaxed); - format!("reth-wkpool-tokio-{}", id) - }) .build() .unwrap() }); diff --git a/crates/tasks/src/pool.rs b/crates/tasks/src/pool.rs index e9729144d0f..10fedccedd1 100644 --- a/crates/tasks/src/pool.rs +++ b/crates/tasks/src/pool.rs @@ -72,7 +72,7 @@ impl BlockingTaskPool { /// Uses [`rayon::ThreadPoolBuilder::build`](rayon::ThreadPoolBuilder::build) defaults but /// increases the stack size to 8MB. pub fn build() -> Result { - Self::builder().thread_name(|i| format!("reth-blocking-rayon-{}", i)).build().map(Self::new) + Self::builder().build().map(Self::new) } /// Asynchronous wrapper around Rayon's diff --git a/crates/trie/parallel/src/root.rs b/crates/trie/parallel/src/root.rs index 7309f85e34f..61d8f69a1d2 100644 --- a/crates/trie/parallel/src/root.rs +++ b/crates/trie/parallel/src/root.rs @@ -20,10 +20,7 @@ use reth_trie::{ use reth_trie_db::{DatabaseHashedCursorFactory, DatabaseTrieCursorFactory}; use std::{ collections::HashMap, - sync::{ - atomic::{AtomicUsize, Ordering}, - mpsc, Arc, OnceLock, - }, + sync::{mpsc, Arc, OnceLock}, time::Duration, }; use thiserror::Error; @@ -286,7 +283,6 @@ fn get_runtime_handle() -> Handle { Handle::try_current().unwrap_or_else(|_| { // Create a new runtime if no runtime is available static RT: OnceLock = OnceLock::new(); - static THREAD_COUNTER: AtomicUsize = AtomicUsize::new(0); let rt = RT.get_or_init(|| { Builder::new_multi_thread() @@ -294,10 +290,6 @@ fn get_runtime_handle() -> Handle { // This prevents the costly process of spawning new threads on every // new block, and instead reuses the existing threads. .thread_keep_alive(Duration::from_secs(15)) - .thread_name_fn(|| { - let id = THREAD_COUNTER.fetch_add(1, Ordering::Relaxed); - format!("reth-trie-tokio-{}", id) - }) .build() .expect("Failed to create tokio runtime") });