- 
                Notifications
    
You must be signed in to change notification settings  - Fork 116
 
          fix(l2): fix ethrex-l2-common crate compilation
          #5106
        
          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
Conversation
ethrex-l2-common doesn't need sp1 and risc0 features anymore
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 refactors the handling of ZKVM program ELF files by centralizing their definitions in the guest_program module and removing the redundant logic from the common crate. The main goal is to simplify the codebase by eliminating duplicate ELF loading code and streamlining feature flag dependencies.
Key changes:
- Centralized ZKVM program ELF constants (
ZKVM_SP1_PROGRAM_ELF,ZKVM_RISC0_PROGRAM_ELF) in theguest_programmodule - Removed the 
aligned_vm_program_code()method fromProverTypein the common crate and replaced it with direct ELF access in the sequencer - Updated feature flag dependencies to propagate through the workspace more cleanly
 
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description | 
|---|---|
| crates/l2/sequencer/l1_proof_sender.rs | Updated to directly access ZKVM ELF constants and added feature flag validation when sending proofs to Aligned Layer | 
| crates/l2/prover/src/guest_program/src/lib.rs | Added ZKVM_SP1_PROGRAM_ELF constant definition with conditional compilation based on sp1 feature flag | 
| crates/l2/prover/src/backend/sp1.rs | Updated to use centralized ZKVM_SP1_PROGRAM_ELF constant instead of local definition | 
| crates/l2/common/src/prover.rs | Removed aligned_vm_program_code() method and associated constants, added documentation clarifying vk_path usage | 
| crates/l2/common/Cargo.toml | Removed sp1 and risc0 feature flags from common crate | 
| crates/l2/Cargo.toml | Added sp1 and risc0 feature flags that propagate to guest_program | 
| cmd/ethrex/Cargo.toml | Removed ethrex-l2-common feature dependencies for sp1 and risc0 | 
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
          Lines of code reportTotal lines added:  Detailed view | 
    
        
          
                crates/l2/common/src/prover.rs
              
                Outdated
          
        
      | /// proof verification. Aligned Layer uses a different vk in SP1's case. | ||
| /// | ||
| /// There's no need to have the following verifying keys here since | ||
| /// they are used by the deployer and they are not used by the sequencer. | 
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.
Can't we delete this so?
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.
I think the comment is misleading, that functionality is actually used by the deployer. Unless you meant to remove that from there and use it directly in the deployer bin.
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.
Yes, I the comment is confusing too. Maybe something like ...?
This function can be moved since it's used by the deployer but not the sequencer
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.
I'll move the functionality there then.
Motivation
ethrex-l2-commonneeds for the SP1 and RISC0 guests' ELF to exist to compile.guest_programgenerates said ELFs in itsbuild.rs, but asethrex-l2-common, it's compiled before thebuild.rsruns, causing a compilation error.Description
guest_programcrate.guest_programcrate).sp1andrisc0features fromethrex-l2-commonas they are not needed anymore.