Skip to content

Conversation

@ilitteri
Copy link
Contributor

@ilitteri ilitteri commented Oct 29, 2025

Motivation

RISC0's p256 patch is not unstable anymore and k256 patch has a new version.

Description

  • Enable p256 patch in RISC0's guest.
  • Update k256 patch version.
  • Remove blst commented patch because we don't use it anywhere in ethrex.

@ilitteri ilitteri self-assigned this Oct 29, 2025
@ilitteri ilitteri requested a review from a team as a code owner October 29, 2025 19:14
Copilot AI review requested due to automatic review settings October 29, 2025 19:14
@github-actions github-actions bot added the L2 Rollup client label Oct 29, 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 enables p256 elliptic curve support in the risc0 guest program by activating the previously commented-out p256 patch and updating it to a newer risczero version. The change moves p256 from the "unstable" category to production-ready status.

  • Enables p256 elliptic curve cryptography for risc0 zkVM programs
  • Updates p256 patch from risczero.0 to risczero.1 version
  • Includes required transitive dependencies (risc0-bigint2, bytemuck)

Reviewed Changes

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

File Description
crates/l2/prover/src/guest_program/src/risc0/Cargo.toml Uncommented and updated p256 patch to risczero.1, formatted ethrex-common features
crates/l2/prover/src/guest_program/src/risc0/Cargo.lock Updated p256 and primeorder dependencies to use git sources with new risc0-bigint2 dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


[patch.crates-io]
sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" }
k256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.4-risczero.0" }
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

The p256 dependency is being moved from the 'unstable' comment section to active patches, but there's no comment explaining why it's now safe for production. Consider adding a comment documenting the change from unstable to stable status, especially since line 41-42 warns that unstable features are 'not suited for production environments.'

Suggested change
k256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.4-risczero.0" }
k256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.4-risczero.0" }
# The p256 patch was previously considered unstable and commented out below.
# It is now considered stable and safe for production use, as the required changes
# have been reviewed and tested. See PR/issue tracker for details.

Copilot uses AI. Check for mistakes.
# These precompiles require the "unstable" risc0 feature which is not suited
# for production environments.
# tiny-keccak = { git = "https://github.com/risc0/tiny-keccak", tag = "tiny-keccak/v2.0.2-risczero.0" }
# blst = { git = "https://github.com/risc0/blst", tag = "blst/v0.3.14-risczero.0" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this one deleted but not added?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we don't use it anywhere in ethrex.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the PR description.

@ilitteri ilitteri added this pull request to the merge queue Oct 31, 2025
Merged via the queue into main with commit d4b20ef Oct 31, 2025
41 checks passed
@ilitteri ilitteri deleted the update_risc0_patches branch October 31, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L2 Rollup client

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants