1

I have question that has been bugging me for a while. It's about first order and nonce.

First of all when i send multiple transaction in meta mask, they should confirm in sequence if i do not change the nonce. So transaction 3 needs to confirm before transaction 4 right? no matter what are the fees because the transactions are coming out of the wallet.

On another hand, if i have a transaction that is pending and i make a new transaction with same nonce and change the fees higher does that Guarantee that the transaction with higher fees will go first? or the one with lower fees might end up going first for some other reason.also an addition to question do miners only take into consideration the fees or there is some other metric. If my first transaction had a fee of 10 gwei and second 11 does that make a difference if they were 10 and 100 fees? does that guarantee that 2 replaces 1 (considering same nonce in both cases. Is there some mechanism in play?

Thanks for your time

1 Answer 1

1

First of all when i send multiple transaction in meta mask, they should confirm in sequence if i do not change the nonce. So transaction 3 needs to confirm before transaction 4 right? no matter what are the fees because the transactions are coming out of the wallet.

I think you mean if you do change the nonce for each transaction, right ?

If so, yes they will be processed in order. Either in the same block where the nonce order must be respected or in different blocks, once again respecting the nonce order.

Any incoherency in the nonce is called a "nonce gap". For instance with pending tx with nonce 1, 3 and 4 :

Tx 1 may be processed by the miners but Tx 3 and 4 will have to wait for a Tx 2 to become pending to become pending themselves.


On another hand, if i have a transaction that is pending and i make a new transaction with same nonce and change the fees higher does that Guarantee that the transaction with higher fees will go first? or the one with lower fees might end up going first for some other reason.also an addition to question do miners only take into consideration the fees or there is some other metric. If my first transaction had a fee of 10 gwei and second 11 does that make a difference if they were 10 and 100 fees? does that guarantee that 2 replaces 1 (considering same nonce in both cases. Is there some mechanism in play?

As long as you change your fee to be 10% higher or more than the previous tx that had the same nonce, any node receiving it will replace your previously pending tx by the new one, same nonce but higher gas fee.

If you wish, you can see it here.

Now regarding the guarantee: there is none as far as I know of.

A miner may include your first tx in a valid block and it should be accepted by the network, after all it's a valid transaction...

But to be fair, if you have time to replace your transaction it means that it was definitely not a priority for the miners. Meaning that your replacement should have strong chances of succeeding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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