Skip to content

Conversation

ManuelBilbao
Copy link
Contributor

Motivation

Currently when someone wants to upgrade the ethrex version of an L2, they have to perform an UUPS upgrade to the contract in order to upgrade the verification keys.

Description

Add a function to upgrade SP1 and RISC0 VKs without the need of a full upgrade to the contract

@ManuelBilbao ManuelBilbao self-assigned this Sep 23, 2025
@Copilot Copilot AI review requested due to automatic review settings September 23, 2025 13:43
@ManuelBilbao ManuelBilbao added the L2 Rollup client label Sep 23, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds functionality to upgrade SP1 and RISC0 verification keys in the OnChainProposer contracts without requiring a full UUPS contract upgrade.

  • Adds two new functions to upgrade verification keys for SP1 and RISC0 zkVMs independently
  • Implements the functions in both standard and based OnChainProposer contracts with proper access control

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
crates/l2/contracts/src/l1/interfaces/IOnChainProposer.sol Adds interface declarations for SP1 and RISC0 verification key upgrade functions
crates/l2/contracts/src/l1/based/interfaces/IOnChainProposer.sol Adds interface declarations for SP1 and RISC0 verification key upgrade functions (based variant)
crates/l2/contracts/src/l1/based/OnChainProposer.sol Implements verification key upgrade functions with owner-only access control (based variant)
crates/l2/contracts/src/l1/OnChainProposer.sol Implements verification key upgrade functions with owner-only access control

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


/// @inheritdoc IOnChainProposer
function upgradeSP1VerificationKey(bytes32 new_vk) public onlyOwner {
SP1_VERIFICATION_KEY = new_vk;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's emit an event here after setting it (same for RISC0 and the non-based cases)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 95d6580

@ManuelBilbao
Copy link
Contributor Author

I created an issue to document this process along with other upgrades

@jrchatruc jrchatruc added this pull request to the merge queue Sep 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L2 Rollup client
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants