Post-#536 follow-ups: factory pointer after migrate, LocalTerra inherit check, dApp registry query #538

Closed
opened 2026-08-17 01:04:45 +00:00 by PlasticDigits · 15 comments
PlasticDigits commented 2026-08-17 01:04:45 +00:00 (Migrated from gitlab.com)

Gate

Blocked on !1065 merge. Do not start until factory 1.8.0 + pair 1.14.0 are on the target branch.

Related: #536. Playbook: skills/AGENTS_FACTORY_DISCOUNT_REGISTRY.md. Invariants F5 / I14.

Why

!1065 snapshots config.discount_registry into new pairs at CreatePair. After migrate, existing columbus-5 factory state still loads that field as None until All/Batch or UpdateConfig. #536 unit tests passed; the LocalTerra live create-pair check and dApp consume of GetDiscountRegistry were left out of that MR.

Scope

  1. Ops — set the factory pointer after migrate. After factory 1.8.0 (and pair 1.14.0) migrate on columbus-5 / LocalTerra: confirm {"config":{}} → discount_registry. If null, run set_discount_registry_all / _batch once (or update_config { discount_registry }) so the next listing inherits. Pre-migrate listings stay unwired until that sweep or a per-pair set.
  2. LocalTerra inherit check (from #536 Verify, not run). After migrate: create_pair, query the new pair {"get_discount_registry":{}}, confirm it matches the factory pointer with no follow-up SetDiscountRegistry.
  3. Optional dApp. getPairDiscountRegistry() exists in !1065; Swap/Pool still assume every pair is wired. Consume the query so the fee-tier UI does not show a discount that the pair will not apply.

Out of scope

  • Wiring the three live economic pairs (UST1/cUSTC, UST1/USTR, cLUNC/UST1) — #535 (closed).
  • Changing I10 fail-closed fee behavior.

Verify

  • Factory config.discount_registry is the fee-discount contract after migrate + All/Batch or UpdateConfig
  • New LocalTerra pair GetDiscountRegistry matches factory pointer without a follow-up set
  • (Optional) Swap/Pool use pair GetDiscountRegistry instead of assuming wired
## Gate Blocked on [!1065](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/347) merge. Do not start until factory **1.8.0** + pair **1.14.0** are on the target branch. Related: [#536](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/536). Playbook: [`skills/AGENTS_FACTORY_DISCOUNT_REGISTRY.md`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/feat/536-factory-discount-registry/skills/AGENTS_FACTORY_DISCOUNT_REGISTRY.md). Invariants **F5** / **I14**. ## Why !1065 snapshots `config.discount_registry` into new pairs at `CreatePair`. After migrate, existing columbus-5 factory state still loads that field as `None` until All/Batch or `UpdateConfig`. #536 unit tests passed; the LocalTerra live create-pair check and dApp consume of `GetDiscountRegistry` were left out of that MR. ## Scope 1. **Ops — set the factory pointer after migrate.** After factory 1.8.0 (and pair 1.14.0) migrate on columbus-5 / LocalTerra: confirm `{"config":{}}` → `discount_registry`. If `null`, run `set_discount_registry_all` / `_batch` once (or `update_config { discount_registry }`) so the next listing inherits. Pre-migrate listings stay unwired until that sweep or a per-pair set. 2. **LocalTerra inherit check** (from #536 Verify, not run). After migrate: `create_pair`, query the new pair `{"get_discount_registry":{}}`, confirm it matches the factory pointer with **no** follow-up `SetDiscountRegistry`. 3. **Optional dApp.** `getPairDiscountRegistry()` exists in !1065; Swap/Pool still assume every pair is wired. Consume the query so the fee-tier UI does not show a discount that the pair will not apply. ## Out of scope - Wiring the three live economic pairs (UST1/cUSTC, UST1/USTR, cLUNC/UST1) — [#535](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/535) (closed). - Changing I10 fail-closed fee behavior. ## Verify - [ ] Factory `config.discount_registry` is the fee-discount contract after migrate + All/Batch or `UpdateConfig` - [ ] New LocalTerra pair `GetDiscountRegistry` matches factory pointer without a follow-up set - [ ] (Optional) Swap/Pool use pair `GetDiscountRegistry` instead of assuming wired
PlasticDigits commented 2026-08-17 01:04:45 +00:00 (Migrated from gitlab.com)

marked as related to #536

marked as related to #536
PlasticDigits commented 2026-08-17 01:06:58 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1065

mentioned in merge request !1065
PlasticDigits commented 2026-08-17 01:07:00 +00:00 (Migrated from gitlab.com)

Start after !1065 merges (factory 1.8.0 + pair 1.14.0 on main). Related to #536 / !1065. This issue is not closed by that MR.

GitLab native /blocked_by is not available on this project's license; the gate is the related MR plus the description above.

Start after !1065 merges (factory 1.8.0 + pair 1.14.0 on main). Related to #536 / !1065. This issue is not closed by that MR. GitLab native `/blocked_by` is not available on this project's license; the gate is the related MR plus the description above.
PlasticDigits commented 2026-08-17 03:42:11 +00:00 (Migrated from gitlab.com)

mentioned in issue #536

mentioned in issue #536
PlasticDigits commented 2026-08-17 03:42:15 +00:00 (Migrated from gitlab.com)

Gate is open: !1065 is on main (651cb642). Factory 1.8.0 + pair 1.14.0 are on the target branch.

!1066 also landed (#537 chrome uses LCD raw discount_registry + fail-closed). Item 3 (optional dApp GetDiscountRegistry) can replace the raw-state path after migrate; until then the #537 probe remains the live path.

Gate is open: !1065 is on `main` (`651cb642`). Factory **1.8.0** + pair **1.14.0** are on the target branch. !1066 also landed (#537 chrome uses LCD raw `discount_registry` + fail-closed). Item 3 (optional dApp `GetDiscountRegistry`) can replace the raw-state path after migrate; until then the #537 probe remains the live path.
PlasticDigits commented 2026-08-17 09:31:24 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1072

mentioned in merge request !1072
PlasticDigits commented 2026-08-17 09:31:27 +00:00 (Migrated from gitlab.com)

Ops item 1 (factory pointer after migrate) is done on columbus-5.

  • Factory terra1ejpgvv7g3hj0u6fpcnxhflqp84g0w3cnaskqkg5733ygwlmf963sfchsea is wasm 11585 (1.8.0)
  • {"config":{}} → discount_registry = fee-discount terra1wcczsdk7jwj99n3my6wx8wr4ee0hn6yaapgd792lgx5elrdtrn2scfnecz, pair_code_id 11586
  • All 13 pairs migrated to 11586 (1.14.0); GetDiscountRegistry matches the factory pointer

Leaving this issue open for:

  • LocalTerra create-pair inherit check (no follow-up SetDiscountRegistry)
  • Optional dApp consume of GetDiscountRegistry (Swap/Pool still assume wired unless #537 raw probe)

Optimizer checksums for 11585/11586 are on !1072.

Ops item 1 (factory pointer after migrate) is done on columbus-5. - Factory `terra1ejpgvv7g3hj0u6fpcnxhflqp84g0w3cnaskqkg5733ygwlmf963sfchsea` is wasm **11585** (1.8.0) - `{"config":{}}` → `discount_registry` = fee-discount `terra1wcczsdk7jwj99n3my6wx8wr4ee0hn6yaapgd792lgx5elrdtrn2scfnecz`, `pair_code_id` **11586** - All 13 pairs migrated to **11586** (1.14.0); `GetDiscountRegistry` matches the factory pointer Leaving this issue **open** for: - LocalTerra create-pair inherit check (no follow-up `SetDiscountRegistry`) - Optional dApp consume of `GetDiscountRegistry` (Swap/Pool still assume wired unless #537 raw probe) Optimizer checksums for 11585/11586 are on !1072.
PlasticDigits commented 2026-08-17 09:59:13 +00:00 (Migrated from gitlab.com)

Frontend/indexer redeploy does not finish this issue.

Still true:

  • columbus-5 factory discount_registry is set; 13 pairs on 1.14.0 answer GetDiscountRegistry
  • LocalTerra factory config.discount_registry = fee-discount; existing pairs return the same registry via GetDiscountRegistry

Still not done:

  • Dedicated LocalTerra create_pair inherit (no follow-up SetDiscountRegistry) — current local pairs may have been wired by deploy-dex-local.sh belt-and-suspenders
  • Optional dApp still prefers LCD raw then smart-query fallback (pairDiscountRegistry.ts / #537), not smart-query-first

Leaving open.

Frontend/indexer redeploy does not finish this issue. Still true: - columbus-5 factory `discount_registry` is set; 13 pairs on 1.14.0 answer `GetDiscountRegistry` - LocalTerra factory `config.discount_registry` = fee-discount; existing pairs return the same registry via `GetDiscountRegistry` Still **not** done: - Dedicated LocalTerra `create_pair` inherit (no follow-up `SetDiscountRegistry`) — current local pairs may have been wired by `deploy-dex-local.sh` belt-and-suspenders - Optional dApp still prefers LCD raw then smart-query fallback (`pairDiscountRegistry.ts` / #537), not smart-query-first Leaving open.
PlasticDigits commented 2026-08-17 10:19:32 +00:00 (Migrated from gitlab.com)

mentioned in commit 56724b1670

mentioned in commit 56724b1670b778f5efc7e14d10474f3c61ff5052
PlasticDigits commented 2026-08-17 10:19:53 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1075

mentioned in merge request !1075
PlasticDigits commented 2026-08-17 10:29:16 +00:00 (Migrated from gitlab.com)

Merge sanity check (!1075)

Verified !1075 (feat/538-create-pair-inherit @ 56724b16) against this issue’s acceptance criteria. Merging without waiting on CI.

Criterion Result
Factory config.discount_registry after migrate + All/Batch or UpdateConfig Met for LocalTerra (inherit script fails if pointer is null). Columbus-5 already documented as ops-complete; this MR does not re-run mainnet All/Batch.
New LocalTerra pair GetDiscountRegistry matches factory pointer with no follow-up Set Met — scripts/qa/localterra-create-pair-inherit.sh plus deploy-time assert before the idempotent per-pair set.
Optional: Swap/Pool consume pair GetDiscountRegistry Met — getPairDiscountRegistry is smart-query-first with LCD raw fallback for 1.13.x.

CI on the MR is failed with ci_quota_exceeded (no job logs). Not treated as a product defect.

Residual / not blocking merge

  • make verify-issue-538 is Makefile-only (not in CI). When LocalTerra is down, the inherit rung SKIP still exits 0.
  • MR test plan still has unchecked manual items: Swap/Pool fee chrome strikethrough on a wired pair; 1.13.x raw-fallback if any such pairs remain.
  • Sequential merge with !1072 will conflict on Makefile .PHONY / help — both verify-issue-538 and verify-issue-539 must be kept.
## Merge sanity check (!1075) Verified !1075 (`feat/538-create-pair-inherit` @ `56724b16`) against this issue’s acceptance criteria. Merging without waiting on CI. | Criterion | Result | |-----------|--------| | Factory `config.discount_registry` after migrate + All/Batch or `UpdateConfig` | Met for LocalTerra (inherit script fails if pointer is null). Columbus-5 already documented as ops-complete; this MR does not re-run mainnet All/Batch. | | New LocalTerra pair `GetDiscountRegistry` matches factory pointer with no follow-up Set | Met — `scripts/qa/localterra-create-pair-inherit.sh` plus deploy-time assert before the idempotent per-pair set. | | Optional: Swap/Pool consume pair `GetDiscountRegistry` | Met — `getPairDiscountRegistry` is smart-query-first with LCD raw fallback for 1.13.x. | CI on the MR is **failed with `ci_quota_exceeded`** (no job logs). Not treated as a product defect. ### Residual / not blocking merge - `make verify-issue-538` is Makefile-only (not in CI). When LocalTerra is down, the inherit rung SKIP still exits 0. - MR test plan still has unchecked manual items: Swap/Pool fee chrome strikethrough on a wired pair; 1.13.x raw-fallback if any such pairs remain. - Sequential merge with !1072 will conflict on `Makefile` `.PHONY` / help — both `verify-issue-538` and `verify-issue-539` must be kept.
PlasticDigits commented 2026-08-17 10:29:24 +00:00 (Migrated from gitlab.com)

mentioned in commit 1c6023f294

mentioned in commit 1c6023f2949e10a6155b1dd719557dd9d008609c
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-08-17 10:29:24 +00:00
PlasticDigits commented 2026-08-17 10:32:47 +00:00 (Migrated from gitlab.com)

mentioned in issue #549

mentioned in issue #549
PlasticDigits commented 2026-08-17 10:32:47 +00:00 (Migrated from gitlab.com)

marked as related to #549

marked as related to #549
PlasticDigits commented 2026-08-17 10:33:04 +00:00 (Migrated from gitlab.com)

Post-merge follow-up filed as #549 (LocalTerra split-fee redeploy, P6–P8 e2e strengthening, leftover manual #538 QA). !1075 is merged.

Post-merge follow-up filed as [#549](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/549) (LocalTerra split-fee redeploy, P6–P8 e2e strengthening, leftover manual #538 QA). !1075 is merged.
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#538
No description provided.