Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composition fails to resolve assumption in the client/server API #1236

Closed
rlukata opened this issue Dec 15, 2023 · 2 comments · Fixed by #1241
Closed

Composition fails to resolve assumption in the client/server API #1236

rlukata opened this issue Dec 15, 2023 · 2 comments · Fixed by #1241
Assignees
Labels
enhancement New feature or request

Comments

@rlukata
Copy link
Member

rlukata commented Dec 15, 2023

Report

Composition fails with value: sys_verify_integrity: failed to resolve journal_digest and image_id when used with client/server API.

Steps to Reproduce

  1. Cargo.toml
risc0-zkvm = { workspace = true, features = ["client"] }
  1. In the host:
let env = ExecutorEnv::builder()
        .add_assumption(receipt.clone().into())
        .write(&compute_image_id(METHOD_NAME_ELF)?)?
        .write(&receipt.journal.bytes)?
        .build()
        .unwrap();
let exec = default_executor();
let session = exec.execute(env, METHOD_NAME_ELF).unwrap();
  1. In the guest:
let image_id: Digest = env::read();
let journal: Vec<u8> = env::read();
env::verify(image_id, &journal).unwrap();

Expected behavior

The verify should pass.

Your Environment

  • risc0-zkvm version: 0.20.1 alpha
  • Rust version: 1.72.1
  • Platform/OS: M2 MacOS
@rlukata rlukata added the bug Something isn't working label Dec 15, 2023
@nategraf
Copy link
Contributor

I've confirmed that I forgot to add assumptions to the protobuf definition of ExecutorEnv and so assumptions are not transferred from client to server 🤦‍♂️ .

fn make_execute_env(
&self,
env: &ExecutorEnv<'_>,
binary: pb::api::Asset,
) -> pb::api::ExecutorEnv {
pb::api::ExecutorEnv {
binary: Some(binary),
env_vars: env.env_vars.clone(),
args: env.args.clone(),
slice_ios: env.slice_io.borrow().inner.keys().cloned().collect(),
read_fds: env.posix_io.borrow().read_fds.keys().cloned().collect(),
write_fds: env.posix_io.borrow().write_fds.keys().cloned().collect(),
segment_limit_po2: env.segment_limit_po2,
session_limit: env.session_limit,
trace_events: (!env.trace.is_empty()).then_some(()),
pprof_out: env
.pprof_out
.as_ref()
.map(|x| x.to_string_lossy().into())
.unwrap_or_default(),
}
}

Working on adding assumptions to the protobuf types and fixing this now

@rlukata rlukata changed the title [BUG] Composition fails to resolve assumption in the client/server API [Enhancement] Composition fails to resolve assumption in the client/server API Dec 15, 2023
@rlukata rlukata added enhancement New feature or request and removed bug Something isn't working labels Dec 15, 2023
@nategraf nategraf changed the title [Enhancement] Composition fails to resolve assumption in the client/server API Composition fails to resolve assumption in the client/server API Dec 15, 2023
@nategraf
Copy link
Contributor

Deleted the "[Enhancement]" from the tittle since we have tags to indicate what type of issue this is

nategraf added a commit that referenced this issue Dec 22, 2023
Composition currently does not work in client/server mode because
receipts are not sent from client to server. This PR adds the required
plumbing to send the assumptions from client to server.

Resolves: #1236
flaub pushed a commit that referenced this issue Jan 17, 2024
Composition currently does not work in client/server mode because
receipts are not sent from client to server. This PR adds the required
plumbing to send the assumptions from client to server.

Resolves: #1236
flaub pushed a commit that referenced this issue Jan 17, 2024
Composition currently does not work in client/server mode because
receipts are not sent from client to server. This PR adds the required
plumbing to send the assumptions from client to server.

Resolves: #1236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants