[Staking] Delegators can stake but stakers can't delegate #4904
+41
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #4804.
Fixes the try state error in Westend: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6564522.
Passes here: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6580393
Context
Currently in Kusama and Polkadot, an account can do both, directly stake, and join a pool.
With the migration of pools to
DelegateStake
(See #3905), the funds of pool members are locked in a different way than for direct stakers.holds
.pallet-staking
uses deprecated locks (analogous to freeze) which can overlap with holds.An existing delegator can stake directly since pallet-staking only uses free balance. But once an account becomes staker, we cannot allow them to be delegator as this risks an account to use already staked (frozen) funds in pools.
When an account gets into a situation where it is participating in both pools and staking, it would no longer would be able to add any extra bond to the pool but they can still withdraw funds.
Changes