After the task status changes to PendingValidation
, validators begin validating requests for the specified taskId
in LLMOracleCoordinator
. The final validator then computes the validation scores for that task. When calculating variance in the variance
function: uint256 diff = data[i] - mean;
could return a negative value if data[i] < mean
, which is not permitted in uint256
.
Let’s examine how validation scores are calculated for a given task:
Suppose numGenerations == 2
and numValidations == 3
.
The last validator (oracle) triggering the private function finalizeValidation
. In the loop, scores are obtained for the first generation:
After this, the stddev
function from the Statistics
library is called to calculate the mean and standard deviation:
The scores assigned by validators for the first generation are passed to the stddev
function. The stddev
function calls the variance
function, which does not account for case where a score from some validator might be lower than the mean score, causing a revert:
A score from a validator might be lower than the mean score, either due to a malicious validator or as a result of natural validation.
Validation will not be finalized, the requester will not receive the best response, and generators and validators will not be paid.
Manual review
Consider handling a scenario where the score is less than the mean score.
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.