Skip to content

Bug: Cancelling a pending transaction causes subsequent transactions to be stuck #99

Description

@KartikSoneji

Cancelling a pending transaction doesn't reset the nonce for subsequent transactions in the queue, causing them to be stuck.

For example, the transactions with nonce 2104 and 2105 had a gas limit that was over the block gas cap, hence couldn't be submitted.
When they were cancelled, the subsequent transactions (2106 to 2114) were submitted to the mempool but remained pending because of the missing nonces.

> select
    '0x' || encode(hash, 'hex') as hash,
    status,
    gas_limit,
    nonce
from transaction
where chain_id = 4114
order by nonce desc
limit 15;

                                hash                                |  status   | gas_limit | nonce 
--------------------------------------------------------------------+-----------+-----------+-------
 0x43e350a7e40019e9e729c5782a6d46882e96123f5ee5834b6b36e1320cbff10a | INMEMPOOL |   3182131 |  2114
 0x8cdb8979c2b2d9b2f24912cc8a226cec28e3a0b49a553f80495a5bf3314a150b | INMEMPOOL |   3719913 |  2113
 0x7fb39c2bef8cd0bb31520d3f402c855f8741efd10533da9b209f5e2a92768a1b | INMEMPOOL |   4505092 |  2112
 0x332eb304e8a6f28f3d7ab8d0da71fa63022e0fe92d416161d35e186be6866532 | INMEMPOOL |   3749538 |  2111
 0xfaacac3213f8ac020fe6ba3140e88b4bf9edd3af14078a4bb2c9209d4047c415 | INMEMPOOL |   7936777 |  2110
 0x641bd627c4b8f2c9405e3f21e823b7f4badc87ad3da503623d4e7ec40cc6ec41 | INMEMPOOL |   9153385 |  2109
 0x5b6777bc9162af3ec33ebed1d2902318d05ecf9c4b42d13f77124017eeeb2458 | INMEMPOOL |   6287720 |  2108
 0x07b07df9049bbeed25ed3923a4cf057cfa902b84aaf9fd50621f2b6fb9087bb0 | INMEMPOOL |   3591698 |  2107
 0x2ad49773ba64239f5d7b0de6331362dc5585ab10bedad9255e22fc24f333bff8 | INMEMPOOL |   6044995 |  2106
 0xb99a1f055954144c8df3f5188a256d8f38e49696bd0722c7e783583686513e8f | CANCELLED |  10904455 |  2105
 0x6b66ffb69eb914c69aefc0aeb61bd9f4d3ebe83af00f00d3f13701e33458b8d6 | CANCELLED |  10952338 |  2104
 0x1ab1bc7dba57e458813374fea9602be14746acde6154e45f5135149cb73ebe50 | CONFIRMED |    603822 |  2103
 0x58cdda557238e62f1dff3b026017b928a8a6a23ed9a24e52689758073ad493f4 | CONFIRMED |    518402 |  2102
 0x4af971650fa72e0ace2199f624febe59c8187946a9ed49cd056358423718a1f0 | CONFIRMED |    731431 |  2101
 0xbb01f77847a0a0715115de70404bfda2dcb8aa1adb1d9ab10768b55d2a59a57a | CONFIRMED |    603798 |  2100

Sending two noop transactions:

closed the gap and allowed the rest of the transactions to go through.

> select
    '0x' || encode(hash, 'hex') as hash,
    status,
    gas_limit,
    nonce
from transaction
where chain_id = 4114
order by nonce desc
limit 15;

                                hash                                |  status   | gas_limit | nonce 
--------------------------------------------------------------------+-----------+-----------+-------
 0x43e350a7e40019e9e729c5782a6d46882e96123f5ee5834b6b36e1320cbff10a | CONFIRMED |   3182131 |  2114
 0x8cdb8979c2b2d9b2f24912cc8a226cec28e3a0b49a553f80495a5bf3314a150b | CONFIRMED |   3719913 |  2113
 0x7fb39c2bef8cd0bb31520d3f402c855f8741efd10533da9b209f5e2a92768a1b | CONFIRMED |   4505092 |  2112
 0x332eb304e8a6f28f3d7ab8d0da71fa63022e0fe92d416161d35e186be6866532 | CONFIRMED |   3749538 |  2111
 0xfaacac3213f8ac020fe6ba3140e88b4bf9edd3af14078a4bb2c9209d4047c415 | CONFIRMED |   7936777 |  2110
 0x641bd627c4b8f2c9405e3f21e823b7f4badc87ad3da503623d4e7ec40cc6ec41 | CONFIRMED |   9153385 |  2109
 0x5b6777bc9162af3ec33ebed1d2902318d05ecf9c4b42d13f77124017eeeb2458 | CONFIRMED |   6287720 |  2108
 0x07b07df9049bbeed25ed3923a4cf057cfa902b84aaf9fd50621f2b6fb9087bb0 | CONFIRMED |   3591698 |  2107
 0x2ad49773ba64239f5d7b0de6331362dc5585ab10bedad9255e22fc24f333bff8 | CONFIRMED |   6044995 |  2106
 0xb99a1f055954144c8df3f5188a256d8f38e49696bd0722c7e783583686513e8f | CANCELLED |  10904455 |  2105
 0x6b66ffb69eb914c69aefc0aeb61bd9f4d3ebe83af00f00d3f13701e33458b8d6 | CANCELLED |  10952338 |  2104
 0x1ab1bc7dba57e458813374fea9602be14746acde6154e45f5135149cb73ebe50 | CONFIRMED |    603822 |  2103
 0x58cdda557238e62f1dff3b026017b928a8a6a23ed9a24e52689758073ad493f4 | CONFIRMED |    518402 |  2102
 0x4af971650fa72e0ace2199f624febe59c8187946a9ed49cd056358423718a1f0 | CONFIRMED |    731431 |  2101
 0xbb01f77847a0a0715115de70404bfda2dcb8aa1adb1d9ab10768b55d2a59a57a | CONFIRMED |    603798 |  2100

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions