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
[x] Introduce MinSlashableShare, UnbondPeriodUpperBound and UnbondPeriodLowerBound parameters as genesis storage items.
[x] Define new migration to set initial parameter values in storage.
[x] 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.
[x] Implement a get_min_lowest_third_stake function that gets the lowest third stake entry over UnbondPeriodUpperBound eras.
[x] 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.
[x] Calculate unbonding_time_delta - this can use the following formula to determine a concrete unbond block number.
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
MinSlashableShare
,UnbondPeriodUpperBound
andUnbondPeriodLowerBound
parameters as genesis storage items.UnbondingPeriodUpperBound
eras. ThisLowestThirdTotalStake
storage record can be updated when a new planned era is triggered, more specifically in thestore_stakers_info
function.get_min_lowest_third_stake
function that gets the lowest third stake entry overUnbondPeriodUpperBound
eras.get_quick_unbond_max_unstake()
, that will essentially returnMinSlashableShare * min_lowest_third_stake
, wheremin_lowest_third_stake
is determined by the above storage addition. Utilising this new storage item is of course less weight heavy than iterating throughErasStakersPaged
.unbonding_time_delta
- this can use the following formula to determine a concrete unbond block number.back_of_unbonding_queue_block_number
.unbonding_block_number
and reflect in unlock chunks.back_of_unbonding_queue_block_number
calculation.More to come...
Post Implementation Checklist