Skip to content

feat: update L1 gas constants for Glamsterdam - #25609

Merged
spalladino merged 1 commit into
nextfrom
spl/glamsterdam-gas-constants
Oct 7, 2026
Merged

spalladino merged 1 commit into
nextfrom
spl/glamsterdam-gas-constants

Conversation

@spalladino

Copy link
Copy Markdown
Contributor

What changed

FeeLib.sol prices the L1 work a sequencer and a prover must recover with two constants. They were placeholders taken from a forge benchmark run under --evm-version amsterdam. This PR replaces them with values measured on Sepolia after Glamsterdam:

Constant Old New
L1_GAS_PER_CHECKPOINT_PROPOSED 500,000 520,000
L1_GAS_PER_EPOCH_VERIFIED 4,000,000 2,500,000

Sepolia measurements:

  • Propose (through Multicall3 aggregate3): median 487k; ~514k per checkpoint on average once the setupEpoch folded into each epoch's first checkpoint is counted; the most expensive regular propose was 520k.
  • Epoch proof (first proof submitted for an epoch): median 2.36M, max 2.51M.

The governance proposal is at AztecProtocol/governance#68.

Mirrors updated

  • l1-contracts/test/fixtures/fee_data_points.json is recomputed for the new constants. Only the sequencer, prover and protocol fee components change. The congestion multiplier and the L1 fee inputs stay the same. The recompute script reproduces the current fixture exactly with the old constants (0 of 672 points differ), so the only thing that moves is the constants.
  • labs-patches/0011 makes the same change to the TypeScript port (yarn-project/stdlib/src/gas/fee_math.ts), updates the constants table in the stdlib gas README, and updates the epoch constant hardcoded in the single-node fees_test.ts e2e. The patch stays in the series until the aztec-node PR lands.

Nothing else in the tree mirrors these values: they are not in the constants codegen, and no docs state them.

Testing

  • forge test in l1-contracts (excluding the verifier-dependent scripts, shouting.t.sol and UniswapPortalTest): 1370 passed, 0 failed. The fee suites under test/fees/ (43 tests) pass both before and after the change.
  • In aztec-node, stdlib/src/gas and stdlib/src/tx, the sequencer-client global_variable_builder tests and the aztec-node next_block tests all pass. fee_predictor.test.ts deploys the rollup to anvil and checks the TypeScript predictions against getManaMinFeeAt. It fails when only the TypeScript side is updated (625010100000 != 598135100000). It passes once the L1 contracts carry the new constants too.

Replace the benchmark-derived placeholders for L1_GAS_PER_CHECKPOINT_PROPOSED (500k -> 520k) and L1_GAS_PER_EPOCH_VERIFIED (4M -> 2.5M) with values measured on Sepolia after Glamsterdam. Recompute fee_data_points.json for the new constants and carry the matching TypeScript port bump as labs patch 0011.
@spalladino
spalladino marked this pull request as ready for review October 7, 2026 14:16

@iAmMichaelConnor iAmMichaelConnor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@spalladino
spalladino merged commit 828486f into next Oct 7, 2026
24 checks passed
@spalladino
spalladino deleted the spl/glamsterdam-gas-constants branch October 7, 2026 17:48
AztecBot pushed a commit that referenced this pull request Oct 7, 2026
## What changed

`FeeLib.sol` prices the L1 work a sequencer and a prover must recover
with two constants. They were placeholders taken from a forge benchmark
run under `--evm-version amsterdam`. This PR replaces them with values
measured on Sepolia after Glamsterdam:

| Constant | Old | New |
|---|---|---|
| `L1_GAS_PER_CHECKPOINT_PROPOSED` | 500,000 | 520,000 |
| `L1_GAS_PER_EPOCH_VERIFIED` | 4,000,000 | 2,500,000 |

Sepolia measurements:

- **Propose** (through Multicall3 `aggregate3`): median 487k; ~514k per
checkpoint on average once the `setupEpoch` folded into each epoch's
first checkpoint is counted; the most expensive regular propose was
520k.
- **Epoch proof** (first proof submitted for an epoch): median 2.36M,
max 2.51M.

The governance proposal is at
AztecProtocol/governance#68.

## Mirrors updated

- `l1-contracts/test/fixtures/fee_data_points.json` is recomputed for
the new constants. Only the sequencer, prover and protocol fee
components change. The congestion multiplier and the L1 fee inputs stay
the same. The recompute script reproduces the current fixture exactly
with the old constants (0 of 672 points differ), so the only thing that
moves is the constants.
- `labs-patches/0011` makes the same change to the TypeScript port
(`yarn-project/stdlib/src/gas/fee_math.ts`), updates the constants table
in the stdlib gas README, and updates the epoch constant hardcoded in
the single-node `fees_test.ts` e2e. The patch stays in the series until
the aztec-node PR lands.

