kin-node icon indicating copy to clipboard operation
kin-node copied to clipboard

submitPayment method is super slow and Throw exception as BadNonce

Open bhaveshdaswani93 opened this issue 2 years ago • 4 comments

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",
          },
        ],
      },
    },
  );

bhaveshdaswani93 avatar Apr 04 '22 07:04 bhaveshdaswani93

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.

richardmands avatar Apr 04 '22 19:04 richardmands

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?

bhaveshdaswani93 avatar Apr 08 '22 10:04 bhaveshdaswani93

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 avatar Apr 11 '22 18:04 richardmands

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

richardmands avatar Apr 11 '22 18:04 richardmands