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

set epoch reward pda rent epoch to max#35098

Closed
HaoranYi wants to merge 1 commit into
solana-labs:masterfrom
HaoranYi:2024_Feb_5_max_rent_epoch_pda
Closed

set epoch reward pda rent epoch to max#35098
HaoranYi wants to merge 1 commit into
solana-labs:masterfrom
HaoranYi:2024_Feb_5_max_rent_epoch_pda

Conversation

@HaoranYi
Copy link
Copy Markdown
Contributor

@HaoranYi HaoranYi commented Feb 6, 2024

Problem

We deprecated rent accounts on the network. This means all new accounts must be rent exempt. We also activated set_rent_epoch_max feature. One of the implications is that for rent exempt account, its rent_epoch is set to
u64::max. However, currently, reward pda accounts are created rent-exempted but its rent_epoch is set 0. We rely on rent_collect to update to u64::max. In future, when we skip rent collect, the new PDA account's rent epoch will not be updated and stuck to zero.

To fix this, the pda account can simply be created with rent_epoch to u64::max and don't depend on rent collect to update rent_epoch later.

Summary of Changes

  • set epoch reward pda accounts rent_epoch to u64::max at creation.

Fixes #

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0e4e81a) 81.6% compared to head (7afff85) 81.6%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #35098     +/-   ##
=========================================
- Coverage    81.6%    81.6%   -0.1%     
=========================================
  Files         831      831             
  Lines      225048   225049      +1     
=========================================
- Hits       183735   183715     -20     
- Misses      41313    41334     +21     

@CriesofCarrots
Copy link
Copy Markdown
Contributor

Hi @HaoranYi , I reverted the relevant code yesterday (#35088), so this can be closed. In the meantime, I'd like to sync up with you about partitioned rewards; I'll message you directly.

@HaoranYi
Copy link
Copy Markdown
Contributor Author

HaoranYi commented Feb 6, 2024

close as it is outdated.

@HaoranYi HaoranYi closed this Feb 6, 2024
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.

2 participants