SIMD-0194
Deprecate Rent Exemption Threshold
TL;DR
This proposal aims to eliminate the use of floating-point operations to determine whether an account is rent exempt or not in programs by deprecating the use of the `exempt_threshold` (`f64`) value. More specifically, rename `lamports_per_byte_year` to `lamports_per_byte`, change default value from `3480` to `6960`, change `exemption_threshold` to `1.0` and deprecate it from the protocol. This will enable us to remove `f64` math from all Rent-related SDKs and onchain programs moving forward. To align the cluster value of `burn_percent` with current SDK defaults, we will also explicity set `burn_percent` to `50`.
Summary
This proposal aims to eliminate the use of floating-point operations to determine whether an account is rent exempt or not in programs by deprecating the use of the `exempt_threshold` (`f64`) value. More specifically, rename `lamports_per_byte_year` to `lamports_per_byte`, change default value from `3480` to `6960`, change `exemption_threshold` to `1.0` and deprecate it from the protocol. This will enable us to remove `f64` math from all Rent-related SDKs and onchain programs moving forward. To align the cluster value of `burn_percent` with current SDK defaults, we will also explicity set `burn_percent` to `50`.
Motivation
Emulating floating point math is expensive inside of SVM due to the lack of native floating point number support. This makes calculating the rent exempt threshold cost `~248` more CUs than it would if we were to simply use a `u64`. This is due to the `exemption_threshold` (`f64`), which is currently set to `2.0` years. Since rent exemption is no longer time-based, we have the opportunity to make this commonly used calculation much more performant and simplify our tooling without affecting the existing API. It also simplifies any further changes we may want to make to Rent down the line.
Impact
This change will significantly improve the compute unit (CU) consumption of new onchain programs using updated SDKs programs that calculate the minimum lamports balance required for rent exemption. Currently, the calculation of the minimum balance for rent exemption (`Rent::minimum_balance`) consumes approximately `256` CUs; with the proposed change, this will be reduced to just `8` CUs. Existing programs will not be impacted.
Backwards Compatibility
This feature is backwards compatible. It does not change the absolute value required for an account to be rent exempt and the current way of calculating the threshold will continue to evaluate to the same value. Any deployed program will be unaffected.
Security Considerations
None.