feat: streaming inbox propose validation, unwired (A-1378)#24618
Draft
AztecBot wants to merge 1 commit into
Draft
feat: streaming inbox propose validation, unwired (A-1378)#24618AztecBot wants to merge 1 commit into
AztecBot wants to merge 1 commit into
Conversation
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.
Stacked on #24617 (A-1377). AZIP-22 Fast Inbox, FI-08.
What
Implements the AZIP's censorship assert as
ProposeLib.validateInboxConsumption— a new library function that is not yet called: today'sinbox.consume()/inHashcheck inproposeis untouched, so this is dead code until the flip wires it in.Given the checkpoint header's
inboxRollingHash, an unsigned calldata bucket hint, the proposed slot, and the parent checkpoint's cumulative consumed total (which the flip will source from the temp checkpoint log), the function enforces:inbox.getBucket(hint)(Rollup__InvalidInboxRollingHash). The hint is a lookup aid only — a wrong hint reverts, it cannot change what gets accepted — andgetBucketitself rejects hints beyond the current bucket or already overwritten in the ring. A checkpoint consuming nothing references the same bucket as its parent (the genesis bucket for the first checkpoint), so there is no base case.hint + 1) must be absent, past the cutoff, or cap-escaped (Rollup__UnconsumedInboxMessages). The cutoff is the build-frame start minusINBOX_LAG_SECONDS: a checkpoint proposed in slot S is built during slot S-1 (proposer pipelining), and validators are not required to act on buckets younger than one L1 slot at build start, socutoff = toTimestamp(S-1) - 12. Cap escape allows stopping when consuming through the next bucket would exceedMAX_L1_TO_L2_MSGS_PER_CHECKPOINT(1024) messages since the parent's total. Both comparisons are exact-boundary tested.On success the function advances the Inbox's new consumed-bucket pointer (
markBucketConsumed, rollup-only): the monotonic cache of consumption position that the upcoming ring overwrite protection needs. It never rewinds — per the design, on prunes the per-checkpoint records in the rollup are the source of truth, and the pointer is only an insert-path locality cache, which also makes it safe under reorged re-proposals.INBOX_LAG_SECONDS = 12andMAX_L1_TO_L2_MSGS_PER_CHECKPOINT = 1024are defined at file level inProposeLibfor now; they mirror the protocol constants and should move into the generatedConstantslibrary once the Solidity emitter allow-list includes them.Testing
New
ProposeInboxConsumption.t.sol(15 tests) drives the library function through a harness that owns the Inbox and TimeLib storage, covering the roadmap done-when plus boundaries:Full
forge testsuite: 893 passed, 0 failed (7 pre-existing skips).Created by claudebox · group:
slackbot