Skip to content

fix: replace broken Phala CLI flags with direct API calls for prod deploy#208

Open
Garandor wants to merge 13 commits intonextfrom
feature/cpl-163-fix-phala-cli-multisig
Open

fix: replace broken Phala CLI flags with direct API calls for prod deploy#208
Garandor wants to merge 13 commits intonextfrom
feature/cpl-163-fix-phala-cli-multisig

Conversation

@Garandor
Copy link
Copy Markdown
Contributor

Summary

  • Replaced nonexistent phala deploy --prepare-only / --commit CLI flags with direct phala api calls to the Phala Cloud REST API (/cvms/.../compose_file/provision and /cvms/.../compose_file PATCH)
  • Auto-detects the AppAuth (DstackApp) contract address from CVM KMS info instead of requiring a separate GitHub variable
  • Fixed Safe transaction proposal to support delegate signers (eth_sign) in addition to owners, and removed the unused commit_token field from the deployment context

Test plan

  • Verified end-to-end success of deploy-prod-1-propose.yml on tag v0.0.8 (run 23678671774)

🤖 Generated with Claude Code

Garandor and others added 11 commits March 27, 2026 15:02
The phala CLI does not have --prepare-only, --commit, --token,
--compose-hash, or --transaction-hash flags. Replace these with
direct Phala Cloud API calls:

Phase 1: POST /cvms/{id}/compose_file/provision to get compose_hash
Phase 2: PATCH /cvms/{id}/compose_file with compose_hash to commit

Also removes the non-existent commit_token from the deployment context.

Fixes CPL-163

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Capture stderr and show actual error message when the API call fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Phala Cloud API requires a name field in the compose file
provision request.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Auto-detect dstack_app_address from Phala CVM info instead of
  requiring APP_AUTH_ADDRESS_CHIPOTLE_PROD variable
- Use BASE_DEPLOYER_SECRET as proposer key (0x7774... is Safe owner #1
  and the diamond contract deployer)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
BASE_DEPLOYER_SECRET (0x51ba..94ea) was rotated and is no longer a
Safe owner. Try PHALA_DSTACKAPP_PRIVATE_KEY which may be the original
deployer key.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The proposer address (0x51ba...94ea) is registered as a Safe delegate,
not an owner. The Protocol Kit's signTransaction() requires owner keys.

Instead, detect whether the proposer is an owner or delegate:
- Owner: use Protocol Kit's EIP-712 signature (existing behavior)
- Delegate: sign with eth_sign (message hash prefix, v+4 adjustment)
  and propose via the Transaction Service API

This allows the CI pipeline's proposer key to submit Safe transactions
without being a multisig owner.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Garandor Garandor requested a review from a team March 28, 2026 07:03
Garandor and others added 2 commits March 28, 2026 02:12
The comment documented BASE_DEPLOYER_SECRET but the workflow actually
references SAFE_PROPOSER_PRIVATE_KEY.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@GTC6244 GTC6244 assigned GTC6244 and unassigned GTC6244 Mar 28, 2026
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