Skip to content

Commit c97993a

Browse files
Squash merge from lde/two-more-db to keep the work going
commit fe8ed94 Author: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com> Date: Thu May 7 14:09:02 2026 +0000 Fix name commit c704130 Author: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com> Date: Thu May 7 13:34:34 2026 +0000 Extend calldata types, minor changes to README commit de94416 Author: ledwards2225 <l.edwards.d@gmail.com> Date: Thu May 7 00:43:23 2026 +0000 prover tomls commit c554fd0 Author: ledwards2225 <l.edwards.d@gmail.com> Date: Wed May 6 21:59:54 2026 +0000 vks commit 0ae600b Author: ledwards2225 <l.edwards.d@gmail.com> Date: Wed May 6 21:08:25 2026 +0000 constants commit 6686c89 Author: ledwards2225 <l.edwards.d@gmail.com> Date: Wed May 6 20:16:44 2026 +0000 extend databus with 2 more cols commit f8ac6da Merge: 42e2e67 b3031a2 Author: AztecBot <tech@aztecprotocol.com> Date: Wed May 6 17:47:36 2026 +0000 Merge branch 'next' into merge-train/barretenberg commit b3031a2 Merge: 420fd55 d06c141 Author: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Wed May 6 16:32:12 2026 +0000 chore: Update Noir to nightly-2026-05-05 (#22911) Automated update of Noir submodule to latest nightly. **Current**: unknown **New**: nightly-2026-05-05 [View changes in noir-lang/noir](noir-lang/noir@20391fd...nightly-2026-05-05) commit d06c141 Author: AztecBot <49558828+AztecBot@users.noreply.github.com> Date: Wed May 6 16:31:28 2026 +0000 chore: Update Noir to nightly-2026-05-05 Automated update of Noir submodule to latest nightly. **Current**: unknown **New**: nightly-2026-05-05 [View changes in noir-lang/noir](noir-lang/noir@20391fd...nightly-2026-05-05) commit 420fd55 Merge: 72c125c 22231d5 Author: ledwards2225 <98505400+ledwards2225@users.noreply.github.com> Date: Wed May 6 16:30:52 2026 +0000 feat: merge-train/barretenberg (#22969) BEGIN_COMMIT_OVERRIDE chore: skip zero-init and reserve copy_cycle vectors (#22963) feat: Multi app per kernel (#22640) END_COMMIT_OVERRIDE commit 72c125c Merge: a864dec 38115ab Author: Aztec Bot <49558828+AztecBot@users.noreply.github.com> Date: Wed May 6 16:30:50 2026 +0000 feat: merge-train/avm (#22986) BEGIN_COMMIT_OVERRIDE refactor(avm)!: consolidate revertible/non-revertible append selectors (#22982) END_COMMIT_OVERRIDE commit 42e2e67 Author: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com> Date: Wed May 6 16:54:17 2026 +0100 feat: Improve add_scaled_batch (#22981) Two improvements: 1. `add_scaled_batch` was iterating over all polys to be batched and processing indices based on the range of the destination poly (the biggest of the polys to be batched). This PR adds a skipping condition that speeds up the function: we only iterate over the poly to be batched 2. Write a bespoke `add_batch_scaled` for use in the AVM with dynamic allocation of threads: each thread picks up the new available poly and works with it. This makes optimal usage of the fact that many polys in the AVM are small. Link to AVM bulk test: http://ci.aztec-labs.com/1df80aa9b6ae0088. The PCS component is `446ms` down from ~`600ms` commit 22231d5 Merge: 36d6ec8 a864dec Author: AztecBot <tech@aztecprotocol.com> Date: Wed May 6 15:35:10 2026 +0000 Merge branch 'next' into merge-train/barretenberg commit 38115ab Merge: 024b01b a864dec Author: AztecBot <tech@aztecprotocol.com> Date: Wed May 6 15:35:07 2026 +0000 Merge branch 'next' into merge-train/avm commit a864dec Merge: 1211a03 b23fb63 Author: PhilWindle <60546371+PhilWindle@users.noreply.github.com> Date: Wed May 6 14:55:36 2026 +0000 chore(p2p): drop unused ENR xxhash versioning path (#22943) ## Summary Removes dead code from `p2p/src/versioning.ts`: - `USE_XX_HASH` was never `true` outside tests; production ENRs always used the compressed string from `compressComponentVersions`. - Peer discovery already validates with `checkCompressedComponentVersion` in `discV5_service.ts`; `checkAztecEnrVersion` was only used from tests. - Drops `xxhash-wasm` / `toBufferBE` from this module (gossip `encoding.ts` still uses xxhash for message IDs). Related to [A-766](https://linear.app/aztec-labs/issue/A-766/audit-97-enr-version-detection-uses-string-prefix-matching-fragile) commit 024b01b Author: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Wed May 6 14:18:16 2026 +0200 refactor(avm)!: consolidate revertible/non-revertible append selectors (#22982) The 6 boolean pairs (non_revertible_append_X, revertible_append_X) for X in {note_hash, nullifier, l2_l1_msg} in TX_PHASE_SPEC_MAP were perfectly correlated with is_revertible: in every phase where one of them is set, is_revertible already determines which side. Replace each pair with a single sel_append_X selector and let is_revertible carry the revertibility bit. This removes 3 precomputed columns and 3 committed columns in the tx trace, shrinks the #[READ_PHASE_SPEC] lookup tuple, and simplifies the sel_try_X_append / is_tree_insert_phase / SEL_CAN_EMIT_X expressions. In #[NOTE_HASH_APPEND], the sel_unique flag (previously fed by sel_revertible_append_note_hash) is now is_revertible directly: on the two rows where the lookup is gated on, the two values agree by construction, and is_revertible is the more direct semantic for the "make this note hash unique with a nonce" decision. Updates the hardcoded precomputed VK commitments in avm_fixed_vk.hpp and the corresponding vk_hash; new values obtained from AvmFixedVKTests.FixedVKCommitments. commit b23fb63 Author: spypsy <spypsy@outlook.com> Date: Tue May 5 10:07:46 2026 +0000 chore(p2p): drop unused ENR xxhash versioning path USE_XX_HASH was never true in production; discv5 already validates via checkCompressedComponentVersion. Removes xxhash/toBufferBE from versioning.ts and tests the string format only.
1 parent b2519dc commit c97993a

67 files changed

Lines changed: 4674 additions & 4560 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.

barretenberg/cpp/pil/vm2/precomputed.pil

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pol constant sel_mem_tag_out_of_range;
209209
// - instruction size (in bytes): instr_size
210210
// - Selector on whether the instruction has a tag: sel_has_tag
211211
// - Selector on whether operand op2 is a tag: sel_tag_is_op2
212-
//
212+
//
213213
// Used by the instruction fetching subtrace to decode raw bytecode.
214214
// Selectors for operands decomposition into bytes (required by instr_fetching.pil)
215215
// This table is populated by a map generated by a cpp test defined in op_decomposition.test.cpp.
@@ -361,22 +361,23 @@ pol constant addressing_gas;
361361
// properties: which tree operations are allowed, public-input offsets, revert behavior.
362362
// Used by the transaction trace to enforce phase-based constraints.
363363
//
364-
// Example trace (idx encodes the TransactionPhase enum; abbreviated column names):
365-
// idx | sel_phase | is_call | is_teardown | is_collect_fee | is_tree_padding | is_cleanup | is_revertible | nr_null | nr_note | nr_l2l1 | r_null | r_note | r_l2l1 | next_on_revert
366-
// ----+-----------+---------+-------------+----------------+-----------------+------------+---------------+---------+---------+---------+--------+--------+--------+---------------
367-
// 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 (NR_NULLIFIER_INSERTION)
368-
// 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 (NR_NOTE_INSERTION)
369-
// 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 (NR_L2_TO_L1_MESSAGE)
370-
// 3 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 (SETUP)
371-
// 4 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 8 (R_NULLIFIER_INSERTION)
372-
// 5 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 8 (R_NOTE_INSERTION)
373-
// 6 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 8 (R_L2_TO_L1_MESSAGE)
374-
// 7 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 8 (APP_LOGIC)
375-
// 8 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 9 (TEARDOWN)
376-
// 9 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 (COLLECT_GAS_FEES)
377-
// 10 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 (TREE_PADDING)
378-
// 11 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 (CLEANUP)
379-
// 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 (beyond phase range)
364+
// Example trace (idx encodes the TransactionPhase enum; abbreviated column names).
365+
// Whether an append is revertible or not is determined by `is_revertible`.
366+
// idx | sel_phase | is_call | is_teardown | is_collect_fee | is_tree_padding | is_cleanup | is_revertible | append_null | append_note | append_l2l1 | next_on_revert
367+
// ----+-----------+---------+-------------+----------------+-----------------+------------+---------------+-------------+-------------+-------------+---------------
368+
// 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 (NR_NULLIFIER_INSERTION)
369+
// 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 (NR_NOTE_INSERTION)
370+
// 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 (NR_L2_TO_L1_MESSAGE)
371+
// 3 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 (SETUP)
372+
// 4 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 8 (R_NULLIFIER_INSERTION)
373+
// 5 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 8 (R_NOTE_INSERTION)
374+
// 6 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 8 (R_L2_TO_L1_MESSAGE)
375+
// 7 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 8 (APP_LOGIC)
376+
// 8 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 9 (TEARDOWN)
377+
// 9 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 (COLLECT_GAS_FEES)
378+
// 10 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 (TREE_PADDING)
379+
// 11 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 (CLEANUP)
380+
// 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 (beyond phase range)
380381

381382
// Phase Table for Tx Trace
382383
pol constant sel_phase; // Selector for phase table
@@ -389,12 +390,9 @@ pol constant is_cleanup;
389390
pol constant is_revertible;
390391
pol constant read_pi_start_offset;
391392
pol constant read_pi_length_offset;
392-
pol constant sel_non_revertible_append_note_hash;
393-
pol constant sel_non_revertible_append_nullifier;
394-
pol constant sel_non_revertible_append_l2_l1_msg;
395-
pol constant sel_revertible_append_note_hash;
396-
pol constant sel_revertible_append_nullifier;
397-
pol constant sel_revertible_append_l2_l1_msg;
393+
pol constant sel_append_note_hash;
394+
pol constant sel_append_nullifier;
395+
pol constant sel_append_l2_l1_msg;
398396
pol constant next_phase_on_revert;
399397

400398
// ===== Section 12: Keccak round constants =====

barretenberg/cpp/pil/vm2/tx.pil

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,9 @@ namespace tx;
209209
is_revertible,
210210
read_pi_start_offset,
211211
read_pi_length_offset,
212-
sel_non_revertible_append_note_hash,
213-
sel_non_revertible_append_nullifier,
214-
sel_non_revertible_append_l2_l1_msg,
215-
sel_revertible_append_note_hash,
216-
sel_revertible_append_nullifier,
217-
sel_revertible_append_l2_l1_msg,
212+
sel_append_note_hash,
213+
sel_append_nullifier,
214+
sel_append_l2_l1_msg,
218215
next_phase_on_revert
219216
}
220217
in
@@ -228,12 +225,9 @@ namespace tx;
228225
precomputed.is_revertible,
229226
precomputed.read_pi_start_offset,
230227
precomputed.read_pi_length_offset,
231-
precomputed.sel_non_revertible_append_note_hash,
232-
precomputed.sel_non_revertible_append_nullifier,
233-
precomputed.sel_non_revertible_append_l2_l1_msg,
234-
precomputed.sel_revertible_append_note_hash,
235-
precomputed.sel_revertible_append_nullifier,
236-
precomputed.sel_revertible_append_l2_l1_msg,
228+
precomputed.sel_append_note_hash,
229+
precomputed.sel_append_nullifier,
230+
precomputed.sel_append_l2_l1_msg,
237231
precomputed.next_phase_on_revert
238232
};
239233

@@ -465,18 +459,16 @@ namespace tx;
465459
/***************************************************************************
466460
* Private Side Effect Insertions
467461
**************************************************************************/
468-
pol commit sel_revertible_append_note_hash; // @boolean
469-
pol commit sel_non_revertible_append_note_hash; // @boolean
470-
pol commit sel_revertible_append_nullifier; // @boolean
471-
pol commit sel_non_revertible_append_nullifier; // @boolean
472-
pol commit sel_revertible_append_l2_l1_msg; // @boolean
473-
pol commit sel_non_revertible_append_l2_l1_msg; // @boolean
474-
// The 6 above selectors are booleans thanks to #[READ_PHASE_SPEC] on active rows.
462+
pol commit sel_append_note_hash; // @boolean
463+
pol commit sel_append_nullifier; // @boolean
464+
pol commit sel_append_l2_l1_msg; // @boolean
465+
// The 3 above selectors are booleans thanks to #[READ_PHASE_SPEC] on active rows.
475466
// Furthermore, phase spec guarantees that they are mutually exclusive.
467+
// Whether such an append is revertible or not is determined by `is_revertible`.
476468

477469
// A tree selector means we need to get the tree value
478-
pol commit is_tree_insert_phase; // @boolean on active rows (follows from mutual exclusivity of the 6 above selectors)
479-
is_tree_insert_phase = sel_revertible_append_note_hash + sel_non_revertible_append_note_hash + sel_revertible_append_nullifier + sel_non_revertible_append_nullifier;
470+
pol commit is_tree_insert_phase; // @boolean on active rows (follows from mutual exclusivity of the above selectors)
471+
is_tree_insert_phase = sel_append_note_hash + sel_append_nullifier;
480472
pol commit leaf_value;
481473
// Shared column to track the inverse of the remaining side effects for note hashes, nullifiers, and L2 to L1 messages
482474
pol commit remaining_side_effects_inv;
@@ -491,7 +483,7 @@ namespace tx;
491483

