Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6b2d0c8
feat(fast-inbox): message-bundle components in rollup-lib (A-1372)
spalladino Jul 28, 2026
c3cb239
feat(fast-inbox): introduce inboxRollingHash end to end, dual with in…
spalladino Jul 28, 2026
fbc1e32
feat(fast-inbox): per-block L1-to-L2 message bundles, move parity to …
spalladino Jul 28, 2026
d042fd3
feat(fast-inbox): add block_root_msgs_only_rollup circuit for no-tx b…
spalladino Jul 28, 2026
6ae3afd
feat(fast-inbox): single variable-size InboxParity proof per checkpoi…
spalladino Jul 28, 2026
41bc4ab
feat(fast-inbox): same-block L1-to-L2 message consumption for non-fir…
spalladino Jul 28, 2026
fe8d9b1
feat(fast-inbox): rolling-hash buckets in the Inbox alongside frontie…
spalladino Jul 28, 2026
4a406e6
feat(fast-inbox): streaming inbox propose validation, unwired (A-1378)
spalladino Jul 28, 2026
b14453c
feat(fast-inbox): archiver syncs Inbox buckets (A-1379)
spalladino Jul 28, 2026
43890a4
feat(fast-inbox): world-state per-block message insertion (A-1380)
spalladino Jul 28, 2026
b65cffe
feat(fast-inbox): block proposals carry a bucket reference (A-1381)
spalladino Jul 28, 2026
f1ec994
feat(fast-inbox): sequencer streaming message selection, flag off (A-…
spalladino Jul 28, 2026
60ce1eb
feat(fast-inbox): validator streaming acceptance conditions, flag off…
spalladino Jul 28, 2026
3195169
feat(fast-inbox): flip consensus to streaming inbox (A-1384)
spalladino Jul 28, 2026
3b2f02a
test(fast-inbox): streaming inbox e2e latency and mid-checkpoint incl…
spalladino Jul 28, 2026
be17101
chore(fast-inbox): delete legacy L1 inbox path (A-1386)
spalladino Jul 28, 2026
48cbd2b
chore(fast-inbox): circuits cleanup and checkpoint header format (A-1…
spalladino Jul 28, 2026
7b83121
chore(fast-inbox): delete legacy node message paths (A-1388)
spalladino Jul 28, 2026
6ea21be
chore(fast-inbox): emit inbox lag and checkpoint cap from the constan…
spalladino Jul 28, 2026
7f45fac
chore(fast-inbox): single canonical path for rollup sample-input rege…
spalladino Jul 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 23 additions & 22 deletions barretenberg/.claude/skills/gate-counts/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,41 +209,42 @@ Then retry `bb gates`.
The committed `Prover.toml` files carry fake recursive proofs whose length is
frozen at the value present when they were last generated. After a proof-length
change they must be regenerated (or hacked — see below). Two commands cover all
protocol circuits:
protocol circuits, split by whether the sample needs a real client-proved
transaction.

**Kernel circuits + most rollup circuits** (spins up an L1/anvil sandbox):
**Block-root and above rollup circuits — prover-client suite** (simulated
orchestrator, no L1 sandbox):

```bash
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 \
yarn workspace @aztec/end-to-end test:e2e e2e_prover/full.test
AZTEC_GENERATE_TEST_DATA=1 \
yarn workspace @aztec/prover-client test regenerate_rollup_sample_inputs
```

Regenerates `Prover.toml` for: `private-kernel-init` and its `private-kernel-init-N`
variants, `private-kernel-inner` and its `private-kernel-inner-N` variants,
`private-kernel-reset`, `private-kernel-reset-tail`,
`private-kernel-reset-tail-to-public`, `rollup-tx-base-private`,
`rollup-tx-base-public`, `rollup-block-root-first`,
`rollup-block-root-first-single-tx`, `rollup-checkpoint-root-single-block`,
`rollup-checkpoint-merge`, `rollup-root`.
Regenerates `Prover.toml` for `rollup-block-root-first-empty-tx`,
`rollup-block-root-first`, `rollup-block-root-first-single-tx`,
`rollup-block-root`, `rollup-block-root-single-tx`, `rollup-block-root-msgs-only`,
`rollup-block-merge`, `rollup-checkpoint-root`, `rollup-checkpoint-root-single-block`,
`rollup-checkpoint-merge`, `rollup-tx-merge`, `rollup-root`.

**Rollup circuits NOT covered by `full.test`** (incl. `rollup-tx-merge`):
**Private-kernel + transaction-base circuits — e2e prover full test** (spins up
an L1/anvil sandbox):

```bash
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 \
yarn workspace @aztec/prover-client test src/orchestrator/orchestrator_single_checkpoint.test.ts
yarn workspace @aztec/end-to-end test:e2e single-node/prover/server/full.test
```

Regenerates `Prover.toml` for `rollup-tx-merge`, `rollup-block-root-first-empty-tx`,
`rollup-block-root` (single-tx checkpoint test) and `rollup-block-root-single-tx`,
`rollup-block-merge`, `rollup-checkpoint-root` (multi-block checkpoint test).

> **`rollup-tx-merge`'s `Prover.toml` is regenerated by the prover-client
> command, NOT `full.test`** — it is commented out in `full.test`'s circuit
> list. Use the prover-client command for the tx-merge circuit.
Regenerates `Prover.toml` for: `private-kernel-init` and its `private-kernel-init-N`
variants, `private-kernel-inner` and its `private-kernel-inner-N` variants,
`private-kernel-reset-tail`, `private-kernel-reset-tail-to-public`,
`rollup-tx-base-private`, `rollup-tx-base-public`. These need real client-proved
transactions the simulated orchestrator cannot produce. (`private-kernel-reset`,
the inner reset, is commented out and hand-maintained — not regenerated.)

The circuit lists live in the `updateProtocolCircuitSampleInputs(...)` loops in
`yarn-project/end-to-end/src/e2e_prover/full.test.ts` and
`yarn-project/prover-client/src/orchestrator/orchestrator_single_checkpoint.test.ts`;
`yarn-project/end-to-end/src/single-node/prover/server/full.test.ts` and the
`scenarios` array in
`yarn-project/prover-client/src/test/regenerate_rollup_sample_inputs.test.ts`;
re-read them if a circuit seems missing (entries get commented in/out).

### Build prerequisites for regeneration
Expand Down
37 changes: 19 additions & 18 deletions barretenberg/.claude/skills/update-prover-toml/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: update-prover-toml
description: Regenerate the protocol-circuit sample Prover.toml files (the witnesses CI feeds to `nargo execute`). Covers which e2e test/commands regenerate which tomls, and the one exception — private-kernel-reset/Prover.toml (the inner reset) which is NOT generated by the test at all and is maintained entirely by hand. Use when a `nargo execute` CI check fails on a crates/*/Prover.toml, after changing protocol-circuit inputs/constants, or when asked to refresh/regenerate Prover.toml sample inputs.
description: Regenerate the protocol-circuit sample Prover.toml files (the witnesses CI feeds to `nargo execute`). Covers which of the two commands regenerates which tomls — the prover-client `regenerate_rollup_sample_inputs` suite for the block-root and above rollup circuits, and the e2e prover full test for the private-kernel and transaction-base circuits — and the one exception, private-kernel-reset/Prover.toml (the inner reset), which is NOT generated by the test at all and is maintained entirely by hand. Use when a `nargo execute` CI check fails on a crates/*/Prover.toml, after changing protocol-circuit inputs/constants, or when asked to refresh/regenerate Prover.toml sample inputs.
---

# Updating protocol-circuit Prover.toml files
Expand All @@ -21,39 +21,40 @@ The tomls are captured from a real end-to-end run, not written by hand (except t

## How regeneration works

`yarn-project/end-to-end/src/e2e_prover/full.test.ts` has a test "generates sample Prover.toml files if generate test data is on". During proving, circuit inputs are captured via `pushTestData`/`getTestData`; the test then calls `updateProtocolCircuitSampleInputs(circuitName, TOML.stringify(...))` (`yarn-project/foundation/src/testing/files/index.ts`), which writes `noir-projects/fnd/noir-protocol-circuits/crates/<circuitName>/Prover.toml`.
Two commands cover the protocol-circuit tomls, split by whether the sample needs a real client-proved transaction. Both capture circuit inputs during proving via `pushTestData`/`getTestData` and write them with `updateProtocolCircuitSampleInputs(circuitName, TOML.stringify(...))` (`yarn-project/foundation/src/testing/files/index.ts`), which writes `noir-projects/fnd/noir-protocol-circuits/crates/<circuitName>/Prover.toml`.

The test early-returns unless **both** are true: `AZTEC_GENERATE_TEST_DATA=1` (enables `isGenerateTestDataEnabled()`) and fake proofs (`FAKE_PROOFS=1`, i.e. `REAL_PROOFS` is false).
### Block-root and above rollup circuits — prover-client suite

### Command

From the repo root:
`yarn-project/prover-client/src/test/regenerate_rollup_sample_inputs.test.ts` drives representative epochs through the simulated orchestrator and dumps each rollup circuit's captured input. The whole suite is `describe.skip`ped unless `AZTEC_GENERATE_TEST_DATA=1`, and it needs no L1 sandbox.

```bash
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn-project/end-to-end/scripts/run_test.sh simple e2e_prover/full
AZTEC_GENERATE_TEST_DATA=1 yarn workspace @aztec/prover-client test regenerate_rollup_sample_inputs
```

(Equivalently, from `yarn-project/end-to-end`: `AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn test:e2e e2e_prover/full.test`.) This is a full-stack run (L1 anvil + node + prover), ~15 min with fake proofs.
Regenerates: `rollup-block-root-first-empty-tx`, `rollup-block-root-first`, `rollup-block-root-first-single-tx`, `rollup-block-root`, `rollup-block-root-single-tx`, `rollup-block-root-msgs-only`, `rollup-block-merge`, `rollup-checkpoint-root`, `rollup-checkpoint-root-single-block`, `rollup-checkpoint-merge`, `rollup-tx-merge`, `rollup-root`. The scenario list lives in the `scenarios` array in that test; each scenario's `dump` field names the tomls it owns.

After it finishes, review and stage the changed tomls with `git diff noir-projects/fnd/noir-protocol-circuits/crates/*/Prover.toml`.
### Private-kernel and transaction-base circuits — e2e prover full test

### Which tomls this regenerates
`full.test.ts` has a test "generates sample Prover.toml files if generate test data is on". It early-returns unless **both** `AZTEC_GENERATE_TEST_DATA=1` (enables `isGenerateTestDataEnabled()`) and fake proofs (`FAKE_PROOFS=1`, i.e. `REAL_PROOFS` is false) are set. These circuits need real client-proved transactions, which the simulated orchestrator suite above cannot produce.

The circuit list lives in the `forEach(circuitName => ...)` loop in `full.test.ts`. Currently active (regenerated by the run above):
From the repo root:

```bash
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn-project/end-to-end/scripts/run_test.sh simple single-node/prover/server/full
```

(Equivalently, from `yarn-project/end-to-end`: `AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn test:e2e single-node/prover/server/full.test`.) This is a full-stack run (L1 anvil + node + prover), ~15 min with fake proofs.

Regenerates:

- `private-kernel-init`, `private-kernel-init-2` … `private-kernel-init-5`
- `private-kernel-inner`, `private-kernel-inner-2` … `private-kernel-inner-5`
- `private-kernel-reset-tail`, `private-kernel-reset-tail-to-public` (the terminal resets — these run as part of every tx's tail)
- `rollup-tx-base-private`, `rollup-tx-base-public`
- `rollup-block-root-first`, `rollup-block-root-first-single-tx`
- `rollup-checkpoint-root-single-block`, `rollup-checkpoint-merge`
- `rollup-root`

`private-kernel-reset` (the **inner** reset) is deliberately **commented out** of this list and is **not** generated by the test — see the exception below.

Other entries commented out (e.g. `rollup-tx-merge`, `rollup-block-root`, `rollup-block-merge`, `rollup-checkpoint-root`) are also not produced by this flow; the inline comment points to the orchestrator single-checkpoint test for those.
The circuit list lives in the `forEach(circuitName => ...)` loop in `full.test.ts`. `private-kernel-reset` (the **inner** reset) is deliberately **commented out** of this list and is **not** generated by the test — see the exception below.

If you add a new circuit crate, add its name to that list so its toml gets generated.
After either run, review and stage the changed tomls with `git diff noir-projects/fnd/noir-protocol-circuits/crates/*/Prover.toml`. If you add a new circuit crate, add its name to the appropriate list so its toml gets generated.

## ⚠️ Exception: `private-kernel-reset/Prover.toml` (inner reset) is NOT generated — hand-maintain it

Expand Down
14 changes: 7 additions & 7 deletions barretenberg/cpp/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,21 @@ run the generation commands above.

Proof-length-affecting changes (e.g. `CHONK_PROOF_LENGTH` bumps from MegaFlavor entity additions) make the committed `Prover.toml` fixtures stale. `nargo execute --program-dir <crate>` then fails with `Type Array { length: N, typ: Field } is expected to have length N but value Vec(...)`.

Regenerate via the e2e prover full test with fake proofs:
Regeneration is split across two commands. The block-root, block-merge, checkpoint, tx-merge, and root rollup samples come from the prover-client suite, which drives the simulated orchestrator and needs no L1 sandbox:

```bash
cd yarn-project
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn workspace @aztec/end-to-end test e2e_prover/full.test
AZTEC_GENERATE_TEST_DATA=1 yarn workspace @aztec/prover-client test regenerate_rollup_sample_inputs
```

`FAKE_PROOFS=1` skips real proving — runs in ~2 min (orchestrator + witness generation only). Writes 12 `Prover.toml` files under `noir-projects/fnd/noir-protocol-circuits/crates/<circuit>/Prover.toml`.

For circuits not exercised by `full.test.ts` (`rollup-tx-merge`, `rollup-block-root`, `rollup-block-root-single-tx`, `rollup-block-merge`, `rollup-checkpoint-root`, `rollup-block-root-first-empty-tx`), additionally run:
The private-kernel samples and the transaction-base rollup samples (`rollup-tx-base-private`, `rollup-tx-base-public`) need real client-proved transactions, so they come from the e2e prover full test with fake proofs:

```bash
AZTEC_GENERATE_TEST_DATA=1 yarn workspace @aztec/prover-client test orchestrator_single_checkpoint
cd yarn-project
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn workspace @aztec/end-to-end test single-node/prover/server/full.test
```

`FAKE_PROOFS=1` skips real proving. Both write into `noir-projects/fnd/noir-protocol-circuits/crates/<circuit>/Prover.toml`.

Verify with `nargo execute --program-dir noir-projects/fnd/noir-protocol-circuits/crates/<crate>` for any previously-failing crate; should print `Circuit witness successfully solved`.

## Verification Keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,10 @@ These functions allow you to query the current state of the Inbox.

| Function | Returns | Description |
| -------------------------- | ----------------- | ------------------------------------------------ |
| `getRoot(uint256)` | `bytes32` | Returns the root of a message tree for a given checkpoint number. |
| `getState()` | `InboxState` | Returns the current inbox state (rolling hash, total messages inserted, in-progress checkpoint). |
| `getState()` | `InboxState` | Returns the current inbox state (rolling hash, total messages inserted). |
| `getTotalMessagesInserted()` | `uint64` | Returns the total number of messages inserted into the inbox. |
| `getInProgress()` | `uint64` | Returns the checkpoint number currently being filled. |
| `getFeeAssetPortal()` | `address` | Returns the address of the Fee Juice portal. |

## Internal functions

:::note
The following functions are only callable by the Rollup contract and are documented here for completeness.
:::

### `consume()`

Consumes a message tree for a given checkpoint number.

#include_code consume l1-contracts/src/core/interfaces/messagebridge/IInbox.sol solidity

| Name | Type | Description |
| ----------- | --------- | ---------------------------------------- |
| _toConsume | `uint256` | The checkpoint number to consume. |
| ReturnValue | `bytes32` | The root of the consumed message tree. |

#### Edge cases

- Will revert with `Inbox__Unauthorized()` if `msg.sender != ROLLUP`.
- Will revert with `Inbox__MustBuildBeforeConsume()` if trying to consume a checkpoint that hasn't been built yet.

## Related pages

- [Outbox](./outbox.md) - L2 to L1 message passing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ sequenceDiagram
Portal->>Aave: withdraw(aTokenAmount)
Aave-->>Portal: underlying + yield
Portal->>Inbox: sendL2Message(content)
Note over Inbox: Wait for 2 L2 blocks (required for L1→L2 message availability)
Note over Inbox: Wait for an L2 block to include the message (12-30s)
User->>Bridge: claim_public(amount_with_yield)
Bridge->>Inbox: consume_l1_to_l2_message
Bridge->>Token: mint_to_public(user, amount_with_yield)
Expand Down Expand Up @@ -441,7 +441,7 @@ Extract the message leaf index:

#include_code get_claim_leaf_index /docs/examples/ts/aave_bridge/index.ts typescript

On the local network, L2 blocks are only produced when transactions are submitted. L1-to-L2 messages require 2 L2 blocks before they can be consumed on L2. This utility deploys two dummy contracts (with random salts for unique addresses) to force block production. On devnet or testnet, blocks are produced continuously and this step is unnecessary:
On the local network, L2 blocks are only produced when transactions are submitted. An L1-to-L2 message can only be consumed once an L2 block includes it, and the network waits until the message is at least 12 seconds old before including it. This utility deploys two dummy contracts (with random salts for unique addresses) to force block production. On devnet or testnet, blocks are produced continuously and this step is unnecessary:

#include_code mine_blocks /docs/examples/ts/aave_bridge/index.ts typescript

Expand Down Expand Up @@ -501,7 +501,7 @@ If `claim_public` reverts, ensure you called `set_minter(l2Bridge.address, true)

### L1→L2 message not found — claim reverts after mining blocks

L1-to-L2 messages need 2 L2 blocks after the L1 transaction before they become consumable. Make sure `mine2Blocks` runs before the claim. If the issue persists, verify the `messageLeafIndex` extracted from the `MessageSent` event is correct.
An L1-to-L2 message becomes consumable once an L2 block includes it, which takes 12 to 30 seconds after the L1 transaction. Make sure `mine2Blocks` runs before the claim. If the issue persists, verify the `messageLeafIndex` extracted from the `MessageSent` event is correct.

## Next Steps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,15 @@ To bridge, first approve the portal address to transfer the NFT, then transfer i

#include_code deposit_to_aztec /docs/examples/ts/token_bridge/index.ts typescript

The `Inbox` contract will emit an important log: `MessageSent(inProgress, index, leaf, updatedRollingHash);`. This log provides the **leaf index** of the message in the [L1-L2 Message Tree](../../foundational-topics/ethereum-aztec-messaging/index.md)—the location of the message in the tree that will appear on L2. You need this index, plus the secret, to correctly claim and decrypt the message.
The `Inbox` contract will emit an important log: `MessageSent(index, hash, inboxRollingHash, bucketSeq);`. Its first field is the **leaf index** of the message in the [L1-L2 Message Tree](../../foundational-topics/ethereum-aztec-messaging/index.md)—the location of the message in the tree that will appear on L2. You need this index, plus the secret, to correctly claim and decrypt the message.

Use viem to extract this information:

#include_code get_message_leaf_index /docs/examples/ts/token_bridge/index.ts typescript

This extracts the logs from the deposit and retrieves the leaf index. You can now claim it on L2. However, for security reasons, at least 2 blocks must pass before a message can be claimed on L2. If you called `claim` on the L2 contract immediately, it would return "no message available".
This extracts the logs from the deposit and retrieves the leaf index. You can now claim it on L2. However, a message can only be claimed once an L2 block includes it, and the network waits until the message is at least 12 seconds old before including it, so expect 12 to 30 seconds of latency. If you called `claim` on the L2 contract immediately, it would return "no message available".

Add a utility function to mine two blocks (it deploys a contract with a random salt):
On a local network blocks are only produced when transactions are submitted, so add a utility function that forces a couple of blocks (it deploys a contract with a random salt):

#include_code mine_blocks /docs/examples/ts/token_bridge/index.ts typescript

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ Bridge WETH from L1 to L2:
When depositing from L1 to L2, we use a secret/secret-hash pattern: generate a random secret on the client, send only the hash to L1 (in the deposit transaction), then later reveal the secret on L2 to claim the tokens. This prevents **front-running attacks**: a malicious sequencer (the node that orders and processes L2 transactions) cannot observe the L1 deposit and claim the tokens themselves because they don't know the secret. Only someone who knows the preimage can claim.
:::

Before claiming, we need to mine 2 L2 blocks. L1-to-L2 messages are not available in the same block they are sent -- the rollup must first include them in an L2 block, and then one more block must pass before the message can be consumed. We use a helper that deploys throwaway contracts to force these blocks:
Before claiming, we need to mine a couple of L2 blocks. An L1-to-L2 message is not available the moment it is sent -- the rollup only includes it in an L2 block once it is at least 12 seconds old, and it becomes consumable as soon as that block lands. We use a helper that deploys throwaway contracts to force these blocks:

#include_code mine_blocks /docs/examples/ts/example_swap/index.ts typescript

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export AZTEC_EPOCH_DURATION=16
export AZTEC_TARGET_COMMITTEE_SIZE=48
export AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET=2
export AZTEC_LAG_IN_EPOCHS_FOR_RANDAO=2
export AZTEC_INBOX_LAG=2
export AZTEC_PROOF_SUBMISSION_EPOCHS=2
export AZTEC_LOCAL_EJECTION_THRESHOLD=0
export AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS=1
Expand Down
Loading
Loading