The fillOffchainOrders function in SettlementBranch.sol can cause an indefinite denial of service (DoS) to the protocol if one of the checks within the loop reverts. This issue can prevent all other off-chain orders from being processed until the problematic order is manually resolved, potentially leading to significant disruptions in the protocol's operation.
The fillOffchainOrders function processes multiple off-chain orders by verifying various conditions and executing them based on provided details. However, if any order within the batch fails a check (e.g., if sizeDelta is zero), the function will revert, causing the entire transaction to fail. This behavior can lead to an indefinite DoS as other valid orders will not be processed until the offending order is addressed.
When the fillOffchainOrders function is called, it iterates through each off-chain order, performing several checks and operations. If any check fails, the function reverts, and no further orders are processed. For instance, if ctx.offchainOrder.sizeDelta is zero, the function reverts with an error. Since the function is called by Chainlink keepers, which might process multiple orders in one transaction, the failure of a single order can block all subsequent orders in the same batch.
If the fillOffchainOrders function reverts due to any check failure within the loop, it will prevent all subsequent orders from being processed. This can cause a backlog of unfilled orders, leading to significant delays and potential financial losses for users and the protocol. Additionally, if users are not liquidated when they should be, they could bypass liquidation if the price moves in their favor, potentially resulting in bad debt for the protocol.
Manual review
If any of the checks that rely on users order is likely to revert use continue instead of revert.
If you send 1 cancel and 1 create it should still run the cancel, not revert everything.
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.