fix(limits): budget gas for insertion walks #1331

Merged
PlasticDigits merged 2 commits from fix/1329-hybrid-limit-gas into main 2026-09-23 16:56:15 +00:00

Refs #1329

Summary

  • Derive limit place, batch/ladder, and price-relink gas limits from max_adjust_steps instead of relying on rung count or fixed defaults.
  • Include every rung's bounded walk budget in batch gas because skipped rungs may retry a head walk before the insert cursor advances.
  • Use the same step-aware gas in LUNC preflight, Max reserve, and ladder summary. Ignore URL gas / credit fields.
  • Humanize no-rung placement and insufficient-pool-liquidity failures. Add a contract regression proving a failed hybrid pool remainder leaves maker escrow and order state unchanged.

Verification

  • make verify-issue-1329 — 7 frontend test files / 212 tests, contract rollback/split/partial-batch/cancel tests.
  • VERIFY_ISSUE_1329_CHAIN=1 make verify-issue-1329 — 3/3 LocalTerra transaction checks; LCD gas_used < gas_wanted:
    • Hybrid fill: 934,191 / 1,785,500.
    • High (128-step) place: 678,417 / 4,380,000; CW20 hook contains max_adjust_steps=128.
    • Cancel: 446,494 / 1,000,000.
  • npm run lint — 0 errors; 5 existing hook-dependency warnings.
  • cargo fmt --all -- --check.
  • Commit hooks: cargo clippy, TypeScript check, lint-staged, and gitleaks passed.
  • Columbus-5 place/fill/cancel on a common economic pair. Requires the operator wallet or multisig. A follow-up is queued in cl8y-pm as 397a9612-7a49-4b0f-84bc-450fd62e04ed.

No pair wasm migration is required for this dApp gas-envelope change. The PR does not claim Columbus-5 sign-off.

Refs #1329 ## Summary - Derive limit place, batch/ladder, and price-relink gas limits from `max_adjust_steps` instead of relying on rung count or fixed defaults. - Include every rung's bounded walk budget in batch gas because skipped rungs may retry a head walk before the insert cursor advances. - Use the same step-aware gas in LUNC preflight, Max reserve, and ladder summary. Ignore URL `gas` / `credit` fields. - Humanize no-rung placement and insufficient-pool-liquidity failures. Add a contract regression proving a failed hybrid pool remainder leaves maker escrow and order state unchanged. ## Verification - [x] `make verify-issue-1329` — 7 frontend test files / 212 tests, contract rollback/split/partial-batch/cancel tests. - [x] `VERIFY_ISSUE_1329_CHAIN=1 make verify-issue-1329` — 3/3 LocalTerra transaction checks; LCD `gas_used < gas_wanted`: - Hybrid fill: 934,191 / 1,785,500. - High (128-step) place: 678,417 / 4,380,000; CW20 hook contains `max_adjust_steps=128`. - Cancel: 446,494 / 1,000,000. - [x] `npm run lint` — 0 errors; 5 existing hook-dependency warnings. - [x] `cargo fmt --all -- --check`. - [x] Commit hooks: `cargo clippy`, TypeScript check, lint-staged, and gitleaks passed. - [ ] Columbus-5 place/fill/cancel on a common economic pair. Requires the operator wallet or multisig. A follow-up is queued in cl8y-pm as `397a9612-7a49-4b0f-84bc-450fd62e04ed`. No pair wasm migration is required for this dApp gas-envelope change. The PR does not claim Columbus-5 sign-off.
fix(limits): budget gas for bounded book walks
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
3bbd76832f
Author
Owner

drain skip: no occupying job for rebase/fix-pr/CI-wait; remaining continue

drain skip: no occupying job for rebase/fix-pr/CI-wait; remaining continue
Author
Owner

drain skip: default autoland requires tip ACCEPT (#77)

drain skip: default autoland requires tip ACCEPT (#77)
Merge remote-tracking branch 'origin/main' into fix/1329-hybrid-limit-gas
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
a1028f3417
# Conflicts:
#	AGENTS.md
#	frontend-dapp/src/utils/__tests__/swapQueryParams.test.ts
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!1331
No description provided.