-
Notifications
You must be signed in to change notification settings - Fork 390
Expand file tree
/
Copy pathMakefile
More file actions
1486 lines (1191 loc) · 69 KB
/
Makefile
File metadata and controls
1486 lines (1191 loc) · 69 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.PHONY: help tests
SHELL := /bin/bash
OS := $(shell uname -s)
NETWORK ?= devnet # devnet | holesky-stage | holesky
ifeq ($(NETWORK),holesky)
RPC_URL ?= https://ethereum-holesky-rpc.publicnode.com
BEACON_URL ?= https://eth-beacon-chain-holesky.drpc.org/rest/
else ifeq ($(NETWORK), holesky-stage)
RPC_URL ?= https://ethereum-holesky-rpc.publicnode.com
BEACON_URL ?= https://eth-beacon-chain-holesky.drpc.org/rest/
else
RPC_URL ?= http://localhost:8545
BEACON_URL ?= http://localhost:58801
endif
CONFIG_FILE?=config-files/config.yaml
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml
OPERATOR_VERSION=v0.20.0
EIGEN_SDK_GO_VERSION_DEVNET=v0.2.0-beta.1
EIGEN_SDK_GO_VERSION_TESTNET=v0.2.0-beta.1
EIGEN_SDK_GO_VERSION_MAINNET=v0.2.0-beta.1
ifeq ($(OS),Linux)
BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux
endif
ifeq ($(OS),Darwin)
BUILD_ALL_FFI = $(MAKE) build_all_ffi_macos
endif
ifeq ($(OS),Linux)
export LD_LIBRARY_PATH+=$(CURDIR)/operator/risc_zero/lib:$(CURDIR)/operator/sp1/lib
OPERATOR_FFIS=$(CURDIR)/operator/risc_zero/lib:$(CURDIR)/operator/sp1/lib
endif
ifeq ($(OS),Linux)
BUILD_OPERATOR = $(MAKE) operator_build_linux
endif
ifeq ($(OS),Darwin)
BUILD_OPERATOR = $(MAKE) operator_build_macos
endif
ifeq ($(ENVIRONMENT), devnet)
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_devnet
else ifeq ($(ENVIRONMENT), testnet)
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_testnet
else ifeq ($(ENVIRONMENT), mainnet)
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_mainnet
else
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_error
endif
FFI_FOR_RELEASE ?= true
ifeq ($(FFI_FOR_RELEASE),true)
RELEASE_FLAG=--release
TARGET_REL_PATH=release
else
RELEASE_FLAG=
TARGET_REL_PATH=debug
endif
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {if ($$1 ~ /^__/) printf "\033[33m%-50s\033[0m %s\n", $$1, $$2; else printf "\033[36m%-50s\033[0m %s\n", $$1, $$2}'
__DEPENDENCIES__: ## ____
submodules: ## Initialize and update git submodules
git submodule update --init --recursive
@echo "Updated submodules"
deps: submodules go_deps build_all_ffi ## Install deps
go_deps:
@echo "Installing Go dependencies..."
go install github.com/maoueh/zap-pretty@v0.3.0
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.14.0
go install github.com/Layr-Labs/eigenlayer-cli/cmd/eigenlayer@v0.13.0
foundry_install:
curl -L https://foundry.paradigm.xyz | bash
eigenlayer_cli_install: ## Install Eigenlayer CLI v0.13.0
curl -sSfL https://raw.githubusercontent.com/layr-labs/eigenlayer-cli/master/scripts/install.sh | sh -s -- v0.13.0
__UTILS__: ## ____
bindings: ## Generate Go bindings for contracts
cd contracts && ./generate-go-bindings.sh
lint_contracts: ## Lint Solidity contracts
@cd contracts && npm run lint:sol
build_aligned_contracts: ## Build AlignedLayer contracts
@cd contracts/src/core && forge build --via-ir
show_aligned_error_codes: ## Show AlignedLayer error codes
@echo "\nAlignedLayerServiceManager errors:"
@cd contracts && forge inspect src/core/IAlignedLayerServiceManager.sol:IAlignedLayerServiceManager errors
@echo "\nBatcherPaymentService errors:"
@cd contracts && forge inspect src/core/BatcherPaymentService.sol:BatcherPaymentService errors
__CONTRACTS_DEPLOYMENT_ANVIL__: ## ____
anvil_deploy_all_contracts: anvil_deploy_eigen_contracts anvil_deploy_risc0_contracts anvil_deploy_sp1_contracts anvil_deploy_aligned_contracts
anvil_deploy_eigen_contracts: ## Deploy EigenLayer Contracts on ANVIL
@echo "Deploying Eigen Contracts..."
. contracts/scripts/anvil/deploy_eigen_contracts.sh
anvil_deploy_risc0_contracts: ## Deploy RISC0 Contracts used by Aggregation Mode on ANVIL
@echo "Deploying RISC0 Contracts..."
. contracts/scripts/anvil/deploy_risc0_contracts.sh
anvil_deploy_sp1_contracts: ## Deploy SP1 Contracts used by Aggregation Mode on ANVIL
@echo "Deploying SP1 Contracts..."
. contracts/scripts/anvil/deploy_sp1_contracts.sh
anvil_deploy_aligned_contracts: ## Deploy Aligned Contracts (Verification Layer and Aggregation Mode) on ANVIL
@echo "Deploying Aligned Contracts..."
. contracts/scripts/anvil/deploy_aligned_contracts.sh
anvil_upgrade_aligned_contracts: ## Upgrade Aligned Contracts (Verification Layer and Aggregation Mode) on ANVIL
@echo "Upgrading Aligned Contracts..."
. contracts/scripts/anvil/upgrade_aligned_contracts.sh
anvil_upgrade_batcher_payment_service: ## Upgrade BatcherPaymentService contract on ANVIL
@echo "Upgrading BatcherPayments contract..."
. contracts/scripts/anvil/upgrade_batcher_payment_service.sh
anvil_upgrade_registry_coordinator: ## Upgrade Registry Coordinator Contracts on ANVIL
@echo "Upgrading Registry Coordinator Contracts..."
. contracts/scripts/anvil/upgrade_registry_coordinator.sh
anvil_upgrade_bls_apk_registry: ## Upgrade Bls Apk Registry Contract on ANVIL
@echo "Upgrading Bls Apk Registry Contract..."
. contracts/scripts/anvil/upgrade_bls_apk_registry.sh
anvil_upgrade_stake_registry: ## Upgrade Stake Registry Contract on ANVIL
@echo "Upgrading Stake Registry Contract..."
. contracts/scripts/anvil/upgrade_stake_registry.sh
anvil_upgrade_index_registry: ## Upgrade Index Registry Contracts on ANVIL
@echo "Upgrading Index Registry Contracts..."
. contracts/scripts/anvil/upgrade_index_registry.sh
anvil_upgrade_add_aggregator:
@echo "Adding Aggregator to Aligned Contracts..."
. contracts/scripts/anvil/upgrade_add_aggregator_to_service_manager.sh
__CONTRACTS_MANAGEMENT__: ## ____
pause_all_aligned_service_manager: ## Pause all Aligned Service Manager contracts
@echo "Pausing all contracts..."
. contracts/scripts/pause_aligned_service_manager.sh all
unpause_all_aligned_service_manager: ## Unpause all Aligned Service Manager contracts
@echo "Pausing all contracts..."
. contracts/scripts/unpause_aligned_service_manager.sh all
get_paused_state_aligned_service_manager: ## Get paused state of Aligned Service Manager contracts
@echo "Getting paused state of Aligned Service Manager contract..."
. contracts/scripts/get_paused_state_aligned_service_manager.sh
pause_batcher_payment_service: ## Pause BatcherPaymentService contract
@echo "Pausing BatcherPayments contract..."
. contracts/scripts/pause_batcher_payment_service.sh
unpause_batcher_payment_service: ## Unpause BatcherPaymentService contract
@echo "Unpausing BatcherPayments contract..."
. contracts/scripts/unpause_batcher_payment_service.sh
get_paused_state_batcher_payments_service: ## Get paused state of BatcherPaymentService contract
@echo "Getting paused state of Batcher Payments Service contract..."
. contracts/scripts/get_paused_state_batcher_payments_service.sh
anvil_upgrade_initialize_disable_verifiers:
@echo "Initializing disabled verifiers..."
. contracts/scripts/anvil/upgrade_disabled_verifiers_in_service_manager.sh
# The verifier ID to enable or disable corresponds to the index of the verifier in the `ProvingSystemID` enum.
verifier_enable_devnet: ## Enable a verifier on devnet
@echo "Enabling verifier with id: $(VERIFIER_ID)"
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 RPC_URL=http://localhost:8545 OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/enable_verifier.sh $(VERIFIER_ID)
verifier_disable_devnet: ## Disable a verifier on devnet
@echo "Disabling verifier with id: $(VERIFIER_ID)"
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 RPC_URL=http://localhost:8545 OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/disable_verifier.sh $(VERIFIER_ID)
verifier_enable: ## Enable a verifier
@echo "Enabling verifier with ID: $(VERIFIER_ID)"
@. contracts/scripts/.env && . contracts/scripts/enable_verifier.sh $(VERIFIER_ID)
verifier_disable: ## Disable a verifier
@echo "Disabling verifier with ID: $(VERIFIER_ID)"
@. contracts/scripts/.env && . contracts/scripts/disable_verifier.sh $(VERIFIER_ID)
strategies_get_weight: ## Get the weight of a strategy
@echo "Getting weight of strategy: $(STRATEGY_INDEX)"
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/get_strategy_weight.sh $(STRATEGY_INDEX)
strategies_update_weight: ## TODO
@echo "Updating strategy weights: "
@echo "STRATEGY_INDICES: $(STRATEGY_INDICES)"
@echo "NEW_MULTIPLIERS: $(NEW_MULTIPLIERS)"
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/update_strategy_weight.sh $(STRATEGY_INDICES) $(NEW_MULTIPLIERS)
strategies_remove: ## TODO
@echo "Removing strategies: $(INDICES_TO_REMOVE)"
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/remove_strategy.sh $(INDICES_TO_REMOVE)
strategies_get_addresses: ## TODO
@echo "Getting strategy addresses"
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/get_restakeable_strategies.sh
__ANVIL__: ## ____
anvil_start: ## Start Anvil with pre-deployed state
@echo "Starting Anvil..."
anvil --load-state contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json --block-time 7
anvil_start_with_more_prefunded_accounts:
@echo "Starting Anvil..."
anvil --load-state contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json --block-time 7 -a 2000
__AGGREGATION_MODE__: ## ____
is_aggregator_set:
@if [ -z "$(AGGREGATOR)" ]; then \
echo "Error: AGGREGATOR is not set. Please provide arg AGGREGATOR='sp1' or 'risc0'."; \
exit 1; \
fi
reset_last_aggregated_block:
@echo "Resetting last aggregated block..."
@echo '{"last_aggregated_block":0}' > config-files/proof-aggregator.last_aggregated_block.json
AGGREGATION_MODE_SOURCES = $(wildcard ./aggregation_mode/Cargo.toml) $(wildcard ./aggregation_mode/src/**) $(wildcard ./aggregation_mode/aggregation_programs/risc0/Cargo.toml) $(wildcard ./aggregation_mode/aggregation_programs/risc0/src/**) $(wildcard ./aggregation_mode/aggregation_programs/sp1/Cargo.toml) $(wildcard ./aggregation_mode/aggregation_programs/sp1/src/**)
### All Dev proof aggregator receipts with no real proving
./aggregation_mode/target/release/proof_aggregator_dev: $(AGGREGATION_MODE_SOURCES)
AGGREGATOR=$(AGGREGATOR) cargo build --manifest-path ./aggregation_mode/Cargo.toml --release --bin proof_aggregator_dev
proof_aggregator_start_dev: is_aggregator_set reset_last_aggregated_block ./aggregation_mode/target/release/proof_aggregator_dev ## Starts proof aggregator with mock proofs (DEV mode). Parameters: AGGREGATOR=<sp1|risc0>
AGGREGATOR=$(AGGREGATOR) RISC0_DEV_MODE=1 ./aggregation_mode/target/release/proof_aggregator_dev config-files/config-proof-aggregator-mock.yaml
proof_aggregator_start_dev_ethereum_package: is_aggregator_set reset_last_aggregated_block ./aggregation_mode/target/release/proof_aggregator_dev ## Starts proof aggregator with mock proofs (DEV mode) in ethereum package. Parameters: AGGREGATOR=<sp1|risc0>
AGGREGATOR=$(AGGREGATOR) RISC0_DEV_MODE=1 ./aggregation_mode/target/release/proof_aggregator_dev config-files/config-proof-aggregator-mock-ethereum-package.yaml
### All CPU proof aggregator receipts
./aggregation_mode/target/release/proof_aggregator_cpu: $(AGGREGATION_MODE_SOURCES)
AGGREGATOR=$(AGGREGATOR) cargo build --features prove --manifest-path ./aggregation_mode/Cargo.toml --release --bin proof_aggregator_cpu
proof_aggregator_start: is_aggregator_set reset_last_aggregated_block ./aggregation_mode/target/release/proof_aggregator_cpu ## Starts proof aggregator with proving activated. Parameters: AGGREGATOR=<sp1|risc0>
AGGREGATOR=$(AGGREGATOR) ./aggregation_mode/target/release/proof_aggregator_cpu config-files/config-proof-aggregator.yaml
proof_aggregator_start_ethereum_package: is_aggregator_set reset_last_aggregated_block ./aggregation_mode/target/release/proof_aggregator_cpu ## Starts proof aggregator with proving activated in ethereum package. Parameters: AGGREGATOR=<sp1|risc0>
AGGREGATOR=$(AGGREGATOR) ./aggregation_mode/target/release/proof_aggregator_cpu config-files/config-proof-aggregator-ethereum-package.yaml
### All GPU proof aggregator receipts
./aggregation_mode/target/release/proof_aggregator_gpu: $(AGGREGATION_MODE_SOURCES)
AGGREGATOR=$(AGGREGATOR) cargo build --features "prove,gpu" --manifest-path ./aggregation_mode/Cargo.toml --release --bin proof_aggregator_gpu
proof_aggregator_start_gpu: is_aggregator_set reset_last_aggregated_block ./aggregation_mode/target/release/proof_aggregator_gpu ## Starts proof aggregator with proving + GPU acceleration (CUDA). Parameters: AGGREGATOR=<sp1|risc0>
AGGREGATOR=$(AGGREGATOR) SP1_PROVER=cuda ./aggregation_mode/target/release/proof_aggregator_gpu config-files/config-proof-aggregator.yaml
proof_aggregator_start_gpu_ethereum_package: is_aggregator_set reset_last_aggregated_block ./aggregation_mode/target/release/proof_aggregator_gpu ## Starts proof aggregator with proving activated in ethereum package. Parameters: AGGREGATOR=<sp1|risc0>
AGGREGATOR=$(AGGREGATOR) SP1_PROVER=cuda ./aggregation_mode/target/release/proof_aggregator_gpu config-files/config-proof-aggregator-ethereum-package.yaml
verify_aggregated_proof_sp1:
@echo "Verifying SP1 in aggregated proofs on $(NETWORK)..."
@cd crates/cli/ && \
cargo run verify-agg-proof \
--network $(NETWORK) \
--from-block $(FROM_BLOCK) \
--proving_system SP1 \
--public_input ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.pub \
--program-id-file ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.vk \
--beacon_url $(BEACON_URL) \
--rpc_url $(RPC_URL)
verify_aggregated_proof_risc0:
@echo "Verifying RISC0 in aggregated proofs on $(NETWORK)..."
@cd crates/cli/ && \
cargo run verify-agg-proof \
--network $(NETWORK) \
--from-block $(FROM_BLOCK) \
--proving_system Risc0 \
--program-id-file ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_3_0_3.bin \
--public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_3_0_3.pub \
--beacon_url $(BEACON_URL) \
--rpc_url $(RPC_URL)
proof_aggregator_install: ## Install the aggregation mode with proving enabled
cargo install --path aggregation_mode --features prove,gpu --bin proof_aggregator_gpu --locked
proof_aggregator_write_program_ids: ## Write proof aggregator zkvm programs ids
@cd aggregation_mode && ./scripts/build_programs.sh
__AGGREGATOR__: ## ____
aggregator_start: ## Start the Aggregator. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>, AGG_CONFIG_FILE
$(GET_SDK_VERSION)
@echo "Starting Aggregator..."
@go run aggregator/cmd/main.go --config $(AGG_CONFIG_FILE) \
2>&1 | zap-pretty
aggregator_start_ethereum_package: ## Start the Aggregator with Ethereum package config. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>, AGG_CONFIG_FILE
$(MAKE) aggregator_start AGG_CONFIG_FILE=config-files/config-aggregator-ethereum-package.yaml
aggregator_build: ## Build the Aggregator. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>
$(GET_SDK_VERSION)
@echo "Building aggregator"
@go build -o ./build/aligned-aggregator ./aggregator/cmd/main.go
aggregator_send_dummy_responses:
@echo "Sending dummy responses to Aggregator..."
@cd aggregator && go run dummy/submit_task_responses.go
test_go_retries:
@cd core/ && \
go test -v -timeout 15m
__OPERATOR__: ## ____
operator_start: ## Start the Operator. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>, CONFIG_FILE
$(GET_SDK_VERSION)
@echo "Starting Operator..."
go run operator/cmd/main.go start --config $(CONFIG_FILE) \
2>&1 | zap-pretty
operator_start_ethereum_package: ## Start the Operator with Ethereum package config
$(MAKE) operator_start ENVIRONMENT=devnet CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
operator_set_eigen_sdk_go_version_testnet:
@echo "Setting Eigen SDK version to: $(EIGEN_SDK_GO_VERSION_TESTNET)"
go get github.com/Layr-Labs/eigensdk-go@$(EIGEN_SDK_GO_VERSION_TESTNET)
operator_set_eigen_sdk_go_version_devnet:
@echo "Setting Eigen SDK version to: $(EIGEN_SDK_GO_VERSION_DEVNET)"
go get github.com/Layr-Labs/eigensdk-go@$(EIGEN_SDK_GO_VERSION_DEVNET)
operator_set_eigen_sdk_go_version_mainnet:
@echo "Setting Eigen SDK version to: $(EIGEN_SDK_GO_VERSION_MAINNET)"
go get github.com/Layr-Labs/eigensdk-go@$(EIGEN_SDK_GO_VERSION_MAINNET)
operator_set_eigen_sdk_go_version_error:
@echo "Error setting Eigen SDK version, missing ENVIRONMENT. Possible values for ENVIRONMENT=<devnet|testnet|mainnet>"
exit 1
operator_full_registration: operator_get_eth operator_register_with_eigen_layer operator_mint_mock_tokens operator_deposit_into_mock_strategy operator_whitelist_devnet operator_register_with_aligned_layer ## Register the operator in EigenLayer and AlignedLayer. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>, CONFIG_FILE
operator_full_registration_and_start: ## Register the operator in EigenLayer and AlignedLayer, then start the Operator. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>, CONFIG_FILE
@echo "Operator address: $$(yq -r '.operator.address' $$CONFIG_FILE)" && \
$(MAKE) operator_full_registration CONFIG_FILE=$(CONFIG_FILE) && \
$(MAKE) operator_start ENVIRONMENT=devnet CONFIG_FILE=$(CONFIG_FILE)
operator_full_registration_and_start_ethereum_package: ## Register the operator in EigenLayer and AlignedLayer, then start the Operator with Ethereum package config
@export CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml && \
echo "Operator address: $$(yq -r '.operator.address' $$CONFIG_FILE)" && \
$(MAKE) operator_full_registration CONFIG_FILE=$$CONFIG_FILE && \
$(MAKE) operator_start ENVIRONMENT=devnet CONFIG_FILE=$$CONFIG_FILE
operator_build: deps ## Build the Operator. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>
$(GET_SDK_VERSION)
$(BUILD_OPERATOR)
operator_build_macos:
@echo "Building Operator..."
@go build -ldflags "-X main.Version=$(OPERATOR_VERSION)" -o ./operator/build/aligned-operator ./operator/cmd/main.go
@echo "Operator built into /operator/build/aligned-operator"
operator_build_linux:
@echo "Building Operator..."
@go build -ldflags "-X main.Version=$(OPERATOR_VERSION) -r $(OPERATOR_FFIS)" -o ./operator/build/aligned-operator ./operator/cmd/main.go
@echo "Operator built into /operator/build/aligned-operator"
operator_update: ## Update the Operator to the latest version and build it. Parameters: ENVIRONMENT=<devnet|testnet|mainnet>
$(GET_SDK_VERSION)
@echo "Updating Operator..."
@./scripts/fetch_latest_release.sh
@make operator_build
@./operator/build/aligned-operator --version
operator_valid_marshall_fuzz_macos:
@cd operator/pkg && go test -fuzz=FuzzValidMarshall -ldflags=-extldflags=-Wl,-ld_classic
operator_valid_marshall_fuzz_linux:
@cd operator/pkg && \
go test -fuzz=FuzzValidMarshall
operator_marshall_unmarshall_fuzz_macos:
@cd operator/pkg && go test -fuzz=FuzzMarshalUnmarshal -ldflags=-extldflags=-Wl,-ld_classic
operator_marshall_unmarshall_fuzz_linux:
@cd operator/pkg && \
go test -fuzz=FuzzMarshalUnmarshal
test:
go test ./... -timeout 15m
get_delegation_manager_address:
@sed -n 's/.*"delegationManager": "\([^"]*\)".*/\1/p' contracts/script/output/devnet/eigenlayer_deployment_output.json
operator_generate_keys:
@echo "Generating BLS keys"
eigenlayer operator keys create --key-type bls --insecure operator
@echo "Generating ECDSA keys"
eigenlayer operator keys create --key-type ecdsa --insecure operator
operator_generate_config:
@echo "Generating operator config"
eigenlayer operator config create
operator_get_eth:
@echo "Sending funds to operator address on devnet"
@OPERATOR_ADDRESS=$$(yq -r '.operator.address' $(CONFIG_FILE)) && \
. ./scripts/fund_operator_devnet.sh
operator_register_with_eigen_layer:
@echo "Registering operator with EigenLayer"
@echo "" | eigenlayer operator register $(CONFIG_FILE)
operator_mint_mock_tokens:
@echo "Minting tokens"
@OPERATOR_ADDRESS=$$(yq -r '.operator.address' $(CONFIG_FILE)) && \
. ./scripts/mint_mock_token.sh $(CONFIG_FILE) 100000000000000000
operator_whitelist_devnet:
@echo "Whitelisting operator"
@OPERATOR_ADDRESS=$$(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/operator_whitelist.sh $$OPERATOR_ADDRESS
operator_remove_from_whitelist_devnet:
@echo "Removing operator"
@OPERATOR_ADDRESS=$$(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/operator_remove_from_whitelist.sh $$OPERATOR_ADDRESS
operator_whitelist:
@OPERATOR_ADDRESS=$$(yq -r '.operator.address' $(CONFIG_FILE)) && \
echo "Whitelisting operator $$OPERATOR_ADDRESS on $(NETWORK)" && \
. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/operator_whitelist.sh $$OPERATOR_ADDRESS
operator_remove_from_whitelist:
@OPERATOR_ADDRESS=$$(yq -r '.operator.address' $(CONFIG_FILE)) && \
echo "Removing operator $$OPERATOR_ADDRESS" && \
. contracts/scripts/.env && . contracts/scripts/operator_remove_from_whitelist.sh $$OPERATOR_ADDRESS
operator_deposit_into_mock_strategy:
@echo "Depositing into mock strategy"
$(eval STRATEGY_ADDRESS = $(shell jq -r '.addresses.strategies.WETH' contracts/script/output/devnet/eigenlayer_deployment_output.json))
@go run operator/cmd/main.go deposit-into-strategy \
--config $(CONFIG_FILE) \
--strategy-address $(STRATEGY_ADDRESS) \
--amount 100000000000000000
AMOUNT ?= 1000
operator_deposit_into_strategy:
@echo "Depositing into strategy"
@go run operator/cmd/main.go deposit-into-strategy \
--config $(CONFIG_FILE) \
--strategy-address $(STRATEGY_ADDRESS) \
--amount $(AMOUNT)
operator_register_with_aligned_layer:
@echo "Registering operator with AlignedLayer"
@go run operator/cmd/main.go register \
--config $(CONFIG_FILE)
__BATCHER__: ## ____
BURST_SIZE ?= 5
user_fund_payment_service:
@. ./scripts/user_fund_payment_service_devnet.sh
./crates/batcher/.env:
@echo "To start the Batcher ./crates/batcher/.env needs to be manually set"; false;
batcher_start: ./crates/batcher/.env user_fund_payment_service
@echo "Starting Batcher..."
@cargo run --manifest-path ./crates/batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./crates/batcher/.env
batcher_start_local: user_fund_payment_service ## Start the Batcher locally. It runs LocalStack as S3 service.
@echo "Starting Batcher..."
@$(MAKE) storage_start &
@cargo run --manifest-path ./crates/batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./crates/batcher/.env.dev
batcher_start_local_no_fund:
@echo "Starting Batcher..."
@$(MAKE) storage_start &
@cargo run --manifest-path ./crates/batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./crates/batcher/.env.dev
batcher_start_ethereum_package: user_fund_payment_service ## Start the Batcher with Ethereum package config. It runs LocalStack as S3 service.
@echo "Starting Batcher..."
@$(MAKE) storage_start &
@cargo run --manifest-path ./crates/batcher/Cargo.toml --release -- --config ./config-files/config-batcher-ethereum-package.yaml --env-file ./crates/batcher/.env.dev
batcher_install: ## Install latest version of Batcher
@cargo install --path crates/batcher
__STORAGE__: ## ____
storage_start: ## Run S3-storage using storage-docker-compose.yaml
@echo "Running storage..."
@docker compose -f storage-docker-compose.yaml up
__ALIGNED_CLI__: ## ____
aligned_install: ## Install latest version of Aligned CLI
@./crates/cli/install_aligned.sh
aligned_uninstall: ## Uninstall Aligned CLI
@rm -rf ~/.aligned && echo "Aligned uninstalled"
aligned_install_compiling: ## Install Aligned CLI by compiling from source
@cargo install --path crates/cli
build_batcher_client:
@cd crates/cli && cargo build --release
__SEND_PROOFS__: ## ____
crates/target/release/aligned:
@cd crates/cli && cargo b --release
batcher_send_sp1_task: ## Send a SP1 fibonacci proof to Batcher. Parameters: RPC_URL, NETWORK
@echo "Sending SP1 fibonacci proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system SP1 \
--proof ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.proof \
--vm_program ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.elf \
--public_input ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.pub \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_sp1_burst: ## Send a burst of SP1 fibonacci proofs to Batcher. Parameters: RPC_URL, NETWORK, BURST_SIZE
@echo "Sending SP1 fibonacci proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system SP1 \
--proof ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.proof \
--vm_program ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.elf \
--public_input ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.pub \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--repetitions $(BURST_SIZE) \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_sp1_infinite: ## Send burst of SP1 fibonacci proofs to Batcher every certain time
@echo "Sending infinite SP1 fibonacci proofs to Batcher..."
@./crates/cli/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh
batcher_send_risc0_task: ## Send a Risc0 fibonacci proof to Batcher. Parameters: RPC_URL, NETWORK
@echo "Sending Risc0 fibonacci proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system Risc0 \
--proof ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_3_0_3.proof \
--vm_program ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_3_0_3.bin \
--public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_3_0_3.pub \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_risc0_task_no_pub_input: ## Send a Risc0 proof without public input to Batcher. Parameters: RPC_URL, NETWORK
@echo "Sending Risc0 no pub input proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system Risc0 \
--proof ../../scripts/test_files/risc_zero/no_public_inputs/risc_zero_no_pub_input_3_0_3.proof \
--vm_program ../../scripts/test_files/risc_zero/no_public_inputs/risc_zero_no_pub_input_id_3_0_3.bin \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_risc0_burst: ## Send a burst of Risc0 fibonacci proofs to Batcher. Parameters: RPC_URL, NETWORK, BURST_SIZE
@echo "Sending Risc0 fibonacci proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system Risc0 \
--proof ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_3_0_3.proof \
--vm_program ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_3_0_3.bin \
--public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_3_0_3.pub \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--repetitions $(BURST_SIZE) \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_gnark_plonk_bn254_task: crates/target/release/aligned ## Send a Gnark Plonk Bn254 1!=0 proof to Batcher. Parameters: RPC_URL, NETWORK
@echo "Sending Gnark Plonk Bn254 1!=0 proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system GnarkPlonkBn254 \
--proof ../../scripts/test_files/gnark_plonk_bn254_script/gnark_plonk_0_12_0.proof \
--public_input ../../scripts/test_files/gnark_plonk_bn254_script/gnark_plonk_pub_input_0_12_0.pub \
--vk ../../scripts/test_files/gnark_plonk_bn254_script/gnark_plonk_0_12_0.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_gnark_plonk_bn254_burst: crates/target/release/aligned ## Send a burst of Gnark Plonk Bn254 1!=0 proofs to Batcher. Parameters: RPC_URL, NETWORK, BURST_SIZE
@echo "Sending Gnark Plonk Bn254 1!=0 proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system GnarkPlonkBn254 \
--proof ../../scripts/test_files/gnark_plonk_bn254_script/gnark_plonk_0_12_0.proof \
--public_input ../../scripts/test_files/gnark_plonk_bn254_script/gnark_plonk_pub_input_0_12_0.pub \
--vk ../../scripts/test_files/gnark_plonk_bn254_script/gnark_plonk_0_12_0.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--repetitions $(BURST_SIZE) \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_gnark_plonk_bls12_381_task: crates/target/release/aligned ## Send a Gnark Plonk BLS12-381 1!=0 proof to Batcher. Parameters: RPC_URL, NETWORK
@echo "Sending Gnark Plonk BLS12-381 1!=0 proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system GnarkPlonkBls12_381 \
--proof ../../scripts/test_files/gnark_plonk_bls12_381_script/gnark_plonk_0_12_0.proof \
--public_input ../../scripts/test_files/gnark_plonk_bls12_381_script/gnark_plonk_pub_input_0_12_0.pub \
--vk ../../scripts/test_files/gnark_plonk_bls12_381_script/gnark_plonk_0_12_0.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_gnark_plonk_bls12_381_burst: crates/target/release/aligned ## Send a burst of Gnark Plonk BLS12-381 1!=0 proofs to Batcher. Parameters: RPC_URL, NETWORK, BURST_SIZE
@echo "Sending Gnark Plonk BLS12-381 1!=0 proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system GnarkPlonkBls12_381 \
--proof ../../scripts/test_files/gnark_plonk_bls12_381_script/gnark_plonk_0_12_0.proof \
--public_input ../../scripts/test_files/gnark_plonk_bls12_381_script/gnark_plonk_pub_input_0_12_0.pub \
--vk ../../scripts/test_files/gnark_plonk_bls12_381_script/gnark_plonk_0_12_0.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--repetitions $(BURST_SIZE) \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_gnark_groth16_bn254_task: crates/target/release/aligned ## Send a Gnark Groth16 Bn254 1!=0 proof to Batcher. Parameters: RPC_URL, NETWORK
@echo "Sending Gnark Groth 16Bn254 1!=0 proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system GnarkGroth16Bn254 \
--proof ../../scripts/test_files/gnark_groth16_bn254_script/gnark_groth16_0_12_0.proof \
--public_input ../../scripts/test_files/gnark_groth16_bn254_script/gnark_groth16_0_12_0.pub \
--vk ../../scripts/test_files/gnark_groth16_bn254_script/gnark_groth16_0_12_0.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_gnark_groth16_bn254_burst: crates/target/release/aligned ## Send a burst of Gnark Groth16 Bn254 1!=0 proofs to Batcher. Parameters: RPC_URL, NETWORK, BURST_SIZE
@echo "Sending Gnark Groth16 Bn254 1!=0 proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system GnarkGroth16Bn254 \
--proof ../../scripts/test_files/gnark_groth16_bn254_script/gnark_groth16_0_12_0.proof \
--public_input ../../scripts/test_files/gnark_groth16_bn254_script/gnark_groth16_0_12_0.pub \
--vk ../../scripts/test_files/gnark_groth16_bn254_script/gnark_groth16_0_12_0.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--repetitions $(BURST_SIZE) \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
## TODO: send_burst_tasks.sh and send_infinite_tasks.sh does a similar thing. We could delete one
batcher_send_gnark_groth16_bn254_infinite: crates/target/release/aligned ## Send a different Gnark Groth16 BN254 proof using the client every 3 seconds. Parameters: BURST_SIZE, START_COUNTER
@echo "Sending a burst of proofs to Batcher..."
@mkdir -p scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs
@./crates/cli/send_burst_tasks.sh $(BURST_SIZE) $(START_COUNTER)
batcher_send_circom_groth16_bn256_task: crates/target/release/aligned ## Send a Circom Groth16 BN256 proof to Batcher. Parameters: RPC_URL, NETWORK
@echo "Sending Circom Groth16 BN256 proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system CircomGroth16Bn256 \
--proof ../../scripts/test_files/circom_groth16_bn256_script/proof.json \
--public_input ../../scripts/test_files/circom_groth16_bn256_script/public.json \
--vk ../../scripts/test_files/circom_groth16_bn256_script/verification_key.json \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_circom_groth16_bn256_burst: crates/target/release/aligned ## Send a burst of Circom Groth16 BN256 proofs to Batcher. Parameters: RPC_URL, NETWORK, BURST_SIZE
@echo "Sending Circom Groth16 BN256 proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system CircomGroth16Bn256 \
--proof ../../scripts/test_files/circom_groth16_bn256_script/proof.json \
--public_input ../../scripts/test_files/circom_groth16_bn256_script/public.json \
--vk ../../scripts/test_files/circom_groth16_bn256_script/verification_key.json \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--repetitions $(BURST_SIZE) \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_circom_groth16_bn256_no_pub_input_burst: crates/target/release/aligned ## Send a burst of Circom Groth16 BN256 proofs to Batcher. Parameters: RPC_URL, NETWORK, BURST_SIZE
@echo "Sending Circom Groth16 BN256 proof to Batcher..."
@cd crates/cli/ && cargo run --release -- submit \
--proving_system CircomGroth16Bn256 \
--proof ../../scripts/test_files/circom_groth16_bn256_no_pub_input_script/proof.json \
--public_input ../../scripts/test_files/circom_groth16_bn256_no_pub_input_script/public.json \
--vk ../../scripts/test_files/circom_groth16_bn256_no_pub_input_script/verification_key.json \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--repetitions $(BURST_SIZE) \
--rpc_url $(RPC_URL) \
--network $(NETWORK)
batcher_send_proof_with_random_address: ## Send a proof with a random address to Batcher. Parameters: RPC_URL, NETWORK, PROOF_TYPE, REPETITIONS
@cd crates/cli/ && ./send_proof_with_random_address.sh
batcher_send_burst_with_random_address: ## Send a burst of proofs with random addresses to Batcher. Parameters: RPC_URL, NETWORK, PROOF_TYPE, REPETITIONS
@cd crates/cli/ && ./send_burst_with_random_address.sh
__TASK_SENDER__:
BURST_TIME_SECS ?= 3
task_sender_generate_gnark_groth16_proofs:
@cd crates/task-sender && \
cargo run --release -- generate-proofs \
--number-of-proofs $(NUMBER_OF_PROOFS) --proof-type gnark_groth16 \
--dir-to-save-proofs $(CURDIR)/scripts/test_files/task_sender/proofs
# ===== DEVNET =====
task_sender_fund_wallets_devnet:
@cd crates/task-sender && \
cargo run --release -- generate-and-fund-wallets \
--eth-rpc-url http://localhost:8545 \
--network devnet \
--amount-to-deposit 1 \
--amount-to-deposit-to-aligned 0.9999 \
--private-keys-filepath $(CURDIR)/crates/task-sender/wallets/devnet
task_sender_send_infinite_proofs_devnet:
@cd crates/task-sender && \
cargo run --release -- send-infinite-proofs \
--burst-size $(BURST_SIZE) --burst-time-secs $(BURST_TIME_SECS) \
--eth-rpc-url http://localhost:8545 \
--network devnet \
--proofs-dirpath $(CURDIR)/scripts/test_files/task_sender/proofs \
--private-keys-filepath $(CURDIR)/crates/task-sender/wallets/devnet
task_sender_test_connections_devnet:
@cd crates/task-sender && \
cargo run --release -- test-connections \
--num-senders $(NUM_SENDERS) \
--network devnet
# ===== HOLESKY-STAGE =====
task_sender_generate_and_fund_wallets_holesky_stage:
@cd crates/task-sender && \
cargo run --release -- generate-and-fund-wallets \
--eth-rpc-url https://ethereum-holesky-rpc.publicnode.com \
--network holesky-stage \
--funding-wallet-private-key $(FUNDING_WALLET_PRIVATE_KEY) \
--number-wallets $(NUM_WALLETS) \
--amount-to-deposit $(AMOUNT_TO_DEPOSIT) \
--amount-to-deposit-to-aligned $(AMOUNT_TO_DEPOSIT_TO_ALIGNED) \
--private-keys-filepath $(CURDIR)/crates/task-sender/wallets/holesky-stage
task_sender_send_infinite_proofs_holesky_stage:
@cd crates/task-sender && \
cargo run --release -- send-infinite-proofs \
--burst-size $(BURST_SIZE) --burst-time-secs $(BURST_TIME_SECS) \
--eth-rpc-url https://ethereum-holesky-rpc.publicnode.com \
--network holesky-stage \
--proofs-dirpath $(CURDIR)/scripts/test_files/task_sender/proofs \
--private-keys-filepath $(CURDIR)/crates/task-sender/wallets/holesky-stage
task_sender_test_connections_holesky_stage:
@cd crates/task-sender && \
cargo run --release -- test-connections \
--num-senders $(NUM_SENDERS) \
--network holesky-stage
__UTILS__:
aligned_get_user_balance_devnet:
@cd crates/cli/ && cargo run --release -- get-user-balance \
--user_addr $(USER_ADDR) \
--network devnet
aligned_get_user_balance_holesky:
@cd crates/cli/ && cargo run --release -- get-user-balance \
--rpc_url https://ethereum-holesky-rpc.publicnode.com \
--network holesky \
--user_addr $(USER_ADDR)
__GENERATE_PROOFS__: ## ____
generate_sp1_fibonacci_proof: ## Run the SP1 Fibonacci proof generator script
@cd scripts/test_files/sp1/fibonacci_proof_generator/script && RUST_LOG=info cargo run --release
@echo "Fibonacci proof and ELF generated in scripts/test_files/sp1 folder"
generate_sp1_fibonacci_proof_no_pub_input: ## Run the SP1 Fibonacci proof generator script with empty journal
@cd scripts/test_files/sp1/no_public_inputs/script && RUST_LOG=info cargo run --release
@echo "Fibonacci proof and ELF with no public inputs generated in scripts/test_files/sp1 folder"
generate_risc_zero_fibonacci_proof: ## Run the Risc0 Fibonacci proof generator script
@cd scripts/test_files/risc_zero/fibonacci_proof_generator && \
RUST_LOG=info cargo run --release && \
echo "Fibonacci proof, pub input and image ID generated in scripts/test_files/risc_zero folder"
generate_risc_zero_empty_journal_proof: ## Run the Risc0 Fibonacci proof generator script with empty journal
@cd scripts/test_files/risc_zero/no_public_inputs && RUST_LOG=info cargo run --release
@echo "Fibonacci proof and ELF with empty journal generated in scripts/test_files/risc_zero/no_public_inputs folder"
generate_gnark_plonk_bls12_381_proof: ## Run the gnark_plonk_bls12_381_script
@echo "Running gnark_plonk_bls12_381 script..."
@go run scripts/test_files/gnark_plonk_bls12_381_script/main.go
generate_gnark_plonk_bn254_proof: ## Run the gnark_plonk_bn254_script
@echo "Running gnark_plonk_bn254 script..."
@go run scripts/test_files/gnark_plonk_bn254_script/main.go
generate_gnark_groth16_bn254_proof: ## Run the gnark_groth16_bn254_script
@echo "Running gnark_groth_bn254 script..."
@go run scripts/test_files/gnark_groth16_bn254_script/main.go
generate_gnark_groth16_bn254_ineq_proof: ## Run the gnark_plonk_bn254_script
@echo "Running gnark_groth_bn254_ineq script..."
@go run scripts/test_files/gnark_groth16_bn254_infinite_script/cmd/main.go 1
generate_circom_groth16_bn256_proof: ## Run the circom_groth16_bn256_script
@echo "Running circom_groth16_bn256 script..."
@cd scripts/test_files/circom_groth16_bn256_script && ./generate_proof.sh
generate_circom_groth16_bn256_setup: ## Run the circom_groth16_bn256_script setup
@echo "Running circom_groth16_bn256 script setup..."
@cd scripts/test_files/circom_groth16_bn256_script && ./generate_setup.sh
generate_circom_groth16_bn256_no_pub_input_proof: ## Run the circom_groth16_bn256_script
@echo "Running circom_groth16_bn256 script..."
@cd scripts/test_files/circom_groth16_bn256_no_pub_input_script && ./generate_proof.sh
generate_circom_groth16_bn256_no_pub_input_setup: ## Run the circom_groth16_bn256_script setup
@echo "Running circom_groth16_bn256_no_pub_input_script setup..."
@cd scripts/test_files/circom_groth16_bn256_no_pub_input_script && ./generate_setup.sh
__CONTRACTS_DEPLOYMENT__: ## ____
deploy_aligned_contracts: ## Deploy Aligned Contracts. Parameters: NETWORK=<mainnet|holesky|sepolia>
@echo "Deploying Aligned Contracts on $(NETWORK) network..."
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/deploy_aligned_contracts.sh
deploy_pauser_registry: ## Deploy Pauser Registry
@echo "Deploying Pauser Registry..."
@. contracts/scripts/.env && . contracts/scripts/deploy_pauser_registry.sh
upgrade_aligned_contracts: ## Upgrade Aligned Contracts. Parameters: NETWORK=<mainnet|holesky|sepolia>
@echo "Upgrading Aligned Contracts on $(NETWORK) network..."
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/upgrade_aligned_contracts.sh
upgrade_pauser_aligned_contracts: ## Upgrade Aligned Contracts with Pauser initialization
@echo "Upgrading Aligned Contracts with Pauser initialization..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_add_pausable_to_service_manager.sh
upgrade_registry_coordinator: ## Upgrade Registry Coordinator
@echo "Upgrading Registry Coordinator..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_registry_coordinator.sh
upgrade_bls_apk_registry: ## Upgrade Registry Coordinator
@echo "Upgrading BLS Apk Registry Coordinator..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_bls_apk_registry.sh
upgrade_index_registry: ## Upgrade Registry Coordinator
@echo "Upgrading Index Registry..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_index_registry.sh
upgrade_stake_registry: ## Upgrade Stake Registry
@echo "Upgrading Stake Registry..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_stake_registry.sh
upgrade_add_aggregator: ## Add Aggregator to Aligned Contracts
@echo "Adding Aggregator to Aligned Contracts..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_add_aggregator_to_service_manager.sh
set_aggregator_address:
@echo "Setting Aggregator Address in Aligned Service Manager Contract on $(NETWORK) network..."
@echo "Aggregator address: $(AGGREGATOR_ADDRESS)"
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/set_aggregator_address.sh $(AGGREGATOR_ADDRESS)
set_aggregator_address_devnet:
@echo "Setting Aggregator Address in Aligned Service Manager Contract..."
@echo "Aggregator address: $(AGGREGATOR_ADDRESS)"
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/set_aggregator_address.sh $(AGGREGATOR_ADDRESS)
upgrade_initialize_disabled_verifiers:
@echo "Adding disabled verifiers to Aligned Service Manager..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_disabled_verifiers_in_service_manager.sh
deploy_verify_batch_inclusion_caller:
@echo "Deploying VerifyBatchInclusionCaller contract..."
@. examples/verify/.env && . examples/verify/scripts/deploy_verify_batch_inclusion_caller.sh
deploy_batcher_payment_service: ## Deploy BatcherPayments contract. Parameters: NETWORK=<mainnet|holesky|sepolia>
@echo "Deploying BatcherPayments contract on $(NETWORK) network..."
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/deploy_batcher_payment_service.sh
upgrade_batcher_payment_service: ## Upgrade BatcherPayments contract. Parameters: NETWORK=<mainnet|holesky|sepolia
@echo "Upgrading BatcherPayments Contract on $(NETWORK) network..."
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/upgrade_batcher_payment_service.sh
deploy_proof_aggregator: ## Deploy ProofAggregator contract. Parameters: NETWORK=<mainnet|holesky|sepolia>
@echo "Deploying ProofAggregator contract on $(NETWORK) network..."
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/deploy_proof_aggregator.sh
upgrade_proof_aggregator: ## Upgrade ProofAggregator contract. Parameters: NETWORK=<mainnet|holesky|sepolia>
@echo "Upgrading ProofAggregator Contract on $(NETWORK) network..."
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/upgrade_proof_aggregator.sh
__SP1_FFI__: ##
build_sp1_macos:
@cd operator/sp1/lib && cargo build $(RELEASE_FLAG)
@cp operator/sp1/lib/target/$(TARGET_REL_PATH)/libsp1_verifier_ffi.dylib operator/sp1/lib/libsp1_verifier_ffi.dylib
build_sp1_linux:
@cd operator/sp1/lib && cargo build $(RELEASE_FLAG)
@cp operator/sp1/lib/target/$(TARGET_REL_PATH)/libsp1_verifier_ffi.so operator/sp1/lib/libsp1_verifier_ffi.so
test_sp1_rust_ffi:
@echo "Testing SP1 Rust FFI source code..."
@cd operator/sp1/lib && RUST_MIN_STACK=83886080 cargo t --release
test_sp1_go_bindings_macos: build_sp1_macos
@echo "Testing SP1 Go bindings..."
go test ./operator/sp1/... -v
test_sp1_go_bindings_linux: build_sp1_linux
@echo "Testing SP1 Go bindings..."
go test ./operator/sp1/... -v
__RISC_ZERO_FFI__: ##
build_risc_zero_macos:
@cd operator/risc_zero/lib && cargo build $(RELEASE_FLAG)
@cp operator/risc_zero/lib/target/$(TARGET_REL_PATH)/librisc_zero_verifier_ffi.dylib operator/risc_zero/lib/librisc_zero_verifier_ffi.dylib
build_risc_zero_linux:
@cd operator/risc_zero/lib && cargo build $(RELEASE_FLAG)
@cp operator/risc_zero/lib/target/$(TARGET_REL_PATH)/librisc_zero_verifier_ffi.so operator/risc_zero/lib/librisc_zero_verifier_ffi.so
test_risc_zero_rust_ffi:
@echo "Testing RISC Zero Rust FFI source code..."
@cd operator/risc_zero/lib && cargo test --release
test_risc_zero_go_bindings_macos: build_risc_zero_macos
@echo "Testing RISC Zero Go bindings..."
go test ./operator/risc_zero/... -v
test_risc_zero_go_bindings_linux: build_risc_zero_linux
@echo "Testing RISC Zero Go bindings..."
go test ./operator/risc_zero/... -v
__MERKLE_TREE_FFI__: ##
build_merkle_tree_macos:
@cd operator/merkle_tree/lib && cargo build $(RELEASE_FLAG)
@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_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
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_go_bindings_macos: build_merkle_tree_macos
@echo "Testing Merkle Tree Go bindings..."
go test ./operator/merkle_tree/... -v
test_merkle_tree_go_bindings_linux: build_merkle_tree_linux
@echo "Testing Merkle Tree Go bindings..."
go test ./operator/merkle_tree/... -v
__FFI__: ## ____
build_all_ffi: ## Build all FFIs
$(BUILD_ALL_FFI)
@echo "Created FFIs"
build_all_ffi_macos: ## Build all FFIs for macOS
@echo "Building all FFIs for macOS..."
@$(MAKE) build_sp1_macos
@$(MAKE) build_risc_zero_macos
@$(MAKE) build_merkle_tree_macos
@echo "All macOS FFIs built successfully."
build_all_ffi_linux: ## Build all FFIs for Linux
@echo "Building all FFIs for Linux..."
@$(MAKE) build_sp1_linux
@$(MAKE) build_risc_zero_linux
@$(MAKE) build_merkle_tree_linux
@echo "All Linux FFIs built successfully."
__EXPLORER__: ## ____
explorer_start: explorer_start_db explorer_ecto_setup_db ## Start the Explorer with the database
@cd explorer/ && \
pnpm install --prefix assets && \
mix setup && \
./start.sh
explorer_build_db: ## Build the Explorer database image
@cd explorer && \