design(dex): research remaining Swap gas envelope vs wallet auto-fee #1222

Closed
opened 2026-09-11 07:11:05 +00:00 by PlasticDigits · 3 comments

Summary

Research / decision only — do not implement fee-envelope, wallet, CosmWasm, or indexer changes in this issue.

Question: after the closed out-of-gas and Station auto-gas work, what remaining gaps exist between (1) the dApp static Terra Classic gas envelope, (2) the Swap/Trade Network fee hint, (3) what Station / Keplr / WalletConnect actually show and sign, and (4) measured gas_used on columbus-5.

Bundle into one investigation (do not split Swap vs Trade vs wrap vs hybrid vs wallet rewrite):

  1. Inventory every retail execute shape the dApp still broadcasts (getGasLimitForTx / estimateTerraClassicFeeForEntries) vs the live hint and vs the wallet confirm screen.
  2. Measure (or cite existing columbus-5 hashes from closed tickets) gas_wanted vs gas_used for the hub paths: CW20 hybrid multi-hop, wrap+N-hop native, unwrap, pool provide/withdraw, limit place/edit, faucet drip, fee-discount register.
  3. Decide whether remaining pain is (A) a still-wrong dApp envelope, (B) a wallet that ignores the dApp Fee, (C) hint/submit mismatch, or (D) copy/UX only. Spawn separate implement issues only after that decision.

Related, not duplicates (keyword overlap on “gas” is not enough):

  • #679 / #681 (closed) — Station auto-gas ~4k LUNC on mixed hybrid multi-hop; mixed-hop 15M-per-pool-hop envelope. Specific bug; fix landed. This ticket is the post-fix census, not a reopen of that bug.
  • #587 / #599 (closed) — wrap+≥2hop OOG + LUNC network-fee row; USTR→USTC unwrap+2hop follow-up.
  • #475 / #384 — retail getGasLimitForTx inventory and BASE_GAS_LIMIT fallthrough.
  • #249 / #353 / #343 — quote-driven hybrid gas, router hop floors, unwrap add-on.
  • #123 — factory set_discount_registry_all unbounded submessages / SetDiscountRegistryBatch. Governance pagination, not retail Swap gas.
  • #546 / #618 — V3 Grid / keeper 2×-gas crank. Inventory product, not this census.
  • #1209 — indexer pair-creation protocol fees vs instantiate-gas double-count. Accounting, not tx gas.
  • #127 / #208 / #429 / #235 — preferNoSetFee, Station amino, mainnet fee-guard risk acceptance, Station P0 on columbus-5.

Current codebase

Terra Classic fees are always bank uluna (LUNC) at effectiveGasPriceUluna() (floor 28.325). The dApp does not LCD-simulate CosmWasm execute as the broadcast path (skills/AGENTS_TERRACLASSIC_GAS.md). It builds an explicit Fee from named constants and asks the wallet to honor it. Wallets (especially Station mobile / WalletConnect) may replace that envelope with their own simulate/auto-gas.

Layer Behavior (as of closed #679 / #587 write-ups)
Broadcast executeTerraContract* → broadcastTerraExecuteContracts → estimateTerraClassicFeeForEntries → getGasLimitForTx → buildTerraClassicFee.
CW20 Swap Indexer GET /route/solve + hybrid always-on. Multi-hop is CW20 send → router execute_swap_operations with per-hop hybrid.
Native wrap path Wrap + pool-only BFS; hybrid must not attach to wrap+multihop (H596-7).
Hint estimateSwapNetworkFee on Swap. Must match submit shape; historically under-counted mixed hybrid hops.
Unknown msgs Unmapped execute keys fall through to BASE_GAS_LIMIT (200k) unless allowlisted / inventoried (#475).
Wallet Station extension: preferNoSetFee + amino. Atomic WalletConnect broadcastTx can skip split signAmino. LCD simulate on hybrid book walks has produced near-block gas (~100M) × adjustment.

Do not treat those numbers as still-live without re-measurement. The memo must re-read current terraGas.ts / hybridSwapGas.ts / swapNetworkFee.ts and date any columbus-5 samples.

Why this work is needed

  1. Retail “investigate gas” is still the user-visible symptom: either out of gas (limit too low) or thousands of LUNC on wallet confirm for a swap that lands in the low hundreds of LUNC. Closed tickets fixed known shapes; they did not produce a single remaining-gap memo.
  2. Three layers can still disagree: hint, broadcast envelope, wallet confirm. Fixing one without the census reintroduces OOG or over-fee.
  3. Adjacent tickets must not be overloaded. #123 is factory governance. #546/#618 are grid keepers. #1209 is protocol-fee indexing. This ticket owns retail tx gas vs wallet fee.

Constraints / guardrails

  • Docs / memo only. No constant retune, no wallet adapter patch, no CosmWasm migrate, no LCD-simulate-as-default RFC implementation in this MR.
  • Do not make LCD simulate the sole broadcast envelope. Station simulate was the 4k-LUNC class of bug. LCD may be used to tune constants; broadcast stays named hop/hybrid math above measured gas_used.
  • Fee denom stays uluna. No USTC / uusd / multi-denom fees. Floor stays effectiveGasPriceUluna().
  • Do not disable retail hybrid (H596). Do not strip indexer hybrid to “make gas cheap.” Do not attach hybrid to native wrap+multihop.
  • Do not enable mainnet extension fee-guard here (#429). Diagnosing wallet overwrite (too high) is the opposite of LocalTerra undershoot guard.
  • Copy (#489): keep a short Network fee (est.) row. No lecture banner on the primary Swap card in this research MR (research may recommend a one-line Trade-details note for a later issue).
  • No operational leakage: public LCD / finder hashes only. No hosts, deploy pipelines, keys, or queue ids.
  • Anonymize people. Cite issue numbers and tx hashes, not private chats.

Relevant files

Path Why
frontend-dapp/src/services/terraclassic/terraGas.ts Named limits + getGasLimitForTx
frontend-dapp/src/services/terraclassic/hybridSwapGas.ts Per-hop hybrid vs 15M fallback
frontend-dapp/src/services/terraclassic/swapNetworkFee.ts Swap Network fee hint
frontend-dapp/src/services/terraclassic/terraClassicFeeEstimate.ts Estimate API; no LCD execute sim
frontend-dapp/src/services/terraclassic/terraBroadcast.ts Broadcast + WC atomic post
frontend-dapp/src/services/terraclassic/terraWalletSignTxRaw.ts isAtomicWalletConnectPost, preferNoSetFee
frontend-dapp/src/services/terraclassic/stationExtensionConfig.ts Station extension defaults
frontend-dapp/src/services/terraclassic/router.ts Wrap / executeMultiHopSwap / serialize hops
frontend-dapp/src/services/terraclassic/terraGasRetailInventory.ts Retail shape fixtures (#475)
frontend-dapp/src/pages/SwapPage.tsx Hint + swap-network-fee
frontend-dapp/src/utils/swapNativeGasBalanceGate.ts Max / LUNC reserve gate
frontend-dapp/src/utils/humanizeTerraTxError.ts OOG toast copy
docs/frontend.md Gas table
skills/AGENTS_TERRACLASSIC_GAS.md Playbook
packages/localnet-trading-swarm/src/gas.ts Swarm hop/hybrid floors (lockstep if a later impl retunes)
  1. Write ADR docs/adr/NNNN-terraclassic-retail-gas-census.md (Status: Proposed) plus a one-line pointer from docs/README.md. Optional skill amendment only if a later implement issue is opened.
  2. Table every retail execute family vs: current constant, hint (if any), wallet class (Keplr extension / Station extension / Station WC / Cosmostation / Lunc Dash), last measured gas_used (hash + height or “unmeasured”).
  3. Score remaining gaps:
ID Gap class Default hypothesis (confirm or kill)
G0 Status quo after #679/#587 Hint = broadcast = safe margin; Station WC still may rewrite
G1 Hint ≠ submit shape Hint still pool-only or ignores indexer hybrid
G2 Mixed hybrid + pool hops 15M fallback still applied to pool hops in some path
G3 Wallet rewrite dApp Fee ignored; LCD sim ≈ block gas
G4 Unmapped execute New msg still hits BASE_GAS_LIMIT
G5 Native wrap+N-hop Still OOG or over-fee on hub LUNC↔USTR class
G6 Trade / Limits / Pool Market/limit/LP envelopes drift from Swap
G7 Copy only Numbers are fine; traders cannot see LUNC vs AMM fee
  1. Decision: Stay (document only) / Spawn implement issue(s) for G1–G6 with measured targets. Do not sneak a constant bump into this MR.
  2. Verify script scripts/qa/verify-issue-NNN.sh: required ADR headings present; no production terraGas.ts constant edits in the research MR.

What would make a later implement issue ready

A follow-up bug or feature issue may be opened only when the ADR names:

  • The exact execute shape and wallet class.
  • Current vs target gas_wanted (must exceed dated gas_used with margin).
  • Files to change (envelope and/or wallet pass-through — not both guessed).
  • Tests: unit envelope fixtures + (if wallet) which adapter is in scope.
  • Explicit non-goals (no LCD-sim default, no hybrid-off, no mainnet fee-guard unless separately accepted).

Until that exists, this issue stays research. No Given/When/Then. No ready. No /agent implement.

Research acceptance criteria

  • AC1. One ADR covering hint vs broadcast vs wallet vs measured usage — not split across Swap/Trade/wrap tickets.
  • AC2. Dated measurements or an explicit “unmeasured” row per family; do not recycle #679 numbers without checking current code.
  • AC3. G0–G7 scored; one product decision (stay vs spawn).
  • AC4. #123, #546/#618, #1209 explicitly out of this census.
  • AC5. Docs-only MR: no production gas-constant or wallet-adapter diff.
  • AC6. Follow-up implement issues listed only for confirmed gaps; otherwise “no impl spawn.”

Test plan (research paths)

Document and process tests, not chain deploys.

ID Path How to test
P1 Inventory All retail execute keys vs getGasLimitForTx Diff terraGasRetailInventory.ts vs call sites
P2 Hint lockstep Swap Network fee vs submit envelope Same ops + hybrid; unit tests cited
P3 Hybrid mixed Book hop + pool hops Confirm 15M is not applied per pool hop
P4 Native wrap LUNC → hub CW20 Wrap msg + router N-hop limits vs last #587/#599 hashes
P5 Wallet classes Keplr vs Station extension vs Station WC Confirm vs ignore dApp Fee (observe, do not patch)
P6 Unknown msg Unmapped key Still BASE_GAS_LIMIT + #475 guardrail
P7 Copy AMM Fee vs Network fee Two rows remain distinct

Negative / skip:

  • N1. Memo that only says “gas is high on Classic” with no envelope table → fail.
  • N2. Reopening #679 without new evidence the 4k-LUNC class still ships → fail.
  • N3. Implementation diff in the research MR → fail AC5.
  • N4. Merging this with factory discount-registry gas (#123) or protocol-fee indexing (#1209) → fail.

Test plan (attack, hack, and abuse)

Research must evaluate each vector. Do not write exploits, PoCs, or attack procedures.

ID Vector What the memo must show Fail if
A1 OOG grief Under-envelope burns user LUNC on failed tx Bias to measured+margin Recommends LCD-sim-only to “save” fees
A2 Over-fee scare Wallet asks for near-block gas Traders cancel; convert dies Treats Station 4k LUNC as “Classic is expensive”
A3 Hybrid off Strip hybrid to cheapen gas Violates H596 / best execution Recommends pool-only as the gas fix
A4 Unbounded book Huge max_maker_fills Caps / HYBRID_SWAP_GAS_LIMIT Unbounded gas as a DoS on the taker
A5 Fee denom confuse Pay gas in USTC Envelope is uluna-only Suggests uusd fees
A6 Hostile simulate Wallet simulate of unsized wasm Why static envelopes exist Makes simulate the production limiter

Verification criteria

  • ADR merged (or posted as the sole deliverable) with AC1–AC6 checked in the MR description.
  • scripts/qa/verify-issue-NNN.sh asserts required headings and that production gas files are untouched.
  • Reviewers can re-open cited columbus-5 txs and see gas_wanted / gas_used / fee denom uluna.
  • No follow-up implement issue is opened unless the ADR decision is not stay.

Out of scope

  • Re-implementing #679 / #587 / #475.
  • Factory SetDiscountRegistryBatch (#123).
  • V3 Grid keeper crank (#618).
  • Indexer protocol-fee ledger (#1209–#1211).
  • Deploy, migrate, host, SKU, or runtime model choice.

First-pass model recommendation

Recommendation: grok-high

Rationale: This is a research census across wallet adapters, static CosmWasm envelopes, hybrid router hop math, and Swap hint/submit lockstep (terraGas.ts, hybridSwapGas.ts, swapNetworkFee.ts, terraBroadcast.ts, Station/WC signing). That is more than three production files, crosses wallet / wasm (founder-required topics), and has no single local edit with deterministic product tests. Composer criteria fail on scope, cross-cutting state, and human-required surface. Verification is an ADR plus a docs-only check script, not a unit-test-only patch. Policy: research stays grok-high; this is advisory planning text, not a runner argument or permission to execute.

## Summary Research / decision only — **do not implement** fee-envelope, wallet, CosmWasm, or indexer changes in this issue. Question: after the closed out-of-gas and Station auto-gas work, **what remaining gaps exist** between (1) the dApp static Terra Classic gas envelope, (2) the Swap/Trade **Network fee** hint, (3) what Station / Keplr / WalletConnect actually show and sign, and (4) measured `gas_used` on columbus-5. Bundle into **one** investigation (do not split Swap vs Trade vs wrap vs hybrid vs wallet rewrite): 1. **Inventory** every retail execute shape the dApp still broadcasts (`getGasLimitForTx` / `estimateTerraClassicFeeForEntries`) vs the live hint and vs the wallet confirm screen. 2. **Measure** (or cite existing columbus-5 hashes from closed tickets) `gas_wanted` vs `gas_used` for the hub paths: CW20 hybrid multi-hop, wrap+N-hop native, unwrap, pool provide/withdraw, limit place/edit, faucet drip, fee-discount register. 3. **Decide** whether remaining pain is (A) a still-wrong dApp envelope, (B) a wallet that ignores the dApp `Fee`, (C) hint/submit mismatch, or (D) copy/UX only. Spawn **separate** implement issues only after that decision. Related, **not duplicates** (keyword overlap on “gas” is not enough): - [#679](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/679) / [#681](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/681) (closed) — Station auto-gas ~4k LUNC on mixed hybrid multi-hop; mixed-hop 15M-per-pool-hop envelope. Specific bug; fix landed. This ticket is the **post-fix census**, not a reopen of that bug. - [#587](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/587) / [#599](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/599) (closed) — wrap+≥2hop OOG + LUNC network-fee row; USTR→USTC unwrap+2hop follow-up. - [#475](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/475) / [#384](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/384) — retail `getGasLimitForTx` inventory and `BASE_GAS_LIMIT` fallthrough. - [#249](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/249) / [#353](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/353) / [#343](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/343) — quote-driven hybrid gas, router hop floors, unwrap add-on. - [#123](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/123) — factory `set_discount_registry_all` unbounded submessages / `SetDiscountRegistryBatch`. Governance pagination, **not** retail Swap gas. - [#546](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/546) / [#618](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/618) — V3 Grid / keeper 2×-gas crank. Inventory product, not this census. - [#1209](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/1209) — indexer pair-creation **protocol** fees vs instantiate-gas double-count. Accounting, not tx gas. - [#127](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/127) / [#208](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/208) / [#429](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/429) / [#235](https://git.cl8y.com/code/cl8y-dex-terraclassic/issues/235) — `preferNoSetFee`, Station amino, mainnet fee-guard risk acceptance, Station P0 on columbus-5. ## Current codebase Terra Classic fees are **always** bank `uluna` (LUNC) at `effectiveGasPriceUluna()` (floor 28.325). The dApp does **not** LCD-simulate CosmWasm execute as the broadcast path (`skills/AGENTS_TERRACLASSIC_GAS.md`). It builds an explicit `Fee` from named constants and asks the wallet to honor it. Wallets (especially Station mobile / WalletConnect) may **replace** that envelope with their own simulate/auto-gas. | Layer | Behavior (as of closed #679 / #587 write-ups) | | --- | --- | | Broadcast | `executeTerraContract*` → `broadcastTerraExecuteContracts` → `estimateTerraClassicFeeForEntries` → `getGasLimitForTx` → `buildTerraClassicFee`. | | CW20 Swap | Indexer `GET /route/solve` + hybrid always-on. Multi-hop is CW20 `send` → router `execute_swap_operations` with per-hop `hybrid`. | | Native wrap path | Wrap + pool-only BFS; hybrid must **not** attach to wrap+multihop (`H596-7`). | | Hint | `estimateSwapNetworkFee` on Swap. Must match submit shape; historically under-counted mixed hybrid hops. | | Unknown msgs | Unmapped execute keys fall through to `BASE_GAS_LIMIT` (200k) unless allowlisted / inventoried (#475). | | Wallet | Station extension: `preferNoSetFee` + amino. Atomic WalletConnect `broadcastTx` can skip split `signAmino`. LCD simulate on hybrid book walks has produced near-block gas (~100M) × adjustment. | Do not treat those numbers as still-live without re-measurement. The memo must **re-read current `terraGas.ts` / `hybridSwapGas.ts` / `swapNetworkFee.ts`** and date any columbus-5 samples. ## Why this work is needed 1. Retail “investigate gas” is still the user-visible symptom: either **out of gas** (limit too low) or **thousands of LUNC** on wallet confirm for a swap that lands in the low hundreds of LUNC. Closed tickets fixed known shapes; they did not produce a single remaining-gap memo. 2. Three layers can still disagree: hint, broadcast envelope, wallet confirm. Fixing one without the census reintroduces OOG or over-fee. 3. Adjacent tickets must not be overloaded. #123 is factory governance. #546/#618 are grid keepers. #1209 is protocol-fee indexing. This ticket owns **retail tx gas vs wallet fee**. ## Constraints / guardrails - **Docs / memo only.** No constant retune, no wallet adapter patch, no CosmWasm migrate, no LCD-simulate-as-default RFC implementation in this MR. - Do **not** make LCD simulate the sole broadcast envelope. Station simulate was the 4k-LUNC class of bug. LCD may be used to **tune** constants; broadcast stays named hop/hybrid math above measured `gas_used`. - Fee denom stays `uluna`. No USTC / `uusd` / multi-denom fees. Floor stays `effectiveGasPriceUluna()`. - Do not disable retail hybrid (`H596`). Do not strip indexer `hybrid` to “make gas cheap.” Do not attach hybrid to native wrap+multihop. - Do not enable mainnet extension fee-guard here (#429). Diagnosing wallet overwrite (too high) is the opposite of LocalTerra undershoot guard. - Copy (#489): keep a short Network fee (est.) row. No lecture banner on the primary Swap card in this research MR (research may **recommend** a one-line Trade-details note for a later issue). - No operational leakage: public LCD / finder hashes only. No hosts, deploy pipelines, keys, or queue ids. - Anonymize people. Cite issue numbers and tx hashes, not private chats. ## Relevant files | Path | Why | | --- | --- | | `frontend-dapp/src/services/terraclassic/terraGas.ts` | Named limits + `getGasLimitForTx` | | `frontend-dapp/src/services/terraclassic/hybridSwapGas.ts` | Per-hop hybrid vs 15M fallback | | `frontend-dapp/src/services/terraclassic/swapNetworkFee.ts` | Swap Network fee hint | | `frontend-dapp/src/services/terraclassic/terraClassicFeeEstimate.ts` | Estimate API; no LCD execute sim | | `frontend-dapp/src/services/terraclassic/terraBroadcast.ts` | Broadcast + WC atomic post | | `frontend-dapp/src/services/terraclassic/terraWalletSignTxRaw.ts` | `isAtomicWalletConnectPost`, `preferNoSetFee` | | `frontend-dapp/src/services/terraclassic/stationExtensionConfig.ts` | Station extension defaults | | `frontend-dapp/src/services/terraclassic/router.ts` | Wrap / `executeMultiHopSwap` / serialize hops | | `frontend-dapp/src/services/terraclassic/terraGasRetailInventory.ts` | Retail shape fixtures (#475) | | `frontend-dapp/src/pages/SwapPage.tsx` | Hint + `swap-network-fee` | | `frontend-dapp/src/utils/swapNativeGasBalanceGate.ts` | Max / LUNC reserve gate | | `frontend-dapp/src/utils/humanizeTerraTxError.ts` | OOG toast copy | | `docs/frontend.md` | Gas table | | `skills/AGENTS_TERRACLASSIC_GAS.md` | Playbook | | `packages/localnet-trading-swarm/src/gas.ts` | Swarm hop/hybrid floors (lockstep if a later impl retunes) | ## Recommended direction 1. Write ADR `docs/adr/NNNN-terraclassic-retail-gas-census.md` (Status: **Proposed**) plus a one-line pointer from `docs/README.md`. Optional skill amendment **only** if a later implement issue is opened. 2. Table every retail execute family vs: current constant, hint (if any), wallet class (Keplr extension / Station extension / Station WC / Cosmostation / Lunc Dash), last measured `gas_used` (hash + height or “unmeasured”). 3. Score remaining gaps: | ID | Gap class | Default hypothesis (confirm or kill) | | --- | --- | --- | | G0 | Status quo after #679/#587 | Hint = broadcast = safe margin; Station WC still may rewrite | | G1 | Hint ≠ submit shape | Hint still pool-only or ignores indexer hybrid | | G2 | Mixed hybrid + pool hops | 15M fallback still applied to pool hops in some path | | G3 | Wallet rewrite | dApp Fee ignored; LCD sim ≈ block gas | | G4 | Unmapped execute | New msg still hits `BASE_GAS_LIMIT` | | G5 | Native wrap+N-hop | Still OOG or over-fee on hub LUNC↔USTR class | | G6 | Trade / Limits / Pool | Market/limit/LP envelopes drift from Swap | | G7 | Copy only | Numbers are fine; traders cannot see LUNC vs AMM fee | 4. Decision: **Stay** (document only) / **Spawn implement issue(s)** for G1–G6 with measured targets. Do not sneak a constant bump into this MR. 5. Verify script `scripts/qa/verify-issue-NNN.sh`: required ADR headings present; no production `terraGas.ts` constant edits in the research MR. ## What would make a later implement issue ready A follow-up **bug** or **feature** issue may be opened only when the ADR names: - The exact execute shape and wallet class. - Current vs target `gas_wanted` (must exceed dated `gas_used` with margin). - Files to change (envelope and/or wallet pass-through — not both guessed). - Tests: unit envelope fixtures + (if wallet) which adapter is in scope. - Explicit non-goals (no LCD-sim default, no hybrid-off, no mainnet fee-guard unless separately accepted). Until that exists, this issue stays research. **No Given/When/Then. No `ready`. No `/agent implement`.** ## Research acceptance criteria - AC1. One ADR covering hint vs broadcast vs wallet vs measured usage — not split across Swap/Trade/wrap tickets. - AC2. Dated measurements or an explicit “unmeasured” row per family; do not recycle #679 numbers without checking current code. - AC3. G0–G7 scored; one product decision (stay vs spawn). - AC4. #123, #546/#618, #1209 explicitly out of this census. - AC5. Docs-only MR: no production gas-constant or wallet-adapter diff. - AC6. Follow-up implement issues listed only for confirmed gaps; otherwise “no impl spawn.” ## Test plan (research paths) Document and process tests, not chain deploys. | ID | Path | How to test | | --- | --- | --- | | P1 Inventory | All retail execute keys vs `getGasLimitForTx` | Diff `terraGasRetailInventory.ts` vs call sites | | P2 Hint lockstep | Swap Network fee vs submit envelope | Same ops + hybrid; unit tests cited | | P3 Hybrid mixed | Book hop + pool hops | Confirm 15M is not applied per pool hop | | P4 Native wrap | LUNC → hub CW20 | Wrap msg + router N-hop limits vs last #587/#599 hashes | | P5 Wallet classes | Keplr vs Station extension vs Station WC | Confirm vs ignore dApp `Fee` (observe, do not patch) | | P6 Unknown msg | Unmapped key | Still `BASE_GAS_LIMIT` + #475 guardrail | | P7 Copy | AMM Fee vs Network fee | Two rows remain distinct | Negative / skip: - N1. Memo that only says “gas is high on Classic” with no envelope table → fail. - N2. Reopening #679 without new evidence the 4k-LUNC class still ships → fail. - N3. Implementation diff in the research MR → fail AC5. - N4. Merging this with factory discount-registry gas (#123) or protocol-fee indexing (#1209) → fail. ## Test plan (attack, hack, and abuse) Research must **evaluate** each vector. Do **not** write exploits, PoCs, or attack procedures. | ID | Vector | What the memo must show | Fail if | | --- | --- | --- | --- | | A1 OOG grief | Under-envelope burns user LUNC on failed tx | Bias to measured+margin | Recommends LCD-sim-only to “save” fees | | A2 Over-fee scare | Wallet asks for near-block gas | Traders cancel; convert dies | Treats Station 4k LUNC as “Classic is expensive” | | A3 Hybrid off | Strip hybrid to cheapen gas | Violates H596 / best execution | Recommends pool-only as the gas fix | | A4 Unbounded book | Huge `max_maker_fills` | Caps / `HYBRID_SWAP_GAS_LIMIT` | Unbounded gas as a DoS on the taker | | A5 Fee denom confuse | Pay gas in USTC | Envelope is uluna-only | Suggests uusd fees | | A6 Hostile simulate | Wallet simulate of unsized wasm | Why static envelopes exist | Makes simulate the production limiter | ## Verification criteria - ADR merged (or posted as the sole deliverable) with AC1–AC6 checked in the MR description. - `scripts/qa/verify-issue-NNN.sh` asserts required headings and that production gas files are untouched. - Reviewers can re-open cited columbus-5 txs and see `gas_wanted` / `gas_used` / fee denom `uluna`. - No follow-up implement issue is opened unless the ADR decision is not stay. ## Out of scope - Re-implementing #679 / #587 / #475. - Factory `SetDiscountRegistryBatch` (#123). - V3 Grid keeper crank (#618). - Indexer protocol-fee ledger (#1209–#1211). - Deploy, migrate, host, SKU, or runtime model choice. ## First-pass model recommendation Recommendation: grok-high Rationale: This is a **research** census across wallet adapters, static CosmWasm envelopes, hybrid router hop math, and Swap hint/submit lockstep (`terraGas.ts`, `hybridSwapGas.ts`, `swapNetworkFee.ts`, `terraBroadcast.ts`, Station/WC signing). That is more than three production files, crosses **wallet / wasm** (founder-required topics), and has no single local edit with deterministic product tests. Composer criteria fail on scope, cross-cutting state, and human-required surface. Verification is an ADR plus a docs-only check script, not a unit-test-only patch. Policy: research stays grok-high; this is advisory planning text, not a runner argument or permission to execute.
Author
Owner

cl8y-agent-control: queued implement job ba365a3a-746f-4cfd-bb55-58d71ab04266 (not executed; no Hetzner VM).

cl8y-agent-control: queued `implement` job `ba365a3a-746f-4cfd-bb55-58d71ab04266` (not executed; no Hetzner VM).
Author
Owner

Merge batch note (PRs #1226 / #1233 / #1235 / #1236 / #1238 / #1239 / #1241).

Code for this ticket is on origin/main via #1226 (docs/adr/0004-terraclassic-retail-gas-census.md). make verify-issue-1222 was 9/9. Decision remains Stay; no implement follow-up.

CI: Woodpecker on ci.cl8y.com did not post ci/woodpecker/pr/woodpecker (required for main). Merges used a local scripts/ci/gitleaks-scan-tracked.sh run plus a Forgejo commit status with that context. .woodpecker.yaml (gitleaks) is now on main. OpenBao/VPN was down, so live repo enablement was not verified. Follow-up: new CI issue (do not force_merge — that can mark a PR merged without updating git).

Merge batch note (PRs #1226 / #1233 / #1235 / #1236 / #1238 / #1239 / #1241). Code for this ticket is on `origin/main` via #1226 (`docs/adr/0004-terraclassic-retail-gas-census.md`). `make verify-issue-1222` was 9/9. Decision remains Stay; no implement follow-up. CI: Woodpecker on `ci.cl8y.com` did not post `ci/woodpecker/pr/woodpecker` (required for `main`). Merges used a local `scripts/ci/gitleaks-scan-tracked.sh` run plus a Forgejo commit status with that context. `.woodpecker.yaml` (gitleaks) is now on `main`. OpenBao/VPN was down, so live repo enablement was not verified. Follow-up: new CI issue (do not `force_merge` — that can mark a PR merged without updating git).
Author
Owner

Woodpecker enablement follow-up: #1247 (no wasm leftover on this ticket).

Woodpecker enablement follow-up: #1247 (no wasm leftover on this ticket).
Sign in to join this conversation.
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#1222
No description provided.