feat(deploy): one-command deploy (contracts + blueprint) + release workflow#24
Merged
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. RunsDeploy.s.sol(timelock-ownedSurplusSettlement+SurplusBSM+ initial book), captures the addresses intodeploy/.env.deployedand the manifest'ssurplus_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 deploy→onBlueprintCreatedon the BSM). Previously it only ran the blueprint registration and never deployedSurplusSettlement.Gap 2 — the blueprint pinned a release that didn't exist
.github/workflows/release.yml(new): on av*tag, build + publish thesurplus-operator(linux/amd64) binary the definitions fetch, and emit its sha256.scripts/set-release-sha.sh(new): pin that sha256 (+ tag) intodeploy/blueprint-definition*.tomlsocargo tangle blueprint deployverifies the artifact. Thev0.1.0pin no longer references a non-existent release once you cut the tag.Verified
deploy-surplus.shagainst anvil deployed MockUSD → SurplusSettlement → SurplusBSM (wired) → book → TimelockController, and wrotedeploy/.env.deployed.Deploy.s.sollogic end-to-end against live chain state (only stopped at the unfunded-key gas step).release.ymlvalid; all scriptsbash -nclean;set-release-sha.shrewrites + 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 thev0.1.0release (this workflow) andscripts/set-release-sha.sh <sha> v0.1.0.