Skip to content

chore(fast-inbox): circuits cleanup and checkpoint header format (A-1387)#24792

Open
spalladino wants to merge 6 commits into
spl/a-1386-l1-cleanupfrom
spl/a-1387-circuits-cleanup
Open

chore(fast-inbox): circuits cleanup and checkpoint header format (A-1387)#24792
spalladino wants to merge 6 commits into
spl/a-1386-l1-cleanupfrom
spl/a-1387-circuits-cleanup

Conversation

@spalladino

@spalladino spalladino commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

FI-17 of the Fast Inbox (AZIP-22) stack. Stacked on #24791 (A-1386); it removes the legacy inHash from the checkpoint header now that the consensus flip (#24789, A-1384) has switched validation to the streaming rolling hash. After this PR, inboxRollingHash is the checkpoint's only inbox commitment.

Consensus-format change

  • The checkpoint header loses its inHash field across all three preimage layers in lockstep: noir CheckpointHeader (checkpoint_header.nr), TS CheckpointHeader (stdlib/src/rollup/checkpoint_header.ts), and Solidity ProposedHeaderLib (struct + hash packing). The field ordering is otherwise unchanged; the header shrinks by one field (32 bytes: CHECKPOINT_HEADER_SIZE_IN_BYTES 380 to 348, CHECKPOINT_HEADER_LENGTH 14 to 13).
  • The header-hash fixtures were regenerated from checkpoint_header.test.ts (the established workflow) and pasted into the noir tests; the p2p golden-byte fixture (wire_compat_fixtures.ts) was refreshed for the checkpoint-proposal serialization, which shrinks by exactly the one removed field. The block-proposal wire fixture is unchanged (block-level inHash is out of scope, see A-1388).

