Skip to content
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

stake-pool: Update program to work with minimum delegation #3127

Merged
merged 5 commits into from
May 2, 2022

Conversation

joncinque
Copy link
Contributor

Problem

The minimum delegation will be raised with solana-labs/solana#24603, and the minimum reserve amount will be lowered with solana-labs/solana#24670 -- the stake pool program needs to be ready for that!

Solution

Update the minimum active stake amount and the minimum reserve amount as required. This was tested against the changes to raise the minimum delegation to 1 SOL, but not the second PR. The hope is that the only change will be to update MINIMUM_RESERVE_LAMPORTS to 0.

The best option will be to call get_minimum_delegation on the stake program, but that hasn't landed in any of the Solana crates yet.

We can land this PR to unblock solana-labs/solana#24603 if needed, or keep it as a draft. We won't redeploy the program until the new instruction makes it anyway.

@@ -747,7 +745,7 @@ impl Processor {
stake_pool.manager_fee_account = *manager_fee_info.key;
stake_pool.token_program_id = *token_program_info.key;
stake_pool.total_lamports = total_lamports;
stake_pool.pool_token_supply = 0;
stake_pool.pool_token_supply = total_lamports;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tests uncovered this little oopsie!

@joncinque joncinque marked this pull request as ready for review May 2, 2022 19:09
Copy link
Contributor

@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.

Lgtm! I did not go in-depth on all the tests; once MINIMUM_RESERVE_LAMPORTS drops to 0, that'll effectively double check the tests as well 😊

@joncinque joncinque merged commit a1c827d into solana-labs:master May 2, 2022
@joncinque joncinque deleted the sp-min-del branch May 2, 2022 20:45
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.

2 participants