-
Notifications
You must be signed in to change notification settings - Fork 391
feat(agg-mode): support risc0 stark proofs #1874
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
Changes to gas cost
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Composite proofs|
|
||
| build_aligned_contracts: | ||
| @cd contracts/src/core && forge build | ||
| @cd contracts/src/core && forge build --via-ir |
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 had to this flag as the ci would fail otherwise. Here is what it does: https://docs.soliditylang.org/en/latest/ir-breaking-changes.html#solidity-ir-based-codegen-changes. But the TLDR: it uses a newer form of compiling solidity that has very tiny modifications that shouldn't affect us at all.
4d417b8 to
454f80c
Compare
JuArce
left a comment
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.
Some missing changes:
- Update the holesky config files with the Risc0 contract
- Add target and script to upgrade proof_aggregator
- There is missing
--via-irflag to deployment scripts
|
@JuArce, following up on your comments:
|
…ith risc0 features" This reverts commit bd5ad9d.
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 support for risc0 stark proofs in the aggregation program. Key changes include:
- Adding risc0 contracts remapping and new dependency configurations.
- Extending the proof aggregator and fetcher logic to handle both SP1 and risc0 proofs.
- Introducing a new risc0 aggregator module and updating build scripts, README, and CI workflow to integrate risc0 support.
Reviewed Changes
Copilot reviewed 24 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| contracts/remappings.txt | Added remapping for risc0 contracts. |
| aggregation_mode/src/backend/mod.rs | Updated aggregator service to select between SP1 and risc0 proofs and added seal encoding for risc0. |
| aggregation_mode/src/backend/fetcher.rs | Modified fetcher to process proofs based on the chosen engine (SP1 or risc0). |
| aggregation_mode/src/aggregators/sp1_aggregator.rs | Adjusted conversion to Box for SP1 proofs for consistent API usage. |
| aggregation_mode/src/aggregators/risc0_aggregator.rs | Introduced risc0 aggregator implementation with proof aggregation and verification logic. |
| aggregation_mode/src/aggregators/mod.rs | Updated enums and proof variants to support both SP1 and risc0 proofs. |
| aggregation_mode/build.rs | Integrated risc0 build step via embed_methods. |
| aggregation_mode/aggregation_programs/risc0/ | New risc0 aggregation program implementation. |
| aggregation_mode/README.md | Updated instructions to include risc0 deployment and proof sending. |
| aggregation_mode/Cargo.toml & .github/workflows/build-and-test-rust.yml | Updated dependencies and CI to install and build with the risc0 toolchain. |
Files not reviewed (5)
- .gitmodules: Language not supported
- Makefile: Language not supported
- contracts/lib/risc0-ethereum: Language not supported
- contracts/script/deploy/AlignedProofAggregationServiceDeployer.s.sol: Language not supported
- contracts/script/deploy/config/devnet/proof-aggregator-service.devnet.config.json: Language not supported
Comments suppressed due to low confidence (1)
aggregation_mode/src/aggregators/mod.rs:16
- [nitpick] Consider using consistent casing for the Display output of the ZKVMEngine variants (e.g., 'RISC0' instead of 'Risc0') to match the enum variant naming.
impl Display for ZKVMEngine { ... Self::RISC0 => write!(f, "Risc0"), ... }
| .filter_map(|p| match p.proving_system { | ||
| ProvingSystemId::Risc0 => { | ||
| let mut image_id = [0u8; 32]; | ||
| image_id.copy_from_slice(p.vm_program_code?.as_slice()); |
Copilot
AI
Apr 24, 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.
Ensure that 'p.vm_program_code' always yields a 32-byte slice before copying to avoid potential panics; consider adding a length check or validation.
| image_id.copy_from_slice(p.vm_program_code?.as_slice()); | |
| let vm_program_code = p.vm_program_code?; | |
| if vm_program_code.len() != 32 { | |
| error!("Invalid vm_program_code length: expected 32, got {}", vm_program_code.len()); | |
| return None; | |
| } | |
| image_id.copy_from_slice(vm_program_code.as_slice()); |
Description
Implements risc0 aggregation program to support Risc0 stark proofs. The changes include:
sp1orrisc0ProofAggregationServicecontract was modified to support risc0 proofs verification.To run it locally, go to #1876, which deploys risc0 contracts in anvil.
Type of change
Checklist
testnet, everything else tostaging