The LibChainlinkOracle
library utilizes a CHAINLINK_TIMEOUT
constant set to 14400
seconds (4 hours). This duration is four times longer than the Chainlink
heartbeat that is 3600
seconds (1 hour), potentially introducing a significant delay in recognizing stale or outdated price data.
The LibChainlinkOracle::checkForInvalidTimestampOrAnswer
function accepts three input arguments: timestamp
, answer
and currentTimestamp
and check if the return answer from Chainlinlink Oracle
or the timestamp is invalid:
The function also checks if the difference between the currentTimestamp
and the timestamp
is greater then CHAINLINK_TIMEOUT
. The CHAINLINK_TIMEOUT
is defined to be 4 hours
:
The Chainlink
heartbeat indicates the expected frequency of updates from the oracle. The Chainlink
heartbeat on Ethereum for Eth/Usd
is 3600
seconds (1 hour).
But the defined CHAINLINK_TIMEOUT
in the LibChainlinkOracle
is 14400
seconds (4 hours).
A CHAINLINK_TIMEOUT
that is significantly longer than the heartbeat can lead to scenarios where the LibChainlinkOracle
library accepts data that may no longer reflect current market conditions. Also, in volatile markets, a 4-hour window leads to accepting outdated prices, increasing the risk of price slippage.
Manual Review
Consider reducing the CHAINLINK_TIMEOUT
to align more closely with the Chainlink
heartbeat on Ethereum, enhancing the relevance of the price data.
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.