Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: high
Invalid

validationDeviationFactor is not being enforced like generationDeviationFactor

Summary

validationDeviationFactor is not being enforced like generationDeviationFactor

Vulnerability Details

Here are variables and their purpose

/// @notice The deviation factor for the validation scores.
uint64 public validationDeviationFactor;
/// @notice The deviation factor for the generation scores.
uint64 public generationDeviationFactor;

LLMOracleManager.sol#L35

Here, we can see that only accurate responder are being awarded based on generationDeviationFactor

for (uint256 g_i = 0; g_i < task.parameters.numGenerations; g_i++) {
// ignore lower outliers
if (generationScores[g_i] >= mean - generationDeviationFactor * stddev) {
_increaseAllowance(responses[taskId][g_i].responder, task.generatorFee);
}
}

LLMOracleCoordinator.sol#L368

But, validationDeviationFactor is not being enforced anywhere in project which will lead to incorrect validator being awarded.

Impact

incorrect validator being awarded.

Tools Used

Recommendations

Seems liks code should look like this

for (uint256 v_i = 0; v_i < task.parameters.numValidations; ++v_i) {
uint256 score = scores[v_i];
if ((score >= _mean - _stddev) && (score <= _mean + _stddev)) {
innerSum += score;
innerCount++;
// send validation fee to the validator
+ if (score + validationDeviationFactor * stddev >= mean ) {
_increaseAllowance(validations[taskId][v_i].validator, task.validatorFee);
+ }
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.