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

[NPoS] Staking: Users can delegate their fund to a target which can nominate on their behalf. #408

Closed
Ank4n opened this issue Jul 8, 2023 · 7 comments
Assignees
Labels
I5-enhancement An additional feature request.

Comments

@Ank4n
Copy link
Contributor

Ank4n commented Jul 8, 2023

This is first part of enabling funds of nomination pool delegators to be reusable for governance.

A delegator account should be able to delegate their funds to a delegatee account. The delegatee account can nominate validators using the funds of the delegator account. The funds of delegator should be locked in-place in delegator's account. Staking pallet will need to build a delegation ledger that will bookkeep the delegations. As first iteration, we should allow delegations only for direct nominations .

The slashes should be applied lazily. As long as more funds are staked than pending slashes, staking pallet should be happy. But it should not allow more funds to be withdrawn than pending slashes. Effectively, the balance of a delegated nominator is delegated_balance - pending_slashes. This value should always be zero or greater.

Nomination pool will use the above primitive to allow users to delegate their funds to the pool. The pool account would be the direct nominator. The pool is also responsible for managing rewards and slashes if applicable.

In future, the same primitives can be used to build different implementations/strategies around slashing and rewards for a pool.

Some more details on the approach
https://hackmd.io/JXvBdTcHTZmwpEZzNst8mA?edit

@Ank4n Ank4n self-assigned this Jul 8, 2023
@bkchr
Copy link
Member

bkchr commented Jul 9, 2023

A user should be able to delegate their funds to another account which can nominate validators on behalf of the user. The fund of user should be locked in-place in user's account.

This could be done by just having a proxy for nominate or not?

@Ank4n
Copy link
Contributor Author

Ank4n commented Jul 9, 2023

A user should be able to delegate their funds to another account which can nominate validators on behalf of the user. The fund of user should be locked in-place in user's account.

This could be done by just having a proxy for nominate or not?

Proxy is different from delegation (I will modify the description to clarify this). Proxy allows another account to do some action as if its done by the proxied account, where as in delegation, the account to which funds are delegated to, would act as the main nominator, and its active staking balance would be the aggregate of all the delegation funds it has received.

@bkchr
Copy link
Member

bkchr commented Jul 9, 2023

where as in delegation, the account to which funds are delegated to, would act as the main nominator, and its active staking balance would be the aggregate of all the delegation funds it has received.

But isn't this nomination pools?

@Ank4n
Copy link
Contributor Author

Ank4n commented Jul 10, 2023

where as in delegation, the account to which funds are delegated to, would act as the main nominator, and its active staking balance would be the aggregate of all the delegation funds it has received.

But isn't this nomination pools?

The way nomination pool works today, it 1) moves the fund from delegator to pool account, and 2) stakes.
After this change, we will refactor nomination pool to instead: 1) delegate fund from delegator to pool account, and 2) stake.

The difference being, that the funds will be locked in-place in user's account enabling them to participate in governance voting.

Nomination pool would still do all the heavy lifting around pool administration, reward distribution, lazy slashing.

@bkchr
Copy link
Member

bkchr commented Jul 10, 2023

Okay, thank you for the explanation @Ank4n :)

@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. and removed J0-enhancement labels Aug 25, 2023
@Polkadot-Forum
Copy link

This issue has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/opengov-improvements-on-the-technical-level/6578/3

serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* expose GRANDPA RPC API from Millau node

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* expose GRANDPA RPC API from Millau node

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* expose GRANDPA RPC API from Millau node

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* expose GRANDPA RPC API from Millau node

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* expose GRANDPA RPC API from Millau node

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* expose GRANDPA RPC API from Millau node

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* expose GRANDPA RPC API from Millau node

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* expose GRANDPA RPC API from Millau node

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
* expose GRANDPA RPC API from Millau node

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
* expose GRANDPA RPC API from Millau node

* fmt
jonathanudd pushed a commit to jonathanudd/polkadot-sdk that referenced this issue Apr 10, 2024
* expose GRANDPA RPC API from Millau node

* fmt
@Ank4n
Copy link
Contributor Author

Ank4n commented Oct 1, 2024

complete with #3905

@Ank4n Ank4n closed this as completed Oct 1, 2024
@github-project-automation github-project-automation bot moved this from 📕 Backlog to ✅ Done in (Nominated) Proof of Stake Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request.
Projects
Status: Done
4 participants