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

fix(sp1-build): default docker tag #1693

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
751 changes: 390 additions & 361 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions SP1_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v3.0.0
2 changes: 1 addition & 1 deletion book/verification/onchain/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ You can run the above script with `RUST_LOG=info cargo run --bin groth16_bn254 -
If you would like to run the Groth16 or PLONK prover directly without Docker, you must have Go 1.22 installed and enable the `native-gnark` feature in `sp1-sdk`. This path is not recommended and may require additional native dependencies.

```toml
sp1-sdk = { version = "2.0.0", features = ["native-gnark"] }
sp1-sdk = { version = "3.0.0", features = ["native-gnark"] }
```
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This is likely due to two different versions of `alloy_sol_types` being used. To

```toml
[dependencies]
sp1-sdk = { version = "2.0.0", default-features = false }
sp1-sdk = { version = "3.0.0", default-features = false }
```

This will configure out the `network` feature which will remove the dependency on `alloy_sol_types` and configure out the `NetworkProver`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RUSTFLAGS='-C target-cpu=native' cargo run --release
Currently there is support for AVX512 and NEON SIMD instructions. For NEON, you must also enable the `sp1-sdk` feature `neon` in your script crate's `Cargo.toml` file.

```toml
sp1-sdk = { version = "2.0.0", features = ["neon"] }
sp1-sdk = { version = "3.0.0", features = ["neon"] }
```

## Performance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ You must switch to a supported version before submitting a proof. To do so, repl

```toml
[dependencies]
sp1-zkvm = "2.0.0"
sp1-zkvm = "3.0.0"
```

replace the `sp1-sdk` version in your script's `Cargo.toml`:

```toml
[dependencies]
sp1-sdk = "2.0.0"
sp1-sdk = "3.0.0"
```

Re-build your program and script, and then try again.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The path passed in to `build_program` should point to the directory containing t

```toml
[build-dependencies]
sp1-build = "2.0.0"
sp1-build = "3.0.0"
```

You will see output like the following from the build script if the program has changed, indicating that the program was rebuilt:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Note that to use the macro, you must add the `sp1-derive` crate to your dependen

```toml
[dependencies]
sp1-derive = "2.0.0"
sp1-derive = "3.0.0"
```

In the script for proof generation, setup the logger with `utils::setup_logger()` and run the script with `RUST_LOG=info cargo run --release`. You should see the following output:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ name = "program"
edition = "2021"

[dependencies]
sp1-zkvm = "2.0.0"
sp1-zkvm = "3.0.0"
```

The `sp1-zkvm` crate includes necessary utilities for your program, including handling inputs and outputs,
Expand Down
6 changes: 3 additions & 3 deletions crates/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ pub use build::{execute_build_program, generate_elf_paths};

use clap::Parser;

const SP1_CIRCUIT_VERSION: &str = include_str!("../../../SP1_VERSION");
const BUILD_TARGET: &str = "riscv32im-succinct-zkvm-elf";
const DEFAULT_TAG: &str = "latest";
const DEFAULT_OUTPUT_DIR: &str = "elf";
const HELPER_TARGET_SUBDIR: &str = "elf-compilation";

