chore(moolah-vault): increase MAX_QUEUE_LENGTH from 100 to 1000 - #222
Conversation
Pull Request ReviewThis Solidity PR increases Sensitive ContentNo sensitive content detected. Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
Pull Request ReviewThis Solidity PR increases Sensitive ContentNo sensitive content detected. Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
…o 600 Bump ConstantsLib.MAX_QUEUE_LENGTH from 100 to 600. Capped at 600 (not higher) so a full-length setSupplyQueue -- one cold SSTORE (~22.1k) plus a cold validation SLOAD (~2.1k) per element, ~24.9k/element -- stays under the BEP-652 per-transaction gas limit of 16,777,216; 1000 elements (~25M gas) would make a full-length supply queue unsettable. Adapt the vault unit tests to the larger limit: - Decouple NB_MARKETS from MAX_QUEUE_LENGTH so the shared setUp no longer creates one market per queue slot for every vault test. - Rewrite testAcceptCapMaxQueueLengthExceeded to create markets on demand and enable them via direct O(1) setCap instead of the O(n^2) supply-queue rebuilding helper. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7c5ed09 to
ba75a70
Compare
Pull Request ReviewThis Solidity PR raises Sensitive ContentNo sensitive content detected. Security Issues🟠 [HIGH] Larger queues may make vault deposits or withdrawals exceed the transaction gas limit
Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
Summary
Increases the hardcoded maximum supply/withdraw queue length in
MoolahVaultfrom 100 to 1000.src/moolah-vault/libraries/ConstantsLib.sol:MAX_QUEUE_LENGTH100→1000This constant caps both the supply and withdraw queues, enforced in:
MoolahVault.setSupplyQueue(MoolahVault.sol:245)MoolahVault.updateWithdrawQueue(MoolahVault.sol:643)Both now allow up to 1000 markets in the queue.
Testing
forge buildpasses.🤖 Generated with Claude Code