Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

removes feature gate code preserving rent_epoch for rent exempt accounts#28507

Merged
behzadnouri merged 2 commits intosolana-labs:masterfrom
behzadnouri:rm-preserve-rent-epoch-feature
Nov 1, 2022
Merged

removes feature gate code preserving rent_epoch for rent exempt accounts#28507
behzadnouri merged 2 commits intosolana-labs:masterfrom
behzadnouri:rm-preserve-rent-epoch-feature

Conversation

@behzadnouri
Copy link
Copy Markdown
Contributor

@behzadnouri behzadnouri commented Oct 20, 2022

Problem

feature is activated on all clusters

Summary of Changes

removed feature gate code

Fixes #26509

@behzadnouri behzadnouri force-pushed the rm-preserve-rent-epoch-feature branch 4 times, most recently from 805af9c to d654943 Compare October 25, 2022 12:57
@jeffwashington
Copy link
Copy Markdown
Contributor

jeffwashington commented Oct 31, 2022

I pushed updates to the bank test: test_bank_hash_consistency:
These are the pubkeys that have rent collected from them at various slots and the resulting rent_epoch prior to the feature activation.
Last 2 numbers are (existing account.rent_epoch, changed account.rent_epoch)
When removing the feature code, we stop updating account.rent_epoch. This produces different bank hash values.
So, the constants in the test need to change.

slot: 32, epoch: 1
collect rent: slot: 33, KeccakSecp256k11111111111111111111111111111, 0, 0
collect rent: slot: 33, SysvarEpochSchedu1e111111111111111111111111, 0, 1
collect rent: slot: 33, SysvarStakeHistory1111111111111111111111111, 0, 1
collect rent: slot: 33, SysvarC1ock11111111111111111111111111111111, 0, 1
collect rent: slot: 33, SysvarFees111111111111111111111111111111111, 0, 1
collect rent: slot: 33, Stake11111111111111111111111111111111111111, 0, 0
collect rent: slot: 33, SysvarS1otHistory11111111111111111111111111, 0, 1
collect rent: slot: 33, Vote111111111111111111111111111111111111111, 0, 0
collect rent: slot: 33, SysvarS1otHashes111111111111111111111111111, 0, 1
collect rent: slot: 33, SysvarRecentB1ockHashes11111111111111111111, 0, 1
collect rent: slot: 33, SysvarRent111111111111111111111111111111111, 0, 1
collect rent: slot: 42, 3qbR1eZRqXUWroWKKYhbDmR3FfqTHfqSU8zZSxtANzYh, 0, 1
slot: 64, epoch: 1
collect rent: slot: 96, 11111111111111111111111111111111, 0, 0
collect rent: slot: 97, Config1111111111111111111111111111111111111, 0, 0
collect rent: slot: 97, Ed25519SigVerify111111111111111111111111111, 0, 0
collect rent: slot: 98, KeccakSecp256k11111111111111111111111111111, 0, 0
collect rent: slot: 99, Vote111111111111111111111111111111111111111, 0, 0
collect rent: slot: 99, SysvarEpochSchedu1e111111111111111111111111, 1, 2
collect rent: slot: 99, SysvarStakeHistory1111111111111111111111111, 1, 2
collect rent: slot: 99, SysvarC1ock11111111111111111111111111111111, 1, 2
collect rent: slot: 99, SysvarFees111111111111111111111111111111111, 1, 2
collect rent: slot: 99, Stake11111111111111111111111111111111111111, 0, 0
collect rent: slot: 99, SysvarS1otHistory11111111111111111111111111, 1, 2
collect rent: slot: 99, SysvarS1otHashes111111111111111111111111111, 1, 2
collect rent: slot: 99, SysvarRecentB1ockHashes11111111111111111111, 1, 2
collect rent: slot: 99, SysvarRent111111111111111111111111111111111, 1, 2
collect rent: slot: 117, 3qbR1eZRqXUWroWKKYhbDmR3FfqTHfqSU8zZSxtANzYh, 1, 2
slot: 128, epoch: 2

@jeffwashington jeffwashington self-requested a review October 31, 2022 18:43
@behzadnouri behzadnouri force-pushed the rm-preserve-rent-epoch-feature branch from 557a3b6 to b6cf004 Compare November 1, 2022 10:08
Copy link
Copy Markdown
Contributor

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

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

lgtm

@behzadnouri behzadnouri merged commit 17680fe into solana-labs:master Nov 1, 2022
@behzadnouri behzadnouri deleted the rm-preserve-rent-epoch-feature branch November 1, 2022 13:37
Comment thread runtime/src/accounts.rs
if !preserve_rent_epoch_for_rent_exempt_accounts
&& account.rent_epoch() == INITIAL_RENT_EPOCH
{
let rent = rent_collector
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@behzadnouri
This PR looks like it is correctly removing the feature.
I am not entirely sure what this code here is doing. Is this code gone because we aren't allowed to create rent paying accounts anymore so the only side effect was updating rent_epoch?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for posterity, from behzad:

that branch was added separately in:
#26851
the PR has some context

gnapoli23 pushed a commit to gnapoli23/solana that referenced this pull request Dec 16, 2022
…nts (solana-labs#28507)

* removes feature gate code preserving rent_epoch for rent exempt accounts

* update test expected hashes

Co-authored-by: jeff washington <jeff.washington@solana.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Gate: preserves rent_epoch for rent exempt accounts

2 participants