Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jonathanpwang
Copy link
Contributor

DO NOT SQUASH MERGE

Avaneesh-axiom and others added 15 commits June 20, 2025 06:45
The point decompression function takes the x-coordinate and the parity
of the y-coordinate. Then it solves $y^2 = x^3 + ax + b$ for $y$ up to
parity. If the recovered $y$ doesn't have the correct parity, it returns
the point $(x, -y)$, otherwise it returns $(x, y)$.

The problem happens if the recovered $y$ is $0$ and `rec_id = 1`, in
which case $-y$ has the same parity as $y$ (namely, even), so although
the resulting point $(x, y)$ is a valid point on the curve, it does not
correspond to `rec_id = 1`.

This is not an issue for Secp256k1 and Secp256r1 since these curves do
not have points with $y = 0$ (such a point would have order 2 since $P =
-P$ and the order of these curves is not even) so any such decompression
will fail.

However, a curve could be constructed for which this is an issue.

This PR adds a failing test with such a curve and then fixes the bug by
checking the special case.
Note that the curve equation for `CurvePoint5mod8` in the
`decompress.rs` test was changed so that a point with y-coordinate zero
exists in that curve.

---------

Co-authored-by: Jonathan Wang <[email protected]>
Fixes the `verify_stark` integration test following some folder
reorganization.
close INT-4031

---------

Co-authored-by: Jonathan Wang <[email protected]>
Co-authored-by: HrikB <[email protected]>
Runs the `verify-stark` integration test in CI
)

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
# Add versioning compatibility workflow for INT-4160

## Overview

This PR implements a new GitHub workflow to enforce OpenVM's versioning
policy as described in ticket INT-4160. The workflow verifies that
verification keys remain consistent between the main branch and the
latest patch version (v1.2.0).

## Changes

- **New workflow file**: `.github/workflows/versioning.yml`
- **Workflow functionality**:
  - Runs `cargo openvm keygen` with default config on the main branch
  - Runs `cargo openvm keygen` with default config on v1.2.0 tag
- Compares the generated verification keys (`app.vk`) using `cmp`
command
- Fails the workflow if verification keys differ, indicating a
versioning policy violation

## Technical Implementation

The workflow follows the established patterns in the repository:
- Uses the same runner configuration as other workflows
(`32cpu-linux-arm64`)
- Includes proper Rust toolchain setup and caching
- Installs the CLI tool using `cargo install --force --path crates/cli`
- Uses default keygen configuration (no custom config file specified)
- Outputs keys to separate directories for comparison

## Versioning Policy Enforcement

As stated in `VERSIONING.md`, the core principle is: **"Patch upgrade
should be backward compatible"**. This means the verification key
(`MultiStarkVerifyingKey`) must not change across patch versions. This
workflow automatically verifies this requirement.

## Testing

The workflow has been structured based on existing patterns in the
codebase:
- Follows the same YAML structure as other workflows in
`.github/workflows/`
- Uses the same actions and runner configurations
- Implements the keygen functionality as described in
`crates/cli/src/commands/keygen.rs`

Successful test run here:
https://github.com/openvm-org/openvm/actions/runs/15722075897/job/44304740887

## Ticket Reference

- **Linear Ticket**: INT-4160
- **Link to Devin run**:
https://app.devin.ai/sessions/b18b4684e92c44daabd69e34e47bd138
- **Requested by**: Yi Sun

## Workflow Triggers

- Runs on push to `main` branch
- Supports manual dispatch via `workflow_dispatch`

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Yi Sun <[email protected]>
Co-authored-by: Hrik Bhowal <[email protected]>
For reasons I am not entirely clear on, when you use
`getrandom_v02::Error`, the `getrandom` crate pulls in `std` library.
But if you just directly implement what the `register_custom_getrandom!`
macro does, this goes away...

Fixes CI failure.

Full disclosure: I got the idea from
https://github.com/risc0/risc0/pull/3106/files#diff-fd010fc66ba8d918981d2705c0d10cd65d19db599969bb29bb14caffa62d3b65R95
## Summary
- Updates the version command to display in the format `v1.3.0-rc.1
(abc123...)` instead of showing build timestamp
- Adds version tag to openvm dependency when running `cargo openvm init`
- Dependencies now include `tag = "v1.3.0-rc.1"` for reproducible builds

## Changes
1. Modified `OPENVM_VERSION_MESSAGE` in `crates/cli/src/lib.rs` to show
version and commit hash
2. Updated `crates/cli/build.rs` to only emit git SHA (removed build
timestamp)
3. Enhanced `add_openvm_dependency` function in
`crates/cli/src/commands/init.rs` to include version tag

## Test plan
- [x] Built cargo-openvm with `cargo build -p cargo-openvm`
- [x] Tested version command: `./target/debug/cargo-openvm openvm
--version` outputs `v1.3.0-rc.1 (46160dd)`
- [x] Tested init command: `cargo openvm init` now adds dependency with
version tag

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <[email protected]>
Separates the functions exposed by guest libs into their own section in
the book.

Closes INT-4294

---------

Co-authored-by: Jonathan Wang <[email protected]>
And update on support for both getrandom v0.2 and v0.3.

closes INT-4186
Clarify that OpenVM's use of the Harvard architecture and how it relates
to reflective programming.

Closes INT-4352

---------

Co-authored-by: Yi Sun <[email protected]>
Currently if we change the workspace version before tagging, the
integration test for `cargo openvm init` will break because it creates a
guest crate that references the tagged version. I updated the test so it
patches to the local openvm if the environmental variable
`USE_LOCAL_OPENVM=1` is set.
@jonathanpwang
Copy link
Contributor Author

@shuklaayush @nyunyunyunyu here is the failing verify_stark test

@github-actions

This comment has been minimized.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 10, 2025

CodSpeed WallTime Performance Report

Merging #1844 will not alter performance

Comparing feat/new-exec-merge-1.3 (ac7576d) with feat/new-execution (dabf5d5)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 20 untouched benchmarks

The patching doesn't work because cargo still tries to fetch from git
first before doing the patch, so instead we use a find replace approach.
I have tested this with v1.4.0-rc.0 to ensure it works.
@github-actions
Copy link

group app.proof_time_ms app.cycles app.cells_used leaf.proof_time_ms leaf.cycles leaf.cells_used
verify_fibair (-20 [-1.6%]) 1,242 322,700 17,271,202 - - -
fibonacci (-19 [-0.8%]) 2,349 1,500,277 50,589,231 - - -
regex (+92 [+1.3%]) 7,054 4,165,432 166,449,586 - - -
ecrecover (-38 [-2.8%]) 1,339 137,283 8,179,549 - - -
pairing (-34 [-0.8%]) 4,033 1,862,964 102,530,853 - - -

Commit: ac7576d

Benchmark Workflow

@jonathanpwang jonathanpwang merged commit a7d1125 into feat/new-execution Jul 10, 2025
30 of 31 checks passed
@jonathanpwang jonathanpwang deleted the feat/new-exec-merge-1.3 branch July 10, 2025 20:10
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.

5 participants