Skip to content

feat(deploy): on-chain binary publish + reusable publish workflow (CD-loop publish side)#160

Merged
tangletools merged 4 commits into
mainfrom
chore/publish-v0-trading-and-script-race-fix
May 30, 2026
Merged

feat(deploy): on-chain binary publish + reusable publish workflow (CD-loop publish side)#160
tangletools merged 4 commits into
mainfrom
chore/publish-v0-trading-and-script-race-fix

Conversation

@tangletools

Copy link
Copy Markdown
Contributor

The publish + CD-trigger half of the blueprint upgrade loop. Carries the v0/on-chain publish work plus the new reusability that lets a blueprint repo's release CI auto-publish.

  • deploy/publish-binary.sh / publish-trading-v0.sh / register-blueprints.sh — compute sha256 + content-addressed URI, call publishBinaryVersion + setActiveBinaryVersion (owner key stays here).
  • RequestTradingService one-shot register+request+approve.
  • New (CD loop): .github/workflows/publish-blueprint-binary.yml gains a workflow_call trigger (alongside workflow_dispatch), exposing the same inputs + the privileged secrets (PUBLISH_RPC_URL, BLUEPRINT_OWNER_KEY). This lets tangle-network/ai-trading-blueprint's release CI (PR Payments rearchitecture: RFQ hardening + multi-asset bill weighting + facet split for EIP-170 #133 there) trigger an on-chain publish on every v* tag — closing the publish side of the loop. actionlint: clean.

Pairs with ai-trading-blueprint#133 (release trigger + operator approval UI) and the already-shipped manager watcher/swap pipeline. Must be on main so the cross-repo gh workflow run --ref main resolves.

drewstone added 3 commits May 26, 2026 14:32
… publish-binary

* blueprints.tsv: replace "no_v0_published" with "v0=<sha>; release=v0.1.3" for
  ids 13/14/15/16 — all four ai-trading blueprints now have a genesis binary
  version on-chain (Base Sepolia, setActiveBinaryVersion confirmed).

* publish-binary.sh: poll getBinaryVersionCount up to 5x after publishBinaryVersion
  to ride out the read-back gap immediately following cast send (where the call
  occasionally still sees stale state and parses to 0 → version_id=-1 → setActive
  reverts). Fail loudly with a clear error if the publish landed but the read
  still says 0 after retries.
…e in one shot

Reusable operator go-live script for any blueprint, compiled against tnt-core's
own ITangle interfaces so selectors always match the deployment (the reliable
path when cargo-tangle bindings are version-skewed — symptom UnknownSelector on
requestService). Env-driven: TANGLE_CORE / BLUEPRINT_ID / OPERATOR_KEY /
OPERATOR_ADDR / OPERATOR_PUBKEY / OPERATOR_RPC. Proven: ai-trading blueprint 13,
service 0 ACTIVE on Base Sepolia.
Add a workflow_call trigger alongside workflow_dispatch so a blueprint
repo's release CI can invoke the on-chain publish directly. Inputs mirror
the manual trigger; PUBLISH_RPC_URL and BLUEPRINT_OWNER_KEY are exposed as
workflow_call secrets so the owner key stays in tnt-core. The shared job
reads inputs.*/secrets.* identically for both triggers.
drewstone
drewstone previously approved these changes May 30, 2026

@drewstone drewstone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved tangletools PR — 73ccc4ab

This PR was opened by the trusted tangletools automation account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: tangletools_author · 2026-05-30T16:07:28Z

@tangletools

tangletools commented May 30, 2026

Copy link
Copy Markdown
Contributor Author

🔍 Reviewing 73ccc4ab

Pass Status ETA
opencode DeepSeek v4 Pro Running (8 min) ~5-15 min
Kimi Code K2.6 Running (8 min) ~5-15 min

Agent review running. Reads the actual code. This comment updates in place.

tangletools · #160 · model: kimi-for-coding · started 2026-05-30T16:17:17Z

…blueprint-agnostic)

The script is generic protocol ops (registerOperator → requestService →
approveService for any BLUEPRINT_ID env). Only its name/comments were
trading-specific; rename + de-trading the docs so tnt-core stays
blueprint-agnostic. Logic unchanged.

@drewstone drewstone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved tangletools PR — 8f15ced0

This PR was opened by the trusted tangletools automation account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: tangletools_author · 2026-05-30T16:17:47Z

@tangletools tangletools merged commit 7c32e54 into main May 30, 2026
@tangletools tangletools deleted the chore/publish-v0-trading-and-script-race-fix branch May 30, 2026 16:17
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.

2 participants