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

Ensure that unvested coins can be staked #364

Open
tonimateos opened this issue Feb 14, 2024 · 3 comments
Open

Ensure that unvested coins can be staked #364

tonimateos opened this issue Feb 14, 2024 · 3 comments
Labels
Genesis Sprint Candidate Proposed by PO for the very next sprint

Comments

@tonimateos
Copy link
Contributor

tonimateos commented Feb 14, 2024

As a token owner with cliff and/or vesting I want to be able to stake on the network my unvested coins

  • initial state: 10 vested already, 1000 locked because of vesting
    you want to put 500 into staking
  • final state: X frozen, Y vested already, Z locked because of vesting

ACCEPTANCE:

  • I can stake my unvested coins
  • I understand the final state in the case mentioned above
@tonimateos tonimateos added Genesis Sprint Candidate Proposed by PO for the very next sprint labels Feb 14, 2024
@ghost ghost self-assigned this Feb 19, 2024
@ghost
Copy link

ghost commented Feb 20, 2024

Before:
Image

Join as a delegator:
Image

Image

Final state:

Image

@ghost
Copy link

ghost commented Feb 20, 2024

  • staking pallet uses freeze to lock funds of participants
  • vesting pallet uses lock to lock funds of participants

both freeze and lock operations are treated same and sometimes used interchangeably, this means that funds may "overlap". But even if the whole funds are unvested i.e unlocked, they are not converted to free balance since there is still a freeze on funds that are used for staking. So usable balance will never include locked or frozen funds unless there is some mechanism locking/freezing it

So, basically, this suffices to can locked funds be frozen?, and the answer is - yes!

Example:

Alice starts with 1 free and 9 unvested units, which is basically a freeze/lock on 9 units. Then she stakes 9 units, which places another lock on the same 9 units. And for 9 units to be totally "free" it needs to "escape" two locks:

  • 9 units should be fully vested
  • 9 units should be unstaked

@ghost
Copy link

ghost commented Feb 20, 2024

more info here paritytech/polkadot-sdk#236 (comment)

@ccubu ccubu unassigned ghost Feb 21, 2024
@magecnion magecnion assigned magecnion and unassigned magecnion Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Genesis Sprint Candidate Proposed by PO for the very next sprint
Projects
Status: Done
Development

No branches or pull requests

2 participants