diff --git a/crates/transaction-pool/src/test_utils/mock.rs b/crates/transaction-pool/src/test_utils/mock.rs index 849bde265..afa1638c8 100644 --- a/crates/transaction-pool/src/test_utils/mock.rs +++ b/crates/transaction-pool/src/test_utils/mock.rs @@ -770,6 +770,14 @@ impl EthPoolTransaction for MockTransaction { } } + fn try_into_pooled_eip4844(self, sidecar: Arc) -> Option { + Self::Pooled::try_from_blob_transaction( + self.into_consensus(), + Arc::unwrap_or_clone(sidecar), + ) + .ok() + } + fn validate_blob( &self, _blob: &BlobTransactionSidecar, diff --git a/crates/transaction-pool/src/traits.rs b/crates/transaction-pool/src/traits.rs index d0ec36cb0..f4946ed9d 100644 --- a/crates/transaction-pool/src/traits.rs +++ b/crates/transaction-pool/src/traits.rs @@ -1093,6 +1093,13 @@ pub trait EthPoolTransaction: /// Returns the number of blobs this transaction has. fn blob_count(&self) -> usize; + /// A specialization for the EIP-4844 transaction type. + /// Tries to reattach the blob sidecar to the transaction. + /// + /// This returns an option, but callers should ensure that the transaction is an EIP-4844 + /// transaction: [`PoolTransaction::is_eip4844`]. + fn try_into_pooled_eip4844(self, sidecar: Arc) -> Option; + /// Validates the blob sidecar of the transaction with the given settings. fn validate_blob( &self, @@ -1324,6 +1331,14 @@ impl EthPoolTransaction for EthPooledTransaction { } } + fn try_into_pooled_eip4844(self, sidecar: Arc) -> Option { + PooledTransactionsElementEcRecovered::try_from_blob_transaction( + self.into_consensus(), + Arc::unwrap_or_clone(sidecar), + ) + .ok() + } + fn validate_blob( &self, sidecar: &BlobTransactionSidecar,