Open Olshansk opened 2 months ago
@moatus Could you review the requirements for unstaking here. I'm thinking of mounting out the engineering work for it.
With some guidance from @facundomedica, here is the way to go
In that case I don't think we have a solution that would work "out of the box". You could achieve something like that with endblock or x/epochs, both solutions being pretty similar, main difference being that with x/epochs you can "schedule" the process to happen every certain amount of time. Most likely you'll have an unbonding queue so on endblock/epochEnd you iterate through them and release any that its unbonding time has expired. You might also want to add some limits to this kind of processing, so you process up to X unbonds per epoch/endblock. Otherwise you might get timeouts.
After looking through [1], this is EXACTLY what we should be using for this.
Please note that the documentation is outdated on their website right now: https://github.com/cosmos/cosmos-sdk/issues/20651
@red-0ne Please make sure to take a look at the notes & comments. We should tackle this in the next iteration.
Cross-referencing this comment for the most up to date documentation [2]
[1] https://github.com/cosmos/cosmos-sdk/issues/20651#issuecomment-2179515541 [2] https://docs.cosmos.network/main/build/modules/epochs
Objective
Design & implement a framework of how to handle on-chain
Unbonding
after an actor submits a validUnstake
transaction.Origin Documents
UnstakingTime
which can be found hereGoals
Unbonding
definition: a state during which an actor operates normally, after unstaking, before their escrowed stake is returned and they are removed as active actorsDeliverables
IMPORTANT NOTE TO THE OWNER: The deliverables below are not a complete list of everything that needs to be done, but rather a starting point to help. The research, which is part of the deliverables, should drive most of the design decisions.
Research
Other Projects
Morse
Before implementation
Implementation requirements
N
blocks from the moment the actor submits the unstaking transactionN
should have a unique governance parameter for every actor: Application, Supplier, GatewayDuring implementation
After implementation
Estimated Days of Work
5 days
Disclaimer: This is the total projected number of estimated hours to completion & merge. The owner of this tickets is expected to use this GitHub issue to communicate with the core protocol team along the way, with update & feedback for each deliverable throughout the duration of this work._
Creator: @olshansk Co-Owners: @moatus