Try โ€‚โ€‰HackMD

Enabling governance participation for pool members

Problem Statement

When a staker directly stakes on pallet-staking, their funds are locked in their account and stakers can use their locked funds for participating in governance. For delegators in Nomination Pool, their funds are transferred to a pool account (pallet sub account) instead. This means they lose access to their locked funds and cannot use it for governance.

We could fix this if NominationPool instead held funds in the user accounts itself and somehow conveyed to Staking Pallet that the pool account represents the locked amount of all its delegators.

How Nomination Pools work currently:

  1. transfer tokens from delegator to pool account, and
  2. stake from pool account as a direct nominator. Tokens are locked in the pool account.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

How we want it to work:

  1. delegate fund from delegator to pool account with tokens locked in delegator account itself.
  2. stake from pool account as if all delegated funds to pool account are its own.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

This is what we try to achieve with pallet-delegated-staking. It is a wrapper implementation on top of staking-pallet that adds a new primitive of Delegation to staking.

Other design goals and challenges

  • Both nomination pool and staking are already big codebases and we want to minimise changes to each of this pallet to avoid adding regression.
  • Delegation based staking is configurable and runtimes can choose to enable or disable it.
  • Avoid greedy slashing of delegators of an Agent account to keep slashing event bounded.

Pallet Delegation Staking

Introducing Delegators and Agents

Agents are accounts who receive delegation from other accounts (delegators) and stakes on behalf of them. The funds are held in delegator accounts.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

Nomination Pools

Extracts out all pool specific staking interaction into a new trait StakeStrategy and implements two strategies:

  • Transfer and Stake: Same as current.
  • Delegate and Stake: Uses the new primitives introduced by DelegationStakeInterface.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

Migration of existing pools

There are migration functions exposed by pallet-delegated-staking to convert a Nominator into an Agent and a way for old Pool members to migrate their funds and be locked in their own accounts.

Following are the steps of how an existing nomination pool would migrate to DelegateStake strategy.

  1. Initial state of pool account

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

  1. Migrate pool account into an agent account

For this step, we create a proxy_delegator account that is a keyless account derived using the actual pool account by pallet-delegated-staking. All funds are moved to this account and delegated to pool account. Pool account is now an Agent.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

  1. Delegator migrates their fund as DelegateStake

Step 1 and 2 needs to be done in a single migration. This step can be done async, one delegator at a time permissionlessly. Each nominator can migrate their funds from proxy delegator to their own account.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

  1. Once all funds are migrated
    When all delegators to a pool have migrated their funds, proxy_delegator account is dusted.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’