Skip to content

Commit

Permalink
feat: sp1-sdk, remote prover (#370)
Browse files Browse the repository at this point in the history
Co-authored-by: mattstam <[email protected]>
  • Loading branch information
ctian1 and mattstam authored Mar 28, 2024
1 parent 0c4c91a commit cb43fd7
Show file tree
Hide file tree
Showing 47 changed files with 4,256 additions and 355 deletions.
679 changes: 665 additions & 14 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[workspace]
members = [
"core",
"cli",
"core",
"derive",
"zkvm/*",
"helper",
"eval",
"helper",
"recursion/core",
"recursion/compiler",
"recursion/circuit",
"recursion/program",
"sdk",
"zkvm/*",
]
exclude = ["examples/target"]
resolver = "2"
Expand Down
3 changes: 2 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ vergen = { version = "8", default-features = false, features = ["build", "git",
anyhow = { version = "1.0.79", features = ["backtrace"] }
cargo_metadata = "0.18.1"
clap = { version = "4.4.15", features = ["derive", "env"] }
sp1-core = { path = "../core", features = ["perf"] }
sp1-core = { path = "../core" }
sp1-sdk = { path = "../sdk" }
reqwest = { version = "0.11.3", features = ["stream", "json", "rustls-tls"], default-features = false }
futures-util = "0.3.14"
indicatif = "0.15.0"
Expand Down
2 changes: 1 addition & 1 deletion cli/src/assets/script/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "unnamed-script"
edition = "2021"

[dependencies]
sp1-core = { git = "https://github.com/succinctlabs/sp1.git" }
sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git" }

[build-dependencies]
sp1-helper = { git = "https://github.com/succinctlabs/sp1.git" }
2 changes: 1 addition & 1 deletion cli/src/assets/script/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! A simple script to generate and verify the proof of a given program.
use sp1_core::{SP1Prover, SP1Stdin, SP1Verifier};
use sp1_sdk::{SP1Prover, SP1Stdin, SP1Verifier};

const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf");

Expand Down
5 changes: 1 addition & 4 deletions cli/src/commands/prove.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use anstyle::*;
use anyhow::Result;
use clap::Parser;
use sp1_core::{
utils::{self},
SP1Prover, SP1Stdin,
};
use sp1_sdk::{utils, SP1Prover, SP1Stdin};
use std::time::Instant;
use std::{env, fs::File, io::Read, path::PathBuf, str::FromStr};

Expand Down
5 changes: 5 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
clippy::unnecessary_unwrap,
clippy::default_constructed_unit_structs,
clippy::box_default,
deprecated,
incomplete_features
)]
#![feature(generic_const_exprs)]
Expand All @@ -20,6 +21,7 @@ pub mod alu;
pub mod bytes;
pub mod cpu;
pub mod disassembler;
#[deprecated(note = "Import from sp1_sdk instead of sp1_core")]
pub mod io;
pub mod lookup;
pub mod memory;
Expand All @@ -43,13 +45,16 @@ use std::fs;
use utils::{prove_core, run_and_prove, BabyBearPoseidon2};

/// A prover that can prove RISCV ELFs.
#[deprecated(note = "Import from sp1_sdk instead of sp1_core")]
pub struct SP1Prover;

/// A verifier that can verify proofs generated by `SP1Prover`.
#[deprecated(note = "Import from sp1_sdk instead of sp1_core")]
pub struct SP1Verifier;

/// A proof of a RISCV ELF execution with given inputs and outputs.
#[derive(Serialize, Deserialize)]
#[deprecated(note = "Import from sp1_sdk instead of sp1_core")]
pub struct SP1ProofWithIO<SC: StarkGenericConfig + Serialize + DeserializeOwned> {
#[serde(with = "proof_serde")]
pub proof: Proof<SC>,
Expand Down
1 change: 1 addition & 0 deletions eval/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition = "2021"

[dependencies]
sp1-core = { path = "../core" }
sp1-sdk = { path = "../sdk" }
clap = { version = "4.4.0", features = ["derive"] }
csv = "1.3.0"
serde = "1.0.196"
Expand Down
5 changes: 3 additions & 2 deletions eval/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ use clap::{command, Parser};
use csv::WriterBuilder;
use serde::Serialize;
use sp1_core::runtime::{Program, Runtime};
use sp1_core::utils::{get_cycles, prove_core, BabyBearBlake3, BabyBearKeccak, BabyBearPoseidon2};
use sp1_core::{SP1ProofWithIO, SP1Stdin, SP1Stdout, SP1Verifier};
use sp1_core::utils::{get_cycles, prove_core};
use sp1_sdk::utils::{BabyBearBlake3, BabyBearKeccak, BabyBearPoseidon2};
use sp1_sdk::{SP1ProofWithIO, SP1Stdin, SP1Stdout, SP1Verifier};
use std::fmt;
use std::fs::OpenOptions;
use std::io;
Expand Down
Binary file modified examples/chess/program/elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
Loading

0 comments on commit cb43fd7

Please sign in to comment.