Skip to content

[Staking] Self stake incentive for Validators#11651

Open
Ank4n wants to merge 23 commits intoankn-staker-reward-from-potfrom
ankn-validator-incentive
Open

[Staking] Self stake incentive for Validators#11651
Ank4n wants to merge 23 commits intoankn-staker-reward-from-potfrom
ankn-validator-incentive

Conversation

@Ank4n
Copy link
Copy Markdown
Contributor

@Ank4n Ank4n commented Apr 6, 2026

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:

  • Below optimum: w(s) = √s
  • Between optimum and cap: w(s) = √(T + k² × (s - T)) (diminishing returns)
  • Above cap: plateau

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_dap now snapshots both staker reward and incentive pots. Era planning calculates and stores incentive weights for each elected validator. Pruning cleans up ErasValidatorIncentive storage.

Payout: do_payout_stakers_by_page calls pay_validator_incentive_for_page after staker rewards. Direct Currency::transfer from incentive era pot to payout account.

TODO

  • Run staking async bench (after 11616 is merged)

@Ank4n Ank4n changed the title vibed - need to review these properly [Staking] Self stake incentive for Validators Apr 6, 2026
@Ank4n Ank4n force-pushed the ankn-validator-incentive branch from 447f986 to 63c712f Compare April 6, 2026 15:28
@Ank4n Ank4n added the T2-pallets This PR/Issue is related to a particular pallet. label Apr 6, 2026
@Ank4n Ank4n marked this pull request as ready for review April 6, 2026 15:56
@Ank4n Ank4n requested a review from a team as a code owner April 6, 2026 15:56
/// 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(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this needs to be properly benchmarked - but it's in your TODO list already

_ => {
defensive!("Validator missing payee");
Self::deposit_event(Event::<T>::Unexpected(
UnexpectedKind::ValidatorMissingPayee { era },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we want to add a test checking for ValidatorMissingPayee event?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T2-pallets This PR/Issue is related to a particular pallet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants