Skip to content

Compilation Failure: Multiple risc0-zkp Versions Causing Type Mismatches and Missing Trait Implementations #53

@ankit2771991

Description

@ankit2771991

The project is experiencing compilation errors due to conflicts between different versions of the risc0-zkp crate and missing trait implementations in the RISC0 ZK-VM ecosystem.

guest: Compiling keccak v0.1.5
guest: Compiling cobs v0.2.3
guest: Compiling spin v0.9.8
guest: Compiling postcard v1.1.1
guest: Compiling lazy_static v1.5.0
guest: Compiling merlin v3.0.0
guest: Compiling risc0-zkvm-platform v1.2.5
guest: Compiling derive_more v2.0.1
guest: Compiling risc0-core v1.2.5
guest: Compiling ark-crypto-primitives-macros v0.5.0
guest: Compiling risc0-circuit-recursion v1.4.0
guest: Compiling risc0-binfmt v2.0.0
guest: Compiling ark-poly v0.5.0
guest: Compiling ark-relations v0.5.1
guest: Compiling ark-snark v0.5.1
guest: Compiling derivative v2.2.0
guest: Compiling risc0-circuit-rv32im v1.2.5
guest: Compiling ark-ec v0.5.0
guest: Compiling risc0-binfmt v1.2.5
guest: Compiling downcast-rs v1.2.1
guest: Compiling serde_json v1.0.140
guest: Compiling rrs-lib v0.1.0
guest: Compiling risc0-circuit-keccak v1.4.0
guest: Compiling ark-crypto-primitives v0.5.0
guest: Compiling ark-bn254 v0.5.0
guest: Compiling ark-groth16 v0.5.0
guest: Compiling memchr v2.7.4
guest: Compiling risc0-groth16 v1.4.0
guest: Compiling ryu v1.0.20
guest: Compiling itoa v1.0.15
guest: Compiling risc0-zkvm v1.2.5
guest: error[E0271]: expected {closure@succinct.rs:259:25} to be a closure that returns Option<Digest>, but it returns Option<Digest>
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/succinct.rs:257:9
guest: |
guest: 256 | Ok(risc0_circuit_rv32im::control_ids(hash_name, po2_max).chain(
guest: | ----- required by a bound introduced by this call
guest: 257 | / zkr_control_ids
guest: 258 | | .into_iter()
guest: 259 | | .filter_map(move |(name, digest)| allowed_zkr_names.contains(name).then_some(digest)),
guest: | |_________________________________________________________________________________________________^ expected risc0_zkp::core::digest::Digest, found a different risc0_zkp::core::digest::Digest
guest: |
guest: = note: risc0_zkp::core::digest::Digest and risc0_zkp::core::digest::Digest have similar names, but are actually distinct types
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-2.0.0/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-1.2.5/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: = note: perhaps two different versions of crate risc0_zkp are being used?
guest: = note: required for FilterMap<IntoIter<(&str, Digest), 27>, {closure@succinct.rs:259:25}> to implement Iterator
guest: note: required by a bound in std::iter::Iterator::chain
guest: --> /opt/actions-runner/work/rust/rust/rust/library/core/src/iter/traits/iterator.rs:481:5
guest: = note: the full name for the type has been written to '/root/projects/layeredge/light-node/risc0-merkle-service/target/riscv-guest/methods/guest/riscv32im-risc0-zkvm-elf/release/deps/risc0_zkvm-513abb8ba97329fd.long-type-14743667652843370365.txt'
guest: = note: consider using --verbose to print the full type name to the console
guest:
guest: error[E0271]: expected {closure@succinct.rs:259:25} to be a closure that returns Option<Digest>, but it returns Option<Digest>
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/succinct.rs:236:21
guest: |
guest: 236 | ) -> anyhow::Result<impl Iterator<Item = Digest>> {
guest: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected risc0_zkp::core::digest::Digest, found a different risc0_zkp::core::digest::Digest
guest: |
guest: = note: risc0_zkp::core::digest::Digest and risc0_zkp::core::digest::Digest have similar names, but are actually distinct types
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-1.2.5/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-2.0.0/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: = note: perhaps two different versions of crate risc0_zkp are being used?
guest: = note: required for FilterMap<IntoIter<(&str, Digest), 27>, {closure@succinct.rs:259:25}> to implement Iterator
guest: = note: 1 redundant requirement hidden
guest: = note: required for Chain<impl Iterator<Item = Digest>, FilterMap<IntoIter<(&str, Digest), 27>, {closure@succinct.rs:259:25}>> to implement Iterator
guest: = note: the full name for the type has been written to '/root/projects/layeredge/light-node/risc0-merkle-service/target/riscv-guest/methods/guest/riscv32im-risc0-zkvm-elf/release/deps/risc0_zkvm-513abb8ba97329fd.long-type-15438879340273260333.txt'
guest: = note: consider using --verbose to print the full type name to the console
guest:
guest: error[E0599]: no associated item named CIRCUIT_INFO found for struct risc0_circuit_recursion::CircuitImpl in the current scope
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/composite.rs:137:56
guest: |
guest: 137 | ... circuit_info: CircuitImpl::CIRCUIT_INFO,
guest: | ^^^^^^^^^^^^ associated item not found in CircuitImpl
guest: |
guest: = help: items from traits can only be used if the trait is in scope
guest: help: trait CircuitInfo which provides CIRCUIT_INFO is implemented but not in scope; perhaps you want to import it
guest: |
guest: 15 + use risc0_zkp::adapter::CircuitInfo;
guest: |
guest:
guest: error[E0308]: mismatched types
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/groth16.rs:88:26
guest: |
guest: 88 | split_digest(params.control_root).map_err(|
| VerificationError::ReceiptFormatError)?;
guest: | ------------ ^^^^^^^^^^^^^^^^^^^ expected risc0_zkp::core::digest::Digest, found a different risc0_zkp::core::digest::Digest
guest: | |
guest: | arguments to this function are incorrect
guest: |
guest: = note: risc0_zkp::core::digest::Digest and risc0_zkp::core::digest::Digest have similar names, but are actually distinct types
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-1.2.5/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-2.0.0/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: = note: perhaps two different versions of crate risc0_zkp are being used?
guest: note: function defined here
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-groth16-1.4.0/src/lib.rs:91:8
guest: |
guest: 91 | pub fn split_digest(d: Digest) -> Result<(Fr, Fr), Error> {
guest: | ^^^^^^^^^^^^
guest:
guest: error[E0308]: mismatched types
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/groth16.rs:89:37
guest: |
guest: 89 | let (c0, c1) = split_digest(self.claim.digest::sha::Impl())
guest: | ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected risc0_zkp::core::digest::Digest, found a different risc0_zkp::core::digest::Digest
guest: | |
guest: | arguments to this function are incorrect
guest: |
guest: = note: risc0_zkp::core::digest::Digest and risc0_zkp::core::digest::Digest have similar names, but are actually distinct types
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-1.2.5/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-2.0.0/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: = note: perhaps two different versions of crate risc0_zkp are being used?
guest: note: function defined here
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-groth16-1.4.0/src/lib.rs:91:8
guest: |
guest: 91 | pub fn split_digest(d: Digest) -> Result<(Fr, Fr), Error> {
guest: | ^^^^^^^^^^^^
guest:
guest: error[E0308]: mismatched types
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/groth16.rs:144:31
guest: |
guest: 144 | bn254_control_id: BN254_IDENTITY_CONTROL_ID,
guest: | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected risc0_zkp::core::digest::Digest, found a different risc0_zkp::core::digest::Digest
guest: |
guest: = note: risc0_zkp::core::digest::Digest and risc0_zkp::core::digest::Digest have similar names, but are actually distinct types
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-2.0.0/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-1.2.5/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: = note: perhaps two different versions of crate risc0_zkp are being used?
guest:
guest: error[E0599]: no method named digest found for struct VerifyingKey in the current scope
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/groth16.rs:165:36
guest: |
guest: 165 | self.verifying_key.digest::(),
guest: | ^^^^^^ method not found in VerifyingKey
guest: |
guest: = help: items from traits can only be used if the trait is in scope
guest: help: trait Digestible which provides digest is implemented but not in scope; perhaps you want to import it
guest: |
guest: 15 + use risc0_binfmt::hash::Digestible;
guest: |
guest:
guest: error[E0308]: mismatched types
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/groth16.rs:176:27
guest: |
guest: 176 | control_root: ALLOWED_CONTROL_ROOT,
guest: | ^^^^^^^^^^^^^^^^^^^^ expected risc0_zkp::core::digest::Digest, found a different risc0_zkp::core::digest::Digest
guest: |
guest: = note: risc0_zkp::core::digest::Digest and risc0_zkp::core::digest::Digest have similar names, but are actually distinct types
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-2.0.0/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-1.2.5/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: = note: perhaps two different versions of crate risc0_zkp are being used?
guest:
guest: error[E0308]: mismatched types
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/groth16.rs:177:31
guest: |
guest: 177 | bn254_control_id: BN254_IDENTITY_CONTROL_ID,
guest: | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected risc0_zkp::core::digest::Digest, found a different risc0_zkp::core::digest::Digest
guest: |
guest: = note: risc0_zkp::core::digest::Digest and risc0_zkp::core::digest::Digest have similar names, but are actually distinct types
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-2.0.0/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-1.2.5/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: = note: perhaps two different versions of crate risc0_zkp are being used?
guest:
guest: error[E0599]: no associated item named CIRCUIT_INFO found for struct risc0_circuit_recursion::CircuitImpl in the current scope
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/succinct.rs:123:48
guest: |
guest: 123 | if params.circuit_info != CircuitImpl::CIRCUIT_INFO {
guest: | ^^^^^^^^^^^^ associated item not found in CircuitImpl
guest: |
guest: = help: items from traits can only be used if the trait is in scope
guest: help: trait CircuitInfo which provides CIRCUIT_INFO is implemented but not in scope; perhaps you want to import it
guest: |
guest: 15 + use risc0_zkp::adapter::CircuitInfo;
guest: |
guest:
guest: error[E0599]: no associated item named CIRCUIT_INFO found for struct risc0_circuit_recursion::CircuitImpl in the current scope
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/succinct.rs:125:40
guest: |
guest: 125 | expected: CircuitImpl::CIRCUIT_INFO,
guest: | ^^^^^^^^^^^^ associated item not found in CircuitImpl
guest: |
guest: = help: items from traits can only be used if the trait is in scope
guest: help: trait CircuitInfo which provides CIRCUIT_INFO is implemented but not in scope; perhaps you want to import it
guest: |
guest: 15 + use risc0_zkp::adapter::CircuitInfo;
guest: |
guest:
guest: error[E0277]: the trait bound risc0_circuit_recursion::CircuitImpl: CircuitCoreDef<_> is not satisfied
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/succinct.rs:152:35
guest: |
guest: 152 | risc0_zkp::verify::verify(&CIRCUIT, suite, &self.seal, check_code)?;
guest: | ------------------------- ^^^^^^^^ the trait CircuitCoreDef<_> is not implemented for risc0_circuit_recursion::CircuitImpl
guest: | |
guest: | required by a bound introduced by this call
guest: |
guest: = help: the trait CircuitCoreDef<BabyBear> is implemented for risc0_circuit_rv32im::CircuitImpl
guest: note: required by a bound in risc0_zkp::verify::verify
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-1.2.5/src/verify/mod.rs:502:8
guest: |
guest: 494 | pub fn verify<F, C, CheckCode>(
guest: | ------ required by a bound in this function
guest: ...
guest: 502 | C: CircuitCoreDef,
guest: | ^^^^^^^^^^^^^^^^^ required by this bound in verify
guest:
guest: error[E0599]: no associated item named OUTPUT_SIZE found for struct risc0_circuit_recursion::CircuitImpl in the current scope
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/succinct.rs:156:69
guest: |
guest: 156 | bytemuck::checked::cast_slice(&self.seal[..CircuitImpl::OUTPUT_SIZE]);
guest: | ^^^^^^^^^^^ associated item not found in CircuitImpl
guest: |
guest: = help: items from traits can only be used if the trait is in scope
guest: help: trait CircuitInfo which provides OUTPUT_SIZE is implemented but not in scope; perhaps you want to import it
guest: |
guest: 15 + use risc0_zkp::adapter::CircuitInfo;
guest: |
guest:
guest: error[E0599]: no associated item named CIRCUIT_INFO found for struct risc0_circuit_recursion::CircuitImpl in the current scope
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/succinct.rs:306:40
guest: |
guest: 306 | circuit_info: CircuitImpl::CIRCUIT_INFO,
guest: | ^^^^^^^^^^^^ associated item not found in CircuitImpl
guest: |
guest: = help: items from traits can only be used if the trait is in scope
guest: help: trait CircuitInfo which provides CIRCUIT_INFO is implemented but not in scope; perhaps you want to import it
guest: |
guest: 15 + use risc0_zkp::adapter::CircuitInfo;
guest: |
guest:
guest: error[E0308]: mismatched types
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/succinct.rs:340:27
guest: |
guest: 340 | control_root: ALLOWED_CONTROL_ROOT,
guest: | ^^^^^^^^^^^^^^^^^^^^ expected risc0_zkp::core::digest::Digest, found a different risc0_zkp::core::digest::Digest
guest: |
guest: = note: risc0_zkp::core::digest::Digest and risc0_zkp::core::digest::Digest have similar names, but are actually distinct types
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-2.0.0/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: note: risc0_zkp::core::digest::Digest is defined in crate risc0_zkp
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkp-1.2.5/src/core/digest.rs:62:1
guest: |
guest: 62 | pub struct Digest([u32; DIGEST_WORDS]);
guest: | ^^^^^^^^^^^^^^^^^
guest: = note: perhaps two different versions of crate risc0_zkp are being used?
guest:
guest: error[E0599]: no associated item named CIRCUIT_INFO found for struct risc0_circuit_recursion::CircuitImpl in the current scope
guest: --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/risc0-zkvm-1.2.5/src/receipt/succinct.rs:343:40
guest: |
guest: 343 | circuit_info: CircuitImpl::CIRCUIT_INFO,
guest: | ^^^^^^^^^^^^ associated item not found in CircuitImpl
guest: |
guest: = help: items from traits can only be used if the trait is in scope
guest: help: trait CircuitInfo which provides CIRCUIT_INFO is implemented but not in scope; perhaps you want to import it
guest: |
guest: 15 + use risc0_zkp::adapter::CircuitInfo;
guest: |
guest:
guest: Some errors have detailed explanations: E0271, E0277, E0308, E0599.
guest: For more information about an error, try rustc --explain E0271.
guest: error: could not compile risc0-zkvm (lib) due to 16 previous errors
guest: warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for methods v0.1.0 (/root/projects/layeredge/light-node/risc0-merkle-service/methods)

Caused by:
process didn't exit successfully: /root/projects/layeredge/light-node/risc0-merkle-service/target/debug/build/methods-7aa68fcf24998190/build-script-build (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=RISC0_SKIP_BUILD
Building guest package methods.guest
cargo:rerun-if-env-changed=RISC0_SKIP_BUILD
Using rustc: /root/.rustup/toolchains/risc0/bin/rustc
cargo:rerun-if-env-changed=RISC0_RUST_SRC
Building guest package: cargo build --target r

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions