From 53f9daeda55fc4756e00a12e3bece6047303670f Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 13 Dec 2024 14:18:49 +0100 Subject: [PATCH] chore: remove PooledTransactionsElement variant --- crates/ethereum/node/src/node.rs | 7 ++-- crates/net/eth-wire-types/src/primitives.rs | 2 +- crates/net/eth-wire-types/src/transactions.rs | 32 +++++++++---------- .../net/eth-wire/tests/pooled_transactions.rs | 6 ++-- crates/net/network/src/test_utils/testnet.rs | 17 +++------- .../net/network/src/transactions/fetcher.rs | 14 ++++---- .../network/src/transactions/validation.rs | 2 +- crates/node/builder/src/rpc.rs | 6 ++-- crates/optimism/cli/src/ovm_file_codec.rs | 2 +- crates/optimism/node/src/node.rs | 11 +++---- crates/primitives/src/lib.rs | 8 ++--- crates/primitives/src/transaction/mod.rs | 29 +++++++++-------- crates/primitives/src/transaction/pooled.rs | 18 +++++------ crates/rpc/rpc-builder/src/lib.rs | 18 +++++------ crates/rpc/rpc/src/eth/bundle.rs | 10 +++--- crates/transaction-pool/src/maintain.rs | 4 +-- .../transaction-pool/src/test_utils/mock.rs | 4 +-- crates/transaction-pool/src/traits.rs | 10 +++--- crates/transaction-pool/src/validate/eth.rs | 6 ++-- 19 files changed, 93 insertions(+), 113 deletions(-) diff --git a/crates/ethereum/node/src/node.rs b/crates/ethereum/node/src/node.rs index 59269d3a3e01..d08879be69d9 100644 --- a/crates/ethereum/node/src/node.rs +++ b/crates/ethereum/node/src/node.rs @@ -23,7 +23,7 @@ use reth_node_builder::{ BuilderContext, Node, NodeAdapter, NodeComponentsBuilder, PayloadBuilderConfig, PayloadTypes, }; use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService}; -use reth_primitives::{EthPrimitives, PooledTransactionsElement}; +use reth_primitives::{EthPrimitives, PooledTransaction}; use reth_provider::{CanonStateSubscriptions, EthStorage}; use reth_rpc::EthApi; use reth_tracing::tracing::{debug, info}; @@ -312,10 +312,7 @@ impl NetworkBuilder for EthereumNetworkBuilder where Node: FullNodeTypes>, Pool: TransactionPool< - Transaction: PoolTransaction< - Consensus = TxTy, - Pooled = PooledTransactionsElement, - >, + Transaction: PoolTransaction, Pooled = PooledTransaction>, > + Unpin + 'static, { diff --git a/crates/net/eth-wire-types/src/primitives.rs b/crates/net/eth-wire-types/src/primitives.rs index 3d14bf154c0c..4595ac15ab6f 100644 --- a/crates/net/eth-wire-types/src/primitives.rs +++ b/crates/net/eth-wire-types/src/primitives.rs @@ -50,6 +50,6 @@ impl NetworkPrimitives for EthNetworkPrimitives { type BlockBody = reth_primitives::BlockBody; type Block = reth_primitives::Block; type BroadcastedTransaction = reth_primitives::TransactionSigned; - type PooledTransaction = reth_primitives::PooledTransactionsElement; + type PooledTransaction = reth_primitives::PooledTransaction; type Receipt = reth_primitives::Receipt; } diff --git a/crates/net/eth-wire-types/src/transactions.rs b/crates/net/eth-wire-types/src/transactions.rs index ca76f0a8c7ed..bd77d761e3d9 100644 --- a/crates/net/eth-wire-types/src/transactions.rs +++ b/crates/net/eth-wire-types/src/transactions.rs @@ -5,7 +5,7 @@ use alloy_primitives::B256; use alloy_rlp::{RlpDecodableWrapper, RlpEncodableWrapper}; use derive_more::{Constructor, Deref, IntoIterator}; use reth_codecs_derive::add_arbitrary_tests; -use reth_primitives::PooledTransactionsElement; +use reth_primitives::PooledTransaction; /// A list of transaction hashes that the peer would like transaction bodies for. #[derive(Clone, Debug, PartialEq, Eq, RlpEncodableWrapper, RlpDecodableWrapper, Default)] @@ -46,7 +46,7 @@ where Constructor, )] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct PooledTransactions( +pub struct PooledTransactions( /// The transaction bodies, each of which should correspond to a requested hash. pub Vec, ); @@ -88,7 +88,7 @@ mod tests { use alloy_primitives::{hex, PrimitiveSignature as Signature, TxKind, U256}; use alloy_rlp::{Decodable, Encodable}; use reth_chainspec::MIN_TRANSACTION_GAS; - use reth_primitives::{PooledTransactionsElement, Transaction, TransactionSigned}; + use reth_primitives::{PooledTransaction, Transaction, TransactionSigned}; use std::str::FromStr; #[test] @@ -175,17 +175,17 @@ mod tests { ), ), ]; - let message: Vec = txs + let message: Vec = txs .into_iter() .map(|tx| { - PooledTransactionsElement::try_from(tx) - .expect("Failed to convert TransactionSigned to PooledTransactionsElement") + PooledTransaction::try_from(tx) + .expect("Failed to convert TransactionSigned to PooledTransaction") }) .collect(); let request = RequestPair { request_id: 1111, message: PooledTransactions(message), /* Assuming PooledTransactions wraps a - * Vec */ + * Vec */ }; request.encode(&mut data); assert_eq!(data, expected); @@ -241,11 +241,11 @@ mod tests { ), ), ]; - let message: Vec = txs + let message: Vec = txs .into_iter() .map(|tx| { - PooledTransactionsElement::try_from(tx) - .expect("Failed to convert TransactionSigned to PooledTransactionsElement") + PooledTransaction::try_from(tx) + .expect("Failed to convert TransactionSigned to PooledTransaction") }) .collect(); let expected = RequestPair { request_id: 1111, message: PooledTransactions(message) }; @@ -373,11 +373,11 @@ mod tests { ), ), ]; - let message: Vec = txs + let message: Vec = txs .into_iter() .map(|tx| { - PooledTransactionsElement::try_from(tx) - .expect("Failed to convert TransactionSigned to PooledTransactionsElement") + PooledTransaction::try_from(tx) + .expect("Failed to convert TransactionSigned to PooledTransaction") }) .collect(); let expected_transactions = @@ -510,11 +510,11 @@ mod tests { ), ), ]; - let message: Vec = txs + let message: Vec = txs .into_iter() .map(|tx| { - PooledTransactionsElement::try_from(tx) - .expect("Failed to convert TransactionSigned to PooledTransactionsElement") + PooledTransaction::try_from(tx) + .expect("Failed to convert TransactionSigned to PooledTransaction") }) .collect(); let transactions = RequestPair { request_id: 0, message: PooledTransactions(message) }; diff --git a/crates/net/eth-wire/tests/pooled_transactions.rs b/crates/net/eth-wire/tests/pooled_transactions.rs index 93a17f3b05ba..3d43e66f88ec 100644 --- a/crates/net/eth-wire/tests/pooled_transactions.rs +++ b/crates/net/eth-wire/tests/pooled_transactions.rs @@ -4,7 +4,7 @@ use alloy_eips::eip2718::Decodable2718; use alloy_primitives::hex; use alloy_rlp::{Decodable, Encodable}; use reth_eth_wire::{EthNetworkPrimitives, EthVersion, PooledTransactions, ProtocolMessage}; -use reth_primitives::PooledTransactionsElement; +use reth_primitives::PooledTransaction; use std::{fs, path::PathBuf}; use test_fuzz::test_fuzz; @@ -61,7 +61,7 @@ fn decode_blob_transaction_data() { PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("testdata/blob_transaction"); let data = fs::read_to_string(network_data_path).expect("Unable to read file"); let hex_data = hex::decode(data.trim()).unwrap(); - let _txs = PooledTransactionsElement::decode(&mut &hex_data[..]).unwrap(); + let _txs = PooledTransaction::decode(&mut &hex_data[..]).unwrap(); } #[test] @@ -71,5 +71,5 @@ fn decode_blob_rpc_transaction() { PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("testdata/rpc_blob_transaction"); let data = fs::read_to_string(network_data_path).expect("Unable to read file"); let hex_data = hex::decode(data.trim()).unwrap(); - let _txs = PooledTransactionsElement::decode_2718(&mut hex_data.as_ref()).unwrap(); + let _txs = PooledTransaction::decode_2718(&mut hex_data.as_ref()).unwrap(); } diff --git a/crates/net/network/src/test_utils/testnet.rs b/crates/net/network/src/test_utils/testnet.rs index ddb49f33b89e..c9934a882b4c 100644 --- a/crates/net/network/src/test_utils/testnet.rs +++ b/crates/net/network/src/test_utils/testnet.rs @@ -20,7 +20,7 @@ use reth_network_api::{ NetworkEvent, NetworkEventListenerProvider, NetworkInfo, Peers, }; use reth_network_peers::PeerId; -use reth_primitives::{PooledTransactionsElement, TransactionSigned}; +use reth_primitives::{PooledTransaction, TransactionSigned}; use reth_storage_api::{ noop::NoopProvider, BlockReader, BlockReaderIdExt, HeaderProvider, StateProviderFactory, }; @@ -229,10 +229,7 @@ where + Unpin + 'static, Pool: TransactionPool< - Transaction: PoolTransaction< - Consensus = TransactionSigned, - Pooled = PooledTransactionsElement, - >, + Transaction: PoolTransaction, > + Unpin + 'static, { @@ -300,10 +297,7 @@ where + Unpin + 'static, Pool: TransactionPool< - Transaction: PoolTransaction< - Consensus = TransactionSigned, - Pooled = PooledTransactionsElement, - >, + Transaction: PoolTransaction, > + Unpin + 'static, { @@ -537,10 +531,7 @@ where + Unpin + 'static, Pool: TransactionPool< - Transaction: PoolTransaction< - Consensus = TransactionSigned, - Pooled = PooledTransactionsElement, - >, + Transaction: PoolTransaction, > + Unpin + 'static, { diff --git a/crates/net/network/src/transactions/fetcher.rs b/crates/net/network/src/transactions/fetcher.rs index 2fa900d416fc..8f438d0c55f0 100644 --- a/crates/net/network/src/transactions/fetcher.rs +++ b/crates/net/network/src/transactions/fetcher.rs @@ -49,7 +49,7 @@ use reth_eth_wire_types::{EthNetworkPrimitives, NetworkPrimitives}; use reth_network_api::PeerRequest; use reth_network_p2p::error::{RequestError, RequestResult}; use reth_network_peers::PeerId; -use reth_primitives::PooledTransactionsElement; +use reth_primitives::PooledTransaction; use reth_primitives_traits::SignedTransaction; use schnellru::ByLength; #[cfg(debug_assertions)] @@ -1084,7 +1084,7 @@ impl TxFetchMetadata { /// Represents possible events from fetching transactions. #[derive(Debug)] -pub enum FetchEvent { +pub enum FetchEvent { /// Triggered when transactions are successfully fetched. TransactionsFetched { /// The ID of the peer from which transactions were fetched. @@ -1108,7 +1108,7 @@ pub enum FetchEvent { /// An inflight request for [`PooledTransactions`] from a peer. #[derive(Debug)] -pub struct GetPooledTxRequest { +pub struct GetPooledTxRequest { peer_id: PeerId, /// Transaction hashes that were requested, for cleanup purposes requested_hashes: RequestTxHashes, @@ -1118,7 +1118,7 @@ pub struct GetPooledTxRequest { /// Upon reception of a response, a [`GetPooledTxRequest`] is deconstructed to form a /// [`GetPooledTxResponse`]. #[derive(Debug)] -pub struct GetPooledTxResponse { +pub struct GetPooledTxResponse { peer_id: PeerId, /// Transaction hashes that were requested, for cleanup purposes, since peer may only return a /// subset of requested hashes. @@ -1131,7 +1131,7 @@ pub struct GetPooledTxResponse { #[must_use = "futures do nothing unless polled"] #[pin_project::pin_project] #[derive(Debug)] -pub struct GetPooledTxRequestFut { +pub struct GetPooledTxRequestFut { #[pin] inner: Option>, } @@ -1517,10 +1517,10 @@ mod test { #[test] fn verify_response_hashes() { let input = hex!("02f871018302a90f808504890aef60826b6c94ddf4c5025d1a5742cf12f74eec246d4432c295e487e09c3bbcc12b2b80c080a0f21a4eacd0bf8fea9c5105c543be5a1d8c796516875710fafafdf16d16d8ee23a001280915021bb446d1973501a67f93d2b38894a514b976e7b46dc2fe54598daa"); - let signed_tx_1: PooledTransactionsElement = + let signed_tx_1: PooledTransaction = TransactionSigned::decode(&mut &input[..]).unwrap().try_into().unwrap(); let input = hex!("02f871018302a90f808504890aef60826b6c94ddf4c5025d1a5742cf12f74eec246d4432c295e487e09c3bbcc12b2b80c080a0f21a4eacd0bf8fea9c5105c543be5a1d8c796516875710fafafdf16d16d8ee23a001280915021bb446d1973501a67f93d2b38894a514b976e7b46dc2fe54598d76"); - let signed_tx_2: PooledTransactionsElement = + let signed_tx_2: PooledTransaction = TransactionSigned::decode(&mut &input[..]).unwrap().try_into().unwrap(); // only tx 1 is requested diff --git a/crates/net/network/src/transactions/validation.rs b/crates/net/network/src/transactions/validation.rs index 1018cde6b55b..5eb4c905f9f2 100644 --- a/crates/net/network/src/transactions/validation.rs +++ b/crates/net/network/src/transactions/validation.rs @@ -42,7 +42,7 @@ pub trait ValidateTx68 { /// Returns the reasonable minimum encoded transaction length, if any. This property is not /// spec'ed out but can be inferred by looking at which - /// [`reth_primitives::PooledTransactionsElement`] will successfully pass decoding + /// [`reth_primitives::PooledTransaction`] will successfully pass decoding /// for any given transaction type. fn min_encoded_tx_length(&self, ty: TxType) -> Option; diff --git a/crates/node/builder/src/rpc.rs b/crates/node/builder/src/rpc.rs index 32123b194e6b..aa280a908b39 100644 --- a/crates/node/builder/src/rpc.rs +++ b/crates/node/builder/src/rpc.rs @@ -18,7 +18,7 @@ use reth_node_core::{ version::{CARGO_PKG_VERSION, CLIENT_CODE, NAME_CLIENT, VERGEN_GIT_SHA}, }; use reth_payload_builder::PayloadStore; -use reth_primitives::{EthPrimitives, PooledTransactionsElement}; +use reth_primitives::{EthPrimitives, PooledTransaction}; use reth_provider::providers::ProviderNodeTypes; use reth_rpc::{ eth::{EthApiTypes, FullEthApiServer}, @@ -405,7 +405,7 @@ where impl RpcAddOns where N: FullNodeComponents< - Pool: TransactionPool>, + Pool: TransactionPool>, >, EthApi: EthApiTypes + FullEthApiServer @@ -536,7 +536,7 @@ impl NodeAddOns for RpcAddOns where N: FullNodeComponents< Types: ProviderNodeTypes, - Pool: TransactionPool>, + Pool: TransactionPool>, >, EthApi: EthApiTypes + FullEthApiServer diff --git a/crates/optimism/cli/src/ovm_file_codec.rs b/crates/optimism/cli/src/ovm_file_codec.rs index 3d746d6d1e0d..b2e1e6c4cdb7 100644 --- a/crates/optimism/cli/src/ovm_file_codec.rs +++ b/crates/optimism/cli/src/ovm_file_codec.rs @@ -213,7 +213,7 @@ impl Decodable for TransactionSigned { /// This cannot be used for decoding EIP-4844 transactions in p2p `PooledTransactions`, since /// the EIP-4844 variant of [`TransactionSigned`] does not include the blob sidecar. /// - /// For a method suitable for decoding pooled transactions, see \[`PooledTransactionsElement`\]. + /// For a method suitable for decoding pooled transactions, see \[`PooledTransaction`\]. /// /// CAUTION: Due to a quirk in [`Header::decode`], this method will succeed even if a typed /// transaction is encoded in this format, and does not start with a RLP header: diff --git a/crates/optimism/node/src/node.rs b/crates/optimism/node/src/node.rs index 4fe67b819cd3..c9b48e21829d 100644 --- a/crates/optimism/node/src/node.rs +++ b/crates/optimism/node/src/node.rs @@ -33,7 +33,7 @@ use reth_optimism_rpc::{ OpEthApi, SequencerClient, }; use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService}; -use reth_primitives::{BlockBody, PooledTransactionsElement, TransactionSigned}; +use reth_primitives::{BlockBody, PooledTransaction, TransactionSigned}; use reth_provider::{ providers::ChainStorage, BlockBodyReader, BlockBodyWriter, CanonStateSubscriptions, ChainSpecProvider, DBProvider, EthStorage, ProviderResult, ReadBodyInput, StorageLocation, @@ -246,7 +246,7 @@ where Storage = OpStorage, Engine = OpEngineTypes, >, - Pool: TransactionPool>, + Pool: TransactionPool>, >, OpEngineValidator: EngineValidator<::Engine>, { @@ -297,7 +297,7 @@ where Storage = OpStorage, Engine = OpEngineTypes, >, - Pool: TransactionPool>, + Pool: TransactionPool>, >, OpEngineValidator: EngineValidator<::Engine>, { @@ -647,10 +647,7 @@ impl NetworkBuilder for OpNetworkBuilder where Node: FullNodeTypes>, Pool: TransactionPool< - Transaction: PoolTransaction< - Consensus = TxTy, - Pooled = PooledTransactionsElement, - >, + Transaction: PoolTransaction, Pooled = PooledTransaction>, > + Unpin + 'static, { diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index 3ed81ccf9aba..9b7cf7d13cc0 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -43,15 +43,13 @@ pub use reth_primitives_traits::{ }; pub use static_file::StaticFileSegment; +pub use alloy_consensus::{transaction::PooledTransaction, ReceiptWithBloom}; pub use transaction::{ util::secp256k1::{public_key_to_address, recover_signer_unchecked, sign_message}, - InvalidTransactionError, PooledTransactionsElement, PooledTransactionsElementEcRecovered, - RecoveredTx, Transaction, TransactionMeta, TransactionSigned, TransactionSignedEcRecovered, - TxType, + InvalidTransactionError, PooledTransactionsElementEcRecovered, RecoveredTx, Transaction, + TransactionMeta, TransactionSigned, TransactionSignedEcRecovered, TxType, }; -pub use alloy_consensus::ReceiptWithBloom; - // Re-exports pub use reth_ethereum_forks::*; diff --git a/crates/primitives/src/transaction/mod.rs b/crates/primitives/src/transaction/mod.rs index 543ab5bed001..4417b6b278cb 100644 --- a/crates/primitives/src/transaction/mod.rs +++ b/crates/primitives/src/transaction/mod.rs @@ -1,10 +1,11 @@ //! Transaction types. use alloc::vec::Vec; +pub use alloy_consensus::transaction::PooledTransaction; use alloy_consensus::{ - transaction::{PooledTransaction, RlpEcdsaTx}, - SignableTransaction, Signed, Transaction as _, TxEip1559, TxEip2930, TxEip4844, - TxEip4844Variant, TxEip4844WithSidecar, TxEip7702, TxLegacy, Typed2718, TypedTransaction, + transaction::RlpEcdsaTx, SignableTransaction, Signed, Transaction as _, TxEip1559, TxEip2930, + TxEip4844, TxEip4844Variant, TxEip4844WithSidecar, TxEip7702, TxLegacy, Typed2718, + TypedTransaction, }; use alloy_eips::{ eip2718::{Decodable2718, Eip2718Error, Eip2718Result, Encodable2718}, @@ -27,7 +28,7 @@ use once_cell::sync::{Lazy as LazyLock, OnceCell as OnceLock}; use op_alloy_consensus::DepositTransaction; #[cfg(feature = "optimism")] use op_alloy_consensus::TxDeposit; -pub use pooled::{PooledTransactionsElement, PooledTransactionsElementEcRecovered}; +pub use pooled::PooledTransactionsElementEcRecovered; use rayon::prelude::{IntoParallelIterator, ParallelIterator}; pub use reth_primitives_traits::{ transaction::error::{ @@ -853,25 +854,25 @@ impl TransactionSigned { &self.transaction } - /// Tries to convert a [`TransactionSigned`] into a [`PooledTransactionsElement`]. + /// Tries to convert a [`TransactionSigned`] into a [`PooledTransaction`]. /// /// This function used as a helper to convert from a decoded p2p broadcast message to - /// [`PooledTransactionsElement`]. Since EIP4844 variants are disallowed to be broadcasted on + /// [`PooledTransaction`]. Since EIP4844 variants are disallowed to be broadcasted on /// p2p, return an err if `tx` is [`Transaction::Eip4844`]. - pub fn try_into_pooled(self) -> Result { + pub fn try_into_pooled(self) -> Result { let hash = self.hash(); match self { Self { transaction: Transaction::Legacy(tx), signature, .. } => { - Ok(PooledTransactionsElement::Legacy(Signed::new_unchecked(tx, signature, hash))) + Ok(PooledTransaction::Legacy(Signed::new_unchecked(tx, signature, hash))) } Self { transaction: Transaction::Eip2930(tx), signature, .. } => { - Ok(PooledTransactionsElement::Eip2930(Signed::new_unchecked(tx, signature, hash))) + Ok(PooledTransaction::Eip2930(Signed::new_unchecked(tx, signature, hash))) } Self { transaction: Transaction::Eip1559(tx), signature, .. } => { - Ok(PooledTransactionsElement::Eip1559(Signed::new_unchecked(tx, signature, hash))) + Ok(PooledTransaction::Eip1559(Signed::new_unchecked(tx, signature, hash))) } Self { transaction: Transaction::Eip7702(tx), signature, .. } => { - Ok(PooledTransactionsElement::Eip7702(Signed::new_unchecked(tx, signature, hash))) + Ok(PooledTransaction::Eip7702(Signed::new_unchecked(tx, signature, hash))) } // Not supported because missing blob sidecar tx @ Self { transaction: Transaction::Eip4844(_), .. } => Err(tx), @@ -889,13 +890,13 @@ impl TransactionSigned { pub fn try_into_pooled_eip4844( self, sidecar: BlobTransactionSidecar, - ) -> Result { + ) -> Result { let hash = self.hash(); Ok(match self { // If the transaction is an EIP-4844 transaction... Self { transaction: Transaction::Eip4844(tx), signature, .. } => { // Construct a pooled eip488 tx with the provided sidecar. - PooledTransactionsElement::Eip4844(Signed::new_unchecked( + PooledTransaction::Eip4844(Signed::new_unchecked( TxEip4844WithSidecar { tx, sidecar }, signature, hash, @@ -1251,7 +1252,7 @@ impl Decodable for TransactionSigned { /// This cannot be used for decoding EIP-4844 transactions in p2p `PooledTransactions`, since /// the EIP-4844 variant of [`TransactionSigned`] does not include the blob sidecar. /// - /// For a method suitable for decoding pooled transactions, see [`PooledTransactionsElement`]. + /// For a method suitable for decoding pooled transactions, see [`PooledTransaction`]. /// /// CAUTION: Due to a quirk in [`Header::decode`], this method will succeed even if a typed /// transaction is encoded in this format, and does not start with a RLP header: diff --git a/crates/primitives/src/transaction/pooled.rs b/crates/primitives/src/transaction/pooled.rs index 88de540170b0..a01eb7142037 100644 --- a/crates/primitives/src/transaction/pooled.rs +++ b/crates/primitives/src/transaction/pooled.rs @@ -2,14 +2,12 @@ //! response to `GetPooledTransactions`. use crate::RecoveredTx; +use alloy_consensus::transaction::PooledTransaction; use alloy_eips::eip4844::BlobTransactionSidecar; use reth_primitives_traits::transaction::error::TransactionConversionError; -/// Tmp alias for the transaction type. -pub type PooledTransactionsElement = alloy_consensus::transaction::PooledTransaction; - /// A signed pooled transaction with recovered signer. -pub type PooledTransactionsElementEcRecovered = RecoveredTx; +pub type PooledTransactionsElementEcRecovered = RecoveredTx; impl PooledTransactionsElementEcRecovered { /// Transform back to [`RecoveredTx`] @@ -39,7 +37,7 @@ impl TryFrom for PooledTransactionsElementEcRecovered { type Error = TransactionConversionError; fn try_from(tx: RecoveredTx) -> Result { - match PooledTransactionsElement::try_from(tx.signed_transaction) { + match PooledTransaction::try_from(tx.signed_transaction) { Ok(pooled_transaction) => { Ok(Self::from_signed_transaction(pooled_transaction, tx.signer)) } @@ -78,7 +76,7 @@ mod tests { for hex_data in &input_too_short { let input_rlp = &mut &hex_data[..]; - let res = PooledTransactionsElement::decode(input_rlp); + let res = PooledTransaction::decode(input_rlp); assert!( res.is_err(), @@ -88,7 +86,7 @@ mod tests { // this is a legacy tx so we can attempt the same test with decode_enveloped let input_rlp = &mut &hex_data[..]; - let res = PooledTransactionsElement::decode_2718(input_rlp); + let res = PooledTransaction::decode_2718(input_rlp); assert!( res.is_err(), @@ -104,7 +102,7 @@ mod tests { let data = hex!("02f903d382426882ba09832dc6c0848674742682ed9694714b6a4ea9b94a8a7d9fd362ed72630688c8898c80b90364492d24749189822d8512430d3f3ff7a2ede675ac08265c08e2c56ff6fdaa66dae1cdbe4a5d1d7809f3e99272d067364e597542ac0c369d69e22a6399c3e9bee5da4b07e3f3fdc34c32c3d88aa2268785f3e3f8086df0934b10ef92cfffc2e7f3d90f5e83302e31382e302d64657600000000000000000000000000000000000000000000569e75fc77c1a856f6daaf9e69d8a9566ca34aa47f9133711ce065a571af0cfd000000000000000000000000e1e210594771824dad216568b91c9cb4ceed361c00000000000000000000000000000000000000000000000000000000000546e00000000000000000000000000000000000000000000000000000000000e4e1c00000000000000000000000000000000000000000000000000000000065d6750c00000000000000000000000000000000000000000000000000000000000f288000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002cf600000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000f1628e56fa6d8c50e5b984a58c0df14de31c7b857ce7ba499945b99252976a93d06dcda6776fc42167fbe71cb59f978f5ef5b12577a90b132d14d9c6efa528076f0161d7bf03643cfc5490ec5084f4a041db7f06c50bd97efa08907ba79ddcac8b890f24d12d8db31abbaaf18985d54f400449ee0559a4452afe53de5853ce090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000c080a01428023fc54a27544abc421d5d017b9a7c5936ad501cbdecd0d9d12d04c1a033a0753104bbf1c87634d6ff3f0ffa0982710612306003eb022363b57994bdef445a" ); - let res = PooledTransactionsElement::decode_2718(&mut &data[..]).unwrap(); + let res = PooledTransaction::decode_2718(&mut &data[..]).unwrap(); assert_eq!(res.to(), Some(address!("714b6a4ea9b94a8a7d9fd362ed72630688c8898c"))); } @@ -123,7 +121,7 @@ mod tests { let data = &hex!("d30b02808083c5cdeb8783c5acfd9e407c565656")[..]; let input_rlp = &mut &data[..]; - let res = PooledTransactionsElement::decode(input_rlp); + let res = PooledTransaction::decode(input_rlp); assert_matches!(res, Ok(_tx)); assert!(input_rlp.is_empty()); @@ -135,7 +133,7 @@ mod tests { assert!(input_rlp.is_empty()); // we can also decode_enveloped - let res = PooledTransactionsElement::decode_2718(&mut &data[..]); + let res = PooledTransaction::decode_2718(&mut &data[..]); assert_matches!(res, Ok(_tx)); } } diff --git a/crates/rpc/rpc-builder/src/lib.rs b/crates/rpc/rpc-builder/src/lib.rs index 877e80897861..dcbb9f22225f 100644 --- a/crates/rpc/rpc-builder/src/lib.rs +++ b/crates/rpc/rpc-builder/src/lib.rs @@ -19,7 +19,7 @@ //! use reth_engine_primitives::PayloadValidator; //! use reth_evm::{execute::BlockExecutorProvider, ConfigureEvm}; //! use reth_network_api::{NetworkInfo, Peers}; -//! use reth_primitives::{Header, PooledTransactionsElement, TransactionSigned}; +//! use reth_primitives::{Header, PooledTransaction, TransactionSigned}; //! use reth_provider::{AccountReader, CanonStateSubscriptions, ChangeSetReader, FullRpcProvider}; //! use reth_rpc::EthApi; //! use reth_rpc_builder::{ @@ -58,7 +58,7 @@ //! Pool: TransactionPool< //! Transaction: PoolTransaction< //! Consensus = TransactionSigned, -//! Pooled = PooledTransactionsElement, +//! Pooled = PooledTransaction, //! >, //! > + Unpin //! + 'static, @@ -102,7 +102,7 @@ //! use reth_engine_primitives::{EngineTypes, PayloadValidator}; //! use reth_evm::{execute::BlockExecutorProvider, ConfigureEvm}; //! use reth_network_api::{NetworkInfo, Peers}; -//! use reth_primitives::{Header, PooledTransactionsElement, TransactionSigned}; +//! use reth_primitives::{Header, PooledTransaction, TransactionSigned}; //! use reth_provider::{AccountReader, CanonStateSubscriptions, ChangeSetReader, FullRpcProvider}; //! use reth_rpc::EthApi; //! use reth_rpc_api::EngineApiServer; @@ -148,7 +148,7 @@ //! Pool: TransactionPool< //! Transaction: PoolTransaction< //! Consensus = TransactionSigned, -//! Pooled = PooledTransactionsElement, +//! Pooled = PooledTransaction, //! >, //! > + Unpin //! + 'static, @@ -230,7 +230,7 @@ use reth_consensus::FullConsensus; use reth_engine_primitives::{EngineTypes, PayloadValidator}; use reth_evm::{execute::BlockExecutorProvider, ConfigureEvm}; use reth_network_api::{noop::NoopNetwork, NetworkInfo, Peers}; -use reth_primitives::{NodePrimitives, PooledTransactionsElement}; +use reth_primitives::{NodePrimitives, PooledTransaction}; use reth_provider::{ AccountReader, BlockReader, CanonStateSubscriptions, ChainSpecProvider, ChangeSetReader, EvmEnvProvider, FullRpcProvider, ProviderBlock, ProviderHeader, ProviderReceipt, @@ -323,7 +323,7 @@ where Receipt = ::Receipt, Header = ::BlockHeader, >, - Pool: TransactionPool>, + Pool: TransactionPool>, >, BlockExecutor: BlockExecutorProvider, { @@ -715,7 +715,7 @@ where Receipt = ::Receipt, Header = ::BlockHeader, >, - Pool: TransactionPool>, + Pool: TransactionPool>, >, { let Self { @@ -841,7 +841,7 @@ where Block = ::Block, Header = ::BlockHeader, >, - Pool: TransactionPool>, + Pool: TransactionPool>, >, Pool: TransactionPool::Transaction>, { @@ -1382,7 +1382,7 @@ where Receipt = ::Receipt, Header = ::BlockHeader, >, - Pool: TransactionPool>, + Pool: TransactionPool>, >, BlockExecutor: BlockExecutorProvider, Consensus: reth_consensus::FullConsensus + Clone + 'static, diff --git a/crates/rpc/rpc/src/eth/bundle.rs b/crates/rpc/rpc/src/eth/bundle.rs index cbec6c2d3d7e..adb1f71c8ea8 100644 --- a/crates/rpc/rpc/src/eth/bundle.rs +++ b/crates/rpc/rpc/src/eth/bundle.rs @@ -6,7 +6,7 @@ use alloy_rpc_types_mev::{EthCallBundle, EthCallBundleResponse, EthCallBundleTra use jsonrpsee::core::RpcResult; use reth_chainspec::EthChainSpec; use reth_evm::{ConfigureEvm, ConfigureEvmEnv}; -use reth_primitives::PooledTransactionsElement; +use reth_primitives::PooledTransaction; use reth_primitives_traits::SignedTransaction; use reth_provider::{ChainSpecProvider, HeaderProvider}; use reth_revm::database::StateProviderDatabase; @@ -47,8 +47,8 @@ where Eth: EthTransactions< Pool: TransactionPool< Transaction: PoolTransaction< - Consensus: From, - Pooled = PooledTransactionsElement, + Consensus: From, + Pooled = PooledTransaction, >, >, > + LoadPendingBlock @@ -188,7 +188,7 @@ where while let Some((tx, signer)) = transactions.next() { // Verify that the given blob data, commitments, and proofs are all valid for // this transaction. - if let PooledTransactionsElement::Eip4844(ref tx) = tx { + if let PooledTransaction::Eip4844(ref tx) = tx { tx.tx().validate_blob(EnvKzgSettings::Default.get()).map_err(|e| { Eth::Error::from_eth_err(EthApiError::InvalidParams(e.to_string())) })?; @@ -277,7 +277,7 @@ where impl EthCallBundleApiServer for EthBundle where Eth: EthTransactions< - Pool: TransactionPool>, + Pool: TransactionPool>, > + LoadPendingBlock + Call + 'static, diff --git a/crates/transaction-pool/src/maintain.rs b/crates/transaction-pool/src/maintain.rs index 75f3524a0fbb..a0c5571a4abb 100644 --- a/crates/transaction-pool/src/maintain.rs +++ b/crates/transaction-pool/src/maintain.rs @@ -680,7 +680,7 @@ mod tests { use alloy_primitives::{hex, U256}; use reth_chainspec::MAINNET; use reth_fs_util as fs; - use reth_primitives::PooledTransactionsElement; + use reth_primitives::PooledTransaction; use reth_provider::test_utils::{ExtendedAccount, MockEthProvider}; use reth_tasks::TaskManager; @@ -700,7 +700,7 @@ mod tests { let temp_dir = tempfile::tempdir().unwrap(); let transactions_path = temp_dir.path().join(FILENAME).with_extension(EXTENSION); let tx_bytes = hex!("02f87201830655c2808505ef61f08482565f94388c818ca8b9251b393131c08a736a67ccb192978801049e39c4b5b1f580c001a01764ace353514e8abdfb92446de356b260e3c1225b73fc4c8876a6258d12a129a04f02294aa61ca7676061cd99f29275491218b4754b46a0248e5e42bc5091f507"); - let tx = PooledTransactionsElement::decode_2718(&mut &tx_bytes[..]).unwrap(); + let tx = PooledTransaction::decode_2718(&mut &tx_bytes[..]).unwrap(); let provider = MockEthProvider::default(); let transaction: EthPooledTransaction = tx.try_into_ecrecovered().unwrap().into(); let tx_to_cmp = transaction.clone(); diff --git a/crates/transaction-pool/src/test_utils/mock.rs b/crates/transaction-pool/src/test_utils/mock.rs index 2d16254dd2f2..999c4d9c8e15 100644 --- a/crates/transaction-pool/src/test_utils/mock.rs +++ b/crates/transaction-pool/src/test_utils/mock.rs @@ -30,7 +30,7 @@ use rand::{ }; use reth_primitives::{ transaction::{SignedTransactionIntoRecoveredExt, TryFromRecoveredTransactionError}, - PooledTransactionsElement, PooledTransactionsElementEcRecovered, RecoveredTx, Transaction, + PooledTransaction, PooledTransactionsElementEcRecovered, RecoveredTx, Transaction, TransactionSigned, TxType, }; use reth_primitives_traits::InMemorySize; @@ -666,7 +666,7 @@ impl PoolTransaction for MockTransaction { type Consensus = TransactionSigned; - type Pooled = PooledTransactionsElement; + type Pooled = PooledTransaction; fn try_from_consensus( tx: RecoveredTx, diff --git a/crates/transaction-pool/src/traits.rs b/crates/transaction-pool/src/traits.rs index ade76444456c..2fd93c90fd8a 100644 --- a/crates/transaction-pool/src/traits.rs +++ b/crates/transaction-pool/src/traits.rs @@ -21,8 +21,8 @@ use reth_execution_types::ChangedAccount; use reth_primitives::{ kzg::KzgSettings, transaction::{SignedTransactionIntoRecoveredExt, TryFromRecoveredTransactionError}, - PooledTransactionsElement, PooledTransactionsElementEcRecovered, RecoveredTx, SealedBlock, - Transaction, TransactionSigned, + PooledTransaction, PooledTransactionsElementEcRecovered, RecoveredTx, SealedBlock, Transaction, + TransactionSigned, }; use reth_primitives_traits::SignedTransaction; #[cfg(feature = "serde")] @@ -224,7 +224,7 @@ pub trait TransactionPool: Send + Sync + Clone { max: usize, ) -> Vec>>; - /// Returns converted [PooledTransactionsElement] for the given transaction hashes. + /// Returns converted [PooledTransaction] for the given transaction hashes. /// /// This adheres to the expected behavior of /// [`GetPooledTransactions`](https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getpooledtransactions-0x09): @@ -1238,7 +1238,7 @@ impl From for EthPooledTransaction { let encoded_length = tx.encode_2718_len(); let (tx, signer) = tx.to_components(); match tx { - PooledTransactionsElement::Eip4844(tx) => { + PooledTransaction::Eip4844(tx) => { // include the blob sidecar let (tx, sig, hash) = tx.into_parts(); let (tx, blob) = tx.into_parts(); @@ -1262,7 +1262,7 @@ impl PoolTransaction for EthPooledTransaction { type Consensus = TransactionSigned; - type Pooled = PooledTransactionsElement; + type Pooled = PooledTransaction; fn clone_into_consensus(&self) -> RecoveredTx { self.transaction().clone() diff --git a/crates/transaction-pool/src/validate/eth.rs b/crates/transaction-pool/src/validate/eth.rs index a78578a322f3..53adddf93745 100644 --- a/crates/transaction-pool/src/validate/eth.rs +++ b/crates/transaction-pool/src/validate/eth.rs @@ -850,16 +850,14 @@ mod tests { use alloy_eips::eip2718::Decodable2718; use alloy_primitives::{hex, U256}; use reth_chainspec::MAINNET; - use reth_primitives::{ - transaction::SignedTransactionIntoRecoveredExt, PooledTransactionsElement, - }; + use reth_primitives::{transaction::SignedTransactionIntoRecoveredExt, PooledTransaction}; use reth_provider::test_utils::{ExtendedAccount, MockEthProvider}; fn get_transaction() -> EthPooledTransaction { let raw = "0x02f914950181ad84b2d05e0085117553845b830f7df88080b9143a6040608081523462000414576200133a803803806200001e8162000419565b9283398101608082820312620004145781516001600160401b03908181116200041457826200004f9185016200043f565b92602092838201519083821162000414576200006d9183016200043f565b8186015190946001600160a01b03821692909183900362000414576060015190805193808511620003145760038054956001938488811c9816801562000409575b89891014620003f3578190601f988981116200039d575b50899089831160011462000336576000926200032a575b505060001982841b1c191690841b1781555b8751918211620003145760049788548481811c9116801562000309575b89821014620002f457878111620002a9575b5087908784116001146200023e5793839491849260009562000232575b50501b92600019911b1c19161785555b6005556007805460ff60a01b19169055600880546001600160a01b0319169190911790553015620001f3575060025469d3c21bcecceda100000092838201809211620001de57506000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9160025530835282815284832084815401905584519384523093a351610e889081620004b28239f35b601190634e487b7160e01b6000525260246000fd5b90606493519262461bcd60e51b845283015260248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152fd5b0151935038806200013a565b9190601f198416928a600052848a6000209460005b8c8983831062000291575050501062000276575b50505050811b0185556200014a565b01519060f884600019921b161c191690553880808062000267565b86860151895590970196948501948893500162000253565b89600052886000208880860160051c8201928b8710620002ea575b0160051c019085905b828110620002dd5750506200011d565b60008155018590620002cd565b92508192620002c4565b60228a634e487b7160e01b6000525260246000fd5b90607f16906200010b565b634e487b7160e01b600052604160045260246000fd5b015190503880620000dc565b90869350601f19831691856000528b6000209260005b8d8282106200038657505084116200036d575b505050811b018155620000ee565b015160001983861b60f8161c191690553880806200035f565b8385015186558a979095019493840193016200034c565b90915083600052896000208980850160051c8201928c8610620003e9575b918891869594930160051c01915b828110620003d9575050620000c5565b60008155859450889101620003c9565b92508192620003bb565b634e487b7160e01b600052602260045260246000fd5b97607f1697620000ae565b600080fd5b6040519190601f01601f191682016001600160401b038111838210176200031457604052565b919080601f84011215620004145782516001600160401b038111620003145760209062000475601f8201601f1916830162000419565b92818452828287010111620004145760005b8181106200049d57508260009394955001015290565b85810183015184820184015282016200048756fe608060408181526004918236101561001657600080fd5b600092833560e01c91826306fdde0314610a1c57508163095ea7b3146109f257816318160ddd146109d35781631b4c84d2146109ac57816323b872dd14610833578163313ce5671461081757816339509351146107c357816370a082311461078c578163715018a6146107685781638124f7ac146107495781638da5cb5b1461072057816395d89b411461061d578163a457c2d714610575578163a9059cbb146104e4578163c9567bf914610120575063dd62ed3e146100d557600080fd5b3461011c578060031936011261011c57806020926100f1610b5a565b6100f9610b75565b6001600160a01b0391821683526001865283832091168252845220549051908152f35b5080fd5b905082600319360112610338576008546001600160a01b039190821633036104975760079283549160ff8360a01c1661045557737a250d5630b4cf539739df2c5dacb4c659f2488d92836bffffffffffffffffffffffff60a01b8092161786553087526020938785528388205430156104065730895260018652848920828a52865280858a205584519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925863092a38554835163c45a015560e01b815290861685828581845afa9182156103dd57849187918b946103e7575b5086516315ab88c960e31b815292839182905afa9081156103dd576044879289928c916103c0575b508b83895196879586946364e329cb60e11b8652308c870152166024850152165af19081156103b6579086918991610389575b50169060065416176006558385541660604730895288865260c4858a20548860085416928751958694859363f305d71960e01b8552308a86015260248501528d60448501528d606485015260848401524260a48401525af1801561037f579084929161034c575b50604485600654169587541691888551978894859363095ea7b360e01b855284015260001960248401525af1908115610343575061030c575b5050805460ff60a01b1916600160a01b17905580f35b81813d831161033c575b6103208183610b8b565b8101031261033857518015150361011c5738806102f6565b8280fd5b503d610316565b513d86823e3d90fd5b6060809293503d8111610378575b6103648183610b8b565b81010312610374578290386102bd565b8580fd5b503d61035a565b83513d89823e3d90fd5b6103a99150863d88116103af575b6103a18183610b8b565b810190610e33565b38610256565b503d610397565b84513d8a823e3d90fd5b6103d79150843d86116103af576103a18183610b8b565b38610223565b85513d8b823e3d90fd5b6103ff919450823d84116103af576103a18183610b8b565b92386101fb565b845162461bcd60e51b81528085018790526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b6020606492519162461bcd60e51b8352820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152fd5b608490602084519162461bcd60e51b8352820152602160248201527f4f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f6044820152603760f91b6064820152fd5b9050346103385781600319360112610338576104fe610b5a565b9060243593303303610520575b602084610519878633610bc3565b5160018152f35b600594919454808302908382041483151715610562576127109004820391821161054f5750925080602061050b565b634e487b7160e01b815260118552602490fd5b634e487b7160e01b825260118652602482fd5b9050823461061a578260031936011261061a57610590610b5a565b918360243592338152600160205281812060018060a01b03861682526020522054908282106105c9576020856105198585038733610d31565b608490602086519162461bcd60e51b8352820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152fd5b80fd5b83833461011c578160031936011261011c57805191809380549160019083821c92828516948515610716575b6020958686108114610703578589529081156106df5750600114610687575b6106838787610679828c0383610b8b565b5191829182610b11565b0390f35b81529295507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b8284106106cc57505050826106839461067992820101948680610668565b80548685018801529286019281016106ae565b60ff19168887015250505050151560051b8301019250610679826106838680610668565b634e487b7160e01b845260228352602484fd5b93607f1693610649565b50503461011c578160031936011261011c5760085490516001600160a01b039091168152602090f35b50503461011c578160031936011261011c576020906005549051908152f35b833461061a578060031936011261061a57600880546001600160a01b031916905580f35b50503461011c57602036600319011261011c5760209181906001600160a01b036107b4610b5a565b16815280845220549051908152f35b82843461061a578160031936011261061a576107dd610b5a565b338252600160209081528383206001600160a01b038316845290528282205460243581019290831061054f57602084610519858533610d31565b50503461011c578160031936011261011c576020905160128152f35b83833461011c57606036600319011261011c5761084e610b5a565b610856610b75565b6044359160018060a01b0381169485815260209560018752858220338352875285822054976000198903610893575b505050906105199291610bc3565b85891061096957811561091a5733156108cc5750948481979861051997845260018a528284203385528a52039120558594938780610885565b865162461bcd60e51b8152908101889052602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b865162461bcd60e51b81529081018890526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b865162461bcd60e51b8152908101889052601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b50503461011c578160031936011261011c5760209060ff60075460a01c1690519015158152f35b50503461011c578160031936011261011c576020906002549051908152f35b50503461011c578060031936011261011c57602090610519610a12610b5a565b6024359033610d31565b92915034610b0d5783600319360112610b0d57600354600181811c9186908281168015610b03575b6020958686108214610af05750848852908115610ace5750600114610a75575b6106838686610679828b0383610b8b565b929550600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b828410610abb575050508261068394610679928201019438610a64565b8054868501880152928601928101610a9e565b60ff191687860152505050151560051b83010192506106798261068338610a64565b634e487b7160e01b845260229052602483fd5b93607f1693610a44565b8380fd5b6020808252825181830181905290939260005b828110610b4657505060409293506000838284010152601f8019910116010190565b818101860151848201604001528501610b24565b600435906001600160a01b0382168203610b7057565b600080fd5b602435906001600160a01b0382168203610b7057565b90601f8019910116810190811067ffffffffffffffff821117610bad57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03908116918215610cde5716918215610c8d57600082815280602052604081205491808310610c3957604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b03908116918215610de25716918215610d925760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b90816020910312610b7057516001600160a01b0381168103610b70579056fea2646970667358221220285c200b3978b10818ff576bb83f2dc4a2a7c98dfb6a36ea01170de792aa652764736f6c63430008140033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000d3fd4f95820a9aa848ce716d6c200eaefb9a2e4900000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000003543131000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035431310000000000000000000000000000000000000000000000000000000000c001a04e551c75810ffdfe6caff57da9f5a8732449f42f0f4c57f935b05250a76db3b6a046cd47e6d01914270c1ec0d9ac7fae7dfb240ec9a8b6ec7898c4d6aa174388f2"; let data = hex::decode(raw).unwrap(); - let tx = PooledTransactionsElement::decode_2718(&mut data.as_ref()).unwrap(); + let tx = PooledTransaction::decode_2718(&mut data.as_ref()).unwrap(); tx.try_into_ecrecovered().unwrap().into() }