Closed tayfunelmas closed 1 month ago
Attention: Patch coverage is 71.42857%
with 12 lines
in your changes missing coverage. Please review.
Project coverage is 71.58%. Comparing base (
773aae7
) to head (a0d31bc
).
Files with missing lines | Patch % | Lines |
---|---|---|
core/primitives/src/epoch_info.rs | 36.84% | 12 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This change will only take effect with new protocol feature
ChunkEndorsementsInBlockHeader
.We used the endorsement kickout threshold as the cutoff threshold for the endorsement ratio when computing the validator rewards. For context see this thread.
If the validator's endorsement ratio is above the cutoff threshold, the contribution of the endorsement ratio to the average uptime is 1, otherwise it is 0. Then the resulting average uptime is used in two places: 1) When calculating the validator rewards. 2) When sorting the validators by uptime ratio to get the validators exempted from kickout.
In the second case, for chunk validator-only nodes, the average uptime of the validator will be either 1 or 0. Then when calculating the exempted validators, the ordering of the validators will be based on the account id only. This is unfair. To alleviate this fairness, in this PR, we make two changes to break the tie:
1) We remove the use of cutoff threshold when computing the average uptime for the exempted validator calculation. As a result, the raw endorsement ratio is used to sort the validators. 2) If the raw endorsement ratios are equal, we also sort by the stake, before comparing the account ids. Thus, the validator with the higher stake is selected for exemption.
This change only impacts the ordering of validators when selecting the exempted ones; it does not affect other places, such as reward calculation.