492484
// ===== NOTE HASHES =====
493485
pol commit sel_try_note_hash_append; // @boolean (follows from definition)
494-
sel_try_note_hash_append = (sel - is_padded) * (sel_revertible_append_note_hash + sel_non_revertible_append_note_hash);
486+
sel_try_note_hash_append = (sel - is_padded) * sel_append_note_hash;
495487

496488
// If we are at the maximum emitted note hashes, we must revert
497489
pol REMAINING_NOTE_HASH_WRITES = constants.MAX_NOTE_HASHES_PER_TX - prev_num_note_hashes_emitted;
@@ -509,7 +501,9 @@ namespace tx;
509501
prev_note_hash_tree_size,
510502
prev_note_hash_tree_root,
511503
precomputed.zero, // Already siloed. (No need to pass address.)
512-
sel_revertible_append_note_hash, // Not unique for revertible note hashes.
504+
is_revertible, // Used as `sel_unique`: revertible note hashes need to be made unique with a nonce.
505+
// On rows where sel_note_hash_append == 1 (NR_NOTE_INSERTION or R_NOTE_INSERTION),
506+
// is_revertible is exactly the discriminator we want.
513507
prev_num_note_hashes_emitted,
514508
discard, // from tx_discard.pil virtual trace
515509
next_note_hash_tree_root
@@ -532,7 +526,7 @@ namespace tx;
532526

