Skip to content

Commit 666df4c

Browse files
committed
docs(fast-inbox): correct the is_first_block and sole-block-variant rationale (A-1387)
1 parent 61af362 commit 666df4c

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/block_rollup_public_inputs.nr

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ pub struct BlockRollupPublicInputs {
4040
// stored in the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
4141
pub block_headers_hash: Field,
4242

43-
// Whether this block range starts at the first block of its checkpoint. Only the first block root sets this true;
44-
// merges propagate it from the left rollup and `validate_consecutive_block_rollups` asserts the right rollup's is
45-
// false, so it can only reach the checkpoint root through the leftmost leaf. It replaces `in_hash`'s former
46-
// structural role: the checkpoint root asserts the merged value is true, and it drives the block-end blob-absorb
47-
// flag (the l1-to-l2 tree root is absorbed only for the first block).
43+
// Whether this block range starts at the first block of its checkpoint. Only the first block root variants set it
44+
// true; merges propagate it from the left rollup (`merge_block_rollups`), and
45+
// `validate_consecutive_block_rollups` asserts the right rollup of every merge is not a first block. The flag is
46+
// therefore a proof that the range's leftmost leaf is a first-variant block root, which is what lets the
47+
// checkpoint root assert its leftmost block is one (`checkpoint_root_inputs_validator`) even though it cannot see
48+
// the leaf VK indices. Since only first variants may be fully empty (no txs and no messages), that also confines
49+
// a fully-empty filler block to the first position of a checkpoint.
4850
pub is_first_block: bool,
4951

5052
// Poseidon2 message-bundle sponge threaded across the blocks of the checkpoint. The leftmost block starts from the

noir-projects/noir-protocol-circuits/crates/rollup-lib/src/checkpoint_root/checkpoint_root_single_block_rollup.nr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ use types::{
2121
//
2222
// That `is_first_block` assertion is the only thing keeping a message-only block from standing as a checkpoint's sole
2323
// block. If it is ever relaxed (e.g. replaced by a "leftmost block's start_msg_sponge is empty" check), this entry
24-
// must be dropped in the same change, or a transaction-less single-block checkpoint — one whose blob omits the
25-
// first-block l1-to-l2 root — would silently become provable.
24+
// must be dropped in the same change, because barring the message-only variant from standing alone is what keeps
25+
// each checkpoint shape to a single valid encoding: a sole transaction-less block carrying a message bundle is
26+
// already provable as an empty-tx-first block, which accepts a non-empty bundle. It is also what keeps the rule
27+
// confining fully-empty blocks to the first position enforceable.
2628
global ALLOWED_PREVIOUS_VK_INDICES: [u32; 4] = [
2729
BLOCK_ROOT_FIRST_ROLLUP_VK_INDEX,
2830
BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP_VK_INDEX,

0 commit comments

Comments
 (0)