[Staking] Self stake incentive for Validators#11651
Open
Ank4n wants to merge 23 commits intoankn-staker-reward-from-potfrom
Open
[Staking] Self stake incentive for Validators#11651Ank4n wants to merge 23 commits intoankn-staker-reward-from-potfrom
Ank4n wants to merge 23 commits intoankn-staker-reward-from-potfrom
Conversation
24 tasks
447f986 to
63c712f
Compare
sigurpol
reviewed
Apr 7, 2026
| /// Changes take effect in the next era when rewards are calculated. | ||
| #[pallet::call_index(34)] | ||
| #[pallet::weight(T::WeightInfo::set_validator_self_stake_incentive_config())] | ||
| pub fn set_validator_self_stake_incentive_config( |
Contributor
There was a problem hiding this comment.
this needs to be properly benchmarked - but it's in your TODO list already
sigurpol
reviewed
Apr 7, 2026
sigurpol
reviewed
Apr 7, 2026
sigurpol
reviewed
Apr 7, 2026
| _ => { | ||
| defensive!("Validator missing payee"); | ||
| Self::deposit_event(Event::<T>::Unexpected( | ||
| UnexpectedKind::ValidatorMissingPayee { era }, |
Contributor
There was a problem hiding this comment.
do we want to add a test checking for ValidatorMissingPayee event?
Contributor
Author
There was a problem hiding this comment.
since it panics in the test, I can't assert on event, can I? But added a test for panic (so practically the same thing)
sigurpol
reviewed
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracted from #10844.
Builds on #11616.
Specs: https://hackmd.io/@jonasW3F/rkN6BXE2ex
Overview
Adds a separate validator self-stake incentive reward track. Validators receive an additional bonus from a dedicated
incentive pot, proportional to their self-stake weight. Payout is flat liquid. Vesting implementation will be in a follow-up PR.
Incentive Weight Curve
Each validator's share of the incentive pot is determined by a piecewise sqrt function:
w(s) = √sw(s) = √(T + k² × (s - T))(diminishing returns)Weights are calculated during era planning and stored per-validator. At payout, each validator's incentive =
(their_weight / total_weight) × era_incentive_budget, prorated across pages.Changes
New storage:
OptimumSelfStake,HardCapSelfStake,SelfStakeSlopeFactor,ErasValidatorIncentiveAllocation(era budget snapshot),ErasTotalValidatorWeight,ErasValidatorIncentive(per-validator weights).New extrinsic:
set_validator_self_stake_incentive_config: sets optimum, cap, and slope factor. Callable by StakingAdmin. Validates optimum ≤ cap.New event:
ValidatorIncentivePaid { era, validator_stash, dest, amount }Era lifecycle:
end_era_dapnow snapshots both staker reward and incentive pots. Era planning calculates and stores incentive weights for each elected validator. Pruning cleans upErasValidatorIncentivestorage.Payout:
do_payout_stakers_by_pagecallspay_validator_incentive_for_pageafter staker rewards. DirectCurrency::transferfrom incentive era pot to payout account.TODO