Skip to content

chore: Accumulated backports to v4-next#22205

Merged
AztecBot merged 19 commits into
v4-nextfrom
backport-to-v4-next-staging
Apr 1, 2026
Merged

chore: Accumulated backports to v4-next#22205
AztecBot merged 19 commits into
v4-nextfrom
backport-to-v4-next-staging

Conversation

@AztecBot

@AztecBot AztecBot commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

BEGIN_COMMIT_OVERRIDE
cherry-pick: feat: move event size check from declaration to private emission (#22168)
fix: prevent oracle failure on tag computation for invalid recipient (#22163)
feat: move event size check from declaration to private emission (#22168) [v4-next backport] (#22182)
fix(cli-wallet): peek claim stack instead of popping for estimate-gas-only (#22196)
fix: use Fr.fromString for CLI wallet claim params to handle decimal values (#22197)
fix: indefinite retry for prover node and agent broker communication (#22202)
END_COMMIT_OVERRIDE

Thunkar added 2 commits April 1, 2026 07:56
) [v4-next backport] (#22182)

## Summary

Backport of #22168
to v4-next.

The `#[event]` macro previously enforced MAX_EVENT_SERIALIZED_LEN at
declaration time, blocking valid use cases like large public-only
events. The size constraint only applies to private emission (due to
encryption overhead), so the check now lives in
`encode_private_event_message` instead. Adds a test contract and e2e
test proving large events work when emitted publicly.

## Conflict Resolution

The `invalid_event` comp-failure contract had a conflict because on
v4-next the `InvalidEvent` struct is defined inline (with a custom
`Serialize` impl) rather than in a separate module. Resolution kept the
inline definition while updating the function body to use the new
`self.emit().deliver_to()` pattern instead of `get_event_type_id()`.

## Changes
- Removed event size static assertion from `#[event]` macro's
`get_event_type_id()`
- Added size check to `encode_private_event_message` (only enforced for
private emission)
- Updated `invalid_event` comp-failure contract to emit privately
instead of calling `get_event_type_id()`
- Added `large_public_event_contract` test contract
- Added e2e test for large public events

ClaudeBox log: https://claudebox.work/s/e313e5935f72366d?run=1
…-only (#22196)

## Summary

When running any CLI wallet command with `--estimate-gas-only` and a
saved fee juice claim (`--payment method=fee_juice,claim=true`), the
wallet would pop the claim off the stack, consuming it. This meant the
claim was no longer available for the actual transaction.

This PR adds a `peekBridgedFeeJuice` method to `WalletDB` that reads the
top of the claim stack without removing it, and uses it when
`estimateOnly` is true.

## Changes

- Added `peekBridgedFeeJuice()` to `WalletDB` — reads top-of-stack
without decrementing the pointer
- Threaded `estimateOnly` flag through to `parsePaymentMethod()` to
select peek vs pop

## Test plan

- Run `deploy-account --estimate-gas-only --payment
method=fee_juice,claim=true` — claim should still be available after
- Run `deploy-account --payment method=fee_juice,claim=true` — claim
should be consumed as before

ClaudeBox log: https://claudebox.work/s/16b824b54402040d?run=1
…values (#22197)

## Summary

Fixes incorrect parsing of `--payment` claim parameters in the CLI
wallet when using the explicit long form:
```
--payment method=fee_juice,claimAmount=123,claimSecret=0xabc,messageLeafIndex=42
```

**Bug**: `Fr.fromHexString()` was used to parse `claimAmount`, which
interprets bare numeric strings as hex. When a user copy-pastes the
output of `bridge-fee-juice` (which prints `claimAmount` as a decimal
bigint like `1000000000000000000`), it would be silently misinterpreted
as a hex value, resulting in a completely wrong claim amount.

**Fix**: Switch to `Fr.fromString()` which correctly auto-detects
decimal vs hex (0x-prefixed) input. Also adds a type guard for
`claimSecret` to handle both the DB path (which returns a string) and
the direct CLI path uniformly.

## Changes

- `Fr.fromHexString(claimAmount)` → `Fr.fromString(claimAmount)` —
handles decimal amounts correctly
- `Fr.fromHexString(claimSecret)` → `Fr.fromString(claimSecret)` with
type guard — consistent handling for both DB and CLI paths

## Test plan

- Verify `deploy-account --payment
method=fee_juice,claimAmount=1000000000000000000,claimSecret=0xabc...,messageLeafIndex=42`
correctly parses the decimal amount
- Verify `deploy-account --payment method=fee_juice,claim` (DB-backed
short form) still works unchanged
- Verify hex-prefixed values like `claimAmount=0x1234` still work
correctly

ClaudeBox log: https://claudebox.work/s/7737b856f8012542?run=2
…22202)

## Summary

Changes the HTTP-level retry mechanism for prover node and agent
communication with the prover broker from limited retries to indefinite
backoff:

- **Prover node → broker** (`start_node.ts`): Changed from finite retry
array `[1, 2, 3, 3, ...]` (~30s) to indefinite backoff `[1, 1, 1, 2, 4,
4, 4, ...]`
- **Prover agent → broker** (`start_prover_agent.ts`): Same change
- **Default broker RPC clients** (`rpc.ts`): Updated defaults to use the
new `proverBrokerBackoff` generator
- **`makeTracedFetch`** (`fetch.ts`): Now accepts either a `number[]`
for finite backoff or a `() => Generator<number>` factory for indefinite
backoff

The rationale is that the epoch proving has its own timeout — when it
expires, the chain reorgs and jobs can be safely cancelled. There's no
reason for the HTTP communication layer to give up before that happens.

## Test plan

- [x] All 98 proving broker tests pass
- [x] Build succeeds
- [ ] Verify in spartan that prover node and agent reconnect to broker
after transient failures"
AztecBot and others added 9 commits April 1, 2026 13:57
Cherry-pick of 636853e from PR #22192.
Contains modify/delete conflicts on versioned docs files.
Remove versioned docs files (version-v4.2.0-aztecnr-rc.2) that don't exist on v4-next.
Only the docs-developers/ source files and docs/examples/ts/ changes apply.
…t (with conflicts)

Cherry-pick of 06a09f0 from PR #22166.
All conflicts are modify/delete in versioned docs directory that was removed on v4-next.
The versioned docs directory version-v4.2.0-aztecnr-rc.2 does not exist on v4-next.
Accept the deletion — only the docs-developers/ source files are relevant on this branch.
Docs-only change — no compilation or build fixes required for v4-next.
…to v4-next) (#22225)

## Summary

Backport of #22195
to v4-next.

Fixes several issues in the Private Token Contract tutorial:
- Add missing `@aztec/wallets` package to the `yarn add` command
- Use `aztec new` instead of `aztec init`
- Fix `Nargo.toml` path references
- Clarify `balance_set` dependency instruction
- Improve `tsx` tip

## Conflict resolution

The versioned docs file
(`docs/developer_versioned_docs/version-v4.2.0-aztecnr-rc.2/.../token_contract.md`)
was deleted on v4-next but modified by the PR. Resolution: accepted the
deletion since the versioned docs don't exist on this branch. The main
docs file (`docs/docs-developers/.../token_contract.md`) applied
cleanly.

ClaudeBox log: https://claudebox.work/s/e987e6392893261f?run=1
…22192) (#22226)

## Summary
Backport of #22192
to v4-next.

- Fix code examples across aztec-js how-to guides to use correct API
patterns
- Replace hardcoded inline code blocks with `#include_code` macros
pointing to TypeScript example files
- Fix inaccurate field names in `GasSettings` and correct transaction
status enum values

## Conflict Resolution
The cherry-pick had modify/delete conflicts on 5 files in
`docs/developer_versioned_docs/version-v4.2.0-aztecnr-rc.2/` which don't
exist on v4-next. These were removed. The remaining 8 files
(`docs-developers/` source docs and `docs/examples/ts/` TypeScript
examples) applied cleanly.

## Commits
1. Cherry-pick with conflicts recorded
2. Conflict resolution — remove versioned docs not present on v4-next

ClaudeBox log: https://claudebox.work/s/9d87ae50e4432456?run=1
@critesjosh critesjosh requested a review from a team as a code owner April 1, 2026 14:17
…22166) (#22227)

## Summary

Backport of #22166
to v4-next.

Fixes 52 documentation issues across aztec-nr doc pages (deprecated
import paths, missing API parameters, incorrect method names, wrong
dependency URLs, etc.).

## Conflict resolution

All 20 conflicts were modify/delete in
`docs/developer_versioned_docs/version-v4.2.0-aztecnr-rc.2/` — this
versioned docs directory does not exist on v4-next, so the deletions
were accepted. The 18 `docs-developers/` source files merged cleanly.

## Commits

1. Cherry-pick with conflicts (original attempt)
2. Conflict resolution (remove versioned docs that don't exist on
v4-next)
3. No build fixes needed (docs-only change)

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

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Auto-approved

@AztecBot AztecBot merged commit 2821640 into v4-next Apr 1, 2026
9 checks passed
@AztecBot

AztecBot commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 8 hours of inactivity. This PR will be merged automatically once all checks pass.

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.

5 participants