`stake-tracker` feedback PR (#4411)
- Changes the target list score type from balance to `u128` (`ExtendedBalance`) - simplifies `balance/ vote_weight/ extended_balance` conversions - relies less on the currency total issuance call - ensures approval stake calculations/storage is safe - Simplifies stake tracker logic - removes a few redundant checks - split `on_stake_update` code - Ensures `VoterUpdateMode` is taken into consideration in try-state checks - use voter mode lazy in benchmarks - update weights + check the diff with voter lazy - Docs improvements - All tests passing after merging validator disabling and virtual stakers **new** - ensures duplicate nominations are dedup before calculating the approvals stake - chills nominator after total slash to ensure the target can be reaped/kill without leaving nominations behind. - ensures that switching from validator to nominator and back is correct - a nominator may have an entry in the targetlist (if it was a validator + has nominations) - ensure target node is removed if balance is 0 and it is a nominator. - addresses https://github.com/paritytech-secops/srlabs_findings/issues/383 --- **Other experiments:** (not included) - https://github.com/paritytech/polkadot-sdk/pull/4402 (passing the status of the staker with who in the OnStakingUpdate interface is less clean, it turns out) - https://github.com/paritytech/polkadot-sdk/pull/4361 --------- Co-authored-by: command-bot <>
parent
e9218b62
Please register or sign in to comment