feat(circuits): add InboxParity variants for size 4 and 16 - #25463
Open
spalladino wants to merge 2 commits into
Open
feat(circuits): add InboxParity variants for size 4 and 16#25463spalladino wants to merge 2 commits into
spalladino wants to merge 2 commits into
Conversation
spalladino
requested review from
IlyasRidhuan,
LeilaWang,
iAmMichaelConnor,
iakovenkos and
ledwards2225
as code owners
September 10, 2026 17:56
The InboxParity size ladder started at 64 messages, which costs 578k gates. Most checkpoints carry far fewer messages than that, and the rungs below 64 are much cheaper: size 4 is 39k gates and size 16 is 147k. Adding them lets a small checkpoint prove a circuit sized for its message count instead of paying for 64 lanes it never fills. The two new crates are the same one-line `inbox_parity::execute` wrapper the existing rungs use, instantiated at sizes 4 and 16. They take VK indices 77 and 78: the ladder is allocated append-only, so from now on the indices no longer follow the sizes. The checkpoint root's allowed VK-index set widens from three entries to five, and the checkpoint-root parity tests cover the two new indices. The node side follows in `labs-patches/0017`: the ladder in `INBOX_PARITY_SIZES`, the two artifacts in the server artifact union, the size-to-artifact and VK-index maps, and the plain-UltraHonk list in the bb-prover. Gate counts from `bb gates --scheme ultra_honk`: 39,297 for size 4 and 147,161 for size 16, against 578,633 for size 64.
The block-root composer asserted the message bundle's padding lanes were zero before appending them, but `append_leaves_to_snapshot` already rejects a bundle with a non-zero lane past `num_msgs` (see its `append_non_zero_padding_lane_fails` test) and bounds `num_msgs` by the array length. Asserting it again only adds constraints.
spalladino
force-pushed
the
spl/fi2-b4-inbox-parity-rungs
branch
from
September 10, 2026 19:38
fb8a3ad to
e78983a
Compare
spalladino
added this pull request to stack #25470
September 10, 2026 20:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
InboxParitysize ladder starts at 64 messages, and that rung costs 578kgates. One parity proof is produced per checkpoint, and the prover picks the
smallest rung that fits the checkpoint's real message count, so a checkpoint
carrying a handful of messages currently pays for 64 lanes it never fills. The
two rungs below 64 are far cheaper.
Measured with
bb gates --scheme ultra_honk:This adds crates for sizes 4 and 16. Each is the same one-line
inbox_parity::executewrapper the existing rungs use, just instantiated at asmaller
S, so there is no new circuit logic. They take VK indices 77 and 78,which means the ladder is now allocated append-only and the indices no longer
follow the sizes; the comment in
constants.nrsays so. The checkpoint root'sallowed VK-index set widens from three entries to five, and the checkpoint-root
parity tests cover the two new indices against the fake VK tree.
The node side rides the foundation patch queue as
labs-patches/0017:INBOX_PARITY_SIZESgrows to five entries (ascending, sopickInboxParitySizekeeps picking the smallest that fits with no further change), the two artifacts
join the server artifact union, the size-to-artifact map, the VK index map and
the plain-UltraHonk list in the bb-prover, and the codegen script emits their
input types.
The second commit, authored by Leila Wang and taken from #25422, drops a
redundant assertion in the block-root composer:
append_leaves_to_snapshotalready rejects a message bundle with a non-zero lane past
num_msgsandbounds
num_msgsby the array length, so asserting it again only addedconstraints. It sits here rather than in the follow-up cleanup PR because
removing a constraint moves the block-root VK, and this PR already moves the VK
tree root. The PR carries
ci-no-squashso that authorship survives the merge.Adding protocol constants moves barretenberg's own build hash, so every
protocol-circuit VK is regenerated by this change. The committed
Prover.tomlfixtures still solve as they are — each one carries its own
vk_tree_rootandmatching membership hints, so a moved tree root does not invalidate them — and
nargo executewas verified againstrollup-block-root,rollup-block-root-no-txs,rollup-checkpoint-rootandrollup-checkpoint-root-single-block.Fixes A-1989