Skip to content

feat(toolchain): support getrandom v0.2 and v0.3 simultaneously#1795

Merged
jonathanpwang merged 1 commit into
mainfrom
feat/support-getrandom-23
Jun 26, 2025
Merged

feat(toolchain): support getrandom v0.2 and v0.3 simultaneously#1795
jonathanpwang merged 1 commit into
mainfrom
feat/support-getrandom-23

Conversation

@jonathanpwang

Copy link
Copy Markdown
Contributor

With the v1.3.0-rc release, we moved to supporting getrandom v0.3. However some libraries like ecdsa still use getrandom v0.2 and it would give the unsupported backend error.

Turns out it is possible to support both simultaneously.

Closes INT-4187

@jonathanpwang jonathanpwang requested review from HrikB and Copilot June 26, 2025 14:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 aims to support both getrandom v0.2 and v0.3 simultaneously so that libraries still using getrandom v0.2 (e.g., ecdsa) do not trigger an unsupported backend error.

  • Updated test cases to pass a program name parameter for getrandom and getrandom_v02
  • Added a new example program for getrandom_v02 and updated compile error directives
  • Adjusted Cargo.toml and custom getrandom registrations to include getrandom-v02 support

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
extensions/rv32im/tests/src/lib.rs Updated test cases to include getrandom_v02 as program input
extensions/rv32im/tests/programs/examples/getrandom_v02.rs Added new example program for getrandom v0.2
extensions/rv32im/tests/programs/examples/getrandom.rs Added compile error directive for getrandom-v02 compatibility
extensions/rv32im/tests/programs/Cargo.toml Included getrandom-v02 dependency and updated feature config
crates/toolchain/openvm/src/getrandom.rs Added custom registration for getrandom_v02
crates/toolchain/openvm/Cargo.toml Updated dependencies and feature definitions for getrandom-v02
Comments suppressed due to low confidence (1)

extensions/rv32im/tests/src/lib.rs:281

  • [nitpick] There is an inconsistency in naming between the program identifier 'getrandom_v02' (with an underscore) and the feature flag 'getrandom-v02' (with a hyphen). Consider aligning these naming conventions for clarity.
    #[test_case("getrandom_v02", vec!["getrandom-v02", "getrandom-unsupported"])]

@github-actions

Copy link
Copy Markdown
group app.proof_time_ms app.cycles app.cells_used leaf.proof_time_ms leaf.cycles leaf.cells_used
verify_fibair (+12 [+1.0%]) 1,202 322,699 17,340,132 - - -
fibonacci (+25 [+0.9%]) 2,667 1,500,277 50,589,503 - - -
regex (+43 [+0.5%]) 7,924 4,165,226 166,511,152 - - -
ecrecover 1,142 136,241 8,089,270 - - -
pairing (-67 [-1.5%]) 4,480 1,862,964 97,277,783 - - -

Commit: 0781ff5

Benchmark Workflow

@jonathanpwang jonathanpwang merged commit 3b40bd8 into main Jun 26, 2025
27 checks passed
@jonathanpwang jonathanpwang deleted the feat/support-getrandom-23 branch June 26, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants