pub struct TransactionQueue { /* private fields */ }
Expand description

Ethereum Transaction Queue

Responsible for:

  • verifying incoming transactions
  • maintaining a pool of verified transactions.
  • returning an iterator for transactions that are ready to be included in block (pending)

Implementations

Create new queue with given pool limits and initial verification options.

If latest block has different base fee than it’s parent, then transaction pool scoring needs to be updated.

Update verification options

Some parameters of verification may vary in time (like block gas limit or minimal gas price).

Sets the in-chain transaction checker for pool listener.

Import a set of transactions to the pool.

Given blockchain and state access (Client) verifies and imports transactions to the pool.

Returns all transactions in the queue without explicit ordering.

Returns all transaction hashes in the queue without explicit ordering.

Computes unordered set of pending hashes.

Since strict nonce-checking is not required, you may get some false positive future transactions as well.

Returns current pending transactions ordered by priority.

NOTE: This may return a cached version of pending transaction set. Re-computing the pending set is possible with #collect_pending method, but be aware that it’s a pretty expensive operation.

Returns current pending transactions filtered.

Different to the pending() method, this one does not cache.

Collect pending transactions.

NOTE This is re-computing the pending set and it might be expensive to do so. Prefer using cached pending set using #pending method.

t_nb 10.5.1 Culls all stalled transactions from the pool.

Returns next valid nonce for given sender or None if there are no pending transactions from that sender.

Retrieve a transaction from the pool.

Given transaction hash looks up that transaction in the pool and returns a shared pointer to it or None if it’s not present.

Remove a set of transactions from the pool.

Given an iterator of transaction hashes removes them from the pool. That method should be used if invalid transactions are detected or you want to cancel a transaction.

Clear the entire pool.

Penalize given senders.

Returns gas price of currently the worst transaction in the pool.

Returns effective priority fee gas price of currently the worst transaction in the pool. If the worst transaction has zero gas price, the minimal gas price is returned.

Returns a status of the queue.

Check if there are any local transactions in the pool.

Returns true if there are any transactions in the pool that has been marked as local.

Local transactions are the ones from accounts managed by this node and transactions submitted via local RPC (eth_sendRawTransaction)

Returns status of recently seen local transactions.

Add a callback to be notified about all transactions entering the pool.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.