Skip to content
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 maximum validator payout per era #1859

Closed
wants to merge 1 commit into from

Conversation

gpestana
Copy link
Contributor

@gpestana gpestana commented Oct 12, 2023

This PR implements an (optional) cap of the era inflation that is allocated to staking rewards. This mechanism can be used to guarantee a minimum treasury inflow as per this discussion.

The (percent) maximum validators payout can be set through SystemCall::set_storage.

Note: The storage parameter type in the runtime configs only sets the pre-set_storage default value. Once the value is set on-chain, the default will be a noop and not anymore a source of truth.

Todo (once merged)

  • update the fellowship runtimes accordingly (era_payout impl included)

Related to and possibly replacing #1660
Closes #403

@gpestana gpestana added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Oct 12, 2023
@gpestana gpestana self-assigned this Oct 12, 2023
@gpestana gpestana requested review from a team October 12, 2023 09:13
@gpestana gpestana requested a review from a team October 12, 2023 09:13
@gpestana gpestana marked this pull request as draft October 12, 2023 09:13
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/3946274

@gpestana gpestana marked this pull request as ready for review October 12, 2023 09:34
@gpestana gpestana requested review from kianenigma and Ank4n October 12, 2023 09:40
@@ -352,7 +353,8 @@ impl pallet_staking::Config for Runtime {
type SlashDeferDuration = SlashDeferDuration;
type AdminOrigin = frame_system::EnsureNever<()>;
type SessionInterface = Self;
type EraPayout = pallet_staking::ConvertCurve<RewardCurve>;
type MaxValidatorsPayout = MaxValidatorsPayout;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type MaxValidatorsPayout = MaxValidatorsPayout;

If you were to do this approach, I don't think there is any need to pass MaxValidatorsPayout to the staking pallet. Whatever cap is needed, should already be applied to RewardCurve or whatever type is implementing type EraPayout.

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit wrong because of https://github.com/paritytech/polkadot-sdk/pull/1859/files#r1382983349, but in any case we probably won't need it.

@gpestana
Copy link
Contributor Author

gpestana commented Nov 6, 2023

Closing due to #403 (comment)

@gpestana gpestana closed this Nov 6, 2023
bkchr pushed a commit that referenced this pull request Apr 10, 2024
* message delivery transaction is not free!!!

* test pays_fee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[NPoS] Mint fixed portion of inflation directly into the treasury
3 participants