Skip to content

Commit fab82cd

Browse files
authored
Merge branch 'next' into merge-train/barretenberg
2 parents 1163a37 + 2ceea66 commit fab82cd

1,999 files changed

Lines changed: 18149 additions & 33983 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-rpc.yml

Lines changed: 41 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ on:
44
workflow_call:
55
inputs:
66
rpc_environment:
7-
description: "RPC environment to deploy: testnet or mainnet."
7+
description: "RPC environment to deploy. Must match a directory under spartan/terraform/deploy-rpc/environments."
88
required: true
99
type: string
1010
v4_aztec_docker_image:
1111
description: "Full Aztec Docker image for the v4 RPC, for example aztecprotocol/aztec:4.3.1."
1212
required: true
1313
type: string
1414
canonical_aztec_docker_image:
15-
description: "Full Aztec Docker image for canonical RPC. Accepted now, used when the canonical RPC block is enabled."
16-
required: true
15+
description: "Full Aztec Docker image for canonical RPC."
16+
required: false
1717
type: string
1818
default: ""
1919
ref:
@@ -25,31 +25,6 @@ on:
2525
required: false
2626
type: string
2727
default: "testnet-440309"
28-
gcp_region:
29-
description: "GCP region passed to Terraform."
30-
required: false
31-
type: string
32-
default: "us-west1"
33-
cluster:
34-
description: "GKE cluster name."
35-
required: false
36-
type: string
37-
default: "aztec-gke-public"
38-
cluster_location:
39-
description: "GKE cluster location used by gcloud."
40-
required: false
41-
type: string
42-
default: "us-west1-a"
43-
k8s_cluster_context:
44-
description: "Kubernetes context override. Defaults to gke_<project>_<location>_<cluster>."
45-
required: false
46-
type: string
47-
default: ""
48-
respect_tf_lock:
49-
description: "Whether Terraform should respect state locking."
50-
required: false
51-
type: boolean
52-
default: true
5328
secrets:
5429
GCP_SA_KEY:
5530
description: "GCP service account key for Terraform, GCS state, and GKE access."
@@ -68,8 +43,8 @@ on:
6843
required: true
6944
type: string
7045
canonical_aztec_docker_image:
71-
description: "Full Aztec Docker image for canonical RPC. Accepted now, used when the canonical RPC block is enabled."
72-
required: true
46+
description: "Full Aztec Docker image for canonical RPC."
47+
required: false
7348
type: string
7449
ref:
7550
description: "Git ref to checkout. Leave empty to use the current ref."
@@ -80,30 +55,6 @@ on:
8055
required: false
8156
type: string
8257
default: "testnet-440309"
83-
gcp_region:
84-
description: "GCP region passed to Terraform."
85-
required: false
86-
type: string
87-
default: "us-west1"
88-
cluster:
89-
description: "GKE cluster name."
90-
required: false
91-
type: string
92-
default: "aztec-gke-public"
93-
cluster_location:
94-
description: "GKE cluster location used by gcloud."
95-
required: false
96-
type: string
97-
default: "us-west1-a"
98-
k8s_cluster_context:
99-
description: "Kubernetes context override. Defaults to gke_<project>_<location>_<cluster>."
100-
required: false
101-
type: string
102-
respect_tf_lock:
103-
description: "Whether Terraform should respect state locking."
104-
required: false
105-
type: boolean
106-
default: true
10758

10859
permissions:
10960
contents: read
@@ -117,25 +68,13 @@ jobs:
11768
runs-on: ubuntu-latest
11869
env:
11970
GCP_PROJECT_ID: ${{ inputs.gcp_project_id }}
120-
GCP_REGION: ${{ inputs.gcp_region }}
121-
CLUSTER_NAME: ${{ inputs.cluster }}
122-
CLUSTER_LOCATION: ${{ inputs.cluster_location }}
71+
GKE_CLUSTER_NAME: aztec-gke-public
72+
GKE_CLUSTER_LOCATION: us-west1-a
12373
steps:
124-
- name: Determine checkout ref
125-
id: checkout-ref
126-
env:
127-
REQUESTED_REF: ${{ inputs.ref }}
128-
run: |
129-
if [[ -n "$REQUESTED_REF" ]]; then
130-
echo "ref=$REQUESTED_REF" >> "$GITHUB_OUTPUT"
131-
else
132-
echo "ref=${{ github.ref }}" >> "$GITHUB_OUTPUT"
133-
fi
134-
13574
- name: Checkout
13675
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
13776
with:
138-
ref: ${{ steps.checkout-ref.outputs.ref }}
77+
ref: ${{ inputs.ref || github.ref }}
13978
fetch-depth: 0
14079
persist-credentials: false
14180

