3

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

2 Answers 2

5

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, remove transactions.rlp file (rm ~/examplePOA/private/geth/transactions.rlp) and restart.

1

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.

5
  • 1
    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
    Commented Mar 7, 2018 at 12:35
  • 1
    Any errors from the web3, or Geth/Parity log, for the replacement transaction? Commented Mar 7, 2018 at 12:43
  • 1
    I am having Error: intrinsic gas too low or Error: replacement transaction underpriced error.@Linmao Song
    – alper
    Commented Mar 7, 2018 at 12:44
  • 1
    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)? Commented Mar 7, 2018 at 12:47
  • 1
    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
    Commented Mar 7, 2018 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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