Skip to content

Commit

Permalink
more 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstam committed Sep 13, 2024
1 parent 6b2ee70 commit 1572b39
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
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`.**
> **Currently, the supported version of SP1 on the prover network is `v2.0.0`.**
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.
10 changes: 4 additions & 6 deletions book/writing-programs/compiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Under the hood, this CLI command calls `cargo build` with the `riscv32im-succinc

You can pass additional arguments to the `cargo prove build` command to customize the build process, like configuring what features are enabled, customizing the output directory and more. To see all available options, run `cargo prove build --help`. Many of these options mirror the options available in the `cargo build` command.


## Production Builds

For production builds of programs, you can build your program inside a Docker container which will generate a **reproducible ELF** on all platforms. To do so, just use the `--docker` flag and optionally the `--tag` flag with the release version you want to use (defaults to `latest`). For example:
Expand Down Expand Up @@ -62,24 +61,23 @@ The path passed in to `build_program` should point to the directory containing t

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

You will see output like the following from the build script if the program has changed, indicating that the program was rebuilt:

````
```
[fibonacci-script 0.1.0] cargo:rerun-if-changed=../program/src
[fibonacci-script 0.1.0] cargo:rerun-if-changed=../program/Cargo.toml
[fibonacci-script 0.1.0] cargo:rerun-if-changed=../program/Cargo.lock
[fibonacci-script 0.1.0] cargo:warning=fibonacci-program built at 2024-03-02 22:01:26
[fibonacci-script 0.1.0] [sp1] Compiling fibonacci-program v0.1.0 (/Users/umaroy/Documents/fibonacci/program)
[fibonacci-script 0.1.0] [sp1] Finished release [optimized] target(s) in 0.15s
warning: fibonacci-script@0.1.0: fibonacci-program built at 2024-03-02 22:01:26
````
```

The above output was generated by running `RUST_LOG=info cargo run --release -vv` for the `script` folder of the Fibonacci example.


### Advanced Build Options

To configure the build process when using the `sp1-build` crate, you can pass a [`BuildArgs`](https://docs.rs/sp1-build/1.2.0/sp1_build/struct.BuildArgs.html) struct to to the [`build_program_with_args`](https://docs.rs/sp1-build/1.2.0/sp1_build/fn.build_program_with_args.html) function. The build arguments are the same as the ones available from the `cargo prove build` command.
Expand All @@ -99,4 +97,4 @@ fn main() {
}
```

**Note:** If you want reproducible builds with the `build.rs` approach, you should use the `docker` flag and the `build_program_with_args` function, as shown in the example above.
**Note:** If you want reproducible builds with the `build.rs` approach, you should use the `docker` flag and the `build_program_with_args` function, as shown in the example above.
6 changes: 3 additions & 3 deletions book/writing-programs/cycle-tracking.md
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 = "1.1.0"
sp1-derive = "2.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 Expand Up @@ -43,6 +43,7 @@ stdout: result: 2940
Note that we elegantly handle nested cycle tracking, as you can see above.

### Get Tracked Cycle Counts

To include tracked cycle counts in the `ExecutionReport` when using `ProverClient::execute`, use the following annotations:

```rust,noplayground
Expand All @@ -65,8 +66,7 @@ First, we need to generate a trace file of the program counter at each cycle whi
TRACE_FILE=trace.log RUST_LOG=info cargo run --release
```

When the `TRACE_FILE` environment variable is set, as SP1's RISC-V runtime is executing, it will write a log of the program counter to the file specified by `TRACE_FILE`.

When the `TRACE_FILE` environment variable is set, as SP1's RISC-V runtime is executing, it will write a log of the program counter to the file specified by `TRACE_FILE`.

Next, we can use the `cargo prove` CLI with the `trace` command to analyze the trace file and generate a table of instruction counts. This can be done with the following command:

Expand Down
2 changes: 1 addition & 1 deletion book/writing-programs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ name = "program"
edition = "2021"
[dependencies]
sp1-zkvm = "1.1.0"
sp1-zkvm = "2.0.0"
```

The `sp1-zkvm` crate includes necessary utilities for your program, including handling inputs and outputs,
Expand Down

0 comments on commit 1572b39

Please sign in to comment.