Skip to content

fix: backport v4 next staging#21934

Merged
Thunkar merged 17 commits into
backport-to-v4-next-stagingfrom
grego/fix-backport-v4-next-staging
Mar 24, 2026
Merged

fix: backport v4 next staging#21934
Thunkar merged 17 commits into
backport-to-v4-next-stagingfrom
grego/fix-backport-v4-next-staging

Conversation

@Thunkar

@Thunkar Thunkar commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

Trying to get us out of the backport issues

benesjan and others added 17 commits March 17, 2026 12:26
## Summary

Merges v4 into v4-next, resolving the conflict in
`getBlockHashMembershipWitness` in `server.ts`.

The conflict was between v4-next's simple passthrough to
`getWorldState(referenceBlock)` and v4's off-by-one bugfix that uses
`getWorldState(BlockNumber(referenceBlockNumber - 1))`. The v4 fix is
correct: the Noir circuit checks the archive membership proof against
`anchor_block_header.last_archive.root`, which is the archive tree root
BEFORE the anchor block was added, so we need the world state at block
N-1.

Resolution: took the v4 bugfix, adapted to use v4-next's `getWorldState`
(protected) instead of v4's `#getWorldState` (private).

Replaces #21493
which had stale conflict markers.

ClaudeBox log: https://claudebox.work/s/d4b96d5b355d7fba?run=1

Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
Co-authored-by: Phil Windle <philip.windle@gmail.com>
Co-authored-by: Santiago Palladino <santiago@aztecprotocol.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
## Summary

Merges latest `v4` (`bb3ea6f1`) into `v4-next` with a proper **merge
commit** to preserve the merge topology. This fixes the issue where PR
#21702 was squash-merged, causing git to lose track of which v4 commits
were already in v4-next.

## Commits

1. **Merge commit with conflict markers** — raw `git merge origin/v4`
showing the conflicts
2. **Fix server.ts** — resolve `getWorldState` vs `#getWorldState`
conflict (use protected version), remove duplicate `resolveBlockNumber`
method
3. **Fix deploy_network.sh** — resolve pre-existing conflict from old
merge (keep default multiplier of 2)

## Important

**This PR must be merged with a merge commit (not squashed)** to
preserve the v4→v4-next merge topology. Add the `ci-no-squash` label.
Without the merge commit, future auto-merges will re-encounter the same
conflicts.

ClaudeBox log: https://claudebox.work/s/3402fef75fe1ebde?run=4

