-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make active stake consistent in split #33295
Make active stake consistent in split #33295
Conversation
5d54c37
to
e201022
Compare
Codecov Report
@@ Coverage Diff @@
## master #33295 +/- ##
========================================
Coverage 81.9% 82.0%
========================================
Files 795 796 +1
Lines 215226 215640 +414
========================================
+ Hits 176404 176838 +434
+ Misses 38822 38802 -20 |
3aa6f79
to
8938201
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I'll keep at the stake pool changes in order to support this, then re-enable the downstream job
…ate::Initialized case
bffbf0e
to
e6a8808
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Add feature gate * Add helper fn * Require split destination to be rent-exempt if it is active * Update cli to prefund split accounts * cli: require rent param with sign-only * Update tokens to prefund split accounts * Update split tests with sysvar accounts * Fix test_split_to_account_with_rent_exempt_reserve * Fix test_staked_split_destination_minimum_balance * Fix test_split_more_than_staked * Fix test_split_minimum_stake_delegation and remove misleading StakeState::Initialized case * Fix test_split_from_larger_sized_account * Add test for pre-/post-activation behavior splitting some or all of stake account * Assert active stake * Fix runtime test * Ignore stake-pool downstream * Review comments * Feature gate sysvar reads (cherry picked from commit bca41ed) # Conflicts: # cli/tests/stake.rs # programs/stake/src/stake_instruction.rs # programs/stake/src/stake_state.rs # runtime/tests/stake.rs # sdk/src/feature_set.rs
…3319) * Make active stake consistent in split (#33295) * Add feature gate * Add helper fn * Require split destination to be rent-exempt if it is active * Update cli to prefund split accounts * cli: require rent param with sign-only * Update tokens to prefund split accounts * Update split tests with sysvar accounts * Fix test_split_to_account_with_rent_exempt_reserve * Fix test_staked_split_destination_minimum_balance * Fix test_split_more_than_staked * Fix test_split_minimum_stake_delegation and remove misleading StakeState::Initialized case * Fix test_split_from_larger_sized_account * Add test for pre-/post-activation behavior splitting some or all of stake account * Assert active stake * Fix runtime test * Ignore stake-pool downstream * Review comments * Feature gate sysvar reads (cherry picked from commit bca41ed) # Conflicts: # cli/tests/stake.rs # programs/stake/src/stake_instruction.rs # programs/stake/src/stake_state.rs # runtime/tests/stake.rs # sdk/src/feature_set.rs * Fix conflicts --------- Co-authored-by: Tyera <tyera@solana.com>
This PR has significant impact on how stake authority can be used. E.g. when stake authority is given to 3rd party to operate on the stake accounts, that 3rd party now has pay for rent (which it has no way of claiming back) and cost of such stake management is quite high. Consider for example Marinade Native - having thousands of stake accounts and splitting and re-balancing them was possible specifically because the rent could have been taken from the existing stake account. Now the cost to split the account would be quite high. Staker funding the split account cannot get hold of the funds later - as opposed to being a withdrawer. |
Problem
Stake split still contains some brittle logic.
Summary of Changes
Update tests to assert that active stake is consistent across split
Add feature to make rent-exempt handling consistent