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

[WIP] RFC-0097 Implementation to Decrease Unbonding Time #5715

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

rossbulat
Copy link

@rossbulat rossbulat commented Sep 14, 2024

This PR aims to implement RFC-0097, that introduces a flexible unbonding mechanism to decrease the time stakers have to wait to unbond by as much as 26 eras, resulting in 2 eras / 2 days on Polkadot in the best case scenario.

Commit Log

  • Introduce MinSlashableShare, UnbondPeriodUpperBound and UnbondPeriodLowerBound parameters as genesis storage items.
  • Define new migration to set initial parameter values in storage.
  • Record how much stake was used to back the lowest-backed 1/3 of validators, for the last UnbondingPeriodUpperBound eras. This LowestThirdTotalStake storage record can be updated when a new planned era is triggered, more specifically in the store_stakers_info function.
  • Implement a get_min_lowest_third_stake function that gets the lowest third stake entry over UnbondPeriodUpperBound eras.
  • Create pallet function get_quick_unbond_max_unstake(), that will essentially return MinSlashableShare * min_lowest_third_stake, where min_lowest_third_stake is determined by the above storage addition. Utilising this new storage item is of course less weight heavy than iterating through ErasStakersPaged.
  • Calculate unbonding_time_delta - this can use the following formula to determine a concrete unbond block number:
  • Calculate back_of_unbonding_queue_block_number.
  • Calculate unbonding_block_number and reflect in unlock chunks.

More to come...

Post Implementation Checklist

  • Add migration to runtimes.

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable 2/3
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7347472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants