Skip to content

[NPoS] When pool contribution of a pool member goes below ED, it should be reaped. #5009

@Ank4n

Description

@Ank4n

There are cases where because of slashing, nomination pool members have contribution less than ED. When this happens, we should have a way to reap these accounts. This could be exposed via a permissionless extrinsic.

Things it should do

  • Reap pool member in pallet-nomination-pools.
  • Reap delegator in pallet-delegated-staking
  • reap part of the staked balance in pallet-staking. This should never exceed ED.

How I see this to be implemented

  • Add new permissionless extrinsic to Nomination pool to reap member. It should only execute if pool contribution of member is below ED.
  • The pool associated with the member is a nominator account in pallet-staking. Force withdraw that amount from pallet-staking and burn it. This should be similar to how balance pallet handles dust (see fungible::Unbalanced::handle_dust). This should also be removed from StakingLedger.active.
  • Clean up the delegator (in pallet-delegated-staking) and pool member. This logic would be somewhat similar to what happens in pool::withdraw_unbonded when all member funds are withdrawn.

Additionally, this should also ensure when the pool is destroyed, the pool_account is reaped from pallet-staking. If the pool is already destroyed, but it exists in pallet-staking, it should get reaped as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.D1-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

    Type

    No type

    Projects

    Status

    📕 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions