The OracleHelper::_recalibratePreview function will enforce a limitation on the iterationCount ensuring that it is greater-than-or-equal-to the value of 2. This limitation is incorrect as an iterationCount of 2 would result in the currentSecondBiggest yielded by the function to be always 0.
Impact:
As an iterationCount of 2 is permitted incorrectly, the Chainlink delay permitted would be 0 causing the oracle to appear "dead" regardless of its update rate.
We advise the code to impose a limitation on the iterationCount that ensures it is greater-than-or-equal-to 3 instead, ensuring that 2 rounds are processed and thus yielding a potentially non-zero value for the currentSecondBiggest delay between Chainlink answers.
OHR-03M: Incorrect Iteration Count Limitation
Description:
The
OracleHelper::_recalibratePreview
function will enforce a limitation on theiterationCount
ensuring that it is greater-than-or-equal-to the value of2
. This limitation is incorrect as aniterationCount
of2
would result in thecurrentSecondBiggest
yielded by the function to be always0
.Impact:
As an
iterationCount
of2
is permitted incorrectly, the Chainlink delay permitted would be0
causing the oracle to appear "dead" regardless of its update rate.Example:
Recommendation:
We advise the code to impose a limitation on the
iterationCount
that ensures it is greater-than-or-equal-to3
instead, ensuring that 2 rounds are processed and thus yielding a potentially non-zero value for thecurrentSecondBiggest
delay between Chainlink answers.