---------

Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
Co-authored-by: Phil Windle <philip.windle@gmail.com>
Co-authored-by: Santiago Palladino <santiago@aztecprotocol.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
Co-authored-by: spypsy <spypsy@users.noreply.github.com>
## Summary
- Bump `.release-please-manifest.json` from `4.1.0` to `4.2.0` in
preparation for the next release cycle.
BEGIN_COMMIT_OVERRIDE
feat: entrypoint replay protection (#21649)
feat: guard BoundedVec oracle returns against dirty trailing storage
(#21589)
fix: add bounds when allocating arrays in deserialization (#21622)
feat: implement manual Packable for structs with sub-Field members
(#21576)
fix(aztec-node): throw on existing nullifier in
getLowNullifierMembershipWitness (#21472)
fix: use trait dispatch for array Packable::unpack in card_game_contract
(#21683)
fix(p2p): penalize peers for errors during response reading (#21680)
fix: update nullifier non-inclusion test expectations after early oracle
throw (backport #21600) (#21615)
fix(aztec-nr): fix OOB index with nonzero offset (#21613)
fix(builder): persist contractsDB across blocks within a checkpoint
(#21520)
fix(stdlib): accept null return_type for void Noir functions (#21647)
feat: gas estimations on send (#21646)
fix(validator): process block proposals from own validator keys in HA
setups (backport #21603) (#21659)
fix(p2p): penalize peer on tx rejected by pool (#21677)
fix(sequencer): fix checkpoint budget redistribution for multi-block
slots (#21692)
feat: sync cache invalidation oracle (backport #21459) (#21730)
feat!: make AES128 decrypt oracle return Option (backport #21696)
(#21735)
feat!: include init_hash in private initialization nullifier (backport
#21427) (#21736)
fix(sequencer): extract gas and blob configs from valid requests only
(A-677) (#21747)
chore: backport #21744 — replace dead BOOTSTRAP_TO env var with
bootstrap.sh build arg (#21748)
refactor: revert remove assert_bounded_vec_trimmed (#21758)
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
chore: backport #21754 (feat!: make isContractInitialized a tri-state
enum) to v4-next (#21792)
fix(stdlib): zero-pad bufferFromFields when declared length exceeds
payload (#21802)
test(protocol-contracts): verify max-size bytecode fits in contract
class log (#21818)
chore: port P2P mesh topic deflake fix to v4-next (#21825)
fix(archiver): throw on duplicate contract class or instance additions
(#21799)
feat: sync poseidon in the browser (#21833)
chore: backport #21824 (fix(aztec-up): add sensible defaults to
installer y/n prompts) to v4-next (#21844)
fix(sequencer): backport wall-clock time for slot estimation to v4-next
(#21769) (#21847)
chore: backport PR #21788 (feat(p2p): add tx validation for contract
class id verification) to v4-next (#21852)
feat: sync poseidon browser (#21851)
END_COMMIT_OVERRIDE
…ode detection (#21719)

Fix A-700

## Summary
- Reworks `testSources()` to detect supernodes by probing the blob
sidecar endpoint
- Keeps individual per-source validation logs (info for reachable, error
for failures)
- Emits a consolidated summary after all sources are validated:
`Blob client running with consensusSuperNodes=N archiveSources=N
blobSinks=N. M consensus client(s) ignored because they are not running
in supernode or semi-supernode mode`
- Warns if no consensus supernodes are reachable; throws if no sources
at all (unless `blobAllowEmptySources`)

## How supernode detection works
Post-Fusaka (PeerDAS), non-supernode beacon nodes no longer serve the
blob sidecar endpoint. Each consensus host is tested by:
1. Fetching `/eth/v1/beacon/headers/head` to verify reachability and get
the head slot
2. Fetching `/eth/v1/beacon/blobs/{headSlot}` to check blob sidecar
support
3. A 200 response (even with an empty data array for a slot with no
blobs) means the node serves blob sidecars (supernode/semi-supernode)
4. A non-200 response means the node does not serve blob sidecars

## Log level logic
- `info` — at least one consensus supernode available
- `warn` — no consensus supernodes (but other sources like
archive/filestore may exist)
- `throw` — no sources at all (unless `blobAllowEmptySources`)
I made the param be optional in the fn since it has other unrelated
callsites (e.g. the CLI). I also merged both node roundtrips into a
single one.
This should prevent issues were users accidentally make queries in the
future. Not sure if we should add a dedicated error message with docs
link etc.
## Summary
- Backports the newer documentation infrastructure from `next` onto
`v4-next` so the v4 docs build, versioning, redirects, and generated
references follow the same pipeline.
- Replaces stale developer snapshots with a new `v4.1.0-rc.2` testnet
docs snapshot and updates the docs app/config/scripts to treat testnet
as a first-class version alongside devnet/nightly.
- Adds automated execution coverage for TypeScript documentation
examples in CI, including the recursive verification flow and Docker
Compose-based local-network orchestration.
- Refreshes a broad set of v4 docs content and regenerates the
associated versioned docs and static API reference artifacts.

## What Changed

### Versioning and docs infrastructure
- Updates `developer_versions.json`, `docusaurus.config.js`,
preprocessing macros, and related scripts so developer docs can serve
`v4.1.0-rc.2` as the root testnet version while still supporting stable
`devnet`, `nightly`, and `testnet` API reference folders.
- Removes outdated developer snapshots that no longer match the
supported v4 docs set.
- Extends Aztec.nr and TypeScript API generation/validation scripts, LLM
appendix generation, and Netlify preview setup to understand testnet
outputs.

### Docs examples pipeline
- Splits vanilla circuit compilation from contract compilation in
`docs/examples/bootstrap.sh` so shared docs workspaces do not get
treated as contract artifacts.
- Adds a Docker Compose-driven execution path for TS docs examples via
`docs/examples/ts/docker-compose.yml` and
`docs/examples/ts/aztecjs_runner/run.sh`.
- Introduces shared dependency parsing for TS example validation and
support for per-example setup hooks (used by `recursive_verification`
proof-data generation).
- Updates affected examples to use `AZTEC_NODE_URL`, ephemeral embedded
wallets where appropriate, and L1 fee-juice bridging in the connection
example.

### Docs content and redirects
- Adds Aztec.nr standards docs for AIP-20, AIP-721, AIP-4626, escrow,
dripper, and generic proxy patterns.
- Refreshes developer/operator/participation docs including AI tooling,
migration notes, delegation, networks, staking, and multiple
tutorials/reference pages.
- Updates Netlify redirects to match renamed/reorganized v4 docs pages
and CLI reference locations.

### Generated artifacts
- Regenerates `docs/developer_versioned_docs/version-v4.1.0-rc.2/**`.
- Regenerates static Aztec.nr API docs under
`docs/static/aztec-nr-api/testnet/**`.
- Regenerates static TypeScript API docs under
`docs/static/typescript-api/testnet/**`.
- Regenerates CLI reference output and related versioned developer docs
snapshots.

## Reviewer Notes
- Most of the file-count churn in this PR is generated/versioned docs
output. The substantive hand-maintained changes are primarily in
`docs/examples/**`, `docs/scripts/**`, `docs/docusaurus.config.js`,
`docs/netlify.toml`, and the edited source docs under `docs/docs-*`.

## Test Plan
- `cd docs && yarn build`
- `cd docs && yarn test:preprocess`
- `cd docs && yarn validate:api-ref-links`
- CI coverage now includes docs example execution via
`docs/examples/bootstrap.sh execute` /
`docs/examples/ts/aztecjs_runner/run.sh`

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…for getBlockHashMembershipWitness) to v4-next (#21891)

Backport of #21836
to v4-next.

Cherry-pick of f8b6239 onto `backport-to-v4-next-staging` with
conflict resolution.

**Conflict:** `server.ts` had a conflict because v4-next doesn't have
the `resolveBlockNumber` method or the `N-1` world state lookup refactor
from `next`. Adapted the fix to check for block 0 using both
`BlockNumber.ZERO` and initial block hash comparison, keeping the
v4-next `getWorldState(referenceBlock)` pattern.

**Original PR description:** Explicitly handles the initial block (block
0) case in `getBlockHashMembershipWitness`. Block 0 has an empty
archive, so no membership witness can exist.

- `yarn-project/aztec-node/src/aztec-node/server.ts`: Early return
`undefined` when reference block is block 0 (by number or hash)
- `yarn-project/aztec-node/src/aztec-node/server.test.ts`: Added test
for the initial block case

1. Cherry-pick with conflict markers
2. Conflict resolution (adapted for v4-next)
3. Test comment adaptation

---------

Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
## Summary
- Adds documentation for the
[aztec-immutables-macro](https://github.com/defi-wonderland/aztec-immutables-macro/tree/dev)
library that encodes immutable values into the contract deployment salt,
eliminating initialization transactions
- Adds the page to both current developer docs and v4.1.0-rc.2 versioned
docs

## Test plan
- [ ] Verify page renders correctly with `yarn start` in docs/
- [ ] Confirm the page appears in the v4.1.0-rc.2 version dropdown under
Aztec.nr > Framework Description
- [ ] Verify external links to the macro repo are valid

🤖 Generated with [Claude Code](https://claude.com/claude-code)
… backport) (#21914)

## Summary

Backport of #21909 to `backport-to-v4-next-staging`.

- Pin `typescript@^5.3.3` in docs examples validation (was unpinned,
pulling TS 6.0 which breaks `@ts-expect-error` directives)
- Use git state instead of filesystem state for yarn.lock emptiness
check (prevents false positives on retry after interrupted parallel
runs)

## Context

See #21909 for full details. The same `docs/examples/ts/bootstrap.sh`
exists on this branch with the same two issues.

## Test plan

- [ ] CI passes on this PR


🤖 Generated with [Claude Code](https://claude.com/claude-code)
…erhead (#21770)

## Summary

- Moves kernel overhead explanation (gate counts per phase, design tips,
large-circuit reassurance) from the profiling how-to guide into
`foundational-topics/advanced/circuits/private_kernel.md` where it
belongs conceptually
- Slims the profiling guide to link there instead of duplicating content
- Updates cross-references in `writing_efficient_contracts.md` and
`transactions.md`
- Clarifies that a typical single-function transaction involves two
private calls (account entrypoint + user function), so
`private_kernel_inner` is correctly included in the cost breakdown

## Test plan

- [ ] Verify links resolve correctly in local dev server (`yarn start`
from docs/)
- [ ] Confirm `private_kernel.md#performance-impact` anchor works from
all linking pages

🤖 Generated with [Claude Code](https://claude.com/claude-code)
A few changes to the cli-wallet to make it easier to use for testing
deployed networks:
- adds an optional salt parameter to `create-account`. This is so I can
import a bot account which already has FJ
- adds a command to quickly check FJ balance
- all commands that send txs now take a `--wait-for-status
<checkpointed|proposed>` optional flag (default: proposed) to control
how long we wait for txs.
@Thunkar Thunkar self-assigned this Mar 24, 2026
@Thunkar Thunkar requested review from a team, charlielye and nventuro as code owners March 24, 2026 06:27

@critesjosh critesjosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs look good. thanks grego 💜

@Thunkar Thunkar merged commit 2d20a19 into backport-to-v4-next-staging Mar 24, 2026
9 checks passed
@Thunkar Thunkar deleted the grego/fix-backport-v4-next-staging branch March 24, 2026 14:06
@Thunkar Thunkar restored the grego/fix-backport-v4-next-staging branch March 24, 2026 14:21
AztecBot added a commit that referenced this pull request Mar 25, 2026
BEGIN_COMMIT_OVERRIDE
fix(aztec-up): narrow PATH cleanup regex to avoid removing user PATH
entries (#21828)
fix: consolidate blob source test into single summary log with supernode
detection (#21719)
fix: use anchor block on getL1ToL2MsgWitness (#21872)
fix: make sure queries are not made ahead of the anchor block (#21874)
chore(docs): backport docs infrastructure changes to v4 (#21437)
chore: backport PR #21836 (fix: explicitly handle initial block case for
getBlockHashMembershipWitness) to v4-next (#21891)
chore: backport PR #21813 (fix(aztec-up): strip leading v prefix from
version strings) to v4-next (#21912)
docs: document defi-wonderland immutable macro (#21764)
fix: pin typescript and harden lockfile check in docs examples CI (v4
backport) (#21914)
docs: expand circuit profiling guide and document kernel gate cost
overhead (#21770)
feat: cli-wallet (#21757)
chore: sync backport staging with v4-next HEAD (#21931)
fix: bot gas estimations (backport #21945) (#21947)
refactor(aztec-nr): use logging wrappers in
compute_note_hash_and_nullifier (#21897)
fix: backport v4 next staging (#21934)
fix: make PXE#getSyncedBlockHeader a concurrency=1 job to prevent IDB tx
liveness issues (#21944)
feat: add error page mapping for incompatible oracles (#21943)
fix(aztec-up): validate semver in uninstall to prevent path traversal
(#21892)
chore: merge v4-next into backport staging (fix ancestry) (#21954)
fix(aztec-up): add truncation protection to install scripts (#21896)
fix: noir format in compute_note_hash_and_nullifier.nr (#21956)
fix(stdlib): decode `EthAddress`, `FunctionSelector` and wrapped field
structs in `AbiDecoder` (#21926)
chore: update noir to nightly-2026-02-12-patch.1 (#21960)
fix: ensure empty docs examples does not populate yarn lock backport
(#21963)
fix: docs examples does not build on simple bootstrap backport (#21964)
fix: add rc/testnet version detection to API reference pages (#21966)
docs: document EmbeddedWallet automatic gas estimation and private
authwits (#21790)
fix(pxe): robust error handling in message processing (backport #21093)
(#21981)
chore: manually recreate backport (#21969)
chore: (A-779) load all accounts before calling
LogService.#getSecretsForSenders (#21923)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants