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

Nonce gap not detected, wallet sets wrong nonce #5934

Open
314159265359879 opened this issue Nov 3, 2024 · 3 comments
Open

Nonce gap not detected, wallet sets wrong nonce #5934

314159265359879 opened this issue Nov 3, 2024 · 3 comments
Assignees
Labels
area:nonce area:stacks area:transactions bug Functionality broken bug-p4 Non-critical functionality broken for few users, or there are clear workarounds

Comments

@314159265359879
Copy link
Contributor

314159265359879 commented Nov 3, 2024

This issue used to be solved, not sure if there is a change to the API or the wallet.
It is my understanding that the "next nonce" api should know if there is a missing nonce between the last processed transaction nonce and the lowest nonce still pending.

reproduction steps:

  1. In a new wallet account with some STX
  2. Create a STX transfer and edit the nonce to 20
  3. Sign transaction, this will remain pending, because the first nonce that can be processed for this account is 0
  4. Now create another transaction and do not edit the nonce
  5. Sign transaction
  6. See the issue: the transaction is send with a nonce of 21 instead of 0.

The API or Wallet wrongfully deduces that the next nonce is 21, while there is a gap of nonce 0 through 19 before 21 can get processed.

Tested on the public testnet.

@314159265359879 314159265359879 added area:nonce area:stacks area:transactions bug Functionality broken bug-p2 Critical functionality broken for few users, with no clear workarounds labels Nov 3, 2024
Copy link

linear bot commented Nov 3, 2024

@314159265359879
Copy link
Contributor Author

It is possible this only occurs on an address that hasn't signed any transactions yet. I just retested on an other address that already had a transaction with nonce 0 processed and then this didn't occur.

@314159265359879 314159265359879 self-assigned this Nov 7, 2024
Copy link
Collaborator

camerow commented Nov 21, 2024

This seems like a self inflicted wound, no? You edited the nonce to 20 - is the expectation that if you edit the nonce we then revert back to the previous nonce value before you edited it?

@camerow camerow removed the bug-p2 Critical functionality broken for few users, with no clear workarounds label Nov 21, 2024
@camerow camerow added the bug:p5 (visual) label Nov 21, 2024 — with Linear
@camerow camerow added the bug-p4 Non-critical functionality broken for few users, or there are clear workarounds label Nov 21, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:nonce area:stacks area:transactions bug Functionality broken bug-p4 Non-critical functionality broken for few users, or there are clear workarounds
Projects
None yet
Development

No branches or pull requests

2 participants