Settlement of batch auction can exceed the gas limit
Settlement of batch auction can exceed the gas limit, making it impossible to settle the auction.\\nWhen a batch auction (EMPAM) is settled, to calculate the lot marginal price, the contract iterates over all bids until the capacity is reached or a bid below the minimum price is found.\\nAs some of the operations performed in the loop are gas-intensive, the contract may run out of gas if the number of bids is too high.\\nNote that additionally, there is another loop in the `_settle` function that iterates over all the remaining bids to delete them from the queue. While this loop consumes much less gas per iteration and would require the number of bids to be much higher to run out of gas, it adds to the problem.\\nChange the minimum bid percent to 0.1% in the `EmpaModuleTest` contract in `EMPAModuleTest.sol`.\\n```\\n// Remove the line below\\n   uint24 internal constant _MIN_BID_PERCENT = 1000; // 1%\\n// Add the line below\\n   uint24 internal constant _MIN_BID_PERCENT = 100; // 0.1%\\n```\\n\\nAdd the following code to the contract `EmpaModuleSettleTest` in `settle.t.sol` and run `forge test --mt test_settleOog`.\\n```\\nmodifier givenBidsCreated() {\\n    uint96 amountOut = 0.01e18;\\n    uint96 amountIn = 0.01e18;\\n    uint256 numBids = 580;\\n\\n    for (uint256 i = 0; i < numBids; i++) {\\n        _createBid(_BIDDER, amountIn, amountOut);\\n    }\\n    \\n    _;\\n}\\n\\nfunction test_settleOog() external\\n    givenLotIsCreated\\n    givenLotHasStarted\\n    givenBidsCreated\\n    givenLotHasConcluded\\n    givenPrivateKeyIsSubmitted\\n    givenLotIsDecrypted\\n{        \\n    uint256 gasBefore = gasleft();\\n    _settle();\\n\\n    assert(gasBefore - gasleft() > 30_000_000);\\n}\\n```\\n
An easy way to tackle the issue would be to change the `_MIN_BID_PERCENT` value from 10 (0.01%) to 1000 (1%) in the `EMPAM.sol` contract, which would limit the number of iterations to 100.\\nA more appropriate solution, if it is not acceptable to increase the min bid percent, would be to change the settlement logic so that can be handled in batches of bids to avoid running out of gas.\\nIn both cases, it would also be recommended to limit the number of decrypted bids that can be deleted from the queue in a single transaction.
Settlement of batch auction will revert, causing sellers and bidders to lose their funds.
```\\n// Remove the line below\\n   uint24 internal constant _MIN_BID_PERCENT = 1000; // 1%\\n// Add the line below\\n   uint24 internal constant _MIN_BID_PERCENT = 100; // 0.1%\\n```\\n