In the case of highly dispersed score values, mean
could be less than standard deviation therefore causing calculations to revert.
In the score filtering logic of finalizeValidation
, the protocol uses the difference between the mean and standard deviation as a lower bound to cut off outliers, relying on the assumption that the mean is greater than the standard deviation.
However, this assumption is not always valid, as we will demonstrate further.
Let’s consider the following example with four validation oracles returning the corresponding scores:
It is clear that the fourth oracle is an outlier that needs to be excluded from the awards, and its data should be rejected. However, let’s examine what the calculations will show in this case:
As clearly illustrated by the calculation results, the mean is less than the standard deviation. Therefore, the code at line #343 will revert due to arithmetic underflow.
Task validation cannot be finalized due to arithmetic underflow, blocking purchases.
Manual review
Use zero if the mean is less than the standard deviation.
Alternatively, consider employing other methods to filter out outliers.
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.