Skip to content

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

Open
spalladino wants to merge 5 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 5 commits into
spl/a-1386-l1-cleanupfrom
spl/a-1387-circuits-cleanup

Conversation

@spalladino

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.

@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 2 times, most recently from b82f5cc to 8287158 Compare July 19, 2026 18: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.
@spalladino
spalladino force-pushed the spl/a-1387-circuits-cleanup branch 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
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