Skip to content

Commit 1aca885

Browse files
authored
chore: Accumulated backports to v4-next (#23080)
BEGIN_COMMIT_OVERRIDE fix(aztec-up): Aztec installer does not shadow user installed binaries on PATH (#22902) fix: include sqlite binary in its npm package (#23039) chore: backport #23041 (add sendMessagesAs to wallet api schemas) to v4-next (#23081) chore: backport DeployMethod refactor (#22985) to v4-next (#23029) refactor(pxe): deduplicate tx hash lookups in MessageContextService (#23075) refactor(pxe): batch tagged private log queries across all secrets (#23048) refactor(pxe): batch log RPC calls in LogService.fetchLogsByTag (#23088) feat(aztec-nr): Initial handshake registry contract with non interactive handshake function (#22854) fix: add Tag.random() helper required by backported #23088 tests (#23094) chore: backport: fix(aztec-up): installer does not shadow user binaries on PATH (#22902) (#23060) chore: backport handshake registry contract (#22854) to v4-next (#23063) feat: deploy method refactor 2 (#23033) refactor(pxe): skip redundant getBlock RPC when querying at anchor block (#23100) port(v4-next): feat(docs): autogenerate node JSON-RPC API reference (#22543) (#23046) chore: backport feat: deploy method refactor 2 (#23033) to v4-next (#23103) port(v4-next): feat(ci): Snapshots for aztec-nr contract compilation failures and nargo expand (#23061) (#23104) feat(txe): allow authorizing cross-contract utility calls in nr tests (#23064) END_COMMIT_OVERRIDE
2 parents af6e4cf + e0366c9 commit 1aca885

342 files changed

Lines changed: 28067 additions & 2373 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.

.claude/skills/release-network-docs/SKILL.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ self-identify its release type, ask the user to confirm.
2121

2222
**This skill does NOT:**
2323

24-
- Generate API docs (aztec-nr or TypeScript)
24+
- Generate developer API docs (aztec-nr or TypeScript)
2525
- Generate CLI reference docs
2626
- Update developer version config or cut developer versioned docs
2727
- Update migration notes
2828
- Require aztec CLI, nargo, or yarn-project build
2929

30+
**This skill DOES** regenerate the Node JSON-RPC API reference for the
31+
versioned docs (see Step 5a).
32+
3033
## Usage
3134

3235
```
@@ -165,7 +168,29 @@ Ask the user if any content changes are needed in `docs/docs-operate/`:
165168
- Operator changelog updates (if not handled by `/updating-changelog`)
166169

167170
If the user has content changes, apply them to the source files in
168-
`docs/docs-operate/`. If no content changes are needed, skip to Step 6.
171+
`docs/docs-operate/`. If no content changes are needed, skip to Step 5a.
172+
173+
### Step 5a: Regenerate Node API Reference
174+
175+
The Node JSON-RPC API reference is auto-generated from TypeScript source. It
176+
must be regenerated from the release tag's source files to ensure the versioned
177+
docs reflect the actual API at that release.
178+
179+
```bash
180+
cd docs
181+
yarn generate:node-api-reference
182+
```
183+
184+
This writes to `docs/docs-operate/operators/reference/node-api-reference.md`
185+
using the source files from the currently checked-out tag. The generator parses
186+
`yarn-project/stdlib/src/interfaces/aztec-node.ts` and
187+
`yarn-project/stdlib/src/interfaces/aztec-node-admin.ts` directly (no
188+
yarn-project build needed, but `yarn-project/node_modules/` must be installed
189+
so `npx tsx` can resolve `typescript` — run `yarn install` from `yarn-project`
190+
if needed).
191+
192+
Verify the output lists the expected number of methods and has no ungrouped
193+
methods warnings.
169194

170195
### Step 6: Build and Validate
171196

@@ -284,6 +309,10 @@ Check for stash conflicts. Then report to the user:
284309
- **No heavy prerequisites**: This skill does not require aztec CLI, nargo, or
285310
a yarn-project build. Only `yarn` (for the docs build), `curl`/`jq` (for
286311
the RPC query), and `cast` (for on-chain address queries) are needed.
312+
- **Node API reference is auto-generated**: Run `yarn generate:node-api-reference`
313+
(Step 5a) before building. The generator parses TypeScript source directly, so
314+
no yarn-project build is required — but `yarn-project/node_modules/` must exist
315+
(run `yarn install` from `yarn-project` if missing).
287316
- **Build must pass**: Do not cut versioned docs until `yarn build` succeeds.
288317
- **COMMIT_TAG needs `v` prefix**: The preprocessor uses COMMIT_TAG for GitHub
289318
URLs and git tag references. Omitting the `v` will break links in versioned

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ aztec-nr: noir bb-cpp-native
262262
noir-projects-txe-tests:
263263
$(call test,$@,noir-projects/aztec-nr)
264264
$(call test,$@,noir-projects/noir-contracts)
265-
$(call test,$@,noir-projects/noir-contracts-comp-failures)
266265

267266
# Noir Projects - Aggregate target (builds all sub-projects)
268267
noir-projects: noir-protocol-circuits mock-protocol-circuits noir-contracts aztec-nr

aztec-up/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ That is all.
99
This will install into `~/.aztec/bin` a collection of scripts to help with running aztec containers, and will update
1010
the user's `PATH` variable in their shell startup script so they can be found.
1111

12-
- `aztec` - a collection of tools to compile and test contracts, to launch subsystems and interact with the aztec network."
13-
- `aztec-up` - a tool to install and manage aztec toolchain versions."
14-
- `aztec-wallet` - our minimalistic CLI wallet"
12+
- `aztec` - compiles and tests contracts, launches infrastructure subsystems, interacts with the network.
13+
- `aztec-up` - a version manager for the Aztec toolchain.
14+
- `aztec-wallet` - a tool for interacting with the Aztec network.
15+
- `aztec-bb` - the Barretenberg proving backend.
16+
- `aztec-nargo` - the Noir compiler and simulator.
17+
- `aztec-forge`, `aztec-cast`, `aztec-anvil`, `aztec-chisel` - the bundled Foundry tools.
18+
19+
Foundry, Noir, and Barretenberg are bundled at the versions `aztec` needs. Your own `forge` / `nargo` / `bb` installs still work under their bare names.
1520

1621
After installed, you can use `aztec-up` to install specific versions.
1722

aztec-up/bin/0.0.1/aztec-install

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ function title {
9494
echo -e "Installing version: ${bold}${o}$VERSION${r}"
9595
echo
9696
echo -e "This script installs the following and updates your PATH if necessary:"
97-
echo -e " ${bold}${g}nargo${r} - the noir programming language compiler and simulator."
98-
echo -e " ${bold}${g}noir-profiler${r} - a profiler for analyzing and visualizing noir programs."
99-
echo -e " ${bold}${g}bb${r} - the barretenberg proving backend."
10097
echo -e " ${bold}${g}aztec${r} - compiles and tests contracts, interacts with the network."
10198
echo -e " ${bold}${g}aztec-up${r} - installs and manages aztec toolchain versions."
10299
echo -e " ${bold}${g}aztec-wallet${r} - a minimalistic wallet cli."
100+
echo -e " ${bold}${g}aztec-bb${r} - the barretenberg proving backend."
101+
echo -e " ${bold}${g}aztec-nargo${r} - the noir compiler and simulator."
102+
echo -e " ${bold}${g}aztec-forge${r}, ${bold}${g}aztec-cast${r}, ${bold}${g}aztec-anvil${r}, ${bold}${g}aztec-chisel${r} - the bundled foundry tools."
103+
echo
104+
echo -e "Foundry, Noir, and Barretenberg are bundled at the versions ${bold}${g}aztec${r} needs. Your own ${bold}${g}forge${r} / ${bold}${g}nargo${r} / ${bold}${g}bb${r} installs still work under their bare names."
103105
echo
104106
read -p "Do you wish to continue? (Y/n) " -n 1 -r
105107
echo

aztec-up/bin/0.0.1/install

Lines changed: 98 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ export FORCE_COLOR=1
3737
# Version-specific paths
3838
version_path="$AZTEC_HOME/versions/$VERSION"
3939
version_bin_path="$version_path/bin"
40+
# Native binaries (forge/nargo/anvil/...) live here and are NOT on the user's PATH.
41+
# The aztec wrapper prepends this directory to its child PATH so subprocesses
42+
# spawned from the aztec workflow (which call sibling tools by basename) resolve
43+
# to the bundled binaries. User-facing access is only via the aztec-* symlinks
44+
# in version_bin_path.
45+
version_internal_bin_path="$version_path/internal-bin"
4046

4147
os="$(uname -s)"
4248

@@ -137,7 +143,15 @@ function install_noir {
137143
set -euo pipefail
138144

139145
if [[ -n ${NARGO:-} ]]; then
140-
cp "$NARGO" "$version_bin_path/nargo"
146+
cp "$NARGO" "$version_internal_bin_path/nargo"
147+
# noir's release build co-locates `noir-profiler` next to `nargo`
148+
# (see noir/bootstrap.sh::build_native). Copy it too so the
149+
# `aztec-noir-profiler` symlink in install_native_symlinks resolves.
150+
local nargo_dir
151+
nargo_dir=$(dirname "$NARGO")
152+
if [ -f "$nargo_dir/noir-profiler" ]; then
153+
cp "$nargo_dir/noir-profiler" "$version_internal_bin_path/noir-profiler"
154+
fi
141155
else
142156
local noir_version
143157
noir_version=$(get_version "noir")
@@ -150,13 +164,12 @@ function install_noir {
150164
# Always install/update noirup
151165
curl -Ls https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash
152166

153-
# Install noir to temp location and move to version directory
167+
# Install noir to temp location and move into internal-bin (off PATH).
154168
NARGO_HOME="$temp_nargo_home" "$HOME/.nargo/bin/noirup" -v "$noir_version"
155169

156-
# Move the nargo binary to our version bin directory
157-
mv "$temp_nargo_home/bin/nargo" "$version_bin_path/nargo"
170+
mv "$temp_nargo_home/bin/nargo" "$version_internal_bin_path/nargo"
158171
# Also move noir-profiler, needed by `aztec profile flamegraph`
159-
mv "$temp_nargo_home/bin/noir-profiler" "$version_bin_path/noir-profiler"
172+
mv "$temp_nargo_home/bin/noir-profiler" "$version_internal_bin_path/noir-profiler"
160173

161174
# Cleanup temp directory
162175
rm -rf "$temp_nargo_home"
@@ -182,10 +195,11 @@ function install_foundry {
182195
# Install foundry to temp location and move to version directory
183196
FOUNDRY_DIR="$temp_foundry_dir" timeout 30 "$foundry_home/bin/foundryup" -i "$foundry_version"
184197

185-
# Move the foundry binaries to our version bin directory
198+
# Move the foundry binaries into internal-bin (off PATH); aztec-forge etc.
199+
# symlinks in version_bin_path expose them under aztec-prefixed names.
186200
for binary in forge cast anvil chisel; do
187201
if [ -f "$temp_foundry_dir/bin/$binary" ]; then
188-
mv "$temp_foundry_dir/bin/$binary" "$version_bin_path/$binary"
202+
mv "$temp_foundry_dir/bin/$binary" "$version_internal_bin_path/$binary"
189203
fi
190204
done
191205

@@ -200,32 +214,88 @@ function install_aztec_packages {
200214
npm install @aztec/aztec@$VERSION @aztec/cli-wallet@$VERSION @aztec/bb.js@$VERSION --prefix "$version_path"
201215
}
202216

203-
function symlink_aztec_bins {
217+
# Expose every native tool in internal-bin under an aztec-<tool> symlink in bin.
218+
# Bare `forge`/`nargo`/etc. are intentionally NOT on PATH so they cannot shadow
219+
# user-installed tools.
220+
function install_native_symlinks {
221+
set -euo pipefail
222+
local tool
223+
for tool in forge cast anvil chisel nargo noir-profiler; do
224+
if [ ! -e "$version_internal_bin_path/$tool" ]; then
225+
echo "Error: expected bundled binary '$tool' missing from $version_internal_bin_path" >&2
226+
exit 1
227+
fi
228+
ln -sfn "../internal-bin/$tool" "$version_bin_path/aztec-$tool"
229+
done
230+
}
231+
232+
# Npm bins are NOT mirrored into internal-bin. The contract for any TS tool
233+
# that needs to spawn a sibling binary is to resolve an absolute bundled
234+
# path itself (e.g. via @aztec/bb.js findBbBinary(), or a BB-style env
235+
# var) -- never by basename + PATH lookup. If you find yourself wanting to
236+
# add an npm bin to internal-bin so a child process can find it on PATH,
237+
# fix the caller instead of broadening this list.
238+
function install_npm_bin_symlinks {
204239
set -euo pipefail
205-
# Populate version_bin_path with symlinks to @aztec-owned bins only. Adding
206-
# node_modules/.bin wholesale to PATH would shadow user-installed tools
207-
# (jest, tsc, semver, ...) with Aztec's transitive dependencies.
208240
local npm_bin_dir="$version_path/node_modules/.bin"
209241
[ -d "$npm_bin_dir" ] || return 0
210242

211-
local bin_link bin_name target
243+
local bin_link bin_name target link_name
212244
for bin_link in "$npm_bin_dir"/*; do
213245
[ -L "$bin_link" ] || continue
214246
target=$(readlink "$bin_link")
215247
# npm writes relative symlinks like ../@aztec/aztec/... for scoped packages.
216248
[[ "$target" == ../@aztec/* ]] || continue
217249
bin_name=$(basename "$bin_link")
218-
if [ -e "$version_bin_path/$bin_name" ] && [ ! -L "$version_bin_path/$bin_name" ]; then
219-
echo_yellow "refusing to overwrite non-symlink $bin_name; @aztec package bin collides with a hand-installed toolchain binary" >&2
250+
251+
# `aztec` is a wrapper, written by install_aztec_wrapper.
252+
[[ "$bin_name" == "aztec" ]] && continue
253+
254+
# Already prefixed (e.g. aztec-wallet) keeps its name; everything else gets
255+
# renamed to aztec-<orig> so it cannot shadow a user-installed binary.
256+
if [[ "$bin_name" == aztec-* ]]; then
257+
link_name="$bin_name"
258+
else
259+
link_name="aztec-$bin_name"
260+
fi
261+
262+
if [ -e "$version_bin_path/$link_name" ] && [ ! -L "$version_bin_path/$link_name" ]; then
263+
echo_yellow "refusing to overwrite non-symlink $link_name; @aztec package bin collides with a hand-installed toolchain binary" >&2
220264
exit 1
221265
fi
222-
ln -sfn "../node_modules/.bin/$bin_name" "$version_bin_path/$bin_name"
266+
ln -sfn "../node_modules/.bin/$bin_name" "$version_bin_path/$link_name"
223267
done
224268
}
225269

270+
# Wrapper for `aztec`: prepends internal-bin to PATH so the aztec workflow
271+
# resolves bundled native tools by basename. yarn-project/aztec/scripts/aztec.sh
272+
# (the npm bin entry of @aztec/aztec) calls bare `nargo` (line 36, in `aztec
273+
# test`) and bare `anvil` (line 55-56, in `aztec start --local-network`); the
274+
# TS commands it spawns also fall back to bare `forge` / `nargo` /
275+
# `noir-profiler` when their respective env vars are unset. The wrapper is
276+
# kept minimal -- it is the only place we maintain a PATH-based execution
277+
# context, by design (see install_npm_bin_symlinks for the rationale).
278+
# BASH_SOURCE[0] (not $0) so PATH-name invocation still resolves internal-bin
279+
# from the wrapper's actual location.
280+
function install_aztec_wrapper {
281+
set -euo pipefail
282+
local wrapper="$version_bin_path/aztec"
283+
cat > "$wrapper" <<'EOF'
284+
#!/usr/bin/env bash
285+
# Auto-generated by aztec-up. Do not edit.
286+
set -euo pipefail
287+
self_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
288+
internal_bin="$self_dir/../internal-bin"
289+
export PATH="$internal_bin:$PATH"
290+
exec "$self_dir/../node_modules/.bin/aztec" "$@"
291+
EOF
292+
chmod +x "$wrapper"
293+
}
294+
226295
function main {
227-
# Create version directory
296+
# Create version directories. bin/ is exposed on PATH; internal-bin/ is not.
228297
mkdir -p "$version_bin_path"
298+
mkdir -p "$version_internal_bin_path"
229299

230300
# Download versions manifest
231301
echo -n "Installing version manifest... "
@@ -250,14 +320,23 @@ function main {
250320
dump_fail retry install_foundry
251321
echo_green "done."
252322

323+
# Expose native tools as aztec-forge / aztec-nargo / etc.
324+
echo -n "Linking aztec native tools... "
325+
dump_fail install_native_symlinks
326+
echo_green "done."
327+
253328
# Install aztec npm packages
254-
echo -n "Installing aztec packages... "
329+
echo -n "Installing aztec npm packages... "
255330
dump_fail retry install_aztec_packages
256331
echo_green "done."
257332

258-
# Expose only @aztec-owned bins on PATH (drops transitive npm deps).
333+
# Expose @aztec-owned npm bins under aztec-prefixed symlinks. Bare names
334+
# (bb, pxe, txe, ...) are intentionally NOT exposed as they would shadow
335+
# user-installed tools.
259336
echo -n "Making aztec commands available... "
260-
dump_fail retry symlink_aztec_bins
337+
dump_fail install_npm_bin_symlinks
338+
# Wrap `aztec` so its subprocesses see internal-bin on PATH.
339+
dump_fail install_aztec_wrapper
261340
echo_green "done."
262341
}
263342

aztec-up/bootstrap.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ EOF
104104
}
105105

106106
function test_cmds {
107-
for test in amm_flow bridge_and_claim basic_install counter_contract default_scaffold; do
107+
for test in amm_flow bridge_and_claim basic_install counter_contract default_scaffold no_shadow_user_bins; do
108108
echo "$hash:TIMEOUT=15m aztec-up/scripts/run_test.sh $test"
109109
done
110110
}
@@ -234,8 +234,8 @@ function install_on_mac_vm {
234234
. "\$HOME/.nvm/nvm.sh"
235235
236236
# Verify installation.
237-
nargo --version
238-
bb --version
237+
aztec-nargo --version
238+
aztec-bb --version
239239
aztec --version
240240
REMOTE_EOF
241241
}

aztec-up/scripts/run_isolated_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ EOF
9898
echo "Version information:"
9999

100100
bash -i -c -e '
101-
forge --version
101+
aztec-forge --version
102102
echo
103-
nargo --version
103+
aztec-nargo --version
104104
echo
105105
echo -n "aztec version: "
106106
aztec --version

0 commit comments

Comments
 (0)