diff --git a/Cargo.lock b/Cargo.lock index abe128a632ad5..9a49cf9f6bfda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7423,7 +7423,6 @@ dependencies = [ "reth-testing-utils", "reth-tracing", "reth-trie", - "reth-trie-db", "reth-trie-parallel", "reth-trie-sparse", "revm-primitives", diff --git a/crates/engine/tree/Cargo.toml b/crates/engine/tree/Cargo.toml index f428c8771cba9..37c4471403ac1 100644 --- a/crates/engine/tree/Cargo.toml +++ b/crates/engine/tree/Cargo.toml @@ -32,7 +32,6 @@ reth-prune.workspace = true reth-revm.workspace = true reth-stages-api.workspace = true reth-tasks.workspace = true -reth-trie-db.workspace = true reth-trie-parallel.workspace = true reth-trie-sparse.workspace = true reth-trie.workspace = true @@ -120,5 +119,4 @@ test-utils = [ "reth-tracing", "reth-trie/test-utils", "reth-prune-types?/test-utils", - "reth-trie-db/test-utils", ] diff --git a/crates/engine/tree/src/tree/root.rs b/crates/engine/tree/src/tree/root.rs index 72b18d49f52c7..d9f3ec7c4784d 100644 --- a/crates/engine/tree/src/tree/root.rs +++ b/crates/engine/tree/src/tree/root.rs @@ -4,15 +4,13 @@ use alloy_primitives::map::{HashMap, HashSet}; use rayon::iter::{ParallelBridge, ParallelIterator}; use reth_evm::system_calls::OnStateHook; use reth_provider::{ - providers::ConsistentDbView, BlockReader, DBProvider, DatabaseProviderFactory, - StateCommitmentProvider, + providers::ConsistentDbView, BlockReader, DatabaseProviderFactory, StateCommitmentProvider, }; use reth_trie::{ - proof::Proof, updates::TrieUpdates, HashedPostState, HashedStorage, MultiProof, - MultiProofTargets, Nibbles, TrieInput, + updates::TrieUpdates, HashedPostState, HashedStorage, MultiProof, MultiProofTargets, Nibbles, + TrieInput, }; -use reth_trie_db::DatabaseProof; -use reth_trie_parallel::root::ParallelStateRootError; +use reth_trie_parallel::{proof::ParallelProof, root::ParallelStateRootError}; use reth_trie_sparse::{ errors::{SparseStateTrieResult, SparseTrieErrorKind}, SparseStateTrie, @@ -310,21 +308,8 @@ where // Dispatch proof gathering for this state update rayon::spawn(move || { - let provider = match view.provider_ro() { - Ok(provider) => provider, - Err(error) => { - error!(target: "engine::root", ?error, "Could not get provider"); - return; - } - }; - - // 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, - ); + let result = ParallelProof::new(view, input.clone()).multiproof(proof_targets); + match result { Ok(proof) => { let _ = state_root_message_sender.send(StateRootMessage::ProofCalculated {