-
Notifications
You must be signed in to change notification settings - Fork 160
rent!: Update default values, remove deprecated code #487
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
base: master
Are you sure you want to change the base?
Conversation
#### Problem Rent is gone, and SIMD-0194 will deprecate the exemption threshold, but the field still exists in the actual sysvar on-chain. #### Summary of changes Remove all deprecated code related to collecting rent, and use the new default values for Rent after SIMD-0194. To go with this, avoid floating point math in `minimum_balance()`, which was one of the of motivations for the change in the first place. Add a test to make sure the old and new calcs are the same.
|
If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client |
| pbkdf2 = { version = "0.11.0", default-features = false } | ||
| proc-macro2 = "1.0.93" | ||
| proptest = "1.6" | ||
| proptest = "1.9" |
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.
This upgrade is just to make things easier once #461 lands
|
If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client |
rent/src/lib.rs
Outdated
| let bytes = data_len as u64; | ||
| (((ACCOUNT_STORAGE_OVERHEAD + bytes) * self.lamports_per_byte_year) as f64 | ||
| * self.exemption_threshold) as u64 | ||
| if self.unused_exemption_threshold == DEFAULT_EXEMPTION_THRESHOLD { |
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.
nit: Currently this is only avoiding the f64 operation when the threshold is 1.0. Wonder if it would be better to also include the current case (threshold equal to 2.0), so we get the benefit before SIMD-0194 lands.
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.
My initial implementation actually had that, and then I reverted it 😅 I'll put it back in, and we can remove it once the SIMD is live, it's a good point. It also lets us (more) safely remove all float logic
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 – just left a question.
|
We might need to update the ABI diggest on |
|
If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client |
|
If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client |
|
Ok, this should be good for another look! |
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!
|
I'm going to hold off on merging this for roughly 10 days, then we can merge, publish, and update agave accordingly |
Problem
Rent is gone, and SIMD-0194 will deprecate the exemption threshold, but the field still exists in the actual sysvar on-chain.
Summary of changes
Remove all deprecated code related to collecting rent, and use the new default values for Rent after SIMD-0194.
To go with this, avoid floating point math in
minimum_balance(), which was one of the of motivations for the change in the first place.Add a test to make sure the old and new calcs are the same.
Closes #275