Benchmark MAX_EXPIRED_PARKS_PER_SWAP vs gas ceiling (GitLab #309) #794
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!794
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cursor/gitlab-issue-workflow-f6fa"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes the evidence gap from GitLab #289 / #309: benchmark
MAX_EXPIRED_PARKS_PER_SWAP(15) against Terra Classic max gas and tx size on optimized wasm, add regression tests, and document results.Outcome: retain 15 — isolated worst case at the cap is ~855k
gas_used(≪ 12M headroom under the 15M dApp ceiling).MAX_SCAN_STEPS(500) remains the binding traversal budget on deep expired prefixes; skipped head orders are cheap (~3.7k gas) and clear on the next swap.Merge resolution (2026-06-05): Rebased onto
main—Makefileconflict resolved by keepingverify-issue-309alongside main'sverify-issue-313,verify-issue-295, andsetup-cloud-localterratargets.Issue: https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/309
Closes #309
Changes
scripts/qa/verify-issue-309.sh+make verify-issue-309— LocalTerra sweep N=1..30, records gas/events/tx bytesdocs/limit-orders.md§ Expired-park benchmark — methodology + results tableAGENTS_TERRACLASSIC_GAS.md,contracts-security-audit.mdL5,pair.rscommentAcceptance checklist
glab mr view 76→can_be_mergeddocs/limit-orders.md#expired-park-benchmark-gitlab-309hybridBookWalkLimits.tsunchanged value; hybridSwapGas testslimit_order_tests::{hybrid_walk_at_cap_*, expired_parks_benchmark_*, hybrid_walk_pool_only_*}verify-issue-309.shL291–292make test-contractsmake test-contracts(366 integration + unit)make test-frontend(gas helper)npx vitest run hybridSwapGas.test.ts(9/9)make verify-issue-309(28/28 checks; prior run on optimized wasm)Verification for third parties
Governance note
Cap unchanged — no pair wasm redeploy required for this MR (comment/doc/test only in
dex-common).mentioned in issue #309
changed the description
changed the description
Security review
Commit reviewed:
00e6467733db9258901b991f1a1c15198ddb7d22Scope: MR !794 — benchmark / regression / documentation for
MAX_EXPIRED_PARKS_PER_SWAP(GitLab #309). Files:scripts/qa/verify-issue-309.sh,limit_order_tests.rs(3 new tests),docs/limit-orders.md,AGENTS_TERRACLASSIC_GAS.md,contracts-security-audit.md, comment-only updates index-common/pair.rsandhybridBookWalkLimits.ts,Makefiletarget.Outcome:
FINDINGS: 0medium+Inline threads: none (no medium+ findings on this diff)
Summary
This MR adds evidence and automation around an existing on-chain cap (
MAX_EXPIRED_PARKS_PER_SWAP = 15). No wasm logic, constant value, auth path, or user-facing runtime behavior changes.Reviewed attack surfaces relevant to the diff:
verify-issue-309.shjq --argjson/ bash arithmetic; no eval, no remote user input, no secret logging. Not a production attack surface.hybridBookWalkLimits.tsMAX_EXPIRED_PARKS_PER_SWAPvalue unchanged.Prior security properties (park cap, scan-step budget, owner-only cancel, pause gates, hint side validation) are unchanged and not weakened by this diff.
Security review: no medium+ findings on this diff.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit
00e6467733. Configure here.Missing failure when tx bytes absent
Low Severity
The sweep case treats missing
tx_bytesas success: whentx_serialized_bytesreturns nothing, neither pass nor fail runs for the tx-size acceptance criterion.gas_usedcorrectly fails as unavailable, so a broken tx query can still yield a passing run while skipping the documented 1 048 576-byte check.Reviewed by Cursor Bugbot for commit
00e6467733. Configure here.added 1 commit
f3a0334c- Fail sweep case when tx_bytes is unavailableCompare with previous version
changed the description
resolved all threads
Security review
Commit reviewed:
f3a0334c5c4b9fe1e081db9835bf219fb8e05a0aScope: MR !794 — benchmark / regression / documentation for
MAX_EXPIRED_PARKS_PER_SWAP(GitLab #309). Files:scripts/qa/verify-issue-309.sh,limit_order_tests.rs(3 new tests),docs/limit-orders.md,AGENTS_TERRACLASSIC_GAS.md,contracts-security-audit.md, comment-only updates index-common/pair.rsandhybridBookWalkLimits.ts,Makefiletarget.Outcome:
FINDINGS: 0medium+Inline threads: none (no medium+ findings on this diff)
Delta since prior review (
00e6467)Latest commit tightens QA integrity in
verify-issue-309.sh: whentx_serialized_bytesreturns nothing, the sweep case now records a failure instead of silently skipping the tx-size check. This is a test-harness hardening change, not a production attack surface.Summary
This MR adds evidence and automation around an existing on-chain cap (
MAX_EXPIRED_PARKS_PER_SWAP = 15). No wasm logic, constant value, auth path, or user-facing runtime behavior changes.Reviewed attack surfaces relevant to the diff:
verify-issue-309.shjq --argjson/ bash arithmetic; no eval, no remote user input, no secret logging. Not a production attack surface.hybridBookWalkLimits.tsMAX_EXPIRED_PARKS_PER_SWAPvalue unchanged.Prior security properties (park cap, scan-step budget, owner-only cancel, pause gates, hint side validation) are unchanged and not weakened by this diff.
Security review: no medium+ findings on this diff.
added 39 commits
main6463af2b- Merge origin/main into cursor/gitlab-issue-workflow-f6fa — resolve Makefile conflictCompare with previous version
changed the description
changed the description
Security review
Commit reviewed:
6463af2bb561e031a2693d2f5f38e9133c5cdd7eScope: MR !794 vs
main— benchmark / regression / documentation forMAX_EXPIRED_PARKS_PER_SWAP(GitLab #309). Eight files:scripts/qa/verify-issue-309.sh,limit_order_tests.rs(3 new tests),docs/limit-orders.md,skills/AGENTS_TERRACLASSIC_GAS.md,contracts-security-audit.md, comment-only updates index-common/pair.rsandhybridBookWalkLimits.ts,Makefile(verify-issue-309target).Outcome:
FINDINGS: 0medium+Inline threads: none (no medium+ findings on this diff)
Delta since prior review (
f3a0334)Latest commit merges
origin/mainand resolves theMakefileconflict (addsverify-issue-309alongside existingverify-issue-*targets). No new production code paths, auth changes, or on-chain constant changes beyond what was already reviewed onf3a0334.Summary
This MR adds evidence and automation around an existing on-chain cap (
MAX_EXPIRED_PARKS_PER_SWAP = 15). Wasm logic and the constant value are unchanged.verify-issue-309.shjq --argjson/ bash arithmetic; noeval, no remote user input, no secret logging.tx_bytesmissing now fails the case (lines 287–293). Not a production attack surface.hybridBookWalkLimits.tsPrior security properties (park cap, scan-step budget, owner-only cancel, pause gates, hint side validation) are unchanged and not weakened by this diff.
Security review: no medium+ findings on this diff.
mentioned in commit
c0d8ad6c49