Polygon transactions are stuck/transaction underpriced error
See original GitHub issueEthers Version
5.6.1
Search Terms
polygon maxPriorityFeePerGas maxFeePerGas
Describe the Problem
There is a harcoded (1.5 gwei) maxPriorityFeePerGas (and maxFeePerGas) in index.ts.
This value is used in populateTransaction.
In case of Polygon, this will either result in a transaction stuck in the mempool, or in case og e.g an Alchemy endpoint, “transaction underpriced” error.
Code Snippet
signer.populateTransaction(txParams)
signer.sendTransaction(txParams)
Where txParams don't contain maxPriorityFeePerGas/maxFeePerGas, and is a type 2 transaction.
(Legacy transactions pass as they use gasPrice only)
Contract ABI
No response
Errors
processing response error (body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32000,\"message\":\"transaction underpriced\"},\"id\":64}", error={"code":-32000}, requestBody="{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x02f873818981c98459682f0084596898e882520894c54c244200d657650087455869f1ad168537d3b387038d7ea4c6800080c080a07cb6e05c60a2cb7ffc83349bc52ade79afaf9fdb911c64d57aed421caa1ecbcfa05f30023a4d21dd2eab6ea619c8dbb4820ce40c71841baacf8e82cbde7e87602a\"],\"id\":64,\"jsonrpc\":\"2.0\"}", requestMethod="POST",
Environment
No response
Environment (Other)
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:17
- Comments:36 (2 by maintainers)
Top Results From Across the Web
How To Fix "Replacement Transaction Underpriced" Error?
Replacement transaction underpriced simply means that the user-created transaction for overwriting their pending transactions was unable to be created due to ...
Read more >Fix “replacement transaction underpriced” on Opensea ...
How to fix the MetaMask - RPC Error : Error : [ethjs-query] while formatting outputs from RPC '{“value”:{“code”:-32000,“message”:“replacement ...
Read more >Transactions keep failing with replacement transaction ...
I got a stuck transaction on OpenSea so I tried resetting my wallet. It seems to have worked, everything looks as before and...
Read more >Polygon mumbai testnet error 'transaction underpriced'
This could happen if somehow the nonce of the transaction you're trying to perform got to be the same as your last transaction's...
Read more >web3js - error: replacement transaction underpriced
The error message implies that you're trying to replace a pending transaction. That's because the raw transaction you're trying to send has the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My current workaround:
And my current workaround:
I removed
gasLimit
from the options as it never worked;