Skip to content

Commit 4e4b32c

Browse files
committed
chore(fast-inbox): cover the msgs-only block root in sample-input regen and fix stale regen command patterns (A-1435)
Post-flip a zero-tx non-first block carrying a message bundle is a live block shape routed through the msgs-only block root, so the regen suite gains a scenario with a per-block message distribution that dumps rollup-block-root-msgs-only, and the circuit joins the CI nargo-execute list. The first regen run creates crates/rollup-block-root-msgs-only/Prover.toml, which must be committed alongside the other regenerated tomls. Also fixes the documented e2e regen command: the prover full test lives at single-node/prover/server/full.test.ts, so the old e2e_prover/full.test jest pattern matches nothing.
1 parent 34166f7 commit 4e4b32c

6 files changed

Lines changed: 44 additions & 19 deletions

File tree

barretenberg/.claude/skills/gate-counts/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,16 @@ AZTEC_GENERATE_TEST_DATA=1 \
222222

223223
Regenerates `Prover.toml` for `rollup-block-root-first-empty-tx`,
224224
`rollup-block-root-first`, `rollup-block-root-first-single-tx`,
225-
`rollup-block-root`, `rollup-block-root-single-tx`, `rollup-block-merge`,
226-
`rollup-checkpoint-root`, `rollup-checkpoint-root-single-block`,
225+
`rollup-block-root`, `rollup-block-root-single-tx`, `rollup-block-root-msgs-only`,
226+
`rollup-block-merge`, `rollup-checkpoint-root`, `rollup-checkpoint-root-single-block`,
227227
`rollup-checkpoint-merge`, `rollup-tx-merge`, `rollup-root`.
228228

229229
**Private-kernel + transaction-base circuits — e2e prover full test** (spins up
230230
an L1/anvil sandbox):
231231

232232
```bash
233233
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 \
234-
yarn workspace @aztec/end-to-end test:e2e e2e_prover/full.test
234+
yarn workspace @aztec/end-to-end test:e2e single-node/prover/server/full.test
235235
```
236236

237237
Regenerates `Prover.toml` for: `private-kernel-init` and its `private-kernel-init-N`

barretenberg/.claude/skills/update-prover-toml/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Two commands cover the protocol-circuit tomls, split by whether the sample needs
3131
AZTEC_GENERATE_TEST_DATA=1 yarn workspace @aztec/prover-client test regenerate_rollup_sample_inputs
3232
```
3333

34-
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-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.
34+
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.
3535

3636
### Private-kernel and transaction-base circuits — e2e prover full test
3737

@@ -40,10 +40,10 @@ Regenerates: `rollup-block-root-first-empty-tx`, `rollup-block-root-first`, `rol
4040
From the repo root:
4141

4242
```bash
43-
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn-project/end-to-end/scripts/run_test.sh simple e2e_prover/full
43+
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn-project/end-to-end/scripts/run_test.sh simple single-node/prover/server/full
4444
```
4545

