Pin Bridge-Debt markets and bound issuer controls (#1393) #1411

Merged
PlasticDigits merged 2 commits from fix/issue-1393-market-pins into main 2026-10-06 02:12:36 +00:00
Owner

Changing the global debt receipt code previously invalidated existing markets' Issue/Repay checks. Each market now retains its own receipt/underlying code pins and verified minter inventory, so future registration policy cannot invalidate a valid existing market. New issuance starts disabled and requires finite per-issue, outstanding and fixed-epoch limits.

Adds reviewed market upgrade proposals/acceptance, guarded lossless issuer/receipt migration, recipient-accepted owner transfer, and an issuance circuit breaker that preserves valid repayment/recovery. The deployment script checks an independently reviewed underlying code before transactions, preserves existing pins/pauses/limits, and refuses legacy setup mutations. Policy and tests are separate modules. Both crates are version 1.1.0.

Refs #1393. Implementation acceptance is complete; this PR does not claim production migration acceptance or close outstanding rollout scope.

Acceptance criteria — implementation/synthetic scope

  • AC1: two real synthetic markets with different receipt code IDs retain Issue/Repay after default rotation; upgrading one leaves the other usable.
  • AC2: inconsistent code/minter/decimals/supply changes and failed mint/burn legs roll back balances, outstanding, quota and pending upgrade state; approved upgrades preserve accounting and repayment.
  • AC3: foreign/newer/unsupported cw2 migrations reject; explicit verified legacy pins preserve existing storage/accounting; owner propose/cancel/accept requires recipient acceptance.
  • AC4: configured per-issue/outstanding/epoch limits reject excess and overflow, immutable epochs prevent quota reset, and paused repayment/recovery plus residual governance powers are documented.

Validation

  • make verify-issue-1393: PASS=9 FAIL=0 SKIP=0.
  • Full contracts: 901 passed, zero failed/ignored, repeated by the verifier.
  • Focused tests: 23 issuer + 12 receipt, first pass and retest.
  • Seven deployment-script regressions, documentation links, formatting and warnings-denied Clippy pass.
  • Optimized SDK53 LocalTerra issue/repay/atomic upgrade passes twice with actual code hashes, transaction receipts and supply reconciliation. Both the reused approved CW20 fixture and freshly built pinned fixture were exercised.
  • Wasm helper uses Rust 1.81 with modern Cargo and Binaryen 116 to avoid the observed Rust 1.99 std bulk-memory incompatibility; real rejected uploads were fixed and rerun successfully.
  • Pre-commit hooks passed workspace Clippy and gitleaks; no hooks bypassed.
  • Read-only production baseline confirms one market's receipt supply/debtor balance/outstanding parity, code hashes and actual 2-of-3 custody. Independent latest-state reads are not an atomic block snapshot.

Review and verification

Follow the agent checklist and BD1393-1–BD1393-10; use the verification record/receipts and operator message runbook.

Agents may skip genuinely unavailable items with attempted command, reason and precise scope, while recording overall PASS with skips if all executed checks pass. Skipped criteria remain unchecked; executed failures remain FAIL until corrected and rerun. Skips cannot establish deployment acceptance.

Unverified scope and relevant followup

Production signing/migration was not performed; the read-only baseline still shows issuer/receipt 1.0.0. An integrated synthetic pool dump/price-impact simulation was not run because the standalone fixture has no pool venue; caps were tested in raw units without a dollar-loss bound. A later rollout must use reviewed legacy pins and collect actual migration/repayment receipts. Other underlying minters and wasm admins retain their documented governance powers; advisory $1 valuation is not reserve backing.

Tested commit: 37d60ca3267f3009a3ee1f68c01ac53777d4095d; exact tested source digests are in the verification record.

Changing the global debt receipt code previously invalidated existing markets' Issue/Repay checks. Each market now retains its own receipt/underlying code pins and verified minter inventory, so future registration policy cannot invalidate a valid existing market. New issuance starts disabled and requires finite per-issue, outstanding and fixed-epoch limits. Adds reviewed market upgrade proposals/acceptance, guarded lossless issuer/receipt migration, recipient-accepted owner transfer, and an issuance circuit breaker that preserves valid repayment/recovery. The deployment script checks an independently reviewed underlying code before transactions, preserves existing pins/pauses/limits, and refuses legacy setup mutations. Policy and tests are separate modules. Both crates are version 1.1.0. Refs #1393. Implementation acceptance is complete; this PR does not claim production migration acceptance or close outstanding rollout scope. ### Acceptance criteria — implementation/synthetic scope - [x] AC1: two real synthetic markets with different receipt code IDs retain Issue/Repay after default rotation; upgrading one leaves the other usable. - [x] AC2: inconsistent code/minter/decimals/supply changes and failed mint/burn legs roll back balances, outstanding, quota and pending upgrade state; approved upgrades preserve accounting and repayment. - [x] AC3: foreign/newer/unsupported cw2 migrations reject; explicit verified legacy pins preserve existing storage/accounting; owner propose/cancel/accept requires recipient acceptance. - [x] AC4: configured per-issue/outstanding/epoch limits reject excess and overflow, immutable epochs prevent quota reset, and paused repayment/recovery plus residual governance powers are documented. ### Validation - `make verify-issue-1393`: **PASS=9 FAIL=0 SKIP=0**. - Full contracts: **901 passed**, zero failed/ignored, repeated by the verifier. - Focused tests: **23 issuer + 12 receipt**, first pass and retest. - Seven deployment-script regressions, documentation links, formatting and warnings-denied Clippy pass. - Optimized SDK53 LocalTerra issue/repay/atomic upgrade passes twice with actual code hashes, transaction receipts and supply reconciliation. Both the reused approved CW20 fixture and freshly built pinned fixture were exercised. - Wasm helper uses Rust 1.81 with modern Cargo and Binaryen 116 to avoid the observed Rust 1.99 std bulk-memory incompatibility; real rejected uploads were fixed and rerun successfully. - Pre-commit hooks passed workspace Clippy and gitleaks; no hooks bypassed. - Read-only production baseline confirms one market's receipt supply/debtor balance/outstanding parity, code hashes and actual 2-of-3 custody. Independent latest-state reads are not an atomic block snapshot. ### Review and verification Follow the [agent checklist](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/37d60ca3267f3009a3ee1f68c01ac53777d4095d/docs/qa/issue-1393/README.md) and [BD1393-1–BD1393-10](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/37d60ca3267f3009a3ee1f68c01ac53777d4095d/skills/AGENTS_BRIDGE_DEBT_MARKET_PINS.md); use the [verification record/receipts](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/37d60ca3267f3009a3ee1f68c01ac53777d4095d/docs/qa/issue-1393/verification.md) and [operator message runbook](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/37d60ca3267f3009a3ee1f68c01ac53777d4095d/docs/runbooks/deploy-usdt-ust1-lp.md). Agents may skip genuinely unavailable items with attempted command, reason and precise scope, while recording overall **PASS with skips** if all executed checks pass. Skipped criteria remain unchecked; executed failures remain FAIL until corrected and rerun. Skips cannot establish deployment acceptance. ### Unverified scope and relevant followup Production signing/migration was not performed; the read-only baseline still shows issuer/receipt 1.0.0. An integrated synthetic pool dump/price-impact simulation was not run because the standalone fixture has no pool venue; caps were tested in raw units without a dollar-loss bound. A later rollout must use reviewed legacy pins and collect actual migration/repayment receipts. Other underlying minters and wasm admins retain their documented governance powers; advisory $1 valuation is not reserve backing. Tested commit: `37d60ca3267f3009a3ee1f68c01ac53777d4095d`; exact tested source digests are in the verification record.
Pin Bridge-Debt markets and bound issuer controls (#1393)
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
37d60ca326
Keep existing markets usable after registration defaults change. Guard upgrades and ownership, cap issuance, and add migration and rollback regressions.
Integrate pinned debt markets with security fixes [skip ci]
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
36cf6d4bf6
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!1411
No description provided.