Benchmark: Proving with Risc Zero
Determination of the expected proving speed (in TPS) for a given machine and configuration using the Risc Zero zkVM. This benchmark produces results with a tradeoff between proof latency and max throughput.
Setup
Before running the benchmark, make sure your machine is set up and ready to go. Refer to the Setup Guide for how to set everything up with dependencies.
Running
The benchmark currently supports both CPU and GPU proving with Risc Zero.
For CPU proving, run the benchmark with the following command:
cd benchmarks/zk-proving/risczero
RUSTFLAGS="-Ctarget-cpu=native" cargo run --release
For GPU proving, run the benchmark with the following command:
cd benchmarks/zk-proving/risczero
RUSTFLAGS="-Ctarget-cpu=native" cargo run --release -F cuda
Note: GPU proving takes a VERY long time to compile due to having to build the GPU kernels
Options
The following options are available:
Options:
--num-accounts <NUM_ACCOUNTS>
The number of accounts to fill the state trie (default: 1_000_000) [default: 1000000]
--max-proof-duration <MAX_PROOF_DURATION>
The maximum amount of proof generation time to target (default: 600 seconds) [default: 600]
-h, --help
Print help
-V, --version
Print version
Output
The benchmark outputs two tables. One lists the raw proving time and the number of transactions/events that were proven. The other lists estimated TPS values for a range of proof latencies.
Example:
Proof generation benchmark results:
Events Time (s) TPS
1 3.84 0.26
2 3.92 0.51
...
10000 566.03 17.67
20000 1021.02 19.59
Estimated TPS at various latencies:
Latency (s) TPS
5 3.07
10 7.94
...
120 14.50
300 16.10
Benchmark Results
The following results were obtained on the various reference machines.
AMD Ryzen 9 9950X + RTX 5090
GPU proving
Proof generation benchmark results:
Events Time (s) TPS
1 3.84 0.26
2 3.92 0.51
5 4.47 1.12
10 4.23 2.36
20 5.66 3.53
50 7.96 6.28
100 11.43 8.75
200 19.53 10.24
500 39.54 12.65
1000 74.62 13.40
2000 135.90 14.72
5000 309.93 16.13
10000 566.03 17.67
20000 1021.02 19.59
Estimated TPS at various latencies:
Latency (s) TPS
5 3.07
10 7.94
30 11.90
60 13.19
120 14.50
300 16.10
AWS g6.xlarge
GPU proving
Proof generation benchmark results:
Events Time (s) TPS
1 6.23 0.16
2 6.26 0.32
5 6.79 0.74
10 7.78 1.29
20 9.23 2.17
50 13.66 3.66
100 19.64 5.09
200 32.81 6.10
500 69.10 7.24
1000 126.09 7.93
2000 234.46 8.53
5000 520.38 9.61
10000 942.56 10.61
Estimated TPS at various latencies:
Latency (s) TPS
5 --
10 2.52
30 5.96
60 7.08
120 7.89
300 8.96
AWS c6i.8xlarge
CPU proving
Proof generation benchmark results:
Events Time (s) TPS
1 66.61 0.02
2 66.52 0.03
5 84.84 0.06
10 125.10 0.08
20 152.68 0.13
50 297.24 0.17
100 472.23 0.21
200 848.63 0.24
Estimated TPS at various latencies:
Latency (s) TPS
5 --
10 --
30 --
60 --
120 0.08
300 0.17