-
Notifications
You must be signed in to change notification settings - Fork 126
perf(l2): build zkVMs with recommended settings #5458
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
Lines of code reportTotal lines added: Detailed view |
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 introduces performance optimizations for zkVM builds by configuring the Cargo release profile with recommended compiler settings from the SP1 documentation. The changes set lto = "thin" and codegen-units = 1 to improve execution performance, resulting in 2-10% gas and cycle improvements across various test scenarios.
- Added a helper function to configure Cargo profile environment variables for LTO and codegen optimization
- Applied these settings consistently across all four zkVM backends (RISC0, SP1, Zisk, and OpenVM)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| } | ||
|
|
||
| /// Force the nested guest builds to match the workspace release profile. | ||
| pub fn set_guest_release_profile_env() { |
Copilot
AI
Nov 29, 2025
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.
The pub visibility modifier is unnecessary for this function in a build script. Build scripts don't export their functions to other modules. Consider making this function private by removing pub.
| pub fn set_guest_release_profile_env() { | |
| fn set_guest_release_profile_env() { |
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.
Ah yes, I did this in order not to get the dead code clippy lint. I will change it.
Motivation
Description
Based on SP1 Docs we should compile with
ltothin, true or fat andcodegen-units1.Ethrex Replay Build Command:
cargo build --release --profile sp1,profiling