533527
// ===== NULLIFIERS =====
534528
pol commit sel_try_nullifier_append; // @boolean (follows from definition)
535-
sel_try_nullifier_append = (sel - is_padded) * (sel_revertible_append_nullifier + sel_non_revertible_append_nullifier);
529+
sel_try_nullifier_append = (sel - is_padded) * sel_append_nullifier;
536530

537531
pol commit nullifier_limit_error; // @boolean
538532
nullifier_limit_error * (1 - nullifier_limit_error) = 0;
@@ -594,7 +588,7 @@ namespace tx;
594588

595589
// ===== L2 - L1 Messages =====
596590
pol commit sel_try_l2_l1_msg_append; // @boolean (follows from definition)
597-
sel_try_l2_l1_msg_append = (sel - is_padded) * (sel_revertible_append_l2_l1_msg + sel_non_revertible_append_l2_l1_msg);
591+
sel_try_l2_l1_msg_append = (sel - is_padded) * sel_append_l2_l1_msg;
598592

599593
pol commit l2_l1_msg_contract_address;
600594
pol commit l2_l1_msg_recipient;

barretenberg/cpp/pil/vm2/tx_context.pil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,12 @@ namespace tx;
330330
NOT_LAST_ROW * (1 - is_teardown') * (da_gas_limit - da_gas_limit') = 0;
331331

