Trait reth_transaction_pool::BestTransactions

source ·
pub trait BestTransactions: Iterator + Send {
    // Required methods
    fn mark_invalid(&mut self, transaction: &Self::Item);
    fn no_updates(&mut self);
    fn skip_blobs(&mut self);
    fn set_skip_blobs(&mut self, skip_blobs: bool);
}
Expand description

An Iterator that only returns transactions that are ready to be executed.

This makes no assumptions about the order of the transactions, but expects that all transactions are valid (no nonce gaps.) for the tracked state of the pool.

Note: this iterator will always return the best transaction that it currently knows. There is no guarantee transactions will be returned sequentially in decreasing priority order.

Required Methods§

source

fn mark_invalid(&mut self, transaction: &Self::Item)

Mark the transaction as invalid.

Implementers must ensure all subsequent transaction don’t depend on this transaction. In other words, this must remove the given transaction and drain all transaction that depend on it.

source

fn no_updates(&mut self)

An iterator may be able to receive additional pending transactions that weren’t present it the pool when it was created.

This ensures that iterator will return the best transaction that it currently knows and not listen to pool updates.

source

fn skip_blobs(&mut self)

Skip all blob transactions.

There’s only limited blob space available in a block, once exhausted, EIP-4844 transactions can no longer be included.

If called then the iterator will no longer yield blob transactions.

Note: this will also exclude any transactions that depend on blob transactions.

source

fn set_skip_blobs(&mut self, skip_blobs: bool)

Controls whether the iterator skips blob transactions or not.

If set to true, no blob transactions will be returned.

Implementations on Foreign Types§

source§

impl<T> BestTransactions for Box<T>
where T: BestTransactions + ?Sized,

source§

fn mark_invalid(&mut self, transaction: &Self::Item)

source§

fn no_updates(&mut self)

source§

fn skip_blobs(&mut self)

source§

fn set_skip_blobs(&mut self, skip_blobs: bool)

source§

impl<T> BestTransactions for Empty<T>

A no-op implementation that yields no transactions.

source§

fn mark_invalid(&mut self, _tx: &T)

source§

fn no_updates(&mut self)

source§

fn skip_blobs(&mut self)

source§

fn set_skip_blobs(&mut self, _skip_blobs: bool)

Implementors§