Skip to content

feat(l1): add V5 upgrade payload and deploy script#23752

Open
just-mitch wants to merge 1 commit into
v5-nextfrom
mitch/gk-652-write-v5-upgrade-payload
Open

feat(l1): add V5 upgrade payload and deploy script#23752
just-mitch wants to merge 1 commit into
v5-nextfrom
mitch/gk-652-write-v5-upgrade-payload

Conversation

@just-mitch
Copy link
Copy Markdown
Collaborator

Summary

Adds the V5 rollup upgrade tooling: a single governance payload that swaps the canonical rollup to v5 and migrates the reward distributor, plus the forge deploy script, its TypeScript wrapper, and the v5 network parameters.

The v5 rollup binds its reward distributor immutably at construction (AZIP-2), so changing the distributor requires deploying a new rollup and completing the swap through governance. V5UpgradePayload performs that swap atomically.

What's included

  • V5UpgradePayload.sol — governance payload with four actions, executed in order:
    1. Drain the v4 RewardDistributor's canonical pool into the new distributor (legacy recover(asset,to,amount) selector; sized to balance - aggregateDebt so earmarked funds stay claimable in v4).
    2. Registry.addRollup(v5) — makes v5 canonical.
    3. Registry.updateRewardDistributor(new) — repoints the registry.
    4. GSE.addRollup(v5) — registers v5 so attesters follow without redepositing.
  • DeployRollupForUpgradeV5.s.sol — deploys the v5 reward distributor, the v5 rollup wired to it, and the payload; emits a single JSON line with all addresses.
  • deployRollupForUpgradeV5 in deploy_aztec_l1_contracts.ts — wrapper with optional Etherscan verification on mainnet/sepolia. The shared forge-invocation logic is factored into runRollupUpgradeForgeScript, which deployRollupForUpgrade now also uses.
  • v5 parameters — AZIP-5 reward-booster retune in RollupConfiguration.sol; v5 slashing schedule and halved proving-cost-per-mana in network-defaults.yml.
  • V5_UPGRADE_RUNBOOK.md — sepolia deploy, mainnet fork dry-run, and production deploy procedures.

Testing

  • test/periphery/V5UpgradePayload.t.sol — 5 tests covering constructor capture, action encoding/targets, end-to-end drain + promotion, the no-earmarked-funds case, and the not-governance revert path.
  • forge build and the existing DeployRollupForUpgrade.t.sol pass.
  • TypeScript tsc and eslint clean for the ethereum package.

@just-mitch just-mitch marked this pull request as ready for review May 31, 2026 16:13
@just-mitch just-mitch force-pushed the mitch/gk-652-write-v5-upgrade-payload branch from b95375d to 3af4bf1 Compare May 31, 2026 16:25
Adds the V5UpgradePayload governance contract that swaps canonical rollup
status to the v5 rollup and drains the old reward distributor, the
DeployRollupForUpgradeV5 forge script and its deploy_aztec_l1_contracts.ts
wrapper, the AZIP-5 reward-booster retune, and a deployment runbook with
tests.
@just-mitch just-mitch changed the base branch from next to v5-next June 1, 2026 23:44
@just-mitch just-mitch force-pushed the mitch/gk-652-write-v5-upgrade-payload branch from 3af4bf1 to 04afbd4 Compare June 1, 2026 23:53
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.

1 participant