reth_transaction_pool

Trait TransactionPoolExt

Source
pub trait TransactionPoolExt: TransactionPool {
    // Required methods
    fn set_block_info(&self, info: BlockInfo);
    fn on_canonical_state_change<H, B>(
        &self,
        update: CanonicalStateUpdate<'_, H, B>,
    )
       where H: BlockHeader,
             B: BlockBody;
    fn update_accounts(&self, accounts: Vec<ChangedAccount>);
    fn delete_blob(&self, tx: B256);
    fn delete_blobs(&self, txs: Vec<B256>);
    fn cleanup_blobs(&self);
}
Expand description

Extension for TransactionPool trait that allows to set the current block info.

Required Methods§

Source

fn set_block_info(&self, info: BlockInfo)

Sets the current block info for the pool.

Source

fn on_canonical_state_change<H, B>( &self, update: CanonicalStateUpdate<'_, H, B>, )
where H: BlockHeader, B: BlockBody,

Event listener for when the pool needs to be updated.

Implementers need to update the pool accordingly:

§Fee changes

The CanonicalStateUpdate includes the base and blob fee of the pending block, which affects the dynamic fee requirement of pending transactions in the pool.

§EIP-4844 Blob transactions

Mined blob transactions need to be removed from the pool, but from the pool only. The blob sidecar must not be removed from the blob store. Only after a blob transaction is finalized, its sidecar is removed from the blob store. This ensures that in case of a reorg, the sidecar is still available.

Source

fn update_accounts(&self, accounts: Vec<ChangedAccount>)

Updates the accounts in the pool

Source

fn delete_blob(&self, tx: B256)

Deletes the blob sidecar for the given transaction from the blob store

Source

fn delete_blobs(&self, txs: Vec<B256>)

Deletes multiple blob sidecars from the blob store

Source

fn cleanup_blobs(&self)

Maintenance function to cleanup blobs that are no longer needed.

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 + TransactionPoolExt + ?Sized> TransactionPoolExt for &'a T

Source§

fn set_block_info(&self, info: BlockInfo)

Source§

fn on_canonical_state_change<H, B>( &self, update: CanonicalStateUpdate<'_, H, B>, )
where H: BlockHeader, B: BlockBody,

Source§

fn update_accounts(&self, accounts: Vec<ChangedAccount>)

Source§

fn delete_blob(&self, tx: B256)

Source§

fn delete_blobs(&self, txs: Vec<B256>)

Source§

fn cleanup_blobs(&self)

Source§

impl<T: TransactionPoolExt + ?Sized> TransactionPoolExt for Arc<T>
where Arc<T>: TransactionPool,

Source§

fn set_block_info(&self, info: BlockInfo)

Source§

fn on_canonical_state_change<H, B>( &self, update: CanonicalStateUpdate<'_, H, B>, )
where H: BlockHeader, B: BlockBody,

Source§

fn update_accounts(&self, accounts: Vec<ChangedAccount>)

Source§

fn delete_blob(&self, tx: B256)

Source§

fn delete_blobs(&self, txs: Vec<B256>)

Source§

fn cleanup_blobs(&self)

Implementors§