Dria

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

Missing multiplication to generationDeviationFactor in `finalizeValidation`

Summary

This error is just my guess, that the code lacks multiplication, I can be wrong, so I put severity = low.

In the finalityValidation function, stddev is subtracted from mean. Here are two examples of code.

first

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
_increaseAllowance(validations[taskId][v_i].validator, task.validatorFee);
}
}

second

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);
}
}

as we see, in the second example stddev is multiplied by generationDeviationFactor.

However, the protocol also has a validationDeviationFactor variable that is only initialized and not used anywhere.

Suppose that it should have been in the first case.

If it is not, then this variable is dead code and can be deleted.

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.