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

[ FEAT ] Optimistic nonce Increment #14

Open
posaune0423 opened this issue Sep 4, 2024 · 1 comment
Open

[ FEAT ] Optimistic nonce Increment #14

posaune0423 opened this issue Sep 4, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@posaune0423
Copy link

posaune0423 commented Sep 4, 2024

Issue

Due to the current implementation of starknetjs, nonce of the account is not incremented before tx confirmed. And this makes user interaction experience poor. So I think pixelaw client should update account nonce optimistically for avoiding duplicated nonce transaction sending and enable fast pixel update experience for users.

Error Message
index-HtQOeg78.js:129 Dp: RPC: starknet_addInvokeTransaction with params {
  "invoke_transaction": {
    "sender_address": "0x106e31736b5f5fa0188eb5a86ff98b4338d5f513d043ded06ac944432fd7f94",
    "calldata": [
      "0x1",
      "0x242b049a376eb129e57e860c6646fd80f2b06747b42bb3821064a70c0a76a36",
      "0x476d5e1b17fd9d508bd621909241c5eb4c67380f3651f54873c5c1f2b891f4",
      "0x5",
      "0x0",
      "0x0",
      "0x9",
      "0x52",
      "0xcda2a2ff"
    ],
    "type": "INVOKE",
    "max_fee": "0xba3204",
    "version": "0x1",
    "signature": [
      "0x3089cd8daf5874780c6c1e8c155b142527c82267262001db0cc11c1c7e807bb",
      "0x1da666e4f99c18d206f56f312b5dac0a5b0ca696cbd21ada2d6571432076c52"
    ],
    "nonce": "0x14e"
  }
}
 
        52: Invalid transaction nonce: "Invalid transaction nonce of contract at address 0x106e31736b5f5fa0188eb5a86ff98b4338d5f513d043ded06ac944432fd7f94. Account nonce: 0x14f; got: 0x14e."
    at qI.errorHandler (https://pixelaw-client.vercel.app/assets/index-HtQOeg78.js:38:11095)
    at qI.fetchEndpoint (https://pixelaw-client.vercel.app/assets/index-HtQOeg78.js:40:216)
    at async nK.execute (https://pixelaw-client.vercel.app/assets/index-HtQOeg78.js:40:111064)
    at async Object.interact (https://pixelaw-client.vercel.app/assets/index-HtQOeg78.js:129:28174)
    at async interact (https://pixelaw-client.vercel.app/assets/index-HtQOeg78.js:129:25001)
    at async https://pixelaw-client.vercel.app/assets/index-HtQOeg78.js:83:15971

Screen Recording

When I tap slowly, it's just fine. but when I try to tap fast, nonce increment error occuers.

ScreenRecording_09-04-2024.15-00-29_1.MP4

How to reproduce

You can try here

@posaune0423 posaune0423 added the enhancement New feature or request label Sep 4, 2024
@posaune0423 posaune0423 changed the title Optimistic nonce Increment [ FEAT ] Optimistic nonce Increment Sep 4, 2024
@0xshora
Copy link
Contributor

0xshora commented Sep 4, 2024

I think it's a really important issue. Thank you for proposing.
Please proceed to fix this.

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

No branches or pull requests

2 participants