The startedAt
value returned by sequencerUptimeFeed.latestRoundData()
should be checked against zero as stated in the Chainlink documentation at the bottom of the code example.
The chainlink docs (very end of article, below code example) say that sequencerUptimeFeed can return a 0 value for startedAt if it is called during an "invalid round":
startedAt
: This timestamp indicates when the sequencer changed status. This timestamp returns 0 if a round is invalid.
When the sequencer comes back up after an outage, wait for theGRACE_PERIOD_TIME
to pass before accepting answers from the data feed.
SubtractstartedAt
fromblock.timestamp
and revert the request if the result is less than theGRACE_PERIOD_TIME
.
This was also confirmed by chainlink team:
This makes the implemented check below to be useless if its called in an invalid round (meaning startedAt == 0
), as block.timestamp - startedAt
will always be > Constants.SEQUENCER_GRACE_PERIOD_TIME
:
inadequate checks to confirm the correct status of the sequencerUptimeFeed in ChainlinkUtil::getPrice()
contract will cause getPrice() to not revert even when the sequencer uptime feed is not updated or is called in an invalid round.
Manual review
Add a check for startedAt == 0
, this is an example but you might prefer to process this scenario differently:
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.