The LLMOracleCoordinator
contract manages LLM generation tasks where multiple generators provide responses that are then scored by validators. The getBestResponse()
function is responsible for selecting the winning response based on validation scores.
The getBestResponse()
function has two significant fairness issues in its selection mechanism:
When all scores are 0 (which can happen when all validation scores fall outside the acceptable range in finalizeValidation()
), the function automatically selects the first response without any randomization or failure handling.
When multiple responses have the same highest score, the function always selects the first one encountered, creating an unfair advantage for earlier responders.
The root cause is in the simple comparison logic in getBestResponse()
:
This creates a deterministic bias favoring earlier responses in cases of ties or zero scores.
Medium. While this doesn't lead to direct fund loss, it undermines the fairness of the oracle system by:
Creating an unfair advantage for earlier responders
Potentially selecting low-quality responses when all scores are 0
Reducing the incentive for later responders to provide high-quality responses
Medium. Score ties are likely to occur frequently in real-world scenarios, especially with discrete scoring systems. Zero scores can occur when validators assign scores that fall outside the acceptable range in finalizeValidation()
.
Scenario 1 - Zero Scores:
Task receives 3 responses from different generators
Validators assign scores that fall outside the acceptable range
All responses end up with 0 scores
First response is automatically selected regardless of quality
Scenario 2 - Tied Scores:
Generator A submits response (index 0) with high quality
Generator B submits response (index 1) with equal quality
Both receive same validation scores
Generator A's response is always selected due to lower index
Implement a fair selection mechanism that for tied scores, use a random selection mechanism.
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.