10

Do Ethereum clients have a memory pool which keeps transactions like Bitcoin's mempool? If so, what is the name for it in Ethereum?

eth
  • 85,679
  • 53
  • 285
  • 406
Satoshi Nakanishi
  • 5,749
  • 7
  • 38
  • 57

1 Answers1

10

It's called the Transaction Pool, or TxPool in the code.

From go-ethereum - tx_pool.go, lines 35 to 62:

var (
    // Transaction Pool Errors
   ...
)

const (
    maxQueued = 64 // max limit of queued txs per address
)

...
// TxPool contains all currently known transactions. Transactions
// enter the pool when they are received from the network or submitted
// locally. They exit the pool when they are included in the blockchain.
//
// The pool separates processable transactions (which can be applied to the
// current state) and future transactions. Transactions move between those
// two states over time as they are received and processed.
type TxPool struct {
    quit         chan bool // Quiting channel
    ...

In the Go Ethereum client implementation geth, you can type the following command to display a count of transactions in your pool:

> txpool.status
{
  pending: 0,
  queued: 1
}

The pending result shows the number of transactions ready to be "executed" (included in the next mined block). The Ethereum transaction pool also has a queue to hold transactions that are not quite ready to process, e.g. when the transaction nonce is too high. See What happens when a transaction nonce is too high?.

And for comparison, here is Bitcoin's txmempool.cpp.

BokkyPooBah
  • 40,274
  • 14
  • 123
  • 193