@@ -144,48 +83,39 @@ jobs:
14483
RPC_ENVIRONMENT: ${{ inputs.rpc_environment }}
14584
V4_AZTEC_DOCKER_IMAGE: ${{ inputs.v4_aztec_docker_image }}
14685
CANONICAL_AZTEC_DOCKER_IMAGE: ${{ inputs.canonical_aztec_docker_image }}
147-
K8S_CLUSTER_CONTEXT: ${{ inputs.k8s_cluster_context }}
14886
run: |
149-
if [[ "$RPC_ENVIRONMENT" != "testnet" && "$RPC_ENVIRONMENT" != "mainnet" ]]; then
150-
echo "Error: rpc_environment must be testnet or mainnet, got '$RPC_ENVIRONMENT'"
151-
exit 1
152-
fi
153-
154-
if [[ ! "$V4_AZTEC_DOCKER_IMAGE" =~ ^.+:.+$ ]]; then
155-
echo "Error: v4_aztec_docker_image must be in repository:tag form"
87+
terraform_base_dir="spartan/terraform/deploy-rpc/environments"
88+
mapfile -t available_environments < <(find "$terraform_base_dir" -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | sort)
89+
available_envs="$(printf '%s, ' "${available_environments[@]}")"
90+
available_envs="${available_envs%, }"
91+
92+
valid_environment=false
93+
for available_environment in "${available_environments[@]}"; do
94+
if [[ "$RPC_ENVIRONMENT" == "$available_environment" ]]; then
95+
valid_environment=true
96+
break
97+
fi
98+
done
99+
100+
if [[ "$valid_environment" != "true" ]]; then
101+
echo "Error: rpc_environment must match one of: $available_envs, got '$RPC_ENVIRONMENT'"
156102
exit 1
157103
fi
158104
159-
if [[ -n "$CANONICAL_AZTEC_DOCKER_IMAGE" && ! "$CANONICAL_AZTEC_DOCKER_IMAGE" =~ ^.+:.+$ ]]; then
160-
echo "Error: canonical_aztec_docker_image must be empty or in repository:tag form"
161-
exit 1
162-
fi
163-
164-
resolved_context="$K8S_CLUSTER_CONTEXT"
165-
if [[ -z "$resolved_context" ]]; then
166-
resolved_context="gke_${GCP_PROJECT_ID}_${CLUSTER_LOCATION}_${CLUSTER_NAME}"
167-
fi
168-
169-
namespace="${RPC_ENVIRONMENT}-rpc"
170-
terraform_dir="spartan/terraform/deploy-rpc/environments/${RPC_ENVIRONMENT}"
171-
state_path="${CLUSTER_NAME}/${namespace}/deploy-rpc"
105+
resolved_context="gke_${GCP_PROJECT_ID}_${GKE_CLUSTER_LOCATION}_${GKE_CLUSTER_NAME}"
172106
173-
if [[ ! -d "$terraform_dir" ]]; then
174-
echo "Error: Terraform environment not found: $terraform_dir"
175-
exit 1
176-
fi
107+
terraform_dir="${terraform_base_dir}/${RPC_ENVIRONMENT}"
177108
178109
{
179110
echo "RPC_ENVIRONMENT=$RPC_ENVIRONMENT"
180-
echo "NAMESPACE=$namespace"
181111
echo "TERRAFORM_DIR=$terraform_dir"
182-
echo "STATE_PATH=$state_path"
183112
echo "K8S_CLUSTER_CONTEXT=$resolved_context"
184113
echo "TF_VAR_GCP_PROJECT_ID=$GCP_PROJECT_ID"
185-
echo "TF_VAR_GCP_REGION=$GCP_REGION"
186114
echo "TF_VAR_K8S_CLUSTER_CONTEXT=$resolved_context"
187115
echo "TF_VAR_V4_AZTEC_DOCKER_IMAGE=$V4_AZTEC_DOCKER_IMAGE"
188-
echo "TF_VAR_CANONICAL_AZTEC_DOCKER_IMAGE=$CANONICAL_AZTEC_DOCKER_IMAGE"
116+
if [[ -n "$CANONICAL_AZTEC_DOCKER_IMAGE" ]]; then
117+
echo "TF_VAR_CANONICAL_AZTEC_DOCKER_IMAGE=$CANONICAL_AZTEC_DOCKER_IMAGE"
118+
fi
189119
} >> "$GITHUB_ENV"
190120
191121
- name: Authenticate to Google Cloud
@@ -200,8 +130,8 @@ jobs:
200130

