From bff1bebd0ccbd462a3ec2aecb90c7ef622c79d21 Mon Sep 17 00:00:00 2001 From: spypsy <6403450+spypsy@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:35:46 +0000 Subject: [PATCH] fix: testnet archival node - v2 backport #17139 --- .github/workflows/deploy-staging-networks.yml | 2 + spartan/scripts/deploy_network.sh | 3 ++ spartan/terraform/deploy-aztec-infra/main.tf | 18 ++++++++ .../values/archive-resources-dev.yaml | 29 ++++++++++++ .../values/archive-resources-prod.yaml | 45 +++++++++++++++++++ .../deploy-aztec-infra/values/archive.yaml | 6 +++ .../terraform/deploy-aztec-infra/variables.tf | 6 +++ .../values/testnet-archive-node.yaml | 2 +- 8 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 spartan/terraform/deploy-aztec-infra/values/archive-resources-dev.yaml create mode 100644 spartan/terraform/deploy-aztec-infra/values/archive-resources-prod.yaml create mode 100644 spartan/terraform/deploy-aztec-infra/values/archive.yaml diff --git a/.github/workflows/deploy-staging-networks.yml b/.github/workflows/deploy-staging-networks.yml index 84004a27985f..d7b1f762de37 100644 --- a/.github/workflows/deploy-staging-networks.yml +++ b/.github/workflows/deploy-staging-networks.yml @@ -248,6 +248,8 @@ jobs: RPC_INGRESS_STATIC_IP_NAME=testnet-rpc-ip RPC_INGRESS_SSL_CERT_NAME=testnet-rpc-cert + DEPLOY_ARCHIVAL_NODE=true + EOF echo "NAMESPACE=$NAMESPACE" >> $GITHUB_ENV diff --git a/spartan/scripts/deploy_network.sh b/spartan/scripts/deploy_network.sh index 978d04804ede..7271998694b5 100755 --- a/spartan/scripts/deploy_network.sh +++ b/spartan/scripts/deploy_network.sh @@ -67,6 +67,7 @@ PROVER_FAILED_PROOF_STORE=${PROVER_FAILED_PROOF_STORE:-} OTEL_COLLECTOR_ENDPOINT=${OTEL_COLLECTOR_ENDPOINT:-} DEPLOY_INTERNAL_BOOTNODE=${DEPLOY_INTERNAL_BOOTNODE:-} +DEPLOY_ARCHIVAL_NODE=${DEPLOY_ARCHIVAL_NODE:-false} BOT_RESOURCE_PROFILE=${BOT_RESOURCE_PROFILE:-${RESOURCE_PROFILE}} BOT_TRANSFERS_MNEMONIC_START_INDEX=${BOT_TRANSFERS_MNEMONIC_START_INDEX:-5001} @@ -313,6 +314,8 @@ RPC_INGRESS_ENABLED = ${RPC_INGRESS_ENABLED} RPC_INGRESS_HOST = "${RPC_INGRESS_HOST}" RPC_INGRESS_STATIC_IP_NAME = "${RPC_INGRESS_STATIC_IP_NAME}" RPC_INGRESS_SSL_CERT_NAME = "${RPC_INGRESS_SSL_CERT_NAME}" + +DEPLOY_ARCHIVAL_NODE = ${DEPLOY_ARCHIVAL_NODE} EOF tf_run "${DEPLOY_AZTEC_INFRA_DIR}" "${DESTROY_AZTEC_INFRA}" "${CREATE_AZTEC_INFRA}" diff --git a/spartan/terraform/deploy-aztec-infra/main.tf b/spartan/terraform/deploy-aztec-infra/main.tf index b84ca55a61fd..11168917b00d 100644 --- a/spartan/terraform/deploy-aztec-infra/main.tf +++ b/spartan/terraform/deploy-aztec-infra/main.tf @@ -197,6 +197,24 @@ locals { wait = true } + archive = var.DEPLOY_ARCHIVAL_NODE ? { + name = "${var.RELEASE_PREFIX}-archive" + chart = "aztec-node" + values = [ + "common.yaml", + "archive.yaml", + "archive-resources-dev.yaml" + ] + custom_settings = { + "nodeType" = "archive" + "node.env.NETWORK" = var.NETWORK + "node.env.P2P_ARCHIVED_TX_LIMIT" = "10000000" + } + boot_node_host_path = "node.env.BOOT_NODE_HOST" + bootstrap_nodes_path = "node.env.BOOTSTRAP_NODES" + wait = true + } : null + # Optional: transfer bots bot_transfers = var.BOT_TRANSFERS_REPLICAS > 0 ? { name = "${var.RELEASE_PREFIX}-bot-transfers" diff --git a/spartan/terraform/deploy-aztec-infra/values/archive-resources-dev.yaml b/spartan/terraform/deploy-aztec-infra/values/archive-resources-dev.yaml new file mode 100644 index 000000000000..c617caee20e3 --- /dev/null +++ b/spartan/terraform/deploy-aztec-infra/values/archive-resources-dev.yaml @@ -0,0 +1,29 @@ +replicaCount: 1 + +hostNetwork: true + +node: + resources: + requests: + cpu: "3" + memory: "12Gi" + +persistence: + enabled: true + +statefulSet: + enabled: true + volumeClaimTemplates: + - metadata: + name: data + annotations: + "helm.sh/resource-policy": "Retain" + spec: + accessModes: [ReadWriteOnce] + resources: + requests: + storage: "1Ti" + +service: + headless: + enabled: true diff --git a/spartan/terraform/deploy-aztec-infra/values/archive-resources-prod.yaml b/spartan/terraform/deploy-aztec-infra/values/archive-resources-prod.yaml new file mode 100644 index 000000000000..1b0dcf8c7627 --- /dev/null +++ b/spartan/terraform/deploy-aztec-infra/values/archive-resources-prod.yaml @@ -0,0 +1,45 @@ +nodeSelector: + local-ssd: "false" + node-type: "network" + cores: "2" + +affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - node + topologyKey: "kubernetes.io/hostname" + namespaceSelector: {} + +replicaCount: 1 +hostNetwork: true + +node: + resources: + requests: + cpu: "1.5" + memory: "5Gi" + +persistence: + enabled: true + +statefulSet: + enabled: true + volumeClaimTemplates: + - metadata: + name: data + annotations: + "helm.sh/resource-policy": "Retain" + spec: + accessModes: [ReadWriteOnce] + resources: + requests: + storage: "1Ti" + +service: + headless: + enabled: true diff --git a/spartan/terraform/deploy-aztec-infra/values/archive.yaml b/spartan/terraform/deploy-aztec-infra/values/archive.yaml new file mode 100644 index 000000000000..a9b81846528d --- /dev/null +++ b/spartan/terraform/deploy-aztec-infra/values/archive.yaml @@ -0,0 +1,6 @@ +node: + env: + OTEL_SERVICE_NAME: "archival-node" + startCmd: + - --node + - --archiver diff --git a/spartan/terraform/deploy-aztec-infra/variables.tf b/spartan/terraform/deploy-aztec-infra/variables.tf index 99e2b6ca8e73..18f7fcad7cf7 100644 --- a/spartan/terraform/deploy-aztec-infra/variables.tf +++ b/spartan/terraform/deploy-aztec-infra/variables.tf @@ -289,6 +289,12 @@ variable "EXTERNAL_BOOTNODES" { default = [] } +variable "DEPLOY_ARCHIVAL_NODE" { + description = "Whether to deploy the archival node" + type = bool + default = false +} + variable "NETWORK" { description = "One of the existing network names to use default config for" type = string diff --git a/spartan/terraform/deploy-testnet/values/testnet-archive-node.yaml b/spartan/terraform/deploy-testnet/values/testnet-archive-node.yaml index 77dfff951611..9d5c8a292b77 100644 --- a/spartan/terraform/deploy-testnet/values/testnet-archive-node.yaml +++ b/spartan/terraform/deploy-testnet/values/testnet-archive-node.yaml @@ -28,7 +28,7 @@ affinity: node: env: - P2P_ARCHIVED_TX_LIMIT: 10000000 # 10 million + P2P_ARCHIVED_TX_LIMIT: "10000000" # 10 million resources: requests: cpu: "3"