Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions docs/docs-operate/operators/reference/changelog/v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,65 @@ The `getL2Tips()` RPC endpoint now returns a restructured response with addition
- Replace `tips.latest` with `tips.proposed`
- For `checkpointed`, `proven`, and `finalized` tips, access block info via `.block` (e.g., `tips.proven.block.number`)

### Block gas limits reworked

The byte-based block size limit has been removed and replaced with field-based blob limits and automatic gas budget computation from L1 rollup limits.

**Removed:**

```bash
--maxBlockSizeInBytes <value> ($SEQ_MAX_BLOCK_SIZE_IN_BYTES)
```

**Changed to optional (now auto-computed from L1 if not set):**

```bash
--maxL2BlockGas <value> ($SEQ_MAX_L2_BLOCK_GAS)
--maxDABlockGas <value> ($SEQ_MAX_DA_BLOCK_GAS)
```

**New (proposer):**

```bash
--gasPerBlockAllocationMultiplier <value> ($SEQ_GAS_PER_BLOCK_ALLOCATION_MULTIPLIER)
--maxTxsPerCheckpoint <value> ($SEQ_MAX_TX_PER_CHECKPOINT)
```

**New (validator):**

```bash
--validateMaxL2BlockGas <value> ($VALIDATOR_MAX_L2_BLOCK_GAS)
--validateMaxDABlockGas <value> ($VALIDATOR_MAX_DA_BLOCK_GAS)
--validateMaxTxsPerBlock <value> ($VALIDATOR_MAX_TX_PER_BLOCK)
--validateMaxTxsPerCheckpoint <value> ($VALIDATOR_MAX_TX_PER_CHECKPOINT)
```

**Migration**: Remove `SEQ_MAX_BLOCK_SIZE_IN_BYTES` from your configuration. Per-block L2 and DA gas budgets are now derived automatically as `(checkpointLimit / maxBlocks) * multiplier`, where the multiplier defaults to 2. You can still override `SEQ_MAX_L2_BLOCK_GAS` and `SEQ_MAX_DA_BLOCK_GAS` explicitly, but they will be capped at the checkpoint-level limits. Validators can now set independent per-block and per-checkpoint limits via the `VALIDATOR_` env vars; when not set, only checkpoint-level protocol limits are enforced.

### Setup phase allow list requires function selectors

The transaction setup phase allow list now enforces function selectors, restricting which specific functions can run during setup on whitelisted contracts. Previously, any public function on a whitelisted contract or class was permitted.

The semantics of the environment variable `TX_PUBLIC_SETUP_ALLOWLIST` have changed:

**v3.x:**

```bash
--txPublicSetupAllowList <value> ($TX_PUBLIC_SETUP_ALLOWLIST)
```

The variable fully **replaced** the hardcoded defaults. Format allowed entries without selectors: `I:address`, `C:classId`.

**v4.0.0:**

```bash
--txPublicSetupAllowListExtend <value> ($TX_PUBLIC_SETUP_ALLOWLIST)
```

The variable now **extends** the hardcoded defaults (which are always present). Selectors are now mandatory. Format: `I:address:selector,C:classId:selector`.

**Migration**: If you were using `TX_PUBLIC_SETUP_ALLOWLIST`, ensure all entries include function selectors. Note the variable now adds to defaults rather than replacing them. If you were not setting this variable, no action is needed — the hardcoded defaults now include the correct selectors automatically.

## Removed features

## New features
Expand Down Expand Up @@ -149,6 +208,25 @@ P2P_RPC_PRICE_BUMP_PERCENTAGE=10 # default: 10 (percent)

Set to `0` to disable the percentage-based bump (still requires strictly higher fee).

### Validator-specific block limits

Validators can now enforce per-block and per-checkpoint limits independently from the sequencer (proposer) limits. This allows operators to accept proposals that exceed their own proposer settings, or to reject proposals that are too large even if the proposer's limits allow them.

**Configuration:**

```bash
VALIDATOR_MAX_L2_BLOCK_GAS=<value> # Max L2 gas per block for validation
VALIDATOR_MAX_DA_BLOCK_GAS=<value> # Max DA gas per block for validation
VALIDATOR_MAX_TX_PER_BLOCK=<value> # Max txs per block for validation
VALIDATOR_MAX_TX_PER_CHECKPOINT=<value> # Max txs per checkpoint for validation
```

When not set, no per-block limit is enforced for that dimension — only checkpoint-level protocol limits apply. These do not fall back to the `SEQ_` values.

### Setup allow list extendable via network config

The setup phase allow list can now be extended via the network configuration JSON (`txPublicSetupAllowListExtend` field). This allows network operators to distribute additional allowed setup functions to all nodes without requiring code changes. The local environment variable takes precedence over the network-json value.

## Changed defaults

## Troubleshooting
Expand Down
8 changes: 6 additions & 2 deletions yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,13 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
// We'll accumulate sentinel watchers here
const watchers: Watcher[] = [];

// Create FullNodeCheckpointsBuilder for block proposal handling and tx validation
// Create FullNodeCheckpointsBuilder for block proposal handling and tx validation.
const validatorCheckpointsBuilder = new FullNodeCheckpointsBuilder(
{ ...config, l1GenesisTime, slotDuration: Number(slotDuration) },
{
...config,
l1GenesisTime,
slotDuration: Number(slotDuration),
},
worldStateSynchronizer,
archiver,
dateProvider,
Expand Down
4 changes: 4 additions & 0 deletions yarn-project/foundation/src/config/env_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ export type EnvVar =
| 'TRANSACTIONS_DISABLED'
| 'VALIDATOR_ATTESTATIONS_POLLING_INTERVAL_MS'
| 'VALIDATOR_DISABLED'
| 'VALIDATOR_MAX_DA_BLOCK_GAS'
| 'VALIDATOR_MAX_L2_BLOCK_GAS'
| 'VALIDATOR_MAX_TX_PER_BLOCK'
| 'VALIDATOR_MAX_TX_PER_CHECKPOINT'
| 'VALIDATOR_PRIVATE_KEYS'
| 'VALIDATOR_PRIVATE_KEY'
| 'VALIDATOR_REEXECUTE'
Expand Down
9 changes: 9 additions & 0 deletions yarn-project/p2p/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export interface P2PConfig
TxCollectionConfig,
TxFileStoreConfig,
Pick<SequencerConfig, 'blockDurationMs' | 'expectedBlockProposalsPerSlot' | 'maxTxsPerBlock'> {
/** Maximum transactions per block for validation. Overrides maxTxsPerBlock for gossip validation when set. */
validateMaxTxsPerBlock?: number;

/** A flag dictating whether the P2P subsystem should be enabled. */
p2pEnabled: boolean;

Expand Down Expand Up @@ -202,6 +205,12 @@ export interface P2PConfig
export const DEFAULT_P2P_PORT = 40400;

export const p2pConfigMappings: ConfigMappingsType<P2PConfig> = {
validateMaxTxsPerBlock: {
env: 'VALIDATOR_MAX_TX_PER_BLOCK',
description:
'Maximum transactions per block for validation. Overrides maxTxsPerBlock for gossip validation when set.',
parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
},
p2pEnabled: {
env: 'P2P_ENABLED',
description: 'A flag dictating whether the P2P subsystem should be enabled.',
Expand Down
12 changes: 5 additions & 7 deletions yarn-project/p2p/src/services/libp2p/libp2p_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,12 @@ export class LibP2PService extends WithTracer implements P2PService {
this.protocolVersion,
);

this.blockProposalValidator = new BlockProposalValidator(epochCache, {
const proposalValidatorOpts = {
txsPermitted: !config.disableTransactions,
maxTxsPerBlock: config.maxTxsPerBlock,
});
this.checkpointProposalValidator = new CheckpointProposalValidator(epochCache, {
txsPermitted: !config.disableTransactions,
maxTxsPerBlock: config.maxTxsPerBlock,
});
maxTxsPerBlock: config.validateMaxTxsPerBlock,
};
this.blockProposalValidator = new BlockProposalValidator(epochCache, proposalValidatorOpts);
this.checkpointProposalValidator = new CheckpointProposalValidator(epochCache, proposalValidatorOpts);
this.checkpointAttestationValidator = config.fishermanMode
? new FishermanAttestationValidator(epochCache, mempools.attestationPool, telemetry)
: new CheckpointAttestationValidator(epochCache);
Expand Down
5 changes: 5 additions & 0 deletions yarn-project/stdlib/src/block/l2_block.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type BlockBlobData, encodeBlockBlobData } from '@aztec/blob-lib/encoding';
import { DA_GAS_PER_FIELD } from '@aztec/constants';
import {
BlockNumber,
CheckpointNumber,
Expand Down Expand Up @@ -138,6 +139,10 @@ export class L2Block {
};
}

computeDAGasUsed(): number {
return this.body.txEffects.reduce((total, txEffect) => total + txEffect.getNumBlobFields(), 0) * DA_GAS_PER_FIELD;
}

static empty(header?: BlockHeader) {
return new L2Block(
AppendOnlyTreeSnapshot.empty(),
Expand Down
1 change: 1 addition & 0 deletions yarn-project/stdlib/src/checkpoint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './checkpoint.js';
export * from './checkpoint_data.js';
export * from './checkpoint_info.js';
export * from './published_checkpoint.js';
export * from './validate.js';
Loading
Loading