Skip to content

Commit b00fc13

Browse files
committed
WEB3-254: Remove dependencies of set-builder-guest to allow publishing to crates.io (#354)
This PR resolves issues with publishing `risc0-aggregation` stemming from dependency on the `set-builder` guest through Cargo. It does so by removing usage of that guest, which is in the form of all code dependending on `SET_BUILDER_ID` or `SET_BUILDER_ELF`. In practice, these values are difficult to use anyway, because they need to align with an on-chain verifier. Unless reproducible builds are always used, these values will flucuate. There is an open issue on how to better manage these values. Related #353
1 parent 2e7e5f9 commit b00fc13

File tree

5 files changed

+35
-10
lines changed

5 files changed

+35
-10
lines changed

.github/workflows/main.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ jobs:
213213
env:
214214
RISC0_SKIP_BUILD: true,
215215
RISC0_SKIP_BUILD_KERNEL: true,
216-
- run: forge doc
216+
# TODO(#355) Re-enable this check.
217+
#- run: forge doc
217218

218219
# Run as a separate job because we need to install a different set of tools.
219220
# In particular, it uses nightly Rust and _does not_ install Forge or cargo risczero.

aggregation/Cargo.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[package]
22
name = "risc0-aggregation"
3+
description = "Proof aggregation for RISC Zero"
34
resolver = "2"
45
version = "0.1.0-rc.1"
56
edition = { workspace = true }
7+
license = { workspace = true }
68
homepage = { workspace = true }
79
repository = { workspace = true }
810

@@ -13,7 +15,8 @@ rustdoc-args = ["--cfg", "docsrs"]
1315
[dependencies]
1416
alloy-primitives = { workspace = true }
1517
alloy-sol-types = { workspace = true }
16-
guest-set-builder = { path = "./guest", optional = true }
18+
# TODO(#353) Determine if it is possible to publish risc0-aggregation with set builder image ID and ELF
19+
#guest-set-builder = { version = "0.1.0", path = "./guest", optional = true }
1720
hex = { workspace = true }
1821
risc0-binfmt = { workspace = true }
1922
risc0-zkp = { workspace = true }
@@ -27,4 +30,4 @@ tokio = { workspace = true, features = ["rt-multi-thread"] }
2730

2831
[features]
2932
default = ["verify"]
30-
verify = ["dep:guest-set-builder"]
33+
verify = []

aggregation/guest/set-builder/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ edition = "2021"
66
[workspace]
77

88
[dependencies]
9-
risc0-aggregation = { path = "../..", default-features = false }
9+
risc0-aggregation = { version = "0.1.0", path = "../..", default-features = false }
1010
risc0-zkvm = { version = "1.2.0", default-features = false, features = ["std"] }

aggregation/src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ mod receipt;
3232
#[cfg(feature = "verify")]
3333
pub use receipt::{
3434
EncodingError, RecursionVerifierParamters, SetInclusionReceipt,
35-
SetInclusionReceiptVerifierParameters, VerificationError, SET_BUILDER_ELF, SET_BUILDER_ID,
36-
SET_BUILDER_PATH,
35+
SetInclusionReceiptVerifierParameters,
36+
VerificationError,
37+
/* TODO(#353)
38+
SET_BUILDER_ELF, SET_BUILDER_ID, SET_BUILDER_PATH,
39+
*/
3740
};
3841

3942
alloy_sol_types::sol! {

aggregation/src/receipt.rs

+22-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ use serde::{Deserialize, Serialize};
2626

2727
use crate::{merkle_path_root, GuestOutput, Seal};
2828

29-
pub use guest_set_builder::{SET_BUILDER_ELF, SET_BUILDER_ID, SET_BUILDER_PATH};
29+
// TODO(#353)
30+
//pub use guest_set_builder::{SET_BUILDER_ELF, SET_BUILDER_ID, SET_BUILDER_PATH};
3031

3132
/// A receipt for a claim that is part of a set of verified claims (i.e. an aggregation).
3233
#[derive(Clone, Debug, Serialize, Deserialize)]
@@ -97,18 +98,31 @@ impl<Claim> SetInclusionReceipt<Claim>
9798
where
9899
Claim: Digestible + Clone + Serialize,
99100
{
101+
/* TODO(#353)
100102
/// Construct a [SetInclusionReceipt] with the given Merkle inclusion path and claim.
101103
///
102104
/// Path should contain all sibling nodes in the tree from the leaf to the root. Note that the
103105
/// path does not include the leaf or the root itself. Resulting receipt will have default
104106
/// verifier parameters and no root receipt.
105-
pub fn from_path(claim: impl Into<MaybePruned<Claim>>, merkle_path: Vec<Digest>) -> Self {
107+
pub fn from_path(claim: impl Into<MaybePruned<Claim>>, merkle_path: Vec<Digest>);
108+
}
109+
*/
110+
111+
/// Construct a [SetInclusionReceipt] with the given Merkle inclusion path and claim.
112+
///
113+
/// Path should contain all sibling nodes in the tree from the leaf to the root. Note that the
114+
/// path does not include the leaf or the root itself. Resulting receipt will have the given
115+
/// verifier parameter digest and no root receipt.
116+
pub fn from_path_with_verifier_params(
117+
claim: impl Into<MaybePruned<Claim>>,
118+
merkle_path: Vec<Digest>,
119+
verifier_parameters: impl Into<Digest>,
120+
) -> Self {
106121
Self {
107122
claim: claim.into(),
108123
root: None,
109124
merkle_path,
110-
verifier_parameters: SetInclusionReceiptVerifierParameters::default()
111-
.digest::<sha::Impl>(),
125+
verifier_parameters: verifier_parameters.into(),
112126
}
113127
}
114128

@@ -131,6 +145,7 @@ where
131145
Self { root: None, ..self }
132146
}
133147

148+
/* TODO(#353)
134149
/// Verify the integrity of this receipt, ensuring the claim is attested to by the seal.
135150
pub fn verify_integrity(&self) -> Result<(), VerificationError> {
136151
self.verify_integrity_with_context(
@@ -139,6 +154,7 @@ where
139154
Some(RecursionVerifierParamters::default()),
140155
)
141156
}
157+
*/
142158

143159
/// Verify the integrity of this receipt, ensuring the claim is attested to by the seal.
144160
// TODO: Use a different error type (e.g. the one from risc0-zkvm).
@@ -250,6 +266,7 @@ impl Digestible for SetInclusionReceiptVerifierParameters {
250266
}
251267
}
252268

269+
/* TODO(#353)
253270
impl Default for SetInclusionReceiptVerifierParameters {
254271
/// Default set of parameters used to verify a
255272
/// [SetInclusionReceipt][super::SetInclusionReceipt].
@@ -259,6 +276,7 @@ impl Default for SetInclusionReceiptVerifierParameters {
259276
}
260277
}
261278
}
279+
*/
262280

263281
// TODO(victor): Move this into risc0-zkvm?
264282
/// Verifier parameters used for recursive verification (e.g. via env::verify) of receipts.

0 commit comments

Comments
 (0)