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]rentEpoc > ulong.MaxValue #49

Open
johnnymny opened this issue Feb 6, 2024 · 0 comments
Open

[Bug]rentEpoc > ulong.MaxValue #49

johnnymny opened this issue Feb 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@johnnymny
Copy link

Describe the bug
I encountered an overflow error when converting the result from JSON using the rpc.GetTokenAccountsByOwnerAsync method, specifically when the rentEpoch value exceeds ulong.MaxValue. This issue arises when processing rentEpoch values larger than what ulong can represent.

To Reproduce
Steps to reproduce the behavior:

  1. Call the rpc.GetTokenAccountsByOwnerAsync method to retrieve information about token accounts associated with an owner.
  2. Identify a scenario where the rentEpoch value in the returned JSON data exceeds ulong.MaxValue.
  3. Observe an overflow error during the conversion of JSON to .NET objects when encountering large rentEpoch values.

Expected behavior
I expected the library to either handle rentEpoch values of any size properly or provide a clear error message indicating that the value exceeds the supported range. Ideally, measures such as using a different data type or implementing a validation mechanism should be taken to accommodate scenarios where rentEpoch could surpass ulong limits.

Additional context
Error json excerpt

{"id":1,"jsonrpc":"2.0","result":{"context":{"apiVersion":"1.17.18","slot":246405854},"value":[{"account":{"data":{"parsed":{"info":{"isNative":false,"mint":"4wjPQJ6PrkC4dHhYghwJzGBVP78DkBzA2U3kHoFNBuhj","owner":"xxxxxxxxxxxxxxxxxx","state":"initialized","tokenAmount":{"amount":"100754","decimals":6,"uiAmount":0.100754,"uiAmountString":"0.100754"}},"type":"account"},"program":"spl-token","space":165},"executable":false,"lamports":2039280,"owner":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","rentEpoch":18446744073709552000,"space":165},"pubkey":"RVM2fCzme8o13BcyuZ2Ja1U7e6bHkf43Fze3iQNgJ1e"}....

Note: This issue report was created with the assistance of ChatGPT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant