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: Splitting a deactivated stake wrongly takes delegation into account #30400

Closed
joncinque opened this issue Feb 18, 2023 · 1 comment
Closed

Comments

@joncinque
Copy link
Contributor

joncinque commented Feb 18, 2023

Problem

If a stake is delegated, becomes active, and then gets deactivated, the delegation is always present in its StakeState. When splitting from any stake, if it's a StakeState, we check that the delegation doesn't go under 0 at

if remaining_stake_delta > self.delegation.stake {
return Err(StakeError::InsufficientStake);
}
. If that deactivated stake has loads of liquid SOL, it will fail to split, which essentially means we can't correctly split a deactivated stake.

Proposed Solution

When splitting from a deactivated stake, don't take the delegation into account.

cc @t-nelson

@github-actions github-actions bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Feb 19, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2024
@github-actions github-actions bot removed the stale [bot only] Added to stale content; results in auto-close after a week. label Mar 1, 2024
@joncinque
Copy link
Contributor Author

This issue has been recreated at solana-program/stake#1 -- closing this one

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

No branches or pull requests

2 participants