https://github.com/Cyfrin/2024-07-zaros/blob/main/src/perpetuals/branches/LiquidationBranch.sol#L42-L86
The unchecked iteration in checkLiquidatableAccounts
can cause transactions to revert due to gas limits being exceeded when processing a large number of accounts.
The function checkLiquidatableAccounts
iterates over a potentially large range of accounts, from lowerBound
to upperBound
, without any mechanism to ensure it stays within the gas limits. This can lead to situations where the function runs out of gas, causing the transaction to revert and potentially leading to denial of service.
Gas Limit Exceeded: Transactions can revert if the iteration exceeds the gas limit.
Denial of Service: Legitimate operations might be delayed or prevented due to reverted transactions.
Manual
Implement Iteration Limits: Break the task into smaller chunks to ensure the gas limit is not exceeded.
Optimize Iteration Logic: Use more efficient data structures or algorithms to minimize gas usage during iteration.
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.