fix(swap): gate USTC wrap gas on LUNC and keep the 2.71M envelope #1293

Merged
PlasticDigits merged 2 commits from issue/1264-ustc-wrap-gas into main 2026-09-21 05:28:55 +00:00

Summary

  • Split Swap native-pay Max / Network-fee preflight so only uluna is treated as fee-paying native. USTC (uusd) still wraps, but gas is always bank LUNC (nativeWrapSwapHints.ts, G1264-4).
  • Keep wrap+2hop USTC→USTR on the shared #587 envelope 2,710,000 (~76.76 LUNC). Do not raise WRAP_ROUTER_COMBO_OVERHEAD_GAS until columbus-5 AC1 classifies OOG vs wallet rewrite.
  • Native wrap hops stay pool-only (H596-7 / H1280-6). Hub hopCount defaults to 2 for both uluna and uusd until client-BFS is known (G1264-5).
  • Docs/skills/invariants: G1264-1–G1264-8, make verify-issue-1264, optional VERIFY1264_COLUMBUS_TX.

Related to #1264. Do not auto-close: AC1 (columbus-5 gas_used) is still unmeasured.

Test plan

  • make verify-issue-1264 unit + docs (ran twice)
  • SwapPage RTL #1264 (USTC Max / LUNC gas-gate)
  • nativeWrapSwapHints, maxSpendableAmount, swapNativeGasBalanceGate USTC cases
  • Columbus-5 AC1: record gas_used on wrap+2hop USTC→USTR (VERIFY1264_COLUMBUS_TX=<hash>)
  • LocalTerra E10 green execute (VERIFY_ISSUE_1264_CHAIN=1); last run showed Network fee ~76.76 LUNC then wasm Swap hop produced zero output on stale gem hops (not OOG)
  • AC2/AC3 only if AC1 classifies a raise or wallet rewrite

Issue criteria

Item Status
Shared 2.71M wrap+2hop envelope Done
Pool-only native wrap hops Done
Do not raise combo without AC1 class A Done (no raise)
G1264-4 USTC Max / LUNC gas-gate Done
Docs + skills + verify-issue-1264 Done
AC1 columbus-5 measure Not done (no funded columbus-5 wallet in operator KV)
AC6 E10 execute success UI envelope verified; execute blocked by empty hop
AC2/AC3 wallet rewrite Blocked on AC1
## Summary - Split Swap native-pay Max / Network-fee preflight so only `uluna` is treated as fee-paying native. USTC (`uusd`) still wraps, but gas is always bank LUNC (`nativeWrapSwapHints.ts`, **G1264-4**). - Keep wrap+2hop USTC→USTR on the shared #587 envelope **2,710,000** (~76.76 LUNC). Do **not** raise `WRAP_ROUTER_COMBO_OVERHEAD_GAS` until columbus-5 AC1 classifies OOG vs wallet rewrite. - Native wrap hops stay pool-only (**H596-7** / **H1280-6**). Hub `hopCount` defaults to 2 for both `uluna` and `uusd` until client-BFS is known (**G1264-5**). - Docs/skills/invariants: **G1264-1–G1264-8**, `make verify-issue-1264`, optional `VERIFY1264_COLUMBUS_TX`. Related to #1264. Do **not** auto-close: AC1 (columbus-5 `gas_used`) is still unmeasured. ## Test plan - [x] `make verify-issue-1264` unit + docs (ran twice) - [x] SwapPage RTL `#1264` (USTC Max / LUNC gas-gate) - [x] `nativeWrapSwapHints`, `maxSpendableAmount`, `swapNativeGasBalanceGate` USTC cases - [ ] Columbus-5 AC1: record `gas_used` on wrap+2hop USTC→USTR (`VERIFY1264_COLUMBUS_TX=<hash>`) - [ ] LocalTerra E10 green execute (`VERIFY_ISSUE_1264_CHAIN=1`); last run showed **Network fee ~76.76 LUNC** then wasm `Swap hop produced zero output` on stale gem hops (not OOG) - [ ] AC2/AC3 only if AC1 classifies a raise or wallet rewrite ## Issue criteria | Item | Status | |------|--------| | Shared 2.71M wrap+2hop envelope | Done | | Pool-only native wrap hops | Done | | Do not raise combo without AC1 class A | Done (no raise) | | G1264-4 USTC Max / LUNC gas-gate | Done | | Docs + skills + `verify-issue-1264` | Done | | AC1 columbus-5 measure | Not done (no funded columbus-5 wallet in operator KV) | | AC6 E10 execute success | UI envelope verified; execute blocked by empty hop | | AC2/AC3 wallet rewrite | Blocked on AC1 |
Author
Owner

drain skip: no occupying job for rebase/fix-pr/CI-wait; remaining continue

drain skip: no occupying job for rebase/fix-pr/CI-wait; remaining continue
Author
Owner

drain skip: default autoland requires tip ACCEPT (#77)

drain skip: default autoland requires tip ACCEPT (#77)
fix(swap): gate USTC wrap gas on LUNC and keep the 2.71M envelope
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
86b4e69071
Native USTC pay was treated as fee-paying uluna for Max and the network-fee
preflight. Split those paths, keep wrap+2hop at 2,710,000 until columbus-5
AC1, and add VERIFY1264_COLUMBUS_TX.
Merge remote-tracking branch 'origin/main' into issue/1264-ustc-wrap-gas
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
94c40ec56b
PlasticDigits deleted branch issue/1264-ustc-wrap-gas 2026-09-21 05:28:55 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!1293
No description provided.