Router unwrap_output fails after wrap-mapper drops Config.fee_bps #523
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#523
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?
Problem
!1054 taught the frontend to dual-read wrap-mapper
fee_wrap_bps/fee_unwrap_bps(legacy{ fee_bps }only before migrate). The router wasm still deserializesdex_common::wrap_mapper::ConfigResponse.fee_bpsonunwrap_outputsettlement (R3).After ustr-cmm#9 migrate, mapper
Configdropsfee_bps(no contract dual-read).query_wasm_smartthen fails,reply_swap_hopaborts, and native-out Swap reverts.Called out as follow-up on !1054 /
skills/AGENTS_WRAP_MAPPER_SPLIT_FEES.md.Fix
Configindex-common(same W13 rules as the dApp).fee_unwrap_bps(legacyfee_bpsonly when both split fields are absent).Verify
make verify-issue-NNN(unit + unwrap settlement against post-migrate Config JSON).mentioned in commit
f120f2daf8mentioned in merge request !1056
Merge review (!1056) — residual gaps
Local sanity:
make verify-issue-5235/5 PASS (dex-common wrap_mapper dual-read, unwrap_output split Config + R3, docs/router 1.1.0, retest). GitLab CI on !1056 did not run tests — jobs failed withci_quota_exceeded(no runner).Code review vs #523 / W13 / R3: PASS. Dual-read matches dApp rules; post-migrate Config without
fee_bpsis covered bytest_unwrap_output_split_fee_config_no_fee_bps.Acceptance still open (ops)
set_fees200/51 (ustr-cmm#13). If mapper migrates first, old routerunwrap_outputstill reverts.{ fee_bps }mapper remains compatible.CI quota is an infra problem, not a test failure. Merging !1056 without waiting for CI per review request.
mentioned in commit
18af28792cmentioned in issue PlasticDigits2/ustr-cmm#13
mentioned in issue PlasticDigits2/ustr-cmm#9
mentioned in issue #516
Wrap-mapper already migrated — router store/migrate is now live-blocking
ustr-cmm#13 store + migrate +
SetFeesalready landed (2026-08-15). Live mapperterra1xuuuh…nmd2is code11574/{ fee_wrap_bps: 200, fee_unwrap_bps: 51 }with nofee_bps.So the “same window” gate in this issue is late on the mapper side. Until router 1.1.0 (!1056) is stored and migrated, on-chain
unwrap_output/ native-out Swap can still revert on the oldConfig.fee_bpsdeserialize.Leaving closed (code merged). Remaining AC is human wasm store + migrate — do that next, then Coolify smoke on ustr-cmm#13.
mentioned in issue #512
Preflight (columbus-5) — router migrate rollback record
Recorded 2026-08-15T12:05:33Z from operator host. Repo
main@bc61fe6.Router (save for rollback)
terra1e7s0h9ftxakwca5gxspyt4haeuaqxds6swr08ul3tsepq7el924sprrsrwcode_id11507terra1zlmv2xydxcusurtr6rl78wsvytdc6mfex6hep7(DEX 2-of-3)Migrate target: store new router wasm (cw2 1.1.0) then
wasm migratewith'{}'signed by that admin. Rollback = migrate back to11507if that code stays on chain.Wrap-mapper (already split — #516 / ustr-cmm#13)
./scripts/check-ust1-wrap-ops-health.sh— 12 PASS / 4 WARN / 0 FAILfee_wrap_bps/fee_unwrap_bpsfee_bpsempty)terra16j5u6ey7a84g40sr3gd94nzg5w5fm45046k9s2347qhfpwm5fr6sem3lr2(CMM)terra1xsecn4snv94ezcez0z3vq8an9j4h4kxxcydp8l(wrap stack — do not use for router migrate)Native-out Swap is unsafe on router 11507 until 1.1.0 migrate: mapper no longer returns
fee_bps.Health WARNs (not a router-migrate blocker)
From the same #503 probe:
last_update_sec=1786769540(2026-08-15T04:52:20Z), age 25954s vsmax_oracle_age_sec=21600. Silence threshold 21600s exceeded (pager should have fired). Window/oracle not paused;fee_bps=100; rate1225611462101223983.8186501(warn < 1e9); allowance treasury→window0(warn < 1e9)./ust1redeem capacity is constrained until topped up / spender limit set.These are wrap-window ops (#503), not DEX router wasm admin.
Router wasm stored (columbus-5) — not migrated yet
Recorded 2026-08-15T12:12:50Z. Repo
main@bc61fe6.CE71DA4892CEB7DC6848449DAD9DB468E39BD5FC38A44CF95E2C010F9289E4362995894011576terra1hu4zggf3f8yw6jw3rxrjxn2drwad675gq5k2lv(cl8ydeploy)data_hash6B038FD75742A3CF99C41B712B7B7B1F0A4C5320FCA1B77A8CDDD6D26E886491(matches localcl8y_dex_router.wasm)3320040/ used2236001Live router is still
11507/ admin DEX 2-of-3terra1zlmv2xydxcusurtr6rl78wsvytdc6mfex6hep7.Next: 2-of-3
wasm migraterouter →11576with'{}'. Rollback target remains11507.Router migrated to 1.1.0 (columbus-5)
Recorded 2026-08-15T12:17Z. Repo
main@bc61fe6.0D9FBBFBB7E0B9E0719EDA9B17263696103762EB943D7717FE8C37FBEE61B7D929958992MsgMigrateContract'{}'terra1zlmv2xydxcusurtr6rl78wsvytdc6mfex6hep7terra1e7s0h9ftxakwca5gxspyt4haeuaqxds6swr08ul3tsepq7el924sprrsrw11507→11576terra1zlmv2xydxcusurtr6rl78wsvytdc6mfex6hep7463290/ used157454LCD
contract_infoafter include:code_id=11576, admin still 2-of-3.On-chain
#523wasm step is done. Remaining: Coolify indexer + frontend for#522, then smoke native-out unwrap/swap (mapper already200/51). Rollback = migrate back to11507.Direct wrap/unwrap smoke (cl8ydeploy) — 2026-08-15
Live mapper 200 / 51 confirmed. This is direct treasury
wrap_deposit+ CW20sendunwrap — not routerunwrap_output.Wallet
terra1hu4zggf3f8yw6jw3rxrjxn2drwad675gq5k2lvhad 0 uusd; used 10 000 uluna (0.01 LUNC).C5DDA278…D493B7wrap_deposit10000 uluna → mappernotify_depositfee_wrap_bps=200 fee=200 mint=9800 cLUNC58FEE7CE…F08526floor(9751×0.015)=146)Terminal
balafter wrap still showed 0 cLUNC because it ran on the sync ack before inclusion. After both included: cLUNC 0, round-trip complete.Note: QA “unwrap 10 000 → 9 800 native” is for unwrapping 10 000 CW20. This smoke unwrapped the wrap output (9 800), so native back is 9 605, which matches 51 bps + tax on 9800.
Router
unwrap_outputon 1.1.0 (11576) still needs a CW20→native Swap to prove #523 settlement.Router unwrap_output smoke (columbus-5) — PASS
Router 11576 settled a native-out swap against post-migrate mapper Config (no
fee_bps). This is the #523 path.4B3BC4B7DDAB89272CBA8EA6077E73B59617E3BF2B9A6001D91FF55A024B31E929959066terra1hu4zggf3f8yw6jw3rxrjxn2drwad675gq5k2lvuusdreturn_amount=19924864cUSTC (matches pre-tx router simulate)unwrapfee_unwrap_bps=51 fee=101616 withdraw=19823248minimum_receive=19823248(post-fee pre-tax) — did not revertOld router (required
Config.fee_bps) would have abortedreply_swap_hopafter ustr-cmm#13. Live native-out Swap on11576is good.Ops complete on columbus-5. Issue already closed by !1056.
0D9FBBFB…B7D9)unwrap_outputUST1→native USTC passed (tx4B3BC4B7…31E9,fee_unwrap_bps=51, R3 floor held)Details: https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/523#note_3690141115
mentioned in issue #539
mentioned in issue #549
mentioned in issue #589
mentioned in issue #690