A validator oracle would never be able to validate a completed taskID
if its validation scores for each generation are not all the same (which is very unlikely).
A validator calls LLMOracleCoordinator::validate() to validate requests for a given taskId
, and if its completed - the validation scores are finalized with a call to LLMOracleCoordinator::finalizeValidation().
Within this function, the mean and standard deviation are computed with a call to Statistics::stddev(). Here is the extract of the function:
Within the stddev()
function, variance()
is called, but this function has a bug when calculating the diff
between the current number in the array and the mean of the array:
As my comment explains, the difference between the current number in the iteration and the mean is calculated - but this is done wrongly as an underflow is certain to occur as long as the numbers/scores are not all the same e.g mean of numbers [7, 5, 12, 10] = 8.5 (rounded to 8 in solidity)
, by calculating 5 - 8
this way - an underflow error occurs which causes the entire operation to revert.
This makes it impossible for a validator to finalize scores for a taskID. The only way to avoid this error is to grade all scores for each generation with the same number, but this is very much counterintuitive as it's unreasonable to grade all responses the same - as even completely wrong answers would be graded the same as the best answer.
DOS for a validator attempting to finalize a validation.
Manual && Solidity
Cast the number and mean to int256
to allow underflow i.e 5 - 8 = -3
, and get the absolute number
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.