Note

If you are new to the blockchain technology, taking our Introduction to Blockchain Technology self-paced course is highly recommended. Also, for a comprehensive coverage of blockchain development in Ethereum or mastering Solidity programming, taking our below self paced courses is highly recommended:

Recap

In our previous article (Review of Ethereum Networking Options), we discussed Ethereum Networking Options.

In this article, we learn what Ethereum Transaction Pool Options are and how they work.

Transaction pool options

Like mining, transaction is a key concept in Ethereum. We discussed how transactions are processed in blockchain in our first article series, blockchain and Cryptocurrency, and how Ethereum processes transactions in our second article series, Ethereum Architecture and Ecosystem. At a high level, once submitted, transactions are broadcasted to the blockchain network and queued in the transaction pool at each node. The miners process transactions and add the blocks to the blockchain. In Ethereum, transactions are processed in an Ethereum Virtual Machine(EVM), and each computation step has a cost in gas associated with it. The sender who’s creating a transaction sets both a gas limit and price per gas unit, which together becomes the price in ether that is paid. The winning miner gets rewarded with ethers and collects the transaction fee.

 

One-to-One Live Blockchain Classes

Coding Bootcamps school offers One-to-One Live Blockchain Classes for Beginners.

 

Within the transaction pool at the miner node, transactions are sorted based on gas price. A transaction with a higher price will naturally be completed sooner. But a transaction with a low gas price won’t stay in a pool forever in a pending state. Different Ethereum client implementations may behave slightly differently. In geth, the network operators can define how the transaction pool works via transaction pool command-line options when starting up the client. The following is a list of the parameters it can set up:

  • txpool.nolocals disables price exemptions for locally submitted transactions. txpool.journal defines a disk journal for a local transaction to survive node restarts. The default is transactions.rlp.
  • txpool.rejournal defines the time interval to regenerate the local transaction journal, by default; it is set to 1 hour.
  • txpool.pricelimit defines the minimal gas price limit to enforce for acceptance into the pool; by default, it is set to 1.
  • txpool.pricebump defines the price bump percentage to replace an already existing transaction; by default, it is set to 10.
  • txpool.accountslots specifies the minimum number of executable transaction slots guaranteed per account; by default, it is set to 16. txpool.globalslots specifies maximum number of executable transaction slots for all accounts; by default, it is 4,096.
  • txpool.accountqueue specifies the maximum number of non-executable transaction slots permitted per account; by default, it is 64. txpool.globalqueue specifies the maximum number of non-executable transaction slots for all accounts; by default, it is set as 1,024. txpool.lifetime specifies the maximum amount of time non-executable transactions are queued; by default, it is 3 hours.

For example, a node might set a price limit so that it doesn’t accept the transactions
with the –txpool.pricelimit flag. The default value is 1, meaning the miner node will only accept the transaction to the pool if it meets the price of 1. Don’t confuse this price limit with –miner.gasprice (–gasprice is the depreciated version). Furthermore, — miner.gasprice is used in mining. If –txpool.pricelimit is set in the first place, and mining is enabled later, –txpool.pricelimit will be overwritten. The pool will only accept a transaction that is minable.

Every node can use the –txpool.lifetime and –txpool.globalqueue flags to drop the transactions. Furthermore, –txpool.lifetime 24h0m0s will queue non-executable transactions up to 24 hours; the default value is 3h0m0s. In addition to this, — txpool.globalqueue 1000 will open 1,000 slots for non-executable transactions, and start to drop the 1001st transaction that is pending. The default value is 1,024. If you have decided to pay more for gas for transactions that have already been sent, you can still bump up the price using –txpool.pricebump. Use the same nonce when the transaction is resubmitted. By the time this new transaction is received, it will overwrite the old one.

 

Next Article

In our next and final series, we cover the following 10 articles:

 

This article is written in collaboration with Brian Wu who is a leading author of “Learn Ethereum: Build your own decentralized applications with Ethereum and smart contracts” book. He has written 7 books on blockchain development.

Resources

Free Webinars on Blockchain

Here is the list of our free webinars that are highly recommended:

 

Free Courses

Here is the list of our 10 free self-paced courses that are highly recommended:

 

Self-Paced Blockchain Courses

If you like to learn more about Hyperledger Fabric, Hyperledger Sawtooth, Ethereum or Corda, taking the following self-paced classes is highly recommended:

  1. Intro to Blockchain Technology
  2. Blockchain Management in Hyperledger for System Admins
  3. Hyperledger Fabric for Developers
  4. Intro to Blockchain Cybersecurity
  5. Learn Solidity Programming by Examples
  6. Introduction to Ethereum Blockchain Development
  7. Learn Blockchain Dev with Corda R3
  8. Intro to Hyperledger Sawtooth for System Admins

 

Live Blockchain Courses

If you want to master Hyperledger Fabric, Ethereum or Corda, taking the following live classes is highly recommended:

 

Articles and Tutorials on Blockchain Technology

If you like to learn more about blockchain technology and how it works, reading the following articles is highly recommended:

 

Articles and Tutorials on Ethereum and Solidity

If you like to learn more about blockchain development in Ethereum with Solidity, reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on Hyperledger Family

If you like to learn more about blockchain development with Hyperledger, reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on R3 Corda

If you like to learn more about blockchain development on Corda , reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on Other Blockchain Platforms

If you like to learn more about blockchain development in other platforms, reading the following articles and tutorials is highly recommended: