Harden router trust lifecycle and single-use settlement (#1388) #1408

Merged
PlasticDigits merged 2 commits from fix/issue-1388-router-trust into main 2026-10-06 02:10:38 +00:00
Owner

A replaced router could leave existing community-tax instances bound to obsolete settlement authority, and a trusted-router regression could emit the same settlement entry repeatedly. This adds live-wasm-admin or bound-factory-governance recovery/revocation with exact candidate code ID/SHA-256/factory/capability and immutable/factory-governed custody checks, monotonic route IDs and bounded single-use token settlement slots. Router/token release 1.3.0 preserves existing configuration and storage while revoking only obsolete router exemptions.

Rollout preflight rejects stale bindings across the complete inventory, including unpaired zero-rate tokens. Artifact probes compare actual code IDs and full hashes. Trading discovery checks live code identity before every cache lookup and rejects migrations during discovery, while retaining the five-second capability/rate TTL within unchanged code identity. Catalog provenance remains independently enforced.

Fixes #1388. Production rollout remains separate under #1384.

Issue acceptance checklist:

  • AC1: reject new-address/stale-binding rollout before broadcasts; test existing-address migration and funded first/middle/final routes.
  • AC2: authorized adopted-token recovery/revocation, direct recovery with an opaque contract admin, stale-router rejection, atomic malformed/unauthorized failures and overlapping exemption preservation.
  • AC3: same-version/different-hash rejection and immediate discovery cutover when live code identity changes.
  • AC4: canonical emission, duplicate-slot rollback, identical transfers across separate routes, dust isolation, bounded state and nonce/storage compatibility.
  • Production migration/rotation and bounded live execution: unverified; synthetic receipts do not establish deployment.

Validation: final focused verifier 12 PASS / 0 FAIL / 1 production SKIP; funding regression verifier 13 PASS / 0 FAIL / 1 production SKIP; 890 contract tests, 475 indexer library tests, 55 Postgres API tests and 268 frontend tests. Two earlier-version migrations and two 12-check rotation/revocation rehearsals passed on LocalTerra; native/invoice atomic flows passed. Commit hooks and independent security review passed.

Validation receipts and exact commands: results. Reproduce with make verify-issue-1388 and make verify-issue-1381; see the agent checklist, recovery runbook, and RTTRUST1388-1–RTTRUST1388-10. Complete runnable checks first. An agent may skip unavailable items and report overall PASS with explicit skips, leaving the corresponding criterion unverified with a concrete reason; executed failures remain FAIL.

A replaced router could leave existing community-tax instances bound to obsolete settlement authority, and a trusted-router regression could emit the same settlement entry repeatedly. This adds live-wasm-admin or bound-factory-governance recovery/revocation with exact candidate code ID/SHA-256/factory/capability and immutable/factory-governed custody checks, monotonic route IDs and bounded single-use token settlement slots. Router/token release 1.3.0 preserves existing configuration and storage while revoking only obsolete router exemptions. Rollout preflight rejects stale bindings across the complete inventory, including unpaired zero-rate tokens. Artifact probes compare actual code IDs and full hashes. Trading discovery checks live code identity before every cache lookup and rejects migrations during discovery, while retaining the five-second capability/rate TTL within unchanged code identity. Catalog provenance remains independently enforced. Fixes #1388. Production rollout remains separate under #1384. Issue acceptance checklist: - [x] AC1: reject new-address/stale-binding rollout before broadcasts; test existing-address migration and funded first/middle/final routes. - [x] AC2: authorized adopted-token recovery/revocation, direct recovery with an opaque contract admin, stale-router rejection, atomic malformed/unauthorized failures and overlapping exemption preservation. - [x] AC3: same-version/different-hash rejection and immediate discovery cutover when live code identity changes. - [x] AC4: canonical emission, duplicate-slot rollback, identical transfers across separate routes, dust isolation, bounded state and nonce/storage compatibility. - [ ] Production migration/rotation and bounded live execution: unverified; synthetic receipts do not establish deployment. Validation: final focused verifier **12 PASS / 0 FAIL / 1 production SKIP**; funding regression verifier **13 PASS / 0 FAIL / 1 production SKIP**; 890 contract tests, 475 indexer library tests, 55 Postgres API tests and 268 frontend tests. Two earlier-version migrations and two 12-check rotation/revocation rehearsals passed on LocalTerra; native/invoice atomic flows passed. Commit hooks and independent security review passed. Validation receipts and exact commands: [results](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/73ca24cf133baa8e2962242b29a92ef880d56459/docs/qa/issue-1388/RESULTS.md). Reproduce with `make verify-issue-1388` and `make verify-issue-1381`; see the [agent checklist](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/73ca24cf133baa8e2962242b29a92ef880d56459/docs/qa/issue-1388/README.md), [recovery runbook](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/73ca24cf133baa8e2962242b29a92ef880d56459/docs/runbooks/router-trust-1388.md), and [RTTRUST1388-1–RTTRUST1388-10](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/73ca24cf133baa8e2962242b29a92ef880d56459/skills/AGENTS_ROUTER_TRUST_LIFECYCLE.md). Complete runnable checks first. An agent may skip unavailable items and report overall **PASS with explicit skips**, leaving the corresponding criterion unverified with a concrete reason; executed failures remain FAIL.
Harden router trust lifecycle and single-use settlement
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
73ca24cf13
Add governed router recovery, candidate custody checks and bounded settlement consumption. Bind trading discovery and rollout checks to live code identity and document verification evidence.
Integrate router trust with reverse budgeting [skip ci]
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
a7ad91d8a2
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!1408
No description provided.