reth_transaction_pool

Trait TransactionPool

Source
pub trait TransactionPool:
    Send
    + Sync
    + Clone {
    type Transaction: EthPoolTransaction;

Show 57 methods // Required methods fn pool_size(&self) -> PoolSize; fn block_info(&self) -> BlockInfo; fn add_transaction_and_subscribe( &self, origin: TransactionOrigin, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TransactionEvents>> + Send; fn add_transaction( &self, origin: TransactionOrigin, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TxHash>> + Send; fn add_transactions( &self, origin: TransactionOrigin, transactions: Vec<Self::Transaction>, ) -> impl Future<Output = Vec<PoolResult<TxHash>>> + Send; fn transaction_event_listener( &self, tx_hash: TxHash, ) -> Option<TransactionEvents>; fn all_transactions_event_listener( &self, ) -> AllTransactionsEvents<Self::Transaction>; fn pending_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<TxHash>; fn blob_transaction_sidecars_listener(&self) -> Receiver<NewBlobSidecar>; fn new_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<NewTransactionEvent<Self::Transaction>>; fn pooled_transaction_hashes(&self) -> Vec<TxHash>; fn pooled_transaction_hashes_max(&self, max: usize) -> Vec<TxHash>; fn pooled_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn pooled_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn get_pooled_transaction_elements( &self, tx_hashes: Vec<TxHash>, limit: GetPooledTransactionLimit, ) -> Vec<<Self::Transaction as PoolTransaction>::Pooled>; fn get_pooled_transaction_element( &self, tx_hash: TxHash, ) -> Option<RecoveredTx<<Self::Transaction as PoolTransaction>::Pooled>>; fn best_transactions( &self, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<Self::Transaction>>>>; fn best_transactions_with_attributes( &self, best_transactions_attributes: BestTransactionsAttributes, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<Self::Transaction>>>>; fn pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn pending_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn queued_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn all_transactions(&self) -> AllPoolTransactions<Self::Transaction>; fn remove_transactions( &self, hashes: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn remove_transactions_and_descendants( &self, hashes: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn remove_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn retain_unknown<A>(&self, announcement: &mut A) where A: HandleMempoolData; fn get( &self, tx_hash: &TxHash, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>; fn get_all( &self, txs: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn on_propagated(&self, txs: PropagatedTransactions); fn get_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn get_pending_transactions_with_predicate( &self, predicate: impl FnMut(&ValidPoolTransaction<Self::Transaction>) -> bool, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn get_pending_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn get_queued_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn get_highest_transaction_by_sender( &self, sender: Address, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>; fn get_highest_consecutive_transaction_by_sender( &self, sender: Address, on_chain_nonce: u64, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>; fn get_transaction_by_sender_and_nonce( &self, sender: Address, nonce: u64, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>; fn get_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn get_pending_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>; fn unique_senders(&self) -> HashSet<Address>; fn get_blob( &self, tx_hash: TxHash, ) -> Result<Option<Arc<BlobTransactionSidecar>>, BlobStoreError>; fn get_all_blobs( &self, tx_hashes: Vec<TxHash>, ) -> Result<Vec<(TxHash, Arc<BlobTransactionSidecar>)>, BlobStoreError>; fn get_all_blobs_exact( &self, tx_hashes: Vec<TxHash>, ) -> Result<Vec<Arc<BlobTransactionSidecar>>, BlobStoreError>; fn get_blobs_for_versioned_hashes( &self, versioned_hashes: &[B256], ) -> Result<Vec<Option<BlobAndProofV1>>, BlobStoreError>; // Provided methods fn add_external_transaction( &self, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TxHash>> + Send { ... } fn add_external_transactions( &self, transactions: Vec<Self::Transaction>, ) -> impl Future<Output = Vec<PoolResult<TxHash>>> + Send { ... } fn pending_transactions_listener(&self) -> Receiver<TxHash> { ... } fn new_transactions_listener( &self, ) -> Receiver<NewTransactionEvent<Self::Transaction>> { ... } fn new_pending_pool_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction> { ... } fn new_basefee_pool_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction> { ... } fn new_queued_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction> { ... } fn contains(&self, tx_hash: &TxHash) -> bool { ... } fn get_local_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>> { ... } fn get_private_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>> { ... } fn get_external_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>> { ... } fn get_local_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>> { ... } fn get_private_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>> { ... } fn get_external_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>> { ... }
}
Expand description

