Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirhemo committed Sep 17, 2024
2 parents 0b5bc84 + db332bd commit f1d5d5d
Show file tree
Hide file tree
Showing 24 changed files with 228 additions and 214 deletions.
180 changes: 90 additions & 90 deletions Cargo.lock

Large diffs are not rendered by default.

54 changes: 29 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "1.2.0"
version = "2.0.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/succinctlabs/sp1"
Expand Down Expand Up @@ -30,7 +30,11 @@ members = [
"crates/stark",
"crates/zkvm/*",
]
exclude = ["examples/target", "crates/recursion/program", "crates/recursion/circuit"]
exclude = [
"examples/target",
"crates/recursion/program",
"crates/recursion/circuit",
]
resolver = "2"

[profile.release]
Expand All @@ -46,29 +50,29 @@ debug-assertions = true

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

# p3
p3-air = "0.1.3-succinct"
Expand Down
18 changes: 8 additions & 10 deletions book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

- [Proof Aggregation](./writing-programs/proof-aggregation.md)


# Generating Proofs

- [Setup](./generating-proofs/setup.md)
Expand All @@ -46,13 +45,15 @@
- [Recommended Workflow](./generating-proofs/recommended-workflow.md)

- [Prover Network Beta](./generating-proofs/prover-network.md)
- [Key Setup](./generating-proofs/prover-network/key-setup.md)
- [Usage](./generating-proofs/prover-network/usage.md)
- [Supported Versions](./generating-proofs/prover-network/versions.md)

- [Key Setup](./generating-proofs/prover-network/key-setup.md)
- [Usage](./generating-proofs/prover-network/usage.md)
- [Supported Versions](./generating-proofs/prover-network/versions.md)

- [Hardware Acceleration](./generating-proofs/hardware-acceleration.md)
- [AVX](./generating-proofs/hardware-acceleration/avx.md)
- [CUDA](./generating-proofs/hardware-acceleration/cuda.md)

- [AVX](./generating-proofs/hardware-acceleration/avx.md)
- [CUDA](./generating-proofs/hardware-acceleration/cuda.md)

- [FAQ](./generating-proofs/sp1-sdk-faq.md)

Expand All @@ -64,7 +65,6 @@

- [Contract Addresses](./onchain-verification/contract-addresses.md)


# Developers

- [Common Issues](./developers/common-issues.md)
Expand All @@ -73,6 +73,4 @@

- [RV32IM Specification](./developers/rv32im-specification.md)

- [Building PLONK Artifacts](./developers/building-plonk-artifacts.md)


- [Building Circuit Artifacts](./developers/building-circuit-artifacts.md)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building Circuit Artifacts

To build the production PLONK and Groth16 Bn254 artifacts from scratch, you can use the `Makefile` inside the `prover` directory.
To build the production Groth16 and PLONK Bn254 artifacts from scratch, you can use the `Makefile` inside the `prover` directory.

