Skip to content

Commit

Permalink
Revert "fix: remove stdin from SP1ProofWithPublicValues (#1714)"
Browse files Browse the repository at this point in the history
This reverts commit 4451903.
  • Loading branch information
yuwen01 authored Nov 6, 2024
1 parent 4451903 commit ee0d541
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 43 deletions.
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 21 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "3.1.0"
version = "3.0.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/succinctlabs/sp1"
Expand Down Expand Up @@ -46,26 +46,26 @@ debug-assertions = true

[workspace.dependencies]
# sp1
sp1-build = { path = "crates/build", version = "3.1.0" }
sp1-cli = { path = "crates/cli", version = "3.1.0", default-features = false }
sp1-core-machine = { path = "crates/core/machine", version = "3.1.0" }
sp1-core-executor = { path = "crates/core/executor", version = "3.1.0" }
sp1-curves = { path = "crates/curves", version = "3.1.0" }
sp1-derive = { path = "crates/derive", version = "3.1.0" }
sp1-eval = { path = "crates/eval", version = "3.1.0" }
sp1-helper = { path = "crates/helper", version = "3.1.0", default-features = false }
sp1-primitives = { path = "crates/primitives", version = "3.1.0" }
sp1-prover = { path = "crates/prover", version = "3.1.0" }
sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "3.1.0" }
sp1-recursion-core = { path = "crates/recursion/core", version = "3.1.0", default-features = false }
sp1-recursion-derive = { path = "crates/recursion/derive", version = "3.1.0", default-features = false }
sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "3.1.0", default-features = false }
sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "3.1.0", default-features = false }
sp1-sdk = { path = "crates/sdk", version = "3.1.0" }
sp1-cuda = { path = "crates/cuda", version = "3.1.0" }
sp1-stark = { path = "crates/stark", version = "3.1.0" }
sp1-lib = { path = "crates/zkvm/lib", version = "3.1.0", default-features = false }
sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "3.1.0", default-features = false }
sp1-build = { path = "crates/build", version = "3.0.0" }
sp1-cli = { path = "crates/cli", version = "3.0.0", default-features = false }
sp1-core-machine = { path = "crates/core/machine", version = "3.0.0" }
sp1-core-executor = { path = "crates/core/executor", version = "3.0.0" }
sp1-curves = { path = "crates/curves", version = "3.0.0" }
sp1-derive = { path = "crates/derive", version = "3.0.0" }
sp1-eval = { path = "crates/eval", version = "3.0.0" }
sp1-helper = { path = "crates/helper", version = "3.0.0", default-features = false }
sp1-primitives = { path = "crates/primitives", version = "3.0.0" }
sp1-prover = { path = "crates/prover", version = "3.0.0" }
sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "3.0.0" }
sp1-recursion-core = { path = "crates/recursion/core", version = "3.0.0", default-features = false }
sp1-recursion-derive = { path = "crates/recursion/derive", version = "3.0.0", default-features = false }
sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "3.0.0", default-features = false }
sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "3.0.0", default-features = false }
sp1-sdk = { path = "crates/sdk", version = "3.0.0" }
sp1-cuda = { path = "crates/cuda", version = "3.0.0" }
sp1-stark = { path = "crates/stark", version = "3.0.0" }
sp1-lib = { path = "crates/zkvm/lib", version = "3.0.0", default-features = false }
sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "3.0.0", default-features = false }

