Skip to content

feat(validator): add VALIDATOR_ env vars for independent block limits (backport #21060)#21109

Closed
AztecBot wants to merge 1 commit intov4from
claudebox/backport-21060-to-v4
Closed

feat(validator): add VALIDATOR_ env vars for independent block limits (backport #21060)#21109
AztecBot wants to merge 1 commit intov4from
claudebox/backport-21060-to-v4

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 4, 2026

Summary

Backport of #21060 to v4.

  • 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

Conflict resolution notes

The automatic cherry-pick failed with conflicts in 6 files. Resolution:

  • docs changelog & README: Resolved by taking incoming content and removing conflict markers
  • aztec-node/server.ts: v4 doesn't have rollupManaLimit in the builder config, so the maxTxsPerCheckpoint override was removed (validation still happens via validateCheckpoint)
  • libp2p_service.ts: Adapted to use shared proposalValidatorOpts pattern with validateMaxTxsPerBlock
  • stdlib/interfaces/validator.ts: Kept v4's txPublicSetupAllowList naming (vs next's txPublicSetupAllowListExtend), removed maxTxsPerBlock from Pick
  • validator.ts: Added validateCheckpoint call without rollupManaLimit (not available in v4's builder config)
  • New files: Created stdlib/src/checkpoint/validate.ts and added L2Block.computeDAGasUsed() method (prerequisites that exist on next but not v4)

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

…#21060)

- 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`

- [x] `yarn build` passes
- [x] `yarn format` and `yarn lint` clean
- [x] `yarn workspace @aztec/validator-client test` — 158 passed
- [x] `yarn workspace @aztec/stdlib test
src/checkpoint/validate.test.ts` — 20 passed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 4, 2026
@AztecBot AztecBot closed this Mar 4, 2026
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