Skip to content

Commit

Permalink
docs: revamp doc for snark assets (#43)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Chataigner <[email protected]>
  • Loading branch information
tchataigner authored Jun 24, 2024
1 parent 0b2fe4a commit 4890486
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 38 deletions.
23 changes: 4 additions & 19 deletions aptos/docs/src/benchmark/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,7 @@ in [their dedicated section](../run/configuration.md).

## SNARK proofs

When running any tests or benchmarks that makes Plonk proofs over BN254, it's necessary to build the correct circuit artifacts.

If you don't manually build them, it will lead to a proof generation failure (unsatisfied constraint) due to
circuit differences between SP1 and Sphinx.

To enable Plonk proofs, we first need to generate the necessary circuit artifacts.

We need to head to the Sphinx repository and run the build script:

```bash
cd sphinx/prover && \
make build-plonk-bn254 && \
mkdir -p ~/.sp1/circuits/plonk_bn254/e48c01ec/ && \
cp build/* ~/.sp1/circuits/plonk_bn254/e48c01ec/
```

The trailing commit identifier after `~/.sp1/circuits/plonk_bn254/` depends on the value of `PLONK_BN254_ARTIFACTS_COMMIT`
defined [here](https://github.com/lurk-lab/sphinx/blob/dev/prover/src/install.rs),
make sure to use the most up-to-date value for the specific Sphinx release.
When running any tests or benchmarks that makes Plonk proofs over BN254, the prover leverages some pre-built circuits
artifacts. Those circuits artifacts are generated when we release new versions of Sphinx and are made avaialble on a
remote storage. The current address for the storage can be
found [here](https://github.com/lurk-lab/sphinx/blob/dev/prover/src/install.rs).
3 changes: 1 addition & 2 deletions aptos/docs/src/benchmark/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ It measures two main metrics for each proof:
## SNARK proofs

To benchmark the end-to-end flow with Plonk proofs over BN254, we first need to generate the circuits assets as described in [the
configuration section](./configuration.md). Then, just pass the environment variable `SNARK=1`:
To enable SNARK proving, just pass the environment variable `SNARK=1`:

```bash
RUN_SERIAL=1 SNARK=1 RUST_LOG="debug" RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable" PRIMARY_ADDR="127.0.0.1:8080" SECONDARY_ADDR="127.0.0.1:8081" cargo +nightly bench --bench proof_server
Expand Down
22 changes: 5 additions & 17 deletions aptos/docs/src/run/setup_proof_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,11 @@ Make sure that the configuration specified in [the dedicated section](./configur

## SNARK proofs

We mentioned earlier that the Proof Server has the capabilities of handling two types of proofs: either Sphinx core proofs
or SNARK proofs using Plonk.

To enable Plonk proofs, we first need to generate the necessary circuit artifacts.

We need to head to the Sphinx repository and run the build script:

```bash
cd sphinx/prover && \
make build-plonk-bn254 && \
mkdir -p ~/.sp1/circuits/plonk_bn254/e48c01ec/ && \
cp build/* ~/.sp1/circuits/plonk_bn254/e48c01ec/
```

The trailing commit identifier after `~/.sp1/circuits/plonk_bn254/` depends on the value of `PLONK_BN254_ARTIFACTS_COMMIT`
defined [here](https://github.com/lurk-lab/sphinx/blob/dev/prover/src/install.rs),
make sure to use the most up-to-date value for the specific Sphinx release.
We mentioned earlier that the Proof Server has the capabilities of handling two types of proofs: either Sphinx core
proofs
or SNARK proofs using Plonk. The circuit artifacts for the SNARK proofs are stored in a remote storage. The current
address
for the storage can be found [here](https://github.com/lurk-lab/sphinx/blob/dev/prover/src/install.rs).

## Environment variables

Expand Down

0 comments on commit 4890486

Please sign in to comment.