The finalizeValidation function computes the inner_score for each generation using validator scores. However, integer division in Solidity can cause precision loss, truncating decimal values and possibly underestimating inner_score. This results in a reward score that inaccurately represents validators' contributions.
In Solidity, division of integers truncates any remainder instead of rounding, which can lead to precision loss. This is particularly impactful in the finalizeValidation function when calculating the inner_score
This calculation loses precision for cases where innerSum is not perfectly divisible by innerCount. For example, if innerSum is 10 and innerCount is 3, inner_score would be computed as 3 instead of 3.33, resulting in a lower-than-expected score.
Due to the precision loss, validators may receive a score that underestimates their contributions.
Manual code Review
use fixedMath library from oz
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.