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

getAccountInfo for solana didn't handle uin64 correctly #1034

Open
LeonSha opened this issue Dec 11, 2023 · 6 comments
Open

getAccountInfo for solana didn't handle uin64 correctly #1034

LeonSha opened this issue Dec 11, 2023 · 6 comments

Comments

@LeonSha
Copy link

LeonSha commented Dec 11, 2023

Describe the bug
A clear and concise description of what the bug is.
getAccountInfo for solana didn't handle uin64 correctly

To Reproduce
Steps to reproduce the behavior:

  1. call getAccountInfo for address "5vsTp9YDw83E4y5FxYatfJ73wG3sRZANV6r6RZBsniyo" from tatum solana proxy
    {"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.17.6","slot":264513092},"value":{"data":["BpuIV/6rgYT7aH9jRhjANdrEOdwa6ztVmKDwAAAAAAGx7kglPvsN1CPoW5+frlezWwWJ3gBP3Kra2qQ67QcWMJIobn8qAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAADwHR8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","base64"],"executable":false,"lamports":182528591490,"owner":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","rentEpoch":18446744073709552000,"space":165}},"id":1}

Expected behavior
{"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.17.6","slot":264513053},"value":{"data":["BpuIV/6rgYT7aH9jRhjANdrEOdwa6ztVmKDwAAAAAAGx7kglPvsN1CPoW5+frlezWwWJ3gBP3Kra2qQ67QcWMDpXan8qAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAADwHR8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","base64"],"executable":false,"lamports":182528341290,"owner":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","rentEpoch":18446744073709551615,"space":165}},"id":1}

A clear and concise description of what you expected to happen.
rentEpoch has been rounded and exceeded max uint64

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@Smrecz
Copy link
Member

Smrecz commented Dec 15, 2023

@LeonSha unable to reproduce - account 5vsTp9YDw83E4y5FxYatfJ73wG3sRZANV6r6RZBsniyo inactive

@LeonSha
Copy link
Author

LeonSha commented Dec 18, 2023

@LeonSha unable to reproduce - account 5vsTp9YDw83E4y5FxYatfJ73wG3sRZANV6r6RZBsniyo inactive

This account is from devnet

@Smrecz
Copy link
Member

Smrecz commented Dec 23, 2023

@Hathoriel
Copy link
Member

@Smrecz @LeonSha Looking on that.

@Hathoriel
Copy link
Member

Hathoriel commented Jan 12, 2024

Hello @LeonSha
You need to call getAccountInfo with Base64 encoding like this:

const { result } = await tatum.rpc.getAccountInfo('5vsTp9YDw83E4y5FxYatfJ73wG3sRZANV6r6RZBsniyo', {
  encoding: Encoding.Base64,
})

Which will produce

{"jsonrpc":"2.0","id":1,"result":{"context":{"slot":272023390,"apiVersion":"1.17.15"},"value":{"data":["BpuIV\\/6rgYT7aH9jRhjANdrEOdwa6ztVmKDwAAAAAAGx7kglPvsN1CPoW5+frlezWwWJ3gBP3Kra2qQ67QcWMLmkbgAzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAADwHR8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","base64"],"executable":false,"lamports":219052622505,"space":165,"rentEpoch":1.844674407371e+19,"owner":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"}}}

Closing issue as a resolved.

@Hathoriel
Copy link
Member

Hathoriel commented Jan 12, 2024

@LeonSha I see where is the problem
"rentEpoch":1.844674407371e+19
is losing precision - but that's issue of the node, not SDK. I will recheck and get back to you.

@Hathoriel Hathoriel reopened this Jan 12, 2024
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

No branches or pull requests

3 participants