Skip to content

chore: trim some reth imports #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions crates/evm/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,16 @@ use crate::{
BlockResult, EvmNeedsTx, EvmTransacted, RunTxResult, SignetLayered, ToRethPrimitive, BASE_GAS,
};
use alloy::{
consensus::{ReceiptEnvelope, Transaction as _},
consensus::{Header, ReceiptEnvelope, Transaction as _, TxType},
eips::eip1559::{BaseFeeParams, INITIAL_BASE_FEE as EIP1559_INITIAL_BASE_FEE},
primitives::{Address, Bloom, U256},
};
use reth::{
core::primitives::SignedTransaction,
primitives::{
Block, BlockBody, Header, Receipt, RecoveredBlock, SealedHeader, Transaction,
TransactionSigned, TxType,
Block, BlockBody, Receipt, RecoveredBlock, SealedHeader, Transaction, TransactionSigned,
},
providers::ExecutionOutcome,
revm::{
context::{ContextTr, TransactTo},
context_interface::block::BlobExcessGasAndPrice,
Inspector,
},
};
use signet_extract::{ExtractedEvent, Extracts};
use signet_types::{constants::SignetSystemConstants, AggregateFills, MarketError};
Expand All @@ -32,10 +26,11 @@ use trevm::{
revm::{
context::{
result::{EVMError, ExecutionResult},
BlockEnv, CfgEnv, TxEnv,
BlockEnv, CfgEnv, ContextTr, TransactTo, TxEnv,
},
context_interface::block::BlobExcessGasAndPrice,
database::State,
Database, DatabaseCommit,
Database, DatabaseCommit, Inspector,
},
trevm_try, BlockDriver, BlockOutput, Tx,
};
Expand Down
6 changes: 3 additions & 3 deletions crates/evm/src/journal/coder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use crate::{AcctDiff, BundleStateIndex, HostJournal, InfoOutcome};
use alloy::primitives::{Address, Bytes, B256, U256};
use alloy::rlp::{Buf, BufMut};
use eyre::Result;
use reth::revm::{
use signet_zenith::Zenith;
use std::{borrow::Cow, collections::BTreeMap, fmt::Debug, sync::Arc};
use trevm::revm::{
db::{states::StorageSlot, BundleState},
primitives::{AccountInfo, Bytecode, Eof},
};
use std::{borrow::Cow, collections::BTreeMap, fmt::Debug, sync::Arc};
use signet_zenith::Zenith;

const TAG_ACCT_CREATED: u8 = 0;
const TAG_ACCT_DIFF: u8 = 1;
Expand Down
8 changes: 0 additions & 8 deletions crates/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ mod sys_log;

pub(crate) const BASE_GAS: usize = 21_000;

/// Type alias for EVMs using a [`StateProviderBox`] as the `DB` type for
/// trevm.
///
/// [`StateProviderBox`]: reth::providers::StateProviderBox
pub type RuRevmState = reth::revm::db::State<
reth::revm::database::StateProviderDatabase<reth::providers::StateProviderBox>,
>;

/// Create a new EVM with the given database.
pub fn signet_evm<Db: Database + DatabaseCommit>(
db: Db,
Expand Down
2 changes: 1 addition & 1 deletion crates/evm/src/orders/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ use alloy::{
primitives::{Address, Log, U256},
sol_types::SolEvent,
};
use reth::revm::interpreter::InterpreterTypes;
use signet_types::{constants::SignetSystemConstants, AggregateFills, AggregateOrders};
use signet_zenith::RollupOrders;
use trevm::{
helpers::Ctx,
revm::{
interpreter::{
CallInputs, CallOutcome, CreateInputs, CreateOutcome, EOFCreateInputs, Interpreter,
InterpreterTypes,
},
Database, Inspector,
},
Expand Down
6 changes: 4 additions & 2 deletions crates/evm/src/orders/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ pub use framed::{Framed, FramedFilleds, FramedOrders};
mod inspector;
pub use inspector::OrderDetector;

use reth::revm::interpreter::{interpreter::EthInterpreter, InterpreterTypes};
use trevm::{
helpers::Ctx,
inspectors::Layered,
revm::{Database, Inspector},
revm::{
interpreter::{interpreter::EthInterpreter, InterpreterTypes},
Database, Inspector,
},
};

/// Inspector containing an accessible [`OrderDetector`].
Expand Down
10 changes: 9 additions & 1 deletion crates/rpc/src/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use reth::{
use reth_chainspec::{BaseFeeParams, ChainSpec, ChainSpecProvider};
use reth_node_api::{BlockBody, FullNodeComponents};
use reth_rpc_eth_api::{RpcBlock, RpcReceipt, RpcTransaction};
use signet_evm::{EvmNeedsTx, RuRevmState};
use signet_evm::EvmNeedsTx;
use signet_tx_cache::client::TxCache;
use signet_types::{constants::SignetSystemConstants, MagicSig};
use std::{marker::PhantomData, sync::Arc};
Expand All @@ -50,6 +50,14 @@ use trevm::{
Cfg,
};

/// Type alias for EVMs using a [`StateProviderBox`] as the `DB` type for
/// trevm.
///
/// [`StateProviderBox`]: reth::providers::StateProviderBox
pub type RuRevmState = trevm::revm::database::State<
reth::revm::database::StateProviderDatabase<reth::providers::StateProviderBox>,
>;

/// The maximum number of headers we read at once when handling a range filter.
const MAX_HEADERS_RANGE: u64 = 1_000; // with ~530bytes per header this is ~500kb

Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mod config;
pub use config::{RpcServerGuard, ServeConfig};

mod ctx;
pub use ctx::RpcCtx;
pub use ctx::{RpcCtx, RuRevmState};

mod eth;
pub use eth::{eth, CallErrorData, EthError};
Expand Down
Loading