diff --git a/crates/payload/builder/src/payload.rs b/crates/payload/builder/src/payload.rs index 2063c0341c3b..461836b49fad 100644 --- a/crates/payload/builder/src/payload.rs +++ b/crates/payload/builder/src/payload.rs @@ -148,16 +148,14 @@ pub struct PayloadBuilderAttributes { } /// Optimism Payload Builder Attributes +#[cfg(feature = "optimism")] #[derive(Debug, Clone, PartialEq, Eq)] pub struct OptimismPayloadBuilderAttributes { /// NoTxPool option for the generated payload - #[cfg(feature = "optimism")] pub no_tx_pool: bool, /// Transactions for the generated payload - #[cfg(feature = "optimism")] pub transactions: Vec, /// The gas limit for the generated payload - #[cfg(feature = "optimism")] pub gas_limit: Option, } diff --git a/crates/primitives/src/transaction/pooled.rs b/crates/primitives/src/transaction/pooled.rs index 3991563569f3..9768bef3fd10 100644 --- a/crates/primitives/src/transaction/pooled.rs +++ b/crates/primitives/src/transaction/pooled.rs @@ -10,9 +10,6 @@ use derive_more::{AsRef, Deref}; use reth_codecs::add_arbitrary_tests; use serde::{Deserialize, Serialize}; -#[cfg(feature = "optimism")] -use crate::TxDeposit; - /// A response to `GetPooledTransactions`. This can include either a blob transaction, or a /// non-4844 signed transaction. #[add_arbitrary_tests] @@ -51,7 +48,7 @@ pub enum PooledTransactionsElement { #[cfg(feature = "optimism")] Deposit { /// The inner transaction - transaction: TxDeposit, + transaction: crate::TxDeposit, /// The signature signature: Signature, /// The hash of the transaction diff --git a/crates/rpc/rpc/src/eth/error.rs b/crates/rpc/rpc/src/eth/error.rs index bfe353209cab..491c35c3cd0a 100644 --- a/crates/rpc/rpc/src/eth/error.rs +++ b/crates/rpc/rpc/src/eth/error.rs @@ -108,14 +108,13 @@ pub enum EthApiError { } /// Eth Optimism Api Error +#[cfg(feature = "optimism")] #[derive(Debug, thiserror::Error)] pub enum OptimismEthApiError { /// Wrapper around a [hyper::Error]. - #[cfg(feature = "optimism")] #[error(transparent)] HyperError(#[from] hyper::Error), /// Wrapper around an [http::Error]. - #[cfg(feature = "optimism")] #[error(transparent)] HttpError(#[from] http::Error), } @@ -348,11 +347,9 @@ pub enum RpcInvalidTransactionError { pub enum OptimismInvalidTransactionError { /// A deposit transaction was submitted as a system transaction post-regolith. #[error("no system transactions allowed after regolith")] - #[cfg(feature = "optimism")] DepositSystemTxPostRegolith, /// A deposit transaction halted post-regolith #[error("deposit transaction halted after regolith")] - #[cfg(feature = "optimism")] HaltedDepositPostRegolith, } diff --git a/crates/transaction-pool/src/noop.rs b/crates/transaction-pool/src/noop.rs index f07ceee36f5f..6e6be8f2b8f4 100644 --- a/crates/transaction-pool/src/noop.rs +++ b/crates/transaction-pool/src/noop.rs @@ -20,9 +20,6 @@ use reth_primitives::{Address, BlobTransactionSidecar, TxHash}; use std::{collections::HashSet, marker::PhantomData, sync::Arc}; use tokio::sync::{mpsc, mpsc::Receiver}; -#[cfg(feature = "optimism")] -use reth_primitives::InvalidTransactionError; - /// A [`TransactionPool`] implementation that does nothing. /// /// All transactions are rejected and no events are emitted. @@ -242,7 +239,7 @@ impl TransactionValidator for MockTransactionValidator { if transaction.is_deposit() { return TransactionValidationOutcome::Invalid( transaction, - InvalidTransactionError::TxTypeNotSupported.into(), + reth_primitives::InvalidTransactionError::TxTypeNotSupported.into(), ) } diff --git a/crates/transaction-pool/src/validate/eth.rs b/crates/transaction-pool/src/validate/eth.rs index dcdd1b4ce715..25507724601e 100644 --- a/crates/transaction-pool/src/validate/eth.rs +++ b/crates/transaction-pool/src/validate/eth.rs @@ -26,8 +26,6 @@ use std::{ }; use tokio::sync::Mutex; -#[cfg(feature = "optimism")] -use reth_primitives::{bytes::BytesMut, BlockNumberOrTag}; #[cfg(feature = "optimism")] use reth_revm::optimism::RethL1BlockInfo; @@ -377,7 +375,10 @@ where #[cfg(feature = "optimism")] let cost = { - let block = match self.client.block_by_number_or_tag(BlockNumberOrTag::Latest) { + let block = match self + .client + .block_by_number_or_tag(reth_primitives::BlockNumberOrTag::Latest) + { Ok(Some(block)) => block, Ok(None) => { return TransactionValidationOutcome::Error( @@ -390,7 +391,7 @@ where } }; - let mut encoded = BytesMut::default(); + let mut encoded = reth_primitives::bytes::BytesMut::default(); transaction.to_recovered_transaction().encode_enveloped(&mut encoded); let cost_addition = match reth_revm::optimism::extract_l1_info(&block).map(|info| { info.l1_tx_data_fee(