0LNetworkCommunity / libra-framework

6 stars 25 forks source link

Last Validator No Rewards #241

Closed davidrotari19 closed 3 weeks ago

davidrotari19 commented 2 months ago

Describe the bug The total deposited/paid reward for outgoing validators is not the expected amount. Checking the calls to 01::diem_governance::trigger_epoch at epoch boundary on epochs 18, 19, 20, and 21 suggests that only the last Validator as in 01::stake::ValidatorSet does not receive the reward.

To Reproduce Steps to reproduce the behavior: [x] Call the 01::diem_governance::trigger_epoch at epoch boundary

Expected behavior All the outgoing compliant Validators should have the expected deposited/paid reward given by the nominal_val_reward.

Desktop:

Additional context In the case of epochs 18, 19, 20, 21 the system_fees_collected which acts as a reward budget follows the following inequality (num_compilant_validators - 1) nominal_reward_to_vals < reward_budget < num_compilant_validators nominal_reward_to_vals. So the total reward budget is just enough to deposit/pay rewards only for num_compilant_validators - 1. The inequality was checked for all the epochs mentioned.