General purpose abstraction of a transaction-pool.

This is intended to be used by API-consumers such as RPC that need inject new incoming, unverified transactions. And by block production that needs to get transactions to execute in a new block.

Note: This requires Clone for convenience, since it is assumed that this will be implemented for a wrapped Arc type, see also Pool.

Required Associated Types§

Source

type Transaction: EthPoolTransaction

The transaction type of the pool

Required Methods§

Source

fn pool_size(&self) -> PoolSize

Returns stats about the pool and all sub-pools.

Source

fn block_info(&self) -> BlockInfo

Returns the block the pool is currently tracking.

This tracks the block that the pool has last seen.

Source

fn add_transaction_and_subscribe( &self, origin: TransactionOrigin, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TransactionEvents>> + Send

Adds an unvalidated transaction into the pool and subscribe to state changes.

This is the same as TransactionPool::add_transaction but returns an event stream for the given transaction.

Consumer: Custom

Source

fn add_transaction( &self, origin: TransactionOrigin, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TxHash>> + Send

Adds an unvalidated transaction into the pool.

Consumer: RPC

Source

fn add_transactions( &self, origin: TransactionOrigin, transactions: Vec<Self::Transaction>, ) -> impl Future<Output = Vec<PoolResult<TxHash>>> + Send

Adds the given unvalidated transaction into the pool.

Returns a list of results.

Consumer: RPC

Source

fn transaction_event_listener( &self, tx_hash: TxHash, ) -> Option<TransactionEvents>

Returns a new transaction change event stream for the given transaction.

Returns None if the transaction is not in the pool.

Source

fn all_transactions_event_listener( &self, ) -> AllTransactionsEvents<Self::Transaction>

Returns a new transaction change event stream for all transactions in the pool.

Source

fn pending_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<TxHash>

Returns a new [Receiver] that yields transactions hashes for new pending transactions inserted into the pending pool depending on the given TransactionListenerKind argument.

Source

fn blob_transaction_sidecars_listener(&self) -> Receiver<NewBlobSidecar>

Returns a new [Receiver] that yields blob “sidecars” (blobs w/ assoc. kzg commitments/proofs) for eip-4844 transactions inserted into the pool

Source

fn new_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<NewTransactionEvent<Self::Transaction>>

Returns a new stream that yields new valid transactions added to the pool depending on the given TransactionListenerKind argument.

Source

fn pooled_transaction_hashes(&self) -> Vec<TxHash>

Returns the hashes of all transactions in the pool.

Note: This returns a Vec but should guarantee that all hashes are unique.

Consumer: P2P

Source

fn pooled_transaction_hashes_max(&self, max: usize) -> Vec<TxHash>

Returns only the first max hashes of transactions in the pool.

Consumer: P2P

Source

fn pooled_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns the full transaction objects all transactions in the pool.

This is intended to be used by the network for the initial exchange of pooled transaction hashes

Note: This returns a Vec but should guarantee that all transactions are unique.

Caution: In case of blob transactions, this does not include the sidecar.

Consumer: P2P

Source

fn pooled_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns only the first max transactions in the pool.

Consumer: P2P

Source

fn get_pooled_transaction_elements( &self, tx_hashes: Vec<TxHash>, limit: GetPooledTransactionLimit, ) -> Vec<<Self::Transaction as PoolTransaction>::Pooled>

Returns converted [PooledTransaction] for the given transaction hashes.

This adheres to the expected behavior of GetPooledTransactions:

The transactions must be in same order as in the request, but it is OK to skip transactions which are not available.

If the transaction is a blob transaction, the sidecar will be included.

Consumer: P2P

Source

fn get_pooled_transaction_element( &self, tx_hash: TxHash, ) -> Option<RecoveredTx<<Self::Transaction as PoolTransaction>::Pooled>>

Returns the pooled transaction variant for the given transaction hash.

This adheres to the expected behavior of GetPooledTransactions:

If the transaction is a blob transaction, the sidecar will be included.

It is expected that this variant represents the valid p2p format for full transactions. E.g. for EIP-4844 transactions this is the consensus transaction format with the blob sidecar.

Consumer: P2P

Source

fn best_transactions( &self, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<Self::Transaction>>>>

Returns an iterator that yields transactions that are ready for block production.

Consumer: Block production

Source

fn best_transactions_with_attributes( &self, best_transactions_attributes: BestTransactionsAttributes, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<Self::Transaction>>>>

Returns an iterator that yields transactions that are ready for block production with the given base fee and optional blob fee attributes.

Consumer: Block production

Source

fn pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all transactions that can be included in the next block.

This is primarily used for the txpool_ RPC namespace: https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-txpool which distinguishes between pending and queued transactions, where pending are transactions ready for inclusion in the next block and queued are transactions that are ready for inclusion in future blocks.

Consumer: RPC

Source

fn pending_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns first max transactions that can be included in the next block. See https://github.com/paradigmxyz/reth/issues/12767#issuecomment-2493223579

Consumer: Block production

Source

fn queued_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all transactions that can be included in future blocks.

This and Self::pending_transactions are mutually exclusive.

Consumer: RPC

Source

fn all_transactions(&self) -> AllPoolTransactions<Self::Transaction>

Returns all transactions that are currently in the pool grouped by whether they are ready for inclusion in the next block or not.

This is primarily used for the txpool_ namespace: https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-txpool

Consumer: RPC

Source

fn remove_transactions( &self, hashes: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Removes all transactions corresponding to the given hashes.

Consumer: Utility

Source

fn remove_transactions_and_descendants( &self, hashes: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Removes all transactions corresponding to the given hashes.

Also removes all dependent transactions.

Consumer: Utility

Source

fn remove_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Removes all transactions from the given sender

Consumer: Utility

Source

fn retain_unknown<A>(&self, announcement: &mut A)
where A: HandleMempoolData,

Retains only those hashes that are unknown to the pool. In other words, removes all transactions from the given set that are currently present in the pool. Returns hashes already known to the pool.

Consumer: P2P

Source

fn get( &self, tx_hash: &TxHash, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns the transaction for the given hash.

Source

fn get_all( &self, txs: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all transactions objects for the given hashes.

Caution: This in case of blob transactions, this does not include the sidecar.

Source

fn on_propagated(&self, txs: PropagatedTransactions)

Notify the pool about transactions that are propagated to peers.

Consumer: P2P

Source

fn get_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all transactions sent by a given user

Source

fn get_pending_transactions_with_predicate( &self, predicate: impl FnMut(&ValidPoolTransaction<Self::Transaction>) -> bool, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all pending transactions filtered by predicate

Source

fn get_pending_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all pending transactions sent by a given user

Source

fn get_queued_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all queued transactions sent by a given user

Source

fn get_highest_transaction_by_sender( &self, sender: Address, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns the highest transaction sent by a given user

Source

fn get_highest_consecutive_transaction_by_sender( &self, sender: Address, on_chain_nonce: u64, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns the transaction with the highest nonce that is executable given the on chain nonce. In other words the highest non nonce gapped transaction.

Note: The next pending pooled transaction must have the on chain nonce.

For example, for a given on chain nonce of 5, the next transaction must have that nonce. If the pool contains txs [5,6,7] this returns tx 7. If the pool contains txs [6,7] this returns None because the next valid nonce (5) is missing, which means txs [6,7] are nonce gapped.

Source

fn get_transaction_by_sender_and_nonce( &self, sender: Address, nonce: u64, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns a transaction sent by a given user and a nonce

Source

fn get_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all transactions that where submitted with the given TransactionOrigin

Source

fn get_pending_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all pending transactions filtered by TransactionOrigin

Source

fn unique_senders(&self) -> HashSet<Address>

Returns a set of all senders of transactions in the pool

Source

fn get_blob( &self, tx_hash: TxHash, ) -> Result<Option<Arc<BlobTransactionSidecar>>, BlobStoreError>

Returns the [BlobTransactionSidecar] for the given transaction hash if it exists in the blob store.

Source

fn get_all_blobs( &self, tx_hashes: Vec<TxHash>, ) -> Result<Vec<(TxHash, Arc<BlobTransactionSidecar>)>, BlobStoreError>

Returns all [BlobTransactionSidecar] for the given transaction hashes if they exists in the blob store.

This only returns the blobs that were found in the store. If there’s no blob it will not be returned.

Source

fn get_all_blobs_exact( &self, tx_hashes: Vec<TxHash>, ) -> Result<Vec<Arc<BlobTransactionSidecar>>, BlobStoreError>

Returns the exact [BlobTransactionSidecar] for the given transaction hashes in the order they were requested.

Returns an error if any of the blobs are not found in the blob store.

Source

fn get_blobs_for_versioned_hashes( &self, versioned_hashes: &[B256], ) -> Result<Vec<Option<BlobAndProofV1>>, BlobStoreError>

Return the [BlobTransactionSidecar]s for a list of blob versioned hashes.

Provided Methods§

Source

fn add_external_transaction( &self, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TxHash>> + Send

Imports an external transaction.

This is intended to be used by the network to insert incoming transactions received over the p2p network.

Consumer: P2P

Source

fn add_external_transactions( &self, transactions: Vec<Self::Transaction>, ) -> impl Future<Output = Vec<PoolResult<TxHash>>> + Send

Imports all external transactions

Consumer: Utility

Source

fn pending_transactions_listener(&self) -> Receiver<TxHash>

Returns a new Stream that yields transactions hashes for new pending transactions inserted into the pool that are allowed to be propagated.

Note: This is intended for networking and will only yield transactions that are allowed to be propagated over the network, see also TransactionListenerKind.

Consumer: RPC/P2P

Source

fn new_transactions_listener( &self, ) -> Receiver<NewTransactionEvent<Self::Transaction>>

Returns a new stream that yields new valid transactions added to the pool.

Source

fn new_pending_pool_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction>

Returns a new Stream that yields new transactions added to the pending sub-pool.

This is a convenience wrapper around Self::new_transactions_listener that filters for SubPool::Pending.

Source

fn new_basefee_pool_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction>

Returns a new Stream that yields new transactions added to the basefee sub-pool.

This is a convenience wrapper around Self::new_transactions_listener that filters for SubPool::BaseFee.

Source

fn new_queued_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction>

Returns a new Stream that yields new transactions added to the queued-pool.

This is a convenience wrapper around Self::new_transactions_listener that filters for SubPool::Queued.

Source

fn contains(&self, tx_hash: &TxHash) -> bool

Returns if the transaction for the given hash is already included in this pool.

Source

fn get_local_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all transactions that where submitted as TransactionOrigin::Local

Source

fn get_private_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all transactions that where submitted as TransactionOrigin::Private

Source

fn get_external_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all transactions that where submitted as TransactionOrigin::External

Source

fn get_local_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all pending transactions that where submitted as TransactionOrigin::Local

Source

fn get_private_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all pending transactions that where submitted as TransactionOrigin::Private

Source

fn get_external_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Returns all pending transactions that where submitted as TransactionOrigin::External

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + TransactionPool + ?Sized> TransactionPool for &'a T
where &'a T: Send + Sync + Clone,

Source§

type Transaction = <T as TransactionPool>::Transaction

Source§

fn pool_size(&self) -> PoolSize

Source§

fn block_info(&self) -> BlockInfo

Source§

fn add_external_transaction( &self, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TxHash>> + Send

Source§

fn add_external_transactions( &self, transactions: Vec<Self::Transaction>, ) -> impl Future<Output = Vec<PoolResult<TxHash>>> + Send

Source§

fn add_transaction_and_subscribe( &self, origin: TransactionOrigin, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TransactionEvents>> + Send

Source§

fn add_transaction( &self, origin: TransactionOrigin, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TxHash>> + Send

Source§

fn add_transactions( &self, origin: TransactionOrigin, transactions: Vec<Self::Transaction>, ) -> impl Future<Output = Vec<PoolResult<TxHash>>> + Send

Source§

fn transaction_event_listener( &self, tx_hash: TxHash, ) -> Option<TransactionEvents>

Source§

fn all_transactions_event_listener( &self, ) -> AllTransactionsEvents<Self::Transaction>

Source§

fn pending_transactions_listener(&self) -> Receiver<TxHash>

Source§

fn pending_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<TxHash>

Source§

fn new_transactions_listener( &self, ) -> Receiver<NewTransactionEvent<Self::Transaction>>

Source§

fn blob_transaction_sidecars_listener(&self) -> Receiver<NewBlobSidecar>

Source§

fn new_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<NewTransactionEvent<Self::Transaction>>

Source§

fn new_pending_pool_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction>

Source§

fn new_basefee_pool_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction>

Source§

fn new_queued_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction>

Source§

fn pooled_transaction_hashes(&self) -> Vec<TxHash>

Source§

fn pooled_transaction_hashes_max(&self, max: usize) -> Vec<TxHash>

Source§

fn pooled_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn pooled_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_pooled_transaction_elements( &self, tx_hashes: Vec<TxHash>, limit: GetPooledTransactionLimit, ) -> Vec<<Self::Transaction as PoolTransaction>::Pooled>

Source§

fn get_pooled_transaction_element( &self, tx_hash: TxHash, ) -> Option<RecoveredTx<<Self::Transaction as PoolTransaction>::Pooled>>

Source§

fn best_transactions( &self, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<Self::Transaction>>>>

Source§

fn best_transactions_with_attributes( &self, best_transactions_attributes: BestTransactionsAttributes, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<Self::Transaction>>>>

Source§

fn pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn pending_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn queued_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn all_transactions(&self) -> AllPoolTransactions<Self::Transaction>

Source§

fn remove_transactions( &self, hashes: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn remove_transactions_and_descendants( &self, hashes: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn remove_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn retain_unknown<A>(&self, announcement: &mut A)
where A: HandleMempoolData,

Source§

fn contains(&self, tx_hash: &TxHash) -> bool

Source§

fn get( &self, tx_hash: &TxHash, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_all( &self, txs: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn on_propagated(&self, txs: PropagatedTransactions)

Source§

fn get_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_pending_transactions_with_predicate( &self, predicate: impl FnMut(&ValidPoolTransaction<Self::Transaction>) -> bool, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_pending_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_queued_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_highest_transaction_by_sender( &self, sender: Address, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_highest_consecutive_transaction_by_sender( &self, sender: Address, on_chain_nonce: u64, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_transaction_by_sender_and_nonce( &self, sender: Address, nonce: u64, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_pending_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_local_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_private_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_external_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_local_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_private_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_external_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn unique_senders(&self) -> HashSet<Address>

Source§

fn get_blob( &self, tx_hash: TxHash, ) -> Result<Option<Arc<BlobTransactionSidecar>>, BlobStoreError>

Source§

fn get_all_blobs( &self, tx_hashes: Vec<TxHash>, ) -> Result<Vec<(TxHash, Arc<BlobTransactionSidecar>)>, BlobStoreError>

Source§

fn get_all_blobs_exact( &self, tx_hashes: Vec<TxHash>, ) -> Result<Vec<Arc<BlobTransactionSidecar>>, BlobStoreError>

Source§

fn get_blobs_for_versioned_hashes( &self, versioned_hashes: &[B256], ) -> Result<Vec<Option<BlobAndProofV1>>, BlobStoreError>

Source§

impl<T: TransactionPool + ?Sized> TransactionPool for Arc<T>
where Arc<T>: Send + Sync + Clone,

Source§

type Transaction = <T as TransactionPool>::Transaction

Source§

fn pool_size(&self) -> PoolSize

Source§

fn block_info(&self) -> BlockInfo

Source§

fn add_external_transaction( &self, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TxHash>> + Send

Source§

fn add_external_transactions( &self, transactions: Vec<Self::Transaction>, ) -> impl Future<Output = Vec<PoolResult<TxHash>>> + Send

Source§

fn add_transaction_and_subscribe( &self, origin: TransactionOrigin, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TransactionEvents>> + Send

Source§

fn add_transaction( &self, origin: TransactionOrigin, transaction: Self::Transaction, ) -> impl Future<Output = PoolResult<TxHash>> + Send

Source§

fn add_transactions( &self, origin: TransactionOrigin, transactions: Vec<Self::Transaction>, ) -> impl Future<Output = Vec<PoolResult<TxHash>>> + Send

Source§

fn transaction_event_listener( &self, tx_hash: TxHash, ) -> Option<TransactionEvents>

Source§

fn all_transactions_event_listener( &self, ) -> AllTransactionsEvents<Self::Transaction>

Source§

fn pending_transactions_listener(&self) -> Receiver<TxHash>

Source§

fn pending_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<TxHash>

Source§

fn new_transactions_listener( &self, ) -> Receiver<NewTransactionEvent<Self::Transaction>>

Source§

fn blob_transaction_sidecars_listener(&self) -> Receiver<NewBlobSidecar>

Source§

fn new_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<NewTransactionEvent<Self::Transaction>>

Source§

fn new_pending_pool_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction>

Source§

fn new_basefee_pool_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction>

Source§

fn new_queued_transactions_listener( &self, ) -> NewSubpoolTransactionStream<Self::Transaction>

Source§

fn pooled_transaction_hashes(&self) -> Vec<TxHash>

Source§

fn pooled_transaction_hashes_max(&self, max: usize) -> Vec<TxHash>

Source§

fn pooled_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn pooled_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_pooled_transaction_elements( &self, tx_hashes: Vec<TxHash>, limit: GetPooledTransactionLimit, ) -> Vec<<Self::Transaction as PoolTransaction>::Pooled>

Source§

fn get_pooled_transaction_element( &self, tx_hash: TxHash, ) -> Option<RecoveredTx<<Self::Transaction as PoolTransaction>::Pooled>>

Source§

fn best_transactions( &self, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<Self::Transaction>>>>

Source§

fn best_transactions_with_attributes( &self, best_transactions_attributes: BestTransactionsAttributes, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<Self::Transaction>>>>

Source§

fn pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn pending_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn queued_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn all_transactions(&self) -> AllPoolTransactions<Self::Transaction>

Source§

fn remove_transactions( &self, hashes: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn remove_transactions_and_descendants( &self, hashes: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn remove_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn retain_unknown<A>(&self, announcement: &mut A)
where A: HandleMempoolData,

Source§

fn contains(&self, tx_hash: &TxHash) -> bool

Source§

fn get( &self, tx_hash: &TxHash, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_all( &self, txs: Vec<TxHash>, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn on_propagated(&self, txs: PropagatedTransactions)

Source§

fn get_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_pending_transactions_with_predicate( &self, predicate: impl FnMut(&ValidPoolTransaction<Self::Transaction>) -> bool, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_pending_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_queued_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_highest_transaction_by_sender( &self, sender: Address, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_highest_consecutive_transaction_by_sender( &self, sender: Address, on_chain_nonce: u64, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_transaction_by_sender_and_nonce( &self, sender: Address, nonce: u64, ) -> Option<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_pending_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_local_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_private_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_external_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_local_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_private_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn get_external_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>

Source§

fn unique_senders(&self) -> HashSet<Address>

Source§

fn get_blob( &self, tx_hash: TxHash, ) -> Result<Option<Arc<BlobTransactionSidecar>>, BlobStoreError>

Source§

fn get_all_blobs( &self, tx_hashes: Vec<TxHash>, ) -> Result<Vec<(TxHash, Arc<BlobTransactionSidecar>)>, BlobStoreError>

Source§

fn get_all_blobs_exact( &self, tx_hashes: Vec<TxHash>, ) -> Result<Vec<Arc<BlobTransactionSidecar>>, BlobStoreError>

Source§

fn get_blobs_for_versioned_hashes( &self, versioned_hashes: &[B256], ) -> Result<Vec<Option<BlobAndProofV1>>, BlobStoreError>

Implementors§

Source§

impl TransactionPool for NoopTransactionPool

Source§

impl<V, T, S> TransactionPool for Pool<V, T, S>

implements the TransactionPool interface for various transaction pool API consumers.