Skip to content

clean up disable_rent_fees_collection feature#6622

Merged
jstarry merged 4 commits intoanza-xyz:masterfrom
jstarry:clean/rent-fee-feature
Jun 20, 2025
Merged

clean up disable_rent_fees_collection feature#6622
jstarry merged 4 commits intoanza-xyz:masterfrom
jstarry:clean/rent-fee-feature

Conversation

@jstarry
Copy link
Copy Markdown

@jstarry jstarry commented Jun 17, 2025

Problem

The disable_rent_fees_collection feature is activated on all clusters and can be cleaned up

Summary of Changes

  • Remove disable_rent_fees_collection from svm feature set
  • Remove obsolete tests
  • Clean up rent collection code, leaving only rent epoch updates in place (those will be removed later)

Fixes #

@jstarry jstarry requested a review from a team as a code owner June 17, 2025 19:59
@jstarry jstarry force-pushed the clean/rent-fee-feature branch from a7a9aea to 0223326 Compare June 18, 2025 04:56
Comment thread runtime/src/bank.rs Outdated
collector_fees: self.collector_fees.load(Relaxed),
fee_rate_governor: self.fee_rate_governor.clone(),
collected_rent: self.collected_rent.load(Relaxed),
collected_rent: 0u64,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We haven't collected rent for many epochs so it's safe to assume that any loaded snapshot will have 0 collected rent.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Are we just going to serialize a 0 from now on, since we can't get the field out of the deserialize side? Or can we?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oops I meant to put this comment in the deserialization path not the serialization path. Anyways, yes, since rent fee collection was turned off we have been only serializing 0 for quite awhile so explicitly serializing 0 isn't a behavior change. Because of always serializing 0 for awhile, we can safely ignore whatever value we deserialize here where I meant to write this comment.

-   collected_rent: AtomicU64::new(fields.collected_rent),

We can ignore it because fields.collected_rent should be 0 and even if it wasn't, we never used the collected_rent field after a bank was frozen anyways so it was kinda pointless to have put it in snapshots in the first place (other than for debugging).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

IMO we should remove collected_rent from BankFieldsToSerialize and hard code to 0 later on SerializableVersionedBank.

(And we can also rename SerializableVersionedBank::collected_rent to SerializableVersionedBank::unused_collected_rent.)

Is that too much of a pain for this PR? If yes, we can also do it as a follow-up.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I got confused and thought this struct was serialized and needed to keep the field. It was simple to remove, thanks for calling out: 72546df

Comment thread runtime/src/bank/tests.rs
assert_eq!(
bank.hash().to_string(),
"5b72TRrdMhGED3boghe55CyX8hmnpYt7RTMrwrHTrNpP",
"CTg8Vq5RjXhfp332YC9DHQjAfFueLPimszv9i6xBFgPW",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

These hashes changed because after removing the old rent collection path, we no longer update rent epoch for executable accounts which do not have a min rent exempt balance (this applies to builtin programs).

Copy link
Copy Markdown

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

Lgtm, just some questions!

Comment thread rpc/src/transaction_status_service.rs
Comment thread runtime/src/bank.rs Outdated
collector_fees: self.collector_fees.load(Relaxed),
fee_rate_governor: self.fee_rate_governor.clone(),
collected_rent: self.collected_rent.load(Relaxed),
collected_rent: 0u64,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Are we just going to serialize a 0 from now on, since we can't get the field out of the deserialize side? Or can we?

Comment thread runtime/src/bank.rs Outdated
Comment thread svm/src/account_loader.rs Outdated
Comment thread svm/src/account_loader.rs
Comment thread runtime/src/bank/fee_distribution.rs
@jstarry jstarry force-pushed the clean/rent-fee-feature branch from 0223326 to 13bcd14 Compare June 18, 2025 15:56
@jstarry
Copy link
Copy Markdown
Author

jstarry commented Jun 18, 2025

Force pushed to resolve a conflict in test_credit_debit_rent_no_side_effect_on_hash from #6561. Resolved the conflict by just removing that test since it's not relevant anymore.

@jstarry jstarry requested a review from buffalojoec June 18, 2025 16:43
@jstarry jstarry requested review from HaoranYi and brooksprumo June 19, 2025 18:39
Copy link
Copy Markdown

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

I didn't look at the SVM nor RPC files, but did scan the rest. I need to go back and do another pass on bank.rs and fee_distribution.rs too.

Comment thread runtime/src/bank.rs Outdated
collector_fees: self.collector_fees.load(Relaxed),
fee_rate_governor: self.fee_rate_governor.clone(),
collected_rent: self.collected_rent.load(Relaxed),
collected_rent: 0u64,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

IMO we should remove collected_rent from BankFieldsToSerialize and hard code to 0 later on SerializableVersionedBank.

(And we can also rename SerializableVersionedBank::collected_rent to SerializableVersionedBank::unused_collected_rent.)

Is that too much of a pain for this PR? If yes, we can also do it as a follow-up.

Comment thread runtime/src/bank.rs Outdated
Comment thread runtime/src/bank/tests.rs
@brooksprumo brooksprumo self-requested a review June 19, 2025 19:17
HaoranYi
HaoranYi previously approved these changes Jun 19, 2025
Copy link
Copy Markdown

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

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

lgtm. Thanks for cleaning it up.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.8%. Comparing base (3281f61) to head (72546df).
Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #6622     +/-   ##
=========================================
  Coverage    82.8%    82.8%             
=========================================
  Files         849      849             
  Lines      379373   377938   -1435     
=========================================
- Hits       314300   313232   -1068     
+ Misses      65073    64706    -367     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

Lgtm from SVM side.

Copy link
Copy Markdown

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

:shipit:

@jstarry jstarry merged commit e36fdb8 into anza-xyz:master Jun 20, 2025
39 checks passed
@jstarry jstarry deleted the clean/rent-fee-feature branch June 20, 2025 14:22
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.

5 participants