Circuits and constants

  • Strips the dead unconstrained in_hash pass-through from the sized InboxParity<S> circuit and ParityPublicInputs (noir + TS + the hand-written noir-protocol-circuits-types conversion wrappers). The circuit is kept (sized-parity, per FI-06's topology decision), so no VK-tree indices move.
  • Retires NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP (replaced everywhere by MAX_L1_TO_L2_MSGS_PER_CHECKPOINT, same value 1024) and the now-dead NUM_MSGS_PER_BASE_PARITY, NUM_BASE_PARITY_PER_ROOT_PARITY, and L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH. Generated constants (constants.gen.ts, ConstantsGen.sol) were regenerated via remake-constants.
  • Deletes FrontierLib.sol and its tests (Parity.t.sol, the Frontier harness and merkle test) now that their last users are gone.

Verification

  • Noir: types::checkpoint_header (5/5), rollup_lib::parity and checkpoint_root::parity_tests (15/15), and the checkpoint-root header-assembly path pass locally. The full checkpoint_root suite (68 tests) is too slow to run in full locally and rides CI.
  • Solidity: forge test green across Rollup, RollupFieldRange, Inbox, InboxBuckets, RollupGetters (76/76), covering header hashing and the regenerated checkpoint fixtures.
  • Jest: checkpoint_header, the p2p wire-compat suites, and the parity/messaging suites pass (43 tests), confirming the fixture regeneration is byte-consistent.
  • VK/artifact/Prover.toml regeneration and the generated Noir ABI types ride CI (local yarn build in noir-protocol-circuits-types / simulator / prover-client is expected to fail on stale circuit artifacts until then); e2e and the broken-zone typecheck are the CI-of-record for those.

Stack

Part of the Fast Inbox stack #24784 through #24791 (umbrella #24774): A-1379 (#24784), A-1380 (#24785), A-1381 (#24786), A-1382 (#24787), A-1383 (#24788), A-1384 flip (#24789), A-1385 (#24790), A-1386 (#24791, base of this PR).

Resolves A-1387.

l1 publisher inbox consumption via the streaming selector (CI fix, pass-8)

The A-1387 inHash-removal rewrite left l1_publisher.integration.test.ts hardcoding previousInboxRollingHash = Fr.ZERO and bucketHint = 0n while consuming real L1→L2 messages, so message-consuming checkpoints reverted on L1 with Rollup__InvalidInboxRollingHash / UnconsumedInboxMessages (masked every prior CI round behind earlier failures). INBOX_LAG_SECONDS is an L1-time censorship cutoff, not whole checkpoints, so no checkpoint-depth shift register reproduces the aged bucket set. The test now mirrors the real Inbox buckets into its MockL1ToL2MessageSource and reuses the production selectInboxBucketForBlock (which mirrors ProposeLib.validateInboxConsumption) to pick exactly the buckets each checkpoint must consume, deriving the consumed bundle, the propose bucket hint, and the header rolling hash from that one selection. Box: 13/13, verified at a-1387 and a-1388.

@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from 86a8360 to a7eb238 Compare July 19, 2026 01:25
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch from d06eb0f to 7e1dc3d Compare July 19, 2026 01:25
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from a7eb238 to 721cb08 Compare July 19, 2026 14:05
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch from 7e1dc3d to 0e1e0ed Compare July 19, 2026 14:05
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from 721cb08 to f09a847 Compare July 19, 2026 15:10
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch 2 times, most recently from 2277ca8 to 43ac45a Compare July 19, 2026 15:36
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from f09a847 to 8fa5988 Compare July 19, 2026 15:36
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch 3 times, most recently from 8287158 to 4c4c1a8 Compare July 19, 2026 20:30
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from 225d2e7 to 3eb6939 Compare July 19, 2026 20:30
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch 2 times, most recently from c51c85b to de57be7 Compare July 19, 2026 20:51
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from 70acb89 to 7a02f46 Compare July 19, 2026 20:51
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch from de57be7 to ce83790 Compare July 20, 2026 13:32
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from 7a02f46 to 180983d Compare July 20, 2026 13:32
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch from ce83790 to f853ebe Compare July 20, 2026 14:07
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch 2 times, most recently from 7d55b36 to df4a7eb Compare July 20, 2026 15:30
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch 2 times, most recently from 9d37080 to c50ce18 Compare July 20, 2026 17:28
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from df4a7eb to 480a601 Compare July 20, 2026 17:28
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch from c50ce18 to 6b53788 Compare July 20, 2026 21:21
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from 480a601 to 670ebbf Compare July 20, 2026 21:21
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch from 6b53788 to ff21647 Compare July 21, 2026 02:58
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from 11b1638 to cf29763 Compare July 21, 2026 03:39
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch 2 times, most recently from 4a8dc8a to 9e63607 Compare July 21, 2026 04:43
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from cf29763 to 7b32375 Compare July 21, 2026 04:43
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch from 9e63607 to d743db2 Compare July 21, 2026 12:06
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from 7b32375 to 2b91492 Compare July 21, 2026 12:06
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch from d743db2 to 141286e Compare July 21, 2026 15:02
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from 2b91492 to 5295095 Compare July 21, 2026 15:02
…uits (A-1387)

Remove the dead unconstrained in_hash pass-through from InboxParity and
ParityPublicInputs, and remove in_hash from the CheckpointHeader consensus
format (struct, to_be_bytes, serialization length, Empty, hash fixtures). The
Inbox rolling hash is now the checkpoint's only inbox commitment.

Retire NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP in favor of
MAX_L1_TO_L2_MSGS_PER_CHECKPOINT, and drop the now-unused
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH and the NUM_MSGS_PER_BASE_PARITY /
NUM_BASE_PARITY_PER_ROOT_PARITY frontier fan-in constants. Regenerated
constants.gen.ts and ConstantsGen.sol via remake-constants.
…te FrontierLib (A-1387)

Remove inHash from the ProposedHeader struct and its hash preimage in
ProposedHeaderLib, keeping the packing byte-for-byte in lockstep with the noir
and stdlib checkpoint headers. Update the decoder base struct and the propose
test helpers, and regenerate the checkpoint fixtures (drop header.inHash,
recompute headerHash).

Delete FrontierLib and its only remaining users: the parity cross-check test
(Parity.t.sol, which verified the deleted parity circuits) and the frontier
merkle test/harness. The frontier tree is gone from both circuits and L1.
…h stdlib and node (A-1387)

Mirror the consensus-format change in the stdlib CheckpointHeader (struct,
serialization, viem, hash fixtures) and the circuit-ABI stdlib types
(ParityPublicInputs, InboxParityPrivateInputs) and their noir conversion
mappings. Sweep the header-inHash populate/read sites: the lightweight
checkpoint builder, the checkpoint-proving orchestrator, the sequencer fixture
writer, and the checkpoint proposal (its block-level inHash now sources zero
rather than the removed header field). Regenerate the checkpoint p2p wire
fixture for the shorter header.

Replace NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP with MAX_L1_TO_L2_MSGS_PER_CHECKPOINT
across the TS consumers. The block-level inHash struct fields (BlockProposal,
L2Block) and stdlib/src/messaging/in_hash.ts remain for the node cleanup issue.
…oval (A-1387)

The propose-failure test asserted the deleted Rollup__InvalidInHash selector
(0xcd6f4233). With the legacy inHash L1 check gone, a checkpoint carrying
messages that do not match the Inbox now reverts at validateInboxConsumption
with Rollup__InvalidInboxRollingHash (0xed1f7bb5).
… checkpoint header (A-1387)

Dropping inHash from the checkpoint header changes the checkpoint hash preimage, so the checkpoint ids the
tips store persists change value. The stored format is unchanged (read-defaultable), so only the snapshot is
regenerated; no PXE_DATA_SCHEMA_VERSION bump.
…reaming bucket selector (A-1387)

The A-1387 rewrite that removed inHash left this test's inbox handling half-adapted: it hardcoded
previousInboxRollingHash to Fr.ZERO and proposed with bucketHint 0n while consuming real L1->L2 messages, so
message-consuming checkpoints reverted on L1 with Rollup__InvalidInboxRollingHash / UnconsumedInboxMessages.
INBOX_LAG_SECONDS is an L1-time censorship cutoff (not whole checkpoints), so no checkpoint-depth shift
register can reproduce the aged bucket set. Mirror the real Inbox buckets into the test's
MockL1ToL2MessageSource, then reuse the production selectInboxBucketForBlock (which mirrors
ProposeLib.validateInboxConsumption) to pick exactly the buckets each checkpoint must consume, deriving the
consumed bundle, the propose bucket hint, and the header rolling hash from that one selection so header,
world state, and L1 agree. Matches the A-1388 rewrite of this file so the segment rebase dissolves to zero.
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch from 141286e to 92c4a70 Compare July 21, 2026 22:32
@spalladino
spalladino force-pushed the spl/a-1386-l1-cleanup branch from 5295095 to e853cd3 Compare July 21, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant