Skip to content

Commit 239cae0

Browse files
committed
Merge branch 'staging' into mina
2 parents d7bc504 + 403b363 commit 239cae0

File tree

178 files changed

+9925
-6108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+9925
-6108
lines changed

.github/pull_request_template.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# TITLE
2+
3+
## Description
4+
5+
Description of the pull request changes and motivation.
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] New feature
12+
- [ ] Bug fix
13+
- [ ] Optimization
14+
- [ ] Refactor
15+
16+
## Checklist
17+
- [ ] Linked to Github Issue
18+
- [ ] This change depends on code or research by an external entity
19+
- [ ] Acknowledgements were updated to give credit
20+
- [ ] Unit tests added
21+
- [ ] This change requires new documentation.
22+
- [ ] Documentation has been added/updated.
23+
- [ ] This change is an Optimization
24+
- [ ] Benchmarks added/run
25+
- [ ] Has a known issue
26+
- [Link to the open issue addressing it]()
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ jobs:
3535
run: make build_mina_linux
3636
- name: Build Mina Account bindings
3737
run: make build_mina_account_linux
38-
- name: Build Old Merkle Tree bindings
39-
run: make build_merkle_tree_linux_old
4038
- name: Build operator
4139
run: go build operator/cmd/main.go
4240
- name: Build aggregator
4341
run: go build aggregator/cmd/main.go
42+

.github/workflows/build-and-test-rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
cargo build --all
4848
4949
test:
50-
runs-on: ubuntu-latest
50+
runs-on: aligned-runner
5151
needs: build
5252
steps:
5353
- name: Checkout code

Makefile

Lines changed: 66 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ OS := $(shell uname -s)
66
CONFIG_FILE?=config-files/config.yaml
77
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml
88

9-
OPERATOR_VERSION=v0.8.0
9+
OPERATOR_VERSION=v0.10.0
1010

1111
ifeq ($(OS),Linux)
1212
BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux
@@ -17,7 +17,15 @@ ifeq ($(OS),Darwin)
1717
endif
1818

1919
ifeq ($(OS),Linux)
20-
export LD_LIBRARY_PATH := $(CURDIR)/operator/risc_zero/lib:$(CURDIR)/operator/mina/lib:$(CURDIR)/operator/mina_account/lib
20+
LD_LIBRARY_PATH += $(CURDIR)/operator/risc_zero/lib:$(CURDIR)/operator/mina/lib:$(CURDIR)/operator/mina_account/lib
21+
endif
22+
23+
ifeq ($(OS),Linux)
24+
BUILD_OPERATOR = $(MAKE) build_operator_linux
25+
endif
26+
27+
ifeq ($(OS),Darwin)
28+
BUILD_OPERATOR = $(MAKE) build_operator_macos
2129
endif
2230

2331

@@ -85,9 +93,9 @@ anvil_upgrade_add_aggregator:
8593
@echo "Adding Aggregator to Aligned Contracts..."
8694
. contracts/scripts/anvil/upgrade_add_aggregator_to_service_manager.sh
8795

88-
anvil_add_type_hash_to_batcher_payment_service:
89-
@echo "Adding Type Hash to Batcher Payment Service..."
90-
. contracts/scripts/anvil/upgrade_add_type_hash_to_batcher_payment_service.sh
96+
anvil_upgrade_initialize_disable_verifiers:
97+
@echo "Initializing disabled verifiers..."
98+
. contracts/scripts/anvil/upgrade_disabled_verifiers_in_service_manager.sh
9199

92100
lint_contracts:
93101
@cd contracts && npm run lint:sol
@@ -124,6 +132,14 @@ operator_full_registration: operator_get_eth operator_register_with_eigen_layer
124132
operator_register_and_start: operator_full_registration operator_start
125133

