Skip to content

feat(sequencer): add SEQ_MAX_TX_PER_CHECKPOINT config (backport #21016)#21078

Closed
AztecBot wants to merge 2 commits intov4from
claudebox/d582f035481b9054-1
Closed

feat(sequencer): add SEQ_MAX_TX_PER_CHECKPOINT config (backport #21016)#21078
AztecBot wants to merge 2 commits intov4from
claudebox/d582f035481b9054-1

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 3, 2026

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 via SEQ_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 by checkpointBudget - 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() on L2Block: 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:

  • Used txPublicSetupAllowList (v4 naming) instead of txPublicSetupAllowListExtend (next naming)
  • Added rollupManaLimit to v4's SequencerRollupConstants type
  • Added gasPerBlockAllocationMultiplier to SequencerConfig interface, schema, default config, and env var mappings
  • Added computeDAGasUsed() method to L2Block (was part of the original PR but missed by cherry-pick)
  • Created validate.ts in stdlib/checkpoint (file didn't exist on v4) and wired up barrel export

Test plan

  • CI passes build and tests for affected packages (stdlib, sequencer-client, validator-client)
  • checkpoint_builder.test.ts passes with new capLimitsByCheckpointBudgets test suite
  • Existing checkpoint/sequencer tests remain green

🤖 Generated with Claude Code

ClaudeBox log: http://ci.aztec-labs.com/d582f035481b9054-1

@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 3, 2026
@AztecBot AztecBot closed this Mar 4, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant