Fix e2e-seed-expired-parked-claim-all.sh: hybrid park swap missing min_return (#334) #339
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#339
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
Terrad harness
scripts/e2e-seed-expired-parked-claim-all.shfails when parking expired limits via pure-book hybrid swap because the swap hook omitsbelief_priceandmin_return, violating pair invariant L9 / GitLab #334. This breakslimit-orders-claim-all-tx.spec.tsand blocks #292 strictmake test-e2etx phase.Current codebase
Seed harness
scripts/e2e-seed-expired-parked-claim-all.sh:frontend-dapp/.env.local(VITE_FACTORY_ADDRESS, LCD).place_limit_order_batch(dev wallet /terrad_tx).block_time >= expires_at.pool_input: "0"(book-only leg): — nobelief_price, nomin_return, notrader.limit_order_expired_parked×2 → indexerparked_expiredfor dev wallet.Playwright consumer
frontend-dapp/e2e/limit-orders-claim-all-tx.spec.ts— callsseedExpiredParkedLimitsForClaimAllE2e()then drives Claim all parked UI (#259).limit-placements?status=parked_expiredfor ≥ 2 rows.On-chain rule (GitLab #334)
smartcontracts/packages/dex-common/src/max_spread.rs— pure-book hybrid (pool_input = 0,book_input > 0) on execute requiresbelief_priceormin_return.hybrid_pure_book_requires_slippage_floor_without_beliefinlimit_order_tests.rs— passes withmin_return: Some(Uint128::one()).docs/integrators.md§ Slippage; skillskills/AGENTS_MAX_SPREAD_HYBRID.md.Similar harness (may need same fix)
scripts/qa/verify-issue-309.sh—hybrid_swap_book_only()also usesbelief_price: nullwithoutmin_return(audit when fixing seed script).Why this is needed
e2e-tx33/38 with this harness called out explicitly.Constraints / guardrails
min_return— use a small floor (e.g.1raw unit) only to satisfy execute; parking behavior depends on book walk, not output amount.belief_price— acceptable if set from pair pool/book context; prefermin_returnfor scripted terrd paths (no price oracle in bash).MAX_EXPIRED_PARKS_PER_SWAP(15); script places only 2 orders.echopair addr + tx hints on success.make deploy-local+e2e-start-indexer.sh+ dev-wallet provision (LT11 order).e2e-txproject; no parallel claim tests on same wallet.Relevant files
scripts/e2e-seed-expired-parked-claim-all.shscripts/lib/e2e-terrad-tx.shfrontend-dapp/e2e/limit-orders-claim-all-tx.spec.ts,e2e/helpers/limit-expiry-park-e2e.tssmartcontracts/tests/src/limit_order_tests.rs,dex-common/src/max_spread.rsscripts/qa/verify-issue-309.sh(related)skills/AGENTS_E2E_LIMIT_ORDERS_TX.md,skills/AGENTS_FRONTEND_LIMIT_PARKED_EXPIRED.md,docs/testing.md,frontend-dapp/e2e/README.mdRecommended solution direction
SWAP_HOOKJSON in seed script to include full swap envelope:bash scripts/e2e-seed-expired-parked-claim-all.sh— confirm terrd tx succeeds and LCD events includelimit_order_expired_parked.limit-orders-claim-all-tx.spec.tsend-to-end.verify-issue-309.shhybrid_swap_book_onlyin same MR if QA script is broken on main.min_returnrationale ine2e/README.md(one line cross-link #334).Acceptance criteria
bash scripts/e2e-seed-expired-parked-claim-all.shexits 0 on fresh LocalTerra deploy with indexer syncing.belief_price/min_returnrevert).parked_expiredplacements for dev wallet on seeded pair within poll window.limit-orders-claim-all-tx.spec.tspasses under--project=e2e-tx.Test plan — functional paths
expires_at.limit_order_expired_parked(or batch park events)..../limit-placements?status=parked_expiredreturns dev-wallet rows./limits→ Claim all parked → confirm (LUNC gas copy) → batch claim tx → rows cleared.Test plan — attack / hack / abuse vectors
min_return: 1must not enable value extraction — floor is minimal; verify taker still pays fullbook_inputescrow; no free mint path.block_time; attempting early swap should not createparked_expired(harness should fail loudly, not claim success).Verification criteria
bash scripts/e2e-seed-expired-parked-claim-all.sh— exit 0, stderr clean.bash scripts/with-node.sh --cwd frontend-dapp -- npx playwright test e2e/limit-orders-claim-all-tx.spec.ts --project=e2e-tx— pass.CI=1 make test-e2etx phase includes claim-all green.make test-contracts— no regressions (harness-only change).Related
mentioned in issue #292
mentioned in commit 81b1b85c16807e7b5e68e36b517cbf6502746ecf
mentioned in commit
a0cccd0456Verification complete — #339
All acceptance criteria PASS after harness fix. MR: !841
Pre-fix (baseline)
bash scripts/e2e-seed-expired-parked-claim-all.shfailed at hybrid park step:Post-fix verification
bash scripts/e2e-seed-expired-parked-claim-all.sh→seeded pair=terra146y… owner=terra1x46… expires_at=…parked_expiredGET /api/v1/pairs/{pair}/limit-placements?status=parked_expiredlimit-orders-claim-all-tx.spec.tsnpx playwright test … --project=e2e-tx— 1 passed (60s)verify-issue-309.shbook-only helpermin_return: "1"Changes in MR
scripts/e2e-seed-expired-parked-claim-all.sh—min_return: "1"on pure-book park swapscripts/qa/verify-issue-309.sh— same floorfrontend-dapp/e2e/README.md,skills/AGENTS_E2E_LIMIT_ORDERS_TX.md— #334 cross-linksIssue left open pending MR merge.
mentioned in merge request !841
mentioned in commit
d07ba09bedmentioned in merge request !842
Took this — same min_return floor I added to verify-issue-285.sh, so I knew the shape.
scripts/e2e-seed-expired-parked-claim-all.sh: the pure-book park swap (pool_input:"0", book_input>0) now sets min_return:"1" on the Cw20HookMsg::Swap, clearing the L9/#334 guard on execute. Kept max_spread:"1", left belief_price null — min_return is the right floor for a scripted terrad path with no oracle, exactly the guardrail you spelled out.
Also patched scripts/qa/verify-issue-309.sh — same belief_price:null / no-min_return shape, gave it the same floor (not re-run in full; identical contract path).
Verified live, not just the edit:
#334 untouched on-chain — harness-only, both scripts. MR !842 (fork→main). Needs your merge — @PlasticDigits.
mentioned in issue #337
Update — !841 (
a0cccd0) already merged the same min_return floor while I was on this, so my !842 was a duplicate. Closed it and dropped the branch.The merged fix matches what I shipped (min_return:"1" on the pure-book swap hook, both the seed and verify-309), so my live run stands as verification of the merged version: the seed parks both expired bids in one tx (lifecycle_status=parked_expired), and I drove the dapp's "Claim all parked (2)" against fresh parked orders — one claim_expired_limit_orders batch, single combined refund, both flip to refunded. Merged harness fix is good end to end.
Verification complete — #339
All acceptance and verification criteria PASS on
main(83dc192).Results
bash scripts/e2e-seed-expired-parked-claim-all.sh— hybrid park tx succeedsmin_return:"1"on pure-book swap hooklimit-orders-claim-all-tx.spec.tsnpx playwright test … --project=e2e-tx— 1/1 (68s)verify-issue-309.shalignedmin_return:"1"floor presentMerged fix: !841.
Re-verify checklist
bash scripts/e2e-seed-expired-parked-claim-all.sh— exit 0npx playwright test e2e/limit-orders-claim-all-tx.spec.ts --project=e2e-tx— pass