diff --git a/crates/prover/src/lib.rs b/crates/prover/src/lib.rs index db33e35652..5630a79f73 100644 --- a/crates/prover/src/lib.rs +++ b/crates/prover/src/lib.rs @@ -86,6 +86,11 @@ use utils::{sp1_committed_values_digest_bn254, sp1_vkey_digest_bn254, words_to_b use components::{DefaultProverComponents, SP1ProverComponents}; +/// The global version for all components of SP1. +/// +/// This string should be updated whenever any step in verifying an SP1 proof changes, including +/// core, recursion, and plonk-bn254. This string is used to download SP1 artifacts and the gnark +/// docker image. pub const SP1_CIRCUIT_VERSION: &str = include_str!("../../SP1_CIRCUIT_VERSION"); /// The configuration for the core prover. diff --git a/crates/recursion/gnark-ffi/src/ffi/docker.rs b/crates/recursion/gnark-ffi/src/ffi/docker.rs index b6384fccdd..874958d6a0 100644 --- a/crates/recursion/gnark-ffi/src/ffi/docker.rs +++ b/crates/recursion/gnark-ffi/src/ffi/docker.rs @@ -1,10 +1,8 @@ use crate::ProofBn254; -use crate::{Groth16Bn254Proof, PlonkBn254Proof}; +use crate::{Groth16Bn254Proof, PlonkBn254Proof, SP1_CIRCUIT_VERSION}; use anyhow::{anyhow, Result}; use std::{io::Write, process::Command}; -const SP1_CIRCUIT_VERSION: &str = include_str!("../../../../SP1_CIRCUIT_VERSION"); - /// Represents the proof system being used enum ProofSystem { Plonk, diff --git a/crates/recursion/gnark-ffi/src/ffi/native.rs b/crates/recursion/gnark-ffi/src/ffi/native.rs index fa46de6c81..f21b42aa5c 100644 --- a/crates/recursion/gnark-ffi/src/ffi/native.rs +++ b/crates/recursion/gnark-ffi/src/ffi/native.rs @@ -5,15 +5,13 @@ //! Although we cast to *mut c_char because the Go signatures can't be immutable, the Go functions //! should not modify the strings. -use crate::{Groth16Bn254Proof, PlonkBn254Proof}; +use crate::{Groth16Bn254Proof, PlonkBn254Proof, SP1_CIRCUIT_VERSION}; use cfg_if::cfg_if; use std::{ ffi::{c_char, CStr, CString}, mem::forget, }; -const SP1_CIRCUIT_VERSION: &str = include_str!("../../../../SP1_CIRCUIT_VERSION"); - #[allow(warnings, clippy::all)] mod bind { include!(concat!(env!("OUT_DIR"), "/bindings.rs")); diff --git a/crates/recursion/gnark-ffi/src/lib.rs b/crates/recursion/gnark-ffi/src/lib.rs index 4709ad15a5..287596ed91 100644 --- a/crates/recursion/gnark-ffi/src/lib.rs +++ b/crates/recursion/gnark-ffi/src/lib.rs @@ -11,4 +11,9 @@ pub use plonk_bn254::*; pub use proof::*; pub use witness::*; -const SP1_CIRCUIT_VERSION: &str = include_str!("../../../SP1_CIRCUIT_VERSION"); \ No newline at end of file +/// The global version for all components of SP1. +/// +/// This string should be updated whenever any step in verifying an SP1 proof changes, including +/// core, recursion, and plonk-bn254. This string is used to download SP1 artifacts and the gnark +/// docker image. +const SP1_CIRCUIT_VERSION: &str = include_str!("../../../SP1_CIRCUIT_VERSION");