-
Notifications
You must be signed in to change notification settings - Fork 915
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
Fix rent epoch type #3719
base: maintenance/v1.x
Are you sure you want to change the base?
Fix rent epoch type #3719
Conversation
|
#3133 is relevant to this discussion too |
I can see that you guys are working on the new version of the package, but when the mainnet RPC returns a |
Maybe other |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@backmeupplz good spot. This is because the default value for rentEpoch
is now being set to Rust's u64::MAX
, as the concept of rent-paying accounts is being phased out.
This change causes actual valid JS numbers to break the struct validation, though. I think what we really want is this:
coerce(bigint(), number(), (value) => BigInt(value))
cc @steveluscher for review and to determine release process. Changing the type is a breaking change afaict, so can we sneak this into the next minor?
@buffalojoec imo whether it breaks the implementation or not depends on the types of values passed to from what i've seen it's only ever been an int, so switching it all to bigint might be ok however, again, this is debatable as the feature is being phased out the thing that bugs me is that like... am i the first one to notice? 🥲 this literally breaks types in |
So, for some reason rpc's return
2 ^ 64 - 1
asrentEpoch
. Obviously, this is larger thanNumber
in JS, so I switched the types tobigint
and it all works now.I'm a newby in Solana and have no idea why this works.
See solana-labs/solana-program-library#7635 for the reference.