From aaedf9d730179082f6e9c6f15682390d3eb2dba2 Mon Sep 17 00:00:00 2001 From: Kamen Mladenov Date: Wed, 26 Feb 2025 11:19:14 +0200 Subject: feat: Add zkvm cargo features So you can make code modifications compile-time, based on the zkVM --- guests/README.md | 10 ++++++++-- guests/fibonacci/Cargo.toml | 6 ++++++ guests/graph_coloring/Cargo.toml | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) (limited to 'guests') diff --git a/guests/README.md b/guests/README.md index 1bbb176..9afcc23 100644 --- a/guests/README.md +++ b/guests/README.md @@ -26,13 +26,19 @@ These are normal Rust programs, with certain specific patterns implemented for z guests_macro = { version = "0.1.0", path = "../../guests_macro" } ``` - and add a `no_std` [feature](https://doc.rust-lang.org/cargo/reference/features.html) like this: + and add a `no_std` and zkVM [features](https://doc.rust-lang.org/cargo/reference/features.html) like this: ```toml no_std = [] + jolt = [] + nexus = [] + risc0 = [] + sp1 = [] + zkm = [] + zkwasm = [] ``` - It's ok if you don't conditionally include anything with the feature, however it **must** exist! + It's ok if you don't use those features in any way, however they **must** exist! 4. **Update your program.** diff --git a/guests/fibonacci/Cargo.toml b/guests/fibonacci/Cargo.toml index 4fe043c..6ada0c6 100644 --- a/guests/fibonacci/Cargo.toml +++ b/guests/fibonacci/Cargo.toml @@ -8,3 +8,9 @@ guests_macro = { version = "0.1.0", path = "../../guests_macro" } [features] no_std = [] +jolt = [] +nexus = [] +risc0 = [] +sp1 = [] +zkm = [] +zkwasm = [] diff --git a/guests/graph_coloring/Cargo.toml b/guests/graph_coloring/Cargo.toml index b097d33..14af0f8 100644 --- a/guests/graph_coloring/Cargo.toml +++ b/guests/graph_coloring/Cargo.toml @@ -8,3 +8,9 @@ guests_macro = { version = "0.1.0", path = "../../guests_macro" } [features] no_std = [] +jolt = [] +nexus = [] +risc0 = [] +sp1 = [] +zkm = [] +zkwasm = [] -- cgit v1.2.3