Skip to content

Commit

Permalink
Fix execute only result (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
xander42280 authored Sep 21, 2024
1 parent 460cfe6 commit 2911ce0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
4 changes: 1 addition & 3 deletions sdk/src/local/stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ pub fn prove_stark(input: &ProverInput, storedir: &str, result: &mut ProverResul
state.add_input_stream(&input.private_inputstream);

let (total_steps, state) = split_prog_into_segs(state, &seg_path, "", seg_size);
result
.output_stream
.copy_from_slice(&state.public_values_stream);
result.output_stream = state.public_values_stream.clone();
if input.execute_only {
return;
}
Expand Down
22 changes: 14 additions & 8 deletions sdk/src/network/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,23 @@ impl Prover for NetworkProver {
sleep(Duration::from_secs(30)).await;
}
Some(Status::Success) => {
let stark_proof =
NetworkProver::download_file(&get_status_response.stark_proof_url).await?;
let solidity_verifier =
NetworkProver::download_file(&get_status_response.solidity_verifier_url)
.await?;
let proof_result = ProverResult {
let mut proof_result = ProverResult {
output_stream: get_status_response.output_stream,
proof_with_public_inputs: get_status_response.proof_with_public_inputs,
stark_proof,
solidity_verifier,
stark_proof: vec![],
solidity_verifier: vec![],
};
if !get_status_response.stark_proof_url.is_empty() {
proof_result.stark_proof =
NetworkProver::download_file(&get_status_response.stark_proof_url)
.await?;
}
if !get_status_response.solidity_verifier_url.is_empty() {
proof_result.solidity_verifier = NetworkProver::download_file(
&get_status_response.solidity_verifier_url,
)
.await?;
}
return Ok(Some(proof_result));
}
_ => {
Expand Down

0 comments on commit 2911ce0

Please sign in to comment.