46-
(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.
46+
(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.
4747

4848
Regenerates:
4949

barretenberg/cpp/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ The private-kernel samples and the transaction-base rollup samples (`rollup-tx-b
146146

147147
```bash
148148
cd yarn-project
149-
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn workspace @aztec/end-to-end test e2e_prover/full.test
149+
AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn workspace @aztec/end-to-end test single-node/prover/server/full.test
150150
```
151151

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

noir-projects/noir-protocol-circuits/bootstrap.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ function test_cmds {
272272
rollup-block-root-first-empty-tx
273273
rollup-block-root
274274
rollup-block-root-single-tx
275+
rollup-block-root-msgs-only
275276
rollup-block-merge
276277
rollup-checkpoint-root
277278
rollup-checkpoint-root-single-block

yarn-project/foundation/src/testing/files/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function updateInlineTestData(targetFileFromRepoRoot: string, itemName: s
5454
* @remarks Requires AZTEC_GENERATE_TEST_DATA=1 to be set. The block-root, block-merge, checkpoint,
5555
* tx-merge, and root rollup samples are regenerated by the prover-client
5656
* `regenerate_rollup_sample_inputs.test.ts` suite; the private-kernel and transaction-base rollup
57-
* samples by the e2e 'AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn test:e2e e2e_prover/full.test' dump.
57+
* samples by the e2e 'AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn test:e2e single-node/prover/server/full.test' dump.
5858
*/
5959
export function updateProtocolCircuitSampleInputs(circuitName: string, value: string) {
6060
const logger = createConsoleLogger('aztec:testing:test_data');

yarn-project/prover-client/src/test/regenerate_rollup_sample_inputs.test.ts

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { MAX_L1_TO_L2_MSGS_PER_CHECKPOINT } from '@aztec/constants';
22
import { EpochNumber } from '@aztec/foundation/branded-types';
3-
import { timesAsync } from '@aztec/foundation/collection';
3+
import { times, timesAsync } from '@aztec/foundation/collection';
44
import { Fr } from '@aztec/foundation/curves/bn254';
55
import { EthAddress } from '@aztec/foundation/eth-address';
66
import { type Logger, createLogger } from '@aztec/foundation/log';
@@ -25,7 +25,7 @@ import { type CheckpointTopTreeData, TopTreeOrchestrator } from '../orchestrator
2525
// Without that flag the whole suite is skipped, so it is a no-op (no prover setup) in normal CI. The
2626
// `rollup-tx-base-private`/`rollup-tx-base-public` fixtures and the private-kernel fixtures depend on
2727
// real client-proved transactions the simulated orchestrator cannot produce, so those are regenerated
28-
// separately by the e2e `e2e_prover/full.test` dump instead.
28+
// separately by the e2e `single-node/prover/server/full.test` dump instead.
2929
//
3030
// The scenarios are chosen to exercise each block-root variant the orchestrator selects (see
3131
// BlockProvingState#getBlockRootRollupTypeAndInputs): a first block with 0 txs, with >=2 txs, and
@@ -36,7 +36,9 @@ import { type CheckpointTopTreeData, TopTreeOrchestrator } from '../orchestrator
3636
// checkpoint-root-single-block circuit and multi-block checkpoints the (two-input) checkpoint-root
3737
// circuit. A block with three txs merges its transaction base proofs through the tx-merge circuit
3838
// before the (two-input) block root, whereas one- or two-tx blocks feed the block root directly, so a
39-
// dedicated three-tx scenario is what regenerates the tx-merge sample. Every scenario also produces
39+
// dedicated three-tx scenario is what regenerates the tx-merge sample. A zero-tx non-first block that
40+
// carries a message bundle (a message-only block, AZIP-22 Fast Inbox) routes through the msgs-only
41+
// block root, so that variant needs a per-block message distribution. Every scenario also produces
4042
// the root rollup.
4143
const describeOrSkip = isGenerateTestDataEnabled() ? describe : describe.skip;
4244

@@ -47,8 +49,13 @@ describeOrSkip('prover/regenerate-rollup-sample-inputs', () => {
4749
interface Scenario {
4850
numCheckpoints: number;
4951
numBlocksPerCheckpoint: number;
50-
numTxsPerBlock: number;
52+
numTxsPerBlock: number | number[];
5153
numL1ToL2Messages: number;
54+
/**
55+
* Per-block message distribution. When set it overrides `numL1ToL2Messages`, and a zero-tx non-first block with
56+
* a non-empty slice routes through the msgs-only block root.
57+
*/
58+
l1ToL2MessagesPerBlock?: Fr[][];
5259
/** Circuits whose sample inputs this scenario is responsible for regenerating. */
5360
dump: CircuitName[];
5461
}
@@ -98,6 +105,16 @@ describeOrSkip('prover/regenerate-rollup-sample-inputs', () => {
98105
numL1ToL2Messages: withMessages,
99106
dump: ['rollup-tx-merge'],
100107
},
108+
// A zero-tx non-first block carrying a message bundle is a message-only block (AZIP-22 Fast
109+
// Inbox), the only shape that selects the msgs-only block root.
110+
{
111+
numCheckpoints: 1,
112+
numBlocksPerCheckpoint: 2,
113+
numTxsPerBlock: [1, 0],
114+
numL1ToL2Messages: 0, // Overridden by l1ToL2MessagesPerBlock.
115+
l1ToL2MessagesPerBlock: [times(2, i => new Fr(0x900 + i)), times(3, i => new Fr(0xa00 + i))],
116+
dump: ['rollup-block-root-msgs-only'],
117+
},
101118
// The checkpoint-merge only appears with three checkpoints. Independently-built checkpoints do
102119
// not carry the inbox message state forward, so this scenario runs with no L1-to-L2 messages and
103120
// a zero previous rolling hash, matching the multi-checkpoint case in top-tree-orchestrator.test.
@@ -121,13 +138,19 @@ describeOrSkip('prover/regenerate-rollup-sample-inputs', () => {
121138

122139
it.each(scenarios)(
123140
'regenerates $dump from an epoch with $numCheckpoints checkpoints, $numBlocksPerCheckpoint blocks, $numTxsPerBlock txs',
124-
async ({ numCheckpoints, numBlocksPerCheckpoint, numTxsPerBlock, numL1ToL2Messages, dump }) => {
141+
async ({
142+
numCheckpoints,
143+
numBlocksPerCheckpoint,
144+
numTxsPerBlock,
145+
numL1ToL2Messages,
146+
l1ToL2MessagesPerBlock,
147+
dump,
148+
}) => {
149+
const makeProcessedTxOpts = (_: unknown, txIndex: number) => ({ privateOnly: txIndex % 2 === 0 });
125150
const checkpoints = await timesAsync(numCheckpoints, () =>
126-
context.makeCheckpoint(numBlocksPerCheckpoint, {
127-
numTxsPerBlock,
128-
numL1ToL2Messages,
129-
makeProcessedTxOpts: (_, txIndex) => ({ privateOnly: txIndex % 2 === 0 }),
130-
}),
151+
l1ToL2MessagesPerBlock
152+
? context.makeCheckpointWithMessagesPerBlock(l1ToL2MessagesPerBlock, { numTxsPerBlock, makeProcessedTxOpts })
153+
: context.makeCheckpoint(numBlocksPerCheckpoint, { numTxsPerBlock, numL1ToL2Messages, makeProcessedTxOpts }),
131154
);
132155

133156
const finalBlobChallenges = await context.getFinalBlobChallenges();
@@ -163,7 +186,8 @@ describeOrSkip('prover/regenerate-rollup-sample-inputs', () => {
163186
const { header, txs } = blocks[i];
164187
const { blockNumber, timestamp } = header.globalVariables;
165188

166-
await subTree.startNewBlock(blockNumber, timestamp, txs.length, i === 0 ? l1ToL2Messages : []);
189+
const blockMessages = l1ToL2MessagesPerBlock?.[i] ?? (i === 0 ? l1ToL2Messages : []);
190+
await subTree.startNewBlock(blockNumber, timestamp, txs.length, blockMessages);
167191
if (txs.length > 0) {
168192
await subTree.addTxs(txs);
169193
}

0 commit comments

Comments
 (0)