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: Allow removal of force-destaked validator #5439

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

joncinque
Copy link
Contributor

Problem

As mentioned in a Discord discussion https://discord.com/channels/428295358100013066/859540542608900127/1157393252119478332, stake pools cannot properly handle a validator that has been force-destaked through the new DeactivateDelinquent instruction on the stake program.

Solution

It's pretty simple -- don't try to deactivate a stake account again during removal. This way, the manager simply needs to remove the validator and then re-run an update to reabsorb the account.

While going through this, I also relaxed the check on an activating / active transient stake account, so that it'll just deactivate it. This way, we prevent a potential malfunction during this edge case:

  • someone deactivates-delinquent the main stake account, but not an activating transient stake account
  • the delinquent validator comes back online
  • it's now impossible to deactivate-delinquent the activating transient stake account
  • pool is confused and can't remove the validator

@2501babe
Copy link
Member

will review this next!

2501babe
2501babe previously approved these changes Oct 11, 2023
@2501babe
Copy link
Member

i love how simple this change is! it handles the case its meant to without needing to check for it, just two independent deactivations that accomplish the broader goal of removing the validator. very nice!

@mergify mergify bot dismissed 2501babe’s stale review October 11, 2023 19:13

Pull request has been modified.

@joncinque
Copy link
Contributor Author

That was the hope! I go cross-eyed making these changes sometimes, so I'm glad that you liked the simplicity of this one

@joncinque joncinque merged commit 9d3cb47 into solana-labs:master Oct 11, 2023
9 checks passed
@joncinque joncinque deleted the spdelinquent branch October 11, 2023 19:36
@CriesofCarrots
Copy link
Contributor

CriesofCarrots commented Oct 12, 2023

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.

None yet

3 participants