3

I have a pending transaction that is not going through because of low gas price. I tried sending a new transaction with the same 57 nonce (https://etherscan.io/tx/0x7d50ccda13524e04614d65ac03ddbd1d1027a1b6fa8aab7c779fca2ff5bf6b81) and high gas but it doesn't go through and give me the error:

Failed transaction Transaction 57 failed! [ethjs-query] while formatting outputs from PC '("value": ""code":-32000 "message": "replacement transaction underpriced"})'

How can I send another transaction with nonce 57, to replace my transaction that had a low gas price?

2 Answers 2

3

From etherscan, I have captured the relevant details of Transaction Hash: 0x7d50ccda13524e04614d65ac03ddbd1d1027a1b6fa8aab7c779fca2ff5bf6b81

Gas Price: 0.000000030629291882 Ether (30.629291882 Gwei)

Max Priority: 30.629291882 Gwei

Txn Type: 2 (EIP-1559)

Nonce: 57

This is an EIP-1559 transaction and the nonce57 transaction you want to replace it with must have at least 10% more Gas Price and Max Priority.

So both following minimum values are needed:

  • Gas Price: 1.1*30.629291882
  • Max Priority: 1.1*30.629291882

You do not need to increase the Gas Limit of your transaction. (If your replacement transaction is sending 0 ether to yourself, you can even lower it and set the Gas Limit to 21,000.)

2
  • 1
    man i really really reallyyyyyy appreciate you, i solved the issue thanks to you, the most important thing was to adjust the max pririty fee and a high gas as max fee, thank you!!!! Commented Feb 7, 2022 at 18:06
  • Cool you've welcome! I'm glad I didn't miss a more time-sensitive comment.
    – eth
    Commented Mar 4, 2022 at 1:29
1

Make sure you send the replacement transaction with a higher price and the same gas limit as the pending transaction.

Note: this doesn't mean you'll be using the full gas limit. It just means that Ethereum will see that the full possible price of the new tx (gasPrice*gasLimit) is higher than the pending tx's gas price.

3
  • 1
    Thanks for answering :) Just wanted to help you realize that the gas limit of the replacement transaction does not need to be the same. The cancel transaction functionality of some wallets, like MetaMask, creates a replacement transaction that sends 0 ether to the sender account, and for it a Gas Limit of 21,000 is enough. Maybe in the general case keeping the same Gas Limit will lead to a slightly faster time getting mined. But for an ether transfer, I do not think a miner would be attracted if its Gas Limit is 210,000.
    – eth
    Commented Feb 6, 2022 at 8:35
  • Thanks :) I am pretty sure I saw a case in the past where somebody got the same message, he tried with higher gas price, but couldn't replace the tx until he raised the gas limit... I might test it later. I think it also kinda makes sense as the miner has better potential profits from a tx of 100 gwei and 1000 gas limit than a tx of 1000 gwei and 1 gas limit. Commented Feb 6, 2022 at 8:58
  • There could be custom miners that also look at the gas limit, but prioritizing with gas limit is tricky. Your example makes sense but there are examples that can trick miners. For example a miner could see a 10M gas limit transaction with gas price 100 gwei and think it will be very profitable, but in reality the tx only uses 100K gas. So the miner that included the 10M gas limit tx, would have lost on much revenue instead of choosing all the transactions that were more truthful, like 100 transactions that each have 100 gwei gas price and use around 100K gas.
    – eth
    Commented Mar 4, 2022 at 1:43

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.