Implements a % cap on staking rewards from era inflation (#1660)
This PR implements an (optional) cap of the era inflation that is allocated to staking rewards. The remaining is minted directly into the [`RewardRemainder`](https://github.com/paritytech/polkadot-sdk/blob/fb0fd3e6/substrate/frame/staking/src/pallet/mod.rs#L160) account, which is the treasury pot account in Polkadot and Kusama. The staking pallet now has a percent storage item, `MaxStakersRewards`, which defines the max percentage of the era inflation that should be allocated to staking rewards. The remaining era inflation (i.e. `remaining = max_era_payout - staking_payout.min(staking_payout * MaxStakersRewards))` is minted directly into the treasury. The `MaxStakersRewards` can be set by a privileged origin through the `set_staking_configs` extrinsic. **To finish** - [x] run benchmarks for westend-runtime Replaces https://github.com/paritytech/polkadot-sdk/pull/1483 Closes https://github.com/paritytech/polkadot-sdk/issues/403 --------- Co-authored-by: command-bot <>
Showing
- polkadot/runtime/westend/src/weights/pallet_staking.rs 105 additions, 101 deletionspolkadot/runtime/westend/src/weights/pallet_staking.rs
- prdoc/pr_1660.prdoc 12 additions, 0 deletionsprdoc/pr_1660.prdoc
- substrate/frame/nomination-pools/test-staking/src/mock.rs 1 addition, 0 deletionssubstrate/frame/nomination-pools/test-staking/src/mock.rs
- substrate/frame/staking/src/benchmarking.rs 6 additions, 1 deletionsubstrate/frame/staking/src/benchmarking.rs
- substrate/frame/staking/src/lib.rs 11 additions, 3 deletionssubstrate/frame/staking/src/lib.rs
- substrate/frame/staking/src/pallet/impls.rs 10 additions, 1 deletionsubstrate/frame/staking/src/pallet/impls.rs
- substrate/frame/staking/src/pallet/mod.rs 8 additions, 0 deletionssubstrate/frame/staking/src/pallet/mod.rs
- substrate/frame/staking/src/tests.rs 84 additions, 4 deletionssubstrate/frame/staking/src/tests.rs
- substrate/frame/staking/src/weights.rs 190 additions, 190 deletionssubstrate/frame/staking/src/weights.rs
Please register or sign in to comment