Security: no LocalTerra swap trace to verify route display aligns with actual submit operations [SEC-E07] #428
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#428
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
swapRouteDisplay.test.tscovers unit logic for computing the displayed path and verifies thatderiveSwapSubmitRouteSourcereturns the correct source branch (indexer, client BFS, direct, wrap/unwrap) for each route scenario. Unit coverage is present. The checklist also requires a LocalTerra swap trace or e2e test confirming the displayed path matches the wasm operations actually submitted on-chain. No such trace or e2e test exists indocs/runbooks/,frontend-dapp/e2e/, or any script.What Was Checked
frontend-dapp/src/utils/swapRouteDisplay.test.ts:computeSwapRouteDisplay,deriveSwapSubmitRouteSource,tokenPathFromSwapOperations,tokenPathForNativeSupportedRouteall unit tested. No on-chain verification.docs/runbooks/(full listing verified):blacklist-decision.md,emergency-commands.md,governance-emergency-rehearsal.md,launch-checklist.md,wasm-admin-migration.md, and others. No swap route trace or route-alignment transcript.frontend-dapp/e2e/: Playwright specs exist (e.g.,wrap-swap.spec.ts) but no spec asserting displayed route tokens match submitted wasm events.scripts/: no LocalTerra swap script comparing UI route display to on-chain event output.Expected (per checklist)
A LocalTerra swap trace or e2e test must confirm that for at least one multi-hop and one direct pair swap, the route shown in the UI matches the operations submitted to the chain.
Actual
Only unit tests of display logic exist. A rendering mismatch between the displayed path and the submitted operations would not be caught automatically.
Evidence
frontend-dapp/src/utils/swapRouteDisplay.test.ts: unit coverage present, no on-chain tracedocs/runbooks/: no route-alignment document foundfrontend-dapp/e2e/: no route-alignment Playwright specSuggested Fix
Add a Playwright e2e test that selects a multi-hop route on the swap page, captures the displayed path tokens, submits the swap, and checks the wasm execute events for the same hop sequence. As interim evidence, a LocalTerra swap transcript attached to this issue showing the displayed route (screenshot or log) and the submitted tx JSON is sufficient until an automated test is written.
Verification Checklist
Labels
security,pre-launchCc: @PlasticDigits
Dropped an interim LocalTerra trace here — the checklist accepts a transcript until the automated e2e lands, and that e2e is the agent:implement MR. Traced the displayed route source (indexer route/solve hops + router_operations — what the UI renders via computeSwapRouteDisplay, already unit-tested in swapRouteDisplay.test.ts) against the operations actually submitted on-chain, for both a multi-hop and a direct swap.
Multi-hop — EMBER -> RUBY (1 EMBER), tx 126A86DF, code 0:
Direct — TOPAZ -> OPAL (1 TOPAZ), tx 1B88B2CF, code 0:
No duplicate or conflicting route segments in either: multi-hop is exactly one swap event per displayed hop (2), direct is exactly one (1).
Two notes worth carrying into the automated e2e:
This is the data-layer + on-chain half. The remaining piece is the automated Playwright spec that captures the rendered route line and asserts it against the submit payload — that's the agent:implement MR, and the rendered-pixel capture is the laptop/clean-host part. @PlasticDigits — interim trace attached per the checklist; the automated test stays on the agent.
mentioned in issue #381
mentioned in commit
36e322bf49mentioned in merge request !963
mentioned in commit
de59858d9aVerification complete — SEC-E07 / #428
All acceptance criteria PASS. No repo changes; closing issue.
Checklist
e2e/swap-route-alignment-tx.spec.ts— multihop test (CORAL→IRON, ≥2 wasm hops); UIswap-route-summarysymbols equal txoffer_asset/ask_assetsequence. Interim LocalTerra trace in @Brouie comment (EMBER→JADE→RUBY, tx 126A86DF) also satisfies checklist.assertNoDuplicateRouteSegmentsine2e/helpers/route-alignment-e2e.tsruns on both display and tx paths in e2e assertions.How verified
bash scripts/with-node.sh --cwd frontend-dapp -- npm run test -- --run src/utils/swapRouteDisplay.test.ts— 5/5 passed (computeSwapRouteDisplay,deriveSwapSubmitRouteSource, path helpers).make setup-cloud-localterra(fresh deploy after stale-volume reset); LocalTerra + indexer up.CI=1 bash scripts/with-node.sh --cwd frontend-dapp -- npx playwright test e2e/swap-route-alignment-tx.spec.ts --project=e2e-tx— 2 passed (54s): direct pair + multihop hybrid.skills/AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.md§ On-chain route alignment;frontend-dapp/e2e/README.mdanddocs/testing.mdcross-link the spec.Follow-ups (optional)
/trade→ Market tab) route alignment e2e is not covered by this spec (Swap/only today); consider if product wants parity.