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: Integrate stake redelegation #3749

Closed
joncinque opened this issue Oct 25, 2022 · 0 comments · Fixed by #3856
Closed

stake-pool: Integrate stake redelegation #3749

joncinque opened this issue Oct 25, 2022 · 0 comments · Fixed by #3856

Comments

@joncinque
Copy link
Contributor

Problem

The stake program added the redelegate instruction in solana-labs/solana#26294, which easily moves stake from one validator to another without losing an epoch of rewards due to the flow of deactivate -> wait -> delegate -> wait.

Stake pools are extremely important users of stake accounts, and we want most stake to go through a stake pool at some point. When stake pools rebalance, they lose out on rewards, impacting their performance, so many just don't do it, or only move a minimal amount to keep their financial performance high.

Solution

Add a redelegate instruction to the stake pool program, which moves a certain number of lamports from one validator to another. Underneath, this instruction will:

  • split lamports from the main stake account into the redelegation stake account, a PDA given by some seed (also part of the instruction), where the seed will be stored in the ValidatorStakeInfo entry for that validator in the pool
  • redelegate from the redelegation stake account to an ephemeral stake account, a PDA given by some other seed (honestly, it doesn't matter because it will be immediately deleted in the next step)
  • immediately merge the ephemeral stake account into the transient stake account for the validator

This model allows for multiple redelegations into the same validator in one epoch. The redelegated stake account needs to stay around to be reabsorbed into the pool, so there's only one redelegation possible from a validator per epoch. However, this means that it is not possible to decrease stake from a validator and also redelegate to it. That would be a weird situation though.

During the update_validator_list_balance instruction, instead of passing in two accounts per validator (the main stake account and the transient stake account), we'll also pass in the redelegation stake account, so we'll update in groups of three. If the redelegation stake account exists and is deactivated, the reserve stake account receives the rent-exempt lamports.

Since there's enough changes happening in #3714, let's land that first before tackling this.

cc @mvines

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 a pull request may close this issue.

1 participant