-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Staking] Cleanups and some improvements #8701
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
Changes from 21 commits
960e322
5d3d02a
8cc3d3b
c47f127
873333a
1381a78
80479ff
fc8f315
3455016
35bd423
b1e5247
971de13
5f0aed8
36448f9
2d7e2a2
44d6164
d377884
6650ad1
31c5c85
8c7c840
84ec94b
77615b5
0a3723f
81ee0ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| title: '[Staking] Cleanups and some improvements' | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: |- | ||
| ## Changes | ||
| - Introduced a new `min_bond` value, which is the minimum of `MinValidatorBond` and `MinNominatorBond`, with a fallback to `ExistentialDeposit`. Since ED on AH is much lower than on RC, this ensures we enforce some min bonds for staking to cover storage costs for staking ledger and related data. | ||
| - Added an upper bound on era duration, protecting against anomalous conditions that could otherwise lead to excessive inflation. | ||
| - Some refactors to gracefully handle unexpected validator activation in RC. | ||
|
|
||
|
|
||
| ## TODO | ||
| - [ ] Set `MaxEraDuration` in WAH. | ||
| - [ ] Port [full unbond](https://github.com/paritytech/polkadot-sdk/pull/3811) (will do in a separate PR) | ||
| crates: | ||
| - name: pallet-staking-async | ||
| bump: major | ||
| - name: pallet-staking-async-parachain-runtime | ||
| bump: major | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -72,6 +72,18 @@ use sp_runtime::TryRuntimeError; | |||||
| const NPOS_MAX_ITERATIONS_COEFFICIENT: u32 = 2; | ||||||
|
|
||||||
| impl<T: Config> Pallet<T> { | ||||||
| /// Returns the minimum required bond for participation, considering validators, nominators, | ||||||
| /// and the chain’s existential deposit. | ||||||
| /// | ||||||
| /// This function computes the smallest allowed bond among `MinValidatorBond` and | ||||||
| /// `MinNominatorBond`, but ensures it is not below the existential deposit required to keep an | ||||||
| /// account alive. | ||||||
| pub(crate) fn min_bond() -> BalanceOf<T> { | ||||||
|
||||||
| pub(crate) fn min_bond() -> BalanceOf<T> { | |
| pub(crate) fn min_chilled_bond() -> BalanceOf<T> { |
and then two more for
fn min_validator_bond
fn min_nominator_bond
?
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.
@kianenigma Can you sanity check these new functions before I merge
81ee0ae#diff-4fde8f6e9b1050fbd0fb764fe2bea06879a3ee0443e476b95ca418d188f22079R89
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.
Merged but still pls check!
Uh oh!
There was an error while loading. Please reload this page.