diff --git a/docs/docs-operate/operators/reference/changelog/v4.md b/docs/docs-operate/operators/reference/changelog/v4.md index 599c58e8cfa6..83b29d4758a6 100644 --- a/docs/docs-operate/operators/reference/changelog/v4.md +++ b/docs/docs-operate/operators/reference/changelog/v4.md @@ -90,7 +90,7 @@ The byte-based block size limit has been removed and replaced with field-based b **New (proposer):** ```bash ---gasPerBlockAllocationMultiplier ($SEQ_GAS_PER_BLOCK_ALLOCATION_MULTIPLIER) +--perBlockAllocationMultiplier ($SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER) --maxTxsPerCheckpoint ($SEQ_MAX_TX_PER_CHECKPOINT) ``` diff --git a/yarn-project/foundation/src/config/env_var.ts b/yarn-project/foundation/src/config/env_var.ts index 07b60428cb17..942316271146 100644 --- a/yarn-project/foundation/src/config/env_var.ts +++ b/yarn-project/foundation/src/config/env_var.ts @@ -207,7 +207,7 @@ export type EnvVar = | 'SEQ_PUBLISH_TXS_WITH_PROPOSALS' | 'SEQ_MAX_DA_BLOCK_GAS' | 'SEQ_MAX_L2_BLOCK_GAS' - | 'SEQ_GAS_PER_BLOCK_ALLOCATION_MULTIPLIER' + | 'SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER' | 'SEQ_PUBLISHER_PRIVATE_KEY' | 'SEQ_PUBLISHER_PRIVATE_KEYS' | 'SEQ_PUBLISHER_ADDRESSES' diff --git a/yarn-project/sequencer-client/src/client/sequencer-client.ts b/yarn-project/sequencer-client/src/client/sequencer-client.ts index 613c5d172219..22e1be967576 100644 --- a/yarn-project/sequencer-client/src/client/sequencer-client.ts +++ b/yarn-project/sequencer-client/src/client/sequencer-client.ts @@ -267,7 +267,7 @@ export function computeBlockLimits( enforce: config.enforceTimeTable ?? DefaultSequencerConfig.enforceTimeTable, }).maxNumberOfBlocks; - const multiplier = config.gasPerBlockAllocationMultiplier ?? DefaultSequencerConfig.gasPerBlockAllocationMultiplier; + const multiplier = config.perBlockAllocationMultiplier ?? DefaultSequencerConfig.perBlockAllocationMultiplier; // Compute maxL2BlockGas let maxL2BlockGas: number; diff --git a/yarn-project/sequencer-client/src/config.ts b/yarn-project/sequencer-client/src/config.ts index f020431f90a3..117839911491 100644 --- a/yarn-project/sequencer-client/src/config.ts +++ b/yarn-project/sequencer-client/src/config.ts @@ -40,7 +40,7 @@ export const DefaultSequencerConfig = { minTxsPerBlock: 1, buildCheckpointIfEmpty: false, publishTxsWithProposals: false, - gasPerBlockAllocationMultiplier: 2, + perBlockAllocationMultiplier: 2, enforceTimeTable: true, attestationPropagationTime: DEFAULT_P2P_PROPAGATION_TIME, secondsBeforeInvalidatingBlockAsCommitteeMember: 144, // 12 L1 blocks @@ -105,12 +105,12 @@ export const sequencerConfigMappings: ConfigMappingsType = { description: 'The maximum DA block gas.', parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined), }, - gasPerBlockAllocationMultiplier: { - env: 'SEQ_GAS_PER_BLOCK_ALLOCATION_MULTIPLIER', + perBlockAllocationMultiplier: { + env: 'SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER', description: 'Per-block gas budget multiplier for both L2 and DA gas. Budget per block is (checkpointLimit / maxBlocks) * multiplier.' + ' Values greater than one allow early blocks to use more than their even share, relying on checkpoint-level capping for later blocks.', - ...numberConfigHelper(DefaultSequencerConfig.gasPerBlockAllocationMultiplier), + ...numberConfigHelper(DefaultSequencerConfig.perBlockAllocationMultiplier), }, coinbase: { env: 'COINBASE', diff --git a/yarn-project/stdlib/src/interfaces/configs.ts b/yarn-project/stdlib/src/interfaces/configs.ts index a290e0c69b0d..a6009002575f 100644 --- a/yarn-project/stdlib/src/interfaces/configs.ts +++ b/yarn-project/stdlib/src/interfaces/configs.ts @@ -26,7 +26,7 @@ export interface SequencerConfig { /** The maximum DA block gas. */ maxDABlockGas?: number; /** Per-block gas budget multiplier for both L2 and DA gas. Budget = (checkpointLimit / maxBlocks) * multiplier. */ - gasPerBlockAllocationMultiplier?: number; + perBlockAllocationMultiplier?: number; /** Recipient of block reward. */ coinbase?: EthAddress; /** Address to receive fees. */ @@ -93,7 +93,7 @@ export const SequencerConfigSchema = zodFor()( maxL2BlockGas: z.number().optional(), publishTxsWithProposals: z.boolean().optional(), maxDABlockGas: z.number().optional(), - gasPerBlockAllocationMultiplier: z.number().optional(), + perBlockAllocationMultiplier: z.number().optional(), coinbase: schemas.EthAddress.optional(), feeRecipient: schemas.AztecAddress.optional(), acvmWorkingDirectory: z.string().optional(), @@ -142,7 +142,7 @@ type SequencerConfigOptionalKeys = | 'maxTxsPerCheckpoint' | 'maxL2BlockGas' | 'maxDABlockGas' - | 'gasPerBlockAllocationMultiplier'; + | 'perBlockAllocationMultiplier'; export type ResolvedSequencerConfig = Prettify< Required> & Pick diff --git a/yarn-project/validator-client/README.md b/yarn-project/validator-client/README.md index 9ae98004e384..4c475117d3d1 100644 --- a/yarn-project/validator-client/README.md +++ b/yarn-project/validator-client/README.md @@ -259,7 +259,7 @@ Per-block budgets prevent one block from consuming the entire checkpoint budget. | `SEQ_MAX_DA_BLOCK_GAS` | *auto* | Per-block DA gas. Auto-derived from checkpoint DA limit / maxBlocks * multiplier. | | `SEQ_MAX_TX_PER_BLOCK` | *none* | Per-block tx count. If `SEQ_MAX_TX_PER_CHECKPOINT` is set and per-block is not, derived as `ceil(checkpointLimit / maxBlocks * multiplier)`. | | `SEQ_MAX_TX_PER_CHECKPOINT` | *none* | Total txs across all blocks in a checkpoint. When set, per-block tx limit is derived from it (unless explicitly overridden) and checkpoint-level capping is enforced. | -| `SEQ_GAS_PER_BLOCK_ALLOCATION_MULTIPLIER` | 2 | Multiplier for per-block budget computation. | +| `SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER` | 2 | Multiplier for per-block budget computation. | | `VALIDATOR_MAX_L2_BLOCK_GAS` | *none* | Per-block L2 gas limit for validation. Proposals exceeding this are rejected. | | `VALIDATOR_MAX_DA_BLOCK_GAS` | *none* | Per-block DA gas limit for validation. Proposals exceeding this are rejected. | | `VALIDATOR_MAX_TX_PER_BLOCK` | *none* | Per-block tx count limit for validation. Proposals exceeding this are rejected. |