Skip to content

Add TransactionPoolExt::filter_pooled_txs(Fn(&) -> bool) #19919

@mattsse

Description

@mattsse

Describe the feature

this is intended as a cheaper variant for

/// Returns the _full_ transaction objects all transactions in the pool that are allowed to be
/// propagated.
///
/// 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
fn pooled_transactions(&self) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>>;

that uses a predicate to also filter txs

we should add this to this trait:

pub trait TransactionPoolExt: TransactionPool {

for example we can improve this:

for tx in &pool.pooled_transactions() {

TODO

  • add and impl fn
  • update in maintain_transaction_pool_conditional

Additional context

No response

Metadata

Metadata

Labels

A-sdkRelated to reth's use as a libraryC-enhancementNew feature or requestD-good-first-issueNice and easy! A great choice to get started

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions