pub trait StakerRewardCalculator<Balance> {
// Required methods
fn calculate_validator_incentive_weight(self_stake: Balance) -> Balance;
fn calculate_staker_reward(
validator_total_reward: Balance,
validator_commission: Perbill,
validator_own_stake: Balance,
total_exposure: Balance,
) -> StakerRewardResult<Balance>;
}Expand description
Handles two independent reward calculations:
-
Staker reward split (
Self::calculate_staker_reward) — determines how a validator’s staking reward is divided between the validator and their nominators. -
Validator incentive weight (
Self::calculate_validator_incentive_weight) — determines a validator’s relative share of a separate validator incentive pot, based on self-stake. This incentive pot is validator-only; nominators do not receive from it.
Required Methods§
Sourcefn calculate_validator_incentive_weight(self_stake: Balance) -> Balance
fn calculate_validator_incentive_weight(self_stake: Balance) -> Balance
Compute a weight for this validator’s share of the validator incentive pot.
Called once per validator during era planning. All validators’ weights are summed, and
each validator’s incentive payout is proportional to their_weight / total_weight.
Sourcefn calculate_staker_reward(
validator_total_reward: Balance,
validator_commission: Perbill,
validator_own_stake: Balance,
total_exposure: Balance,
) -> StakerRewardResult<Balance>
fn calculate_staker_reward( validator_total_reward: Balance, validator_commission: Perbill, validator_own_stake: Balance, total_exposure: Balance, ) -> StakerRewardResult<Balance>
Split a validator’s staking reward into validator and nominator portions.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.