fix(limits): hybrid limit place and fill must not under-estimate gas #1329
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#1329
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
Terra Classic limit orders that use the hybrid AMM plus order-book path still fail often enough that traders fall back to manual gas edits. Reported failures on that path are a wasm or gas-estimate under-run, a “not enough credit” reject, and a
pool_input+book_inputexecute failure. Place, fill, and cancel need to succeed on the common routes without a hand-tuned gas limit.This is the retail limit path (LUNC, UST1, USTR, cUSTC), not a new order type.
Not duplicates
Expected / actual
Given / When / Then
Given a hybrid limit on a common LUNC, UST1, USTR, or cUSTC route,
When the trader places, fills, or cancels without editing gas,
Then the message succeeds when the book and pool can take it, and a rejected size returns a specific error instead of an under-estimate toast or a raw
pool_input/book_inputfailure.Acceptance criteria
Test plan
Attack / abuse
Verification
First-pass model recommendation
Recommendation: grok-high
The path crosses the pair contract, the gas envelope, and retail execute. That is wasm plus wallet scope.
Verified the fix merged through PR #1331. The tested commit
a1028f34is an ancestor of currentorigin/main.make verify-issue-1329: 212 frontend tests, four contract regressions, and documentation cross-links passed.make setup-cloud-localterra,VERIFY_ISSUE_1329_CHAIN=1 make verify-issue-1329passed all three LocalTerra E2E cases. LCDgas_used/gas_wanted: hybrid fill784796/1785500, place666598/4380000, cancel436960/1000000.gas/credit, rejects mismatched hybrid splits, and rolls back a book fill when the pool cannot take its remainder.The invariants and cross-links are documented in limit-orders, frontend, security invariant L25, testing, and the third-party hybrid limit gas playbook.
Remaining operator verification: signed Columbus-5 place, partial hybrid fill, and cancel. This is tracked by the queued cl8y-pm card “Verify hybrid limit flow on Columbus-5” (ID
397a9612-7a49-4b0f-84bc-450fd62e04ed; PM inbox); the card body links this issue and records the transaction links. LocalTerra results are not Columbus-5 production sign-off.