From 81d50617cd226b1868dec135a98fb278cc666a72 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 12:36:54 +0000 Subject: [PATCH 01/13] fix: tf vars --- .github/workflows/devnet-deploy.yml | 2 +- .github/workflows/network-deploy.yml | 10 +++++----- spartan/terraform/deploy-release/main.tf | 2 +- spartan/terraform/deploy-release/variables.tf | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index f49feb403a3..6c5264b0d35 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -36,7 +36,7 @@ jobs: uses: ./.github/workflows/network-deploy.yml with: namespace: ${{ github.event.inputs.namespace }} - values_file: release-devnet + values_file: release-devnet.yaml aztec_docker_image: ${{ github.event.inputs.aztec_docker_image }} deployment_mnemonic_secret_name: ${{ github.event.inputs.deployment_mnemonic_secret_name }} respect_tf_lock: ${{ github.event.inputs.respect_tf_lock }} diff --git a/.github/workflows/network-deploy.yml b/.github/workflows/network-deploy.yml index b497a5a6142..2d48e35c9e1 100644 --- a/.github/workflows/network-deploy.yml +++ b/.github/workflows/network-deploy.yml @@ -120,11 +120,11 @@ jobs: working-directory: ./spartan/terraform/deploy-release run: | terraform plan \ - -var="release_name=${{ env.NAMESPACE }}" \ - -var="values_file=${{ env.VALUES_FILE }}" \ - -var="gke_cluster_context=${{ env.GKE_CLUSTER_CONTEXT }}" \ - -var="aztec_docker_image=${{ env.AZTEC_DOCKER_IMAGE }}" \ - -var="l1_deployment_mnemonic=${{ steps.get-mnemonic.outputs.mnemonic }}" \ + -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ + -var="VALUES_FILE=${{ env.VALUES_FILE }}" \ + -var="GKE_CLUSTER_CONTEXT=${{ env.GKE_CLUSTER_CONTEXT }}" \ + -var="AZTEC_DOCKER_IMAGE=${{ env.AZTEC_DOCKER_IMAGE }}" \ + -var="L1_DEPLOYMENT_MNEMONIC=${{ steps.get-mnemonic.outputs.mnemonic }}" \ -out=tfplan \ -lock=${{ inputs.respect_tf_lock }} diff --git a/spartan/terraform/deploy-release/main.tf b/spartan/terraform/deploy-release/main.tf index 4f525c1388f..12cfc012b2a 100644 --- a/spartan/terraform/deploy-release/main.tf +++ b/spartan/terraform/deploy-release/main.tf @@ -48,7 +48,7 @@ resource "helm_release" "aztec-gke-cluster" { set { name = "aztec.l1DeploymentMnemonic" - value = var.l1_deployment_mnemonic + value = var.L1_DEPLOYMENT_MNEMONIC } # Setting timeout and wait conditions diff --git a/spartan/terraform/deploy-release/variables.tf b/spartan/terraform/deploy-release/variables.tf index 369218d3ede..0dff0d4509b 100644 --- a/spartan/terraform/deploy-release/variables.tf +++ b/spartan/terraform/deploy-release/variables.tf @@ -19,7 +19,7 @@ variable "AZTEC_DOCKER_IMAGE" { type = string } -variable "l1_deployment_mnemonic" { +variable "L1_DEPLOYMENT_MNEMONIC" { description = "Mnemonic to use for the L1 contract deployments" type = string sensitive = true From b30c94e0aa3e45513ab7051b205a93dc78967c0f Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 12:49:33 +0000 Subject: [PATCH 02/13] fix: remove ci-setup-action --- .github/workflows/devnet-deploy.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index 6c5264b0d35..68a3934690b 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -48,8 +48,6 @@ jobs: runs-on: ubuntu-latest needs: deploy-network steps: - - uses: ./.github/ci-setup-action - - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: From 0b28e39b47326f4dcedcd434a0512223eda53683 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 12:54:51 +0000 Subject: [PATCH 03/13] fix: correctly select pxe pods --- .github/workflows/devnet-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index 68a3934690b..57d052bb830 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -95,7 +95,7 @@ jobs: trap cleanup EXIT echo "Waiting for PXE pods to be ready..." - if ! kubectl wait --for=condition=ready pod -l app=$NAMESPACE-aztec-network-pxe --timeout=10m; then + if ! kubectl wait --for=condition=ready pod -l app=pxe --timeout=10m; then echo "Error: PXE pods did not become ready within timeout" exit 1 fi From 4a9f6bf4240cb129ebb1ef166d97ec2f1248e571 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 12:57:59 +0000 Subject: [PATCH 04/13] fix: specify namespaces --- .github/workflows/devnet-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index 57d052bb830..f71110e06e6 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -95,7 +95,7 @@ jobs: trap cleanup EXIT echo "Waiting for PXE pods to be ready..." - if ! kubectl wait --for=condition=ready pod -l app=pxe --timeout=10m; then + if ! kubectl wait -n $NAMESPACE --for=condition=ready pod -l app=pxe --timeout=10m; then echo "Error: PXE pods did not become ready within timeout" exit 1 fi From 701467c7e61dfb6c16834f0a62f1eda31c71a589 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 13:02:34 +0000 Subject: [PATCH 05/13] fix: jq --- .github/workflows/devnet-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index f71110e06e6..a48205889f6 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -103,7 +103,7 @@ jobs: helm get values $NAMESPACE -n $NAMESPACE -o json --all > helm_values.json PXE_PORT="$(jq -r .pxe.service.nodePort helm_values.json)" - ETHEREUM_PORT="$(jq -r ethereum.service.port helm_values.json)" + ETHEREUM_PORT="$(jq -r .ethereum.service.port helm_values.json)" L1_CHAIN_ID="$(jq -r .ethereum.chainId helm_values.json)" MNEMONIC="$(jq -r .aztec.l1DeploymentMnemonic helm_values.json)" From b5cc1212cf650f874061e2614213fa5ce6e274a8 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 13:09:14 +0000 Subject: [PATCH 06/13] fix: port-forward --- .github/workflows/devnet-deploy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index a48205889f6..2a135346d75 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -113,7 +113,10 @@ jobs: kubectl port-forward -n $NAMESPACE svc/$NAMESPACE-aztec-network-pxe $PXE_PORT & pxe_port_forward_pid=$! - kubectl port-forward -n $NAMESPACE svc/$NAMESPACE-aztec-network-ethereum $ETHEREUM_PORT & + + # port-forward directly to the pod because the Eth node does not have a service definition + ETH_POD_NAME=$(kubectl get pods -n $NAMESPACE -l app=ethereum -o jsonpath='{.items[0].metadata.name}') + kubectl port-forward -n $NAMESPACE pod/$ETH_POD_NAME $ETHEREUM_PORT & ethereum_port_forward_pid=$! # wait for port-forwards to establish From 9e5ab3c7afd0200a32344307ff3565f063cfb202 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 13:12:09 +0000 Subject: [PATCH 07/13] fix: chain id --- .github/workflows/devnet-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index 2a135346d75..9c7918b9d2c 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -126,7 +126,7 @@ jobs: --network host \ --rpc-url http://127.0.0.1:$PXE_PORT \ --l1-rpc-url http://127.0.0.1:$ETHEREUM_PORT \ - --l1-chain-id $CHAIN_ID \ + --l1-chain-id $L1_CHAIN_ID \ --mnemonic $MNEMONIC \ --json | tee ./basic_contracts.json From b7d696c019c1ce99fb0e3fd7c07bcb26dc4b8345 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 13:15:46 +0000 Subject: [PATCH 08/13] fix: docker --- .github/workflows/devnet-deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index 9c7918b9d2c..53fe11862be 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -122,8 +122,7 @@ jobs: # wait for port-forwards to establish sleep 5 - docker run --rm $AZTEC_DOCKER_IMAGE bootstrap-network \ - --network host \ + docker run --rm --network host $AZTEC_DOCKER_IMAGE bootstrap-network \ --rpc-url http://127.0.0.1:$PXE_PORT \ --l1-rpc-url http://127.0.0.1:$ETHEREUM_PORT \ --l1-chain-id $L1_CHAIN_ID \ From 6763e05b81a53ccb6942bb82d5983320e1c8085b Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 13:23:16 +0000 Subject: [PATCH 09/13] fix: quotes --- .github/workflows/devnet-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index 53fe11862be..4c4e5a7384f 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -125,8 +125,8 @@ jobs: docker run --rm --network host $AZTEC_DOCKER_IMAGE bootstrap-network \ --rpc-url http://127.0.0.1:$PXE_PORT \ --l1-rpc-url http://127.0.0.1:$ETHEREUM_PORT \ - --l1-chain-id $L1_CHAIN_ID \ - --mnemonic $MNEMONIC \ + --l1-chain-id "$L1_CHAIN_ID" \ + --mnemonic "$MNEMONIC" \ --json | tee ./basic_contracts.json aws s3 cp ./basic_contracts.json ${{ env.CONTRACT_S3_BUCKET }}/devnet/basic_contracts.json From b39740560f592eab2c4bdcd84a160d1335ad12c8 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 14:50:15 +0000 Subject: [PATCH 10/13] fix: add hook --- spartan/aztec-network/templates/deploy-l1-verifier.yaml | 5 +++++ spartan/aztec-network/templates/setup-l2-contracts.yaml | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/spartan/aztec-network/templates/deploy-l1-verifier.yaml b/spartan/aztec-network/templates/deploy-l1-verifier.yaml index c3edb5d42ff..b69dcd58f65 100644 --- a/spartan/aztec-network/templates/deploy-l1-verifier.yaml +++ b/spartan/aztec-network/templates/deploy-l1-verifier.yaml @@ -5,6 +5,11 @@ metadata: name: {{ include "aztec-network.fullname" . }}-deploy-l1-verifier labels: {{- include "aztec-network.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": post-install + "helm.sh/hook-weight": "0" + "helm.sh/hook-delete-policy": before-hook-creation + spec: template: metadata: diff --git a/spartan/aztec-network/templates/setup-l2-contracts.yaml b/spartan/aztec-network/templates/setup-l2-contracts.yaml index 8afc65abb66..c3167e89109 100644 --- a/spartan/aztec-network/templates/setup-l2-contracts.yaml +++ b/spartan/aztec-network/templates/setup-l2-contracts.yaml @@ -5,6 +5,10 @@ metadata: name: {{ include "aztec-network.fullname" . }}-setup-l2-contracts labels: {{- include "aztec-network.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": post-install + "helm.sh/hook-weight": "0" + "helm.sh/hook-delete-policy": before-hook-creation spec: template: metadata: From f5e755315291699f553cf45e70eac9b442c8f64b Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 15:00:35 +0000 Subject: [PATCH 11/13] fix: add ctor params --- yarn-project/cli/src/cmds/devnet/bootstrap_network.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts b/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts index 12073936e11..12b283cbdfd 100644 --- a/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts +++ b/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts @@ -130,6 +130,7 @@ async function deployERC20({ walletClient, publicClient }: L1Clients) { publicClient, erc20.contractAbi, erc20.contractBytecode, + ['DevCoin', 'DEV', walletClient.account.address], ); const { address: portalAddress } = await deployL1Contract( walletClient, From a7c679a1605d4c11d9bdc33e1f8e5bad8e98d1ed Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 15:14:12 +0000 Subject: [PATCH 12/13] fix: upgrade --- spartan/terraform/deploy-release/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/spartan/terraform/deploy-release/main.tf b/spartan/terraform/deploy-release/main.tf index 12cfc012b2a..46eac8fc049 100644 --- a/spartan/terraform/deploy-release/main.tf +++ b/spartan/terraform/deploy-release/main.tf @@ -37,6 +37,7 @@ resource "helm_release" "aztec-gke-cluster" { chart = "aztec-network" namespace = var.RELEASE_NAME create_namespace = true + upgrade_install = true # base values file values = [file("../../aztec-network/values/${var.VALUES_FILE}")] From 3efe99278d3f5fdc0cf7ece2a5b5ee3b0a9b6005 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 6 Dec 2024 15:21:55 +0000 Subject: [PATCH 13/13] fix: bump helm --- spartan/terraform/deploy-release/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spartan/terraform/deploy-release/main.tf b/spartan/terraform/deploy-release/main.tf index 46eac8fc049..73eba9e5b37 100644 --- a/spartan/terraform/deploy-release/main.tf +++ b/spartan/terraform/deploy-release/main.tf @@ -6,7 +6,7 @@ terraform { required_providers { helm = { source = "hashicorp/helm" - version = "~> 2.12.1" + version = "~> 2.16.1" } kubernetes = { source = "hashicorp/kubernetes"