Function snarkvm_synthesizer::vm::staking_rewards
source · pub fn staking_rewards<N: Network>(
stakers: &IndexMap<Address<N>, (Address<N>, u64)>,
committee: &Committee<N>,
block_reward: u64
) -> IndexMap<Address<N>, (Address<N>, u64)>
Expand description
Returns the updated stakers reflecting the staking rewards for the given committee and block reward.
The staking reward is defined as: block_reward * stake / total_stake
.
This method ensures that stakers who are bonded to validators with more than 25% of the total stake will not receive a staking reward. In addition, this method ensures stakers who have less than 10 credit are not eligible for a staking reward.
The choice of 25% is to ensure at least 4 validators are operational at any given time, since our security model adheres to 3f+1, where f=1. As such, we tolerate Byzantine behavior up to 33% of the total stake.