-
Notifications
You must be signed in to change notification settings - Fork 688
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
base: master
Are you sure you want to change the base?
Conversation
The CI pipeline was cancelled due to failure one of the required jobs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a governance origin protected call to update the parameter.
|
||
/// Parameters for the unbonding queue mechanism. | ||
#[pallet::storage] | ||
pub(crate) type UnbondingQueueParams<T: Config> = StorageValue<_, UnbondingQueue, ValueQuery>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub(crate) type UnbondingQueueParams<T: Config> = StorageValue<_, UnbondingQueue, ValueQuery>; | |
pub(crate) type UnbondingQueueParams<T: Config> = StorageValue<_, UnbondingQueue, OptionQuery>; |
Maybe to not having a default and disable this feature when there is no parameter.
This requires a governance call to set the parameter to enable this feature, which I think should be the preferred way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amended to OptionQuery
and added an unbonding params entry to set_staking_configs
.
Wen are we having this released? |
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.UnbondQueueParams
OptionQuery, None by default, & configurable viaset_staking_configs
.unbonding_period_upper_bound
as duplicate ofBondingDuration
.bonding_duration
interface so pallets likefast-unstake
get the correct unbond duration.