Skip to content

Commit ce5c9e7

Browse files
authored
Staging (#1039)
2 parents 1876fd0 + e0dd6ce commit ce5c9e7

File tree

173 files changed

+9886
-2300
lines changed

Some content is hidden

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

173 files changed

+9886
-2300
lines changed

.github/workflows/build-go.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
run: make build_halo2_ipa_linux
3636
- name: Build Merkle Tree bindings
3737
run: make build_merkle_tree_linux
38+
- name: Build Old Merkle Tree bindings
39+
run: make build_merkle_tree_linux_old
3840
- name: Build operator
3941
run: go build operator/cmd/main.go
4042
- name: Build aggregator

.github/workflows/build-rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
build:
15-
runs-on: ubuntu-latest
15+
runs-on: aligned-runner
1616

1717
steps:
1818
- uses: actions/checkout@v4

.github/workflows/explorer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
ssh -o "StrictHostKeyChecking=no" ${USERNAME}@${HOST_NAME} "
4444
cd ${APP_DIR} &&
4545
git fetch &&
46+
git reset --hard HEAD &&
47+
git clean -fd &&
4648
git checkout ${REF} &&
4749
git pull &&
4850
sudo systemctl restart ${SERVICE_NAME}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint contracts
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: ["*"]
7+
paths:
8+
- "contracts/src/core/*.sol"
9+
- ".github/workflows/lint-contracts.yml"
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: "20"
22+
23+
- name: Install dependencies
24+
run: npm install
25+
working-directory: contracts
26+
27+
- name: Run Solhint
28+
run: npm run lint:sol
29+
working-directory: contracts

.github/workflows/test-risc-zero.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@ on:
77
pull_request:
88
branches: ["*"]
99
paths:
10-
- 'operator/risc_zero/**'
11-
- '.github/workflows/test-risc-zero.yml'
10+
- "operator/risc_zero/**"
11+
- ".github/workflows/test-risc-zero.yml"
1212

1313
jobs:
14-
test:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Clear device space
18-
run: |
19-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
20-
sudo rm -rf /usr/local/lib/android
21-
sudo rm -rf /opt/ghc
22-
sudo rm -rf /usr/local/.ghcup
23-
sudo rm -rf /usr/share/dotnet
24-
sudo rm -rf /opt/ghc
25-
sudo rm -rf "/usr/local/share/boost"
26-
- uses: actions/checkout@v4
27-
- uses: actions/setup-go@v5
28-
with:
29-
go-version: '1.22'
30-
cache: false
31-
- uses: actions-rs/toolchain@v1
32-
with:
33-
toolchain: stable
34-
- name: Test Risc Zero Rust
35-
run: make test_risc_zero_rust_ffi
36-
- name: Test Risc Zero go bindings
37-
run: make test_risc_zero_go_bindings_linux
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Clear device space
18+
run: |
19+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
20+
sudo rm -rf /usr/local/lib/android
21+
sudo rm -rf /opt/ghc
22+
sudo rm -rf /usr/local/.ghcup
23+
sudo rm -rf /usr/share/dotnet
24+
sudo rm -rf /opt/ghc
25+
sudo rm -rf "/usr/local/share/boost"
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-go@v5
28+
with:
29+
go-version: "1.22"
30+
cache: false
31+
- uses: actions-rs/toolchain@v1
32+
with:
33+
toolchain: stable
34+
- name: Test Risc Zero Rust
35+
run: make test_risc_zero_rust_ffi
36+
- name: Test Risc Zero go bindings
37+
run: make test_risc_zero_go_bindings_linux

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@
1616
[submodule "examples/validating-public-input/contracts/lib/forge-std"]
1717
path = examples/validating-public-input/contracts/lib/forge-std
1818
url = https://github.com/foundry-rs/forge-std
19+
[submodule "contracts/lib/openzeppelin-contracts"]
20+
path = contracts/lib/openzeppelin-contracts
21+
url = https://github.com/OpenZeppelin/openzeppelin-contracts
22+
[submodule "contracts/lib/openzeppelin-contracts-upgradeable"]
23+
path = contracts/lib/openzeppelin-contracts-upgradeable
24+
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable

Makefile

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

8-
OPERATOR_VERSION=v0.5.2
8+
OPERATOR_VERSION=v0.7.0
99

1010
ifeq ($(OS),Linux)
1111
BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux
@@ -55,6 +55,10 @@ anvil_upgrade_aligned_contracts:
5555
@echo "Upgrading Aligned Contracts..."
5656
. contracts/scripts/anvil/upgrade_aligned_contracts.sh
5757

58+
anvil_upgrade_batcher_payment_service:
59+
@echo "Upgrading BatcherPayments contract..."
60+
. contracts/scripts/anvil/upgrade_batcher_payment_service.sh
61+
5862
anvil_upgrade_registry_coordinator:
5963
@echo "Upgrading Registry Coordinator Contracts..."
6064
. contracts/scripts/anvil/upgrade_registry_coordinator.sh
@@ -71,6 +75,17 @@ anvil_upgrade_index_registry:
7175
@echo "Upgrading Index Registry Contracts..."
7276
. contracts/scripts/anvil/upgrade_index_registry.sh
7377

78+
anvil_upgrade_add_aggregator:
79+
@echo "Adding Aggregator to Aligned Contracts..."
80+
. contracts/scripts/anvil/upgrade_add_aggregator_to_service_manager.sh
81+
82+
anvil_add_type_hash_to_batcher_payment_service:
83+
@echo "Adding Type Hash to Batcher Payment Service..."
84+
. contracts/scripts/anvil/upgrade_add_type_hash_to_batcher_payment_service.sh
85+
86+
lint_contracts:
87+
@cd contracts && npm run lint:sol
88+
7489
anvil_start:
7590
@echo "Starting Anvil..."
7691
anvil --load-state contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json
@@ -136,7 +151,7 @@ operator_register_with_eigen_layer:
136151

137152
operator_mint_mock_tokens:
138153
@echo "Minting tokens"
139-
. ./scripts/mint_mock_token.sh $(CONFIG_FILE) 1000
154+
. ./scripts/mint_mock_token.sh $(CONFIG_FILE) 100000000000000000
140155

141156
operator_whitelist_devnet:
142157
@echo "Whitelisting operator"
@@ -155,7 +170,7 @@ operator_deposit_into_mock_strategy:
155170
@go run operator/cmd/main.go deposit-into-strategy \
156171
--config $(CONFIG_FILE) \
157172
--strategy-address $(STRATEGY_ADDRESS) \
158-
--amount 1000
173+
--amount 100000000000000000
159174

160175
operator_deposit_into_strategy:
161176
@echo "Depositing into strategy"
@@ -229,7 +244,7 @@ batcher_send_sp1_burst:
229244
--proving_system SP1 \
230245
--proof ../../scripts/test_files/sp1/sp1_fibonacci.proof \
231246
--vm_program ../../scripts/test_files/sp1/sp1_fibonacci.elf \
232-
--repetitions 15 \
247+
--repetitions $(BURST_SIZE) \
233248
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
234249
--rpc_url $(RPC_URL) \
235250
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
@@ -256,7 +271,7 @@ batcher_send_risc0_burst:
256271
--proof ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci.proof \
257272
--vm_program ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id.bin \
258273
--public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci.pub \
259-
--repetitions 15 \
274+
--repetitions $(BURST_SIZE) \
260275
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
261276
--rpc_url $(RPC_URL) \
262277
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
@@ -281,6 +296,7 @@ batcher_send_plonk_bn254_burst: batcher/target/release/aligned
281296
--vk ../../scripts/test_files/gnark_plonk_bn254_script/plonk.vk \
282297
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
283298
--rpc_url $(RPC_URL) \
299+
--repetitions 4 \
284300
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
285301

286302
batcher_send_plonk_bls12_381_task: batcher/target/release/aligned
@@ -426,6 +442,14 @@ upgrade_stake_registry: ## Upgrade Stake Registry
426442
@echo "Upgrading Stake Registry..."
427443
@. contracts/scripts/.env && . contracts/scripts/upgrade_stake_registry.sh
428444

445+
upgrade_add_aggregator: ## Add Aggregator to Aligned Contracts
446+
@echo "Adding Aggregator to Aligned Contracts..."
447+
@. contracts/scripts/.env && . contracts/scripts/upgrade_add_aggregator_to_service_manager.sh
448+
449+
upgrade_batcher_payments_add_type_hash: ## Add Type Hash to Batcher Payment Service
450+
@echo "Adding Type Hash to Batcher Payment Service..."
451+
@. contracts/scripts/.env && . contracts/scripts/upgrade_add_type_hash_to_batcher_payment_service.sh
452+
429453
deploy_verify_batch_inclusion_caller:
430454
@echo "Deploying VerifyBatchInclusionCaller contract..."
431455
@. examples/verify/.env && . examples/verify/scripts/deploy_verify_batch_inclusion_caller.sh
@@ -441,6 +465,12 @@ upgrade_batcher_payment_service:
441465
build_aligned_contracts:
442466
@cd contracts/src/core && forge build
443467

468+
show_aligned_error_codes:
469+
@echo "\nAlignedLayerServiceManager errors:"
470+
@cd contracts/src/core && forge inspect IAlignedLayerServiceManager.sol:IAlignedLayerServiceManager errors
471+
@echo "\nBatcherPaymentService errors:"
472+
@cd contracts/src/core && forge inspect BatcherPaymentService.sol:BatcherPaymentService errors
473+
444474
__BUILD__:
445475
build_binaries:
446476
@echo "Building aggregator..."
@@ -497,6 +527,7 @@ test_risc_zero_go_bindings_macos: build_risc_zero_macos
497527

498528
test_risc_zero_go_bindings_linux: build_risc_zero_linux
499529
@echo "Testing RISC Zero Go bindings..."
530+
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(CURDIR)/operator/risc_zero/lib \
500531
go test ./operator/risc_zero/... -v
501532

502533
generate_risc_zero_fibonacci_proof:
@@ -510,15 +541,29 @@ build_merkle_tree_macos:
510541
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.dylib operator/merkle_tree/lib/libmerkle_tree.dylib
511542
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree/lib/libmerkle_tree.a
512543

544+
build_merkle_tree_macos_old:
545+
@cd operator/merkle_tree_old/lib && cargo build $(RELEASE_FLAG)
546+
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.dylib operator/merkle_tree_old/lib/libmerkle_tree.dylib
547+
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree_old/lib/libmerkle_tree.a
548+
513549
build_merkle_tree_linux:
514550
@cd operator/merkle_tree/lib && cargo build $(RELEASE_FLAG)
515551
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.so operator/merkle_tree/lib/libmerkle_tree.so
516552
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree/lib/libmerkle_tree.a
517553

554+
build_merkle_tree_linux_old:
555+
@cd operator/merkle_tree_old/lib && cargo build $(RELEASE_FLAG)
556+
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.so operator/merkle_tree_old/lib/libmerkle_tree.so
557+
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree_old/lib/libmerkle_tree.a
558+
518559
test_merkle_tree_rust_ffi:
519560
@echo "Testing Merkle Tree Rust FFI source code..."
520561
@cd operator/merkle_tree/lib && RUST_MIN_STACK=83886080 cargo t --release
521562

563+
test_merkle_tree_rust_ffi_old:
564+
@echo "Testing Old Merkle Tree Rust FFI source code..."
565+
@cd operator/merkle_tree_old/lib && RUST_MIN_STACK=83886080 cargo t --release
566+
522567
test_merkle_tree_go_bindings_macos: build_merkle_tree_macos
523568
@echo "Testing Merkle Tree Go bindings..."
524569
go test ./operator/merkle_tree/... -v
@@ -527,6 +572,14 @@ test_merkle_tree_go_bindings_linux: build_merkle_tree_linux
527572
@echo "Testing Merkle Tree Go bindings..."
528573
go test ./operator/merkle_tree/... -v
529574

575+
test_merkle_tree_old_go_bindings_macos: build_merkle_tree_macos_old
576+
@echo "Testing Old Merkle Tree Go bindings..."
577+
go test ./operator/merkle_tree_old/... -v
578+
579+
test_merkle_tree_go_bindings_linux_old: build_merkle_tree_linux_old
580+
@echo "Testing Merkle Tree Go bindings..."
581+
go test ./operator/merkle_tree_old/... -v
582+
530583
__HALO2_KZG_FFI__: ##
531584
build_halo2_kzg_macos:
532585
@cd operator/halo2kzg/lib && cargo build $(RELEASE_FLAG)
@@ -601,6 +654,7 @@ build_all_ffi_macos: ## Build all FFIs for macOS
601654
@$(MAKE) build_sp1_macos
602655
@$(MAKE) build_risc_zero_macos
603656
@$(MAKE) build_merkle_tree_macos
657+
@$(MAKE) build_merkle_tree_macos_old
604658
@$(MAKE) build_halo2_ipa_macos
605659
@$(MAKE) build_halo2_kzg_macos
606660
@echo "All macOS FFIs built successfully."
@@ -610,45 +664,46 @@ build_all_ffi_linux: ## Build all FFIs for Linux
610664
@$(MAKE) build_sp1_linux
611665
@$(MAKE) build_risc_zero_linux
612666
@$(MAKE) build_merkle_tree_linux
667+
@$(MAKE) build_merkle_tree_linux_old
613668
@$(MAKE) build_halo2_ipa_linux
614669
@$(MAKE) build_halo2_kzg_linux
615670
@echo "All Linux FFIs built successfully."
616671

617672

618673
__EXPLORER__:
619-
run_explorer: run_db ecto_setup_db
674+
run_explorer: explorer_run_db explorer_ecto_setup_db
620675
@cd explorer/ && \
621676
pnpm install --prefix assets && \
622677
mix setup && \
623678
./start.sh
624679

625-
build_db:
680+
explorer_build_db:
626681
@cd explorer && \
627682
docker build -t explorer-postgres-image .
628683

629-
run_db: remove_db_container
684+
explorer_run_db: explorer_remove_db_container
630685
@cd explorer && \
631686
docker run -d --name explorer-postgres-container -p 5432:5432 -v explorer-postgres-data:/var/lib/postgresql/data explorer-postgres-image
632687

633-
ecto_setup_db:
688+
explorer_ecto_setup_db:
634689
@cd explorer/ && \
635690
./ecto_setup_db.sh
636691

637-
remove_db_container:
692+
explorer_remove_db_container:
638693
@cd explorer && \
639694
docker stop explorer-postgres-container || true && \
640695
docker rm explorer-postgres-container || true
641696

642-
clean_db: remove_db_container
697+
explorer_clean_db: explorer_remove_db_container
643698
@cd explorer && \
644699
docker volume rm explorer-postgres-data || true
645700

646-
dump_db:
701+
explorer_dump_db:
647702
@cd explorer && \
648703
docker exec -t explorer-postgres-container pg_dumpall -c -U explorer_user > dump.$$(date +\%Y\%m\%d_\%H\%M\%S).sql
649704
@echo "Dumped database successfully to /explorer"
650705

651-
recover_db: run_db
706+
explorer_recover_db: explorer_run_db
652707
@read -p $$'\e[32mEnter the dump file to recover (e.g., dump.20230607_123456.sql): \e[0m' DUMP_FILE && \
653708
cd explorer && \
654709
docker cp $$DUMP_FILE explorer-postgres-container:/dump.sql && \

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- [Aligned Infrastructure Guide](#aligned-infrastructure-guide)
1414
- [Submitting Proofs to Aligned](#submitting-proofs-to-aligned)
1515
- [Integrating Aligned into your Project](#integrating-aligned-into-your-project)
16+
- [Versioning and Networks](#versioning-and-networks)
1617

1718

1819
## The Project
@@ -181,3 +182,11 @@ For submitting proofs generated by your own project to the network via CLI, see
181182
## Integrating Aligned into your Project
182183
183184
If you are developing applications using Aligned, we offer a [Rust-SDK](docs/3_guides/1_SDK_how_to.md) for submitting proofs directly to the network within your applications.
185+
186+
## Versioning and Networks
187+
188+
Testnet code and documentation is always in sync with the default [Testnet Branch](https://github.com/yetanotherco/aligned_layer/tree/feat/testnet)
189+
190+
Releases are provided for each version of the testnet.
191+
192+
Latest version of the code, deployed on staging network, is always on [Staging Branch](https://github.com/yetanotherco/aligned_layer/tree/feat/staging)

0 commit comments

Comments
 (0)