Skip to content

test(fast-inbox): streaming inbox e2e latency and mid-checkpoint inclusion (A-1385)#24790

Open
spalladino wants to merge 5 commits into
spl/a-1384-flip-streaming-inboxfrom
spl/a-1385-streaming-e2e
Open

test(fast-inbox): streaming inbox e2e latency and mid-checkpoint inclusion (A-1385)#24790
spalladino wants to merge 5 commits into
spl/a-1384-flip-streaming-inboxfrom
spl/a-1385-streaming-e2e

Conversation

@spalladino

@spalladino spalladino commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Test-only coverage for the Fast Inbox (AZIP-22) streaming L1→L2 message path (issue A-1385, FI-15) — the behaviours the legacy suite could not express, because pre-flip every message entered at the first block of the next checkpoint.

Stacked on the node/flip phase: #24784 (A-1379) → #24785 (A-1380) → #24786 (A-1381) → #24787 (A-1382) → #24788 (A-1383) → #24789 (A-1384). Base is spl/a-1384-flip-streaming-inbox.

e2e (end-to-end)

New single-node/cross-chain/streaming_inbox.test.ts, on the proven CrossChainMessagingTest fixture (production pipelining sequencer) with a widened slot (36s, 6s blocks → up to ~4 blocks per checkpoint) and minTxsPerBlock: 0:

  • Mid-checkpoint inclusion — times a send so the message ages past INBOX_LAG_SECONDS partway through a checkpoint's build, then asserts the inserting block has indexWithinCheckpoint > 0 and that the immediately preceding block did not yet carry the message. Retries with fresh messages if a message happens to age exactly at a checkpoint boundary.
  • Latency bound — asserts, slot-denominated, that includingBlockTimestamp − messageL1Timestamp ≤ INBOX_LAG_SECONDS + 2·slotDuration (derived from the deployed constants, not hardcoded), and that it is positive. Wall-clock latency is logged only (A-1178 style), never asserted.
  • Message-only block — on a drained pool, asserts the block that consumes the message carries zero tx effects (the FI-05 zero-tx / non-empty-bundle shape) and that the chain keeps proving past it.
  • Send-then-consume on the streaming path — consumes a streaming-inserted message with a public tx by its compact leaf index and asserts a second consume reverts (double-spend protection); the insert/consume block relationship is logged.

prover-client

New checkpoint-sub-tree-orchestrator test for a checkpoint whose L1→L2 messages span multiple blocks (a non-first block carries a bundle). Asserts per-block start/end L1→L2 tree-snapshot continuity and slice partitioning (no gap/overlap; block slice = [prevBlockLeafCount, blockLeafCount)) and the isFirstBlock flag. Adds TestContext.makeCheckpointWithMessagesPerBlock to distribute a bundle across a checkpoint's blocks (the single-block-per-checkpoint makeCheckpoint puts every message in the first block).

Validation

  • The e2e suite and the prover-client orchestrator test could not be run locally — the local build is broken in noir-protocol-circuits-types/simulator/prover-client from stale circuit artifacts, and end-to-end sits downstream. CI validates both. Every helper, fixture, and API call is grounded on an existing green suite (l1_to_l2.test.ts, cross_chain_public_message.test.ts) and verified against the current interfaces. No packages that build locally (stdlib, blob-lib, ethereum, foundation) are touched.
  • Reviewed by codex (gpt-5.6-terra): it caught an incorrect message-sponge-continuity assumption in the prover test (non-first block roots inherit the checkpoint-wide sponge, not the prior block's end sponge); those sponge assertions were removed, leaving the correct L1→L2 tree-snapshot partitioning checks.

Review follow-up (phase-2 final review)

The multi-block-slice orchestrator test now also asserts per-block message-sponge continuity (start empty, each block absorbs exactly its slice, last end equals the InboxParity sponge) and turns its last block into a zero-tx message-only block, exercising the msgs-only block-root wiring fixed in #24789. A stray async in the e2e suite was dropped (lint).

…age (A-1385)

Add a checkpoint-sub-tree orchestrator test for a checkpoint whose L1-to-L2
messages span multiple blocks, including a non-first block carrying a bundle.
Asserts per-block start/end L1-to-L2 snapshot continuity and slice partitioning
(no gap/overlap; block slice = [prevBlockLeafCount, blockLeafCount)).

Adds TestContext.makeCheckpointWithMessagesPerBlock to distribute a bundle
across a checkpoint's blocks (the single-block-per-checkpoint makeCheckpoint
puts every message in the first block).
…usion (A-1385)

New end-to-end coverage the legacy suite could not express (streaming Inbox,
AZIP-22 / FI-15): a message included in a non-first block of a checkpoint
(mid-checkpoint), the L1-inclusion to L2-availability latency within the
streaming bound (slot-denominated), a message-only zero-tx block on an empty
pool, and a public consume of a streaming-inserted message by compact index
with double-spend protection.
…only block root (A-1385)

Extends the multi-block-slice orchestrator test to assert per-block message
sponge continuity (first block starts empty, each block absorbs exactly its
own slice, last end sponge equals the InboxParity sponge) and turns its last
block into a zero-tx message-only block, exercising the msgs-only block root
selection wired in the flip. Also drops a stray async on a helper with no
await in the streaming inbox e2e (lint).
…s-only block (A-1385)

Drive the streaming Inbox shapes through the entire proving DAG (block roots
incl. msgs-only, block merge, checkpoint roots, checkpoint merge, root rollup)
at simulated-circuit fidelity in the top-tree orchestrator suite: a checkpoint
whose messages land in a non-first block plus a zero-tx message-only block,
followed by message-carrying and message-less checkpoints. Asserts the root
rollup's inbox rolling-hash range matches the accumulation over the epoch's
messages in block order.

TestContext now threads the inbox rolling hash across the checkpoints it
builds (previously hardcoded to zero), so a checkpoint built after a
message-carrying one commits the correct continuation in its header and the
checkpoint merge continuity assert can be exercised.
…tputs (A-1385)

The sub-tree result surfaces at most two top-level nodes for the binary checkpoint root, so a
three-block checkpoint yields [block-merge(blocks 0-1), block 2] rather than one output per block.
The slice/sponge continuity walk now runs over expected per-output block ranges; merge public
inputs span their range (is_first_block from the left child, start sponge/state from the left,
end sponge/state from the right).
@spalladino
spalladino force-pushed the spl/a-1385-streaming-e2e branch from 6599148 to 595fd99 Compare July 19, 2026 20:51
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