chore: v6 l1 updates integration branch - #25401
Draft
alexghr wants to merge 12 commits into
Draft
Conversation
Adds a governance-set margin `mu` on the mana base fee. The fee becomes `cost * (1 + mu) * congestionMultiplier`: operators still receive exactly `cost` from the fee waterfall plus the unchanged block reward, and the markup above cost goes to a governance-set `protocolFeeRecipient`, which defaults to the current burn address. - `mu` is a uint16 bps field packed into bits 224-239 of `CompressedFeeConfig` and deploys at 0, so the rollup is bit-identical to today. - `setProtocolFeeMargin` is governance-only and rate-limited to x3/2 on the fee multiplier per 30-day window, matching `setProvingCostPerMana`. Decreases are immediate and unrestricted; setting the current value is a no-op. - The `(1 + mu)` scaling is applied only to the `fakeExponential` factor in `congestionMultiplier`. The `mulDiv` divisor stays `MINIMUM_CONGESTION_MULTIPLIER` -- scaling both sites cancels the margin. - The fee header's uint64 `congestionCost` field becomes `protocolFee` and carries `summedMinFee - sequencerCost - proverCost` as a single subtraction clamped at 0, so `fee - protocolFee = cost * manaUsed` holds to the wei. - `RewardLib.BURN_ADDRESS` becomes the deploy-time default for a stored `protocolFeeRecipient`; `getBurnAddress()` is replaced by `getProtocolFeeRecipient()`. - The TypeScript fee mirror is updated to match bit-exactly, with `mu` threaded through the L1 config read into the fee predictor.
## Summary - reuse the current epoch already computed during proof acceptance - cache the packed chain tips for full-proof detection and proven-tip advancement - read the known-existing next checkpoint slot directly instead of repeating checkpoint-number validation - update the gas benchmark results; this saves 1,053 gas per proof submission versus the parent PR implementation, leaving roughly 3,729 gas of net overhead versus the pre-PR baseline ## Tests - `forge fmt --check` - `forge test --offline --match-contract MultiProofTest` - `forge test --offline --match-contract HandleRewardsTest` - `python3 scripts/gas_benchmarks.py`
…ject/v6-l1-updates
## Context There was no on-chain record of who proved a given checkpoint. `L2ProofVerified` carries the prover, but there is nothing queryable, and the reward accounting only tracks per-epoch submissions. ## Approach Adds a `firstProvenBy` mapping to `RollupStore`, written in `submitEpochRootProof` whenever a proof advances the proven tip. Only the checkpoint the proof ended at gets an entry, so entries are sparse: proofs of 1-10 and then 11-20 record entries at 10 and 20, with nothing in between. Because a proof of an already proven range cannot advance the tip, it never reaches the write and the original prover is preserved. `getFirstProvenBy(checkpointNumber)` resolves an arbitrary checkpoint by walking forward to the next entry. The first entry at or after the requested number belongs to the earliest proof that covered it, since the proven tip only ever advances; the walk is bounded by the epoch duration because a proof covers at most one epoch. The mapping stores the address in its lower 160 bits and sets bit 160 as a presence flag, so `address(0)` remains distinguishable from a sparse, unwritten entry. The getter reverts with `Rollup__CheckpointNotProven` for checkpoint 0 or a checkpoint ahead of the proven tip. The getter is routed through `RewardExtLib` (alongside the other STF getters) rather than inlined in `Rollup.sol` — the Rollup deployed bytecode is within 800 bytes of the size limit. ## API changes New `IRollup.getFirstProvenBy(uint256) returns (address)` and `Errors.Rollup__CheckpointNotProven(uint256 proven, uint256 requested)`. Fixes A-1927
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.