Skip to content

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

Merged
spalladino merged 1 commit intov4from
claudebox/redo-backport-21016-v4
Mar 4, 2026
Merged

feat(sequencer): add SEQ_MAX_TX_PER_CHECKPOINT config (backport #21016)#21115
spalladino merged 1 commit intov4from
claudebox/redo-backport-21016-v4

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 4, 2026

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

  • 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

Backport of #21016 to v4.

Adds a `SEQ_MAX_TX_PER_CHECKPOINT` configuration option that limits the
total number of transactions across all blocks in a checkpoint. Per-block
TX limits are derived from the checkpoint limit using the same
ceil(limit/maxBlocks*multiplier) pattern used for gas limits.

Key changes:
- Extract `computeBlockLimits` as a free function from SequencerClient
- Add `validateCheckpointStructure` for structural validation of checkpoints
- Extend `capLimitsByCheckpointBudgets` with TX count capping
- Add `maxTxsPerCheckpoint` to SequencerConfig and block builder config
- Fix Checkpoint.random to properly align global variables between header and blocks
- Add tests for computeBlockLimits, validateCheckpointStructure, and TX budget capping
@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 4, 2026
@spalladino spalladino marked this pull request as ready for review March 4, 2026 17:43
@spalladino spalladino enabled auto-merge (squash) March 4, 2026 17:54
@AztecBot
Copy link
Collaborator Author

AztecBot commented Mar 4, 2026

Flakey Tests

🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/89c28340e0a9ed4e�89c28340e0a9ed4e8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_l1_reorgs.parallel.test.ts "updates L1 to L2 messages changed due to an L1 reorg" (66s) (code: 0) group:e2e-p2p-epoch-flakes
\033FLAKED\033 (8;;http://ci.aztec-labs.com/a4a1b25f841aa19b�a4a1b25f841aa19b8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_mbps.parallel.test.ts "builds multiple blocks per slot with transactions anchored to checkpointed block" (177s) (code: 0) group:e2e-p2p-epoch-flakes

@spalladino spalladino merged commit 64ab33f into v4 Mar 4, 2026
21 checks passed
@spalladino spalladino deleted the claudebox/redo-backport-21016-v4 branch March 4, 2026 18:01
spalladino pushed a commit that referenced this pull request Mar 4, 2026
… (backport #21060) (#21132)

## Summary

Backport of #21060
to v4. Redone from scratch on current v4 tip (after #21115 landed).

- Adds `VALIDATOR_MAX_L2_BLOCK_GAS`, `VALIDATOR_MAX_DA_BLOCK_GAS`,
`VALIDATOR_MAX_TX_PER_BLOCK`, and `VALIDATOR_MAX_TX_PER_CHECKPOINT` env
vars so operators can tune validation limits independently from `SEQ_`
proposer limits
- When a `VALIDATOR_` var is not set, no per-block limit is enforced for
that dimension (checkpoint-level protocol limits still apply)
- P2P gossip validation uses `VALIDATOR_MAX_TX_PER_BLOCK` when set,
falling back to the sequencer's `maxTxsPerBlock`
- Validators can now pass per-block gas limits and tx limits to
`buildBlock` during re-execution and `validateCheckpoint` for final
validation

### Changes from previous attempt (#21109)

The previous backport (#21109, now closed) was done before other PRs
landed on v4 and became unmergeable. This is a clean redo on top of the
current v4 tip where all prerequisites (`validateCheckpoint`,
`computeDAGasUsed`, `maxTxsPerCheckpoint`) already exist.

Build verified clean: http://ci.aztec-labs.com/80f4d462d5b81f2f

ClaudeBox log: http://ci.aztec-labs.com/5215aa10b97d3ffe-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.

2 participants