ops: P0 upgrade-582 script, ContractInfo probe, freeze/unfreeze runbook #1108

Merged
PlasticDigits merged 4 commits from 584-ops-p0-order-enforcing-upgrade-582-script-columbus-5-contractinfo-probe-freeze-unfreeze-runbook into main 2026-08-21 00:15:04 +00:00
PlasticDigits commented 2026-08-20 14:43:28 +00:00 (Migrated from gitlab.com)

Implements the #584 ops rollout for invariant F6 (depends on !1107 / #582). Does not change fund-moving contract logic. Launch-checklist BLOCK remains until this script has run on columbus-5.

Related to #584 (do not auto-close: live columbus-5 migrate + LocalTerra rehearsal still open).

Summary

  • Add scripts/upgrade-582-code-id-pin.sh: factory 1.9.0 before any pair 1.15.0 migrate; abort if factory cw2 < 1.9.0 or IsCodeIdWhitelisted fails (UPGRADE582_FORCE_FACTORY_VERSION covers DRY_RUN).
  • Paginate pairs at limit: 30 with start_after = last asset_infos; reconcile to GetPairCount (fail closed on mismatch / mid-loop create).
  • Preflight GET /cosmwasm/wasm/v1/contract/{addr} for factory + every listed asset; fail closed if code_id is missing.
  • Post-migrate smoke: every pair GetAssetCodeIds (hard-error on unmigrated) + whitelist check + HybridSimulation (queries are ungated — quote ≠ tradable).
  • Runbook: keep maximal freeze (exits stay gated); unfreeze is SetPairPaused through refresh + private rebalance; batch refresh skip via start_after; never de-whitelist 10184.
  • make verify-issue-584 + make verify-issue-582 greps the script (cannot pass if it is deleted).

