Cancelled limit order remains in indexer placements list -> raw contract storage error surfaced on duplicate cancel attempt #135
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#135
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?
Issue Summary
After a limit order is successfully cancelled, the order continues to appear in the indexer's recent placements list. A user who sees the order still listed may attempt to cancel it a second time. The second cancel attempt is rejected on-chain with a raw contract storage error containing a binary map key, this is completely unreadable to a user and provides no actionable guidance.
Reproduction Steps
/limits, place a limit order, and confirm placementExpected Behavior
Either:
In neither case should a raw contract storage key be shown to the user.
Actual Behavior
The cancelled order persists in the placements list. A second cancel attempt is submitted on-chain and rejected with the following raw error surfaced directly in the UI:
The binary key (
[00, 0C, 6C, ...]) is an internal contract storage reference with no meaning to a user. No human-readable "already cancelled" message is shown.Environment Details
localterra(local Docker)VITE_NETWORK=local npm run devmake indexer-dev)make deploy-localWallet / Device Details
http://localhost:1317, RPChttp://localhost:26657Severity / Impact
P3 Nit. Does not block DEX usage or hinder normal user flow — no funds are at risk and the duplicate cancel fails safely. Two improvements warranted:
cc @PlasticDigits
mentioned in commit
2e77eede9bUpdate (implemented on
main, mergec4bc1c2)What changed
GET /api/v1/pairs/{addr}/limit-placementsnow returns only placement rows whose(pair_id, order_id)has no matching row inlimit_order_cancellations(SQLNOT EXISTS). Added(pair_id, order_id)index on cancellations for the anti-join. Full cancel history stays on.../limit-cancellations.limitPlacementsand pair-scopedlimitCancellations. If the typed order id already appears in indexed cancellations, Cancel is disabled and the wallet is not invoked. CosmWasmLimitOrdermap not found / binary key errors are humanized viatryHumanizeTerraTxMessage(withhumanizeCosmwasmLimitOrderMissingMessage).handleTransactionErrorno longer treats any substringrejectedas a wallet reject, so #134 max-spread copy (Trade rejected: ...) is not misclassified as user rejection.Docs / agent crosslinks
docs/limit-orders.md,docs/indexer-invariants.md,skills/AGENTS_LOCALNET_TRADING_SWARM.mdupdated and cross-linked to #135.Verification checklist (please confirm)
order_id; cancellations endpoint still lists the cancel./limitsand Trade panel: after cancel, active placements refresh; duplicate cancel for the same id is blocked when indexed.cd frontend-dapp && npx vitest run src/utils/__tests__/limitOrderCancelUserMessage.test.ts src/services/terraclassic/__tests__/transactions.test.tscd indexer && cargo test --test api_pairswith Postgres forget_pair_limit_placements_and_cancellations.@totdking — could you verify on your LocalTerra stack and confirm the checklist? Leaving the issue open as requested.
mentioned in issue #134
Verification checklist
order_id; cancellations endpoint still lists the cancel./limitsand Trade panel: after cancel, active placements refresh; duplicate cancel for the same id is blocked when indexed.cd frontend-dapp && npx vitest run src/utils/__tests__/limitOrderCancelUserMessage.test.ts src/services/terraclassic/__tests__/transactions.test.tscd indexer && cargo test --test api_pairswith Postgres forget_pair_limit_placements_and_cancellations.Final verdict
This is resolved, good to go
cc: @PlasticDigits
qa cleared, good to close @PlasticDigits
mentioned in issue #337
mentioned in issue #412
mentioned in issue #419
mentioned in issue #530