-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release crates io v1.5.0 staking backport (#4144)
This backport PR should bump the `pallet-staking` from 27.0.0 to 27.0.1 Backports for 1.5: - #3639 Relevant Issues: - #3245 Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: kianenigma <[email protected]>
- Loading branch information
1 parent
e2b550e
commit c79481a
Showing
7 changed files
with
411 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
title: Prevents staking controllers from becoming stashes of different ledgers; Ensures that no ledger in bad state is mutated. | ||
|
||
doc: | ||
- audience: Runtime User | ||
description: | | ||
This PR introduces a fix to the staking logic which prevents an existing controller from bonding as a stash of another ledger, which | ||
lead to staking ledger inconsistencies down the line. In addition, it adds a few (temporary) gates to prevent ledgers that are already | ||
in a bad state from mutating its state. | ||
|
||
In summary: | ||
* Checks if stash is already a controller when calling `Call::bond` and fails if that's the case; | ||
* Ensures that all fetching ledgers from storage are done through the `StakingLedger` API; | ||
* Ensures that a `Error::BadState` is returned if the ledger bonding is in a bad state. This prevents bad ledgers from mutating (e.g. | ||
`bond_extra`, `set_controller`, etc) its state and avoid further data inconsistencies. | ||
* Prevents stashes which are controllers or another ledger from calling `set_controller`, since that may lead to a bad state. | ||
* Adds further try-state runtime checks that check if there are ledgers in a bad state based on their bonded metadata. | ||
|
||
crates: | ||
- name: pallet-staking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.