332332
// Selectors to allow prev => next state changes in the different phases
333-
pol SEL_CAN_EMIT_NOTE_HASH = is_public_call_request + sel_non_revertible_append_note_hash + sel_revertible_append_note_hash;
334-
pol SEL_CAN_EMIT_NULLIFIER = is_public_call_request + sel_non_revertible_append_nullifier + sel_revertible_append_nullifier;
333+
pol SEL_CAN_EMIT_NOTE_HASH = is_public_call_request + sel_append_note_hash;
334+
pol SEL_CAN_EMIT_NULLIFIER = is_public_call_request + sel_append_nullifier;
335335
pol SEL_CAN_WRITE_PUBLIC_DATA = is_public_call_request + is_collect_fee;
336336
pol SEL_CAN_WRITE_WRITTEN_PUBLIC_DATA_SLOTS = is_public_call_request;
337337
pol SEL_CAN_EMIT_PUBLIC_LOG = is_public_call_request;
338-
pol SEL_CAN_EMIT_L2_L1_MSG = is_public_call_request + sel_non_revertible_append_l2_l1_msg + sel_revertible_append_l2_l1_msg;
338+
pol SEL_CAN_EMIT_L2_L1_MSG = is_public_call_request + sel_append_l2_l1_msg;
339339
// The 6 above selectors are booleans on active rows due to #[READ_PHASE_SPEC] and
340340
// mutual exclusivity of the selectors on the right-hand side.
341341

barretenberg/cpp/scripts/test_chonk_standalone_vks_havent_changed.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ script_path="$root/barretenberg/cpp/scripts/test_chonk_standalone_vks_havent_cha
2121
# - Generate a hash for versioning: sha256sum bb-chonk-inputs.tar.gz
2222
# - Upload the compressed results: aws s3 cp bb-chonk-inputs.tar.gz s3://aztec-ci-artifacts/protocol/bb-chonk-inputs-[hash(0:8)].tar.gz
2323
# Note: In case of the "Test suite failed to run ... Unexpected token 'with' " error, need to run: docker pull aztecprotocol/build:3.0
24-
pinned_short_hash="c09aeb0c"
24+
pinned_short_hash="341842bf"
2525
pinned_chonk_inputs_url="https://aztec-ci-artifacts.s3.us-east-2.amazonaws.com/protocol/bb-chonk-inputs-${pinned_short_hash}.tar.gz"
2626

