fix(frontend): symmetric BID ladder crossing guard when best ask empty (#385) #914
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!914
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-385-ladder-bid-crossing-guard"
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
Fixes #385 — follow-up to #297 / MR !757. The limit ladder crossing guard blocked ASK rungs below
best_bidbut silently allowed BID rungs above market whenbest_askwas empty or not yet resolved.Root cause:
limitBidCrossesBestAskreturnsfalsewhenbestAskis missing, so the ladder guard was skipped while ASK still blocked against a populated bid book. The retailTradeOrderTicketalso has a tape/pool reference gate; the ladder panel only had book-head checks.Changes:
describeLimitCrossingBlockerWithRef— book head first, then tape/AMMrefToken1PerToken0fallback when the opposite book side is empty/limits(useLimitOrderPriceRefBundle) intoLimitOrderLadderPaneluseTradeBestBookPricesfrom cachedlimitBookPageinfinite-query data when dedicated head fetches are still emptyAcceptance checklist
N of M rungs will cross the market…cd frontend-dapp && npm test -- LimitOrderLadderPanel.crossing(case: nullbestAsk+ ref 1.1, prices 15–18)ladder-place-submitdisabledbest_bidstill blockeddescribeLimitCrossingBlockerWithRefunit coveragecd frontend-dapp && npm test -- limitOrderNonCrossingmutationFnloops rungs withdescribeLimitCrossingBlockerWithRefmake lint-frontendmake setup-cloud-localterra && make dev→/limitsLadder tabbestAsk)Verification for third parties
Manual (LocalTerra + Keplr):
make setup-cloud-localterra && make devhttp://127.0.0.1:5173/limits, connect wallet, select CORAL/EMBER15, end18→ expect crossing warning + disabled submit0.1, end0.5→ expect same guard (regression)Blockers
None for merge from automated checks. Manual LocalTerra walkthrough recommended before release QA.
mentioned in commit
8a5c9e85a2Security review — MR !914
Commit reviewed:
5850aa28ba51d5ab36fdeaa7230c448cba24e8c1Scope: Symmetric BID ladder crossing guard when
best_askis empty —describeLimitCrossingBlockerWithRef,useTradeBestBookPricescache seeding, ladder panel wiring fromuseLimitOrderPriceRefBundle, tests/docs.Outcome:
FINDINGS: 0medium+Prior threads: No prior security-review notes on this MR; nothing to re-report.
Analysis summary
This change extends an existing client-only post-only UX guard (documented as non-authoritative; the pair contract still accepts crossing limits on-chain). Review traced attacker-controlled inputs (ladder prices, pair selection) to sinks (inline guard messages,
mutationFnre-check before broadcast).refis a finitenumber; book prices use existing decimal-string helpers. No new HTML/dangerouslySetInnerHTMLpaths.refToken1PerToken0and book heads come from the same indexer/LCD sources already used byTradeOrderTicket/evaluateLimitOrderPricePlaceGate. Misreported market data could mislead the placing user about crossing risk; it does not grant access to third-party funds or bypass on-chain checks.limitBookPage)pairAddress+ side; dedicated head fetch takes precedence when non-null. Stale cache may affect submit UX for the connected user only.best_ask, and stricter than before when a reference is available. Not an exploitable cross-user boundary.Inline threads: None (no medium+ findings).
Security review: no medium+ findings on this diff.