readme and .cfg files added

This commit is contained in:
Manish Kumar 2024-03-18 11:48:14 +05:30
parent 9d6723bf03
commit 50730f1e92
5 changed files with 32 additions and 1 deletions

10
hash/sp1/bench/README.md Normal file
View File

@ -0,0 +1,10 @@
Benchmarking inside sp1 ZKVM
--------------------------------
- The `sp1/benches` contains the following hash `program`(the source code that will be proven inside the zkVM): sha256, keccak, blake2, blake3, and poseidon2 ober BN256.
- `script` folder contains the benchmarking code that contains proof generation and verification code for each hash program.
- The `build.sh` script builds the whole code.
- `run.sh` and `run_tree.sh` runs the benchmark. (`run.sh` for sha256, keccak, blake2, blake3 and `run_tree.sh` for poseidon2 over BN256)
- Benchmarks can be parameterized using environment variables. By convention, we start the names of these environment variables with the `ZKBENCH_` prefix.
- By default the `run.sh` will run the sha256 benchmark over 1KB of data. other hashes can be run by settig the environment variables accordingly.
- Additional files `bench.cfg` and `bench_tree.cfg` specifies the configurations and parameters.

11
hash/sp1/bench/bench.cfg Normal file
View File

@ -0,0 +1,11 @@
name: "Hashes benchmarking using sp1 prover"
author:
timeout: 200
params:
[ HASH_TYPE: [ "sha256", "keccak", "blake2", "blake3"]
, INPUT_SIZE_BYTES: [ 256, 512, 1024, 2048 ]
]
tags: sp1, $HASH_TYPE
comments:
The benchmarks includes for sha256, keccak, blake2, blake3 using sp1.

View File

@ -0,0 +1,10 @@
name: "Hashes benchmarking using sp1 prover"
author:
timeout: 500
params:
[ HASH_TYPE_TREE: [ "poseidon2"]
, TREE_DEPTH: [ 2, 4, 8, 16 ]
]
tags: sp1, $HASH_TYPE_TREE
comments:
The benchmarks includes for poseidon2(merkle hashing) over BN256.

View File

@ -13,4 +13,4 @@ echo "HASH = $ZKBENCH_HASH_TYPE_TREE"
echo "Tree Depth = $ZKBENCH_TREE_DEPTH"
# Run the benchmarks
./target/release/bench-script $ZKBENCH_HASH_TYPE_TREE $ZKBENCH_TREE_DEPTH
RUST_LOG=info ./target/release/bench-script $ZKBENCH_HASH_TYPE_TREE $ZKBENCH_TREE_DEPTH