Skip to content

Commit 4371708

Browse files
author
AztecBot
committed
chore: sync public-v5-next with upstream v5-next
2 parents 78efa9e + aba2a2e commit 4371708

70 files changed

Lines changed: 2557 additions & 562 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.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Bench Inclusion Point
2+
3+
# Reusable: runs ONE inclusion-sweep TPS point against an ALREADY-DEPLOYED
4+
# network (SKIP_NETWORK_DEPLOY=1). The caller (nightly-bench-inclusion-sweep.yml)
5+
# deploys the network once and calls this for each point (1/5/10 TPS), chaining
6+
# the calls so the points run sequentially on the same network. Deploy / wait /
7+
# teardown are done once by the caller, not here.
8+
9+
on:
10+
workflow_call:
11+
inputs:
12+
tps:
13+
description: "Target TPS for this point"
14+
required: true
15+
type: string
16+
namespace:
17+
description: "k8s namespace of the already-deployed network"
18+
required: true
19+
type: string
20+
network:
21+
description: "Network env name (environments/<network>.env)"
22+
required: false
23+
type: string
24+
default: bench-inclusion-sweep
25+
docker_image:
26+
description: "Full aztec docker image (already deployed)"
27+
required: true
28+
type: string
29+
source_ref:
30+
description: "Git ref to checkout for the bench scripts"
31+
required: true
32+
type: string
33+
sweep_id:
34+
description: "Shared sweep id so the dashboard groups the points"
35+
required: true
36+
type: string
37+
38+
jobs:
39+
bench:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
43+
with:
44+
ref: ${{ inputs.source_ref }}
45+
- name: Run ${{ inputs.tps }} TPS inclusion point
46+
timeout-minutes: 120
47+
env:
48+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
49+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
50+
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
51+
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
52+
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
53+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
54+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
55+
RUN_ID: ${{ github.run_id }}
56+
AWS_SHUTDOWN_TIME: 180
57+
NO_SPOT: 1
58+
SKIP_NETWORK_DEPLOY: "1"
59+
TARGET_TPS: ${{ inputs.tps }}
60+
BENCH_SWEEP_ID: ${{ inputs.sweep_id }}
61+
BENCH_SWEEP_LABEL: inclusion-sweep
62+
run: ./.github/ci3.sh network-inclusion-sweep ${{ inputs.network }} ${{ inputs.namespace }} "${{ inputs.docker_image }}"
Lines changed: 82 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
name: Nightly Bench 10 TPS
1+
name: Nightly Bench Inclusion Sweep
2+
3+
# Inclusion sweep: deploys ONE network and runs the
4+
# 1/5/10 TPS points SEQUENTIALLY against it, all tagged with a shared sweepId so
5+
# the dashboard groups them. The scraper drains the mempool to zero between
6+
# points. Each point is the reusable bench-inclusion-point.yml workflow
7+
# (SKIP_NETWORK_DEPLOY=1); the next point's call `needs` the previous one so they
8+
# don't overlap. Deploy / wait-for-first-block / teardown happen once.
29

310
on:
411
schedule:
5-
- cron: "30 6 * * *"
12+
- cron: "30 3 * * *"
613
workflow_dispatch:
714
inputs:
815
docker_image:
@@ -19,7 +26,7 @@ on:
1926
type: string
2027

2128
concurrency:
22-
group: nightly-bench-10tps-${{ github.ref }}
29+
group: nightly-bench-inclusion-sweep-${{ github.ref }}
2330
cancel-in-progress: true
2431

2532
jobs:
@@ -29,6 +36,7 @@ jobs:
2936
docker_image: ${{ steps.docker-image.outputs.docker_image }}
3037
image_label: ${{ steps.docker-image.outputs.image_label }}
3138
source_ref: ${{ steps.docker-image.outputs.source_ref }}
39+
sweep_id: ${{ steps.sweep.outputs.sweep_id }}
3240
steps:
3341
- name: Checkout
3442
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -71,130 +79,132 @@ jobs:
7179
echo "Using source ref: $source_ref"
7280
7381
- name: Verify source git ref
74-
id: verify-source
7582
run: |
7683
set -euo pipefail
7784
source_ref="${{ steps.docker-image.outputs.source_ref }}"
7885
git fetch --depth 1 origin "refs/tags/${source_ref}:refs/tags/${source_ref}"
79-
source_sha=$(git rev-parse "${source_ref}^{}")
80-
echo "Nightly source commit: $source_sha"
86+
git rev-parse "${source_ref}^{}"
8187
8288
- name: Check if Docker image exists
8389
run: |
8490
DOCKER_IMAGE="${{ steps.docker-image.outputs.docker_image }}"
85-
echo "Checking if Docker image exists: $DOCKER_IMAGE"
8691
if docker manifest inspect "$DOCKER_IMAGE" > /dev/null 2>&1; then
8792
echo "Docker image exists: $DOCKER_IMAGE"
8893
else
8994
echo "Docker image does not exist: $DOCKER_IMAGE"
9095
exit 1
9196
fi
9297
93-
deploy-bench-10tps-network:
98+
- name: Compute shared sweep id
99+
id: sweep
100+
run: |
101+
# Shared across all three points so the dashboard groups the sweep.
102+
echo "sweep_id=incl-$(date -u +%Y%m%d)-${{ github.run_id }}" >> "$GITHUB_OUTPUT"
103+
104+
# ---- Deploy the single network the whole sweep runs against ----
105+
deploy:
94106
needs: select-image
95107
uses: ./.github/workflows/deploy-network.yml
96108
with:
97-
network: bench-10tps
98-
namespace: bench-10tps
109+
network: bench-inclusion-sweep
110+
namespace: bench-inclusion-sweep
99111
aztec_docker_image: ${{ needs.select-image.outputs.docker_image }}
100112
ref: ${{ needs.select-image.outputs.source_ref }}
101113
notify_on_failure: false
102114
secrets: inherit
103115

104-
wait-for-first-l2-block:
105-
needs:
106-
- select-image
107-
- deploy-bench-10tps-network
116+
wait:
117+
needs: [select-image, deploy]
108118
runs-on: ubuntu-latest
109119
timeout-minutes: 120
110120
steps:
111-
- name: Checkout
112-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
121+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
113122
with:
114123
ref: ${{ needs.select-image.outputs.source_ref }}
115-
116-
- name: Authenticate to Google Cloud
117-
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
124+
- uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
118125
with:
119126
credentials_json: ${{ secrets.GCP_SA_KEY }}
120-
121-
- name: Set up Cloud SDK
122-
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1
127+
- uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1
123128
with:
124129
install_components: gke-gcloud-auth-plugin
125-
126130
- name: Wait for first L2 block
127131
env:
128132
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
129-
run: |
130-
cd spartan
131-
./bootstrap.sh wait_for_l2_block bench-10tps
133+
NAMESPACE: bench-inclusion-sweep
134+
run: cd spartan && ./bootstrap.sh wait_for_l2_block bench-inclusion-sweep
132135

133-
benchmark:
134-
needs:
135-
- select-image
136-
- wait-for-first-l2-block
136+
# ---- Three points, sequential, on the SAME network ----
137+
point-1tps:
138+
needs: [select-image, wait]
139+
uses: ./.github/workflows/bench-inclusion-point.yml
140+
with:
141+
tps: "1"
142+
namespace: bench-inclusion-sweep
143+
docker_image: ${{ needs.select-image.outputs.docker_image }}
144+
source_ref: ${{ needs.select-image.outputs.source_ref }}
145+
sweep_id: ${{ needs.select-image.outputs.sweep_id }}
146+
secrets: inherit
147+
148+
# 5 TPS runs after 1 TPS finishes — gated on the network being up (wait), not
149+
# on the 1 TPS result, so a failed point drops only itself.
150+
point-5tps:
151+
needs: [select-image, wait, point-1tps]
152+
if: ${{ !cancelled() && needs.wait.result == 'success' }}
153+
uses: ./.github/workflows/bench-inclusion-point.yml
154+
with:
155+
tps: "5"
156+
namespace: bench-inclusion-sweep
157+
docker_image: ${{ needs.select-image.outputs.docker_image }}
158+
source_ref: ${{ needs.select-image.outputs.source_ref }}
159+
sweep_id: ${{ needs.select-image.outputs.sweep_id }}
160+
secrets: inherit
161+
162+
point-10tps:
163+
needs: [select-image, wait, point-5tps]
164+
if: ${{ !cancelled() && needs.wait.result == 'success' }}
165+
uses: ./.github/workflows/bench-inclusion-point.yml
166+
with:
167+
tps: "10"
168+
namespace: bench-inclusion-sweep
169+
docker_image: ${{ needs.select-image.outputs.docker_image }}
170+
source_ref: ${{ needs.select-image.outputs.source_ref }}
171+
sweep_id: ${{ needs.select-image.outputs.sweep_id }}
172+
secrets: inherit
173+
174+
# ---- Tear the network down once, regardless of point outcomes ----
175+
cleanup:
176+
if: always()
177+
needs: [select-image, deploy, wait, point-1tps, point-5tps, point-10tps]
137178
runs-on: ubuntu-latest
138179
steps:
139-
- name: Checkout
140-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
180+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
141181
with:
142182
ref: ${{ needs.select-image.outputs.source_ref }}
143-
144-
- name: Run 10 TPS benchmark
145-
timeout-minutes: 240
183+
- name: Cleanup network resources
146184
env:
147185
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
148186
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
149187
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
150188
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
151189
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
152190
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
153-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
154-
RUN_ID: ${{ github.run_id }}
155-
AWS_SHUTDOWN_TIME: 240
156191
NO_SPOT: 1
157-
SKIP_NETWORK_DEPLOY: "1"
158-
run: |
159-
./.github/ci3.sh network-bench-10tps bench-10tps bench-10tps "${{ needs.select-image.outputs.docker_image }}"
160-
161-
cleanup:
162-
if: always()
163-
needs:
164-
- select-image
165-
- deploy-bench-10tps-network
166-
- wait-for-first-l2-block
167-
- benchmark
168-
runs-on: ubuntu-latest
169-
steps:
170-
- name: Checkout
171-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
172-
with:
173-
ref: ${{ needs.select-image.outputs.source_ref }}
174-
175-
- name: Cleanup network resources
176-
uses: ./.github/actions/network-teardown
177-
with:
178-
env_file: bench-10tps
179-
namespace: bench-10tps
180-
gcp_sa_key: ${{ secrets.GCP_SA_KEY }}
181-
gcp_project_id: ${{ secrets.GCP_PROJECT_ID }}
192+
run: ./.github/ci3.sh network-teardown bench-inclusion-sweep bench-inclusion-sweep
182193

183194
notify-failure:
184195
if: ${{ always() && failure() && github.event_name != 'workflow_dispatch' }}
185196
needs:
186197
- select-image
187-
- deploy-bench-10tps-network
188-
- wait-for-first-l2-block
189-
- benchmark
190-
- cleanup
198+
- deploy
199+
- wait
200+
- point-1tps
201+
- point-5tps
202+
- point-10tps
191203
runs-on: ubuntu-latest
192204
steps:
193-
- name: Checkout
194-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
205+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
195206
with:
196207
ref: ${{ needs.select-image.outputs.source_ref }}
197-
198208
- name: Notify Slack on failure
199209
env:
200210
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
@@ -203,6 +213,6 @@ jobs:
203213
IMAGE="${{ needs.select-image.outputs.image_label || 'unknown' }}"
204214
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
205215
./ci3/slack_notify_with_claudebox_kickoff "#alerts-next-scenario" \
206-
"Nightly 10 TPS benchmark FAILED (image ${IMAGE}): <${RUN_URL}|View Run> (🤖)" \
207-
"Nightly 10 TPS benchmark failed (image ${IMAGE}). CI run: ${RUN_URL}. Investigate the benchmark failure and identify the root cause." \
216+
"Nightly inclusion sweep FAILED (image ${IMAGE}): <${RUN_URL}|View Run> (🤖)" \
217+
"Nightly inclusion sweep failed (image ${IMAGE}). CI run: ${RUN_URL}. Deploy/wait failures fail the whole sweep; a failed individual point drops only that point." \
208218
--link "$RUN_URL"

bootstrap.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,36 @@ case "$cmd" in
936936
bench_merge
937937
cache_upload spartan-bench-10tps-$(git rev-parse HEAD^{tree}).tar.gz bench-out/bench.json
938938
;;
939+
"ci-network-inclusion-sweep")
940+
# Args: <env_file> <namespace> [docker_image]
941+
# Runs one inclusion-sweep point (TARGET_TPS) on the given network.
942+
# The v4 run JSON (tagged BENCH_SWEEP_ID) is uploaded to GCS inside
943+
# bench_inclusion_point; deploy/teardown of each point's namespace is done by
944+
# the workflow, so this is normally called with SKIP_NETWORK_DEPLOY=1.
945+
export CI=1
946+
env_file="${1:?env_file is required}"
947+
namespace="${2:?namespace is required}"
948+
docker_image="${3:-}"
949+
build
950+
export NAMESPACE="$namespace"
951+
if [ "${SKIP_NETWORK_DEPLOY:-0}" != "1" ]; then
952+
# If no docker image provided, build and push to aztecdev
953+
if [ -z "$docker_image" ]; then
954+
release-image/bootstrap.sh push_pr
955+
docker_image="aztecprotocol/aztecdev:$(git rev-parse HEAD)"
956+
fi
957+
export AZTEC_DOCKER_IMAGE="$docker_image"
958+
spartan/bootstrap.sh network_deploy "${env_file}"
959+
else
960+
echo "SKIP_NETWORK_DEPLOY=1, running inclusion-sweep point (${TARGET_TPS:-10} TPS) against existing network '$namespace'."
961+
fi
962+
# Run one inclusion-sweep point (TARGET_TPS / BENCH_SWEEP_ID from env).
963+
spartan/bootstrap.sh bench_inclusion_point "${env_file}"
964+
rm -rf bench-out
965+
mkdir -p bench-out
966+
bench_merge
967+
cache_upload spartan-bench-inclusion-${TARGET_TPS:-10}tps-$(git rev-parse HEAD^{tree}).tar.gz bench-out/bench.json
968+
;;
939969
"ci-network-teardown")
940970
# Args: <env_file> <namespace>
941971
# Tears down a deployed network.

