Type Alias EthTransactionPool
pub type EthTransactionPool<Client, S> = Pool<TransactionValidationTaskExecutor<EthTransactionValidator<Client, EthPooledTransaction>>, CoinbaseTipOrdering<EthPooledTransaction>, S>;
Expand description
Type alias for default ethereum transaction pool
Aliased Type§
struct EthTransactionPool<Client, S> { /* private fields */ }
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes
Implementations
§impl<Client, S> Pool<TransactionValidationTaskExecutor<EthTransactionValidator<Client, EthPooledTransaction>>, CoinbaseTipOrdering<EthPooledTransaction>, S>where
Client: ChainSpecProvider + StateProviderFactory + Clone + 'static,
<Client as ChainSpecProvider>::ChainSpec: EthereumHardforks,
S: BlobStore,
impl<Client, S> Pool<TransactionValidationTaskExecutor<EthTransactionValidator<Client, EthPooledTransaction>>, CoinbaseTipOrdering<EthPooledTransaction>, S>where
Client: ChainSpecProvider + StateProviderFactory + Clone + 'static,
<Client as ChainSpecProvider>::ChainSpec: EthereumHardforks,
S: BlobStore,
pub fn eth_pool(
validator: TransactionValidationTaskExecutor<EthTransactionValidator<Client, EthPooledTransaction>>,
blob_store: S,
config: PoolConfig,
) -> Pool<TransactionValidationTaskExecutor<EthTransactionValidator<Client, EthPooledTransaction>>, CoinbaseTipOrdering<EthPooledTransaction>, S>
Available on crate feature test-utils
only.
pub fn eth_pool( validator: TransactionValidationTaskExecutor<EthTransactionValidator<Client, EthPooledTransaction>>, blob_store: S, config: PoolConfig, ) -> Pool<TransactionValidationTaskExecutor<EthTransactionValidator<Client, EthPooledTransaction>>, CoinbaseTipOrdering<EthPooledTransaction>, S>
test-utils
only.Returns a new Pool
that uses the default TransactionValidationTaskExecutor
when
validating EthPooledTransaction
s and ords via CoinbaseTipOrdering
§Example
use reth_chainspec::MAINNET;
use reth_storage_api::StateProviderFactory;
use reth_tasks::TokioTaskExecutor;
use reth_chainspec::ChainSpecProvider;
use reth_transaction_pool::{
blobstore::InMemoryBlobStore, Pool, TransactionValidationTaskExecutor,
};
use reth_chainspec::EthereumHardforks;
let blob_store = InMemoryBlobStore::default();
let pool = Pool::eth_pool(
TransactionValidationTaskExecutor::eth(
client,
blob_store.clone(),
TokioTaskExecutor::default(),
),
blob_store,
Default::default(),
);
§impl<V, T, S> Pool<V, T, S>where
V: TransactionValidator,
T: TransactionOrdering<Transaction = <V as TransactionValidator>::Transaction>,
S: BlobStore,
impl<V, T, S> Pool<V, T, S>where
V: TransactionValidator,
T: TransactionOrdering<Transaction = <V as TransactionValidator>::Transaction>,
S: BlobStore,
pub fn new(
validator: V,
ordering: T,
blob_store: S,
config: PoolConfig,
) -> Pool<V, T, S>
Available on crate feature test-utils
only.
pub fn new( validator: V, ordering: T, blob_store: S, config: PoolConfig, ) -> Pool<V, T, S>
test-utils
only.Create a new transaction pool instance.
pub fn config(&self) -> &PoolConfig
Available on crate feature test-utils
only.
pub fn config(&self) -> &PoolConfig
test-utils
only.Get the config the pool was configured with.
pub fn len(&self) -> usize
Available on crate feature test-utils
only.
pub fn len(&self) -> usize
test-utils
only.Number of transactions in the entire pool
pub fn is_exceeded(&self) -> bool
Available on crate feature test-utils
only.
pub fn is_exceeded(&self) -> bool
test-utils
only.Returns whether or not the pool is over its configured size and transaction count limits.
pub fn blob_store(&self) -> &S
Available on crate feature test-utils
only.
pub fn blob_store(&self) -> &S
test-utils
only.Returns the configured blob store.
Trait Implementations
§impl<V, T, S> Clone for Pool<V, T, S>where
T: TransactionOrdering,
impl<V, T, S> Clone for Pool<V, T, S>where
T: TransactionOrdering,
§impl<V, T, S> TransactionPool for Pool<V, T, S>where
V: TransactionValidator,
<V as TransactionValidator>::Transaction: EthPoolTransaction,
T: TransactionOrdering<Transaction = <V as TransactionValidator>::Transaction>,
S: BlobStore,
implements the TransactionPool
interface for various transaction pool API consumers.
impl<V, T, S> TransactionPool for Pool<V, T, S>where
V: TransactionValidator,
<V as TransactionValidator>::Transaction: EthPoolTransaction,
T: TransactionOrdering<Transaction = <V as TransactionValidator>::Transaction>,
S: BlobStore,
implements the TransactionPool
interface for various transaction pool API consumers.
§fn get_pending_transactions_by_origin(
&self,
origin: TransactionOrigin,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get_pending_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
Returns all pending transactions filtered by TransactionOrigin
§type Transaction = <T as TransactionOrdering>::Transaction
type Transaction = <T as TransactionOrdering>::Transaction
§fn block_info(&self) -> BlockInfo
fn block_info(&self) -> BlockInfo
§async fn add_transaction_and_subscribe(
&self,
origin: TransactionOrigin,
transaction: <Pool<V, T, S> as TransactionPool>::Transaction,
) -> Result<TransactionEvents, PoolError>
async fn add_transaction_and_subscribe( &self, origin: TransactionOrigin, transaction: <Pool<V, T, S> as TransactionPool>::Transaction, ) -> Result<TransactionEvents, PoolError>
§async fn add_transaction(
&self,
origin: TransactionOrigin,
transaction: <Pool<V, T, S> as TransactionPool>::Transaction,
) -> Result<FixedBytes<32>, PoolError>
async fn add_transaction( &self, origin: TransactionOrigin, transaction: <Pool<V, T, S> as TransactionPool>::Transaction, ) -> Result<FixedBytes<32>, PoolError>
§async fn add_transactions(
&self,
origin: TransactionOrigin,
transactions: Vec<<Pool<V, T, S> as TransactionPool>::Transaction>,
) -> Vec<Result<FixedBytes<32>, PoolError>>
async fn add_transactions( &self, origin: TransactionOrigin, transactions: Vec<<Pool<V, T, S> as TransactionPool>::Transaction>, ) -> Vec<Result<FixedBytes<32>, PoolError>>
§fn transaction_event_listener(
&self,
tx_hash: FixedBytes<32>,
) -> Option<TransactionEvents>
fn transaction_event_listener( &self, tx_hash: FixedBytes<32>, ) -> Option<TransactionEvents>
§fn all_transactions_event_listener(
&self,
) -> AllTransactionsEvents<<Pool<V, T, S> as TransactionPool>::Transaction>
fn all_transactions_event_listener( &self, ) -> AllTransactionsEvents<<Pool<V, T, S> as TransactionPool>::Transaction>
§fn pending_transactions_listener_for(
&self,
kind: TransactionListenerKind,
) -> Receiver<FixedBytes<32>>
fn pending_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<FixedBytes<32>>
§fn blob_transaction_sidecars_listener(&self) -> Receiver<NewBlobSidecar>
fn blob_transaction_sidecars_listener(&self) -> Receiver<NewBlobSidecar>
§fn new_transactions_listener_for(
&self,
kind: TransactionListenerKind,
) -> Receiver<NewTransactionEvent<<Pool<V, T, S> as TransactionPool>::Transaction>>
fn new_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<NewTransactionEvent<<Pool<V, T, S> as TransactionPool>::Transaction>>
§fn pooled_transaction_hashes(&self) -> Vec<FixedBytes<32>>
fn pooled_transaction_hashes(&self) -> Vec<FixedBytes<32>>
§fn pooled_transaction_hashes_max(&self, max: usize) -> Vec<FixedBytes<32>>
fn pooled_transaction_hashes_max(&self, max: usize) -> Vec<FixedBytes<32>>
max
hashes of transactions in the pool. Read more§fn pooled_transactions(
&self,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn pooled_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn pooled_transactions_max(
&self,
max: usize,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn pooled_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
max
transactions in the pool. Read more§fn get_pooled_transaction_elements(
&self,
tx_hashes: Vec<FixedBytes<32>>,
limit: GetPooledTransactionLimit,
) -> Vec<<<V as TransactionValidator>::Transaction as PoolTransaction>::Pooled>
fn get_pooled_transaction_elements( &self, tx_hashes: Vec<FixedBytes<32>>, limit: GetPooledTransactionLimit, ) -> Vec<<<V as TransactionValidator>::Transaction as PoolTransaction>::Pooled>
§fn get_pooled_transaction_element(
&self,
tx_hash: FixedBytes<32>,
) -> Option<Recovered<<<V as TransactionValidator>::Transaction as PoolTransaction>::Pooled>>
fn get_pooled_transaction_element( &self, tx_hash: FixedBytes<32>, ) -> Option<Recovered<<<V as TransactionValidator>::Transaction as PoolTransaction>::Pooled>>
§fn best_transactions(
&self,
) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>>
fn best_transactions( &self, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>>
§fn best_transactions_with_attributes(
&self,
best_transactions_attributes: BestTransactionsAttributes,
) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>>
fn best_transactions_with_attributes( &self, best_transactions_attributes: BestTransactionsAttributes, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>>
§fn pending_transactions(
&self,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn pending_transactions_max(
&self,
max: usize,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn pending_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
max
transactions that can be included in the next block.
See https://github.com/paradigmxyz/reth/issues/12767#issuecomment-2493223579 Read more§fn queued_transactions(
&self,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn queued_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn all_transactions(
&self,
) -> AllPoolTransactions<<Pool<V, T, S> as TransactionPool>::Transaction>
fn all_transactions( &self, ) -> AllPoolTransactions<<Pool<V, T, S> as TransactionPool>::Transaction>
§fn remove_transactions(
&self,
hashes: Vec<FixedBytes<32>>,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn remove_transactions( &self, hashes: Vec<FixedBytes<32>>, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn remove_transactions_and_descendants(
&self,
hashes: Vec<FixedBytes<32>>,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn remove_transactions_and_descendants( &self, hashes: Vec<FixedBytes<32>>, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn remove_transactions_by_sender(
&self,
sender: Address,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn remove_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn retain_unknown<A>(&self, announcement: &mut A)where
A: HandleMempoolData,
fn retain_unknown<A>(&self, announcement: &mut A)where
A: HandleMempoolData,
§fn get(
&self,
tx_hash: &FixedBytes<32>,
) -> Option<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get( &self, tx_hash: &FixedBytes<32>, ) -> Option<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn get_all(
&self,
txs: Vec<FixedBytes<32>>,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get_all( &self, txs: Vec<FixedBytes<32>>, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn on_propagated(&self, txs: PropagatedTransactions)
fn on_propagated(&self, txs: PropagatedTransactions)
§fn get_transactions_by_sender(
&self,
sender: Address,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn get_pending_transactions_with_predicate(
&self,
predicate: impl FnMut(&ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>) -> bool,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get_pending_transactions_with_predicate( &self, predicate: impl FnMut(&ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>) -> bool, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn get_pending_transactions_by_sender(
&self,
sender: Address,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get_pending_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn get_queued_transactions_by_sender(
&self,
sender: Address,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get_queued_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn get_highest_transaction_by_sender(
&self,
sender: Address,
) -> Option<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get_highest_transaction_by_sender( &self, sender: Address, ) -> Option<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn get_highest_consecutive_transaction_by_sender(
&self,
sender: Address,
on_chain_nonce: u64,
) -> Option<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get_highest_consecutive_transaction_by_sender( &self, sender: Address, on_chain_nonce: u64, ) -> Option<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn get_transaction_by_sender_and_nonce(
&self,
sender: Address,
nonce: u64,
) -> Option<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get_transaction_by_sender_and_nonce( &self, sender: Address, nonce: u64, ) -> Option<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn get_transactions_by_origin(
&self,
origin: TransactionOrigin,
) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
fn get_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<<Pool<V, T, S> as TransactionPool>::Transaction>>>
§fn unique_senders(&self) -> HashSet<Address>
fn unique_senders(&self) -> HashSet<Address>
§fn get_blob(
&self,
tx_hash: FixedBytes<32>,
) -> Result<Option<Arc<BlobTransactionSidecar>>, BlobStoreError>
fn get_blob( &self, tx_hash: FixedBytes<32>, ) -> Result<Option<Arc<BlobTransactionSidecar>>, BlobStoreError>
§fn get_all_blobs(
&self,
tx_hashes: Vec<FixedBytes<32>>,
) -> Result<Vec<(FixedBytes<32>, Arc<BlobTransactionSidecar>)>, BlobStoreError>
fn get_all_blobs( &self, tx_hashes: Vec<FixedBytes<32>>, ) -> Result<Vec<(FixedBytes<32>, Arc<BlobTransactionSidecar>)>, BlobStoreError>
§fn get_all_blobs_exact(
&self,
tx_hashes: Vec<FixedBytes<32>>,
) -> Result<Vec<Arc<BlobTransactionSidecar>>, BlobStoreError>
fn get_all_blobs_exact( &self, tx_hashes: Vec<FixedBytes<32>>, ) -> Result<Vec<Arc<BlobTransactionSidecar>>, BlobStoreError>
§fn get_blobs_for_versioned_hashes(
&self,
versioned_hashes: &[FixedBytes<32>],
) -> Result<Vec<Option<BlobAndProofV1>>, BlobStoreError>
fn get_blobs_for_versioned_hashes( &self, versioned_hashes: &[FixedBytes<32>], ) -> Result<Vec<Option<BlobAndProofV1>>, BlobStoreError>
BlobTransactionSidecar
s for a list of blob versioned hashes.