Conversation
|
@Ank4n according to @kianenigma we want to fully unbond everything after chilling. Therefore, the extrinsic don't need to take any value, also there will be no need to add a check for minimum active bond which you suggested earlier here. #3629 (comment) Also, if we want to do a chill also when we expect a value, we can definitely do that in the unbond extrinsic. should i go ahead and include that? |
|
@kianenigma wdyt about |
This is also fine with me, no strong opinion. I like your idea better as it improves UX without wallets needing to do much. |
|
OK. So, should we still keep the full unbond extrinsic and also implement the implicit one that @Ank4n is suggesting? |
f6032b7 to
df5c186
Compare
# Conflicts: # polkadot/runtime/westend/src/weights/pallet_staking.rs # substrate/frame/staking/src/benchmarking.rs # substrate/frame/staking/src/pallet/impls.rs # substrate/frame/staking/src/pallet/mod.rs # substrate/frame/staking/src/weights.rs
# Conflicts: # Cargo.lock
|
@Ank4n @kianenigma please help review again |
…re unbonding all amount
kianenigma
left a comment
There was a problem hiding this comment.
Looks good, needs more tests (for unbond fully calling chill) and better prdoc and bench etc.
|
bot fmt |
|
@Ank4n https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/8297709 was started for your command Comment |
|
@Ank4n Command |
# Conflicts: # substrate/frame/staking/src/pallet/impls.rs
|
@Ank4n can we get this merge please. 🙏 |
fe46832
|
@kianenigma can you tip @dharjeezy? |
|
/tip medium |
|
@kianenigma A referendum for a medium (80 DOT) tip was successfully submitted for @dharjeezy (12GyGD3QhT4i2JJpNzvMf96sxxBLWymz4RdGCxRH5Rj5agKW on polkadot). |
|
The referendum has appeared on Polkassembly. |
closes #414 Polkadot address: 12GyGD3QhT4i2JJpNzvMf96sxxBLWymz4RdGCxRH5Rj5agKW --------- Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com> Co-authored-by: command-bot <> Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com> Co-authored-by: Ankan <ankan.anurag@gmail.com>
## 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](#3811) (will do in a separate PR) --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## 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](#3811) (will do in a separate PR) --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## 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](#3811) (will do in a separate PR) --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…10502) ## Context We want to make nominators unslashable (configurable via a storage set), and once they are unslashable, they can also unbond and withdraw in 2 era instead of the full BondingDuration (28 eras). ## Storage Changes - `AreNominatorsSlashable: StorageValue<bool>` (default: true): Runtime-configurable flag. Made this a storage value (not a config constant) so it can be enabled together with MinValidatorBond and MinCommission via `set_staking_configs`. - `ErasNominatorsSlashable: StorageMap<EraIndex, bool>` (default: true): Per-era snapshot of slashability setting. This ensures offences are processed with the rules that were in effect at the time of the offence, not the current rules. Cleaned up automatically for eras outside bonding window. - `LastValidatorEra` to track if a staker was a validator in a recent era and hence needs to follow full unbonding time. Does not need migration as long as we disable nominator slash (in other words: reduce their unbond time) at least one era after these changes are applied. ## Slashing logic - Added `process_offence_validator_only` as a separate code path instead of overloading the same function. See `process_offence_for_era` in `substrate/frame/staking-async/src/slashing.rs`. - We might want to remove nominator slashing code completely at some point. ## Unbonding logic: - Introduce new config constant `NominatorFastUnbondDuration` that determines the fast unbond duration (recommended value: 2 eras) when nominators are not slashable. - Added `nominator_bonding_duration()` to `StakingInterface` trait (returns `NominatorFastUnbondDuration` era when not slashable, full unbond duration otherwise). - Nomination pools now use `nominator_bonding_duration()`, so pool members also benefit from fast unbonding. - Ported auto-chill on full unbond from pallet-staking (PR #3811) to prevent `InsufficientBond` errors. - Nominators unbonding the era before the nominators become unslashable will still have 28 days of unbonding. ## Era pruning: - Moved pruning of `ValidatorSlashInEra` as well as `ErasNominatorsSlashable` in lazy pruning. This has a minor (I believe acceptable) side effect that they will be cleaned up in 84 eras instead of 28 eras. --- ## TODO - [x] Ensure delegator slash works correctly (nomination pool). - [x] Ensure pool members can unbond in 1 day as well. - [x] Benchmark update. - [x] Document how all three can be changed in one go: `MinCommission`, `MinValidatorBond`, and `AreNominatorsSlashable`. - [x] Regenerate weight - [x] Make nominator unbonding time configurable and set it to 2 eras. - [x] Refactor compute slash to avoid calling `slash_nominator` completely. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>

closes #414
Polkadot address: 12GyGD3QhT4i2JJpNzvMf96sxxBLWymz4RdGCxRH5Rj5agKW