Skip to content

feat(deploy): one-command deploy (contracts + blueprint) + release workflow#24

Merged
drewstone merged 1 commit into
mainfrom
feat/deploy-ops
Jun 14, 2026
Merged

feat(deploy): one-command deploy (contracts + blueprint) + release workflow#24
drewstone merged 1 commit into
mainfrom
feat/deploy-ops

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Closes the two deploy-ops launch-blockers so a Surplus testnet is repeatable — locally and on Base Sepolia. Deploy is from this repo (tnt-core is a vendored lib; the Tangle core is already on-chain).

Gap 1 — contracts weren't deployed by the launch script

  • deploy/deploy-surplus.sh (new): unified contract deploy. Runs Deploy.s.sol (timelock-owned SurplusSettlement + SurplusBSM + initial book), captures the addresses into deploy/.env.deployed and the manifest's surplus_settlement_address. Same script local (anvil) or Base Sepolia — only the RPC + production env change (PAYMENT_TOKEN=real USDC, TIMELOCK_ADMIN=Gnosis Safe, book attesters, optional SP1 verifier). BROADCAST="" for a dry run.
  • deploy/base-sepolia.sh: now deploys the settlement spine first, sources the captured addresses, then registers the blueprint (cargo tangle blueprint deployonBlueprintCreated on the BSM). Previously it only ran the blueprint registration and never deployed SurplusSettlement.

Gap 2 — the blueprint pinned a release that didn't exist

  • .github/workflows/release.yml (new): on a v* tag, build + publish the surplus-operator (linux/amd64) binary the definitions fetch, and emit its sha256.
  • scripts/set-release-sha.sh (new): pin that sha256 (+ tag) into deploy/blueprint-definition*.toml so cargo tangle blueprint deploy verifies the artifact. The v0.1.0 pin no longer references a non-existent release once you cut the tag.

Verified

  • Full local test of the production deploy path: deploy-surplus.sh against anvil deployed MockUSD → SurplusSettlement → SurplusBSM (wired) → book → TimelockController, and wrote deploy/.env.deployed.
  • Base Sepolia dry-run (earlier) ran the same Deploy.s.sol logic end-to-end against live chain state (only stopped at the unfunded-key gas step).
  • release.yml valid; all scripts bash -n clean; set-release-sha.sh rewrites + reverts the pin correctly.

To actually go live (your call — funds + governance)

PAYMENT_TOKEN=<USDC> TIMELOCK_ADMIN=<safe> DEPLOYER_KEY=<funded> deploy/base-sepolia.sh, after cutting the v0.1.0 release (this workflow) and scripts/set-release-sha.sh <sha> v0.1.0.

…ation + release workflow

Closes the two deploy-ops gaps so launch is repeatable, local and on Base Sepolia:

- deploy/deploy-surplus.sh: unified contract deploy — Deploy.s.sol (timelock-owned
  SurplusSettlement + SurplusBSM + initial book) captured into deploy/.env.deployed
  and the manifest's surplus_settlement_address. Same script local (anvil) or
  Base Sepolia (swap RPC + PAYMENT_TOKEN/TIMELOCK_ADMIN); BROADCAST="" for a dry
  run. Verified locally end-to-end (token -> settlement -> BSM -> book -> timelock,
  addresses captured).
- deploy/base-sepolia.sh: now deploys the SurplusSettlement spine FIRST (gap: it
  previously only ran `cargo tangle blueprint deploy`), sources the captured
  addresses, then registers the blueprint (onBlueprintCreated on the BSM).
- .github/workflows/release.yml: on a v* tag, build + publish the `surplus-operator`
  (linux/amd64) binary the blueprint definitions fetch, emit its sha256.
- scripts/set-release-sha.sh: pin that sha256 (+ tag) into the definitions so
  `cargo tangle blueprint deploy` verifies the artifact — the v0.1.0 pin no longer
  references a non-existent release.

Deploy is from THIS repo (tnt-core is a vendored lib; Tangle core is on-chain).
@drewstone drewstone merged commit 9dab46c into main Jun 14, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant