nexus-xyz / nexus-zkvm

The Nexus zkVM: The zero-knowledge virtual machine
https://docs.nexus.xyz
Apache License 2.0
736 stars 238 forks source link

[BUG]: test machines fail to prove with Nova #203

Closed slumber closed 3 months ago

slumber commented 4 months ago

Program Information

Test machines

"fib31", "bitop", "shift", "sub"

Project Information

(old imports)

let public_params = nexus_prover::pp::gen_vm_pp(CONFIG.k, &())?;

// Run the program.
let vm_opts = VMOpts {
    k: CONFIG.k,
    machine: Some(String::from("fib31")),
    ..Default::default()
};
let trace = nexus_prover::run(
    &vm_opts,
    matches!(CONFIG.prover, ProverImpl::Nova(NovaImpl::Parallel)),
)?;

tracing::info!("Proving execution trace...");
let proof = nexus_prover::prove_seq(&public_params, trace)?;

tracing::info!("Verifying proof...");
proof.verify(&public_params, proof.step_num() as _)?;

Reproduction Steps

run the code

What is expected?

Proof is valid

What is actually happening?

Proof is invalid

System Information

No response

Any additional comments?

Probably related to transition from NexusVM instructions encoding back to RISCV

zkp72345 commented 4 months ago

To add more context, I bumped to c470d63 and retested these with hypernova. For k=1 only "ldst" failed, but "fib31", "bitop", "ldst", "shift", and "sub" each failed to verify for k=16.

slumber commented 3 months ago

Fixed by https://github.com/nexus-xyz/nexus-zkvm/pull/214 Credited to @yoichi-nexus

yoichi-nexus commented 3 months ago

Thank you for checking.