The fillOffchainOrders is called by the keeper with an array of valid off-chain orders belonging to different accounts, the problem here is that a trader can cancel an order before it is sent on-chain. Doing this will make the call to the fillOffchainOrders revert. Therefore the other users won't have their off-chain orders fulfilled.
Offchain orders are sent on-chain by the keeper, the fillOffchainOrders loops through the array of orders provided by the keeper, and checks if they are valid, one of the checks here is that the off-chain order nonce is the same as the tradingAccount nonce. i.e (ctx.offchainOrder.nonce != tradingAccount.nonce), if the two nonces are not equal the transaction reverts.
https://github.com/Cyfrin/2024-07-zaros/blob/main/src/perpetuals/branches/SettlementBranch.sol#L236
Off-chain orders can be canceled by calling the cancelAllOffchainOrders function, this function can be called anytime by the trading account owner. This function increases the nonce and makes (ctx.offchainOrder.nonce != tradingAccount.nonce) it be true. Thereby causing a revert on the fillOffchainOrders function.
https://github.com/Cyfrin/2024-07-zaros/blob/main/src/perpetuals/branches/OrderBranch.sol#L374
Keeper is sending a list of 100 off-chain orders
Bob a malicious user can cancel their offchain order just before the keeper sends it. This cancels the transaction for everyone.
Denial of service and Griefing.
Manual
Put the checks at the top of the function before any state changes and use of 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.