gasPrice
field in order to place a bid on gas price. Post-London, with EIP 1559, transactions can include one or both of maxPriorityFeePerGas
(a tip to the miner) or maxFeePerGas
(a total fee including tip to the miner). For the purposes of this tutorial, we will assume you have submitted a transaction with one or both of these fields at least once before.gasPrice
, which needed to be at least 10% higher than the pending transaction's price in order for minders to reconsider the transaction. The purpose is to convince miners that you are willing to pay more.maxPriorityFeePerGas
, or "tip". This is the amount that will go to the miner. Just as in legacy transactions, the tip needs to increase by at least 10% to be re-considered.maxFeePerGas
field. Meaning that you are not explicitly setting a tip — you are letting the system fill in a default for you. This is problematic because to update your transaction you need to submit a new maxPriorityFeePerGas
. So in this instance you will need to fetch your pending transaction, check the maxPriorityFeePerGas
field, and then submit a new transaction with the same nonce and an increased tip. You will also need to increase your maxFeePerGas
by the same amount.maxPriorityFeePerGas
to 15. No self-respecting miner would accept a 15 wei tip. I mean, they might, but it's really really really really unlikely.maxPriorityFeePerGas
it's simple for us to update it. In order to update the tip you have to submit a transaction with the same nonce, just as with legacy transactions.maxFeePerGas
field with no explicit maxPriorityFeePerGas
. In this instance, updating the transaction is slightly more complicated.maxFeePerGas
field, then a default is filled in for the maxPriorityFeePerGas
field. The default depends on what node provider you are using. When you submit an updated transaction with a new maxFeePerGas
, your node provider will very likely not fill in an updated priority fee. That means that no matter how much you bump the maxFeePerGas
, your updated transaction will continue to fail. To complicate matters further, when you are submitting a transaction update it is likely that the baseFeePerGas
also changed.maxFeePerGas
estimate from Eth Gas Station (or other estimator). Now that we know the new total, we just need to know the new baseFeePerGas
and then we can calculate the new tip to submit.maxFeePerGas
and maxPriorityFeePerGas
fields, and you will successfully retry the transaction!