The LLMOracleCoordinator::finalizeValidation
function is called to finalize validation when the required validations for a request are reached.
This function calls the Statistics::stddev
to calculate the standard deviations for scores of a given generation from different validations.
An issue occurs in Statistics::stddev
when it calls Statistics::variance
which gets the deviation by subtracting data(scores) minus the mean. This is bound to underFlow and panic (revert with panic error) all the time since mean
is of all the scores and some scores will definately be greater than the mean and the underflow occurs since the value is of type uint256
.
https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/libraries/Statistics.sol#L21C8-L24C10
Denial of service and validator and Generator won't be paid their amounts.
Manual Review
consider using type int256
instead of uint256
in Statistics::variance
.
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.