2

I sent a transaction with relatively low gas and during several days it was pending. Eventually I managed to have it to get through by increasing a gas fee.

Other time I send a transaction with a low gas fee as well, from some web-service or site where I have an account, and that one failed after around 12 hours, somehow. Although, I don't know, maybe a web service marked it as "canceled" by sending another one with same nonce and bigger gas fee, to cancel it.

Does Ethereum have mechanism for dropping or cancelling a transaction automatically, whether it be one sent to an ordinary account or smart contract, that's been pending for a long time? If yes, how long is long time?

1 Answer 1

2

No, Ethereum does not have a mechanism for dropping or cancelling transactions automatically. In practice, however, a transaction could be dropped:

Every node part of the blockchain has an internal buffer of pending transactions. As new transactions keep coming in, the buffer might get full and older transactions will be dropped.

So, after a time long enough, if your transaction is still not executed, it will drop of every node's buffer and disappear from the system.

How long? We don't know, it depends on the sizes of the buffers of each nodes.

In doubt, you can resend the exact same transaction (same hash, same nonce, same gas price, etc.) periodically to make sure it re-enters the buffer if it was dropped. Something like once per day should be enough.

For example, let's say you re-send the same transaction, two cases: (1) the transaction was actually dropped so your newly sent transaction is accepted, or (2) the transaction was not dropped yet, so you get an error while trying to override a transaction with same nonce and same gas price (in which case, it's fine, just ignore the error: you know the transaction is not dropped).

And as always, dropped or not, you can always override a non-executed transaction by sending another one with same nonce and higher gas price (high enough).

To sum up: because buffers have limited size, after a time long enough the non-executed transaction will drop from the system, which is the same as being automatically cancelled. The exact duration after which this will happen is unknown. It depends on the amount of transactions sent by other people and the buffers' sizes. -- Any estimate of the time after which this happens is unreliable, but my personal guess is that after a month the transaction will be dropped.

11
  • how long approximately? day, week, month?
    – michika
    Commented Jan 25, 2021 at 13:50
  • If the transaction appears on EtherScan, mempool can buffer the transaction for days. Commented Jan 25, 2021 at 15:45
  • @MikkoOhtamaa and if it doesn't appear?
    – michika
    Commented Jan 25, 2021 at 20:33
  • It is unlikely it is in mempool of other nodes either. Commented Jan 25, 2021 at 20:44
  • @MikkoOhtamaa I ask "how long?" not "where is it?" ---> how long approximately, day, week, month, if it's not appeared at EtherScan?
    – michika
    Commented Jan 26, 2021 at 9:50

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.