feat: sequencer streaming message selection, flag off (A-1382)#24787
Open
spalladino wants to merge 3 commits into
Open
feat: sequencer streaming message selection, flag off (A-1382)#24787spalladino wants to merge 3 commits into
spalladino wants to merge 3 commits into
Conversation
…ING_INBOX (A-1382) Behind the shared `streamingInbox` flag (env `STREAMING_INBOX`, default off), the sequencer selects L1-to-L2 messages from the Inbox rolling-hash buckets per block instead of consuming the whole checkpoint's messages up front. - Adds a pure `inbox_bucket_selector` that mirrors `ProposeLib.validateInboxConsumption`: newest lag-eligible bucket, per-block/per-checkpoint cap walk-back with cap-escape, and a last-block cutoff floor (cutoff = toTimestamp(slot-1) - INBOX_LAG_SECONDS). - Adds `INBOX_LAG_SECONDS` (12) to constants.nr, regenerated into the TS constants. - Threads a per-block message bundle through the checkpoint builder interface and an optional signed bucket reference onto block proposals. - Flag off is byte-identical: the new paths are gated at checkpoint start and per block.
…eckpoint cursor (A-1382)
…inal block and defer bundle accumulation (A-1382) - The censorship cutoff floor now applies on whichever block ends the checkpoint, including the block that reaches the per-checkpoint block cap, not only the timetable's last sub-slot, so the checkpoint always consumes through the cutoff. - The lightweight builder accumulates a block's streaming message bundle only after the block is fully built, so a mid-build failure leaves the checkpoint's message list (and its inHash/rolling hash) consistent with the blocks actually built.
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.
Implements A-1382 (FI-12): sequencer streaming Inbox message selection behind a
streamingInboxflag, default off. Part of the Fast Inbox stack (AZIP-22).Flag semantics
STREAMING_INBOX->streamingInbox: boolean(default false), defined once instdlib'ssharedSequencerConfigMappingsso the sequencer reads it now and the validator (A-1383) maps the same env. Flag off is byte-identical: the new paths are gated at checkpoint start and per block.proposestill enforces the legacy per-checkpoint consumption until the flip, A-1384). The streaming path is exercised with unit/mock tests only.Selection policy (mirrors
ProposeLib.validateInboxConsumption)New pure selector
sequencer-client/src/sequencer/inbox_bucket_selector.ts, run per block:getLatestInboxBucketAtOrBefore(now - INBOX_LAG_SECONDS)); on the checkpoint's final block, also consider the cutoff bucket and take the newer, so consumption reaches the censorship floor.bucket.totalMsgCount - parent.totalMsgCount) and the per-checkpoint cap (bucket.totalMsgCount - checkpointStartTotalMsgCount). If even the first forward bucket overshoots the per-checkpoint cap, consume nothing — matching L1's cap-escape (next.totalMsgCount - parentTotal > MAX_L1_TO_L2_MSGS_PER_CHECKPOINT).<=comparisons make a bucket exactlyINBOX_LAG_SECONDSold eligible and a bucket exactly at the cutoff mandatory, matching L1's strictnext.timestamp > cutoff.Cutoff is computed as
getTimestampForSlot(slot - 1) - INBOX_LAG_SECONDS, matchingProposeLibexactly (not the consensus timetable'sgetBuildFrameStart, which subtracts an extra ethereum-slot). Boundary vectors pinned against A-1371 resolution section 13.Cutoff floor
On the checkpoint's final block (including the block that reaches the per-checkpoint block cap) the cutoff is a consumption floor, so the checkpoint's own header would pass the L1 censorship assert post-flip.
Builder interface change
ICheckpointBlockBuilder.buildBlockgains an optional per-blockl1ToL2Messagesbundle;ICheckpointsBuilder.startCheckpointgainsinsertMessagesPerBlock. Threaded throughFullNodeCheckpointsBuilder/CheckpointBuilderand the lightweight builder (first-in-checkpoint bundle padded, non-first compact; the inHash/rolling hash recompute over the accumulated logical messages).Validator.createBlockProposal->ValidationService->BlockProposal.createProposalFromSigner).Constant
INBOX_LAG_SECONDS = 12added toconstants.nrand regenerated into the TS constants (constants.gen.ts). Not emitted toConstantsGen.sol(Solidity whitelist);ProposeLibkeeps its local copy pending consolidation (A-1434).Open item / to verify on CI
sequencer-client,validator-client,prover-clientis blocked by the known stale-artifact/@aztec/bb-avm-simbreakage, so CI is the typecheck of record for the job/builder/proposal edits. The pure selector unit tests and the stdlib config changes were verified locally.