Skip to content

Commit

Permalink
Perfect sdk err (#32)
Browse files Browse the repository at this point in the history
* new snark proof

* update host program

* fix the user_data zero in the public_inputs

* update host program

* update host program

* update host program

* update host

* update host

* update host

* update host

* update host

* update sdk

* update sdk

* update sdk

* update sdk

* update sdk

* update sdk

* update sdk

* update host

* update host

* update host

* update host

* update host

* update host

* update host

* update host

* update host

* update host

* zkm and gnark updating

* update host

* update host

* update sdk

* update sdk

* update contract

* update contract

* update contract

* update contract

* update contract

* update host

* update host

* update host

* add sdk readme

* update sdk's readme

* update sdk's readme

* add log for hash(bincong(public_inputs))

* update sdk

* update contract

* update contract

* update contract

* update contract

* update the host

* update the host

* update host

* update host

* update host

* update host

* update host

* update host

* update host

* update contract

* update the readme and host

* update the readme and host

* update the readme and host

* update readme

* update readme

* perfect the host

* perfect the host

* perfect the host

* perfect the host

* perfect the host

* perfect the host

* perfect the readme

* update the host

* fix CI/CD error

* fix CI/CD error

* fix CI/CD error

* perfect the SDK's error message

* update sdk

* update host

* fix CI/CD error

---------

Co-authored-by: [gavin-ygy] <[[email protected]]>
  • Loading branch information
gavin-ygy and [gavin-ygy] authored Nov 4, 2024
1 parent 63a2270 commit 209d952
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion host-program/run-network-proving.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BASEDIR=$(cd $(dirname $0); pwd)
export LD_LIBRARY_PATH=$BASEDIR/../sdk/src/local/libsnark:$LD_LIBRARY_PATH ##Modify it according your template
export CA_CERT_PATH=tool/ca.pem
export PRIVATE_KEY=xxxx ##The private key corresponding to the public key when registering in the https://www.zkm.io/apply
export ENDPOINT=https://152.32.186.45:20002 ##the test entry of zkm proving network
export ENDPOINT=https://152.32.186.45:20002 ##the test entry of zkm proof network
export ZKM_PROVER=network
export RUST_LOG=info
export SEG_SIZE=262144
Expand Down
18 changes: 13 additions & 5 deletions host-program/src/bin/zkm-prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let args_parameter = env::var("ARGS").unwrap_or("data-to-hash".to_string());
let json_path = env::var("JSON_PATH").expect("JSON PATH is missing");
let proof_results_path = env::var("PROOF_RESULTS_PATH").unwrap_or("../contracts".to_string());
let zkm_prover = env::var("ZKM_PROVER").expect("ZKM PROVER is missing");

log::info!("new prover client.");
let prover_client = ProverClient::new().await;
Expand Down Expand Up @@ -67,11 +68,18 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(Some(prover_result)) => {
if !execute_only2 {
if prover_result.proof_with_public_inputs.is_empty() {
log::info!(
"Fail: snark_proof_with_public_inputs.len() is : {}.Please try setting SEG_SIZE={}",
prover_result.proof_with_public_inputs.len(), seg_size2/2
);
return Err("SEG_SIZE is excessively large".into());
if zkm_prover.to_lowercase() == *"local".to_string() {
//local proving
log::info!("Fail: please try setting SEG_SIZE={}", seg_size2 / 2);
return Err("SEG_SIZE is excessively large".into());
} else {
//network proving
log::info!(
"Fail: the SEG_SIZE={} out of the range of the proof network's.",
seg_size2
);
return Err("SEG_SIZE is out of the range of the proof network's".into());
}
}
//1.snark proof
let output_dir = format!("{}/verifier", proof_results_path);
Expand Down
6 changes: 5 additions & 1 deletion sdk/src/network/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ impl Prover for NetworkProver {
"generate_proof failed status: {}",
get_status_response.status
);
return Ok(None);
//return Ok(None);
return Err(anyhow::anyhow!(
"generate_proof failed status: {}",
get_status_response.status
));
}
}
}
Expand Down

0 comments on commit 209d952

Please sign in to comment.