-
Notifications
You must be signed in to change notification settings - Fork 9
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
The snark proof with separate public inputs file #31
Conversation
host-program/src/bin/zkm-prove.rs
Outdated
} | ||
|
||
fn replace_public_inputs(public_inputstream: Vec<u8>, proof_public_inputs: &Vec<u8>) -> bool { | ||
let output_dir = "../contracts/verifier".to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the hardcoding here? make sure each function does one thing. This function just calculates the Snark public input, you should do this only.
host-program/src/bin/zkm-prove.rs
Outdated
if !replace_public_inputs(input.public_inputstream, &prover_result.public_values) { | ||
log::info!("public_inputs check false."); | ||
return Err("public_inputs check false.".into()); | ||
} | ||
//contract | ||
let output_dir = "../contracts/src".to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never use the relative path in a binary. Make sure the user know the input/output path explicitly.
@@ -220,9 +231,9 @@ impl Data { | |||
|
|||
fn set_sha2_go_input(seg_size_u: u32, execute_only_b: bool) -> anyhow::Result<ProverInput> { | |||
let elf_path = env::var("ELF_PATH").expect("ELF PATH is missed"); | |||
let args = env::var("ARGS").unwrap_or("data-to-hash".to_string()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you have a function, which receives argments, but also read environment, how does people know which paths to pass the parameters??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never read the ENV in an intermediate function.
host-program/src/bin/zkm-prove.rs
Outdated
let input = ProverInput { | ||
elf: read(elf_path).unwrap(), | ||
public_inputstream: "".into(), | ||
public_inputstream: "0".into(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be explained. Why you fill in a "0" and how it should be solved in the future.
sdk/README.md
Outdated
|
||
## Use the libsnark | ||
|
||
1. The compile.sh in the path sdk/src/local/libsnark only supports X86_64 linux. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can support in MacOS, but only via Docker.
README.md
Outdated
> 3. There are three guest programs(sha2-rust, sha2-go, mem-alloc-vec), each capable of generating a SNARK proof on a machine | ||
equipped with an AMD EPYC 7R13 processor and 250GB of memory. The following will use sha2-rust as an example to demonstrate local and network proofs. | ||
> 3. There are four guest programs(sha2-rust, sha2-go, mem-alloc-vec,revme), each capable of generating a SNARK proof on a machine | ||
equipped with an AMD EPYC 7R13 processor and 246GB of memory. The following will use sha2-rust and revme as an example to demonstrate local and network proofs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should we tell people this ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may scale to any server
README.md
Outdated
#### Generating the public input about a specific block | ||
|
||
> [!NOTE] | ||
> The local node is the [GOAT](https://goat.network) test chain in the following example. You must use the Eth-Compatible local node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you able to connect the localhost as the GOAT ?????
host-program/src/bin/zkm-prove.rs
Outdated
let input = ProverInput { | ||
elf: read(elf_path).unwrap(), | ||
public_inputstream: "".into(), | ||
public_inputstream: "0".into(), //if the public input is empty, please using "0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we change this asset back to the old one, allowing the size less than or equal to 32, we can use an empty public input. https://github.com/zkMIPS/zkm/blob/415b293dcf59bf9c09a3ff602259f13cfc51395c/prover/src/generation/mod.rs#L55 Plz help check this.
No description provided.