126134
build_operator: deps
135+
$(BUILD_OPERATOR)
136+
137+
build_operator_macos:
138+
@echo "Building Operator..."
139+
@go build -ldflags "-X main.Version=$(OPERATOR_VERSION)" -o ./operator/build/aligned-operator ./operator/cmd/main.go
140+
@echo "Operator built into /operator/build/aligned-operator"
141+
142+
build_operator_linux:
127143
@echo "Building Operator..."
128144
@go build -ldflags "-X main.Version=$(OPERATOR_VERSION) -r $(LD_LIBRARY_PATH)" -o ./operator/build/aligned-operator ./operator/cmd/main.go
129145
@echo "Operator built into /operator/build/aligned-operator"
@@ -218,6 +234,23 @@ operator_register_with_aligned_layer:
218234
operator_deposit_and_register: operator_deposit_into_strategy operator_register_with_aligned_layer
219235

220236

237+
# The verifier ID to enable or disable corresponds to the index of the verifier in the `ProvingSystemID` enum.
238+
verifier_enable_devnet:
239+
@echo "Enabling verifier with id: $(VERIFIER_ID)"
240+
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 RPC_URL=http://localhost:8545 OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/enable_verifier.sh $(VERIFIER_ID)
241+
242+
verifier_disable_devnet:
243+
@echo "Disabling verifier with id: $(VERIFIER_ID)"
244+
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 RPC_URL=http://localhost:8545 OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/disable_verifier.sh $(VERIFIER_ID)
245+
246+
verifier_enable:
247+
@echo "Enabling verifier with ID: $(VERIFIER_ID)"
248+
@. contracts/scripts/.env && . contracts/scripts/enable_verifier.sh $(VERIFIER_ID)
249+
250+
verifier_disable:
251+
@echo "Disabling verifier with ID: $(VERIFIER_ID)"
252+
@. contracts/scripts/.env && . contracts/scripts/disable_verifier.sh $(VERIFIER_ID)
253+
221254
__BATCHER__:
222255

223256
BURST_SIZE=5
@@ -295,6 +328,16 @@ batcher_send_risc0_task:
295328
--rpc_url $(RPC_URL) \
296329
--network $(NETWORK)
297330

331+
batcher_send_risc0_task_no_pub_input:
332+
@echo "Sending Risc0 fibonacci task to Batcher..."
333+
@cd batcher/aligned/ && cargo run --release -- submit \
334+
--proving_system Risc0 \
335+
--proof ../../scripts/test_files/risc_zero/no_public_inputs/risc_zero_no_pub_input.proof \
336+
--vm_program ../../scripts/test_files/risc_zero/no_public_inputs/no_pub_input_id.bin \
337+
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
338+
--rpc_url $(RPC_URL) \
339+
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
340+
298341
batcher_send_risc0_burst:
299342
@echo "Sending Risc0 fibonacci task to Batcher..."
300343
@cd batcher/aligned/ && cargo run --release -- submit \
@@ -436,6 +479,7 @@ generate_groth16_ineq_proof: ## Run the gnark_plonk_bn254_script
436479
@go run scripts/test_files/gnark_groth16_bn254_infinite_script/cmd/main.go 1
437480

438481
__METRICS__:
482+
# Prometheus and graphana
439483
run_metrics: ## Run metrics using metrics-docker-compose.yaml
440484
@echo "Running metrics..."
441485
@docker compose -f metrics-docker-compose.yaml up
@@ -474,9 +518,9 @@ upgrade_add_aggregator: ## Add Aggregator to Aligned Contracts
474518
@echo "Adding Aggregator to Aligned Contracts..."
475519
@. contracts/scripts/.env && . contracts/scripts/upgrade_add_aggregator_to_service_manager.sh
476520

477-
upgrade_batcher_payments_add_type_hash: ## Add Type Hash to Batcher Payment Service
478-
@echo "Adding Type Hash to Batcher Payment Service..."
479-
@. contracts/scripts/.env && . contracts/scripts/upgrade_add_type_hash_to_batcher_payment_service.sh
521+
upgrade_initialize_disabled_verifiers:
522+
@echo "Adding disabled verifiers to Aligned Service Manager..."
523+
@. contracts/scripts/.env && . contracts/scripts/upgrade_disabled_verifiers_in_service_manager.sh
480524

