Skip to content

feat(sequencer): add SEQ_MAX_TX_PER_CHECKPOINT config#21016

Merged
spalladino merged 4 commits intomerge-train/spartanfrom
palla/max-txs-per-checkpoint
Mar 3, 2026
Merged

feat(sequencer): add SEQ_MAX_TX_PER_CHECKPOINT config#21016
spalladino merged 4 commits intomerge-train/spartanfrom
palla/max-txs-per-checkpoint

Conversation

@spalladino
Copy link
Contributor

@spalladino spalladino commented Mar 2, 2026

Fixes A-611

Summary

  • Adds SEQ_MAX_TX_PER_CHECKPOINT env var and maxTxsPerCheckpoint config to limit total transactions across all blocks in a checkpoint, mirroring the existing two-level pattern for gas limits
  • Proposers derive per-block TX limits from the checkpoint limit (using ceil(checkpointLimit / maxBlocks * multiplier)) when SEQ_MAX_TX_PER_BLOCK is not explicitly set
  • Validators enforce the checkpoint TX budget via capLimitsByCheckpointBudgets and validateCheckpoint
  • Makes maxTxsPerBlock mandatory (number | undefined) in proposal validator constructors to prevent missed wiring, and wires it through P2P, validator-client, and sequencer-client
  • Extracts computeBlockLimits as a free function with dedicated unit tests
  • Moves maxTxsPerBlock config mapping to sharedSequencerConfigMappings so both P2P and sequencer packages share it
  • Adds extra structural validations to the checkpoint validation, and wires them to the archiver data updater.

Test plan

  • Unit tests for computeBlockLimits (L2 gas, DA gas, TX count derivation, multi-block mode)
  • Unit tests for maxTxsPerBlock validation in shared proposal validator test suite (block + checkpoint)
  • Unit tests for maxTxsPerCheckpoint capping in checkpoint_builder.test.ts
  • Unit tests for TX limit validation in validate.ts
  • Existing sequencer and checkpoint proposal job tests updated and passing

🤖 Generated with Claude Code

@spalladino spalladino added the ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure label Mar 2, 2026
@spalladino spalladino force-pushed the palla/max-txs-per-checkpoint branch 2 times, most recently from 06a9ed2 to 304530c Compare March 3, 2026 13:11
Base automatically changed from palla/update-block-build-limits to merge-train/spartan March 3, 2026 13:49
spalladino and others added 3 commits March 3, 2026 10:50
Adds a checkpoint-level aggregate transaction count limit, mirroring the
existing two-level pattern used for gas limits. Proposers derive per-block
TX limits from the checkpoint limit when SEQ_MAX_TX_PER_BLOCK is not
explicitly set. Validators enforce the checkpoint budget via
capLimitsByCheckpointBudgets and validateCheckpoint.

Also extracts computeBlockLimits as a free function, makes maxTxsPerBlock
mandatory (number | undefined) in proposal validators to prevent missed
wiring, and adds unit tests across all affected packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds extra validations to the validateCheckpoint method, and calls it
from the data store updater.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@spalladino spalladino enabled auto-merge (squash) March 3, 2026 20:23
@spalladino spalladino merged commit 503d0f9 into merge-train/spartan Mar 3, 2026
16 of 20 checks passed
@spalladino spalladino deleted the palla/max-txs-per-checkpoint branch March 3, 2026 20:31
@AztecBot
Copy link
Collaborator

AztecBot commented Mar 3, 2026

❌ Failed to cherry-pick to v4 due to conflicts. Dispatching ClaudeBox to resolve. View backport run.

AztecBot added a commit that referenced this pull request Mar 4, 2026
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
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
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2026
BEGIN_COMMIT_OVERRIDE
test: update proving-real test to mbps (#20991)
chore: epoch proving log analyzer (#21033)
chore: update pause script to allow resume (#21032)
feat: price bump for RPC transaction replacement (#20806)
refactor: remove update checker, retain version checks (#20898)
fix: (A-592) p2p client proposal tx collector test (#20998)
refactor: use publishers-per-pod in deployments (#21039)
chore: web3signer refreshes keystore (#21045)
feat(sequencer): set block building limits from checkpoint limits
(#20974)
chore(e2e): fix e2e bot L1 tx nonce reuse (#21052)
feat: Update L1 to L2 message APIs (#20913)
fix: (A-589) epochs l1 reorgs test (#20999)
feat(sequencer): add SEQ_MAX_TX_PER_CHECKPOINT config (#21016)
fix: drop --pid=host from docker_isolate (#21081)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
feat(validator): add VALIDATOR_ env vars for independent block limits
(#21060)
refactor(p2p): decouple proposal validators from base class via
composition (#21075)
feat: additional validation in public setup allowlist (onlySelf + null
msg sender) (#21122)
fix: (A-591) aztecProofSubmissionEpochs incorrectly named as
aztecProofSubmissionWindow (#21108)
refactor(sequencer): rename SEQ_GAS_PER_BLOCK_ALLOCATION_MULTIPLIER to
SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER (#21125)
fix: unbound variable in check_doc_references.sh with set -u (#21126)
feat: calldata length validation of public setup function allowlist
(#21139)
fix: include mismatched values in tx metadata validation errors (#21147)
feat: single-node implementation of slash-protection signer (#20894)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
chore: More updated Alpha configuration (#21155)
chore: tally slashing pruning improvements (#21161)
fix: update dependencies (#20997)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21169)
refactor(p2p): (A-588) maintain sorted array in tx pool instead of
sorting on read (#21079)
fix(p2p): report most severe failure in runValidations (#21185)
fix: use dedicated L1 account for bot bridge resume tests to avoid nonce
race (#21148)
fix: parse error.message in formatViemError (#21163)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
chore: code decuplication + refactor (public setup allowlist) (#21200)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v4 ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants