diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index 02946310f13a..96941dfadf99 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -90,7 +90,7 @@ pub use transaction::{ IntoRecoveredTransaction, InvalidTransactionError, Signature, Transaction, TransactionKind, TransactionMeta, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxEip1559, TxEip2930, TxEip4844, TxLegacy, TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, - LEGACY_TX_TYPE_ID, + EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID, }; pub use withdrawal::Withdrawal; diff --git a/crates/primitives/src/transaction/mod.rs b/crates/primitives/src/transaction/mod.rs index a2d64517fcb7..8c7e0394c6a2 100644 --- a/crates/primitives/src/transaction/mod.rs +++ b/crates/primitives/src/transaction/mod.rs @@ -14,7 +14,9 @@ use reth_rlp::{ use serde::{Deserialize, Serialize}; pub use signature::Signature; use std::mem; -pub use tx_type::{TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, LEGACY_TX_TYPE_ID}; +pub use tx_type::{ + TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, LEGACY_TX_TYPE_ID, +}; pub use eip1559::TxEip1559; pub use eip2930::TxEip2930; diff --git a/crates/primitives/src/transaction/tx_type.rs b/crates/primitives/src/transaction/tx_type.rs index 822965a18f11..6685e96b64cf 100644 --- a/crates/primitives/src/transaction/tx_type.rs +++ b/crates/primitives/src/transaction/tx_type.rs @@ -13,8 +13,7 @@ pub const EIP2930_TX_TYPE_ID: u8 = 1; pub const EIP1559_TX_TYPE_ID: u8 = 2; /// Identifier for [TxEip4844](crate::TxEip4844) transaction. -#[allow(unused)] -pub(crate) const EIP4844_TX_TYPE_ID: u8 = 3; +pub const EIP4844_TX_TYPE_ID: u8 = 3; /// Transaction Type /// diff --git a/crates/transaction-pool/src/traits.rs b/crates/transaction-pool/src/traits.rs index 7d07a72a8759..5cffaa30df43 100644 --- a/crates/transaction-pool/src/traits.rs +++ b/crates/transaction-pool/src/traits.rs @@ -7,7 +7,8 @@ use crate::{ use futures_util::{ready, Stream}; use reth_primitives::{ Address, FromRecoveredTransaction, IntoRecoveredTransaction, PeerId, Transaction, - TransactionKind, TransactionSignedEcRecovered, TxHash, EIP1559_TX_TYPE_ID, H256, U256, + TransactionKind, TransactionSignedEcRecovered, TxHash, EIP1559_TX_TYPE_ID, EIP4844_TX_TYPE_ID, + H256, U256, }; use reth_rlp::Encodable; use std::{ @@ -554,6 +555,11 @@ pub trait PoolTransaction: self.tx_type() == EIP1559_TX_TYPE_ID } + /// Returns true if the transaction is an EIP-4844 transaction. + fn is_eip4844(&self) -> bool { + self.tx_type() == EIP4844_TX_TYPE_ID + } + /// Returns the length of the rlp encoded object fn encoded_length(&self) -> usize;