Skip to content

Conversation

@nategraf
Copy link

@nategraf nategraf commented Jan 5, 2026

This PR merges in the upstream commits up to v0.3.16.

This PR should be merged into the risc0 branch as a rebase, preserving this constituent commits instead of squashing them. Once this is done, a tag for v0.3.16-risczero.0 can be pushed as new releases of this patch.

dot-asm added 30 commits March 7, 2025 23:12
Since blst itself does not call the function in question, blst users
are not affected by this problem. It only impacts the alt_bn128 field
in sppark on ARM.
Shave off redundant instructions and ensure pair-loads/stores are 128-bit
aligned.
It's deemed to be benign in real-life applications. Or in other words
in order to trigger an actual problem one would need to explicitly
implement an unusually specific test case.
@nategraf nategraf requested a review from flaub January 5, 2026 22:23
@github-actions github-actions bot changed the title Update patch to 0.3.16 ZKVM-1459: Update patch to 0.3.16 Jan 5, 2026
Comment on lines 84 to 85
[patch.crates-io]
blst = { path = "." }
Copy link
Member

Choose a reason for hiding this comment

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

Is this intended? Without other context, it seems like this is bad.

Copy link
Author

Choose a reason for hiding this comment

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

Good question. I added it to address an issue that risc0-zkvm is used as a dev-dependency in the the tests that are added to this crate. risc0-zkvm transitively depends on blst, and without this patch statement running cargo test fails with the following

error: failed to select a version for `blst`.
    ... required by package `risc0-groth16-sys v0.1.0`
    ... which satisfies dependency `risc0-groth16-sys = "^0.1.0"` of package `risc0-groth16 v3.0.1`
    ... which satisfies dependency `risc0-groth16 = "^3.0.1"` of package `risc0-zkvm v3.0.1`
    ... which satisfies dependency `risc0-zkvm = "^3.0"` of package `blst v0.3.16 (/home/victor/risc0/patches/blst/bindings/rust)`
versions that meet the requirements `^0.3.15` are: 0.3.16, 0.3.15

package `blst` links to the native library `blst`, but it conflicts with a previous package which links to `blst` as well:
package `blst v0.3.16 (/home/victor/risc0/patches/blst/bindings/rust)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "blst"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `blst` which could resolve this conflict

I'll do some more thinking and poke around to see if I can figure out another way to do this, because it does seem like a hacky solution.

Copy link
Author

Choose a reason for hiding this comment

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

We don't need this anymore since I was able to get the library tests running under cargo risczero guest test. This includes a super-set of what was added as tests using a guest to wrap the test functionality. I removed those in 21045fa. Running it also shook out an alignment issue in the constants, which I address in 1ac51e3

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.

6 participants