Test plan

  • bash -n scripts/upgrade-582-code-id-pin.sh
  • DRY_RUN=1 factory 1.9.0 → prints factory-then-pairs / PAIR_MIGRATE_BEGIN
  • DRY_RUN=1 UPGRADE582_FORCE_FACTORY_VERSION=1.8.0 exits before PAIR_MIGRATE_BEGIN
  • Pagination mock: 31 pairs (30+1) and 61 pairs (two full pages + short third)
  • Dead LCD ContractInfo probe fails closed
  • make verify-issue-584 first pass + retest
  • make verify-issue-582 first pass + retest (pin tests still pass)
  • Columbus-5 read-only probe (14 pairs, GetPairCount=14, code_ids 10184 / 6036)
  • LocalTerra happy path after make deploy-local (UPGRADE582_LOCAL=1)
  • Columbus-5 migrate itself (tx hashes + smoke table on #584 / #391) — BLOCK until run

Columbus-5 read-only probe (2026-08-20)

LCD https://terra-classic-lcd.publicnode.com. Factory terra1ejpgvv7g3hj0u6fpcnxhflqp84g0w3cnaskqkg5733ygwlmf963sfchsea code_id 11585. Enumerated 14 pairs = GetPairCount. Listed assets: 10184 (mintable) and 6036 (PEARL/QUARTZ).

Implements the #584 ops rollout for invariant **F6** (depends on !1107 / #582). Does **not** change fund-moving contract logic. Launch-checklist **BLOCK** remains until this script has **run** on columbus-5. Related to #584 (do **not** auto-close: live columbus-5 migrate + LocalTerra rehearsal still open). ## Summary - Add `scripts/upgrade-582-code-id-pin.sh`: factory **1.9.0** before any pair **1.15.0** migrate; abort if factory cw2 `< 1.9.0` or `IsCodeIdWhitelisted` fails (`UPGRADE582_FORCE_FACTORY_VERSION` covers DRY_RUN). - Paginate `pairs` at `limit: 30` with `start_after` = last `asset_infos`; reconcile to `GetPairCount` (fail closed on mismatch / mid-loop create). - Preflight `GET /cosmwasm/wasm/v1/contract/{addr}` for factory + every listed asset; fail closed if `code_id` is missing. - Post-migrate smoke: every pair `GetAssetCodeIds` (hard-error on unmigrated) + whitelist check + `HybridSimulation` (queries are ungated — quote ≠ tradable). - Runbook: **keep** maximal freeze (exits stay gated); unfreeze is `SetPairPaused` through refresh + private rebalance; batch refresh skip via `start_after`; never de-whitelist **10184**. - `make verify-issue-584` + `make verify-issue-582` greps the script (cannot pass if it is deleted). ## Test plan - [x] `bash -n scripts/upgrade-582-code-id-pin.sh` - [x] `DRY_RUN=1` factory 1.9.0 → prints factory-then-pairs / `PAIR_MIGRATE_BEGIN` - [x] `DRY_RUN=1` `UPGRADE582_FORCE_FACTORY_VERSION=1.8.0` exits before `PAIR_MIGRATE_BEGIN` - [x] Pagination mock: 31 pairs (30+1) and 61 pairs (two full pages + short third) - [x] Dead LCD ContractInfo probe fails closed - [x] `make verify-issue-584` first pass + retest - [x] `make verify-issue-582` first pass + retest (pin tests still pass) - [x] Columbus-5 **read-only** probe (14 pairs, GetPairCount=14, code_ids 10184 / 6036) - [ ] LocalTerra happy path after `make deploy-local` (`UPGRADE582_LOCAL=1`) - [ ] Columbus-5 migrate itself (tx hashes + smoke table on #584 / #391) — **BLOCK until run** ## Columbus-5 read-only probe (2026-08-20) LCD `https://terra-classic-lcd.publicnode.com`. Factory `terra1ejpgvv7g3hj0u6fpcnxhflqp84g0w3cnaskqkg5733ygwlmf963sfchsea` code_id **11585**. Enumerated **14** pairs = `GetPairCount`. Listed assets: **10184** (mintable) and **6036** (PEARL/QUARTZ).
PlasticDigits commented 2026-08-20 14:44:15 +00:00 (Migrated from gitlab.com)

marked this merge request as ready

marked this merge request as **ready**
PlasticDigits commented 2026-08-20 14:44:15 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-08-20 14:44:15 +00:00 (Migrated from gitlab.com)

mentioned in issue #584

mentioned in issue #584
PlasticDigits commented 2026-08-21 00:13:59 +00:00 (Migrated from gitlab.com)

added 3 commits

  • 5402859e - docs(audit): add MR 389 code-id pin security audit report
  • b2b8b52a - Merge origin/main into fix/584-upgrade-582-ops.
  • 363b17f9 - ops: enforce factory-first F6 migrate and freeze runbook

Compare with previous version

added 3 commits <ul><li>5402859e - docs(audit): add MR 389 code-id pin security audit report</li><li>b2b8b52a - Merge origin/main into fix/584-upgrade-582-ops.</li><li>363b17f9 - ops: enforce factory-first F6 migrate and freeze runbook</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/390/diffs?diff_id=1975044005&start_sha=1a1a6b211abab8f1ad58b2cd3bc379cbf1b95fe0)
PlasticDigits (Migrated from gitlab.com) changed target branch from fix/582-cw20-code-id-pin to main 2026-08-21 00:14:00 +00:00
PlasticDigits commented 2026-08-21 00:15:03 +00:00 (Migrated from gitlab.com)

mentioned in commit 70e7950873

mentioned in commit 70e79508732841ea4a0bdf356dc4de031f473045
PlasticDigits (Migrated from gitlab.com) merged commit 70e7950873 into main 2026-08-21 00:15:05 +00:00
PlasticDigits commented 2026-08-21 00:16:25 +00:00 (Migrated from gitlab.com)

mentioned in issue #585

mentioned in issue #585
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!1108
No description provided.