53061 sc high asymmetric rounding in commission ceil for users floor for validators enables per segment rounding loss validators can amplify via frequent commission checkpoints
Description
Vulnerability Details
// In _calculateRewardsCore(...) for the user
uint256 grossRewardForSegment =
(userStakedAmount * rewardPerTokenDeltaForUserInSegment) / REWARD_PRECISION;
uint256 commissionForThisSegment =
_ceilDiv(grossRewardForSegment * effectiveCommissionRate, REWARD_PRECISION);
if (grossRewardForSegment >= commissionForThisSegment) {
totalUserRewardDelta += grossRewardForSegment - commissionForThisSegment;
} else {
// net reward becomes 0 for this segment
}Impact Details
Proof of Concept
Previous53063 sc low maxvalidatorpercentage can be used to dos protocol staking Next53059 sc low reward rate checkpoints are used but are never set
Was this helpful?