Skip to content

Commit

Permalink
fix: Add SHARD_BATCH_SIZE=0 to commands
Browse files Browse the repository at this point in the history
  • Loading branch information
wwared committed Jun 24, 2024
1 parent 1abf687 commit 18d096b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion aptos/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ chain. The code for this is located in the `aptos_test_utils` module.
To run tests, we recommend the following command:

```shell
cargo +nightly-2024-05-31 nextest run --verbose --release --profile ci --features aptos --package aptos-lc --no-capture
SHARD_BATCH_SIZE=0 cargo +nightly-2024-05-31 nextest run --verbose --release --profile ci --features aptos --package aptos-lc --no-capture
```

This command should be run with the following environment variable:
Expand All @@ -39,3 +39,4 @@ This command should be run with the following environment variable:
[target.'cfg(all())']
rustflags = ["--cfg", "tokio_unstable", "-C", "target-cpu=native", "-C", "opt-level=3"]
```
- `SHARD_BATCH_SIZE=0`: Disables some checkpointing for faster proving at the cost of RAM.
4 changes: 2 additions & 2 deletions aptos/docs/src/benchmark/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ the [`proof-server`](https://github.com/lurk-lab/zk-light-clients/blob/dev/aptos
crate. It can be run with the following command:

```bash
RUST_LOG="debug" RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" PRIMARY_ADDR="127.0.0.1:8080" SECONDARY_ADDR="127.0.0.1:8081" cargo +nightly-2024-05-31 bench --bench proof_server
SHARD_BATCH_SIZE=0 RUST_LOG="debug" RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" PRIMARY_ADDR="127.0.0.1:8080" SECONDARY_ADDR="127.0.0.1:8081" cargo +nightly-2024-05-31 bench --bench proof_server
```

This benchmark will spawn the two servers locally and make two requests in sequence to them. This generates both proofs
Expand Down Expand Up @@ -49,7 +49,7 @@ TODO FIXME
To enable SNARK proving, just pass the environment variable `SNARK=1` when running:

```bash
SNARK=1 RUST_LOG="debug" RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" PRIMARY_ADDR="127.0.0.1:8080" SECONDARY_ADDR="127.0.0.1:8081" cargo +nightly-2024-05-31 bench --bench proof_server
SNARK=1 SHARD_BATCH_SIZE=0 RUST_LOG="debug" RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" PRIMARY_ADDR="127.0.0.1:8080" SECONDARY_ADDR="127.0.0.1:8081" cargo +nightly-2024-05-31 bench --bench proof_server
```

For our [production configuration](../run/overview.md), we currently get the following results:
Expand Down
4 changes: 2 additions & 2 deletions aptos/docs/src/benchmark/proof.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Enter benchmark name: e2e
Run the following command:

```shell
cargo +nightly-2024-05-31 bench --features aptos --bench execute -- <benchmark_name>
SHARD_BATCH_SIZE=0 cargo +nightly-2024-05-31 bench --features aptos --bench execute -- <benchmark_name>
```

## Interpreting the results
Expand Down Expand Up @@ -137,7 +137,7 @@ To run the test efficiently, first install `nextest` following [its documentatio
Ensure that you also have the previously described environment variables set, then run the following command:

```shell
cargo +nightly-2024-05-31 nextest run --verbose --release --profile ci --features aptos --package aptos-lc --no-capture
SHARD_BATCH_SIZE=0 cargo +nightly-2024-05-31 nextest run --verbose --release --profile ci --features aptos --package aptos-lc --no-capture
```

> **Note**
Expand Down
4 changes: 2 additions & 2 deletions aptos/docs/src/run/setup_proof_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Now that our deployment machine is properly configured, we can run the secondary
```bash
git clone [email protected]:lurk-lab/zk-light-clients.git && \
cd zk-light-clients/aptos/proof-server && \
RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" cargo +nightly-2024-05-31 run --release --bin server_secondary -- -a <NETWORK_ADDRESS>
SHARD_BATCH_SIZE=0 RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" cargo +nightly-2024-05-31 run --release --bin server_secondary -- -a <NETWORK_ADDRESS>
```

## Deploy the primary server
Expand All @@ -50,5 +50,5 @@ Finally, once the primary server is configured in the same fashion, run it:
```bash
git clone [email protected]:lurk-lab/zk-light-clients.git && \
cd zk-light-clients/aptos/proof-server && \
RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" cargo +nightly-2024-05-31 run --release --bin server_primary -- -a <NETWORK_ADDESS> --snd-addr <SECONDARY_SERVER_ADDRESS>
SHARD_BATCH_SIZE=0 RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" cargo +nightly-2024-05-31 run --release --bin server_primary -- -a <NETWORK_ADDESS> --snd-addr <SECONDARY_SERVER_ADDRESS>
```
2 changes: 2 additions & 0 deletions aptos/light-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ benchmark:
@read -p "Enter benchmark name: " bench; \
RUST_LOG="debug" \
RUSTFLAGS="--cfg tokio_unstable -C target-cpu=native -C opt-level=3" \
SHARD_BATCH_SIZE=0 \
cargo +nightly-2024-05-31 bench --features aptos --bench $$bench

BENCH ?= e2e

bench-ci:
RUST_LOG="info" \
RUSTFLAGS="--cfg tokio_unstable -C target-cpu=native -C opt-level=3" \
SHARD_BATCH_SIZE=0 \
cargo +nightly-2024-05-31 bench --features aptos --bench $(BENCH)

0 comments on commit 18d096b

Please sign in to comment.