Skip to content

Conversation

tomip01
Copy link
Contributor

@tomip01 tomip01 commented Oct 15, 2025

Motivation

Risc0 is currently failing because precompute must be set to 0.

This changes were made by @gianbelinche

Follow up

Opened this issue to update the code once the change becomes available.

@tomip01 tomip01 requested a review from a team as a code owner October 15, 2025 22:23
@Copilot Copilot AI review requested due to automatic review settings October 15, 2025 22:23
@github-actions github-actions bot added L1 Ethereum client L2 Rollup client labels Oct 15, 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 introduces a feature flag system to conditionally set the KZG precompute parameter based on the target environment. It addresses Risc0 compatibility issues by setting the precompute value to 0 for Risc0 builds while maintaining the optimized value of 8 for other environments.

  • Added a risc0 feature flag across the common crates
  • Introduced conditional compilation for KZG precompute values
  • Updated all KZG function calls to use the new configurable constant

Reviewed Changes

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

File Description
crates/l2/prover/src/guest_program/src/risc0/Cargo.toml Enables the risc0 feature for ethrex-common dependency
crates/common/crypto/kzg.rs Adds conditional KZG_PRECOMPUTE constant and updates function calls
crates/common/crypto/Cargo.toml Defines the risc0 feature flag
crates/common/Cargo.toml Propagates the risc0 feature to the crypto subcrate

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

Copy link

github-actions bot commented Oct 15, 2025

Lines of code report

Total lines added: 6
Total lines removed: 0
Total lines changed: 6

Detailed view
+------------------------------------+-------+------+
| File                               | Lines | Diff |
+------------------------------------+-------+------+
| ethrex/crates/common/crypto/kzg.rs | 143   | +6   |
+------------------------------------+-------+------+

[features]
default = []
c-kzg = ["dep:c-kzg"]
risc0 = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's include c-kzg in risc0.

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 2c5b849

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need to update RISC0's guest Cargo.lock?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, there is no need. I ran cargo check inside risc0 guest program and nothing change

@tomip01 tomip01 force-pushed the fix_risc0 branch 2 times, most recently from 8fc9d1e to 36be0a2 Compare October 16, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client L2 Rollup client

Projects

Status: No status
Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants