Skip to content

Commit 1193400

Browse files
NicolasRampoldijotabulaciostaturosati
authored
feat: add infinite sp1 for testnet (#270)
Co-authored-by: jotabulacios <jbulacios@fi.uba.ar> Co-authored-by: Tatu <65305492+srosati@users.noreply.github.com>
1 parent 426b987 commit 1193400

4 files changed

Lines changed: 52 additions & 0 deletions

File tree

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ batcher_send_sp1_burst_5:
160160
--repetitions 5 \
161161
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657
162162

163+
batcher_send_infinite_sp1:
164+
@echo "Sending infinite SP1 fibonacci task to Batcher..."
165+
@./batcher/client/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh
166+
163167
batcher_send_plonk_bn254_task: batcher/client/target/release/batcher-client
164168
@echo "Sending Groth16Bn254 1!=0 task to Batcher..."
165169
@cd batcher/client/ && cargo run --release -- \
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os
2+
from eth_account import Account
3+
from eth_utils import to_checksum_address
4+
5+
def generate_random_address():
6+
# Generate a random private key
7+
private_key = os.urandom(32)
8+
# Derive the public key and address
9+
account = Account.from_key(private_key)
10+
# Get the checksummed address
11+
checksummed_address = to_checksum_address(account.address)
12+
return checksummed_address
13+
14+
if __name__ == "__main__":
15+
print(generate_random_address())
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
web3==6.19.0
2+
eth-utils==4.1.1
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
counter=1
4+
timer=3
5+
if [ -z "$1" ]; then
6+
echo "Using default timer value: 3 seconds"
7+
elif ! [[ "$1" =~ ^[0-9]+$ ]]; then
8+
echo "Error: Argument must be a number."
9+
exit 1
10+
else
11+
timer=$1
12+
echo "Using timer value: $timer seconds"
13+
fi
14+
15+
cd ./batcher/client
16+
17+
while true
18+
do
19+
echo "Generating proof $counter"
20+
random_addr=$(python3 ./send_infinite_sp1_tasks/generate_address.py)
21+
echo "Random address: $random_addr"
22+
23+
batcher-client \
24+
--proving_system SP1 \
25+
--proof test_files/sp1/sp1_fibonacci.proof \
26+
--vm_program test_files/sp1/sp1_fibonacci-elf \
27+
--proof_generator_addr "$random_addr"
28+
29+
sleep "$timer"
30+
counter=$((counter + 1))
31+
done

0 commit comments

Comments
 (0)