-
Notifications
You must be signed in to change notification settings - Fork 163
rent: Deprecate the concept of paying rent, prep for SIMD-0194 #486
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
Conversation
|
If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client |
|
cc @brooksprumo just in case there's anything I'm missing. The deprecated functions aren't being used by Agave at all, and we can just upgrade Agave to use the new functions to prep for the breaking change. |
#### Problem The concept of rent no longer exists in Solana clusters, but we still have the types and functions related to it. Additionally, with SIMD-0194, we're eliminating the concept of `exemption_threshold`, but the field still exists. #### Summary of changes Prepare solana-rent for SIMD-0194, by deprecating `lamports_per_byte_year` (will be renamed to `lamports_per_byte`), `exemption_threshold` (will just become a `[u8; 8]`), and `burn_percent` (will just go unused). Also deprecate functions and types related to paying rent. Once this lands, we can do a breaking release that removes types and changes variable names.
|
If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client |
febo
left a comment
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.
Looks great!
Love it. Looks good to me. |
|
@joncinque I was just going through pinocchio's implementation of And we might want to change the type of |
|
If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client |
I just deprecated them entirely and added |
rent/src/lib.rs
Outdated
| /// - $1 per SOL | ||
| /// - $0.01 per megabyte day | ||
| /// - $7.30 per megabyte | ||
| pub const DEFAULT_LAMPORTS_PER_BYTE: u64 = 2 * 1_000_000_000 / 100 * 365 / (1024 * 1024); |
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.
SIMD-0194 specifies this value as 6960, which is equivalent to doubling the current 3480 value. Because of the precision, DEFAULT_LAMPORTS_PER_BYTE is evaluating to 6961. To match the SIMD value, we could do the following:
| pub const DEFAULT_LAMPORTS_PER_BYTE: u64 = 2 * 1_000_000_000 / 100 * 365 / (1024 * 1024); | |
| pub const DEFAULT_LAMPORTS_PER_BYTE: u64 = 2 * (1_000_000_000 / 100 * 365 / (1024 * 1024) as u64); |
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.
Nice catch, I'll just hard-code it to 6960
|
If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client |
febo
left a comment
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.
Looks great!
Problem
The concept of rent no longer exists in Solana clusters, but we still have the types and functions related to it.
Additionally, with SIMD-0194, we're eliminating the concept of
exemption_threshold, but the field still exists.Summary of changes
Prepare solana-rent for SIMD-0194, by deprecating
lamports_per_byte_year(will be renamed tolamports_per_byte),exemption_threshold(will just become a[u8; 8]), andburn_percent(will just go unused). Also deprecate functions and types related to paying rent.Once this lands, we can do a breaking release that removes types and changes variable names.
This is a part of #275