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

[Staking] Delegators can stake but stakers can't delegate #4904

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ank4n
Copy link
Contributor

@Ank4n Ank4n commented Jun 27, 2024

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.

  • Pool member funds uses 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

  • Add test for the above scenario.
  • Removes the assumption that a delegator cannot be a staker.

@Ank4n Ank4n requested a review from a team as a code owner June 27, 2024 19:01
@Ank4n Ank4n added R0-silent Changes should not be mentioned in any release notes T2-pallets This PR/Issue is related to a particular pallet. labels Jun 27, 2024
@Ank4n Ank4n enabled auto-merge July 1, 2024 03:56
@Ank4n Ank4n added this pull request to the merge queue Jul 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T2-pallets This PR/Issue is related to a particular pallet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants