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§
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<H, B>(
&self,
update: CanonicalStateUpdate<'_, H, B>,
)where
H: BlockHeader,
B: BlockBody,
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.
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.
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.