diff --git a/Cargo.lock b/Cargo.lock index 93fb51d9b..d1d81ed9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7391,6 +7391,7 @@ dependencies = [ "assert_matches", "criterion", "crossbeam-channel", + "derive_more", "futures", "metrics", "rand 0.8.5", diff --git a/crates/engine/tree/Cargo.toml b/crates/engine/tree/Cargo.toml index f428c8771..6a6a67a5e 100644 --- a/crates/engine/tree/Cargo.toml +++ b/crates/engine/tree/Cargo.toml @@ -58,6 +58,7 @@ reth-metrics = { workspace = true, features = ["common"] } # misc rayon.workspace = true tracing.workspace = true +derive_more.workspace = true # optional deps for test-utils reth-prune-types = { workspace = true, optional = true } diff --git a/crates/engine/tree/src/tree/root.rs b/crates/engine/tree/src/tree/root.rs index f80546c25..10547e766 100644 --- a/crates/engine/tree/src/tree/root.rs +++ b/crates/engine/tree/src/tree/root.rs @@ -1,6 +1,7 @@ //! State root task related functionality. use alloy_primitives::map::HashSet; +use derive_more::derive::Deref; use rayon::iter::{ParallelBridge, ParallelIterator}; use reth_errors::ProviderError; use reth_evm::system_calls::OnStateHook; @@ -22,7 +23,6 @@ use reth_trie_sparse::{ use revm_primitives::{keccak256, EvmState, B256}; use std::{ collections::BTreeMap, - ops::Deref, sync::{ mpsc::{self, channel, Receiver, Sender}, Arc, @@ -185,6 +185,7 @@ impl ProofSequencer { /// A wrapper for the sender that signals completion when dropped #[allow(dead_code)] +#[derive(Deref)] pub(crate) struct StateHookSender(Sender>); #[allow(dead_code)] @@ -194,14 +195,6 @@ impl StateHookSender { } } -impl Deref for StateHookSender { - type Target = Sender>; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - impl Drop for StateHookSender { fn drop(&mut self) { // Send completion signal when the sender is dropped @@ -355,7 +348,6 @@ where // TODO: replace with parallel proof let result = Proof::overlay_multiproof( provider.tx_ref(), - // TODO(alexey): this clone can be expensive, we should avoid it input.as_ref().clone(), proof_targets.clone(), );