Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Proposing" transactions one after another can result in the same nonce #2034

Closed
katspaugh opened this issue May 24, 2023 · 0 comments
Closed
Assignees

Comments

@katspaugh
Copy link
Member

katspaugh commented May 24, 2023

Problem

If you quickly create two back-to-back transactions, the recommended nonce for them (from the backend) may end up the same resulting in the second tx cancelling the first one.

Example

An example of how to reproduce: https://www.loom.com/share/89a490a44d454d9bba67c15d9e602ff1

What happens under the hood:

  • User makes a tx on CoW Swap
  • The WC app picks it up via the RPC call
  • WC safe app calls the wallet app and tells it to popup a modal
  • User confirms the modal and signs the tx
  • Tx is added to the queue (aka "proposed")
  • RPC request returns a response to the CoW app

Although adding to the queue should increment the "recommended" nonce on the backend, it doesn't. Apparently, there's an internal lag/asynchronous state involved.

Solution

One potential solution would be to wait/poll until the recommended nonce increments after proposing a tx and make any subsequent txs wait for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant