Skip to content

chore: Accumulated backports to v4#21187

Merged
ludamad merged 37 commits intov4-nextfrom
backport-to-v4-staging
Mar 10, 2026
Merged

chore: Accumulated backports to v4#21187
ludamad merged 37 commits intov4-nextfrom
backport-to-v4-staging

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 5, 2026

BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker (#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler (#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist (#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
feat!: Expose offchain effects when simulating/sending txs (backport #20563) (#21110)
chore: bump minor version (#21171)
chore: backport #21161 (tally slashing pruning improvements) to v4 (#21166)
chore: More updated Alpha configuration (backport #21155) (#21165)
fix(p2p): report most severe failure in runValidations (#21185)
feat: add ergonomic conversions for Noir's Option<T> (#21107)
docs: clarifying Noir fields vs struct fields in event metadata (#21172)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
fix: update dependencies (#20997)
chore: New alpha-net environment (#20800) (#21202)
chore: code decuplication + refactor (public setup allowlist) (#21200)
feat: mask all ciphertext fields with Poseidon2-derived values (backport #21009) (#21140)
chore: disable sponsored FPC in testnet (#21235)
feat!: exposing pub event pagination on wallet (#21197)
refactor(pxe): narrow tryGetPublicKeysAndPartialAddress return type (backport #21208) (#21236)
feat: orchestrator enqueues via serial queue (#21247)
feat: rollup mana limit gas validation (#21219)
chore: deploy SPONSORED_FPC in test networks (#21254)
fix(sequencer): fix log when not enough txs (#21297)
END_COMMIT_OVERRIDE

ledwards2225 and others added 20 commits March 3, 2026 16:09
Adds Chonk proof compression logic that utilizes two things:
1. Suyash's proposed EC point compression: store (x, sign_bit) instead of (x, y); leverage curve equation to reconstruct y-coord
2. Store all fields as u256 / 32 bytes. (Similar effect to Snappy compression but seems to do slightly better)

Overall effect is that each single "component" of the proof is represented as 32 bytes. E.g. an Fq (naively 2 Frs) becomes one u256. A bn254 commitment (naively 2 Fqs = 4 Frs) becomes one u256 representing the x-coord.

High level stats:
| Metric            | Value                                    |
|-------------------|------------------------------------------|
| Original size     | 1,935 Fr elements = ~60 KB|
| Snappy compressed size   | ~47 KB                    |
| Compressed size   | ~35 KB                   |
| Compression ratio | 1.72x                                    |
| Compress time     | 0.64 ms                                  |
| Decompress time   | 3.5 ms                                   |
This PR fixes issue A-548 by replacing the block-based L1-to-L2 message readiness API with a checkpoint-based one. The core insight: messages are grouped by checkpoint number, not block number, so readiness should be checked against the checkpoint the node has synced to.

Key changes:

New API getCheckpointNumber() added to AztecNode, L2BlockSource, and archiver interfaces — returns the latest synced checkpoint number.

Renamed getL1ToL2MessageBlock → getL1ToL2MessageCheckpoint — now returns CheckpointNumber instead of BlockNumber, eliminating the deprecated BlockNumber.fromCheckpointNumber cast.

Simplified isL1ToL2MessageReady — removed the forPublicConsumption flag entirely. This now checks whether we have reached the first block in the message's inclusion checkpoint.

Updated all callers — bot factory, cross-chain bot, e2e tests, spartan setup, and epoch tests. Removed all A-548 workaround comments.

E2E test improvements — new helpers advanceCheckpoint and waitForBlockToCheckpoint for checkpoint-aware test flow. The drift test now mines checkpoints instead of blocks.
Adapts `proof_compression.hpp` for v4's Translator proof layout, which
differs from `next` in three ways:

1. **Wire commitments**: v4 uses `(NUM_WITNESS_ENTITIES - 3 -
NUM_OP_QUEUE_WIRES)` as a single batch instead of separately listing
gemini masking poly, `NUM_COMMITMENTS_IN_PROOF` wires, and z_perm
2. **Sumcheck evaluations**: v4 sends all entity evaluations
(`NUM_ALL_ENTITIES`) instead of a subset (`NUM_SENT_EVALUATIONS`)
3. **Gemini P pos/neg**: v4 includes two extra Gemini interleaving
evaluations that were removed on `next`

The static_assert validates the walk produces exactly
`TranslatorFlavor::PROOF_LENGTH` Fr elements. Build verified locally —
`chonk_tests` compiles cleanly.

This unblocks backport PR
#21064.

ClaudeBox log: http://ci.aztec-labs.com/eb8ee3312bb1d8e2-2
…ker (#21086)

Fixes `TypeError: Do not know how to serialize a BigInt` in
`p2p_client.proposal_tx_collector.bench.test.ts`.

`childProcess.send()` uses JSON serialization under the hood, which
cannot handle BigInt values. The recently added `priceBumpPercentage`
config field is a `bigint`, causing the worker fork to crash.

This omits `priceBumpPercentage` from the IPC config

ClaudeBox log: http://ci.aztec-labs.com/6d6b6eba6d0eecf1-1
## Summary

- Extracts the node's rollup standby logic into a shared module (`standby.ts`) so both the node and the prover broker can wait for a compatible L1 rollup before starting
- Adds standby mode to the prover broker startup — previously it would crash on `getL1Config()` if the canonical rollup was incompatible (e.g. during L1 contract upgrades)
- Reduces the standby poll interval from 600s to 60s and replaces the manual `while(true) + sleep` loop with `retryUntil` from `@aztec/foundation/retry` (both suggested as review feedback on #20937)

## Changes

**New: `aztec/src/cli/cmds/standby.ts`**
- `computeExpectedGenesisRoot(config, userLog)` — computes genesis archive root from test accounts, sponsored FPC, and prefund addresses
- `waitForCompatibleRollup(config, expectedGenesisRoot, port, userLog)` — checks L1 rollup genesis root, enters standby with a K8s health server if mismatch, polls every 60s via `retryUntil`

**Modified: `aztec/src/cli/cmds/start_node.ts`**
- Removed inline `waitForCompatibleRollup` function and genesis computation logic
- Now imports and calls the shared functions from `standby.ts`
- Cleaned up unused imports (`RegistryContract`, `RollupContract`, `sleep`, `Koa`, etc.)

**Modified: `aztec/src/cli/cmds/start_prover_broker.ts`**
- Added `computeExpectedGenesisRoot` + `waitForCompatibleRollup` calls before `getL1Config()`, matching the node's pattern

Fixes A-608
)

The default block handler was limited in that it failed to handle block proposals out of order, missed validations, missed proper timeouts, etc. It's not removed in favor of the full block proposal handler, which is installed if the validator client is not set.
## Summary
- Add `include` field to barretenberg-rs `Cargo.toml` so generated `api.rs` and `generated_types.rs` are packaged by `cargo publish`, even though they remain gitignored
- Add `release` function to `barretenberg/rust/bootstrap.sh` — sets crate version from `REF_NAME`, verifies generated files exist, and runs `cargo publish`
- Hook `barretenberg/rust` into the top-level release orchestrator (after `barretenberg/ts` which generates the Rust bindings)
- Add `publish = false` to the tests crate

## How it works
1. Generated files stay **gitignored** — not committed to the repo
2. The `include` field in `Cargo.toml` overrides `.gitignore` for `cargo publish`, so the files are packaged as long as they exist on disk
3. During a release, `barretenberg/ts` runs first (which calls `yarn generate`), then `barretenberg/rust` publishes
4. No separate workflow — follows the same unified release flow as npm packages

## Test plan
- [x] `cargo package --list --allow-dirty` confirms `src/api.rs` and `src/generated_types.rs` are included
- [x] `cargo publish --dry-run --allow-dirty --no-verify` succeeds
- [ ] Set `CARGO_REGISTRY_TOKEN` env var in release environment before first publish
…etup allowlist (backport #20909, #21122) (#21129)

Combined backport of
#20909 and
#21122 to v4.

#20909 re-enables function selector checking in the setup allowlist, and
#21122 (which depends on it) adds `onlySelf` and `rejectNullMsgSender`
validation flags.

Cherry-picked in order with conflict resolution for v4 compatibility.

ClaudeBox log: http://ci.aztec-labs.com/766112c90222bb64-2
…21139)

## Summary

- Add calldata length validation to the public setup function allowlist in `PhasesTxValidator`, preventing setup calls with malformed arguments from being accepted
- Extend `AllowedElement` with an optional `calldataLength` field and compute expected lengths dynamically from contract artifacts (`AuthRegistry`, `FeeJuice`, `Token`)
- Reject setup calls where calldata length doesn't match the expected length for the matched allowlist entry, returning a new `TX_ERROR_SETUP_WRONG_CALLDATA_LENGTH` error

## Details

Even when a setup function call matches the allowlist by address/class and selector, it can still revert if the arguments are malformed. Since Aztec's ABI has no variable-size inputs, validating that the calldata length matches the expected length for a given selector is sufficient to guarantee the arguments are deserializable.

**AllowedElement type** (`stdlib`): Added optional `calldataLength?: number` to both `AllowedInstanceFunction` and `AllowedClassFunction`, plus corresponding Zod schema updates.

**PhasesTxValidator** (`p2p`): After matching an entry by address or class+selector, checks `entry.calldataLength` against `publicCall.calldata.length` before proceeding to `onlySelf`/`rejectNullMsgSender` checks. When `calldataLength` is not set, any length is accepted (backwards compatible).

**Default allowlist** (`p2p`): Uses `getFunctionArtifactByName` + `countArgumentsSize` from `stdlib/abi` to compute expected calldata lengths from `AuthRegistryArtifact`, `FeeJuiceArtifact`, and `TokenContractArtifact`.

Fixes A-612
Resolve conflicts:
- Use v4's perBlockAllocationMultiplier naming (not gasPerBlockAllocationMultiplier)
- Keep backported txPublicSetupAllowListExtend rename
- Keep v4's validator-specific limits (validateMax* fields)
- Accept v4's deletion of proposal_validator test files
- Merge changelog and README sections from both sides
…pool (#21138)

## Summary

AVM simulations previously used `Napi::AsyncWorker` which runs on the **libuv thread pool**. During simulation, C++ calls back to JS for contract data via `BlockingCall`, and those JS callbacks do async I/O (LMDB, WorldState) that also needs libuv threads. With all libuv threads occupied by sims, the callback I/O deadlocks.

This PR introduces `ThreadedAsyncOperation` which spawns a **dedicated `std::thread` per simulation** and signals completion back to the JS event loop via `ThreadSafeFunction`. This structurally prevents the deadlock — libuv threads are always available for callback I/O.

### Changes
- **`async_op.hpp`**: New `ThreadedAsyncOperation` class — spawns `std::thread`, uses TSFN for completion, self-destructs after resolving/rejecting the promise
- **`avm_simulate_napi.cpp`**: Both `simulate` and `simulateWithHintedDbs` now use `ThreadedAsyncOperation` instead of `AsyncOperation`
- **`native_module.ts`**: Deadlock-prevention semaphore removed. Optional resource-limit semaphore available via `MAX_CONCURRENT_AVM_SIMULATIONS` env var (default: unlimited)

### Why this helps multi-sequencer tests
Previously, running multiple sequencers in one process required careful tuning of `UV_THREADPOOL_SIZE` and concurrent sim limits to avoid deadlock. With this change, AVM sims don't touch the libuv pool at all, so any number of concurrent simulations can run without starving each other's callbacks.

ClaudeBox log: http://ci.aztec-labs.com/884501541464780d-1
## Summary

Removes non-protocol contracts (Token class-based entries) from the default public setup allowlist for alpha. Token class IDs change with aztec-nr releases, making the allowlist hard to maintain—and FPC-based fee payment with custom tokens won't be supported on mainnet alpha.

- **Removed Token entries from the default allowlist** (`allowed_public_setup.ts`): only protocol contracts (AuthRegistry, FeeJuice) remain in the hardcoded defaults
- **Extended `parseAllowList` to support validation flags**: new optional flags segment (`os`, `rn`, `cl=N`) so node operators who manually re-add entries get proper `onlySelf`, `rejectNullMsgSender`, and `calldataLength` validation
- **Updated e2e tests to manually extend the allowlist**: `FeesTest` and `ClientFlowsBenchmark` now compute Token allowlist entries and pass them via `txPublicSetupAllowListExtend`
- **Updated local network node** (`local-network.ts`): computes Token allowlist entries at startup so FPC-based fee payments continue to work in local development and CI
- **Deprecated `PublicFeePaymentMethod` and `PrivateFeePaymentMethod`** in aztec.js with `@deprecated` JSDoc tags
- **Added CLI wallet deprecation warnings** for `fpc-public` and `fpc-private` payment methods
- **Added warning comment to FPC Noir contract** clarifying it's a reference implementation that won't work on mainnet alpha
- **Updated v4 changelog** with the breaking change, new flag syntax documentation, and migration guidance

## Test plan

- [x] Unit tests: `p2p/src/config.test.ts` (11 tests including 4 new flag parsing tests)
- [x] Unit tests: `p2p/src/msg_validators/tx_validator/phases_validator.test.ts` (23 tests)
- [x] E2E tests: all 8 fee test suites (26 tests total) — public_payments, private_payments, failures, account_init, gas_estimation, sponsored_payments, fee_juice_payments, fee_settings
- [ ] E2E: `e2e_local_network_example.test.ts` (requires running local network — unchanged, validated via local-network.ts code review)
- [x] Alert `@AztecProtocol/devrel` to update docs

Fixes A-606
…20563) (#21110)

## Summary

Backport of #20563
to v4.

**Commit 1** — Cherry-pick of the original squash merge (authored by
@mverzilli), conflicts resolved by accepting the incoming version.

**Commit 2** — Fix commit adapting the cherry-pick for v4:
- Resolved `send()` return type destructuring in 11 files
- Wired `additionalScopes` in `base_wallet`, `interaction_options`, and
`wallet.ts` schemas
- Deleted modify/delete conflict files (`e2e_custom_message.test.ts`,
`e2e_pxe.test.ts`) not present on v4
- Kept v4's `AvmGadgetsTestContract` name in `n_tps_prove.test.ts`
- Added `GasFees` import for priority fee logic in
`e2e_block_building.test.ts`
- Updated bot factory for v4 PrivateToken deploy pattern

Closes F-322.

---------

Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
Backport of #21155
to v4.

This PR applies configuration settings for Alpha — renaming
`SEQ_MAX_TX_PER_BLOCK` to `SEQ_MAX_TX_PER_CHECKPOINT` across environment
files, deploy scripts, and terraform config. Also updates alpha/mainnet
network defaults (enabling transactions, setting P2P pool count).

The only conflict was `spartan/environments/alpha-net.env` which was
deleted in v4, so that change was dropped.

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

Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
When multiple validators fail, `runValidations` reported whichever failure appeared first in the Record by insertion order. Now it reports the one with the harshest penalty severity.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
The v4.1.0-rc.1 release failed at cargo publish because CARGO_REGISTRY_TOKEN
was not available in the build environment. Forward the token in both ci3.yml
and bootstrap_ec2, matching what's already on next.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AztecBot AztecBot requested a review from charlielye as a code owner March 5, 2026 20:30
ludamad and others added 2 commits March 5, 2026 15:34
This is necessary to make calling contract functions with Option params relatively straightforward.
Just a smol docs PR tackling confusion between noir fields and struct members.

In a process of finishing #20332 (comment)
- reduce aztec committee lag -> 1 for scenario network
Ref: A-459

Most packages are updated via resolutions. Except `minimatch`, it's used by multiple dependencies with different major versions.

boxes/yarn.lock still has minimatch 9.0.3 pinned by @typescript-eslint/typescript-estree@6.21.0 (from
boxes/boxes/react using @typescript-eslint v6). Fixing this requires upgrading boxes/react to @typescript-eslint v8.

| yarn.lock                         | Package              | Old Version | New Version |
|-----------------------------------|----------------------|-------------|-------------|
| yarn-project/yarn.lock            | rollup               | 4.52.3      | 4.59.0      |
| boxes/yarn.lock                   | rollup               | 4.41.1      | 4.59.0      |
| playground/yarn.lock              | rollup               | 4.50.1      | 4.59.0      |
| barretenberg/acir_tests/yarn.lock | basic-ftp            | 5.0.5       | 5.2.0       |
| docs/yarn.lock                    | h3                   | 1.15.4      | 1.15.5      |
| barretenberg/docs/yarn.lock       | h3                   | 1.15.3      | 1.15.5      |
| yarn-project/yarn.lock            | systeminformation    | 5.23.8      | 5.31.1      |
| yarn-project/yarn.lock            | node-forge           | 1.3.1       | 1.3.3       |
| boxes/yarn.lock                   | node-forge           | 1.3.1       | 1.3.3       |
| docs/yarn.lock                    | node-forge           | 1.3.1       | 1.3.3       |
| barretenberg/acir_tests/yarn.lock | node-forge           | 1.3.1       | 1.3.3       |
| barretenberg/docs/yarn.lock       | node-forge           | 1.3.1       | 1.3.3       |
| yarn-project/yarn.lock            | koa                  | 2.16.2      | 2.16.4      |
| yarn-project/yarn.lock            | serve                | 14.2.4      | 14.2.6      |
| boxes/yarn.lock                   | serve                | 14.2.4      | 14.2.6      |
| barretenberg/acir_tests/yarn.lock | serve                | 14.2.4      | 14.2.6      |
| yarn-project/yarn.lock            | minimatch            | 3.1.2       | 3.1.5       |
| boxes/yarn.lock                   | minimatch            | 3.1.2       | 3.1.5       |
| docs/yarn.lock                    | minimatch            | 3.1.2       | 3.1.5       |
| playground/yarn.lock              | minimatch            | 3.1.2       | 3.1.5       |
| barretenberg/docs/yarn.lock       | serve-handler        | 6.1.6       | 6.1.7       |
| docs/yarn.lock                    | serve-handler        | 6.1.6       | 6.1.7       |
| docs/yarn.lock                    | minimatch            | 3.1.2       | 3.1.5       |
| yarn-project/yarn.lock            | minimatch            | 5.1.6       | 5.1.9       |
| boxes/yarn.lock                   | minimatch            | 5.1.6       | 5.1.9       |
| docs/yarn.lock                    | minimatch            | 5.1.6       | 5.1.9       |
| yarn-project/yarn.lock            | minimatch            | 9.0.5       | 9.0.9       |
| docs/yarn.lock                    | minimatch            | 9.0.5       | 9.0.9       |
| barretenberg/acir_tests/yarn.lock | minimatch            | 9.0.5       | 9.0.9       |
| boxes/yarn.lock                   | minimatch            | 9.0.5       | 9.0.9       |
| yarn-project/yarn.lock            | serialize-javascript | 6.0.2       | 7.0.4       |
| boxes/yarn.lock                   | serialize-javascript | 6.0.2       | 7.0.4       |
| docs/yarn.lock                    | serialize-javascript | 6.0.2       | 7.0.4       |
| barretenberg/acir_tests/yarn.lock | serialize-javascript | 6.0.2       | 7.0.4       |
| barretenberg/docs/yarn.lock       | serialize-javascript | 6.0.2       | 7.0.4       |
| boxes/yarn.lock                   | axios                | 1.12.2      | 1.13.6      |
| docs/yarn.lock                    | axios                | 1.12.2      | 1.13.6      |
This PR add a new alpha-net test network.
@socket-security
Copy link

socket-security bot commented Mar 6, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​serve@​14.2.4 ⏵ 14.2.69910099 +192 +5100
Updatednpm/​koa@​2.16.2 ⏵ 2.16.498 +1100 +18100 +195 -1100

View full report

## Summary

Follow-up to #21154, addressing review feedback to deduplicate code and use contract artifacts instead of hardcoded signature strings.

- **New `buildAllowedElement` helper** (`@aztec/p2p/msg_validators`): Builds an `AllowedElement` from a `ContractArtifact` + function name, deriving both the selector (via `FunctionSelector.fromNameAndParameters`) and calldata length from the artifact. Eliminates all hardcoded `FunctionSelector.fromSignature(...)` calls.
- **Refactored protocol allowlist** (`allowed_public_setup.ts`): Uses `buildAllowedElement` with `AuthRegistryArtifact` and `FeeJuiceArtifact` instead of manually constructing selectors and calldata lengths.
- **Deduplicated token allowlist** into a single shared `getTokenAllowedSetupFunctions()` in `@aztec/aztec/testing`, removing three identical copies from `local-network.ts`, `fees_test.ts`, and `client_flows_benchmark.ts`.
- **Refactored `fee_payer_balance.ts`**: Replaced hardcoded `fromSignature('_increase_public_balance((Field),u128)')` with artifact-derived selector using `FeeJuiceArtifact`.
- **Left `public_fee_payment_method.ts` and `private_fee_payment_method.ts` as-is**: These deprecated classes in `aztec.js` would require adding contract artifact dependencies or API changes to refactor.

Net result: **-154 lines** removed across 3 duplicated functions and hardcoded selectors, **+73 lines** added for the shared helper and single source of truth.
@nchamo nchamo requested a review from LeilaWang as a code owner March 6, 2026 15:43
This just exposes the pagination that was already implemented by the node on the wallet API. I didn't add tests in this PR as it felt unnecessary given that this is just passing the flag through.

A disadvantage of this is that it's a breaking change and that now there isn't the symmetry with private events where we don't have pagination. In private pagination is not really necessary though as you are just querying your local storage (that's where private events are stored).

This is the last missing piece of #20332 and for this reason this PR:

Closes #20332
AztecBot and others added 2 commits March 8, 2026 10:51
…backport #21208) (#21236)

Backport of #21208
to v4.

The automatic cherry-pick failed due to conflicts caused by the
`utility` prefix rename on v4. Resolved by applying the return type
narrowing (`{ publicKeys, partialAddress }` instead of
`CompleteAddress`) while keeping the `utility` method prefix used in v4.

Original PR by @benesjan.

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

Co-authored-by: benesjan <janbenes1234@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This PR adds an enqueuing queue to the orchestrator in order to give the event loop a chance to interleave other async work.
## Summary

Transactions whose gas limits exceed the block or checkpoint mana limit are currently silently dropped during block building, causing users' `.wait()` calls to hang indefinitely. This PR adds early rejection at the gossip, RPC, and pending pool entry points by validating both L2 and DA gas limits against protocol limits and operator-configured validator block gas limits.

## Changes

### Promote `rollupManaLimit` to `L1RollupConstants`

- Added `rollupManaLimit: number` to the `L1RollupConstants` type, `EmptyL1RollupConstants` (defaults to `Number.MAX_SAFE_INTEGER`), and the Zod schema
- Removed the ad-hoc `& { rollupManaLimit?: number }` extensions from the archiver, sequencer, and block-builder types — they now get it from the base type
- Updated `EpochCache.create()` and `RollupContract.getRollupConstants()` to fetch and include `rollupManaLimit` from L1

### Validate L2 and DA gas limits at tx entry points

- `GasLimitsValidator` now accepts `{ rollupManaLimit?, maxBlockL2Gas?, maxBlockDAGas?, bindings? }`:
  - Effective L2 limit = `min(MAX_PROCESSABLE_L2_GAS, rollupManaLimit, maxBlockL2Gas)`
  - Effective DA limit = `min(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, maxBlockDAGas)`
  - `rollupManaLimit` applies to L2 gas only (not DA)
- `GasTxValidator` forwards these options to its inner `GasLimitsValidator`
- All factory functions (`createFirstStageTxValidationsForGossipedTransactions`, `createTxValidatorForAcceptingTxsOverRPC`, `createTxValidatorForTransactionsEnteringPendingTxPool`) accept and pass through the limits

### Use validator block gas limits for tx validation

The existing `VALIDATOR_MAX_L2_BLOCK_GAS` and `VALIDATOR_MAX_DA_BLOCK_GAS` env vars (introduced in #21060 for block proposal validation) are now also used for tx acceptance validation. Derived block limits (from the sequencer timetable) are only used for proposals — not for validation.

- **P2P config**: Added `validateMaxL2BlockGas` and `validateMaxDABlockGas` fields reading the existing `VALIDATOR_MAX_L2_BLOCK_GAS` / `VALIDATOR_MAX_DA_BLOCK_GAS` env vars
- **Gossip path** (`libp2p_service.ts`): Passes `rollupManaLimit` from L1 constants and validator block gas limits from P2P config
- **RPC path** (`aztec-node/server.ts`): Passes `rollupManaLimit` from L1 constants and validator block gas limits from node config
- **Pending pool migration** (`client/factory.ts`): Passes `rollupManaLimit` and validator block gas limits from config

### Unit tests

Tests in `gas_validator.test.ts` covering:
- Rejection when exceeding `rollupManaLimit` (L2), `maxBlockL2Gas`, or `maxBlockDAGas`
- Min-of-all-limits behavior (L2)
- Acceptance at exactly the effective L2 and DA limits
- Fallback to `MAX_PROCESSABLE_L2_GAS` / `MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT` when no additional limits are set
- Forwarding L2 and DA limits through `GasTxValidator`

## Notes

- When `VALIDATOR_MAX_L2_BLOCK_GAS` / `VALIDATOR_MAX_DA_BLOCK_GAS` are not set, only the protocol-level limits (`MAX_PROCESSABLE_L2_GAS`, `MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT`) and `rollupManaLimit` (L2 only) are enforced
- No new env vars — reuses the existing `VALIDATOR_MAX_L2_BLOCK_GAS` and `VALIDATOR_MAX_DA_BLOCK_GAS` from #21060
- ~20 test files updated to include `rollupManaLimit` in their `L1RollupConstants` objects

Fixes A-68
Fixes A-639
I changed the default in #21235 so this flag needs to be manually turned on now.
Fixes log entries such as:
```
Not enough txs to build block 1982 at index 1 in slot 5580 (got 0 txs but needs 0)
```
@AztecBot
Copy link
Collaborator Author

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/88ee1ca11a65396d�88ee1ca11a65396d8;;�):  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" (67s) (code: 0) group:e2e-p2p-epoch-flakes
\033FLAKED\033 (8;;http://ci.aztec-labs.com/d563bb20d342842c�d563bb20d342842c8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_bot.test.ts (143s) (code: 0)

…21312) (#21329)

## Summary
Backport of #21312
to `v4`.

- Defaults minimum transactions per block to 1 in deployments
- Updates `n_tps.test.ts` to use simulated gas limits
- Adds configurable sequencer multiplier
(`SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER`)
- Corrects gossipsub degree default from 6 to 8

## Conflicts resolved
- `spartan/environments/alpha-net.env` — deleted in v4, dropped
- `spartan/environments/devnet.env` — kept v4's existing
`PUBLISHERS_PER_VALIDATOR_KEY=1`, applied `SEQ_MIN_TX_PER_BLOCK=1`
- `spartan/environments/prove-n-tps-fake.env` — kept v4's line ordering,
applied `SEQ_MIN_TX_PER_BLOCK=1`

ClaudeBox log: https://claudebox.work/s/d6f43353532bf0ba?run=1

Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
@ludamad ludamad changed the base branch from v4 to v4-next March 10, 2026 20:52
@ludamad
Copy link
Collaborator

ludamad commented Mar 10, 2026

Merging into v4-next. the next one of these goes into v4! this is a one time action

@ludamad ludamad merged commit 4e7f820 into v4-next Mar 10, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.