-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NPoS] Mint fixed portion of inflation directly into the treasury #403
Comments
It would be good to be more forward looking and design something for that that would also work for a parachain. Would probably mean taking away the minting from staking and doing it elsewhere. |
This issue has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/revising-polkadots-ideal-staking-rate-calculation/3897/1 |
This issue has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/adjusting-polkadots-ideal-staking-rate-calculation/3897/6 |
For the record, we'll implement these changes using the parameters pallet (under development) (#2061) so that the era payout parameters can be changed using selected origins. |
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/fb0fd3e62445eb2dee2b2456a0c8574d1ecdcc73/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 #1483 Closes #403 --------- Co-authored-by: command-bot <>
…#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/d349b45d086199af7ad0195534e2b913ba9b6827/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 paritytech#1483 Closes paritytech#403 --------- Co-authored-by: command-bot <>
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
* extract ChainBase to bp-runtime * post-merge fixes * cargo fmt --all * compilation fixes * reexport BlockNumberOf, HashOf, HeaderOf
It's been proposed and discussed a change to the current inflation model where a fixed portion of the inflation is minted directly into the treasury, while the remaining portion is distributed as rewards as per the current mechanism. The main goal is to ensure the sustainability of the treasury in the long term (more info in this thread).
In addition, it would be helpful to allow governance to change the percentage of inflation minted into the treasury.
Implementation suggestions
fn era_payout
calculates the portion of payout that is distributed among stakers (validator_payout
) and the treasury based on perthingTreasuryFraction
, in storage.ErasValidatorReward
istotal_payout - total_payout * TreasuryFraction
. From here on, the logic of the stakers' rewards remains the same.Treasury::account_id()
(another option would be to cache treasury rewards and mint into the treasury pot every X eras, but probably not worth the effort/storage).TreasuryFraction
perthing, gated by root.The text was updated successfully, but these errors were encountered: