Skip to content

Commit 879fa93

Browse files
alejoamirasclaude
andauthored
feat!: Aztec v6 (@aztec-labs), block-duration-ms input, SHA-pinned actions (#3)
* ci: pin every action to a full commit SHA Floating tags (setup-aztec@v0, create-or-update-comment@v4, checkout@v4, upload-artifact@v4, setup-node@v4) let upstream change what runs, and a caller's SHA pin on these reusable workflows did not pin them. Also stop persisting the checkout token in the reusable workflows (PR code and installers run in the same job) and stop passing all repo secrets to the upstream pre-release workflow, which uses none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(ci): keep expressions and untrusted values out of shell scripts Move ${{ }} expressions used inside run: into step env (publish.yml version/tag checks, the comment-minimize step), quote $GITHUB_OUTPUT, and make the action's npx call refuse to install: the unscoped `aztec-benchmark` npm package belongs to a third party. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(ci): add block-duration-ms input to the reusable benchmark workflows Callers can set the local network's SEQ_BLOCK_DURATION_MS. The per-tx DA gas cap scales with blocks per checkpoint: the 3 s default admits 55836, 6000 ms (mainnet's block duration) admits 117624, enough for large contract-class publications. The value is validated before checkout because Aztec parses it with parseFloat ("6s" would mean 6 ms); empty keeps today's environment untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: document SHA pinning, block-duration-ms and the workflows' security model Replace the non-existent @v0 refs with commit-SHA pins, add contents: read to the example permissions, complete the PR Benchmark inputs table, and explain why the per-tx DA cap depends on block duration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat!: move to Aztec v6 (@aztec-labs/* packages), release 6.0.0-rc.1 Aztec v6 renamed its npm scope from @Aztec to @aztec-labs. Peers are now @aztec-labs/aztec.js and @aztec-labs/wallets at >=6.0.0-0 <7 (any 6.0.0 pre-release, since upstream's latest tag points at a nightly), and config.aztecVersion moves to 6.0.0-rc.1. The CLI only uses these packages in type positions, so the emitted dist/*.js is byte-identical to 5.0.1; only the .d.ts specifiers change. BREAKING CHANGE: requires @aztec-labs/* v6 peers; v5 (@aztec/*) consumers stay on 5.0.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: update samples to @aztec-labs and add a compatibility table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: scope the pull_request warning to pr-benchmark and state the no-echo invariant The trigger warning applies to pr-benchmark.yml only (update-baseline runs on push), and on fork PRs the failed comment step also skips the baseline upload. The validator comment now records why the value is never echoed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 433bb26 commit 879fa93

13 files changed

Lines changed: 541 additions & 353 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Check out github repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1919

2020
- name: Use Node
21-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2222
with:
2323
node-version: 22.17.0
2424
cache: "yarn"

‎.github/workflows/pr-benchmark.yml‎

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ on:
3535
description: "Include per-circuit gate breakdown in the report"
3636
type: boolean
3737
default: false
38+
block-duration-ms:
39+
description: "Local-network block duration in ms, exported as SEQ_BLOCK_DURATION_MS. Empty keeps the Aztec default (3000). 6000 matches mainnet's block duration and raises the per-tx DA gas cap from 55836 to 117624."
40+
type: string
41+
default: ""
3842

3943
permissions:
4044
contents: read
@@ -56,14 +60,28 @@ jobs:
5660
runs-on: ${{ inputs.runner }}
5761
timeout-minutes: ${{ inputs.timeout }}
5862
steps:
63+
- name: Configure block duration
64+
if: inputs.block-duration-ms != ''
65+
env:
66+
BLOCK_DURATION_MS: ${{ inputs.block-duration-ms }}
67+
run: |
68+
# Aztec parses this with parseFloat ("6s" = 6 ms). Never echo the value: a newline in it would run as a workflow command.
69+
if [[ ! "$BLOCK_DURATION_MS" =~ ^[1-9][0-9]*$ ]]; then
70+
echo "::error::block-duration-ms must be a positive integer number of milliseconds"
71+
exit 1
72+
fi
73+
echo "SEQ_BLOCK_DURATION_MS=$BLOCK_DURATION_MS" >> "$GITHUB_ENV"
74+
5975
- name: Checkout
60-
uses: actions/checkout@v4
76+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
6177
with:
6278
ref: ${{ github.event.pull_request.head.sha }}
6379
fetch-depth: 0
80+
# PR code and third-party installers run in this job; keep the write-scoped token off disk.
81+
persist-credentials: false
6482

6583
- name: Setup Aztec environment
66-
uses: AztecProtocol/aztec-ci-actions/actions/setup-aztec@v0
84+
uses: AztecProtocol/aztec-ci-actions/actions/setup-aztec@431859e477234b8690eb1f80d1305d2e34f10f1b # v0.1.1
6785
with:
6886
start-pxe: "true"
6987
run-codegen: "true"
@@ -77,11 +95,11 @@ jobs:
7795
BASE_REF: ${{ github.event.pull_request.base.ref }}
7896
run: |
7997
encoded=$(echo "${BASE_REF}" | sed 's/\//-/g')
80-
echo "base-ref-encoded=${encoded}" >> $GITHUB_OUTPUT
98+
echo "base-ref-encoded=${encoded}" >> "$GITHUB_OUTPUT"
8199
if [[ "${BASE_REF}" == "main" ]]; then
82-
echo "workflow=${BASELINE_WORKFLOW}" >> $GITHUB_OUTPUT
100+
echo "workflow=${BASELINE_WORKFLOW}" >> "$GITHUB_OUTPUT"
83101
else
84-
echo "workflow=${PR_WORKFLOW}" >> $GITHUB_OUTPUT
102+
echo "workflow=${PR_WORKFLOW}" >> "$GITHUB_OUTPUT"
85103
fi
86104
87105
- name: Download baseline artifact
@@ -128,10 +146,13 @@ jobs:
128146
continue-on-error: true
129147
env:
130148
GH_TOKEN: ${{ github.token }}
149+
REPO: ${{ github.repository }}
150+
PR_NUMBER: ${{ github.event.pull_request.number }}
131151
run: |
132-
node_ids=$(gh api "/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \
152+
node_ids=$(gh api "/repos/${REPO}/issues/${PR_NUMBER}/comments" \
133153
--paginate --jq '.[] | select(.body | contains("<!-- benchmark-diff -->")) | .node_id')
134154
for node_id in $node_ids; do
155+
# shellcheck disable=SC2016 # $id is a GraphQL variable, not shell
135156
gh api graphql -f query='
136157
mutation($id: ID!) {
137158
minimizeComment(input: {subjectId: $id, classifier: OUTDATED}) {
@@ -141,7 +162,7 @@ jobs:
141162
done
142163
143164
- name: Comment diff on PR
144-
uses: peter-evans/create-or-update-comment@v4
165+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
145166
with:
146167
issue-number: ${{ github.event.pull_request.number }}
147168
body-path: benchmark-comparison.md
@@ -159,10 +180,10 @@ jobs:
159180
HEAD_REF: ${{ github.event.pull_request.head.ref }}
160181
run: |
161182
encoded=$(echo "${HEAD_REF}" | sed 's/\//-/g')
162-
echo "head-ref-encoded=${encoded}" >> $GITHUB_OUTPUT
183+
echo "head-ref-encoded=${encoded}" >> "$GITHUB_OUTPUT"
163184
164185
- name: Upload baseline
165-
uses: actions/upload-artifact@v4
186+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
166187
with:
167188
name: benchmark-baseline-${{ steps.encode-head.outputs.head-ref-encoded }}
168189
path: ${{ env.BENCH_DIR }}/*${{ env.CURRENT_SUFFIX }}.benchmark.json

‎.github/workflows/pre-release.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ permissions:
88

99
jobs:
1010
pre-release:
11-
uses: AztecProtocol/aztec-ci-actions/.github/workflows/pre-release.yml@v0
11+
uses: AztecProtocol/aztec-ci-actions/.github/workflows/pre-release.yml@431859e477234b8690eb1f80d1305d2e34f10f1b # v0.1.1
1212
with:
1313
run-compile: false
1414
run-codegen: false
15-
secrets: inherit

‎.github/workflows/publish.yml‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
runs-on: ubuntu-latest
3838
steps:
3939
- name: Check out github repository
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
4141

4242
- name: Use Node
43-
uses: actions/setup-node@v4
43+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4444
with:
4545
node-version: 22.17.0
4646
cache: "yarn"
@@ -82,19 +82,20 @@ jobs:
8282
runs-on: ubuntu-latest
8383
steps:
8484
- name: Check out github repository
85-
uses: actions/checkout@v4
85+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
8686

8787
- name: Use Node
88-
uses: actions/setup-node@v4
88+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
8989
with:
9090
node-version: 22.17.0
9191
cache: "yarn"
9292
registry-url: "https://registry.npmjs.org"
9393

9494
- name: Validate input version matches package.json
9595
if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != ''
96+
env:
97+
INPUT_VERSION: ${{ github.event.inputs.version }}
9698
run: |
97-
INPUT_VERSION="${{ github.event.inputs.version }}"
9899
PKG_VERSION=$(node -p "require('./package.json').version")
99100
echo "Input version: $INPUT_VERSION"
100101
echo "package.json version: $PKG_VERSION"
@@ -105,9 +106,10 @@ jobs:
105106
106107
- name: Validate release tag matches package.json
107108
if: github.event_name == 'release'
109+
env:
110+
RELEASE_TAG: ${{ github.event.release.tag_name }}
108111
run: |
109-
TAG_VERSION="${{ github.event.release.tag_name }}"
110-
TAG_VERSION="${TAG_VERSION#v}" # Strip an optional leading "v"
112+
TAG_VERSION="${RELEASE_TAG#v}" # Strip an optional leading "v"
111113
PKG_VERSION=$(node -p "require('./package.json').version")
112114
echo "Release tag version: $TAG_VERSION"
113115
echo "package.json version: $PKG_VERSION"

‎.github/workflows/update-baseline.yml‎

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
description: "Suffix for benchmark report files"
2020
type: string
2121
default: "_latest"
22+
block-duration-ms:
23+
description: "Local-network block duration in ms, exported as SEQ_BLOCK_DURATION_MS. Empty keeps the Aztec default (3000). 6000 matches mainnet's block duration and raises the per-tx DA gas cap from 55836 to 117624."
24+
type: string
25+
default: ""
2226

2327
permissions:
2428
contents: read
@@ -34,13 +38,27 @@ jobs:
3438
runs-on: ${{ inputs.runner }}
3539
timeout-minutes: ${{ inputs.timeout }}
3640
steps:
41+
- name: Configure block duration
42+
if: inputs.block-duration-ms != ''
43+
env:
44+
BLOCK_DURATION_MS: ${{ inputs.block-duration-ms }}
45+
run: |
46+
# Aztec parses this with parseFloat ("6s" = 6 ms). Never echo the value: a newline in it would run as a workflow command.
47+
if [[ ! "$BLOCK_DURATION_MS" =~ ^[1-9][0-9]*$ ]]; then
48+
echo "::error::block-duration-ms must be a positive integer number of milliseconds"
49+
exit 1
50+
fi
51+
echo "SEQ_BLOCK_DURATION_MS=$BLOCK_DURATION_MS" >> "$GITHUB_ENV"
52+
3753
- name: Checkout
38-
uses: actions/checkout@v4
54+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
3955
with:
4056
fetch-depth: 0
57+
# Dependency scripts and third-party installers run in this job; keep the write-scoped token off disk.
58+
persist-credentials: false
4159

4260
- name: Setup Aztec environment
43-
uses: AztecProtocol/aztec-ci-actions/actions/setup-aztec@v0
61+
uses: AztecProtocol/aztec-ci-actions/actions/setup-aztec@431859e477234b8690eb1f80d1305d2e34f10f1b # v0.1.1
4462
with:
4563
start-pxe: "true"
4664
run-codegen: "true"
@@ -61,10 +79,10 @@ jobs:
6179
BRANCH_NAME: ${{ github.ref_name }}
6280
run: |
6381
encoded=$(echo "${BRANCH_NAME}" | sed 's/\//-/g')
64-
echo "branch-encoded=${encoded}" >> $GITHUB_OUTPUT
82+
echo "branch-encoded=${encoded}" >> "$GITHUB_OUTPUT"
6583
6684
- name: Upload baseline artifact
67-
uses: actions/upload-artifact@v4
85+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6886
with:
6987
name: benchmark-baseline-${{ steps.encode.outputs.branch-encoded }}
7088
path: ${{ env.BENCH_DIR }}/*${{ env.BENCH_SUFFIX }}.benchmark.json

0 commit comments

Comments
 (0)