Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

submitPayment method is super slow and Throw exception as BadNonce #22

Open
bhaveshdaswani93 opened this issue Apr 4, 2022 · 4 comments

Comments

@bhaveshdaswani93
Copy link

I am using @kinecosystem/kin-sdk-v2 version 0.5.0 SDK
I have two issue with submitPayment method

  • Getting super slow response approx 2 to 3min
  • Sometimes get BadNonce exception
return new BadNonce("", txId);
                   ^

BadNonce
    at errorFromProto (path\node_modules\@kinecosystem\kin-sdk-v2\dist\errors.js:90:20)
    at Object.errorsFromSolanaTx (path\node_modules\@kinecosystem\kin-sdk-v2\dist\errors.js:18:17)
    at path\node_modules\@kinecosystem\kin-sdk-v2\dist\client\internal.js:346:58
    at Object.onReceiveStatus (path\node_modules\grpc\src\client_interceptors.js:1212:9)
    at InterceptingListener._callNext (path\node_modules\grpc\src\client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (path\node_modules\grpc\src\client_interceptors.js:618:8)
    at callback (path\node_modules\grpc\src\client_interceptors.js:847:24)

I am using passing following options to submitPayment method

const txId = await kinClient.submitPayment(
    {
      sender: privateKey,
      destination: publicKey,
      type: TransactionType.P2P,
      quarks: kinToQuarks(kinAmount),
      invoice: {
        Items: [
          {
            amount: kinToQuarks(kinAmount),
            description: "kin spent or p2p",
            sku: new Date().getTime().toString(),
            title: "kin spent or p2p",
          },
        ],
      },
    },
  );
@richardmands
Copy link
Contributor

richardmands commented Apr 4, 2022

Hi. Thanks for submitting this issue. We think this is due to issues on the Solana end. They are taking a bit of a battering at the moment in terms of performance.
https://analytics.solscan.io/public/dashboard/8d888828-baae-47b9-948b-d087e5de1411?select_report_period=past30days
image

For context, we really want this to be over 2000:
image
https://explorer.solana.com/
We can see it's running way below the normal levels.

@bhaveshdaswani93
Copy link
Author

So what can be done related to this?
Do we need to raise issue with solana? If yes then where and how to generate issue with the solana?

@richardmands
Copy link
Contributor

Hi. It looks like this is something Solana is aware of and a fix is coming. Link for some context: https://twitter.com/aeyakovenko/status/1512551478883405834

@richardmands
Copy link
Contributor

There's some chat about this on our developer discord if you're not there already: https://discord.gg/kdRyUNmHDn

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

No branches or pull requests

2 participants