ci.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,21 @@ case "$cmd" in
298298
[ "${SKIP_NETWORK_DEPLOY:-0}" = "1" ] && skip_network_deploy=1
299299
bootstrap_ec2 "SKIP_NETWORK_DEPLOY=$skip_network_deploy ./bootstrap.sh ci-network-bench-10tps $*"
300300
;;
301+
network-inclusion-sweep)
302+
# Args: <env_file> <namespace> [docker_image]
303+
# Runs one inclusion-sweep point at TARGET_TPS against an existing
304+
# network, tagged with BENCH_SWEEP_ID. The workflow deploys/tears down each
305+
# point's namespace separately, so this is normally called with
306+
# SKIP_NETWORK_DEPLOY=1. TARGET_TPS / BENCH_SWEEP_ID / BENCH_SWEEP_LABEL come
307+
# from the caller's env and are threaded into the remote command.
308+
export CI_DASHBOARD="network"
309+
export JOB_ID="x-${2:?namespace is required}-network-inclusion-sweep" CPUS=16
310+
export AWS_SHUTDOWN_TIME=${AWS_SHUTDOWN_TIME:-180}
311+
export INSTANCE_POSTFIX="n-incl-sweep"
312+
skip_network_deploy=0
313+
[ "${SKIP_NETWORK_DEPLOY:-0}" = "1" ] && skip_network_deploy=1
314+
bootstrap_ec2 "TARGET_TPS=${TARGET_TPS:-10} BENCH_SWEEP_ID=${BENCH_SWEEP_ID:-} BENCH_SWEEP_LABEL=${BENCH_SWEEP_LABEL:-inclusion-sweep} SKIP_NETWORK_DEPLOY=$skip_network_deploy ./bootstrap.sh ci-network-inclusion-sweep $*"
315+
;;
301316
network-teardown)
302317
# Args: <scenario> <namespace>
303318
export CI_DASHBOARD="network"

noir-projects/aztec-nr/aztec/src/messages/processing/log_retrieval_response.nr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,10 @@ pub struct LogRetrievalResponse {
1919
pub unique_note_hashes_in_tx: BoundedVec<Field, MAX_NOTE_HASHES_PER_TX>,
2020
/// The first nullifier created by `tx_hash`
2121
pub first_nullifier_in_tx: Field,
22+
/// The number of the block in which `tx_hash` was included
23+
pub block_number: u32,
24+
/// The timestamp of the block in which `tx_hash` was included
25+
pub block_timestamp: u64,
26+
/// The hash of the block in which `tx_hash` was included
27+
pub block_hash: Field,
2228
}

noir-projects/aztec-nr/aztec/src/oracle/message_processing.nr

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ pub unconstrained fn get_logs_by_tag(
5454
get_logs_by_tag_oracle(requests)
5555
}
5656

57-
// TODO: PXE also exposes `getLogsByTagV2`, whose response additionally carries the origin block number and timestamp
58-
// of each log. Switch this oracle (and `LogRetrievalResponse`) over to it once a consumer needs that context.
59-
#[oracle(aztec_utl_getLogsByTag)]
57+
#[oracle(aztec_utl_getLogsByTagV2)]
6058
unconstrained fn get_logs_by_tag_oracle(
6159
requests: EphemeralArray<LogRetrievalRequest>,
6260
) -> EphemeralArray<EphemeralArray<LogRetrievalResponse>> {}

noir-projects/aztec-nr/aztec/src/oracle/version.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// immediately if AZTEC_NR_MINOR > PXE_MINOR because if a contract is updated to use a newer Aztec.nr dependency
1212
/// without actually using any of the new oracles then there is no reason to throw.
1313
pub global ORACLE_VERSION_MAJOR: Field = 30;
14-
pub global ORACLE_VERSION_MINOR: Field = 3;
14+
pub global ORACLE_VERSION_MINOR: Field = 4;
1515

1616
/// Asserts that the version of the oracle is compatible with the version expected by the contract.
1717
pub fn assert_compatible_oracle_version() {

0 commit comments

Comments
 (0)