From 829807af4de8d6b0958668d4a7b168c35d014312 Mon Sep 17 00:00:00 2001 From: PhilWindle Date: Fri, 23 May 2025 13:17:37 +0000 Subject: [PATCH 1/6] Added testnet provers yaml --- .../values/alpha-testnet-provers.yaml | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 spartan/aztec-network/values/alpha-testnet-provers.yaml diff --git a/spartan/aztec-network/values/alpha-testnet-provers.yaml b/spartan/aztec-network/values/alpha-testnet-provers.yaml new file mode 100644 index 000000000000..ed4d736ed72a --- /dev/null +++ b/spartan/aztec-network/values/alpha-testnet-provers.yaml @@ -0,0 +1,90 @@ +telemetry: + enabled: true + +snapshots: + uploadLocation: "gs://aztec-testnet/snapshots/" + syncUrl: "https://storage.googleapis.com/aztec-testnet/snapshots/" + frequency: "0 0 * * *" # daily uploads at midnight + +aztec: + realProofs: true + numberOfDefaultAccounts: 0 + testAccounts: false + sponsoredFPC: true + bootstrapENRs: "enr:-LO4QLbJddVpePYjaiCftOBY-L7O6Mfj_43TAn5Q1Y-5qQ_OWmSFc7bTKWHzw5xmdVIqXUiizum_kIRniXdPnWHHcwEEhWF6dGVjqDAwLTExMTU1MTExLTAwMDAwMDAwLTAtMTgwNmEwMjgtMWE1MzBmM2KCaWSCdjSCaXCEI8nh9YlzZWNwMjU2azGhA-_dX6aFcXP1DLk91negbXL2a0mNYGXH4hrMvb2i92I0g3VkcIKd0A,enr:-LO4QN4WF8kFyV3sQVX0C_y_03Eepxk5Wac70l9QJcIDRYwKS6aRst1YcfbTDdvovXdRfKf-WSXNVWViGLhDA-dUz2MEhWF6dGVjqDAwLTExMTU1MTExLTAwMDAwMDAwLTAtMTgwNmEwMjgtMWE1MzBmM2KCaWSCdjSCaXCEIicTHolzZWNwMjU2azGhAsz7aFFYRnP5xjTux5UW-HyEQcW_EJrZMT1CNm79N4g-g3VkcIKd0A,enr:-LO4QFrGfkRaCk_iFTeUjR5ESwo45Eov9hx_T1-BLdoT-iHzFgCiHMT4V1KBtdFp8D0ajLSe5HcNYrhalmdJXgv6NTUEhWF6dGVjqDAwLTExMTU1MTExLTAwMDAwMDAwLTAtMTgwNmEwMjgtMWE1MzBmM2KCaWSCdjSCaXCEIlICt4lzZWNwMjU2azGhAlC6nKB3iDtRFqWKWqxf_t-P9hc-SZ6VFBJV4y3bTZBQg3VkcIKd0A" + contracts: + registryAddress: "0x4d2cc1d5fb6be65240e0bfc8154243e69c0fb19e" + rollupAddress: "0xee6d4e937f0493fb461f28a75cf591f1dba8704e" + slashFactoryAddress: "0x3c9ccf55a8ac3c2eeedf2ee2aa1722188fd676be" + feeAssetHandlerContractAddress: "0x80d848dc9f52df56789e2d62ce66f19555ff1019" + +network: + public: true + p2pBootstrapNodesAsFullPeers: false + +blobSink: + enabled: false + archiveApiUrl: "https://api.sepolia.blobscan.com" + dataStoreConfig: + dataDir: "/data" + storageSize: "128Gi" + dataStoreMapSize: "134217728" # 128 GB + +bot: + enabled: false + +pxe: + enabled: false + +faucet: + enabled: false + +bootNode: + enabled: false + replicas: 0 + # unused. + externalHost: "http://localhost:8080" + +fullNode: + enabled: false + replicas: 0 + # unused + externalHost: "http://localhost:8080" + +proverNode: + l1FixedPriorityFeePerGas: 3 + l1GasLimitBufferPercentage: 15 + l1GasPriceMax: 1000 + failedEpochStore: "gs://aztec-testnet/failed-epochs/" + maxOldSpaceSize: "8192" + storageSize: "512Gi" + resources: + requests: + cpu: "3" + memory: "10Gi" + +validator: + replicas: 0 + +proverBroker: + storageSize: "10Gi" + +proverAgent: + replicas: 30 + bb: + hardwareConcurrency: 31 + gke: + spotEnabled: true + resources: + requests: + memory: "116Gi" + cpu: "31" + +ethereum: + chainId: "11155111" + l1GasPriceMax: 1000 + l1FixedPriorityFeePerGas: 3 + +jobs: + deployL1Verifier: + enable: false From 14d36315acbbd05b9d3523d8cfb360b9d542f4ad Mon Sep 17 00:00:00 2001 From: PhilWindle Date: Fri, 23 May 2025 13:24:03 +0000 Subject: [PATCH 2/6] Fix --- spartan/aztec-network/values/alpha-testnet-provers.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/spartan/aztec-network/values/alpha-testnet-provers.yaml b/spartan/aztec-network/values/alpha-testnet-provers.yaml index ed4d736ed72a..511403f85644 100644 --- a/spartan/aztec-network/values/alpha-testnet-provers.yaml +++ b/spartan/aztec-network/values/alpha-testnet-provers.yaml @@ -52,6 +52,7 @@ fullNode: externalHost: "http://localhost:8080" proverNode: + replicas: 1 l1FixedPriorityFeePerGas: 3 l1GasLimitBufferPercentage: 15 l1GasPriceMax: 1000 From a4f20e0b8a48996c16b8edbf7454bdfbfc179a76 Mon Sep 17 00:00:00 2001 From: spypsy Date: Fri, 23 May 2025 15:58:39 +0100 Subject: [PATCH 3/6] fix: sepolia deployments on github actions (#14508) --- .github/workflows/fund-sepolia-accounts.yml | 47 +++++++++++++++------ .github/workflows/network-deploy.yml | 45 ++++++++++---------- spartan/scripts/prepare_sepolia_accounts.sh | 6 ++- 3 files changed, 62 insertions(+), 36 deletions(-) diff --git a/.github/workflows/fund-sepolia-accounts.yml b/.github/workflows/fund-sepolia-accounts.yml index 27bbd3cd19a2..26dee1b278ba 100644 --- a/.github/workflows/fund-sepolia-accounts.yml +++ b/.github/workflows/fund-sepolia-accounts.yml @@ -12,6 +12,37 @@ on: required: true type: string default: sepolia-accounts-mnemonic + ref: + description: The branch or tag to checkout + required: false + type: string + default: master + secrets: + GCP_SA_KEY: + required: true + SEPOLIA_FUNDING_PRIVATE_KEY: + required: true + GCP_SEPOLIA_URL: + required: true + GCP_SEPOLIA_API_KEY: + required: true + + workflow_dispatch: + inputs: + values_file: + description: The values file to use, e.g. 1-validators.yaml + required: true + type: string + sepolia_accounts_mnemonic_secret_name: + description: The name of the secret which holds the sepolia accounts mnemonic. Will create a new one if it doesn't exist. + required: true + type: string + default: sepolia-accounts-mnemonic + ref: + description: The branch or tag to checkout + required: false + type: string + default: master jobs: fund-sepolia-accounts: @@ -20,7 +51,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - ref: ${{ github.ref }} + ref: ${{ inputs.ref || github.ref || 'master' }} - name: Authenticate to Google Cloud uses: google-github-actions/auth@v2 @@ -30,14 +61,6 @@ jobs: - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@v2 - - name: Install cast - run: | - if ! command -v cast &>/dev/null; then - echo "Installing cast..." - curl -L https://foundry.paradigm.xyz | bash - $HOME/.foundry/bin/foundryup - fi - - name: Get mnemonic id: get-mnemonic run: | @@ -66,15 +89,15 @@ jobs: export ETHEREUM_HOST="https://json-rpc.${{ secrets.GCP_SEPOLIA_URL }}?key=${{ secrets.GCP_SEPOLIA_API_KEY }}" echo "Funding accounts..." - $REPO/spartan/scripts/fund_sepolia_accounts.sh ${{ inputs.values_file }} "$MNEMONIC_FILE" + $REPO/spartan/scripts/prepare_sepolia_accounts.sh ${{ inputs.values_file }} 30 "$MNEMONIC_FILE" mnemonic=$(cat "$MNEMONIC_FILE") rm "$MNEMONIC_FILE" echo "::add-mask::$mnemonic" echo "mnemonic=$mnemonic" >> "$GITHUB_OUTPUT" - name: Save mnemonic to GCP - if: ${{ steps.get-mnemonic.outputs.new_mnemonic == 'true' }} + if: ${{ steps.fund-accounts.outputs.new_mnemonic == 'true' }} run: | echo "Saving mnemonic to GCP" - echo "::add-mask::${{ steps.get-mnemonic.outputs.mnemonic }}" + echo "::add-mask::${{ steps.fund-accounts.outputs.mnemonic }}" gcloud secrets versions add latest --secret=${{ inputs.sepolia_accounts_mnemonic_secret_name }} --data-file="$MNEMONIC_FILE" diff --git a/.github/workflows/network-deploy.yml b/.github/workflows/network-deploy.yml index 50c39de3b45a..fc9be41bc444 100644 --- a/.github/workflows/network-deploy.yml +++ b/.github/workflows/network-deploy.yml @@ -91,13 +91,27 @@ on: type: string default: "false" sepolia_accounts_mnemonic_secret_name: - description: The name of the secret which holds the sepolia accounts mnemonic + description: The name of the secret which holds the sepolia accounts mnemonic (required for sepolia deployment) required: false type: string default: sepolia-accounts-mnemonic jobs: + fund_sepolia_accounts: + if: ${{ inputs.sepolia_deployment == 'true' }} + uses: ./.github/workflows/fund-sepolia-accounts.yml + with: + values_file: ${{ inputs.values_file }} + sepolia_accounts_mnemonic_secret_name: ${{ inputs.sepolia_accounts_mnemonic_secret_name }} + ref: ${{ inputs.ref || github.ref || 'master' }} + secrets: + GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} + SEPOLIA_FUNDING_PRIVATE_KEY: ${{ secrets.SEPOLIA_FUNDING_PRIVATE_KEY }} + GCP_SEPOLIA_URL: ${{ secrets.GCP_SEPOLIA_URL }} + GCP_SEPOLIA_API_KEY: ${{ secrets.GCP_SEPOLIA_API_KEY }} + network_deployment: + needs: fund_sepolia_accounts # This job will run on Ubuntu runs-on: ubuntu-latest concurrency: @@ -129,6 +143,13 @@ jobs: with: ref: ${{ inputs.ref || github.ref }} + - name: Check values + run: | + echo "inputs.ref: ${{ inputs.ref }}" + echo "github.ref: ${{ github.ref }}" + ls -la .github/workflows/ + ls -la .github/workflows/fund-sepolia-accounts.yml + - name: Authenticate to Google Cloud uses: google-github-actions/auth@v2 with: @@ -172,28 +193,6 @@ jobs: $REPO/spartan/scripts/generate_devnet_config.sh ${{ env.VALUES_FILE }} - - name: Fund sepolia accounts - uses: ./.github/workflows/fund-sepolia-accounts.yml - if: ${{ inputs.sepolia_deployment == 'true' }} - with: - values_file: ${{ env.VALUES_FILE }} - sepolia_accounts_mnemonic_secret_name: ${{ inputs.sepolia_accounts_mnemonic_secret_name }} - - - name: Generate sepolia accounts - id: generate-sepolia-accounts - if: ${{ inputs.sepolia_deployment == 'true' }} - run: | - REPO=$(git rev-parse --show-toplevel) - export FUNDING_PRIVATE_KEY=${{ secrets.SEPOLIA_FUNDING_PRIVATE_KEY }} - export ETHEREUM_HOST="https://json-rpc.${{ secrets.GCP_SEPOLIA_URL }}?key=${{ secrets.GCP_SEPOLIA_API_KEY }}" - echo "Preparing sepolia accounts..." - MNEMONIC_FILE=$(mktemp) - $REPO/spartan/scripts/prepare_sepolia_accounts.sh ${{ env.VALUES_FILE }} 30 "$MNEMONIC_FILE" - mnemonic=$(cat "$MNEMONIC_FILE") - rm "$MNEMONIC_FILE" - echo "::add-mask::$mnemonic" - echo "mnemonic=$mnemonic" >> "$GITHUB_OUTPUT" - - name: Setup Terraform uses: hashicorp/setup-terraform@v2 with: diff --git a/spartan/scripts/prepare_sepolia_accounts.sh b/spartan/scripts/prepare_sepolia_accounts.sh index 8f5759e6473a..42504fc4cc5b 100755 --- a/spartan/scripts/prepare_sepolia_accounts.sh +++ b/spartan/scripts/prepare_sepolia_accounts.sh @@ -57,6 +57,10 @@ if ! command -v yq &>/dev/null; then fi # Convert ETH to wei +if [[ ! "$eth_amount" =~ ^[0-9]+(\.[0-9]+)?$ ]]; then + echo "Error: Invalid ETH amount: $eth_amount" + exit 1 +fi wei_amount=$(cast to-wei "$eth_amount" ether) value_yamls="../aztec-network/values/$values_file ../aztec-network/values.yaml" @@ -91,7 +95,7 @@ max_index=$((max_index > bot_max_index ? max_index : bot_max_index)) total_accounts=$((num_validators + num_provers + num_bots)) # Check if mnemonic is provided -if [ -z "$MNEMONIC" ]; then +if [ "${MNEMONIC:-}" = "" ]; then # Create a new mnemonic echo "Creating mnemonic..." cast wallet new-mnemonic --json >"$tmp_filename" From 29656161cc1e604266485afddadb06f333bdd3a5 Mon Sep 17 00:00:00 2001 From: spypsy Date: Fri, 23 May 2025 15:04:20 +0000 Subject: [PATCH 4/6] fix final step output reference --- .github/workflows/fund-sepolia-accounts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fund-sepolia-accounts.yml b/.github/workflows/fund-sepolia-accounts.yml index 26dee1b278ba..806a6c5e237b 100644 --- a/.github/workflows/fund-sepolia-accounts.yml +++ b/.github/workflows/fund-sepolia-accounts.yml @@ -96,7 +96,7 @@ jobs: echo "mnemonic=$mnemonic" >> "$GITHUB_OUTPUT" - name: Save mnemonic to GCP - if: ${{ steps.fund-accounts.outputs.new_mnemonic == 'true' }} + if: ${{ steps.get-mnemonic.outputs.new_mnemonic == 'true' }} run: | echo "Saving mnemonic to GCP" echo "::add-mask::${{ steps.fund-accounts.outputs.mnemonic }}" From 64378520e4b9aa1ae975a181881b11d2b1b88da8 Mon Sep 17 00:00:00 2001 From: PhilWindle Date: Fri, 23 May 2025 17:19:23 +0000 Subject: [PATCH 5/6] Config change --- spartan/aztec-network/values/alpha-testnet-provers.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spartan/aztec-network/values/alpha-testnet-provers.yaml b/spartan/aztec-network/values/alpha-testnet-provers.yaml index 511403f85644..450b4c627df6 100644 --- a/spartan/aztec-network/values/alpha-testnet-provers.yaml +++ b/spartan/aztec-network/values/alpha-testnet-provers.yaml @@ -71,7 +71,7 @@ proverBroker: storageSize: "10Gi" proverAgent: - replicas: 30 + replicas: 15 bb: hardwareConcurrency: 31 gke: From 4770e560117037d4dfcc000fe95655762f71b702 Mon Sep 17 00:00:00 2001 From: spypsy Date: Tue, 27 May 2025 09:07:54 +0100 Subject: [PATCH 6/6] fix: create GCP secret name if not provided (#14509) --- .github/workflows/fund-sepolia-accounts.yml | 8 +++++++- .github/workflows/network-deploy.yml | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/fund-sepolia-accounts.yml b/.github/workflows/fund-sepolia-accounts.yml index 806a6c5e237b..a77e296913b0 100644 --- a/.github/workflows/fund-sepolia-accounts.yml +++ b/.github/workflows/fund-sepolia-accounts.yml @@ -100,4 +100,10 @@ jobs: run: | echo "Saving mnemonic to GCP" echo "::add-mask::${{ steps.fund-accounts.outputs.mnemonic }}" - gcloud secrets versions add latest --secret=${{ inputs.sepolia_accounts_mnemonic_secret_name }} --data-file="$MNEMONIC_FILE" + echo "Creating new secret ${{ inputs.sepolia_accounts_mnemonic_secret_name }}" + gcloud secrets create ${{ inputs.sepolia_accounts_mnemonic_secret_name }} + TMP_FILE=$(mktemp) + echo "${{ steps.fund-accounts.outputs.mnemonic }}" > "$TMP_FILE" + gcloud secrets versions add ${{ inputs.sepolia_accounts_mnemonic_secret_name }} --data-file="$TMP_FILE" + rm "$TMP_FILE" + echo "Saved mnemonic to GCP secret ${{ inputs.sepolia_accounts_mnemonic_secret_name }}" diff --git a/.github/workflows/network-deploy.yml b/.github/workflows/network-deploy.yml index fc9be41bc444..cd72b314115b 100644 --- a/.github/workflows/network-deploy.yml +++ b/.github/workflows/network-deploy.yml @@ -91,10 +91,9 @@ on: type: string default: "false" sepolia_accounts_mnemonic_secret_name: - description: The name of the secret which holds the sepolia accounts mnemonic (required for sepolia deployment) + description: The name of the secret which holds the sepolia accounts mnemonic (if not provided, will use '{namespace}-accounts-mnemonic'). required: false type: string - default: sepolia-accounts-mnemonic jobs: fund_sepolia_accounts: @@ -102,7 +101,7 @@ jobs: uses: ./.github/workflows/fund-sepolia-accounts.yml with: values_file: ${{ inputs.values_file }} - sepolia_accounts_mnemonic_secret_name: ${{ inputs.sepolia_accounts_mnemonic_secret_name }} + sepolia_accounts_mnemonic_secret_name: ${{ inputs.sepolia_accounts_mnemonic_secret_name || format('{0}-accounts-mnemonic', inputs.namespace) }} ref: ${{ inputs.ref || github.ref || 'master' }} secrets: GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} @@ -212,6 +211,11 @@ jobs: continue-on-error: true run: | if ${{ inputs.sepolia_deployment == 'true' }}; then + if [ -z "${{ inputs.sepolia_accounts_mnemonic_secret_name }}" ]; then + SECRET_NAME="${{ env.NAMESPACE }}-accounts-mnemonic" + else + SECRET_NAME="${{ inputs.sepolia_accounts_mnemonic_secret_name }}" + fi L1_DEPLOYMENT_MNEMONIC=$(gcloud secrets versions access latest --secret=${{ inputs.sepolia_accounts_mnemonic_secret_name }}) terraform destroy -auto-approve \ -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ @@ -243,7 +247,12 @@ jobs: working-directory: ./spartan/terraform/deploy-release run: | if ${{ inputs.sepolia_deployment == 'true' }}; then - L1_DEPLOYMENT_MNEMONIC=$(gcloud secrets versions access latest --secret=${{ inputs.sepolia_accounts_mnemonic_secret_name }}) + if [ -z "${{ inputs.sepolia_accounts_mnemonic_secret_name }}" ]; then + SECRET_NAME="${{ env.NAMESPACE }}-accounts-mnemonic" + else + SECRET_NAME="${{ inputs.sepolia_accounts_mnemonic_secret_name }}" + fi + L1_DEPLOYMENT_MNEMONIC=$(gcloud secrets versions access latest --secret=$SECRET_NAME) terraform plan \ -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ -var="VALUES_FILE=${{ env.VALUES_FILE }}" \