Skip to content

Upgrades

Witness is pre-1.0. Pin a reviewed commit or release, read its changes, and upgrade deliberately. The gateway's SQL migrations are compiled into the binary and run automatically at startup; they are forward-only.

Moving to v0.11: start a new network and log. See the migration guide before changing an existing deployment.

Moving to v0.10: protocol v2 does not verify v1 receipts or checkpoints. Follow the migration guide: start a new network with a fresh gateway database and signer state files, and preserve old evidence with its compatible verifier and public keys.

Procedure

  1. Review the new binary, configuration changes, and release notes.
  2. Create and test a compatible SQLite backup and save the matching configuration, log key, signed key history, and signer checkpoint state.
  3. Build the gateway from the reviewed source:
cargo build --release -p witness-gateway
  1. Exercise the new binary against a copy of the database before production.
  2. Stop the existing gateway, install the reviewed binary, and start it once.
  3. Inspect migration and witness-health logs, then verify /health through the TLS-terminating proxy.
  4. Confirm that threshold collection, database writes, metrics, and intended authentication controls behave as expected.

Do not run multiple gateway processes against one SQLite file. Shutdown cancels active signing attempts rather than draining them; their leases expire and can be reclaimed by a surviving or restarted worker. Operators should still use a controlled upgrade window.

Upgrading a gateway to log tiles

An existing C2SP checkpoint database can be upgraded in place. Back it up and test the upgrade on a copy first. The gateway builds the new SQLite index on the first startup, before serving requests. Plan time and disk space for it to read all closed batches and write their receipt positions and subtree hashes. If a saved batch or checkpoint root disagrees with the rebuild, the gateway refuses to start; investigate the discrepancy rather than dropping old state. Later starts do not repeat the rebuild.

Do not run the old gateway binary against the upgraded database. If you need to roll back, follow the backup procedure below.

Rollback boundary

There are no down migrations. To roll back, stop the gateway, restore a compatible pre-upgrade database backup, deploy the previously reviewed binary and matching configuration, then verify health and witness connectivity.

Do not roll a live signer's checkpoint state back to an older snapshot. Changing signing keys requires a signed key transition; after compromise, clients must re-pin the new configuration independently.