Transactions submitted to a network through an EVM node can have one of the two following statuses before they are propagated to the network and included in a block:
- Pending
- Queued
Pending
Pending are the transactions in the transaction pool that are ready to be included in a block.
Queued
Queued are the transactions waiting to become the pending transactions.
Each transaction has an account nonce (not to be confused with the block nonce). Every time an account does a transaction, the account nonce of the transaction is incremented by 1.
The transactions created with the account nonce in sequence go directly in the pool of pending transactions and are eventually included in a block.
The transactions created with the account nonce not in sequence get the status queued and remain queued until all transactions with the account nonce in sequence are created.
Example
Account 0x123... creates a transaction for the first time. The transaction gets the account nonce 0. The transaction goes directly into the pending pool and is eventually processed.
A subsequent transaction from account 0x123... is automatically incremented by 1 and gets the account nonce 1. The transaction goes directly into the pending pool and is eventually processed.
If account 0x123... creates a third transaction and manually sets the transaction's account nonce to 3, the transaction will get the status queued because there is no transaction with the account nonce 2. The queued transaction will not be propagated to the network until there is a transaction with the account nonce in sequence.
Once account 0x123... creates a transaction with the account nonce 2, both the transactions with the account nonce 2 and account nonce 3 will move to the status pending and will be included in a block.
TL;DR
Pending transactions are those that have been submitted to the network but are not yet mined. They are waiting to be included in a block.
Queued transactions are those that are not yet broadcasted to the network, usually due to nonce gaps. They reside in the local memory pool of the node until previous transactions are confirmed. Once the nonce gap is resolved, these transactions can eventually become pending transactions.
If you have any questions, feel free to contact Chainstack support by emailing support@chainstack.com or by submitting this form.
Comments
0 comments
Article is closed for comments.