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

Bug Report: Fail to sign multiple transactions consecutively #150

Closed
ColinWttt opened this issue Sep 27, 2023 · 2 comments · Fixed by #289
Closed

Bug Report: Fail to sign multiple transactions consecutively #150

ColinWttt opened this issue Sep 27, 2023 · 2 comments · Fixed by #289

Comments

@ColinWttt
Copy link

Bug: When signing multiple transactions in succession manually, the second and subsequent transactions fail after signing. After some time, I am able to successfully sign transactions.

This error can be reproduced on snaps.consensys.net/starknet, when you send tokens consecutively, the second one fails.

error.png

console log two types of errors randomly
error1: MetaMask - RPC Error: 59: A transaction with the same hash already exists in the mempool

error2: MetaMask - RPC Error: 52: Invalid transaction nonce
error52.png

starknet-snap version: @consensys/starknet-snap 2.2.0

MetaMask version: 11.0.0

Chrome: 117.0.5938.92 (arm 64)

Network: Starknet Goerli Testnet

@stanleyyconsensys
Copy link
Collaborator

the issue was introduced when the transaction has sent, but it is still pending at the block, hence the latest block nonce is not updated on chain.

when we send another transaction in between the nonce update, it will occur such issue

we can resolve the issue by
Opt1 : adding a wait for transaction to block the UI
Opt2 : increment the nonce by adding a memory store to remember the last nonce from snap
Opt3 : retry the request with nonce increment when it has nonce error

@vivek-consensys
Copy link

Tested the fix by @khanti42 on dev and the user is able to sign multiple transactions consecutively.
image

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

Successfully merging a pull request may close this issue.

5 participants
@ColinWttt @stanleyyconsensys @vivek-consensys and others