Skip to content

Commit 4375d97

Browse files
committed
feat: single variable-size InboxParity proof per checkpoint (A-1427)
Replace the parity base (x4) + parity root fan-in with one variable-size InboxParity<S> proof per checkpoint, S in {64, 256, 1024} (one VK per size; the prover proves the smallest rung >= the checkpoint's message count). The parity-root circuit is deleted; the checkpoint root keeps one parity verification, now accepting the 3-rung VK ladder. Net +1 VK. Two transitional decisions (dev-only, closed by the future Fast Inbox flip): - in_hash is kept in the parity public inputs as an unconstrained pass-through hint (the orchestrator supplies the true sha256 frontier root via computeInHashFromL1ToL2Messages), so L1's inHash == inbox.consume() check still passes with no L1 changes. The frontier tree is no longer built in circuit. - The block-root message sponge absorbs at the real message count while the L1-to-L2 tree insert stays a padded fixed subtree, decoupled via a new L1ToL2MessageBundle { messages, num_msgs, num_real_msgs } struct so the real count can be dropped later with minimal change. num_msgs is not otherwise pinned in-circuit; documented as a dev-mode gap backstopped by the L1 pending-chain header hash. Threads the single sized proof through the orchestrator, bb-prover, proving broker, and TS bindings, collapsing getBaseParityProof/getRootParityProof into getInboxParityProof and PARITY_BASE/PARITY_ROOT into one INBOX_PARITY request type. The UltraHonk parity benchmark and bb.js debug test move to InboxParity256.
1 parent 9d669cb commit 4375d97

95 files changed

Lines changed: 1347 additions & 1897 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.

noir-projects/noir-protocol-circuits/Nargo.template.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ members = [
88
"crates/types",
99
"crates/protocol-test-utils",
1010
"crates/blob",
11-
"crates/parity-base",
12-
"crates/parity-root",
11+
"crates/inbox-parity-64",
12+
"crates/inbox-parity-256",
13+
"crates/inbox-parity-1024",
1314
"crates/private-kernel-lib",
1415
"crates/private-kernel-init",
1516
"crates/private-kernel-init-2",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "inbox_parity_1024"
3+
type = "bin"
4+
authors = [""]
5+
compiler_version = ">=0.18.0"
6+
7+
[dependencies]
8+
rollup_lib = { path = "../rollup-lib" }
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use rollup_lib::parity::{inbox_parity, InboxParityPrivateInputs, ParityPublicInputs};
2+
3+
fn main(inputs: InboxParityPrivateInputs<1024>) -> pub ParityPublicInputs {
4+
inbox_parity::execute(inputs)
5+
}

noir-projects/noir-protocol-circuits/crates/parity-root/Nargo.toml renamed to noir-projects/noir-protocol-circuits/crates/inbox-parity-256/Nargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "parity_root"
2+
name = "inbox_parity_256"
33
type = "bin"
44
authors = [""]
55
compiler_version = ">=0.18.0"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use rollup_lib::parity::{inbox_parity, InboxParityPrivateInputs, ParityPublicInputs};
2+
3+
fn main(inputs: InboxParityPrivateInputs<256>) -> pub ParityPublicInputs {
4+
inbox_parity::execute(inputs)
5+
}

noir-projects/noir-protocol-circuits/crates/parity-base/Nargo.toml renamed to noir-projects/noir-protocol-circuits/crates/inbox-parity-64/Nargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "parity_base"
2+
name = "inbox_parity_64"
33
type = "bin"
44
authors = [""]
55
compiler_version = ">=0.18.0"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use rollup_lib::parity::{inbox_parity, InboxParityPrivateInputs, ParityPublicInputs};
2+
3+
fn main(inputs: InboxParityPrivateInputs<64>) -> pub ParityPublicInputs {
4+
inbox_parity::execute(inputs)
5+
}

noir-projects/noir-protocol-circuits/crates/parity-base/src/main.nr

Lines changed: 0 additions & 5 deletions
This file was deleted.

noir-projects/noir-protocol-circuits/crates/parity-root/src/main.nr

Lines changed: 0 additions & 5 deletions
This file was deleted.

noir-projects/noir-protocol-circuits/crates/protocol-test-utils/src/fixtures/vk_tree.nr

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ use crate::utils::pad_end;
22
use types::{
33
constants::{
44
BLOCK_ROOT_MSGS_ONLY_ROLLUP_VK_INDEX, HIDING_KERNEL_TO_PUBLIC_VK_INDEX,
5-
MEGA_KERNEL_VK_LENGTH_IN_FIELDS, PARITY_BASE_VK_INDEX, PARITY_ROOT_VK_INDEX,
6-
PRIVATE_KERNEL_INIT_2_VK_INDEX, PRIVATE_KERNEL_INIT_3_VK_INDEX,
5+
INBOX_PARITY_1024_VK_INDEX, INBOX_PARITY_256_VK_INDEX, INBOX_PARITY_64_VK_INDEX,
6+
MEGA_KERNEL_VK_LENGTH_IN_FIELDS, PRIVATE_KERNEL_INIT_2_VK_INDEX,
7+
PRIVATE_KERNEL_INIT_3_VK_INDEX,
78
PRIVATE_KERNEL_INIT_4_VK_INDEX, PRIVATE_KERNEL_INIT_5_VK_INDEX,
89
PRIVATE_KERNEL_INNER_2_VK_INDEX, PRIVATE_KERNEL_INNER_3_VK_INDEX,
910
PRIVATE_KERNEL_INNER_4_VK_INDEX, PRIVATE_KERNEL_INNER_5_VK_INDEX,
@@ -80,9 +81,12 @@ pub global VK_MERKLE_TREE: MerkleTree<VK_TREE_WIDTH> = {
8081
}
8182

8283
// Honk
83-
// Override some of the above with Honk Vks.
84-
leaves[PARITY_BASE_VK_INDEX] = generate_fake_honk_vk_for_index(PARITY_BASE_VK_INDEX).hash;
85-
leaves[PARITY_ROOT_VK_INDEX] = generate_fake_honk_vk_for_index(PARITY_ROOT_VK_INDEX).hash;
84+
// The inbox parity ladder circuits are plain UltraHonk (not rollup-honk) and live past the reset range.
85+
leaves[INBOX_PARITY_64_VK_INDEX] = generate_fake_honk_vk_for_index(INBOX_PARITY_64_VK_INDEX).hash;
86+
leaves[INBOX_PARITY_256_VK_INDEX] =
87+
generate_fake_honk_vk_for_index(INBOX_PARITY_256_VK_INDEX).hash;
88+
leaves[INBOX_PARITY_1024_VK_INDEX] =
89+
generate_fake_honk_vk_for_index(INBOX_PARITY_1024_VK_INDEX).hash;
8690
leaves[ROOT_ROLLUP_VK_INDEX] = generate_fake_honk_vk_for_index(ROOT_ROLLUP_VK_INDEX).hash;
8791

8892
MerkleTree::new(leaves)

0 commit comments

Comments
 (0)