Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Staking and other updates #16

Merged
merged 10 commits into from
Jan 30, 2024
Merged

Staking and other updates #16

merged 10 commits into from
Jan 30, 2024

Conversation

dariolina
Copy link
Member

@dariolina dariolina commented Jan 17, 2024

This PR covers recent updates to domains, specifically those stemming from:

  • Staking v1.1 (PR, spec)
  • Bundles storage fees (PR1, PR2, spec)
  • future challenge period increase

This current PR is not meant to be merged until changes are live on a public network, but to give heads up to @jim-counter @EmilFattakhov as it describes changes to UX and may need to update in farming and dev docs and reeducate community. Happy to answer questions.

Copy link
Member

@jim-counter jim-counter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a few comments/suggestions.

docs/rewards_fees.md Outdated Show resolved Hide resolved
docs/decex/staking.md Outdated Show resolved Hide resolved
docs/decex/staking.md Outdated Show resolved Hide resolved
docs/decex/staking.md Outdated Show resolved Hide resolved
docs/decex/staking.md Outdated Show resolved Hide resolved
docs/decex/staking.md Outdated Show resolved Hide resolved
docs/decex/domains/workflow.md Outdated Show resolved Hide resolved
Copy link
Contributor

@EmilFattakhov EmilFattakhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping this up so that the PR 2452 is not forgotten to be reflected.

docs/decex/staking.md Show resolved Hide resolved
Copy link
Member

@jim-counter jim-counter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest one tiny change. Otherwise LGTM!

As always, your explanations are clear, concise and approachable @dariolina.

docs/consensus/data_flow.md Outdated Show resolved Hide resolved
@dariolina dariolina marked this pull request as ready for review January 30, 2024 11:53
@dariolina
Copy link
Member Author

I'm going to push these to the frontend tomorrow morning before your forum posts.

Copy link
Contributor

@EmilFattakhov EmilFattakhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reads well!

Left one question, nothing blocking.


<div align="center">
<img src="/img/Nomination_Pool-light.svg#gh-light-mode-only" alt="Nomination_Pool" />
<img src="/img/Nomination_Pool-dark.svg#gh-dark-mode-only" alt="Nomination_Pool" />
</div>

### Unlocking Funds

Withdrawals have a lock period of 2 days (currently 28 800 blocks, ~ 48 hours). After the locking period, the withdrawn amount can be unlocked in the user's account with the `unlock_funds` extrinsic. All withdrawals requested in the same stake epoch are aggregated together and the total amount is unlocked at once. This locking period is necessary to ensure that the domain block executing the withdrawal is confirmed and not challenged by a fraud proof in order to increase the economic stability of domains.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to clarify my understanding here.
Previously, in order to unlock tokens operators:
1 - Can either withdraw tokens using withdrawStake(operatorId, withdraw)
2 - Or can withdraw stake by de-registering deregisterOperator(operatorID)
In both cases their funds were automatically unlocked after the locking period.
Would that change at all now (other than the locking time changes)? It sounds like the funds won't be automatically unlocked, but users have to use another extinsics call to unlock_funds for the tokens to be released. Maybe I'm misinterpreting something.

Copy link
Member Author

@dariolina dariolina Jan 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. After 1 or 2, the user has to wait and then submit unlock_funds to actually be able to use the tokens. withdrawStake now basically only "unstakes" from the pool, but doesn't actually compute the individual amount or mint/transfer. This change is worse UX but a huge optimization to domain that lets us avoid iterating through all hundreds (or thousands) of nominators every time.
Currently, the unlock_funds has to be submitted manually, but we could have it automated by the staking interface or wallet so that the funds that are ready to be unlocked show like a reminder icon for the user or even submitted automatically as future transaction. There's room for front-end UX improvement for sure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thank you!
I'm adding the step to the guide as well, at least until we automate it.

@dariolina dariolina merged commit afd603d into main Jan 30, 2024
1 check passed
@dariolina dariolina deleted the stakingv1.1 branch February 2, 2024 14:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants