-
Notifications
You must be signed in to change notification settings - Fork 115
runtime: Update the chain constants. #1279
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
runtime: Update the chain constants. #1279
Conversation
Changes: - SlashDeferDuration changed to the BONDING_DURATION - 1 - Staking history_depth was increased to 336
| .collect(), | ||
| invulnerables: initial_authorities.iter().map(|x| x.0.clone()).collect(), | ||
| slash_reward_fraction: Perbill::from_percent(10), | ||
| history_depth: 336, |
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.
Where did 84 come from? Was it just some default value?
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.
Yes.
| pub const BondingDuration: pallet_staking::EraIndex = 24; | ||
| pub const SlashDeferDuration: pallet_staking::EraIndex = 6; // 1/4 the bonding duration. | ||
| pub const BondingDuration: pallet_staking::EraIndex = BONDING_DURATION; | ||
| pub const SlashDeferDuration: pallet_staking::EraIndex = BONDING_DURATION - 1; // 'slightly less' than the bonding duration. |
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.
If we ever (mistakenly) set BONDING_DURATION to 0 we might get problems (compiler would catch attempting to set a negative number).
, or even setting it to 1 then SlashDeferDuration = 0.
So maybe setting pub const Slash_Defer_Duration = 23 then BondingDuration = Slash_Defer_Duration + 1
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.
The compiler prevents it with the arithmetic operation will overflow message.
|
So I only had a small comment, but otherwise the numbers look good. |
Changes: