pub trait TransactionPoolExt: TransactionPool {
// Required methods
fn set_block_info(&self, info: BlockInfo);
fn on_canonical_state_change(&self, update: CanonicalStateUpdate<'_>);
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§
sourcefn set_block_info(&self, info: BlockInfo)
fn set_block_info(&self, info: BlockInfo)
Sets the current block info for the pool.
sourcefn on_canonical_state_change(&self, update: CanonicalStateUpdate<'_>)
fn on_canonical_state_change(&self, update: CanonicalStateUpdate<'_>)
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.
sourcefn update_accounts(&self, accounts: Vec<ChangedAccount>)
fn update_accounts(&self, accounts: Vec<ChangedAccount>)
Updates the accounts in the pool
sourcefn delete_blob(&self, tx: B256)
fn delete_blob(&self, tx: B256)
Deletes the blob sidecar for the given transaction from the blob store
sourcefn delete_blobs(&self, txs: Vec<B256>)
fn delete_blobs(&self, txs: Vec<B256>)
Deletes multiple blob sidecars from the blob store
sourcefn cleanup_blobs(&self)
fn cleanup_blobs(&self)
Maintenance function to cleanup blobs that are no longer needed.