-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
118 lines (108 loc) · 7.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# TODO: Separate out run and build, store run logs in prove.log instead of cycles.txt
export RUST_LOG=info
# Rust benchmarks
merkle-rust = algorithms/merkle
merkle-proof-rust = algorithms/merkle_proof
nth-prime-rust = algorithms/nth_prime
keccak-rust = algorithms/keccak
poseidon-rust = algorithms/poseidon
bls-agg-rust = algorithms/bls-agg
ecdsa-verify-rust = algorithms/ecdsa_verify
bls-verify-rust = algorithms/bls-verify
all:
@echo "Running all benchmarks..."
make run-nth-prime
make run-merklize
make run-merkle-proof
make run-keccak
make run-poseidon
make run-bls-aggregate
make run-ecdsa-verify
make run-bls-verify
run-merklize:
@echo "Running Merkle benchmark..."
cd ${merkle-rust}/native; cargo run --release -- --execute > cycles.txt
cd ${merkle-rust}/native_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${merkle-rust}/wasm; wasm-pack build
cd ${merkle-rust}/wasm_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${merkle-rust}/wasm_risc_zero/; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${merkle-rust}/native_risc_zero; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${merkle-rust}/delphinus; make build && ./test.sh > cycles.txt
run-nth-prime:
@echo "Running nth-prime benchmark..."
cd ${nth-prime-rust}/native; cargo run --release -- --execute > cycles.txt
cd ${nth-prime-rust}/native_jolt; cargo run --release > cycles.txt
cd ${nth-prime-rust}/native_risc_zero; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${nth-prime-rust}/native_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${nth-prime-rust}/wasm; wasm-pack build
cd ${nth-prime-rust}/wasm_jolt; cargo run --release > cycles.txt
cd ${nth-prime-rust}/wasm_risc_zero/; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${nth-prime-rust}/wasm_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${nth-prime-rust}/native_powdr; cargo run -r &> cycles.txt
run-keccak:
@echo "Running keccak benchmark..."
cd ${keccak-rust}/native; cargo run --release -- --execute > cycles.txt
cd ${keccak-rust}/native_jolt; cargo run --release > cycles.txt
cd ${keccak-rust}/native_risc_zero; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${keccak-rust}/native_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${keccak-rust}/wasm; wasm-pack build
cd ${keccak-rust}/wasm_jolt; cargo run --release > cycles.txt
cd ${keccak-rust}/wasm_risc_zero/; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${keccak-rust}/wasm_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${keccak-rust}/native_powdr; cargo run -r &> cycles.txt
run-merkle-proof:
@echo "Running Merkle Proof Generation benchmark..."
cd ${merkle-proof-rust}/native; cargo run --release -- --execute > cycles.txt
cd ${merkle-proof-rust}/native_jolt; cargo run --release > cycles.txt
cd ${merkle-proof-rust}/native_risc_zero; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${merkle-proof-rust}/native_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${merkle-proof-rust}/wasm; wasm-pack build
cd ${merkle-proof-rust}/wasm_jolt; cargo run --release > cycles.txt
cd ${merkle-proof-rust}/wasm_risc_zero/; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${merkle-proof-rust}/wasm_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${merkle-proof-rust}/native_powdr; cargo run -r &> cycles.txt
run-poseidon:
@echo "Running Poseidon Hash benchmark..."
cd ${poseidon-rust}/native; cargo run --release -- --execute > cycles.txt
cd ${poseidon-rust}/native_jolt; cargo run --release > cycles.txt
cd ${poseidon-rust}/native_risc_zero; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${poseidon-rust}/native_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${poseidon-rust}/wasm; wasm-pack build
cd ${poseidon-rust}/wasm_jolt; cargo run --release > cycles.txt
cd ${poseidon-rust}/wasm_risc_zero/; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${poseidon-rust}/wasm_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${poseidon-rust}/native_powdr; cargo run -r &> cycles.txt
run-bls-aggregate:
@echo "Running BLS aggregate benchmark..."
cd ${bls-agg-rust}/native; cargo run --release -- --execute > cycles.txt
cd ${bls-agg-rust}/native_sp1/script; cargo run --release -- --execute > cycles.txt
cd $(bls-agg-rust)/native_sp1/script; SP1_PROVER=network SP1_PRIVATE_KEY=${SP1_PRIVATE_KEY} RUST_LOG=info cargo run --release -- --prove &> prove.log
cd ${bls-agg-rust}/wasm; wasm-pack build
cd ${bls-agg-rust}/wasm_sp1/script; cargo run --release -- --execute > cycles.txt
cd ${bls-agg-rust}/wasm_risc_zero/; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${bls-agg-rust}/native_risc_zero; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${bls-agg-rust}/native_risc_zero; (time BONSAI_API_KEY=${BONSAI_API_KEY} BONSAI_API_URL=${BONSAI_API_URL} RUST_LOG="[executor]=info" RISC0_DEV_MODE=0 cargo run --release) &> prove.log
cd ${bls-agg-rust}/native_powdr; cargo run -r &> cycles.txt
run-ecdsa-verify:
@echo "Running ECDSA Verify benchmark..."
cd ${ecdsa-verify-rust}/native; cargo run --release -- --execute > cycles.txt
cd ${ecdsa-verify-rust}/native_jolt; cargo run --release > cycles.txt
cd ${ecdsa-verify-rust}/native_risc_zero; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${ecdsa-verify-rust}/native_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${ecdsa-verify-rust}/wasm; wasm-pack build
cd ${ecdsa-verify-rust}/wasm_jolt; cargo run --release > cycles.txt
cd ${ecdsa-verify-rust}/wasm_risc_zero/; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run &> cycles.txt
cd ${ecdsa-verify-rust}/wasm_sp1/script; SP1_PROVER=network cargo run --release > cycles.txt
cd ${ecdsa-verify-rust}/native_powdr; cargo run -r &> cycles.txt
run-bls-verify:
@echo "Running BLS verify benchmark..."
cd ${bls-verify-rust}/native; cargo run --release -- --execute > cycles.txt
cd ${bls-verify-rust}/native_sp1/script; cargo run --release -- --execute > cycles.txt
cd ${bls-verify-rust}/native_sp1/script;SP1_PROVER=network SP1_PRIVATE_KEY=${SP1_PRIVATE_KEY} RUST_LOG=info cargo run --release -- --prove > prove.log
cd ${bls-verify-rust}/wasm; wasm-pack build
cd ${bls-verify-rust}/wasm_sp1/script; cargo run --release -- --execute > cycles.txt
cd ${bls-verify-rust}/wasm_sp1/script;SP1_PROVER=network SP1_PRIVATE_KEY=${SP1_PRIVATE_KEY} RUST_LOG=info cargo run --release -- --prove > prove.log
cd ${bls-verify-rust}/native_risc_zero; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run --release &> cycles.txt
cd ${bls-verify-rust}/native_risc_zero; (time BONSAI_API_KEY=${BONSAI_API_KEY} BONSAI_API_URL=${BONSAI_API_URL} RUST_LOG="[executor]=info" RISC0_DEV_MODE=0 cargo run --release) &> prove.log
cd ${bls-verify-rust}/wasm_risc_zero/; RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run --release &> cycles.txt
cd ${bls-verify-rust}/native_powdr; cargo run -r &> cycles.txt