Skip to content

v0.2 Blue/Green Testnet Cutover Record ​

This records the v0.2 Testnet cutover and preserves the rollback procedure.

Current status ​

GREEN v0.2 became current public Testnet production on 2026-10-26 after its protected Preview and full lifecycle were verified: create → top up → three project-controlled watcher identities voted Down in one round → settlement → cancel → withdraw. The public Web uses the GREEN contracts and indexer. Production deployment dpl_2PUYihsd4aaqJ9nCNofEoqEg11Jq is served at https://slasettle-web.vercel.app; rollback deployment dpl_3GiQGWRH4t59vp55cSkZD5obLQUF remains Ready. BLUE contracts, Worker, and D1 remain intact as legacy/rollback infrastructure. PR #52 was still draft and unmerged when this evidence update began.

The staged Preview origin https://slasettle-c6zukmevs-hollujays-projects.vercel.app remains Vercel-auth protected and is not described as public. The final GREEN CORS allowlist is http://localhost:3000, that protected Preview origin, and https://slasettle-web.vercel.app. The three GREEN watcher identities are project-controlled Testnet identities, not independent or community-operated.

Why blue/green, not an in-place upgrade ​

A freshly initialized sla_vault starts its NextSlaId counter at 0 (see contracts/sla_vault/src/lib.rs's initialize). SLA IDs are only unique within a single contract deployment — a second deployment will create its own "SLA 0", "SLA 1", etc., independent of anything the first deployment ever created.

The indexer's D1 schema has no column identifying which deployment a row belongs to: slas.sla_id TEXT PRIMARY KEY is the only key. Reusing the existing production D1 for the new v0.2 contract pair means the new deployment's SLA 0 collides with the old deployment's SLA 0 — INSERT OR IGNORE silently drops the new row, and checks/settlements queries filtered only by sla_id mix both deployments' events under one key with no way to tell them apart afterward. This is proven deterministically in indexer/src/db/cutover-collision.test.ts.

Separately, the indexer's checkpoint is a single persisted row (checkpoint.id = 1): once last_cursor is set, START_LEDGER is permanently ignored on every subsequent run (see indexer/src/ingest/poller.ts and indexer/src/worker/ingest.ts). Pointing the existing Worker at new v0.2 contract IDs while keeping the old cursor would resume ingestion from the old position filtering for the new contracts — START_LEDGER would never take effect, and the gap between the old cursor and the new contracts' real first event would never be captured.

Both problems are solved the same way: the v0.2 deployment gets its own D1 (empty checkpoint, clean schema) and its own Worker, run alongside the untouched v0.1 Worker and D1, not atop them.

Topology ​

OLD / BLUE (untouched throughout):

  • Worker: slasettle-indexer
  • D1: slasettle-indexer (database id c45540af-2fb9-4092-a771-c34b0b4a4e69)
  • Contracts: the existing v0.1 pair (CDRNXUPCZTVZXKPWNBQZAYI6HYFNBDHRO2KNNJSMDVTEHFOM7LCMOYMF / CDBFPYHJNYSIFXSMXF3BBDWPKHRS7SJFFEKMQ5WJXYTBMD4LFAG2CHLN)
  • Web: rollback deployment dpl_3GiQGWRH4t59vp55cSkZD5obLQUF

NEW / GREEN (deployed):

  • Worker: slasettle-indexer-v02 (https://slasettle-indexer-v02.slasettle-indexer.workers.dev)
  • D1: slasettle-indexer-v02 (id 17b47ce0-bdc6-46eb-ba72-0513804b7827)
  • Contracts: watcher_registry CDTIVQ6I77EMFP42522RIFKMSMJID3BDLNR5LPLJEGVAS4Q2DJDMN3DY, sla_vault CA5R7V5IGMYOBRSAMP4R5MWURSNTY6565NSKEEVR6626PLC3VM2A3EZ2
  • Web: public production deployment dpl_2PUYihsd4aaqJ9nCNofEoqEg11Jq, promoted from the lifecycle-tested staged production artifact.

The old v0.1 Worker may keep serving as a reachable legacy/historical API during the initial v0.2 rollout — it is not decommissioned by this plan.

The repository preserves its exact Worker rollback configuration at indexer/wrangler.blue-v01.rollback.jsonc. If a rollback is explicitly authorized, run from indexer/:

bash
npx wrangler deploy --config wrangler.blue-v01.rollback.jsonc

Do not use that legacy file for current production and do not run this command as part of routine source reconciliation.

Authoritative v0.2 hashes ​

These are the SDK-29.0.1 v0.2 WASM hashes, uploaded and deployed as the green contracts above — verified identical on upload (stellar contract upload returned these exact hashes) and reconfirmed by rebuilding from source immediately before upload:

  • watcher_registry: e433b7e36580889b1a2aa94570ed7adee7e9048d4d211a10031ffcfa8fc53171
  • sla_vault: 23ea6cdc28a11883fd5979c06fcdea3b3f68a5b2aa9f0bace855de0149d8ac79

PREP ​

  • Verify the current Stellar Testnet protocol version (e.g. via getNetwork against the RPC URL) and confirm it still matches the protocol the v0.2 WASMs were built and tested under. If the network has moved to a new protocol since the last local verification, STOP before deploying and repeat Vault fmt/check/test/clippy, stellar contract build, hash comparison, and interface inspection under the new protocol before proceeding. See "Protocol 30 boundary" below.
  • Rebuild the Vault locally (stellar contract build) and confirm both hashes still equal the authoritative hashes above.
  • Verify Hub identity (git config user.name/user.email, gh auth status, gh api user --jq .login) matches ZeePearl56.
  • Verify the connected Cloudflare account has free-tier capacity for one additional temporary Worker and one additional D1 database. If it does not, STOP and report rather than silently choosing a paid plan.

GREEN CONTRACTS ​

  1. Upload watcher_registry's WASM (stellar contract upload --wasm target/wasm32v1-none/release/watcher_registry.wasm --source-account <DEPLOYER> --network testnet); verify the returned hash equals the authoritative watcher_registry hash above.
  2. Deploy an instance from that verified hash (stellar contract deploy --wasm-hash <VERIFIED_HASH> --source-account <DEPLOYER> --network testnet).
  3. Initialize it (initialize --admin <ADMIN_PUBLIC_KEY>).
  4. Register the initial/test watcher set.
  5. Upload sla_vault's WASM; verify the returned hash equals the authoritative sla_vault hash above.
  6. Deploy an instance from that verified hash.
  7. Initialize it with the new registry's contract ID (initialize --admin <ADMIN_PUBLIC_KEY> --watcher_registry <NEW_REGISTRY_ID>).

See apps/docs/developers/deployment.md section 1 for the exact command forms, confirmed against this environment's installed Stellar CLI.

GREEN DATA ​

  1. Create a new D1 database (wrangler d1 create slasettle-indexer-v02); record its name and id.
  2. Apply indexer/migrations/0001_initial_schema.sql then 0002_v0.2_endpoint_lifecycle.sql, in that order, to the new database only.
  3. Inspect the resulting schema: confirm all 6 tables (checkpoint, watchers, checks, slas, settlements, sla_lifecycle_events) and their indexes exist, and that slas.endpoint_hash/checks.endpoint_hash are present.
  4. Confirm the new database's checkpoint table is empty (no row with id = 1) — this is what lets START_LEDGER take effect on the green Worker's first run.
  5. Never bind this database to the blue Worker, and never bind the blue database to the green Worker.

Do not apply 0002 to the existing production D1 as a v0.2 migration strategy — that reuses the same sla_id space the old deployment already populated. The green D1 is built clean from both migrations from the start.

GREEN INDEXER ​

  1. Configure a new Worker (conceptually, a new wrangler.jsonc / environment section) named slasettle-indexer-v02, binding the fresh D1 created above.
  2. Set WATCHER_REGISTRY_CONTRACT_ID and SLA_VAULT_CONTRACT_ID to the new v0.2 contract addresses. These are public configuration (Soroban contract addresses are visible on-chain to anyone), not secrets — they belong in vars, the same way the current indexer/wrangler.jsonc sets them, never behind wrangler secret put.
  3. Set START_LEDGER explicitly to the earliest ledger containing either the new registry's deployment/initialization events, or the first v0.2 application event that must be retained. Because the green checkpoint starts empty, this value will actually take effect (unlike pointing the existing blue Worker at new contract IDs, where a persisted cursor would silently override it).
  4. Deploy the green Worker.
  5. Verify its API: /v1/health, /v1/clock, /v1/watchers.

GREEN PREVIEW WEB ​

  1. Configure a Vercel preview deployment with the new v0.2 contract IDs and the green indexer's URL — not the production environment.
  2. Deploy the preview.
  3. Run the full live lifecycle against it before touching production:
    • page loads;
    • indexer health/clock;
    • Freighter connection;
    • network guard;
    • create SLA;
    • commitment preview;
    • provider dashboard;
    • status page;
    • local endpoint verifier;
    • watcher votes;
    • settlement;
    • lifecycle history.

PRODUCTION CUTOVER ​

Only after every preview check above passes:

  1. Switch production Web's environment to the green contract IDs and green indexer URL.
  2. Redeploy production Web.
  3. Verify browser/Freighter behavior against production exactly as done on preview.
  4. Leave the blue Worker, blue D1, and blue contracts intact and reachable.

ROLLBACK ​

If the cutover fails at any point:

  1. Restore production Web's environment/configuration to the old vault contract ID, old registry contract ID, and old indexer URL.
  2. Redeploy the previous known-good Web build.
  3. The blue D1 requires no downgrade — it was never touched.
  4. The blue contracts require no redeployment — they were never touched.

Protocol 30 boundary ​

As of 2026-10-26, Stellar Testnet is at Protocol 29 (confirmed live via getNetwork against https://soroban-testnet.stellar.org). A Protocol 30 Testnet vote is scheduled for 2026-11-03 17:00 UTC. If v0.2 deployment happens after Testnet upgrades to Protocol 30, do not assume the Protocol-29 build evidence above remains authoritative — STOP before deploying and repeat: Vault fmt/check/test/clippy, stellar contract build, WASM hash comparison, and stellar contract info interface re-inspection, all under the new protocol.