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 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 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.

@github-actions
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
@github-project-automation github-project-automation bot moved this to In Review in ethrex_l1 Oct 21, 2025
@tomip01 tomip01 added this pull request to the merge queue Oct 22, 2025
Merged via the queue into main with commit d13c5a8 Oct 22, 2025
42 checks passed
@tomip01 tomip01 deleted the fix_risc0 branch October 22, 2025 15:46
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Oct 22, 2025
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: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants