From 48512ef238237f9ac78be103bebae27f7b51dcd4 Mon Sep 17 00:00:00 2001 From: Victor Graf Date: Thu, 5 Dec 2024 11:52:49 -0800 Subject: [PATCH 1/6] add version ref to agg guest --- aggregation/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aggregation/Cargo.toml b/aggregation/Cargo.toml index b56e8b24..657003be 100644 --- a/aggregation/Cargo.toml +++ b/aggregation/Cargo.toml @@ -13,7 +13,7 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] alloy-primitives = { workspace = true } alloy-sol-types = { workspace = true } -guest-set-builder = { path = "./guest", optional = true } +guest-set-builder = { version = "0.1.0", path = "./guest", optional = true } hex = { workspace = true } risc0-binfmt = { workspace = true } risc0-zkp = { workspace = true } From a0c9de5e8d2268d7ecda07ff6d01f8e242555cf8 Mon Sep 17 00:00:00 2001 From: Victor Graf Date: Thu, 5 Dec 2024 11:56:31 -0800 Subject: [PATCH 2/6] add version ref to use of risc-aggregation --- aggregation/guest/set-builder/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aggregation/guest/set-builder/Cargo.toml b/aggregation/guest/set-builder/Cargo.toml index 77d2d18f..a2698f53 100644 --- a/aggregation/guest/set-builder/Cargo.toml +++ b/aggregation/guest/set-builder/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "set-builder" -version = "0.1.0" +version = "0.1.0-alpha.1" edition = "2021" [workspace] [dependencies] -risc0-aggregation = { path = "../..", default-features = false } +risc0-aggregation = { version = "0.1.0-alpha.1", path = "../..", default-features = false } risc0-zkvm = { git = "https://github.com/risc0/risc0", branch = "main", default-features = false, features = ["std"] } From e4748dc05569bec55eea63d6ea0bbb8fb3666e93 Mon Sep 17 00:00:00 2001 From: Victor Graf Date: Thu, 5 Dec 2024 11:58:32 -0800 Subject: [PATCH 3/6] disable verify flag as default --- aggregation/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aggregation/Cargo.toml b/aggregation/Cargo.toml index 657003be..e3d4a55b 100644 --- a/aggregation/Cargo.toml +++ b/aggregation/Cargo.toml @@ -26,5 +26,5 @@ rand = { workspace = true } tokio = { workspace = true, features = ["rt-multi-thread"] } [features] -default = ["verify"] +default = [] verify = ["dep:guest-set-builder"] From 9db59ab98664112ff8ba0cc610695fb6c04867dc Mon Sep 17 00:00:00 2001 From: Victor Graf Date: Thu, 5 Dec 2024 12:37:07 -0800 Subject: [PATCH 4/6] comment out code that requires guest --- aggregation/Cargo.toml | 7 ++++--- aggregation/src/lib.rs | 7 +++++-- aggregation/src/receipt.rs | 26 ++++++++++++++++++++++---- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/aggregation/Cargo.toml b/aggregation/Cargo.toml index e3d4a55b..7041d49e 100644 --- a/aggregation/Cargo.toml +++ b/aggregation/Cargo.toml @@ -13,7 +13,8 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] alloy-primitives = { workspace = true } alloy-sol-types = { workspace = true } -guest-set-builder = { version = "0.1.0", path = "./guest", optional = true } +# TODO(#353) Determine if it is possible to publish risc0-aggregation with set builder image ID and ELF +#guest-set-builder = { version = "0.1.0", path = "./guest", optional = true } hex = { workspace = true } risc0-binfmt = { workspace = true } risc0-zkp = { workspace = true } @@ -26,5 +27,5 @@ rand = { workspace = true } tokio = { workspace = true, features = ["rt-multi-thread"] } [features] -default = [] -verify = ["dep:guest-set-builder"] +default = ["verify"] +verify = [] diff --git a/aggregation/src/lib.rs b/aggregation/src/lib.rs index 68a311c1..1daf05c0 100644 --- a/aggregation/src/lib.rs +++ b/aggregation/src/lib.rs @@ -32,8 +32,11 @@ mod receipt; #[cfg(feature = "verify")] pub use receipt::{ EncodingError, RecursionVerifierParamters, SetInclusionReceipt, - SetInclusionReceiptVerifierParameters, VerificationError, SET_BUILDER_ELF, SET_BUILDER_ID, - SET_BUILDER_PATH, + SetInclusionReceiptVerifierParameters, + VerificationError, + /* TODO(#353) + SET_BUILDER_ELF, SET_BUILDER_ID, SET_BUILDER_PATH, + */ }; alloy_sol_types::sol! { diff --git a/aggregation/src/receipt.rs b/aggregation/src/receipt.rs index f03ec678..24f9f60b 100644 --- a/aggregation/src/receipt.rs +++ b/aggregation/src/receipt.rs @@ -26,7 +26,8 @@ use serde::{Deserialize, Serialize}; use crate::{merkle_path_root, GuestOutput, Seal}; -pub use guest_set_builder::{SET_BUILDER_ELF, SET_BUILDER_ID, SET_BUILDER_PATH}; +// TODO(#353) +//pub use guest_set_builder::{SET_BUILDER_ELF, SET_BUILDER_ID, SET_BUILDER_PATH}; /// A receipt for a claim that is part of a set of verified claims (i.e. an aggregation). #[derive(Clone, Debug, Serialize, Deserialize)] @@ -97,18 +98,31 @@ impl SetInclusionReceipt where Claim: Digestible + Clone + Serialize, { + /* TODO(#353) /// Construct a [SetInclusionReceipt] with the given Merkle inclusion path and claim. /// /// Path should contain all sibling nodes in the tree from the leaf to the root. Note that the /// path does not include the leaf or the root itself. Resulting receipt will have default /// verifier parameters and no root receipt. - pub fn from_path(claim: impl Into>, merkle_path: Vec) -> Self { + pub fn from_path(claim: impl Into>, merkle_path: Vec); + } + */ + + /// Construct a [SetInclusionReceipt] with the given Merkle inclusion path and claim. + /// + /// Path should contain all sibling nodes in the tree from the leaf to the root. Note that the + /// path does not include the leaf or the root itself. Resulting receipt will have the given + /// verifier parameter digest and no root receipt. + pub fn from_path_with_verifier_params( + claim: impl Into>, + merkle_path: Vec, + verifier_parameters: impl Into, + ) -> Self { Self { claim: claim.into(), root: None, merkle_path, - verifier_parameters: SetInclusionReceiptVerifierParameters::default() - .digest::(), + verifier_parameters: verifier_parameters.into(), } } @@ -131,6 +145,7 @@ where Self { root: None, ..self } } + /* TODO(#353) /// Verify the integrity of this receipt, ensuring the claim is attested to by the seal. pub fn verify_integrity(&self) -> Result<(), VerificationError> { self.verify_integrity_with_context( @@ -139,6 +154,7 @@ where Some(RecursionVerifierParamters::default()), ) } + */ /// Verify the integrity of this receipt, ensuring the claim is attested to by the seal. // TODO: Use a different error type (e.g. the one from risc0-zkvm). @@ -250,6 +266,7 @@ impl Digestible for SetInclusionReceiptVerifierParameters { } } +/* TODO(#353) impl Default for SetInclusionReceiptVerifierParameters { /// Default set of parameters used to verify a /// [SetInclusionReceipt][super::SetInclusionReceipt]. @@ -259,6 +276,7 @@ impl Default for SetInclusionReceiptVerifierParameters { } } } +*/ // TODO(victor): Move this into risc0-zkvm? /// Verifier parameters used for recursive verification (e.g. via env::verify) of receipts. From 8c388bd3b0ce3ea549f8f7e216dda730a55cb739 Mon Sep 17 00:00:00 2001 From: Victor Graf Date: Thu, 5 Dec 2024 12:43:39 -0800 Subject: [PATCH 5/6] add description and license --- aggregation/Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aggregation/Cargo.toml b/aggregation/Cargo.toml index 7041d49e..60e88c7a 100644 --- a/aggregation/Cargo.toml +++ b/aggregation/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "risc0-aggregation" +description = "Proof aggregation for RISC Zero" resolver = "2" version = "0.1.0-alpha.1" edition = { workspace = true } +license = { workspace = true } homepage = { workspace = true } repository = { workspace = true } From 333c5e00d7d53c12aeb5fc81f0a5c35f5e6ac676 Mon Sep 17 00:00:00 2001 From: Victor Graf Date: Thu, 5 Dec 2024 15:30:42 -0800 Subject: [PATCH 6/6] disable forge doc in CI --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 236aeb95..0fcc41f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -213,7 +213,8 @@ jobs: env: RISC0_SKIP_BUILD: true, RISC0_SKIP_BUILD_KERNEL: true, - - run: forge doc + # TODO(#355) Re-enable this check. + #- run: forge doc # Run as a separate job because we need to install a different set of tools. # In particular, it uses nightly Rust and _does not_ install Forge or cargo risczero.