0

I currently have several txs stuck on Pending even after passing them 100 gwei of gasPrice while current baseFee is 0.000001086 gwei (on Goerli and using ethers.js).

const ops = {
    gasLimit: ethers.BigNumber.from('30000000'),
    gasPrice: ethers.BigNumber.from('100134698068') 
};

I've been re-sending them with the nonce of the stuck tx with even higher and higher gasPrice, but they don't get included.

What settings can I add so they get validated asap?

Thanks!

3
  • Do you have enough ether to pay for the transaction fee? If gasLimit * gasPrice + value is greater than the available balance the transaction will get stuck until they are replaced, or there is enough balance for the fees. Can you share the pending transaction hashes?
    – Ismael
    Nov 30, 2022 at 4:35
  • Thanks! My problem was that I was using a greater nonce than the stuck tx (by 1). As soon as I figured that out and sent it with the correct nonce, it went through
    – dNyrM
    Nov 30, 2022 at 22:00
  • Please, add that as answer so the question can be marked as resolved.
    – Ismael
    Dec 1, 2022 at 0:53

2 Answers 2

1

SOLUTION

I was using a greater nonce than the stuck tx (by 1).

When using ethers.provider.getTransactionCount(addr, 'pending') to get the nonce of the last stuck tx, be sure to use the result from that call and not one nonce higher (my error).

0

You can fetch the Gas Price from the Blockchain instead of hardCoding it .

const gasPrice = ethers.utils.formatUnits(await provider.getGasPrice(), 'gwei')
const options = {gasLimit: 3000000, gasPrice: ethers.utils.parseUnits(gasPrice, 'gwei')}
7
  • That's not working. I hard-coded it to 1000x its value because fetching it directly wasn't working.
    – dNyrM
    Nov 26, 2022 at 11:03
  • What's the error you are getting? Nov 26, 2022 at 11:16
  • No error. The txs just get stuck indefinitely, even after resending them with the same nonce and a higher gasPrice.
    – dNyrM
    Nov 26, 2022 at 11:17
  • Do you mean your JS Script shows transaction Processed but it's not processed on etherscan Explorer? Nov 26, 2022 at 11:20
  • JS script doesn't show anything. It's literally the definition of stuck. When it hits the line of code of signer.sendTransaction(), it doesn't pass that line to the next one. And once I quit the script and query pending txs, I see that it's been sent
    – dNyrM
    Nov 26, 2022 at 11:24

Your Answer

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

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