201131
- name: Configure kubectl
202132
run: |
203-
gcloud container clusters get-credentials "$CLUSTER_NAME" \
204-
--region "$CLUSTER_LOCATION" \
133+
gcloud container clusters get-credentials "$GKE_CLUSTER_NAME" \
134+
--location "$GKE_CLUSTER_LOCATION" \
205135
--project "$GCP_PROJECT_ID"
206136
kubectl config use-context "$K8S_CLUSTER_CONTEXT"
207137
@@ -211,17 +141,19 @@ jobs:
211141
terraform_version: "1.7.5"
212142
terraform_wrapper: false
213143

214-
- name: Configure Terraform backend
215-
run: spartan/scripts/override_terraform_backend.sh "$TERRAFORM_DIR" "$CLUSTER_NAME" "$STATE_PATH"
216-
217144
- name: Terraform Init
218-
run: terraform -chdir="$TERRAFORM_DIR" init -reconfigure
145+
run: terraform -chdir="$TERRAFORM_DIR" init -reconfigure -input=false
219146

220147
- name: Terraform Plan
221-
run: terraform -chdir="$TERRAFORM_DIR" plan -out=tfplan -lock=${{ inputs.respect_tf_lock }}
148+
run: terraform -chdir="$TERRAFORM_DIR" plan -input=false -out=tfplan
222149

223150
- name: Terraform Apply
224-
run: terraform -chdir="$TERRAFORM_DIR" apply -auto-approve -lock=${{ inputs.respect_tf_lock }} tfplan
151+
run: terraform -chdir="$TERRAFORM_DIR" apply -input=false -auto-approve tfplan
152+
153+
- name: Capture Terraform outputs
154+
run: |
155+
namespace="$(terraform -chdir="$TERRAFORM_DIR" output -raw namespace)"
156+
echo "RPC_NAMESPACE=$namespace" >> "$GITHUB_ENV"
225157
226158
- name: Write summary
227159
if: always()
@@ -232,7 +164,8 @@ jobs:
232164
echo "| Field | Value |"
233165
echo "|---|---|"
234166
echo "| Environment | \`${RPC_ENVIRONMENT:-${{ inputs.rpc_environment }}}\` |"
235-
echo "| Namespace | \`${NAMESPACE:-unknown}\` |"
167+
echo "| Namespace | \`${RPC_NAMESPACE:-unknown}\` |"
236168
echo "| v4 image | \`${TF_VAR_V4_AZTEC_DOCKER_IMAGE:-unknown}\` |"
237-
echo "| Terraform state | \`${STATE_PATH:-unknown}\` |"
169+
echo "| canonical image | \`${TF_VAR_CANONICAL_AZTEC_DOCKER_IMAGE:-not set}\` |"
170+
echo "| Terraform directory | \`${TERRAFORM_DIR:-unknown}\` |"
238171
} >> "$GITHUB_STEP_SUMMARY"

.test_patterns.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,14 @@ tests:
389389
owners:
390390
- *palla
391391

392+
# http://ci.aztec-labs.com/e5938ff415312e06
393+
# ChainMonitor teardown race: its poll loop calls the L1 Inbox getState() after
394+
# Jest has torn down the module env (ERR_VM_MODULE_NOT_MODULE). Test itself passes.
395+
- regex: "src/e2e_sequencer/gov_proposal.parallel.test.ts"
396+
error_regex: "a file after the Jest environment has been torn down"
397+
owners:
398+
- *palla
399+
392400
# http://ci.aztec-labs.com/153f5dcbb0f3799c
393401
- regex: "src/e2e_offchain_payment.test.ts"
394402
error_regex: "✕ reprocesses an offchain-delivered payment after an L1 reorg"

Makefile

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ endef
4747
# PHONY TARGETS - List every target that has a file/dir of the same name.
4848
#==============================================================================
4949

50-
.PHONY: noir barretenberg noir-projects l1-contracts release-image boxes playground docs aztec-up spartan wsdb
50+
.PHONY: noir barretenberg noir-projects l1-contracts release-image boxes playground docs aztec-up spartan wsdb bb-avm-sim
5151

