-
Notifications
You must be signed in to change notification settings - Fork 732
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
Implements partial inflation minting to treasury #1483
Conversation
bot bench substrate-pallet --pallet=pallet_staking |
bot help |
…=dev --target_dir=substrate --pallet=pallet_staking
bot bench polkadot-pallet --runtime polkadot |
bot bench polkadot-pallet --pallet=pallet_staking --runtime polkadot |
bot clean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat skeptical of this implementation being in the right path.
Staking already have a way to communicate "what should I do with the rest of my rewards?", which is RewardRemainder
.
It seems a bit sloppy to add another similar mechanism that says "before I distribute my rewards, what should I do with it?".
I kinda wish there was a way to reuse RewardRemainder
to bundle it into a single new hook that expresses what should be done with rewards.
Lastly, you are making a few important assumptions:
- That a treasury pallet exists.
- How this treasury pallet's pallet id should be converted into an account id.
Ideally, all of this should be more abstract.
My idea is that the treasury payment and validator rewards are both first citizen reward "receivers", thus there could be still a remainder. I will look into this direction again though.
Good point, I think that there are a few things that could be changed: 1) renaming "TreasuryPot" to something else, 2) have a way to request the account ID of a type that implements a new Using the trait EDIT: instead of creating a new |
bot fmt |
@gpestana https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/3697257 was started for your command Comment |
@gpestana Command |
My idea is that the treasury payment and validator rewards are both first citizen reward "receivers", thus there could be still a remainder. I will look into this direction again though.
Good point, I think that there are a few things that could be changed: 1) renaming "TreasuryPot" to something else, 2) have a way to request the account ID of a type that implements a new Using the trait EDIT: instead of creating a new |
@kianenigma to touch base on your comment to abstract this further and use the My current perspective is that the Following that, I think that having an explicit Otoh, we could refactor the way we handle the reward remainder and |
Being replaced by #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/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 <>
Unify the operating mode for bridge pallets - define the OperationMode trait and BasicOperatingMode enum - use the OperationMode trait in all the bridge pallets - use BasicOperatingMode instead of IsHalted for the Grandpa pallet - use BasicOperatingMode as part of MessagesOperatingMode Signed-off-by: Serban Iorga <[email protected]>
This PR implements an optional minting of the inflation directly into a pot.
The staking pallet now has a percent storage item,
InflationLevyFraction
, which defines the percentage of the era inflation that should be minted directly into an account (the treasury's account). The remaining of the fraction is the validators rewards for that era. TheInflationLevyFraction
can be set via extrinsic by the staking admin origin through theset_treasury_fraction
callable. TheInflationLevyFraction
default is 0.Treasury
Get<AccountId>
implementationThis PR also implements the
Get<AccountId>
in the treasury pallet which exposes an account id derived at the origin. This helps the staking pallet to request the account ID of the treasury pallet, instead of deriving it locally based on its pallet ID.Closes #403