```shell,noplayground
cd prover
Expand Down
23 changes: 12 additions & 11 deletions book/developers/common-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This is likely due to two different versions of `alloy_sol_types` being used. To

```toml
[dependencies]
sp1-sdk = { version = "1.1.0", default-features = false }
sp1-sdk = { version = "2.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 Expand Up @@ -100,22 +100,23 @@ C++ toolchain be setting this variable manually:
export CC_riscv32im_succinct_zkvm_elf=/path/to/toolchain
```

## Compilation Errors with [`sp1-lib::syscall_verify_sp1_proof`](https://docs.rs/sp1-lib/latest/sp1_lib/fn.syscall_verify_sp1_proof.html)
## Compilation Errors with [`sp1-lib::syscall_verify_sp1_proof`](https://docs.rs/sp1-lib/latest/sp1_lib/fn.syscall_verify_sp1_proof.html)

If you are using the [`sp1-lib::syscall_verify_sp1_proof`](https://docs.rs/sp1-lib/latest/sp1_lib/fn.syscall_verify_sp1_proof.html) function, you may encounter compilation errors when building your program.

```bash
[sp1] = note: rust-lld: error: undefined symbol: syscall_verify_sp1_proof
[sp1] >>> referenced by sp1_lib.b593533d149f0f6e-cgu.0
[sp1] >>> sp1_lib-8f5deb4c47d01871.sp1_lib.b593533d149f0f6e-cgu.0.rcgu.o:(sp1_lib::verify::verify_sp1_proof::h5c1bb38f11b3fe71) in ...
[sp1]
[sp1]
[sp1]
[sp1]
[sp1] error: could not compile `package-name` (bin "package-name") due to 1 previous error
```
```

To resolve this, ensure that you're importing both `sp1-lib` and `sp1-zkvm` with the verify feature enabled.
To resolve this, ensure that you're importing both `sp1-lib` and `sp1-zkvm` with the verify feature enabled.
```toml
[dependencies]
sp1-lib = { version = "<VERSION>", features = ["verify"] }
sp1-zkvm = { version = "<VERSION>", features = ["verify"] }
```
```toml
[dependencies]
sp1-lib = { version = "<VERSION>", features = ["verify"] }
sp1-zkvm = { version = "<VERSION>", features = ["verify"] }
```
2 changes: 1 addition & 1 deletion book/generating-proofs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,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 = "1.1.0", features = ["neon"] }
sp1-sdk = { version = "2.0.0", features = ["neon"] }
```

## Performance
Expand Down
6 changes: 3 additions & 3 deletions book/generating-proofs/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ To make this more concrete, let's walk through a simple example of generating a
{{#include ../../examples/fibonacci/script/src/main.rs}}
```

You can run the above script in the `script` directory with `RUST_LOG=info cargo run --release`. Note that running the above script will generate a proof locally.
You can run the above script in the `script` directory with `RUST_LOG=info cargo run --release`. Note that running the above script will generate a proof locally.

<div class="warning">
WARNING: Local proving often is much slower than the prover network and for certain proof types (e.g. PLONK) requires a significant amount of RAM and will likely not work on a laptop.
WARNING: Local proving often is much slower than the prover network and for certain proof types (e.g. Groth16, PLONK) require a significant amount of RAM and will likely not work on a laptop.
</div>

We recommend using the [prover network](./prover-network.md) to generate proofs. Read more about the [recommended workflow](./recommended-workflow.md) for developing with SP1.
We recommend using the [prover network](./prover-network.md) to generate proofs. Read more about the [recommended workflow](./recommended-workflow.md) for developing with SP1.
31 changes: 24 additions & 7 deletions book/generating-proofs/proof-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ There are a few different types of proofs that can be generated by the SP1 zkVM.

The `ProverClient` follows a "builder" pattern that allows you to configure the proof type and other options after creating a `ProverClient` and calling `prove` on it.