2727
function update_pinned_hash_in_script {

barretenberg/cpp/src/barretenberg/chonk/README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ MegaZK Oink → Merge → ECCVM → Translator Oink + Joint Sumcheck + Joint PCS
111111
112112
Concretely (`ChonkVerifier::reduce_to_ipa_claim` / `ChonkVerifier::verify`):
113113
114-
1. **MegaZK Oink verification**: `BatchedHonkTranslatorVerifier::verify_mega_zk_oink` processes the hiding kernel's pre-sumcheck proof and extracts `HidingKernelIO` (pairing points, calldata commitment, ECC op wire commitments)
115-
2. **Databus consistency check**: Asserts the hiding kernel's calldata commitment equals its `kernel_return_data` commitment
114+
1. **MegaZK Oink verification**: `BatchedHonkTranslatorVerifier::verify_mega_zk_oink` processes the hiding kernel's pre-sumcheck proof and extracts `HidingKernelIO` (pairing points, kernel return data commitment, ECC op wire commitments)
115+
2. **Databus consistency check**: Asserts the hiding kernel's kernel calldata commitment equals the `kernel_return_data` commitment contained it its public inputs
116116
3. **Merge verification**: Verifies the hiding kernel's APPEND-mode merge proof using the ECC op wire commitments from step 1 and `ecc_op_tables` from `HidingKernelIO`
117117
4. **ECCVM verification**: Reduces to an IPA opening claim; extracts translator input parameters (`v`, `x`, `accumulated_result`)
118118
5. **Joint verification**: `BatchedHonkTranslatorVerifier::verify` processes the translator Oink, runs the 17-round joint sumcheck, and performs the joint Shplemini/KZG PCS reduction
@@ -269,13 +269,13 @@ The databus solves this by using **commitments** instead of raw data. Rather tha
269269
270270
| Column | Purpose |
271271
|--------|---------|
272-
| `calldata` | Input from previous kernel's return data ($C_i$) |
273-
| `secondary_calldata` | Input from previous app's return data ($C'_i$) |
272+
| `kernel_calldata` | Input from previous kernel's return data ($C_i$) |
273+
| `app_calldata[0..2]` | Inputs from up to three apps' return data ($C'_{i,j}$) |
274274
| `return_data` | Output to be consumed by next circuit ($R_i$) |
275275
276-
App circuits only produce `return_data` (no calldata). Kernel circuits receive both:
277-
- `calldata` from the previous kernel's return data
278-
- `secondary_calldata` from the corresponding app's return data
276+
App circuits only produce `return_data` (no calldata). Kernel circuits receive:
277+
- `kernel_calldata` from the previous kernel's return data
278+
- `app_calldata[0..2]` from the corresponding apps' return data
279279
280280
#### Lookup Relations
281281
@@ -301,7 +301,7 @@ $$\sum_{i=0}^{n-1} a_i \cdot I_i \cdot (w_{1,i} + w_{2,i}\beta + \gamma) - q_{bu
301301
302302
Inverse correctness is enforced by two separate gating subrelations: $(I \cdot L \cdot T - 1) \cdot \text{is\_read} = 0$ on read rows, and $(I \cdot L \cdot T - 1) \cdot \text{count} = 0$ on write rows. At inactive rows (where both gates are zero), $I$ is unconstrained but the lookup identity contribution is also zero, so the prover gets no free degrees of freedom.
303303
304-
**Multiple columns**: Each bus column (calldata, secondary_calldata, return_data) has separate subrelations, distinguished by column-specific selectors $q_j$.
304+
**Multiple columns**: Each bus column (kernel calldata, three app calldata columns, return data) has separate subrelations, distinguished by column-specific selectors $q_j$.
305305
306306
#### Population
307307
@@ -315,14 +315,15 @@ The databus columns are populated from ACIR constraints generated by the Noir co
315315
```
316316
App₀ ──return_data [R'₀]──┐
317317
318-
Kernel₀ ←─calldata─── (empty for first kernel)
318+
Kernel₀ ←─kernel_calldata─── (empty for first kernel)
319+
←─app_calldata[0] [C'₀,0]─── App₀.return_data
319320
320321
return_data [R₀]
321322
322323
App₁ ──return_data [R'₁]──┐
323324
324-
Kernel₁ ←─calldata [C₁]─── Kernel₀.return_data
325-
←─secondary_calldata [C'₁]─── App₁.return_data
325+
Kernel₁ ←─kernel_calldata [C₁]─── Kernel₀.return_data
326+
←─app_calldata[0] [C'₁,0]─── App₁.return_data
326327
327328
return_data [R₁]
328329
@@ -685,8 +686,8 @@ Kernel circuits output a structured public input block that carries cross-circui
685686
struct KernelIO {
686687
PairingInputs pairing_inputs; // Accumulated {P0, P1} for deferred pairing check
687688
G1 kernel_return_data; // Commitment to this kernel's return data
688-
G1 app_return_data; // Commitment to the app's return data
689-
TableCommitments ecc_op_tables; // [M_1]...[M_4] merged op queue tables from Merge
689+
std::array<G1, MAX_APPS_PER_KERNEL> app_return_data; // App return data commitments
690+
FF ecc_op_hash; // Running hash over ECC op column commitments
690691
FF output_hn_accum_hash; // Hash of the HyperNova accumulator state
691692
};
692693

@@ -722,10 +723,10 @@ The [Databus](#databus) section explains how circuits pass data via commitment e
722723

723724
```cpp
724725
// Kernel's calldata must match previous kernel's return_data
725-
kernel_input.kernel_return_data.incomplete_assert_equal(witness_commitments.calldata);
726+
kernel_input.kernel_return_data.incomplete_assert_equal(witness_commitments.kernel_calldata);
726727

727-
// Kernel's secondary_calldata must match previous app's return_data
728-
kernel_input.app_return_data.incomplete_assert_equal(witness_commitments.secondary_calldata);
728+
// Each app calldata column must match the corresponding app's return_data
729+
kernel_input.app_return_data[idx].incomplete_assert_equal(*app_calldata_commitments[idx]);
729730
```
730731

731732
The `incomplete_assert_equal` (for non-native G1 points) adds in-circuit constraints that the commitments are equal. Combined with the HyperNova binding of public inputs to proofs, tampering with databus content invalidates the proof.

0 commit comments

Comments
 (0)