Skip to content

[SO-340] redeploy-contract: rebuild the deployment-manager when its sources change - #386

Open
ewitulsk wants to merge 1 commit into
stagingfrom
so-340-dm-cache-invalidation
Open

[SO-340] redeploy-contract: rebuild the deployment-manager when its sources change#386
ewitulsk wants to merge 1 commit into
stagingfrom
so-340-dm-cache-invalidation

Conversation

@ewitulsk

@ewitulsk ewitulsk commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Follow-up to #383. Run 30772017011 failed with the same JSON-RPC error after SO-337 merged — because it never ran the fixed code.

What actually happened

The workflow caches the compiled deployment-manager as a release asset (deployment-manager-bin / deploy-linux-x64) and downloads it unconditionally unless rebuild_manager is ticked. Nothing tied that asset to the code that produced it.

The run log proves it: the new workflow YAML executed (GRPC_FROM_SECRET: and GRPC_URL: show up in the step env), but the binary logged

starting deployment network=testnet rpc=https://fullnode.testnet.sui.io:443
Error: ... 0: building Sui client for testnet

rpc= and building Sui client are the pre-SO-337 log strings — the migrated binary logs grpc_host= and building chain client. So: fixed workflow, stale binary.

Fix

Hash the sources that feed the binary (rust-backend/Cargo.toml, Cargo.lock, crates/, tools/deployment-manager/) with git ls-tree -r HEAD, publish it beside the binary as deploy-linux-x64.srchash, and rebuild whenever the recorded hash doesnt match the current one. rebuild_manager stays as a manual override.

  • ls-tree reads the checked-out commit, so it cant be fooled by index/worktree state the way ls-files can. Verified it is stable across repeated runs and differs between HEAD and HEAD~1.
  • The hash is uploaded after the binary — if the binary upload fails, no hash is recorded and the next run rebuilds rather than trusting a mismatched pair.
  • Over-invalidating (hashing all of crates/, not just deployment-managers exact dependency set) only costs a rebuild. Under-invalidating is what caused this.

Unblocking now

This PR makes it self-correcting, but you dont have to wait: re-run Redeploy Contract with rebuild_manager: true and the already-merged SO-337 fix will be compiled and used.

Once this merges, the first run rebuilds on its own — the existing release asset has no .srchash, so the mismatch branch fires — and after that the cache tracks the code.

🤖 Generated with Claude Code

…ources change

The workflow caches the compiled binary as a release asset and downloads
it unconditionally unless `rebuild_manager` is ticked. Nothing tied that
asset to the code that produced it, so it went stale silently: SO-337
fixed the publish path, merged to staging, and the next redeploy still
failed with the old JSON-RPC error because it ran the cached pre-SO-337
binary (run 30772017011).

Hash the sources that feed the binary (Cargo.toml, Cargo.lock, crates/,
tools/deployment-manager/) via `git ls-tree` on the checked-out commit,
publish it beside the binary as `deploy-linux-x64.srchash`, and rebuild
whenever it doesn't match. `rebuild_manager` stays as a manual override.

The hash asset is uploaded after the binary, so a failed binary upload
leaves no hash and the next run rebuilds rather than trusting a
mismatched pair. The current release has no hash recorded, so the first
run after this merges rebuilds on its own.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-options Ready Ready Preview Aug 2, 2026 11:26pm

Request Review

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