Closed tayfunelmas closed 1 month ago
Attention: Patch coverage is 93.61702%
with 18 lines
in your changes missing coverage. Please review.
Project coverage is 71.45%. Comparing base (
3718df6
) to head (1197e10
). Report is 1 commits behind head on master.
Files with missing lines | Patch % | Lines |
---|---|---|
chain/epoch-manager/src/lib.rs | 38.88% | 10 Missing and 1 partial :warning: |
core/primitives/src/epoch_manager.rs | 41.66% | 5 Missing and 2 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Issue: #11900.
This PR introduces a cutoff threshold for chunk endorsement ratio. We use the same kickout threshold as the cutoff threshold. It is currently 80, but we will make it 70 when stabilizing this feature.
If the endorsement ratio is less than the cutoff ratio, it is treated 0, otherwise treated 1, when computing the average uptime ratio (including block and chunk production and endorsement).
For this, we introduce a new struct
ValidatorOnlineThresholds
to containonline_min_threshold
andonline_max_threshold
as well asendorsement_cutoff_threshold
(initialized to the kickout threshold=70 if featureChunkEndorsementsInBlockHeader
is enabled).ValidatorOnlineThresholds
is initialized fromEpochConfig
. We pass this struct tocalculate_rewards
, which then callsget_validator_online_ratio
to apply the cutoff if present.We performed simulation of last 5 epochs in mainnet, results are in this doc. Only the chunk validators with very low endorsement ratio are kicked out and do not get any reward.
Testing: We added some unittests for the basic logic. We will later add integration tests for the full behavior.