Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions .github/workflows/build-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,28 @@ on:
pull_request:
branches: ["*"]
paths:
- 'operator/**'
- 'aggregator/**'
- 'common/**'
- 'core/**'
- 'metrics/**'
- '.github/workflows/build-go.yml'
- "operator/**"
- "aggregator/**"
- "common/**"
- "core/**"
- "metrics/**"
- ".github/workflows/build-go.yml"
env:
FFI_FOR_RELEASE: false
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: "1.22"
cache: false
- name: Build SP1 bindings
run: make build_sp1_linux
- name: Build Risc Zero go bindings
run: make build_risc_zero_linux
- name: Build Halo2-KZG bindings
run: make build_halo2_kzg_linux
- name: Build Halo2-IPA bindings
run: make build_halo2_ipa_linux
- name: Build Merkle Tree bindings
run: make build_merkle_tree_linux
- name: Build Old Merkle Tree bindings
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/test-halo2-ipa.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/test-halo2-kzg.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ batcher/aligned/batch_inclusion_responses/*
**/aligned_verification_data
**/broadcast
volume
config-files/*.last_processed_batch.json

nonce_*.bin
165 changes: 54 additions & 111 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,18 @@ batcher/target/release/aligned:
RPC_URL=http://localhost:8545
NETWORK=devnet # devnet | holesky-stage | holesky

# Infinite stream of burst of 10 proofs
batcher_send_infinite_burst:
@cd batcher/aligned-task-sender && cargo run --release

# Infinite stream of one proofs
batcher_send_infinite_stream:
@cd batcher/aligned-task-sender && cargo run --release -- --burst-size 1

# Infinite connections
batcher_connections:
@cd batcher/aligned-task-sender && cargo run --release -- --num-senders $(NUM_SENDERS) --burst-size 0

batcher_send_sp1_task:
@echo "Sending SP1 fibonacci task to Batcher..."
@cd batcher/aligned/ && cargo run --release -- submit \
Expand Down Expand Up @@ -365,50 +377,6 @@ batcher_send_burst_groth16: batcher/target/release/aligned
@mkdir -p scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs
@./batcher/aligned/send_burst_tasks.sh $(BURST_SIZE) $(START_COUNTER)

batcher_send_halo2_ipa_task: batcher/target/release/aligned
@echo "Sending Halo2 IPA 1!=0 task to Batcher..."
@cd batcher/aligned/ && cargo run --release -- submit \
--proving_system Halo2IPA \
--proof ../../scripts/test_files/halo2_ipa/proof.bin \
--public_input ../../scripts/test_files/halo2_ipa/pub_input.bin \
--vk ../../scripts/test_files/halo2_ipa/params.bin \
--rpc_url $(RPC_URL) \
--network $(NETWORK)

batcher_send_halo2_ipa_task_burst_5: batcher/target/release/aligned
@echo "Sending Halo2 IPA 1!=0 task to Batcher..."
@cd batcher/aligned/ && cargo run --release -- submit \
--proving_system Halo2IPA \
--proof ../../scripts/test_files/halo2_ipa/proof.bin \
--public_input ../../scripts/test_files/halo2_ipa/pub_input.bin \
--vk ../../scripts/test_files/halo2_ipa/params.bin \
--repetitions 5 \
--rpc_url $(RPC_URL) \
--network $(NETWORK)

batcher_send_halo2_kzg_task: batcher/target/release/aligned
@echo "Sending Halo2 KZG 1!=0 task to Batcher..."
@cd batcher/aligned/ && cargo run --release -- submit \
--proving_system Halo2KZG \
--proof ../../scripts/test_files/halo2_kzg/proof.bin \
--public_input ../../scripts/test_files/halo2_kzg/pub_input.bin \
--vk ../../scripts/test_files/halo2_kzg/params.bin \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--network $(NETWORK)

batcher_send_halo2_kzg_task_burst_5: batcher/target/release/aligned
@echo "Sending Halo2 KZG 1!=0 task to Batcher..."
@cd batcher/aligned/ && cargo run --release -- submit \
--proving_system Halo2KZG \
--proof ../../scripts/test_files/halo2_kzg/proof.bin \
--public_input ../../scripts/test_files/halo2_kzg/pub_input.bin \
--vk ../../scripts/test_files/halo2_kzg/params.bin \
--repetitions 5 \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--network $(NETWORK)

__GENERATE_PROOFS__:
# TODO add a default proving system

Expand Down Expand Up @@ -601,69 +569,6 @@ test_merkle_tree_go_bindings_linux_old: build_merkle_tree_linux_old
@echo "Testing Merkle Tree Go bindings..."
go test ./operator/merkle_tree_old/... -v

__HALO2_KZG_FFI__: ##
build_halo2_kzg_macos:
@cd operator/halo2kzg/lib && cargo build $(RELEASE_FLAG)
@cp operator/halo2kzg/lib/target/$(TARGET_REL_PATH)/libhalo2kzg_verifier_ffi.dylib operator/halo2kzg/lib/libhalo2kzg_verifier.dylib
@cp operator/halo2kzg/lib/target/$(TARGET_REL_PATH)/libhalo2kzg_verifier_ffi.a operator/halo2kzg/lib/libhalo2kzg_verifier.a

build_halo2_kzg_linux:
@cd operator/halo2kzg/lib && cargo build $(RELEASE_FLAG)
@cp operator/halo2kzg/lib/target/$(TARGET_REL_PATH)/libhalo2kzg_verifier_ffi.so operator/halo2kzg/lib/libhalo2kzg_verifier.so
@cp operator/halo2kzg/lib/target/$(TARGET_REL_PATH)/libhalo2kzg_verifier_ffi.a operator/halo2kzg/lib/libhalo2kzg_verifier.a

test_halo2_kzg_rust_ffi:
@echo "Testing Halo2-KZG Rust FFI source code..."
@cd operator/halo2kzg/lib && cargo t --release

test_halo2_kzg_go_bindings_macos: build_halo2_kzg_macos
@echo "Testing Halo2-KZG Go bindings..."
go test ./operator/halo2kzg/... -v

test_halo2_kzg_go_bindings_linux: build_halo2_kzg_linux
@echo "Testing Halo2-KZG Go bindings..."
go test ./operator/halo2kzg/... -v

generate_halo2_kzg_proof:
@cd scripts/test_files/halo2_kzg && \
cargo clean && \
rm -f params.bin proof.bin pub_input.bin && \
RUST_LOG=info cargo run --release && \
echo "Generating halo2 plonk proof..." && \
echo "Generated halo2 plonk proof!"

__HALO2_IPA_FFI__: ##
build_halo2_ipa_macos:
@cd operator/halo2ipa/lib && cargo build $(RELEASE_FLAG)
@cp operator/halo2ipa/lib/target/$(TARGET_REL_PATH)/libhalo2ipa_verifier_ffi.dylib operator/halo2ipa/lib/libhalo2ipa_verifier.dylib
@cp operator/halo2ipa/lib/target/$(TARGET_REL_PATH)/libhalo2ipa_verifier_ffi.a operator/halo2ipa/lib/libhalo2ipa_verifier.a

build_halo2_ipa_linux:
@cd operator/halo2ipa/lib && cargo build $(RELEASE_FLAG)
@cp operator/halo2ipa/lib/target/$(TARGET_REL_PATH)/libhalo2ipa_verifier_ffi.so operator/halo2ipa/lib/libhalo2ipa_verifier.so
@cp operator/halo2ipa/lib/target/$(TARGET_REL_PATH)/libhalo2ipa_verifier_ffi.a operator/halo2ipa/lib/libhalo2ipa_verifier.a

test_halo2_ipa_rust_ffi:
@echo "Testing Halo2-KZG Rust FFI source code..."
@cd operator/halo2ipa/lib && cargo t --release

test_halo2_ipa_go_bindings_macos: build_halo2_ipa_macos
@echo "Testing Halo2-KZG Go bindings..."
go test ./operator/halo2ipa/... -v

test_halo2_ipa_go_bindings_linux: build_halo2_ipa_linux
@echo "Testing Halo2-KZG Go bindings..."
go test ./operator/halo2ipa/... -v

generate_halo2_ipa_proof:
@cd scripts/test_files/halo2_ipa && \
cargo clean && \
rm -f params.bin proof.bin pub_input.bin && \
RUST_LOG=info cargo run --release && \
echo "Generating halo2 plonk proof..." && \
echo "Generated halo2 plonk proof!"


__BUILD_ALL_FFI__:

build_all_ffi: ## Build all FFIs
Expand All @@ -676,8 +581,6 @@ build_all_ffi_macos: ## Build all FFIs for macOS
@$(MAKE) build_risc_zero_macos
@$(MAKE) build_merkle_tree_macos
@$(MAKE) build_merkle_tree_macos_old
@$(MAKE) build_halo2_ipa_macos
@$(MAKE) build_halo2_kzg_macos
@echo "All macOS FFIs built successfully."

build_all_ffi_linux: ## Build all FFIs for Linux
Expand All @@ -686,8 +589,6 @@ build_all_ffi_linux: ## Build all FFIs for Linux
@$(MAKE) build_risc_zero_linux
@$(MAKE) build_merkle_tree_linux
@$(MAKE) build_merkle_tree_linux_old
@$(MAKE) build_halo2_ipa_linux
@$(MAKE) build_halo2_kzg_linux
@echo "All Linux FFIs built successfully."


Expand Down Expand Up @@ -739,6 +640,10 @@ explorer_fetch_old_operators_strategies_restakes:
@cd explorer && \
./scripts/fetch_old_operators_strategies_restakes.sh 0

explorer_create_env:
@cd explorer && \
cp .env.dev .env

__TRACKER__:

tracker_devnet_start: tracker_run_db
Expand Down Expand Up @@ -767,3 +672,41 @@ tracker_dump_db:
@cd operator_tracker && \
docker exec -t tracker-postgres-container pg_dumpall -c -U tracker_user > dump.$$(date +\%Y\%m\%d_\%H\%M\%S).sql
@echo "Dumped database successfully to /operator_tracker"

__TELEMETRY__:
open_telemetry_start: ## Run open telemetry services using telemetry-docker-compose.yaml
## TODO(juarce) ADD DOCKER COMPOSE
@echo "Running telemetry..."
@docker compose -f telemetry-docker-compose.yaml up -d

telemetry_start: telemetry_run_db telemetry_ecto_migrate ## Run Telemetry API
@cd telemetry_api && \
./start.sh

telemetry_ecto_migrate: ##
@cd telemetry_api && \
./ecto_setup_db.sh

telemetry_build_db:
@cd telemetry_api && \
docker build -t telemetry-postgres-image .

telemetry_run_db: telemetry_build_db telemetry_remove_db_container
@cd telemetry_api && \
docker run -d --name telemetry-postgres-container -p 5434:5432 -v telemetry-postgres-data:/var/lib/postgresql/data telemetry-postgres-image

telemetry_remove_db_container:
@docker stop telemetry-postgres-container || true && \
docker rm telemetry-postgres-container || true

telemetry_clean_db: telemetry_remove_db_container
@docker volume rm telemetry-postgres-data || true

telemetry_dump_db:
@cd telemetry_api && \
docker exec -t telemetry-postgres-container pg_dumpall -c -U telemetry_user > dump.$$(date +\%Y\%m\%d_\%H\%M\%S).sql
@echo "Dumped database successfully to /telemetry_api"

telemetry_create_env:
@cd telemetry_api && \
cp .env.dev .env
Loading