Expand All @@ -27,7 +27,7 @@ pub struct BuildArgs {
#[clap(
long,
help = "The ghcr.io/succinctlabs/sp1 image tag to use when building with Docker.",
default_value = DEFAULT_TAG
default_value = SP1_CIRCUIT_VERSION
)]
pub tag: String,
#[clap(
Expand Down Expand Up @@ -83,7 +83,7 @@ impl Default for BuildArgs {
fn default() -> Self {
Self {
docker: false,
tag: DEFAULT_TAG.to_string(),
tag: SP1_CIRCUIT_VERSION.to_string(),
features: vec![],
rustflags: vec![],
ignore_rust_version: false,
Expand Down
7 changes: 0 additions & 7 deletions crates/core/machine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ pub mod riscv;
pub mod syscall;
pub mod utils;

/// 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 = "v3.0.0";

// Re-export the `SP1ReduceProof` struct from sp1_core_machine.
//
// This is done to avoid a circular dependency between sp1_core_machine and sp1_core_executor, and
Expand Down
7 changes: 6 additions & 1 deletion crates/prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ use utils::{sp1_committed_values_digest_bn254, sp1_vkey_digest_bn254, words_to_b

use components::{CpuProverComponents, SP1ProverComponents};

pub use sp1_core_machine::SP1_CIRCUIT_VERSION;
/// 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_VERSION");

/// The configuration for the core prover.
pub type CoreSC = BabyBearPoseidon2;
Expand Down
3 changes: 1 addition & 2 deletions crates/recursion/gnark-ffi/src/ffi/docker.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::ProofBn254;
use crate::{Groth16Bn254Proof, PlonkBn254Proof};
use crate::{Groth16Bn254Proof, PlonkBn254Proof, SP1_CIRCUIT_VERSION};
use anyhow::{anyhow, Result};
use sp1_core_machine::SP1_CIRCUIT_VERSION;
use std::{io::Write, process::Command};

/// Represents the proof system being used
Expand Down
3 changes: 1 addition & 2 deletions crates/recursion/gnark-ffi/src/ffi/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
//! 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 sp1_core_machine::SP1_CIRCUIT_VERSION;
use std::{
ffi::{c_char, CStr, CString},
mem::forget,
Expand Down
3 changes: 1 addition & 2 deletions crates/recursion/gnark-ffi/src/groth16_bn254.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ use std::{
use crate::{
ffi::{build_groth16_bn254, prove_groth16_bn254, test_groth16_bn254, verify_groth16_bn254},
witness::GnarkWitness,
Groth16Bn254Proof,
Groth16Bn254Proof, SP1_CIRCUIT_VERSION,
};

use num_bigint::BigUint;
use sha2::{Digest, Sha256};
use sp1_core_machine::SP1_CIRCUIT_VERSION;
use sp1_recursion_compiler::{
constraints::Constraint,
ir::{Config, Witness},
Expand Down
7 changes: 7 additions & 0 deletions crates/recursion/gnark-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ pub use groth16_bn254::*;
pub use plonk_bn254::*;
pub use proof::*;
pub use witness::*;

/// 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_VERSION");
3 changes: 1 addition & 2 deletions crates/recursion/gnark-ffi/src/plonk_bn254.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ use std::{
use crate::{
ffi::{build_plonk_bn254, prove_plonk_bn254, test_plonk_bn254, verify_plonk_bn254},
witness::GnarkWitness,
PlonkBn254Proof,
PlonkBn254Proof, SP1_CIRCUIT_VERSION,
};

use num_bigint::BigUint;
use sha2::{Digest, Sha256};
use sp1_core_machine::SP1_CIRCUIT_VERSION;
use sp1_recursion_compiler::{
constraints::Constraint,
ir::{Config, Witness},
Expand Down
4 changes: 2 additions & 2 deletions crates/sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ pub use sp1_build::include_elf;
pub use sp1_core_executor::{ExecutionReport, Executor, HookEnv, SP1Context, SP1ContextBuilder};

// Re-export the machine/prover primitives.
pub use sp1_core_machine::{io::SP1Stdin, riscv::cost::CostEstimator, SP1_CIRCUIT_VERSION};
pub use sp1_core_machine::{io::SP1Stdin, riscv::cost::CostEstimator};
pub use sp1_primitives::io::SP1PublicValues;
pub use sp1_prover::{
CoreSC, HashableKey, InnerSC, OuterSC, PlonkBn254Proof, ProverMode, SP1Prover, SP1ProvingKey,
SP1VerifyingKey,
SP1VerifyingKey, SP1_CIRCUIT_VERSION,
};

// Re-export the utilities.
Expand Down
4 changes: 2 additions & 2 deletions crates/sdk/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use anyhow::Result;
use itertools::Itertools;
use p3_field::PrimeField32;
use sp1_core_executor::{ExecutionReport, SP1Context};
use sp1_core_machine::{io::SP1Stdin, SP1_CIRCUIT_VERSION};
use sp1_core_machine::io::SP1Stdin;
use sp1_primitives::io::SP1PublicValues;
use sp1_prover::{
components::SP1ProverComponents, CoreSC, InnerSC, SP1CoreProofData, SP1Prover, SP1ProvingKey,
SP1VerifyingKey,
SP1VerifyingKey, SP1_CIRCUIT_VERSION,
};
use sp1_stark::{air::PublicValues, MachineVerificationError, Word};
use thiserror::Error;
Expand Down
Loading