481525
deploy_verify_batch_inclusion_caller:
482526
@echo "Deploying VerifyBatchInclusionCaller contract..."
@@ -536,6 +580,11 @@ generate_sp1_fibonacci_proof:
536580
@mv scripts/test_files/sp1/fibonacci_proof_generator/script/sp1_fibonacci.proof scripts/test_files/sp1/
537581
@echo "Fibonacci proof and ELF generated in scripts/test_files/sp1 folder"
538582

583+
generate_risc_zero_empty_journal_proof:
584+
@cd scripts/test_files/risc_zero/no_public_inputs && RUST_LOG=info cargo run --release
585+
@echo "Fibonacci proof and ELF with empty journal generated in scripts/test_files/risc_zero/no_public_inputs folder"
586+
587+
539588
__RISC_ZERO_FFI__: ##
540589
build_risc_zero_macos:
541590
@cd operator/risc_zero/lib && cargo build $(RELEASE_FLAG)
@@ -568,29 +617,15 @@ build_merkle_tree_macos:
568617
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.dylib operator/merkle_tree/lib/libmerkle_tree.dylib
569618
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree/lib/libmerkle_tree.a
570619

571-
build_merkle_tree_macos_old:
572-
@cd operator/merkle_tree_old/lib && cargo build $(RELEASE_FLAG)
573-
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.dylib operator/merkle_tree_old/lib/libmerkle_tree.dylib
574-
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree_old/lib/libmerkle_tree.a
575-
576620
build_merkle_tree_linux:
577621
@cd operator/merkle_tree/lib && cargo build $(RELEASE_FLAG)
578622
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.so operator/merkle_tree/lib/libmerkle_tree.so
579623
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree/lib/libmerkle_tree.a
580624

581-
build_merkle_tree_linux_old:
582-
@cd operator/merkle_tree_old/lib && cargo build $(RELEASE_FLAG)
583-
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.so operator/merkle_tree_old/lib/libmerkle_tree.so
584-
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree_old/lib/libmerkle_tree.a
585-
586625
test_merkle_tree_rust_ffi:
587626
@echo "Testing Merkle Tree Rust FFI source code..."
588627
@cd operator/merkle_tree/lib && RUST_MIN_STACK=83886080 cargo t --release
589628

590-
test_merkle_tree_rust_ffi_old:
591-
@echo "Testing Old Merkle Tree Rust FFI source code..."
592-
@cd operator/merkle_tree_old/lib && RUST_MIN_STACK=83886080 cargo t --release
593-
594629
test_merkle_tree_go_bindings_macos: build_merkle_tree_macos
595630
@echo "Testing Merkle Tree Go bindings..."
596631
go test ./operator/merkle_tree/... -v
@@ -603,9 +638,6 @@ test_merkle_tree_old_go_bindings_macos: build_merkle_tree_macos_old
603638
@echo "Testing Old Merkle Tree Go bindings..."
604639
go test ./operator/merkle_tree_old/... -v
605640

606-
test_merkle_tree_go_bindings_linux_old: build_merkle_tree_linux_old
607-
@echo "Testing Merkle Tree Go bindings..."
608-
go test ./operator/merkle_tree_old/... -v
609641

610642
__MINA_FFI__: ##
611643
build_mina_macos:
@@ -660,7 +692,6 @@ build_all_ffi_macos: ## Build all FFIs for macOS
660692
@$(MAKE) build_sp1_macos
661693
@$(MAKE) build_risc_zero_macos
662694
@$(MAKE) build_merkle_tree_macos
663-
@$(MAKE) build_merkle_tree_macos_old
664695
@$(MAKE) build_mina_macos
665696
@$(MAKE) build_mina_account_macos
666697
@echo "All macOS FFIs built successfully."
@@ -670,12 +701,10 @@ build_all_ffi_linux: ## Build all FFIs for Linux
670701
@$(MAKE) build_sp1_linux
671702
@$(MAKE) build_risc_zero_linux
672703
@$(MAKE) build_merkle_tree_linux
673-
@$(MAKE) build_merkle_tree_linux_old
674704
@$(MAKE) build_mina_linux
675705
@$(MAKE) build_mina_account_linux
676706
@echo "All Linux FFIs built successfully."
677707

678-
679708
__EXPLORER__:
680709
run_explorer: explorer_run_db explorer_ecto_setup_db
681710
@cd explorer/ && \
@@ -758,11 +787,19 @@ tracker_dump_db:
758787
@echo "Dumped database successfully to /operator_tracker"
759788

760789
__TELEMETRY__:
790+
# Collector, Jaeger and Elixir API
791+
telemetry_full_start: open_telemetry_start telemetry_start
792+
793+
# Collector and Jaeger
761794
open_telemetry_start: ## Run open telemetry services using telemetry-docker-compose.yaml
762-
## TODO(juarce) ADD DOCKER COMPOSE
763795
@echo "Running telemetry..."
764796
@docker compose -f telemetry-docker-compose.yaml up -d
765797

798+
open_telemetry_prod_start: ## Run open telemetry services with Cassandra using telemetry-prod-docker-compose.yaml
799+
@echo "Running telemetry for Prod..."
800+
@docker compose -f telemetry-prod-docker-compose.yaml up -d
801+
802+
# Elixir API
766803
telemetry_start: telemetry_run_db telemetry_ecto_migrate ## Run Telemetry API
767804
@cd telemetry_api && \
768805
./start.sh

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,19 @@
44
> To be used in testnet only.
55
66
To learn more about Aligned and how to use it, refer to the [docs page](https://docs.alignedlayer.com/) or [docs folder](./docs/).
7+
8+
# Acknowledgements
9+
10+
Aligned wouldn't be possible without the valuable work of these people:
11+
- [Ethereum](https://ethereum.org/en/), for being the network we all love
12+
- [EigenLayer](https://www.eigenlayer.xyz) for providing restaking and AVS
13+
- Shafi Goldwasser, Silvio Micali, and Charles Rackoff for [inventing ZK proofs](http://people.csail.mit.edu/silvio/Selected%20Scientific%20Papers/Proof%20Systems/The_Knowledge_Complexity_Of_Interactive_Proof_Systems.pdf)
14+
- Eli Ben-Sasson and [Starkware](https://starkware.co) for making them practical
15+
- [Consensys](https://consensys.io) for implementing the GROTH16 and PLONK protocols in [GNARK](https://docs.gnark.consensys.io)
16+
- [RiscZero](https://risczero.com) for its namesake [proving system](https://github.com/risc0/risc0)
17+
- [SuccintLabs](https://succinct.xyz) for creating [SP1](https://github.com/succinctlabs/sp1)
18+
- [Paradigm](https://www.paradigm.xyz) for maintaining the [Ethers crate](https://crates.io/crates/ethers) and [Foundry](https://github.com/foundry-rs/foundry)
19+
- [LambdaClass](https://lambdaclass.com) for writing [lambdaworks](https://github.com/lambdaclass/lambdaworks)
20+
21+
22+
If you believe we missed someone, contact us! We're always happy to give credit where it's due.

aggregator/cmd/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ func aggregatorMain(ctx *cli.Context) error {
4949
return err
5050
}
5151

52+
// Supervisor revives garbage collector
53+
go func() {
54+
for {
55+
log.Println("Starting Garbage collector")
56+
aggregator.ClearTasksFromMaps()
57+
log.Println("Garbage collector panicked, Supervisor restarting")
58+
}
59+
}()
60+
5261
// Listen for new task created in the ServiceManager contract in a separate goroutine, both V1 and V2 subscriptions:
5362
go func() {
5463
listenErr := aggregator.SubscribeToNewTasks()

0 commit comments

Comments
 (0)