MarketConfiguration.update()
simply forgets to set the value priceFeedHeartbeatSeconds
to storage.
Here you can see it fetches value from configuration and uses Chainlink:
And here it reverts:
https://github.com/Cyfrin/2024-07-zaros/blob/d687fe96bb7ace8652778797052a38763fbcbb1b/src/external/chainlink/ChainlinkUtil.sol#L60-L62
priceFeedHeartbeatSeconds
can't be set to config, so function PerpMarket.getIndexPrice()
will always revert.
PerpMarket.getIndexPrice()
always reverts due to stale price. It doesn't revert only in one case when price update was filled in the current block when tx is being executed.
So most of the time protocol can't operate due to that revert because this function is used in core: createOrder, fillOrders, liquidate.
Manual Review
Set:
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.