Submitted by xiaoming90
It was observed that if the bribe rewards are not collected in the current period, they will not be accrued to future epoch, and they will be lost forever.
When a briber adds in a new bribe reward, the reward information are stored in the Bribe.tokenRewardsPerEpoch mapping. This mapping stored the number of rewards tokens per epoch.
Assume that a briber adds 100 DAI token as bribe reward in epoch 0 (current epoch), they will be stored in:
tokenRewardsPerEpoch[DAI][Epoch0+1(Bribe Lag)] = 100 DAI tokens
Bribe.sol#L41
The  Voter.distribute()function only allows users to distribute the bribe rewards in the current epoch. Calling theVoter.distribute function will in turn trigger the Gauge.deliverBribes function.
In the Gauge.deliverBribes function, the code uint bribeStart = block.timestamp - (block.timestamp % (7 days)) + BRIBE_LAG; will always return the start date of current epoch + BRIBE_LAG (1 day).  So, if someone call Gauge.deliverBribes in epoch 1, the bribeStart variable will be set to the Epoch 1 + 1 day. Due to the above method of fetching bribe rewards and the use of per epochs reward mapping, there is no way to fetch the bribe rewards in the previous epoch(s).
Assume that no one triggered the Voter.distribute() in epoch 0, the 100 DAI tokens bribe rewards will be lost forever.
Gauge.sol#L173
Devise a new implementation to allow bribe rewards not collected to be accured to future epochs so that the bribe rewards will not be lost. Consider referencing the Solidys Bribe contract, which support these requirements.
pooltypes (Velodrome) acknowledged and commented:
Alex the Entreprenerd (judge) decreased severity to Medium and commented:
