Repository navigation
Apply the lamports-per-byte feature gates to the rent sysvar - #431
Conversation
| if self | ||
| .feature_set | ||
| .is_active(&agave_feature_set::set_lamports_per_byte_to_6960::id()) | ||
| { | ||
| rent_account.lamports_per_byte = | ||
| agave_feature_set::set_lamports_per_byte_to_6960::LAMPORTS_PER_BYTE; | ||
| } |
There was a problem hiding this comment.
I'm curious, why is this one separate from the rest? What makes this feature different?
There was a problem hiding this comment.
It mirrors how agave applies them in Bank::apply_feature_activations (https://github.com/anza-xyz/agave/blob/521aa0997c848ba2e9f1db43046c1f1480790e5b/runtime/src/bank.rs#L6418-L6460). The five SIMD-0437 gates are one ordered list where the latest activation wins, and the SIMD-0438 gate sits after that list because it is the safeguard that resets the value to 6960 and has to override any 0437 gate active at the same time. Appending it as a sixth element would give the same result here, but only by position, so I kept the override explicit like agave does. Happy to fold it into the list with a comment if you prefer the shorter form.
44bc688 to
d4bf5c3
Compare
Closes #430.
#423 added the SIMD-0437
set_lamports_per_byte_to_*feature IDs to the mainnet set, butset_sysvarsstill wroteRentwith the pre-reduction value, so the rent-exempt minimum was out of step with mainnet.set_sysvarsnow mirrors Agave: it walks the five reduction gates (6333, 5080, 2575, 1322, 696) and takes the last active one, then lets the SIMD-0438set_lamports_per_byte_to_6960safeguard override the result. The existingdeprecate_rent_exemption_thresholdhandling is unchanged. With the bundled mainnet feature set this yields 5080 lamports per byte, so one node test that asserted the old minimum balance moves from 1,746,960 to 1,275,080 lamports for 123 bytes.Tests cover the mainnet default, each earlier gate when the later ones are inactive, no gate at all, activating a gate that is not yet in the mainnet set, the 6960 reset, and the legacy representation without the threshold feature. Changelog entry under Changed.