Skip to content

AZIP-25: Activity Score for Full Epoch Proofs - #65

Merged
koenmtb1 merged 3 commits into
AztecProtocol:mainfrom
aminsammara:azip-full-epoch-proof-activity-score
Sep 11, 2026
Merged

koenmtb1 merged 3 commits into
AztecProtocol:mainfrom
aminsammara:azip-full-epoch-proof-activity-score

Conversation

@aminsammara

@aminsammara aminsammara commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Adds AZIPs/azip-25-full-epoch-proof-activity-score.md (category: Core, status: Draft).

Restricts the prover activity score increment to proofs that cover a complete epoch. Today RewardLib.handleRewardsAndFees calls updateAndGetShares for every accepted proof, the increment does not depend on proof length, and the protocol accepts a proof of a single checkpoint. A prover that cannot keep up with a congested epoch can therefore hold its score by proving one checkpoint, then collect a full reward share on a later, cheaper epoch. This AZIP gates the increment on a full epoch proof — the same condition that already gates reward eligibility. Fees, reward totals, and proof validity rules are unchanged.

Notes for review:

  • Requires a rollup redeploy via a governance proposal, since EpochProofLib and RewardLib are internal libraries inlined into the Rollup bytecode; this cannot ship as a config change.
  • The Specification adds a proofSubmissionEpochs > 0 constructor requirement. Without it no full epoch proof can exist and the mechanism becomes dead code with no error; the reference PR notes the hazard in a comment but does not yet enforce it.
  • discussions-to is N/A, matching prior AZIPs (e.g. AZIP-23, AZIP-16).
  • Number 25 is the next free number after AZIP-24; happy to have the editor reassign.

@aminsammara
aminsammara requested a review from a team September 9, 2026 09:21
@koenmtb1
koenmtb1 merged commit fa3a736 into AztecProtocol:main Sep 11, 2026
1 check failed
ludamad pushed a commit to r3sako/aztec-packages that referenced this pull request Sep 17, 2026
Rebuilds the v6 L1 integration branch on the latest `next` using
cherry-picked commits.

This includes AZIPs
[23](AztecProtocol/governance#58),
[24](AztecProtocol/governance#64),
[25](AztecProtocol/governance#65) (all approved
in last ACD), plus gas optimizations and refactors to work around the
Rollup contract size limit.

## Included PRs

- [AztecProtocol#25260](AztecProtocol#25260) —
feat: introduce a protocol fee margin (AZIP-23)
- [AztecProtocol#25370](AztecProtocol#25370) —
chore: update activity score to only track full epoch proofs (AZIP-25)
- [AztecProtocol#25386](AztecProtocol#25386) —
refactor(l1): reduce full epoch proof gas overhead
- [AztecProtocol#25389](AztecProtocol#25389) —
feat(l1): track which prover first proved each checkpoint (AZIP-24)
- [AztecProtocol#25314](AztecProtocol#25314) —
perf(l1): hold the rollup config in immutables instead of storage
- [AztecProtocol#25404](AztecProtocol#25404) —
feat: only verify new headers
- [AztecProtocol#25406](AztecProtocol#25406) —
feat: optimize proof submission
- [AztecProtocol#25419](AztecProtocol#25419) —
feat: submitProof takes only new headers

## Gas

The reports were regenerated after removing reward overrides. The `next`
comparison is unchanged because no L1 contract files changed on `next`
since this branch point.

### Epoch benchmark

**No validators**

| Function | `next` | This branch | Delta |
|---|---:|---:|---:|
| `propose` avg | 199,366 | 198,220 | -1,146 (-0.6%) |
| `submitEpochRootProof` avg | 991,020 | 925,398 | -65,622 (-6.6%) |
| `submitEpochRootProof` max | 1,029,513 | 966,444 | -63,069 (-6.1%) |
| `submitEpochRootProof` calldata bytes | 14,148 | 14,212 | +64 (+0.5%)
|
| `setupEpoch` avg | 32,042 | 32,020 | -22 (-0.1%) |
| Avg gas/second | 3,643.1 | 3,570.2 | -72.9 (-2.0%) |

**100 validators**

| Function | `next` | This branch | Delta |
|---|---:|---:|---:|
| `propose` avg | 327,769 | 326,630 | -1,139 (-0.3%) |
| `submitEpochRootProof` avg | 1,572,054 | 1,505,290 | -66,764 (-4.2%) |
| `submitEpochRootProof` max | 1,669,957 | 1,605,780 | -64,177 (-3.8%) |
| `submitEpochRootProof` calldata bytes | 16,644 | 16,708 | +64 (+0.4%)
|
| `aggregate3` avg | 376,655 | 375,623 | -1,032 (-0.3%) |
| `setupEpoch` avg | 46,504 | 46,482 | -22 (0.0%) |
| Avg gas/second | 5,937.2 | 5,863.4 | -73.8 (-1.2%) |

### Partial epoch proof benchmark

| Proof submission | `next` | This branch | Delta |
|---|---:|---:|---:|
| 1 checkpoint | 661,245 | 654,868 | -6,377 (-1.0%) |
| 8 checkpoints | 980,349 | 956,875 | -23,474 (-2.4%) |
| 8 more checkpoints | 988,039 | 910,405 | -77,634 (-7.9%) |
| 16 checkpoints | 1,291,446 | 1,246,224 | -45,222 (-3.5%) |
| 32 checkpoints | 1,805,072 | 1,732,651 | -72,421 (-4.0%) |

The partial proof benchmark uses the mock epoch proof verifier; real ZK
verification and top-level transaction calldata gas are excluded.

### Tracked function gas report

The fixed `RollupTest` report now records a 41,936-byte preheated
deployment, a 393,723-gas median for `submitEpochRootProof()`, and
unchanged 283,135-gas median for `propose()`. The owner-only setters pay
one extra delegatecall after moving fee and reward admin paths into
`RewardExtLib`; hot proposal paths still call `FeeLib` directly.

## Contract size

Without the admin-path extraction, the reward-free integration stack
still produces a 24,744-byte `Rollup`, 168 bytes over EIP-170. Moving
those paths into `RewardExtLib` brings runtime bytecode to **22,670
bytes**, 1,906 under the 24,576-byte limit.

CI checks this directly under both the default and production Foundry
profiles via `scripts/check_contract_sizes.sh`.
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