5252
#==============================================================================
5353
# BOOTSTRAP TARGETS
@@ -69,7 +69,7 @@ full: fast bb-full-tests bb-cpp-full yarn-project-benches
6969
bench: yarn-project-benches bb-sol bb-acir
7070

7171
# Release. Everything plus copy bb cross compiles to ts projects.
72-
release: fast bb-cpp-release-dir bb-ts-cross-copy ipc-runtime-cross
72+
release: fast bb-cpp-release-dir bb-ts-cross-copy bb-avm-sim-cross-copy ipc-runtime-cross
7373

7474
#==============================================================================
7575
# Noir
@@ -104,7 +104,7 @@ avm-transpiler-cross: avm-transpiler-cross-amd64-macos avm-transpiler-cross-arm6
104104
#==============================================================================
105105

106106
# Barretenberg - Aggregate target for all barretenberg sub-projects.
107-
barretenberg: bb-cpp bb-ts bb-rs bb-acir bb-docs bb-sol bb-bbup bb-crs
107+
barretenberg: bb-cpp bb-ts bb-avm-sim bb-rs bb-acir bb-docs bb-sol bb-bbup bb-crs
108108

109109
# BB C++ - Main aggregate target.
110110
bb-cpp: bb-cpp-native bb-cpp-wasm bb-cpp-wasm-threads
@@ -156,19 +156,19 @@ bb-cpp-cross-arm64-macos-objects: bb-cpp-yarn
156156
$(call build,$@,barretenberg/cpp,build_cross_objects arm64-macos)
157157

158158
# Cross-compile for ARM64 Linux (release only)
159-
bb-cpp-cross-arm64-linux: bb-cpp-cross-arm64-linux-objects avm-transpiler-cross-arm64-linux bb-cpp-yarn
159+
bb-cpp-cross-arm64-linux: bb-cpp-native bb-cpp-cross-arm64-linux-objects avm-transpiler-cross-arm64-linux bb-cpp-yarn
160160
$(call build,$@,barretenberg/cpp,build_preset arm64-linux)
161161

162162
# Cross-compile for AMD64 macOS (release only)
163-
bb-cpp-cross-amd64-macos: bb-cpp-cross-amd64-macos-objects avm-transpiler-cross-amd64-macos bb-cpp-yarn
163+
bb-cpp-cross-amd64-macos: bb-cpp-cross-arm64-linux bb-cpp-cross-amd64-macos-objects avm-transpiler-cross-amd64-macos bb-cpp-yarn
164164
$(call build,$@,barretenberg/cpp,build_preset amd64-macos)
165165

166166
# Cross-compile for ARM64 macOS (release or CI_FULL)
167-
bb-cpp-cross-arm64-macos: bb-cpp-cross-arm64-macos-objects avm-transpiler-cross-arm64-macos bb-cpp-yarn
167+
bb-cpp-cross-arm64-macos: bb-cpp-cross-amd64-macos bb-cpp-cross-arm64-macos-objects avm-transpiler-cross-arm64-macos bb-cpp-yarn
168168
$(call build,$@,barretenberg/cpp,build_preset arm64-macos)
169169

170170
# Cross-compile for AMD64 Windows (release only)
171-
bb-cpp-cross-amd64-windows: avm-transpiler-cross-amd64-windows
171+
bb-cpp-cross-amd64-windows: bb-cpp-cross-arm64-macos avm-transpiler-cross-amd64-windows
172172
$(call build,$@,barretenberg/cpp,build_preset amd64-windows)
173173

174174
# iOS SDK download (shared by all iOS cross-compile targets)
@@ -180,19 +180,19 @@ bb-cpp-android-sysroot:
180180
$(call run_command,$@,$(ROOT)/barretenberg/cpp,bash scripts/download-android-sysroot.sh)
181181

182182
# Cross-compile for ARM64 iOS (release only, static lib only)
183-
bb-cpp-cross-arm64-ios: bb-cpp-ios-sdk
183+
bb-cpp-cross-arm64-ios: bb-cpp-cross-amd64-windows bb-cpp-ios-sdk
184184
$(call build,$@,barretenberg/cpp,build_preset arm64-ios)
185185