Nothing else in the tree mirrors these values: they are not in the
constants codegen, and no docs state them.

## Testing

- `forge test` in `l1-contracts` (excluding the verifier-dependent
scripts, `shouting.t.sol` and `UniswapPortalTest`): 1370 passed, 0
failed. The fee suites under `test/fees/` (43 tests) pass both before
and after the change.
- In aztec-node, `stdlib/src/gas` and `stdlib/src/tx`, the
sequencer-client `global_variable_builder` tests and the aztec-node
`next_block` tests all pass. `fee_predictor.test.ts` deploys the rollup
to anvil and checks the TypeScript predictions against
`getManaMinFeeAt`. It fails when only the TypeScript side is updated
(`625010100000 != 598135100000`). It passes once the L1 contracts carry
the new constants too.

(cherry picked from commit 828486f)
@AztecBot AztecBot mentioned this pull request Oct 7, 2026
4 tasks done
AztecBot pushed a commit that referenced this pull request Oct 8, 2026
## What changed

`FeeLib.sol` prices the L1 work a sequencer and a prover must recover
with two constants. They were placeholders taken from a forge benchmark
run under `--evm-version amsterdam`. This PR replaces them with values
measured on Sepolia after Glamsterdam:

| Constant | Old | New |
|---|---|---|
| `L1_GAS_PER_CHECKPOINT_PROPOSED` | 500,000 | 520,000 |
| `L1_GAS_PER_EPOCH_VERIFIED` | 4,000,000 | 2,500,000 |

Sepolia measurements:

- **Propose** (through Multicall3 `aggregate3`): median 487k; ~514k per
checkpoint on average once the `setupEpoch` folded into each epoch's
first checkpoint is counted; the most expensive regular propose was
520k.
- **Epoch proof** (first proof submitted for an epoch): median 2.36M,
max 2.51M.

The governance proposal is at
AztecProtocol/governance#68.

## Mirrors updated

- `l1-contracts/test/fixtures/fee_data_points.json` is recomputed for
the new constants. Only the sequencer, prover and protocol fee
components change. The congestion multiplier and the L1 fee inputs stay
the same. The recompute script reproduces the current fixture exactly
with the old constants (0 of 672 points differ), so the only thing that
moves is the constants.
- `labs-patches/0011` makes the same change to the TypeScript port
(`yarn-project/stdlib/src/gas/fee_math.ts`), updates the constants table
in the stdlib gas README, and updates the epoch constant hardcoded in
the single-node `fees_test.ts` e2e. The patch stays in the series until
the aztec-node PR lands.

Nothing else in the tree mirrors these values: they are not in the
constants codegen, and no docs state them.

## Testing

- `forge test` in `l1-contracts` (excluding the verifier-dependent
scripts, `shouting.t.sol` and `UniswapPortalTest`): 1370 passed, 0
failed. The fee suites under `test/fees/` (43 tests) pass both before
and after the change.
- In aztec-node, `stdlib/src/gas` and `stdlib/src/tx`, the
sequencer-client `global_variable_builder` tests and the aztec-node
`next_block` tests all pass. `fee_predictor.test.ts` deploys the rollup
to anvil and checks the TypeScript predictions against
`getManaMinFeeAt`. It fails when only the TypeScript side is updated
(`625010100000 != 598135100000`). It passes once the L1 contracts carry
the new constants too.

(cherry picked from commit 828486f)
IlyasRidhuan pushed a commit that referenced this pull request Oct 8, 2026
Rolling integration PR carrying merged `port-to-v6` PRs from `next` onto
`v6`. One commit per source PR (plus a `fix(port):` commit after any
conflicted pick).

## Ported
- [x]
[#25596](#25596)
chore: remove ledwards2225 from CODEOWNERS — clean pick
- [x]
[#25609](#25609)
feat: update L1 gas constants for Glamsterdam — clean pick. It adds
`labs-patches/0011-…` to v6's otherwise empty patch queue. The patch's
pre-image blobs match v6's labs pin `ee1312cf`, so it applies there
unchanged.
- [x]
[#25600](#25600)
test(l1-contracts): measure BN254 proof-of-possession gas against the
GSE cap — clean pick. The sources and fixtures it imports
(`BN254Lib.sol`, `Bn254LibWrapper.sol`, `BN254Fixtures.t.sol`,
`bn254_constants.json`) are identical on v6 and next.
- [x]
[#25619](#25619)
fix(l1): escape hatch, staking flush and rollup registration payload
fixes — clean pick. All 34 touched files match next byte-for-byte
afterwards.

---
*Created by
[claudebox](https://claudebox.work/v2/sessions/9666bbcd1ae659f5/jobs/1)
· group: `slackbot` · [Slack
thread](https://aztecprotocol.slack.com/archives/C0AGN2WT3CP/p1791216786568079?thread_ts=1791216786.568079&cid=C0AGN2WT3CP)*

---------

Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants