diff --git a/crates/block-processor/src/utils.rs b/crates/block-processor/src/utils.rs index f6140d6..00eae08 100644 --- a/crates/block-processor/src/utils.rs +++ b/crates/block-processor/src/utils.rs @@ -1,5 +1,5 @@ -use reth::revm::primitives::hardfork::SpecId; use reth_chainspec::EthereumHardforks; +use trevm::revm::primitives::hardfork::SpecId; /// Equivalent to [`reth_evm_ethereum::revm_spec`], however, always starts at /// [`SpecId::PRAGUE`] and transitions to [`SpecId::OSAKA`]. diff --git a/crates/db/src/aliases.rs b/crates/db/src/aliases.rs index da9a7c5..db880fb 100644 --- a/crates/db/src/aliases.rs +++ b/crates/db/src/aliases.rs @@ -1,5 +1,9 @@ -use reth::providers::DatabaseProviderRW; +use reth::{ + providers::{DatabaseProviderRW, StateProviderBox}, + revm::database::StateProviderDatabase, +}; use signet_node_types::SignetNodeTypes; +use trevm::revm::database::State; /// A Convenience alias for a [`DatabaseProviderRW`] using [`SignetNodeTypes`]. pub type SignetDbRw = DatabaseProviderRW>; @@ -8,6 +12,4 @@ pub type SignetDbRw = DatabaseProviderRW>; /// trevm. /// /// [`StateProviderBox`]: reth::providers::StateProviderBox -pub type RuRevmState = trevm::revm::database::State< - reth::revm::database::StateProviderDatabase, ->; +pub type RuRevmState = State>; diff --git a/crates/rpc/src/ctx/full.rs b/crates/rpc/src/ctx/full.rs index 90648c7..5d4ef10 100644 --- a/crates/rpc/src/ctx/full.rs +++ b/crates/rpc/src/ctx/full.rs @@ -14,7 +14,10 @@ use signet_tx_cache::client::TxCache; use signet_types::constants::SignetSystemConstants; use std::sync::Arc; use tokio::sync::{AcquireError, OwnedSemaphorePermit, Semaphore}; -use trevm::{helpers::Ctx, revm::Inspector}; +use trevm::{ + helpers::Ctx, + revm::{Inspector, inspector::NoOpInspector}, +}; /// State location when instantiating an EVM instance. #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -248,7 +251,7 @@ where state: LoadState, header: &Header, ) -> Result, EthApiError> { - self.trevm_with_inspector(state, header, trevm::revm::inspector::NoOpInspector) + self.trevm_with_inspector(state, header, NoOpInspector) } } diff --git a/crates/rpc/src/ctx/signet.rs b/crates/rpc/src/ctx/signet.rs index 113f1af..a146b9b 100644 --- a/crates/rpc/src/ctx/signet.rs +++ b/crates/rpc/src/ctx/signet.rs @@ -21,7 +21,7 @@ use reth::{ ProviderError, ProviderResult, ReceiptProvider, StateProviderFactory, TransactionsProvider, providers::BlockchainProvider, }, - revm::{database::StateProviderDatabase, primitives::hardfork::SpecId}, + revm::database::StateProviderDatabase, rpc::{ eth::{filter::EthFilterError, helpers::types::EthRpcConverter}, server_types::eth::{ @@ -48,7 +48,7 @@ use std::{marker::PhantomData, sync::Arc}; use tracing::{Level, instrument, trace}; use trevm::{ Cfg, - revm::{context::CfgEnv, database::StateBuilder}, + revm::{context::CfgEnv, database::StateBuilder, primitives::hardfork::SpecId}, }; /// The maximum number of headers we read at once when handling a range filter. diff --git a/crates/rpc/src/debug/tracer.rs b/crates/rpc/src/debug/tracer.rs index 0213c68..d9ac74f 100644 --- a/crates/rpc/src/debug/tracer.rs +++ b/crates/rpc/src/debug/tracer.rs @@ -3,16 +3,13 @@ //! In particular the `debug_trace_call` function. use crate::DebugError; -use reth::{ - revm::{DatabaseRef, context::ContextTr}, - rpc::{ - server_types::eth::EthApiError, - types::{ - TransactionInfo, - trace::geth::{ - FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerConfig, - GethDebugTracerType, GethDebugTracingOptions, GethTrace, NoopFrame, - }, +use reth::rpc::{ + server_types::eth::EthApiError, + types::{ + TransactionInfo, + trace::geth::{ + FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerConfig, GethDebugTracerType, + GethDebugTracingOptions, GethTrace, NoopFrame, }, }, }; @@ -23,7 +20,7 @@ use signet_evm::{EvmNeedsTx, EvmReady}; use tracing::instrument; use trevm::{ helpers::Ctx, - revm::{Database, DatabaseCommit, Inspector}, + revm::{Database, DatabaseCommit, DatabaseRef, Inspector, context::ContextTr}, }; /// Trace a transaction using the provided EVM and tracing options. diff --git a/crates/rpc/src/eth/endpoints.rs b/crates/rpc/src/eth/endpoints.rs index 5d44c20..23f099f 100644 --- a/crates/rpc/src/eth/endpoints.rs +++ b/crates/rpc/src/eth/endpoints.rs @@ -30,7 +30,7 @@ use signet_evm::EvmErrored; use signet_node_types::Pnt; use std::borrow::Cow; use tracing::{Instrument, debug, trace_span}; -use trevm::revm::context::result::ExecutionResult; +use trevm::{EstimationResult, MIN_TRANSACTION_GAS, revm::context::result::ExecutionResult}; /// Args for `eth_estimateGas` and `eth_call`. #[derive(Debug, Deserialize)] @@ -407,7 +407,7 @@ where /// - Otherwise, do nothing const fn normalize_gas_stateless(request: &mut TransactionRequest, max_gas: u64) { match request.gas { - Some(..trevm::MIN_TRANSACTION_GAS) => request.gas = None, + Some(..MIN_TRANSACTION_GAS) => request.gas = None, Some(val) if val > max_gas => request.gas = Some(max_gas), _ => {} } @@ -568,16 +568,14 @@ where let (estimate, _) = response_tri!(trevm.estimate_gas().map_err(EvmErrored::into_error)); match estimate { - trevm::EstimationResult::Success { limit, .. } => { - ResponsePayload::Success(U64::from(limit)) - } - trevm::EstimationResult::Revert { reason, .. } => { + EstimationResult::Success { limit, .. } => ResponsePayload::Success(U64::from(limit)), + EstimationResult::Revert { reason, .. } => { ResponsePayload::internal_error_with_message_and_obj( "execution reverted".into(), reason.clone().into(), ) } - trevm::EstimationResult::Halt { reason, .. } => { + EstimationResult::Halt { reason, .. } => { ResponsePayload::internal_error_with_message_and_obj( "execution halted".into(), format!("{reason:?}").into(),