Skip to content

Wait to clear the mempool and use pending nonce in bridge-withdrawer #1228

@itamarreif

Description

@itamarreif

We currently use the latest nonce from cometbft before submitting each batch to the sequencer. This can cause problems if there are pending transactions in the mempool, since the nonce returned from cometbft is only updated after successful execution. Instead, we should:

  1. Use the pending nonce functionality from the sequencer's grpc service.
  2. On startup, wait for the mempool to clear (by waiting until pending nonce == latest nonce) before processing withdrawal batches.
    This way the bridge withdrawer will only start processing transactions from the latest unprocessed batch regardless of pending submissions (e.g. caused by a mid-submission restart) and won't fail submissions due to mempool-related race conditions.

Metadata

Metadata

Assignees

Labels

bridgingbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions