Skip to content

feat(l1): add checkpoint reward overrides - #25461

Open
spalladino wants to merge 4 commits into
nextfrom
project/v6-checkpoint-reward-overrides
Open

spalladino wants to merge 4 commits into
nextfrom
project/v6-checkpoint-reward-overrides

Conversation

@spalladino

Copy link
Copy Markdown
Contributor

Adds configurable per-registry sequencer checkpoint rewards on top of the v6 L1 integration branch.

Context

The rollup needs to override the default sequencer checkpoint reward for validators associated with selected ATP registries. ATP-backed validators register their staker as the GSE withdrawer, so resolving the registry requires following the staker to its ATP and then the ATP to its registry.

Approach

Fixes A-1800

alexghr and others added 4 commits September 10, 2026 14:14
…5426)

Registry reward overrides never applied to ATP-backed validators,
because the lookup probed the wrong contract.

ATP stakers (the `ATPWithdrawableAndClaimableStaker` family in
ignition-contracts) register themselves as the GSE withdrawer when they
deposit, both on the direct path and through the `StakingRegistry`
provider path. The staker only exposes `getATP()`; `getRegistry()` lives
on the ATP. `RewardLib` called `getRegistry()` on the withdrawer
directly, so on the deployed stakers the probe reverted and every
ATP-backed proposer silently fell back to the default sequencer reward.

- `RewardLib.tryGetRegistry` now resolves `withdrawer.getATP()` and then
`atp.getRegistry()`, through a shared defensive probe (`tryGetAddress`)
that keeps the fixed gas cap, exact 32-byte return and clean-address
checks per hop. A withdrawer that answers `getRegistry()` itself no
longer matches, since no deployed staker does.
- Unit tests and the partial-epoch-proof gas benchmark now model the
real shape (staker → ATP → registry) with shared mocks in
`test/mock/ATPMocks.sol`. The two-hop lookup adds ~3.2k gas for one
checkpoint and ~23k for a full 32-checkpoint epoch with two overrides.
- New `test/fork/MainnetATPRewardOverride.t.sol` checks the lookup
against real mainnet ATP stakers: v1 and v2 staker implementations, the
auction and genesis-sale ATP registries, and both the direct and the
`StakingRegistry` provider staking paths. It asserts the attester is
validating on the canonical rollup, that the GSE withdrawer is the
staker, that the staker does not answer `getRegistry()`, that the
two-hop lookup resolves the registry, and that `handleRewardsAndFees`
applies the override. Against the pre-fix code the last two assertions
fail (default 50e18 paid instead of the 10e18 override).
- The fork test runs offline in CI. `setUp` loads a state snapshot
(`test/fixtures/mainnet_atp_reward_override.json`) produced by
`vm.dumpState` from a mainnet fork at block 25934884; the dump only
contains the accounts and slots the test touches (13 accounts, ~190KB).
Set `MAINNET_ATP_FIXTURE_RPC_URL` to a mainnet RPC to refresh the
snapshot; regeneration is deterministic.
- Fixes the solhint `imports-order` errors in `RewardLib.sol` that were
failing CI on the stack.
@spalladino
spalladino force-pushed the project/v6-l1-updates branch from c751592 to 6dce8ee Compare September 10, 2026 17:23
@spalladino
spalladino force-pushed the project/v6-checkpoint-reward-overrides branch from 00cd70b to 4d048ba Compare September 10, 2026 17:23
Base automatically changed from project/v6-l1-updates to next September 10, 2026 18:45
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.

2 participants