Return values from Chainlink's latestRoundData is not checked properly
Summary
Chainlink's latestrounddata() is used but there is no check if the return value indicates stale data. This could lead to stale prices according to the Chainlink documentation:
Jaraxxus
medium
Return values from Chainlink's latestRoundData is not checked properly
Summary
Chainlink's latestrounddata() is used but there is no check if the return value indicates stale data. This could lead to stale prices according to the Chainlink documentation:
https://docs.chain.link/docs/historical-price-data/#historical-rounds
Vulnerability Detail
The protocol uses chainlink to query the result to get the latest price. However, there is no check if the return value indicates stale data.
Impact
Stale price may be queried.
Code Snippet
https://github.com/sherlock-audit/2023-05-perennial/blob/main/perennial-mono/packages/perennial-oracle/contracts/types/ChainlinkAggregator.sol#L32-L48
Tool used
Manual Review
Recommendation
Check roundId and roundCompleteness to see whether the data is stale. Also, check whether
updatedAt
is checked accordingly.