feat(sequencer): add SEQ_MAX_TX_PER_CHECKPOINT config (backport #21016)#21078
Closed
feat(sequencer): add SEQ_MAX_TX_PER_CHECKPOINT config (backport #21016)#21078
Conversation
3 tasks
spalladino
pushed a commit
that referenced
this pull request
Mar 4, 2026
… (#21115) ## Summary Manual backport of #21016 to v4. Replaces #21078 which had too many merge conflicts. - Adds `SEQ_MAX_TX_PER_CHECKPOINT` config to limit total transactions across all blocks in a checkpoint - Extracts `computeBlockLimits` as a free function from `SequencerClient` for deriving per-block limits from checkpoint limits - Adds `validateCheckpointStructure` for structural validation of checkpoints (block count, slot matching, archive chaining) - Extends `capLimitsByCheckpointBudgets` with TX count capping - Fixes `Checkpoint.random` to properly align global variables between header and blocks - Adds tests for `computeBlockLimits`, `validateCheckpointStructure`, and TX budget capping Adapted for v4 naming conventions (e.g. `txPublicSetupAllowList` vs `txPublicSetupAllowListExtend`). ## Test plan - [x] TypeScript compilation verified (no TS errors from changed files) - [ ] CI should pass (pre-existing v4 build infra issues with `private_kernel_reset_dimensions.json` are unrelated) - [ ] New unit tests: `computeBlockLimits`, `validateCheckpointStructure`, checkpoint TX budget capping, `maxTxsPerBlock` proposal validation ClaudeBox log: http://ci.aztec-labs.com/53d7ba930fa50e5d-1
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.
Summary
Backport of #21016 to v4.
Adds checkpoint-level transaction and gas budget configuration to the sequencer:
SEQ_MAX_TX_PER_CHECKPOINT: Caps total transactions across all blocks in a checkpoint. Per-block tx limits are derived from this (unless explicitly overridden viaSEQ_MAX_TX_PER_BLOCK).SEQ_GAS_PER_BLOCK_ALLOCATION_MULTIPLIER(default: 2): Controls how per-block gas/tx budgets are derived from checkpoint limits. A multiplier > 1 lets early blocks use more than their even share.computeBlockLimits(): Derives per-block L2 gas, DA gas, and tx count budgets at startup from L1 rollup limits and the sequencer timetable.capLimitsByCheckpointBudgets(): Before each block is built, caps per-block limits bycheckpointBudget - sum(used by prior blocks)for all three gas dimensions and for transaction count.validateCheckpoint(): Validates structural integrity, gas limits, tx counts, and blob fields of a completed checkpoint before proposing.computeDAGasUsed()onL2Block: Recomputes DA gas used by a block from its tx effects and blob fields.Conflict resolution notes
The cherry-pick had 8 conflicted files. Key adaptations for v4:
txPublicSetupAllowList(v4 naming) instead oftxPublicSetupAllowListExtend(next naming)rollupManaLimitto v4'sSequencerRollupConstantstypegasPerBlockAllocationMultipliertoSequencerConfiginterface, schema, default config, and env var mappingscomputeDAGasUsed()method toL2Block(was part of the original PR but missed by cherry-pick)validate.tsin stdlib/checkpoint (file didn't exist on v4) and wired up barrel exportTest plan
checkpoint_builder.test.tspasses with newcapLimitsByCheckpointBudgetstest suite🤖 Generated with Claude Code
ClaudeBox log: http://ci.aztec-labs.com/d582f035481b9054-1