Skip to content

cspell

cspell #541

name: Deploy Rollup Contracts

Check failure on line 1 in .github/workflows/deploy-rollup-contracts.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy-rollup-contracts.yml

Invalid workflow file

you may only define up to 10 `inputs` for a `workflow_dispatch` event
# This workflow is used to deploy rollup contracts to a cluster.
# It can be used to deploy to kind or a GKE cluster.
#
# Note that you can provide your own docker image. This helps to deploy into GKE.
# But if you're running against KIND, you can just load your aztecprotocol/aztec image with
# kind load docker-image aztecprotocol/aztec:yourtag
#
# example:
# export GOOGLE_APPLICATION_CREDENTIALS=/your/path/to/testnet-helm-sa.json
# alias lwfl=/your/path/to/aztec-clones/alpha/.github/local_workflow.sh
#
# lwfl deploy_rollup_contracts --input cluster=aztec-gke-private --input namespace=mitch-eth-devnet --input aztec_docker_image="iamjustmitch/aztec:8ebe8d7c45190b002c77e29358f2b307a23b5336" --input l1_rpc_urls="http://34.83.173.208:8545" --input mnemonic="test test test test test test test test test test test junk" --input l1_chain_id="1337" --input salt="456" --input sponsored_fpc=true --input real_verifier=true --input aztec_target_commitee_size=48
on:
workflow_call:
inputs:
cluster:
description: The cluster to deploy to, e.g. aztec-gke-private or kind
required: true
type: string
namespace:
description: The namespace to deploy to
required: true
type: string
ref:
description: The branch name to deploy from
required: true
type: string
aztec_docker_image:
description: Aztec Docker image with tag
required: true
type: string
l1_rpc_urls:
description: Comma-separated list of L1 RPC URLs
required: true
type: string
mnemonic:
description: Mnemonic for deployment
required: true
type: string
l1_chain_id:
description: L1 chain ID
required: true
type: string
salt:
description: Salt for deployment
required: true
type: string
validators:
description: Comma-separated list of validators
required: true
type: string
sponsored_fpc:
description: Enable sponsored FPC
required: true
type: boolean
real_verifier:
description: Deploy real verifier
required: true
type: boolean
# Aztec environment variables
aztec_slot_duration:
description: Aztec slot duration
required: true
type: string
aztec_epoch_duration:
description: Aztec epoch duration
required: true
type: string
aztec_target_committee_size:
description: Aztec target committee size
required: true
type: string
aztec_proof_submission_epochs:
description: Aztec proof submission epochs
required: true
type: string
aztec_activation_threshold:
description: Aztec activation threshold
required: true
type: string
aztec_ejection_threshold:
description: Aztec ejection threshold
required: true
type: string
aztec_slashing_quorum:
description: Aztec slashing quorum
required: true
type: string
aztec_slashing_round_size:
description: Aztec slashing round size
required: true
type: string
aztec_governance_proposer_quorum:
description: Aztec governance proposer quorum
required: true
type: string
aztec_governance_proposer_round_size:
description: Aztec governance proposer round size
required: true
type: string
aztec_mana_target:
description: Aztec mana target
required: true
type: string
aztec_proving_cost_per_mana:
description: Aztec proving cost per mana
required: true
type: string
secrets:
GCP_SA_KEY:
description: The JSON key for the GCP service account
required: true
KUBECONFIG_B64:
description: The base64 encoded kubeconfig
required: true
outputs:
registry_address:
description: The address of the registry contract
value: ${{ jobs.deploy_rollup_contracts.outputs.registry_address }}
slash_factory_address:
description: The address of the slash factory contract
value: ${{ jobs.deploy_rollup_contracts.outputs.slash_factory_address }}
fee_asset_handler_address:
description: The address of the fee asset handler contract
value: ${{ jobs.deploy_rollup_contracts.outputs.fee_asset_handler_address }}
governance_address:
description: The address of the governance contract
value: ${{ jobs.deploy_rollup_contracts.outputs.governance_address }}
governance_proposer_address:
description: The address of the governance proposer contract
value: ${{ jobs.deploy_rollup_contracts.outputs.governance_proposer_address }}
rollup_address:
description: The address of the rollup contract
value: ${{ jobs.deploy_rollup_contracts.outputs.rollup_address }}
inbox_address:
description: The address of the inbox contract
value: ${{ jobs.deploy_rollup_contracts.outputs.inbox_address }}
outbox_address:
description: The address of the outbox contract
value: ${{ jobs.deploy_rollup_contracts.outputs.outbox_address }}
fee_juice_portal_address:
description: The address of the fee juice portal contract
value: ${{ jobs.deploy_rollup_contracts.outputs.fee_juice_portal_address }}
zk_passport_verifier_address:
description: The address of the zk passport verifier contract
value: ${{ jobs.deploy_rollup_contracts.outputs.zk_passport_verifier_address }}
staking_asset_handler_address:
description: The address of the staking asset handler contract
value: ${{ jobs.deploy_rollup_contracts.outputs.staking_asset_handler_address }}
staking_asset_address:
description: The address of the staking asset contract
value: ${{ jobs.deploy_rollup_contracts.outputs.staking_asset_address }}
reward_distributor_address:
description: The address of the reward distributor contract
value: ${{ jobs.deploy_rollup_contracts.outputs.reward_distributor_address }}
gse_address:
description: The address of the gse contract
value: ${{ jobs.deploy_rollup_contracts.outputs.gse_address }}
coin_issuer_address:
description: The address of the coin issuer contract
value: ${{ jobs.deploy_rollup_contracts.outputs.coin_issuer_address }}
workflow_dispatch:
inputs:
cluster:
description: The cluster to deploy to, e.g. aztec-gke-private or kind
required: true
type: string
namespace:
description: The namespace to deploy to
required: true
type: string
ref:
description: The branch name to deploy from
required: true
type: string
aztec_docker_image:
description: Aztec Docker image with tag that will actually run deploy-l1-contracts
required: true
type: string
l1_rpc_urls:
description: Comma-separated list of L1 RPC URLs
required: true
type: string
mnemonic:
description: Mnemonic for deployment
required: true
type: string
l1_chain_id:
description: L1 chain ID
required: true
type: string
salt:
description: Salt for deployment
required: true
type: string
validators:
description: Comma-separated list of validators
required: true
type: string
default: ""
sponsored_fpc:
description: Enable sponsored FPC
required: true
type: boolean
real_verifier:
description: Deploy real verifier
required: true
type: boolean
# Aztec environment variables
aztec_slot_duration:
description: Aztec slot duration
required: true
type: string
aztec_epoch_duration:
description: Aztec epoch duration
required: true
type: string
aztec_target_committee_size:
description: Aztec target committee size
required: true
type: string
aztec_proof_submission_epochs:
description: Aztec proof submission epochs
required: true
type: string
aztec_activation_threshold:
description: Aztec activation threshold
required: true
type: string
aztec_ejection_threshold:
description: Aztec ejection threshold
required: true
type: string
aztec_slashing_quorum:
description: Aztec slashing quorum
required: true
type: string
aztec_slashing_round_size:
description: Aztec slashing round size
required: true
type: string
aztec_governance_proposer_quorum:
description: Aztec governance proposer quorum
required: true
type: string
aztec_governance_proposer_round_size:
description: Aztec governance proposer round size
required: true
type: string
aztec_mana_target:
description: Aztec mana target
required: true
type: string
aztec_proving_cost_per_mana:
description: Aztec proving cost per mana
required: true
type: string
jobs:
deploy_rollup_contracts:
runs-on: ubuntu-latest
outputs:
registry_address: ${{ steps.get-rollup-contracts-results.outputs.registry_address }}
slash_factory_address: ${{ steps.get-rollup-contracts-results.outputs.slash_factory_address }}
fee_asset_handler_address: ${{ steps.get-rollup-contracts-results.outputs.fee_asset_handler_address }}
governance_address: ${{ steps.get-rollup-contracts-results.outputs.governance_address }}
governance_proposer_address: ${{ steps.get-rollup-contracts-results.outputs.governance_proposer_address }}
rollup_address: ${{ steps.get-rollup-contracts-results.outputs.rollup_address }}
inbox_address: ${{ steps.get-rollup-contracts-results.outputs.inbox_address }}
outbox_address: ${{ steps.get-rollup-contracts-results.outputs.outbox_address }}
fee_juice_portal_address: ${{ steps.get-rollup-contracts-results.outputs.fee_juice_portal_address }}
zk_passport_verifier_address: ${{ steps.get-rollup-contracts-results.outputs.zk_passport_verifier_address }}
staking_asset_handler_address: ${{ steps.get-rollup-contracts-results.outputs.staking_asset_handler_address }}
staking_asset_address: ${{ steps.get-rollup-contracts-results.outputs.staking_asset_address }}
reward_distributor_address: ${{ steps.get-rollup-contracts-results.outputs.reward_distributor_address }}
gse_address: ${{ steps.get-rollup-contracts-results.outputs.gse_address }}
coin_issuer_address: ${{ steps.get-rollup-contracts-results.outputs.coin_issuer_address }}
env:
TF_STATE_BUCKET: aztec-terraform
REGION: us-west1-a
# Common Terraform variables as environment variables
TF_VAR_NAMESPACE: ${{ inputs.namespace }}
TF_VAR_AZTEC_DOCKER_IMAGE: ${{ inputs.aztec_docker_image }}
TF_VAR_L1_RPC_URLS: ${{ inputs.l1_rpc_urls }}
TF_VAR_MNEMONIC: ${{ inputs.mnemonic }}
TF_VAR_L1_CHAIN_ID: ${{ inputs.l1_chain_id }}
TF_VAR_SALT: ${{ inputs.salt }}
TF_VAR_VALIDATORS: ${{ inputs.validators }}
TF_VAR_SPONSORED_FPC: ${{ inputs.sponsored_fpc }}
TF_VAR_REAL_VERIFIER: ${{ inputs.real_verifier }}
TF_VAR_AZTEC_SLOT_DURATION: ${{ inputs.aztec_slot_duration }}
TF_VAR_AZTEC_EPOCH_DURATION: ${{ inputs.aztec_epoch_duration }}
TF_VAR_AZTEC_TARGET_COMMITTEE_SIZE: ${{ inputs.aztec_target_committee_size }}
TF_VAR_AZTEC_PROOF_SUBMISSION_EPOCHS: ${{ inputs.aztec_proof_submission_epochs }}
TF_VAR_AZTEC_ACTIVATION_THRESHOLD: ${{ inputs.aztec_activation_threshold }}
TF_VAR_AZTEC_EJECTION_THRESHOLD: ${{ inputs.aztec_ejection_threshold }}
TF_VAR_AZTEC_SLASHING_QUORUM: ${{ inputs.aztec_slashing_quorum }}
TF_VAR_AZTEC_SLASHING_ROUND_SIZE: ${{ inputs.aztec_slashing_round_size }}
TF_VAR_AZTEC_GOVERNANCE_PROPOSER_QUORUM: ${{ inputs.aztec_governance_proposer_quorum }}
TF_VAR_AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: ${{ inputs.aztec_governance_proposer_round_size }}
TF_VAR_AZTEC_MANA_TARGET: ${{ inputs.aztec_mana_target }}
TF_VAR_AZTEC_PROVING_COST_PER_MANA: ${{ inputs.aztec_proving_cost_per_mana }}
steps:
- name: debug inputs
run: |
echo "cluster: ${{ inputs.cluster }}"
echo "namespace: ${{ inputs.namespace }}"
echo "ref: ${{ inputs.ref }}"
echo "aztec_docker_image: ${{ inputs.aztec_docker_image }}"
echo "l1_rpc_urls: ${{ inputs.l1_rpc_urls }}"
echo "l1_chain_id: ${{ inputs.l1_chain_id }}"
echo "validators: ${{ inputs.validators }}"
echo "sponsored_fpc: ${{ inputs.sponsored_fpc }}"
echo "real_verifier: ${{ inputs.real_verifier }}"
- name: Setup K8s and Terraform
uses: ./.github/actions/setup-k8s-terraform
with:
cluster: ${{ inputs.cluster }}
namespace: ${{ inputs.namespace }}
ref: ${{ inputs.ref || github.ref }}
gcp_sa_key: ${{ secrets.GCP_SA_KEY }}
kubeconfig_b64: ${{ secrets.KUBECONFIG_B64 }}
terraform_dir: spartan/terraform/deploy-rollup-contracts
tf_state_prefix: deploy-rollup-contracts
additional_state_path: ${{ inputs.salt }}
- name: Terraform Plan
working-directory: spartan/terraform/deploy-rollup-contracts
run: |
# All variables are now set as TF_VAR_ environment variables
terraform plan -out=tfplan
- name: Terraform Apply
working-directory: spartan/terraform/deploy-rollup-contracts
run: |
terraform apply tfplan
- name: Get deployment results
id: get-rollup-contracts-results
working-directory: spartan/terraform/deploy-rollup-contracts
run: |
echo "=== Deployment Results ==="
echo "Job Name: $(terraform output -raw job_name)"
if [ "$(terraform output -raw deployment_successful)" = "true" ]; then
REGISTRY_ADDRESS=$(terraform output -raw registry_address)
SLASH_FACTORY_ADDRESS=$(terraform output -raw slash_factory_address)
FEE_ASSET_HANDLER_ADDRESS=$(terraform output -raw fee_asset_handler_address)
GOVERNANCE_ADDRESS=$(terraform output -raw governance_address)
GOVERNANCE_PROPOSER_ADDRESS=$(terraform output -raw governance_proposer_address)
ROLLUP_ADDRESS=$(terraform output -raw rollup_address)
INBOX_ADDRESS=$(terraform output -raw inbox_address)
OUTBOX_ADDRESS=$(terraform output -raw outbox_address)
FEE_JUICE_PORTAL_ADDRESS=$(terraform output -raw fee_juice_portal_address)
ZK_PASSPORT_VERIFIER_ADDRESS=$(terraform output -raw zk_passport_verifier_address)
STAKING_ASSET_HANDLER_ADDRESS=$(terraform output -raw staking_asset_handler_address)
STAKING_ASSET_ADDRESS=$(terraform output -raw staking_asset_address)
REWARD_DISTRIBUTOR_ADDRESS=$(terraform output -raw reward_distributor_address)
GSE_ADDRESS=$(terraform output -raw gse_address)
COIN_ISSUER_ADDRESS=$(terraform output -raw coin_issuer_address)
echo "registry_address=$REGISTRY_ADDRESS" >> $GITHUB_OUTPUT
echo "slash_factory_address=$SLASH_FACTORY_ADDRESS" >> $GITHUB_OUTPUT
echo "fee_asset_handler_address=$FEE_ASSET_HANDLER_ADDRESS" >> $GITHUB_OUTPUT
echo "governance_address=$GOVERNANCE_ADDRESS" >> $GITHUB_OUTPUT
echo "governance_proposer_address=$GOVERNANCE_PROPOSER_ADDRESS" >> $GITHUB_OUTPUT
echo "rollup_address=$ROLLUP_ADDRESS" >> $GITHUB_OUTPUT
echo "inbox_address=$INBOX_ADDRESS" >> $GITHUB_OUTPUT
echo "outbox_address=$OUTBOX_ADDRESS" >> $GITHUB_OUTPUT
echo "fee_juice_portal_address=$FEE_JUICE_PORTAL_ADDRESS" >> $GITHUB_OUTPUT
echo "zk_passport_verifier_address=$ZK_PASSPORT_VERIFIER_ADDRESS" >> $GITHUB_OUTPUT
echo "staking_asset_handler_address=$STAKING_ASSET_HANDLER_ADDRESS" >> $GITHUB_OUTPUT
echo "staking_asset_address=$STAKING_ASSET_ADDRESS" >> $GITHUB_OUTPUT
echo "reward_distributor_address=$REWARD_DISTRIBUTOR_ADDRESS" >> $GITHUB_OUTPUT
echo "gse_address=$GSE_ADDRESS" >> $GITHUB_OUTPUT
echo "coin_issuer_address=$COIN_ISSUER_ADDRESS" >> $GITHUB_OUTPUT
echo "✅ Rollup contracts deployed successfully!"
echo ""
echo "Contract Addresses:"
echo " Registry Address: $REGISTRY_ADDRESS"
echo " Slash Factory Address: $SLASH_FACTORY_ADDRESS"
echo " Fee Asset Handler Address: $FEE_ASSET_HANDLER_ADDRESS"
echo " Governance Address: $GOVERNANCE_ADDRESS"
echo " Governance Proposer Address: $GOVERNANCE_PROPOSER_ADDRESS"
echo " Rollup Address: $ROLLUP_ADDRESS"
echo " Inbox Address: $INBOX_ADDRESS"
echo " Outbox Address: $OUTBOX_ADDRESS"
echo " Fee Juice Portal Address: $FEE_JUICE_PORTAL_ADDRESS"
echo " ZK Passport Verifier Address: $ZK_PASSPORT_VERIFIER_ADDRESS"
echo " Staking Asset Handler Address: $STAKING_ASSET_HANDLER_ADDRESS"
echo " Staking Asset Address: $STAKING_ASSET_ADDRESS"
echo " Reward Distributor Address: $REWARD_DISTRIBUTOR_ADDRESS"
echo " GSE Address: $GSE_ADDRESS"
echo " Coin Issuer Address: $COIN_ISSUER_ADDRESS"
echo ""
else
echo "⚠️ JSON output not found in logs, but job completed."
echo "Raw output:"
terraform output -json contract_addresses_json
exit 1
fi