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

Update Risc0 with the latest release of Stark2Snark #144

Open
1 task done
CeciliaZ030 opened this issue Apr 30, 2024 · 1 comment
Open
1 task done

Update Risc0 with the latest release of Stark2Snark #144

CeciliaZ030 opened this issue Apr 30, 2024 · 1 comment

Comments

@CeciliaZ030
Copy link
Contributor

Describe the feature request

We are currently at risc0-zkvm = "0.21.0". The latest main branch contains updates after their open-source announcement which has a lot more nicer APIs. Example workflow:

    let env = ExecutorEnv::builder()
        .write(&MultiTestSpec::BusyLoop { cycles: 0 })
        .unwrap()
        .build()
        .unwrap();

    tracing::info!("execute");

    let mut exec = ExecutorImpl::from_elf(env, MULTI_TEST_ELF).unwrap();
    let session = exec.run().unwrap();

    tracing::info!("prove");
    let opts = ProverOpts::default();
    let ctx = VerifierContext::default();
    let prover = get_prover_server(&opts).unwrap();
    let receipt = prover.prove_session(&ctx, &session).unwrap().receipt;
    let claim = receipt.claim().unwrap();
    let composite_receipt = receipt.inner.composite().unwrap();
    let succinct_receipt = prover.compress(composite_receipt).unwrap();
    let journal = session.journal.unwrap().bytes;

    tracing::info!("identity_p254");
    let ident_receipt = identity_p254(&succinct_receipt).unwrap();
    let seal_bytes = ident_receipt.get_seal_bytes();

    tracing::info!("stark-to-snark");
    let seal = stark_to_snark(&seal_bytes).unwrap().to_vec();

    tracing::info!("Receipt");
    let receipt = Receipt::new(
        InnerReceipt::Compact(CompactReceipt { seal, claim }),
        journal,
    );

At some point we should try out risc0-zkvm = { git = "https://github.com/risc0/risc0.git", branch = "main" } and see whether we can save cost on bonsai.

Spam policy

  • I verify that this issue is NOT SPAM and understand SPAM issues will be closed and reported to GitHub, resulting in ACCOUNT TERMINATION.
@mratsim
Copy link
Contributor

mratsim commented Jun 26, 2024

Since then Risc0 has updated to v1.0.x and on synthetic SHA256 CPU benchmarks (without circuits/precompiles) improvement is a dramatic x2.5.

We should pin a version though for reproducibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants