Skip to content

Commit

Permalink
Merge branch 'refs/heads/998-refactortracker-rewrite-operator_tracker…
Browse files Browse the repository at this point in the history
…-in-elixir' into 1075-feattelemetry-implement-telemetry-for-aggregator
  • Loading branch information
JuArce committed Oct 1, 2024
2 parents 2b6d382 + b99b9bf commit 335a448
Show file tree
Hide file tree
Showing 76 changed files with 8,878 additions and 3,675 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
run: make build_halo2_ipa_linux
- name: Build Merkle Tree bindings
run: make build_merkle_tree_linux
- name: Build Old Merkle Tree bindings
run: make build_merkle_tree_linux_old
- name: Build operator
run: go build operator/cmd/main.go
- name: Build aggregator
Expand Down
67 changes: 48 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ OS := $(shell uname -s)
CONFIG_FILE?=config-files/config.yaml
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml

OPERATOR_VERSION=v0.5.2
OPERATOR_VERSION=v0.7.3

ifeq ($(OS),Linux)
BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux
Expand Down Expand Up @@ -112,7 +112,7 @@ operator_register_and_start: operator_full_registration operator_start

build_operator: deps
@echo "Building Operator..."
@go build -ldflags "-X main.Version=$(OPERATOR_VERSION)" -o ./operator/build/aligned-operator ./operator/cmd/main.go
@go build -ldflags "-X main.Version=$(OPERATOR_VERSION) -r $(LD_LIBRARY_PATH):$(CURDIR)/operator/risc_zero/lib" -o ./operator/build/aligned-operator ./operator/cmd/main.go
@echo "Operator built into /operator/build/aligned-operator"

update_operator:
Expand Down Expand Up @@ -159,6 +159,12 @@ operator_whitelist_devnet:
@echo "Operator address: $(OPERATOR_ADDRESS)"
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/whitelist_operator.sh $(OPERATOR_ADDRESS)

operator_remove_devnet:
@echo "Removing operator"
$(eval OPERATOR_ADDRESS = $(shell yq -r '.operator.address' $(CONFIG_FILE)))
@echo "Operator address: $(OPERATOR_ADDRESS)"
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/remove_operator.sh $(OPERATOR_ADDRESS)

operator_whitelist:
@echo "Whitelisting operator $(OPERATOR_ADDRESS)"
@. contracts/scripts/.env && . contracts/scripts/whitelist_operator.sh $(OPERATOR_ADDRESS)
Expand Down Expand Up @@ -226,7 +232,7 @@ batcher/target/release/aligned:


RPC_URL=http://localhost:8545
BATCHER_PAYMENTS_CONTRACT_ADDRESS=0x7969c5eD335650692Bc04293B07F5BF2e7A673C0
NETWORK=devnet # devnet | holesky-stage | holesky

batcher_send_sp1_task:
@echo "Sending SP1 fibonacci task to Batcher..."
Expand All @@ -236,7 +242,7 @@ batcher_send_sp1_task:
--vm_program ../../scripts/test_files/sp1/sp1_fibonacci.elf \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_sp1_burst:
@echo "Sending SP1 fibonacci task to Batcher..."
Expand All @@ -247,7 +253,7 @@ batcher_send_sp1_burst:
--repetitions $(BURST_SIZE) \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_infinite_sp1:
@echo "Sending infinite SP1 fibonacci task to Batcher..."
Expand All @@ -262,7 +268,7 @@ batcher_send_risc0_task:
--public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci.pub \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_risc0_burst:
@echo "Sending Risc0 fibonacci task to Batcher..."
Expand All @@ -274,7 +280,7 @@ batcher_send_risc0_burst:
--repetitions $(BURST_SIZE) \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_plonk_bn254_task: batcher/target/release/aligned
@echo "Sending Groth16Bn254 1!=0 task to Batcher..."
Expand All @@ -285,7 +291,7 @@ batcher_send_plonk_bn254_task: batcher/target/release/aligned
--vk ../../scripts/test_files/gnark_plonk_bn254_script/plonk.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_plonk_bn254_burst: batcher/target/release/aligned
@echo "Sending Groth16Bn254 1!=0 task to Batcher..."
Expand All @@ -297,7 +303,7 @@ batcher_send_plonk_bn254_burst: batcher/target/release/aligned
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--repetitions 4 \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_plonk_bls12_381_task: batcher/target/release/aligned
@echo "Sending Groth16 BLS12-381 1!=0 task to Batcher..."
Expand All @@ -308,7 +314,7 @@ batcher_send_plonk_bls12_381_task: batcher/target/release/aligned
--vk ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_plonk_bls12_381_burst: batcher/target/release/aligned
@echo "Sending Groth16 BLS12-381 1!=0 task to Batcher..."
Expand All @@ -320,8 +326,7 @@ batcher_send_plonk_bls12_381_burst: batcher/target/release/aligned
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--repetitions 15 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)

--network $(NETWORK)

batcher_send_groth16_bn254_task: batcher/target/release/aligned
@echo "Sending Groth16Bn254 1!=0 task to Batcher..."
Expand All @@ -332,7 +337,7 @@ batcher_send_groth16_bn254_task: batcher/target/release/aligned
--vk ../../scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_1_groth16.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_infinite_groth16: batcher/target/release/aligned ## Send a different Groth16 BN254 proof using the client every 3 seconds
@mkdir -p scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs
Expand All @@ -352,7 +357,7 @@ batcher_send_halo2_ipa_task: batcher/target/release/aligned
--public_input ../../scripts/test_files/halo2_ipa/pub_input.bin \
--vk ../../scripts/test_files/halo2_ipa/params.bin \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_halo2_ipa_task_burst_5: batcher/target/release/aligned
@echo "Sending Halo2 IPA 1!=0 task to Batcher..."
Expand All @@ -363,7 +368,7 @@ batcher_send_halo2_ipa_task_burst_5: batcher/target/release/aligned
--vk ../../scripts/test_files/halo2_ipa/params.bin \
--repetitions 5 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_halo2_kzg_task: batcher/target/release/aligned
@echo "Sending Halo2 KZG 1!=0 task to Batcher..."
Expand All @@ -374,7 +379,7 @@ batcher_send_halo2_kzg_task: batcher/target/release/aligned
--vk ../../scripts/test_files/halo2_kzg/params.bin \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_halo2_kzg_task_burst_5: batcher/target/release/aligned
@echo "Sending Halo2 KZG 1!=0 task to Batcher..."
Expand All @@ -386,7 +391,7 @@ batcher_send_halo2_kzg_task_burst_5: batcher/target/release/aligned
--repetitions 5 \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

__GENERATE_PROOFS__:
# TODO add a default proving system
Expand Down Expand Up @@ -467,9 +472,9 @@ build_aligned_contracts:

show_aligned_error_codes:
@echo "\nAlignedLayerServiceManager errors:"
@cd contracts/src/core && forge inspect IAlignedLayerServiceManager.sol:IAlignedLayerServiceManager errors
@cd contracts && forge inspect src/core/IAlignedLayerServiceManager.sol:IAlignedLayerServiceManager errors
@echo "\nBatcherPaymentService errors:"
@cd contracts/src/core && forge inspect BatcherPaymentService.sol:BatcherPaymentService errors
@cd contracts && forge inspect src/core/BatcherPaymentService.sol:BatcherPaymentService errors

__BUILD__:
build_binaries:
Expand Down Expand Up @@ -541,15 +546,29 @@ build_merkle_tree_macos:
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.dylib operator/merkle_tree/lib/libmerkle_tree.dylib
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree/lib/libmerkle_tree.a

build_merkle_tree_macos_old:
@cd operator/merkle_tree_old/lib && cargo build $(RELEASE_FLAG)
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.dylib operator/merkle_tree_old/lib/libmerkle_tree.dylib
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree_old/lib/libmerkle_tree.a

build_merkle_tree_linux:
@cd operator/merkle_tree/lib && cargo build $(RELEASE_FLAG)
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.so operator/merkle_tree/lib/libmerkle_tree.so
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree/lib/libmerkle_tree.a

build_merkle_tree_linux_old:
@cd operator/merkle_tree_old/lib && cargo build $(RELEASE_FLAG)
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.so operator/merkle_tree_old/lib/libmerkle_tree.so
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree_old/lib/libmerkle_tree.a

test_merkle_tree_rust_ffi:
@echo "Testing Merkle Tree Rust FFI source code..."
@cd operator/merkle_tree/lib && RUST_MIN_STACK=83886080 cargo t --release

test_merkle_tree_rust_ffi_old:
@echo "Testing Old Merkle Tree Rust FFI source code..."
@cd operator/merkle_tree_old/lib && RUST_MIN_STACK=83886080 cargo t --release

test_merkle_tree_go_bindings_macos: build_merkle_tree_macos
@echo "Testing Merkle Tree Go bindings..."
go test ./operator/merkle_tree/... -v
Expand All @@ -558,6 +577,14 @@ test_merkle_tree_go_bindings_linux: build_merkle_tree_linux
@echo "Testing Merkle Tree Go bindings..."
go test ./operator/merkle_tree/... -v

test_merkle_tree_old_go_bindings_macos: build_merkle_tree_macos_old
@echo "Testing Old Merkle Tree Go bindings..."
go test ./operator/merkle_tree_old/... -v

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)
Expand Down Expand Up @@ -632,6 +659,7 @@ build_all_ffi_macos: ## Build all FFIs for macOS
@$(MAKE) build_sp1_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."
Expand All @@ -641,6 +669,7 @@ build_all_ffi_linux: ## Build all FFIs for Linux
@$(MAKE) build_sp1_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
5 changes: 1 addition & 4 deletions aggregator/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ func aggregatorMain(ctx *cli.Context) error {
}()

err = aggregator.Start(context.Background())
if err != nil {
return err
}

return nil
return err
}
5 changes: 1 addition & 4 deletions aggregator/internal/pkg/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ func (agg *Aggregator) ServeOperators() error {
agg.AggregatorConfig.Aggregator.ServerIpPortAddress)

err = http.ListenAndServe(agg.AggregatorConfig.Aggregator.ServerIpPortAddress, nil)
if err != nil {
return err
}

return nil
return err
}

// Aggregator Methods
Expand Down
2 changes: 1 addition & 1 deletion aggregator/internal/pkg/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (agg *Aggregator) SubscribeToNewTasks() error {
func (agg *Aggregator) subscribeToNewTasks() error {
var err error

agg.taskSubscriber, err = agg.avsSubscriber.SubscribeToNewTasks(agg.NewBatchChan)
agg.taskSubscriber, err = agg.avsSubscriber.SubscribeToNewTasksV3(agg.NewBatchChan)

if err != nil {
agg.AggregatorConfig.BaseConfig.Logger.Info("Failed to create task subscriber", "err", err)
Expand Down
Loading

0 comments on commit 335a448

Please sign in to comment.