# p3
p3-air = "0.1.4-succinct"
Expand Down
2 changes: 2 additions & 0 deletions crates/core/executor/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,7 @@ impl<'a> Executor<'a> {
let instruction = self.fetch();

// Log the current state of the runtime.
#[cfg(debug_assertions)]
self.log(&instruction);

// Execute the instruction.
Expand Down Expand Up @@ -1660,6 +1661,7 @@ impl<'a> Executor<'a> {
}

#[inline]
#[cfg(debug_assertions)]
fn log(&mut self, _: &Instruction) {
// Write the current program counter to the trace buffer for the cycle tracer.
if let Some(ref mut buf) = self.trace_buf {
Expand Down
2 changes: 2 additions & 0 deletions crates/sdk/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::{fmt::Debug, fs::File, path::Path};
use anyhow::Result;
use serde::{Deserialize, Serialize};
use sp1_core_executor::SP1ReduceProof;
use sp1_core_machine::io::SP1Stdin;
use sp1_primitives::io::SP1PublicValues;
use strum_macros::{EnumDiscriminants, EnumTryAs};

Expand All @@ -25,6 +26,7 @@ pub enum SP1Proof {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SP1ProofWithPublicValues {
pub proof: SP1Proof,
pub stdin: SP1Stdin,
pub public_values: SP1PublicValues,
pub sp1_version: String,
}
Expand Down
4 changes: 4 additions & 0 deletions crates/sdk/src/provers/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl Prover<DefaultProverComponents> for CpuProver {
if kind == SP1ProofKind::Core {
return Ok(SP1ProofWithPublicValues {
proof: SP1Proof::Core(proof.proof.0),
stdin: proof.stdin,
public_values: proof.public_values,
sp1_version: self.version().to_string(),
});
Expand All @@ -71,6 +72,7 @@ impl Prover<DefaultProverComponents> for CpuProver {
if kind == SP1ProofKind::Compressed {
return Ok(SP1ProofWithPublicValues {
proof: SP1Proof::Compressed(Box::new(reduce_proof)),
stdin,
public_values,
sp1_version: self.version().to_string(),
});
Expand All @@ -95,6 +97,7 @@ impl Prover<DefaultProverComponents> for CpuProver {

return Ok(SP1ProofWithPublicValues {
proof: SP1Proof::Plonk(proof),
stdin,
public_values,
sp1_version: self.version().to_string(),
});
Expand All @@ -111,6 +114,7 @@ impl Prover<DefaultProverComponents> for CpuProver {
let proof = self.prover.wrap_groth16_bn254(outer_proof, &groth16_bn254_artifacts);
return Ok(SP1ProofWithPublicValues {
proof: SP1Proof::Groth16(proof),
stdin,
public_values,
sp1_version: self.version().to_string(),
});
Expand Down
4 changes: 4 additions & 0 deletions crates/sdk/src/provers/cuda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ impl Prover<DefaultProverComponents> for CudaProver {
if kind == SP1ProofKind::Core {
return Ok(SP1ProofWithPublicValues {
proof: SP1Proof::Core(proof.proof.0),
stdin: proof.stdin,
public_values: proof.public_values,
sp1_version: self.version().to_string(),
});
Expand All @@ -66,6 +67,7 @@ impl Prover<DefaultProverComponents> for CudaProver {
if kind == SP1ProofKind::Compressed {
return Ok(SP1ProofWithPublicValues {
proof: SP1Proof::Compressed(Box::new(reduce_proof)),
stdin,
public_values,
sp1_version: self.version().to_string(),
});
Expand All @@ -89,6 +91,7 @@ impl Prover<DefaultProverComponents> for CudaProver {
let proof = self.prover.wrap_plonk_bn254(outer_proof, &plonk_bn254_artifacts);
return Ok(SP1ProofWithPublicValues {
proof: SP1Proof::Plonk(proof),
stdin,
public_values,
sp1_version: self.version().to_string(),
});
Expand All @@ -105,6 +108,7 @@ impl Prover<DefaultProverComponents> for CudaProver {
let proof = self.prover.wrap_groth16_bn254(outer_proof, &groth16_bn254_artifacts);
return Ok(SP1ProofWithPublicValues {
proof: SP1Proof::Groth16(proof),
stdin,
public_values,
sp1_version: self.version().to_string(),
});
Expand Down
4 changes: 4 additions & 0 deletions crates/sdk/src/provers/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl Prover<DefaultProverComponents> for MockProver {
let (public_values, _) = self.prover.execute(&pk.elf, &stdin, context)?;
Ok(SP1ProofWithPublicValues {
proof: SP1Proof::Core(vec![]),
stdin,
public_values,
sp1_version: self.version().to_string(),
})
Expand Down Expand Up @@ -101,6 +102,7 @@ impl Prover<DefaultProverComponents> for MockProver {

Ok(SP1ProofWithPublicValues {
proof,
stdin,
public_values,
sp1_version: self.version().to_string(),
})
Expand All @@ -117,6 +119,7 @@ impl Prover<DefaultProverComponents> for MockProver {
raw_proof: "".to_string(),
plonk_vkey_hash: [0; 32],
}),
stdin,
public_values,
sp1_version: self.version().to_string(),
})
Expand All @@ -133,6 +136,7 @@ impl Prover<DefaultProverComponents> for MockProver {
raw_proof: "".to_string(),
groth16_vkey_hash: [0; 32],
}),
stdin,
public_values,
sp1_version: self.version().to_string(),
})
Expand Down

0 comments on commit ee0d541

Please sign in to comment.