Gauge reward distribution will fail instead of filling the buffer, despite the gauge being eligible for the buffer
Whenever distributeRewards is called in GaugeController.sol, fixed emissions are split across all active gauges, according to their weight
Afterwards, the gauge receives it's rewards through notifyRewardAmount. During the execution, the amount being supplied is checked whether it surpasses the state max emission
This is incorrect since amount is an arbitrary number which fluctuates constantly based on gauges' weights. There is no guarantee that all notifyRewardAmount calls will always sum up perfectly.
An example:
Gauge has state.emission = 2000, state.distributed = 1500, all previous emissions supplied in 500 token increments
Gauge's weight increases (due to user voting) and is now eligible for rewards = 550
distributeRewards is called, 550 tokens are attempted to be sent to the gauge, yet it reverts in the snippet above since 550 + 1500 > 2000
Gauges will hardly ever hit their max emissions, despite being eligible to do so. These rewards are lost for the gauge voters and stakers.
Loss of rewards, logic error
Instead of reverting, fill the buffer
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.