Dria

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

Tasks with no validations will always take the first generator result whatever it was

Description

To get the bestResponse we compare the score for generation, and take the best score.

llm/LLMOracleCoordinator.sol#L413-L422

function getBestResponse(uint256 taskId) external view returns (TaskResponse memory) {
...
TaskResponse storage result = taskResponses[0];
uint256 highestScore = result.score;
for (uint256 i = 1; i < taskResponses.length; i++) {
>> if (taskResponses[i].score > highestScore) {
highestScore = taskResponses[i].score;
result = taskResponses[i];
}
}
return result;
}

The score value in generator responses, is assigned by Validators. but for no validators for that task, all scores will be zero, making always the first generator output is the best one.

This will make other generations useless, and nonsense to the task requester.

Recommendations

We think that making a task with no validations only requires one generator as it will always be the output. Or there may be another method for picking the best response at this case.

Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Return value of `getBestResponse` when no validators

Support

FAQs

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