186186
# Cross-compile for ARM64 iOS Simulator (release only, static lib only)
187-
bb-cpp-cross-arm64-ios-sim: bb-cpp-ios-sdk
187+
bb-cpp-cross-arm64-ios-sim: bb-cpp-cross-arm64-ios bb-cpp-ios-sdk
188188
$(call build,$@,barretenberg/cpp,build_preset arm64-ios-sim)
189189

190190
# Cross-compile for ARM64 Android (release only, static lib only)
191-
bb-cpp-cross-arm64-android: bb-cpp-android-sysroot
191+
bb-cpp-cross-arm64-android: bb-cpp-cross-arm64-ios-sim bb-cpp-android-sysroot
192192
$(call build,$@,barretenberg/cpp,build_preset arm64-android)
193193

194194
# Cross-compile for x86_64 Android (release only, static lib only)
195-
bb-cpp-cross-x86_64-android: bb-cpp-android-sysroot
195+
bb-cpp-cross-x86_64-android: bb-cpp-cross-arm64-android bb-cpp-android-sysroot
196196
$(call build,$@,barretenberg/cpp,build_preset x86_64-android)
197197

198198
bb-cpp-cross: bb-cpp-cross-arm64-linux bb-cpp-cross-amd64-macos bb-cpp-cross-arm64-macos bb-cpp-cross-amd64-windows bb-cpp-cross-arm64-ios bb-cpp-cross-arm64-ios-sim bb-cpp-cross-arm64-android bb-cpp-cross-x86_64-android
@@ -225,11 +225,17 @@ bb-cpp-full: bb-cpp bb-cpp-gcc bb-cpp-fuzzing bb-cpp-windows bb-cpp-asan bb-cpp-
225225

226226
# BB TypeScript - TypeScript bindings
227227
bb-ts: bb-cpp-wasm bb-cpp-wasm-threads bb-cpp-native ipc-runtime
228-
$(call build,$@,barretenberg/ts)
228+
$(call build,$@,barretenberg/ts,build_bb_js)
229229

230230
# Copies the cross-compiles into bb.js.
231231
bb-ts-cross-copy: bb-ts bb-cpp-cross
232-
$(call build,$@,barretenberg/ts,cross_copy)
232+
$(call build,$@,barretenberg/ts,cross_copy_bb_js)
233+
234+
bb-avm-sim: ipc-codegen ipc-runtime bb-cpp-native
235+
$(call build,$@,barretenberg/ts,build_bb_avm_sim)
236+
237+
bb-avm-sim-cross-copy: bb-avm-sim bb-cpp-cross
238+
$(call build,$@,barretenberg/ts,cross_copy_bb_avm_sim)
233239

234240
# BB Rust - barretenberg-rs FFI crate
235241
bb-rs: bb-ts bb-cpp-native
@@ -396,8 +402,17 @@ l1-contracts-src: l1-contracts-solc
396402
l1-contracts-verifier: noir-protocol-circuits l1-contracts-src
397403
$(call build,$@,l1-contracts,build_verifier)
398404

405+
# l1-contracts-artifacts: Generate the @aztec/l1-artifacts TS package (ABIs/bytecode/storage) and the
406+
# self-contained foundry bundle used by the runtime forge deploy path. Must depend on the verifier, not
407+
# just build_src: the generated artifact list includes HonkVerifier, and its real implementation is only
408+
# produced by build_verifier (which compiles generated/HonkVerifier.sol, copied from noir-projects).
409+
# build_src only compiles the src/ coverage mock of the same name, which collides on the same out/ path
410+
# and would be published instead if the verifier had not run last.
411+
l1-contracts-artifacts: l1-contracts-verifier
412+
$(call build,$@,l1-contracts,build_artifacts)
413+
399414
# l1-contracts: Complete build (aggregate target)
400-
l1-contracts: l1-contracts-src l1-contracts-verifier
415+
l1-contracts: l1-contracts-src l1-contracts-verifier l1-contracts-artifacts
401416

402417
l1-contracts-tests: l1-contracts-verifier
403418
$(call test,$@,l1-contracts)
@@ -406,7 +421,7 @@ l1-contracts-tests: l1-contracts-verifier
406421
# Yarn Project - TypeScript monorepo with all TS packages
407422
#==============================================================================
408423

409-
yarn-project: bb-ts noir-projects l1-contracts wsdb
424+
yarn-project: bb-ts noir-projects l1-contracts wsdb bb-avm-sim
410425
$(call build,$@,yarn-project)
411426

412427
yarn-project-tests: yarn-project

0 commit comments

Comments
 (0)