Skip to content

Conversation

@joncinque
Copy link
Collaborator

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.

This is a part of #275

@joncinque joncinque requested a review from febo December 4, 2025 18:58
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client @solana/sysvars (example)
Thank you for keeping the JavaScript clients in sync with the Rust clients.

@joncinque
Copy link
Collaborator Author

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.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client @solana/sysvars (example)
Thank you for keeping the JavaScript clients in sync with the Rust clients.

febo
febo previously approved these changes Dec 4, 2025
Copy link
Contributor

@febo febo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@brooksprumo
Copy link
Contributor

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.

Love it. Looks good to me.

@febo
Copy link
Contributor

febo commented Dec 4, 2025

@joncinque I was just going through pinocchio's implementation of Rent. Maybe we should add a deprecation note to DEFAULT_LAMPORTS_PER_BYTE_YEAR and DEFAULT_BURN_PERCENT constants.

And we might want to change the type of DEFAULT_EXEMPTION_THRESHOLD, so a deprecation note here as well.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client @solana/sysvars (example)
Thank you for keeping the JavaScript clients in sync with the Rust clients.

@joncinque
Copy link
Collaborator Author

@joncinque I was just going through pinocchio's implementation of Rent. Maybe we should add a deprecation note to DEFAULT_LAMPORTS_PER_BYTE_YEAR and DEFAULT_BURN_PERCENT constants.

And we might want to change the type of DEFAULT_EXEMPTION_THRESHOLD, so a deprecation note here as well.

I just deprecated them entirely and added DEFAULT_LAMPORTS_PER_BYTE. While I was at it, I realized that the new constructor isn't correct -- we need to set the exemption threshold to 1.

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);
Copy link
Contributor

@febo febo Dec 4, 2025

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:

Suggested change
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);

Copy link
Collaborator Author

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

If this PR represents a change to the sysvar layout, please open a follow-up PR to update the JavaScript client @solana/sysvars (example)
Thank you for keeping the JavaScript clients in sync with the Rust clients.

Copy link
Contributor

@febo febo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@joncinque joncinque merged commit f5f4a4c into anza-xyz:master Dec 4, 2025
25 checks passed
@joncinque joncinque deleted the dep-rent branch December 5, 2025 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants