-
Notifications
You must be signed in to change notification settings - Fork 105
feat(l2): add verification key upgrade functions #4611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
crates/l2/contracts/src/l1/based/interfaces/IOnChainProposer.sol
Outdated
Show resolved
Hide resolved
crates/l2/contracts/src/l1/based/interfaces/IOnChainProposer.sol
Outdated
Show resolved
Hide resolved
|
||
/// @inheritdoc IOnChainProposer | ||
function upgradeSP1VerificationKey(bytes32 new_vk) public onlyOwner { | ||
SP1_VERIFICATION_KEY = new_vk; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 95d6580
I created an issue to document this process along with other upgrades |
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