Oracle begins in stale state due to uninitialized lastOracleUpdateTime
#39
Labels
Low/Info
A Low/Info severity issue.
lastOracleUpdateTime
#39
Description
In the context of
BinaryEligibilityOracleEarningPowerCalculator
,lastOracleUpdateTime
is used to determine if the oracle setting the scores for individual delegatees is stale. Unfortunately this value is not set in the constructor, meaning the oracle begins in the stale state. This means that a user can initialize many deposits which have max earning power right after calculator creation. Unless these deposits are bumped usingrequestedTip == 0
, these deposits will be valid when rewards are first notified and will be eligible for rewards.BinaryEligibilityOracleEarningPowerCalculator.sol#L109-L122:
Recommendation
Please consider initializing
lastOracleUpdateTime
, to avoid it being stale at the start:BinaryEligibilityOracleEarningPowerCalculator.sol#L109-L122:
constructor( address _owner, address _scoreOracle, uint256 _staleOracleWindow, address _oraclePauseGuardian, uint256 _delegateeScoreEligibilityThreshold, uint256 _updateEligibilityDelay ) Ownable(_owner) { _setScoreOracle(_scoreOracle); STALE_ORACLE_WINDOW = _staleOracleWindow; _setOraclePauseGuardian(_oraclePauseGuardian); _setDelegateeScoreEligibilityThreshold(_delegateeScoreEligibilityThreshold); _setUpdateEligibilityDelay(_updateEligibilityDelay); + lastOracleUpdateTime = block.timestamp; }
The text was updated successfully, but these errors were encountered: