I have a small private network that has a proof-of-authority engine created via geth-clique using Geth Version: 1.8.3-unstable, currently there are three signer nodes and two other non-signer nodes (lets call them peer-A and peer-B). peer-A and peer-B are connected to three signer nodes.

First, I sent a transaction with very low gasPrice such as 200, on peer-A as shown below.

eth.sendTransaction({from:eth.accounts[0], to:eth.accounts[1], value: web3.toWei(0,0000, "ether"), gasPrice: 200})

Later when I sent more transactions on peer-A even with greater gasPrice, all of those transactions will remain on the pending state. As I understand submitted transactions work as FIFO queue and my upcoming transactions are stuck since the first send transaction with very low gasPrice locks others.

Example: (First peer-A and peer-B sent a Tx with low gasPrice and later their other Tx with high gasPrice stuck on their pending state.) enter image description here

I have fix this situation by cleaning my chaindata on peer-A, which also cleans all pending transactions: rm -rf private/geth, and later I send my transactions with larger gasPrice. I assume this was a very inefficient solution for networks has a large chain.

So all sent transactions are provided as FIFO queue? Why not they selected based on which has the highest gasPrice?

Please note that I have tried:

eth.resend(eth.pendingTransactions[0], web3.toWei(1000, 'gwei'))

but faced with following error:

Error: intrinsic gas too low or Error: replacement transaction underpriced error.

[Q] How could I solve this problem, how could I remove the pending transaction on the system which has a low gasPrice or reject them or update their gasPrice value and resend() them?

Github issue: https://github.com/ethereum/go-ethereum/issues/16284

up vote 2 down vote accepted

Péter Szilágyi's answer on (https://github.com/ethereum/go-ethereum/issues/16284) help me to solve the problem.

Every account and transaction in Ethereum has a nonce. At any given time, only the transaction with the correct nonce can be executed. If you submit a transaction with a low gas price, that will block all subsequent transactions since they are not executable nonce wise, only the next nonce is executable.

You don't need to clear your chain data folder, pending transactions are not stored there. There's a transactions.rlp file which saves the local transactions.

I was using eth.resend() with two parameters.

=> Adding gasLimit as third parameter solved it, example:

eth.resend(eth.pendingTransactions[0], web3.toWei(20, 'gwei'), 2000000)

=> Or stop the node, transactions.rlp (rm ~/examplePOA/private/geth/transactions.rlp) and restart.

An easier solution (comparing to reseting the chain) is to send a replacement transaction that

  • has the same account nonce (more info here) as the pending low gas transaction
  • offers higher gas price

For a efficient algorithm regarding the more generic issue of nonce singleton, see this question and its answers.

  • I have tried to offer higher gas price by following (ethereum.stackexchange.com/a/18154/4575), but I have faced with some errors. @Linmao Song – alper Mar 7 at 12:35
  • Any errors from the web3, or Geth/Parity log, for the replacement transaction? – Linmao Song Mar 7 at 12:43
  • I am having Error: intrinsic gas too low or Error: replacement transaction underpriced error.@Linmao Song – alper Mar 7 at 12:44
  • Could it be the replacement transaction's gas price is still too low? How does the new gas price compare to the old price, also to the average gas price (e.g. web3.eth.gasPrice)? – Linmao Song Mar 7 at 12:47
  • web3.eth.gasPrice is 18000000000, I have tried: eth.resend(eth.pendingTransactions[0], web3.toWei(1000, 'gwei')) but still the same error. @Linmao Song – alper Mar 7 at 12:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.