feat: Bump SP1 version, link fixes, cleanup (#60)

* chore: all fixes

* fix

* feat: bump to 4.1.7
This commit is contained in:
Ratan Kaliani
2025-04-02 18:04:48 -07:00
committed by GitHub
parent 7d3772a9e6
commit 7f43a7f0a6
12 changed files with 1376 additions and 983 deletions

View File

@@ -1,5 +1,10 @@
# 'mock' for generating mock proofs locally, 'local' for generating proofs locally, 'network' for generating proofs using the proving network.
SP1_PROVER=local
# If using the proving network, set to your whitelisted private key. For more information, see:
# https://docs.succinct.xyz/docs/generating-proofs/prover-network/key-setup
# Proof modes are `mock`, `cpu`, `cuda` and `network`.
# `mock` is for generating mock proofs locally.
# `cpu` is for generating proofs locally using the CPU.
# `cuda` is for generating proofs locally using the GPU.
# `network` is for generating proofs using the Succinct Prover Network.
SP1_PROVER=cpu
# To use the Succinct Prover Network, set the private key of the account you want to use for requesting proofs.
# Set up a new account here: https://docs.succinct.xyz/docs/network/developers/key-setup.
NETWORK_PRIVATE_KEY=

View File

@@ -15,7 +15,10 @@ jobs:
fail-fast: true
name: Foundry project
runs-on: ubuntu-latest
runs-on:
- runs-on
- runner=1cpu-linux-x64
- run-id=${{ github.run_id }}
steps:
- uses: actions/checkout@v4
with:

View File

@@ -14,8 +14,11 @@ jobs:
strategy:
fail-fast: true
name: Build
runs-on: ubuntu-20.04
name: Build and Execute
runs-on:
- runs-on
- runner=16cpu-linux-x64
- run-id=${{ github.run_id }}
steps:
- uses: actions/checkout@v4
with:
@@ -25,7 +28,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.81.0
toolchain: 1.85.0
- name: Install SP1 toolchain
run: |
@@ -37,3 +40,7 @@ jobs:
run: |
cd program
~/.sp1/bin/cargo-prove prove build
- name: Execute SP1 program
run: |
cargo run --release -- --execute

2282
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,4 +7,4 @@ members = [
resolver = "2"
[workspace.dependencies]
alloy-sol-types = "0.7.7"
alloy-sol-types = "0.8"

View File

@@ -6,7 +6,7 @@ that can generate a proof of any RISC-V program.
## Requirements
- [Rust](https://rustup.rs/)
- [SP1](https://docs.succinct.xyz/getting-started/install.html)
- [SP1](https://docs.succinct.xyz/docs/sp1/getting-started/install)
## Running the Project
@@ -33,9 +33,9 @@ cargo run --release -- --execute
This will execute the program and display the output.
### Generate a Core Proof
### Generate an SP1 Core Proof
To generate a core proof for your program:
To generate an SP1 [core proof](https://docs.succinct.xyz/docs/sp1/generating-proofs/proof-types#core-default) for your program:
```sh
cd script
@@ -45,22 +45,24 @@ cargo run --release -- --prove
### Generate an EVM-Compatible Proof
> [!WARNING]
> You will need at least 128GB RAM to generate a Groth16 or PLONK proof.
> You will need at least 16GB RAM to generate a Groth16 or PLONK proof. View the [SP1 docs](https://docs.succinct.xyz/docs/sp1/getting-started/hardware-requirements#local-proving) for more information.
To generate a proof that is small enough to be verified on-chain and verifiable by the EVM:
Generating a proof that is cheap to verify on the EVM (e.g. Groth16 or PLONK) is more intensive than generating a core proof.
To generate a Groth16 proof:
```sh
cd script
cargo run --release --bin evm -- --system groth16
```
this will generate a Groth16 proof. If you want to generate a PLONK proof, run the following command:
To generate a PLONK proof:
```sh
cargo run --release --bin evm -- --system plonk
```
These commands will also generate fixtures that can be used to test the verification of SP1 zkVM proofs
These commands will also generate fixtures that can be used to test the verification of SP1 proofs
inside Solidity.
### Retrieve the Verification Key
@@ -73,7 +75,7 @@ cargo run --release --bin vkey
## Using the Prover Network
We highly recommend using the Succinct prover network for any non-trivial programs or benchmarking purposes. For more information, see the [setup guide](https://docs.succinct.xyz/docs/generating-proofs/prover-network).
We highly recommend using the [Succinct Prover Network](https://docs.succinct.xyz/docs/network/introduction) for any non-trivial programs or benchmarking purposes. For more information, see the [key setup guide](https://docs.succinct.xyz/docs/network/developers/key-setup) to get started.
To get started, copy the example environment file:

View File

@@ -16,7 +16,7 @@ forge test -v
#### Step 1: Set the `VERIFIER` environment variable
Find the address of the `verifer` to use from the [deployments](https://github.com/succinctlabs/sp1-contracts/tree/main/contracts/deployments) list for the chain you are deploying to. Set it to the `VERIFIER` environment variable, for example:
Find the address of the `verifier` to use from the [deployments](https://github.com/succinctlabs/sp1-contracts/tree/main/contracts/deployments) list for the chain you are deploying to. Set it to the `VERIFIER` environment variable, for example:
```sh
VERIFIER=0x3B6041173B80E77f038f3F2C0f9744f04837185e

View File

@@ -2,7 +2,7 @@
"a": 6765,
"b": 10946,
"n": 20,
"vkey": "0x005aa1cbc05f992604b4f375159054d79b76501cf214b1fec6724ea14eceaf78",
"vkey": "0x00b51cef3572d1a49ae7f4a332221cab31cdb72b131dbf28fb6ab26e15458fe2",
"publicValues": "0x00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000001a6d0000000000000000000000000000000000000000000000000000000000002ac2",
"proof": "0x11b6a09d26e2118c306f7c64b4445c077f90764aaf4c3f0b5195ab76135914a2ba0e62be02216ef9ee42db956a50745c57dc6754a616995e6df07f027b32aafd83d9a9c30d129ff8fd534a67fe6a2fa1807f49e3045f8e85269fc90880da3a8063c45d500228c65c2772dd994f30db4ecb6745ab63ef7ea6e8b3ef6e9b600db7330b95c30a2ad71b04e752d8a045e15f803c3be01c0816f07823471294f204bc876d652f189720fa96d811da3e9d83acf730fef4da8bfd685530dd3867190e26e1ccf4d81b68ff5cf9bb36c36d522eac43653f7c3be5a3f022b680983fb04495633146062481a668712b472d6f18ac56f0eda3fedc9a5ee38d3679ef4aa4b3ea9e6208b7"
"proof": "0x11b6a09d07727e8889e440a3a4fe6b3cc7e438d232daa177c762d3267ada247e165b06ca1beaf42fbaaa7676caf3dd978af6c1b7b64968f67f41e3d356790a09337566d81122aa6904fd105ff2a499c1f3264a3f55e740cda6521be1877225f4073f7a4a22fe10987f12d67a145738de4e301bb8e37347556bead5bb003ce32653ffae5a281be092e26c9d16eb569b3592eb766b0197fe05d359952a05958b2596239f061333369ab1d6576f80e965d0e3d8f1d3a74722e794e72199c3dee91bff8f3a5e087ac3fac78f5372befa133b94764b43c4c88ee4f3fc0495e52c74ad5a6d2c18008e6740d0aad32976971c95db159fb37d4f8428d7c5abe658a58d516acd664c"
}

View File

@@ -5,5 +5,5 @@ edition = "2021"
[dependencies]
alloy-sol-types = { workspace = true }
sp1-zkvm = "4.0.0"
sp1-zkvm = "4.1.7"
fibonacci-lib = { path = "../lib" }

View File

@@ -17,7 +17,7 @@ name = "vkey"
path = "src/bin/vkey.rs"
[dependencies]
sp1-sdk = "4.0.0"
sp1-sdk = "4.1.7"
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
serde = { version = "1.0.200", default-features = false, features = ["derive"] }
clap = { version = "4.0", features = ["derive", "env"] }
@@ -28,4 +28,4 @@ fibonacci-lib = { path = "../lib" }
dotenv = "0.15.0"
[build-dependencies]
sp1-build = "4.0.0"
sp1-build = "4.1.7"

View File

@@ -24,11 +24,11 @@ pub const FIBONACCI_ELF: &[u8] = include_elf!("fibonacci-program");
/// The arguments for the EVM command.
#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
#[command(author, version, about, long_about = None)]
struct EVMArgs {
#[clap(long, default_value = "20")]
#[arg(long, default_value = "20")]
n: u32,
#[clap(long, value_enum, default_value = "groth16")]
#[arg(long, value_enum, default_value = "groth16")]
system: ProofSystem,
}

View File

@@ -20,15 +20,15 @@ pub const FIBONACCI_ELF: &[u8] = include_elf!("fibonacci-program");
/// The arguments for the command.
#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
#[command(author, version, about, long_about = None)]
struct Args {
#[clap(long)]
#[arg(long)]
execute: bool,
#[clap(long)]
#[arg(long)]
prove: bool,
#[clap(long, default_value = "20")]
#[arg(long, default_value = "20")]
n: u32,
}