paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.com/
1.89k stars 696 forks source link

Deprecate the era inflation distribution from the staking pallet. #6158

Open gpestana opened 3 weeks ago

gpestana commented 3 weeks ago

The https://github.com/paritytech/polkadot-sdk/pull/5999 somewhat overlaps with the MaxStakedRewards and the era payout distribution that happens at the staking level.

In Westend the staking pallet will make sure that the era validator payout is max MaxStakedRewards is enforced . Since the EraPayout implementation in Westend is returning a 15% to treasury and 85% to stakers, the staking pallet will adjust the staker payout to 80% and remainder value to 20% (effectively overwritting the values returned by EraPayout impl).

It is cleaner to perform the treasury/stakers era inflation distribution in the implementation of the EraPayout, instead of doing it at the staking pallet level (I'd go further and make the & parameterizable with the params pallet, which does not seems to be the case atm).

By moving the era inflation to the EraPayout implementation, we can remove the distribution (MaxStakedRewards, etc) logic from the staking pallet.

Note: ensure that both Kusama and Polkadot runtimes have the EraPayout implementation up to date with the era payout distribution before rolling out these changes in the staking pallet.

Note 2.: MaxStakedRewards in Kusama and Polkadot is set to None, thus the over-writing of the inflation distribution is disabled.

### Tasks
- [ ] Parameterise the min treasury era inflation with params pallet https://github.com/paritytech/polkadot-sdk/pull/6165
- [ ] Ensure `pallet-parameters` if being be used in Kusama and Polkadot (audited + released)
- [ ] Remove `MaxStakedRewards` and related logic from `pallet-staking`