For a full list of options, see the following [docs](https://docs.rs/sp1-sdk/1.1.0/sp1_sdk/action/struct.Prove.html).
For a full list of options, see the following [docs](https://docs.rs/sp1-sdk/1.2.0/sp1_sdk/action/struct.Prove.html).

## Core (Default)

The default prover mode generates a list of STARK proofs that in aggregate have size proportional to
the size of the execution. Use this in settings where you don't care about **verification cost / proof size**.
the size of the execution. Use this in settings where you don't care about **verification cost / proof size**.

```rust,noplayground
let client = ProverClient::new();
Expand All @@ -19,22 +19,39 @@ client.prove(&pk, stdin).run().unwrap();
## Compressed

The compressed prover mode generates STARK proofs that have constant size. Use this in settings where you
care about **verification cost / proof size**. This is useful for applications where you want to recursively verify SP1 proofs within SP1 (see the [proof aggregation](../writing-programs/proof-aggregation.md) section).
care about **verification cost / proof size**. This is useful for applications where you want to recursively verify SP1 proofs within SP1 (see the [proof aggregation](../writing-programs/proof-aggregation.md) section).

```rust,noplayground
let client = ProverClient::new();
client.prove(&pk, stdin).compressed().run().unwrap();
```

## PLONK
## Groth16 (testnet only)

<div class="warning">
WARNING: Groth16 proofs are currently only verifiable on testnets & are not production-ready
</div>

<div class="warning">
WARNING: The PLONK prover requires around 64GB of RAM and is only guaranteed to work on official releases of SP1. We recommend using the prover network to generate PLONK proofs.
WARNING: The Groth16 prover requires around 64GB of RAM and are only guaranteed to work on official releases of SP1. We recommend using the prover network to generate these proofs.
</div>

The Groth16 prover mode generate a SNARK proof with extremely small proof size and low verification cost.
This mode generates proofs that can be verified onchain for around ~270k gas.

```rust,noplayground
let client = ProverClient::new();
client.prove(&pk, stdin).groth16().run().unwrap();
```

## PLONK

<div class="warning">
WARNING: The PLONK prover requires around 64GB of RAM and are only guaranteed to work on official releases of SP1. We recommend using the prover network to generate these proofs.
</div>

The PLONK prover mode generates a SNARK proof with extremely small proof size and low verification cost.
This mode is necessary for generating proofs that can be verified onchain for around ~300k gas.
The Groth16 and PLONK prover modes generate a SNARK proof with extremely small proof size and low verification cost.
This mode generates proofs that can be verified onchain for around ~300k gas.

```rust,noplayground
let client = ProverClient::new();
Expand Down
5 changes: 3 additions & 2 deletions book/generating-proofs/prover-network.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Prover Network Beta

> **Currently, the supported version of SP1 on the prover network is `v1.1.0`.**
> **See [Supported Versions](./prover-network/versions.md) for the currently supported versions of SP1 on the Prover Network.**
Succinct [has been building](https://blog.succinct.xyz/succinct-network/) the Succinct Prover Network, a distributed network of provers that can generate proofs of any size quickly and reliably. It's currently in private beta, but you can get access by following the steps below.

To get started, **[FILL OUT THIS FORM](https://forms.gle/rTUvhstS8PFfv9B3A)** to gain access to the Succinct
Network. Completing this form requires you to complete the [key setup](./prover-network/key-setup.md) steps below.
Network. Completing this form requires you to complete the [key
setup](./prover-network/key-setup.md) steps below.
2 changes: 1 addition & 1 deletion book/generating-proofs/prover-network/usage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prover Network: Usage

> **Currently, the supported version of SP1 on the prover network is `v1.1.0`.**
> **See [Supported Versions](./versions.md) for the currently supported versions of SP1 on the Prover Network.**
## Sending a proof request

Expand Down
15 changes: 8 additions & 7 deletions book/generating-proofs/prover-network/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@

The prover network currently only supports specific versions of SP1:

| Environment | RPC URL | Supported Version |
| ----------- | -------------------------- | ----------------- |
| Production | `https://rpc.succinct.xyz` | `v1.2.X` |
| Version | Description |
| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| v2.X.X | Audited, production ready version. |
| v3.X.X | Pre-release version with enhanced performance, currently being audited. **Recommended for benchmarking or testing, not recommended for production use.** |

Where `X` denotes that any patch version is supported (e.g. `v1.2.0`, `v1.2.1`).
`X` denotes that any minor and patch version is supported (e.g. `v2.1.0`, `v2.1.1`).

If you submit a proof request to the prover network and your are not using the supported version, you will receive an error message.
If you submit a proof request to the prover network and you are not using a supported version, you will receive an error message.

## Changing versions

You must switch to a supported version before submitting a proof. To do so, replace the `sp1-zkvm` version in your progam's `Cargo.toml`:

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

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

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

Re-build your program and script, and then try again.
Loading

0 comments on commit f1d5d5d

Please sign in to comment.