Skip to content

Conversation

@Syndamia
Copy link
Contributor

@Syndamia Syndamia commented Dec 16, 2024

This PR aims to add Nix packages for Jolt, Nexus, zkMIPS, zkWasm, SP1 and RISC0 Zero-knowledge Virtual Machines.

For the immediate future, it will be left as a draft PR, signifying that the packages are in a useable form where anyone can try them out.

However, a lot of cleanup and testing still needs to be done until it is ready for review.

P.S. Even though it shows ~11k additions, in reality 10533 lines come from two Cargo.toml files which needed to be included. The actual code is >=510 lines, many of which are boilerplate.

@Syndamia Syndamia self-assigned this Dec 16, 2024
@Syndamia Syndamia force-pushed the zkvm-packages branch 3 times, most recently from 541717c to 10dea37 Compare December 17, 2024 13:21
@Syndamia
Copy link
Contributor Author

I've done some testing. I have created a very rough nixification of zkVMs-benchmark, with the goal of trying out these packages. I had to do some adjustments to Jolt, but outside of that, everything went swimmingly.

You can check it out here: https://github.com/blocksense-network/zkVMs-benchmark/tree/nixification-test. As is written in the README (where you'll also find usage instructions), this is a very rough proof of concept.

The codebase is as clean as I could muster, so I feel it's ready for a review.

@Syndamia Syndamia marked this pull request as ready for review December 17, 2024 16:07
@Syndamia Syndamia requested a review from PetarKirov December 18, 2024 09:12
@zah
Copy link
Member

zah commented Dec 19, 2024

Please update the README of this repo to add descriptions of the newly added packages.

While you are at it, I would also appreciate it if you make the improvements I've requested here:
#253 (comment)

@Syndamia
Copy link
Contributor Author

@zah

I've added tables for the zkVM packages. Currently they're all listed as supporting only x86_64-linux. They may support darwin but I have no devices to test.

Regarding the general README improvements, I've replaced the lists with headers, but I've not written a contents section since GitHub provides a much better one automatically:

image

I'm also not sure who to ask for organizing the packages.

@zah
Copy link
Member

zah commented Dec 20, 2024

Can you clarify why some packages feature a Cargo.lock file and others don't?

My expectation is that packages that build binaries will have a lock file and those that must be integrated as a library won't, but currently this doesn't seem to be the case.

Otherwise, this looks good for merging. Please rebase and investigate the CI issues, so we can merge it soon.

@Syndamia
Copy link
Contributor Author

Can you clarify why some packages feature a Cargo.lock file and others don't?

Because certain zkVMs don't provide one (to be more specific, it's .gitignore-ed in their repository) and crane requires it (crane is the Nix library which is used for all Rust projects). As to why they don't have a Cargo.lock, it seems in the past this was the recommended Rust workflow, though it isn't anymore.

@Syndamia
Copy link
Contributor Author

Syndamia commented Jan 6, 2025

The CI issues seem to have been from GitHub. When looking at the logs, I found the errors stemmed from not finding a repository which absolutely existed.

@Syndamia
Copy link
Contributor Author

Syndamia commented Jan 6, 2025

Caution

zkMIPS have made some large changes, which will make updating to the latest commit take a good amount of time. I'm working on it, but for now it will stay at an older commit.

Update: all zkVM packages are up to date as of 07.01.2025

Syndamia and others added 16 commits January 16, 2025 17:57
Now you could reference the package in your project's Cargo.toml as
`path = "/nix/store/...-jolt-..."`

Co-authored-by: Petar Atanasov <[email protected]>
`jolt new` will create a project with the correct /nix/store path to
jolt, installPhase now emits bin/jolt, bin/cargo, ... so all you need to
use jolt is found with `nix shell flake#jolt`
We need different cargo version when compiling the guest and host
programs and zkm requires certain variables to be set, so in the
installPhase we create cargo-host and cargo-guest, each of which set
those variables and then pass arguments to the correct cargo version
To use it you will need dependencies (cmake, pkg-config, openssl) and a
link script. Future versions will address these problems.
@github-actions
Copy link
Contributor

Thanks for your Pull Request!

Below you will find a summary of the cachix status of each package, for each supported platform.

package x86_64-linux x86_64-darwin aarch64-darwin
avalanche-cli ✅ cached ✅ cached ✅ cached
blst ✅ cached ✅ cached ✅ cached
bnb-beacon-node ✅ cached ✅ cached ✅ cached
cardano ✅ cached ✅ cached 🚫 not supported
cdt ✅ cached 🚫 not supported 🚫 not supported
circom ✅ cached ✅ cached ✅ cached
circom_runtime ✅ cached ✅ cached ✅ cached
corepack-shims ✅ cached ✅ cached ✅ cached
cosmos-theta-testnet ✅ cached ✅ cached ✅ cached
emscripten ✅ cached ✅ cached ✅ cached
eos-vm ✅ cached 🚫 not supported 🚫 not supported
ffiasm ✅ cached ✅ cached 🚫 not supported
ffiasm-src ✅ cached ✅ cached 🚫 not supported
gaiad ✅ cached ✅ cached ✅ cached
graphql ✅ cached ✅ cached 🚫 not supported
jolt ✅ cached 🚫 not supported 🚫 not supported
jolt-guest-rust ✅ cached 🚫 not supported 🚫 not supported
kurtosis ✅ cached 🚫 not supported 🚫 not supported
nexus ✅ cached 🚫 not supported 🚫 not supported
pistache ✅ cached 🚫 not supported 🚫 not supported
polkadot ✅ cached ✅ cached ✅ cached
polkadot-fast ✅ cached ✅ cached ✅ cached
py-ecc ✅ cached 🚫 not supported 🚫 not supported
rapidsnark ✅ cached ✅ cached 🚫 not supported
rapidsnark-server ✅ cached 🚫 not supported 🚫 not supported
risc0 ✅ cached 🚫 not supported 🚫 not supported
risc0-rust ✅ cached 🚫 not supported 🚫 not supported
sp1 ✅ cached 🚫 not supported 🚫 not supported
sp1-rust ✅ cached 🚫 not supported 🚫 not supported
wasmd ✅ cached 🚫 not supported 🚫 not supported
zkm ✅ cached 🚫 not supported 🚫 not supported
zkm-rust ✅ cached 🚫 not supported 🚫 not supported
zkwasm ✅ cached 🚫 not supported 🚫 not supported
zqfield-bn254 ✅ cached ✅ cached 🚫 not supported

@zah zah merged commit f717747 into main Feb 8, 2025
10 checks passed
@zah zah deleted the zkvm-packages branch February 8, 2025 12:08
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