diff --git a/Cargo.lock b/Cargo.lock index 20c2f9df465c..303deff97f85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8235,7 +8235,6 @@ dependencies = [ "reth-tasks", "reth-testing-utils", "reth-transaction-pool", - "reth-trie", "revm", "revm-inspectors", "revm-primitives", diff --git a/crates/rpc/rpc-api/src/debug.rs b/crates/rpc/rpc-api/src/debug.rs index f073cc434817..0364b2c3e6cd 100644 --- a/crates/rpc/rpc-api/src/debug.rs +++ b/crates/rpc/rpc-api/src/debug.rs @@ -1,5 +1,3 @@ -use std::collections::HashMap; - use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use reth_primitives::{Address, BlockId, BlockNumberOrTag, Bytes, B256}; use reth_rpc_types::{ @@ -9,6 +7,7 @@ use reth_rpc_types::{ }, Bundle, RichBlock, StateContext, TransactionRequest, }; +use std::collections::HashMap; /// Debug rpc interface. #[cfg_attr(not(feature = "client"), rpc(server, namespace = "debug"))] diff --git a/crates/rpc/rpc/Cargo.toml b/crates/rpc/rpc/Cargo.toml index 963cafb9ebc4..5c2ebaa2357a 100644 --- a/crates/rpc/rpc/Cargo.toml +++ b/crates/rpc/rpc/Cargo.toml @@ -33,7 +33,6 @@ reth-evm.workspace = true reth-rpc-eth-types.workspace = true reth-rpc-server-types.workspace = true reth-node-api.workspace = true -reth-trie.workspace = true # eth alloy-dyn-abi.workspace = true diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index d6aea45d6721..2dad02b3e974 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -1,5 +1,3 @@ -use std::sync::Arc; - use alloy_rlp::{Decodable, Encodable}; use async_trait::async_trait; use jsonrpsee::core::RpcResult; @@ -10,9 +8,8 @@ use reth_primitives::{ Address, Block, BlockId, BlockNumberOrTag, Bytes, TransactionSignedEcRecovered, B256, U256, }; use reth_provider::{ - BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, HeaderProvider, - HistoricalStateProviderRef, StateProofProvider, StateProvider, StateProviderFactory, - StateRootProvider, TransactionVariant, + BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, HeaderProvider, StateProofProvider, + StateProviderFactory, TransactionVariant, }; use reth_revm::database::StateProviderDatabase; use reth_rpc_api::DebugApiServer; @@ -28,9 +25,8 @@ use reth_rpc_types::{ BlockError, Bundle, RichBlock, StateContext, TransactionRequest, }; use reth_tasks::pool::BlockingTaskGuard; -use reth_trie::{proof::Proof, HashedPostState}; use revm::{ - db::{states::bundle_state::BundleRetention, BundleState, CacheDB, State}, + db::{BundleState, CacheDB}, primitives::{db::DatabaseCommit, BlockEnv, CfgEnvWithHandlerCfg, Env, EnvWithHandlerCfg}, }; use revm_inspectors::tracing::{ @@ -38,6 +34,7 @@ use revm_inspectors::tracing::{ FourByteInspector, MuxInspector, TracingInspector, TracingInspectorConfig, }; use revm_primitives::{keccak256, HashMap}; +use std::sync::Arc; use tokio::sync::{AcquireError, OwnedSemaphorePermit}; /// `debug` API implementation. @@ -583,11 +580,8 @@ where .accounts .into_iter() .map(|(addr, db_acc)| { - let storage_keys = db_acc - .storage - .into_iter() - .map(|(storage_key, _)| storage_key.into()) - .collect::>(); + let storage_keys = + db_acc.storage.keys().copied().map(Into::into).collect::>(); let account_proof = state.proof(&BundleState::default(), addr, &storage_keys)?; @@ -607,14 +601,14 @@ where let mut witness = HashMap::with_capacity(total_nodes); for proof in account_proofs { // First, add all account proof nodes. - for node in proof.proof.into_iter() { + for node in proof.proof { let hash = keccak256(node.as_ref()); witness.insert(hash, node); } // Next, add all storage proof nodes. - for storage_proof in proof.storage_proofs.into_iter() { - for node in storage_proof.proof.into_iter() { + for storage_proof in proof.storage_proofs { + for node in storage_proof.proof { let hash = keccak256(node.as_ref()); witness.insert(hash, node); } @@ -651,7 +645,7 @@ where GethDebugBuiltInTracerType::FourByteTracer => { let mut inspector = FourByteInspector::default(); let (res, _) = self.eth_api().inspect(db, env, &mut inspector)?; - return Ok((FourByteFrame::from(inspector).into(), res.state)) + return Ok((FourByteFrame::from(inspector).into(), res.state)); } GethDebugBuiltInTracerType::CallTracer => { let call_config = tracer_config