Skip to content

Commit cb41464

Browse files
authored
chore: clean up revm imports (#50)
1 parent cde20ff commit cb41464

File tree

6 files changed

+27
-27
lines changed

6 files changed

+27
-27
lines changed

crates/block-processor/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use reth::revm::primitives::hardfork::SpecId;
21
use reth_chainspec::EthereumHardforks;
2+
use trevm::revm::primitives::hardfork::SpecId;
33

44
/// Equivalent to [`reth_evm_ethereum::revm_spec`], however, always starts at
55
/// [`SpecId::PRAGUE`] and transitions to [`SpecId::OSAKA`].

crates/db/src/aliases.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
use reth::providers::DatabaseProviderRW;
1+
use reth::{
2+
providers::{DatabaseProviderRW, StateProviderBox},
3+
revm::database::StateProviderDatabase,
4+
};
25
use signet_node_types::SignetNodeTypes;
6+
use trevm::revm::database::State;
37

48
/// A Convenience alias for a [`DatabaseProviderRW`] using [`SignetNodeTypes`].
59
pub type SignetDbRw<Db> = DatabaseProviderRW<Db, SignetNodeTypes<Db>>;
@@ -8,6 +12,4 @@ pub type SignetDbRw<Db> = DatabaseProviderRW<Db, SignetNodeTypes<Db>>;
812
/// trevm.
913
///
1014
/// [`StateProviderBox`]: reth::providers::StateProviderBox
11-
pub type RuRevmState = trevm::revm::database::State<
12-
reth::revm::database::StateProviderDatabase<reth::providers::StateProviderBox>,
13-
>;
15+
pub type RuRevmState = State<StateProviderDatabase<StateProviderBox>>;

crates/rpc/src/ctx/full.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ use signet_tx_cache::client::TxCache;
1414
use signet_types::constants::SignetSystemConstants;
1515
use std::sync::Arc;
1616
use tokio::sync::{AcquireError, OwnedSemaphorePermit, Semaphore};
17-
use trevm::{helpers::Ctx, revm::Inspector};
17+
use trevm::{
18+
helpers::Ctx,
19+
revm::{Inspector, inspector::NoOpInspector},
20+
};
1821

1922
/// State location when instantiating an EVM instance.
2023
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -248,7 +251,7 @@ where
248251
state: LoadState,
249252
header: &Header,
250253
) -> Result<EvmNeedsTx<RuRevmState>, EthApiError> {
251-
self.trevm_with_inspector(state, header, trevm::revm::inspector::NoOpInspector)
254+
self.trevm_with_inspector(state, header, NoOpInspector)
252255
}
253256
}
254257

crates/rpc/src/ctx/signet.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use reth::{
2121
ProviderError, ProviderResult, ReceiptProvider, StateProviderFactory, TransactionsProvider,
2222
providers::BlockchainProvider,
2323
},
24-
revm::{database::StateProviderDatabase, primitives::hardfork::SpecId},
24+
revm::database::StateProviderDatabase,
2525
rpc::{
2626
eth::{filter::EthFilterError, helpers::types::EthRpcConverter},
2727
server_types::eth::{
@@ -48,7 +48,7 @@ use std::{marker::PhantomData, sync::Arc};
4848
use tracing::{Level, instrument, trace};
4949
use trevm::{
5050
Cfg,
51-
revm::{context::CfgEnv, database::StateBuilder},
51+
revm::{context::CfgEnv, database::StateBuilder, primitives::hardfork::SpecId},
5252
};
5353

5454
/// The maximum number of headers we read at once when handling a range filter.

crates/rpc/src/debug/tracer.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
//! In particular the `debug_trace_call` function.
44
55
use crate::DebugError;
6-
use reth::{
7-
revm::{DatabaseRef, context::ContextTr},
8-
rpc::{
9-
server_types::eth::EthApiError,
10-
types::{
11-
TransactionInfo,
12-
trace::geth::{
13-
FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerConfig,
14-
GethDebugTracerType, GethDebugTracingOptions, GethTrace, NoopFrame,
15-
},
6+
use reth::rpc::{
7+
server_types::eth::EthApiError,
8+
types::{
9+
TransactionInfo,
10+
trace::geth::{
11+
FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerConfig, GethDebugTracerType,
12+
GethDebugTracingOptions, GethTrace, NoopFrame,
1613
},
1714
},
1815
};
@@ -23,7 +20,7 @@ use signet_evm::{EvmNeedsTx, EvmReady};
2320
use tracing::instrument;
2421
use trevm::{
2522
helpers::Ctx,
26-
revm::{Database, DatabaseCommit, Inspector},
23+
revm::{Database, DatabaseCommit, DatabaseRef, Inspector, context::ContextTr},
2724
};
2825

2926
/// Trace a transaction using the provided EVM and tracing options.

crates/rpc/src/eth/endpoints.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use signet_evm::EvmErrored;
3030
use signet_node_types::Pnt;
3131
use std::borrow::Cow;
3232
use tracing::{Instrument, debug, trace_span};
33-
use trevm::revm::context::result::ExecutionResult;
33+
use trevm::{EstimationResult, MIN_TRANSACTION_GAS, revm::context::result::ExecutionResult};
3434

3535
/// Args for `eth_estimateGas` and `eth_call`.
3636
#[derive(Debug, Deserialize)]
@@ -407,7 +407,7 @@ where
407407
/// - Otherwise, do nothing
408408
const fn normalize_gas_stateless(request: &mut TransactionRequest, max_gas: u64) {
409409
match request.gas {
410-
Some(..trevm::MIN_TRANSACTION_GAS) => request.gas = None,
410+
Some(..MIN_TRANSACTION_GAS) => request.gas = None,
411411
Some(val) if val > max_gas => request.gas = Some(max_gas),
412412
_ => {}
413413
}
@@ -568,16 +568,14 @@ where
568568
let (estimate, _) = response_tri!(trevm.estimate_gas().map_err(EvmErrored::into_error));
569569

570570
match estimate {
571-
trevm::EstimationResult::Success { limit, .. } => {
572-
ResponsePayload::Success(U64::from(limit))
573-
}
574-
trevm::EstimationResult::Revert { reason, .. } => {
571+
EstimationResult::Success { limit, .. } => ResponsePayload::Success(U64::from(limit)),
572+
EstimationResult::Revert { reason, .. } => {
575573
ResponsePayload::internal_error_with_message_and_obj(
576574
"execution reverted".into(),
577575
reason.clone().into(),
578576
)
579577
}
580-
trevm::EstimationResult::Halt { reason, .. } => {
578+
EstimationResult::Halt { reason, .. } => {
581579
ResponsePayload::internal_error_with_message_and_obj(
582580
"execution halted".into(),
583581
format!("{reason:?}").into(),

0 commit comments

Comments
 (0)