Skip to content

Commit c2e8af6

Browse files
authored
v0.15.3 (#1940)
2 parents 9588fd7 + 52d5c8c commit c2e8af6

File tree

220 files changed

+28747
-5046
lines changed

Some content is hidden

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

220 files changed

+28747
-5046
lines changed

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
paths:
99
- "batcher/**"
1010
- "aggregation_mode/**"
11-
- ".github/workflows/build-rust.yml"
11+
- ".github/workflows/build-and-test-rust.yml"
1212

1313
jobs:
1414
build:
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set up Rust
2121
uses: actions-rs/toolchain@v1
2222
with:
23-
toolchain: stable
23+
toolchain: 1.86.0
2424
components: rustfmt, clippy
2525
override: true
2626

@@ -31,6 +31,12 @@ jobs:
3131
source /home/runner/.bashrc
3232
~/.sp1/bin/sp1up
3333
34+
- name: Install risc0 toolchain
35+
run: |
36+
curl -L https://risczero.com/install | bash
37+
source ~/.bashrc
38+
~/.risc0/bin/rzup install
39+
3440
- name: Cache Rust dependencies
3541
uses: actions/cache@v3
3642
with:
@@ -70,7 +76,8 @@ jobs:
7076
- name: Run Clippy on AggregationMode
7177
run: |
7278
cd aggregation_mode
73-
cargo clippy --all -- -D warnings
79+
# We need to skip the build as clippy does not support the riscv32im-risc0-zkvm-elf target
80+
RISC0_SKIP_BUILD=1 cargo clippy --all -- -D warnings
7481
7582
test:
7683
runs-on: aligned-runner
@@ -89,6 +96,12 @@ jobs:
8996
source /home/runner/.bashrc
9097
~/.sp1/bin/sp1up
9198
99+
- name: Install risc0 toolchain
100+
run: |
101+
curl -L https://risczero.com/install | bash
102+
source ~/.bashrc
103+
~/.risc0/bin/rzup install
104+
92105
- name: Cache Rust dependencies
93106
uses: actions/cache@v3
94107
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ nonce_*.bin
1818

1919
infra/ansible/playbooks/ini/**.ini
2020
infra/ansible/playbooks/files/**.pem
21+
22+
examples/l2/crates/l2/db
23+
examples/l2/crates/l2/zkvm_programs/sp1/elf/sp1_state_transition_program

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,12 @@
3434
[submodule "contracts/lib/sp1-contracts"]
3535
path = contracts/lib/sp1-contracts
3636
url = https://github.com/succinctlabs/sp1-contracts
37+
[submodule "contracts/lib/risc0-ethereum"]
38+
path = contracts/lib/risc0-ethereum
39+
url = https://github.com/risc0/risc0-ethereum
40+
[submodule "contracts/eigenlayer_contracts/eigenlayer-contracts"]
41+
path = contracts/eigenlayer_contracts/eigenlayer-contracts
42+
url = https://github.com/Layr-Labs/eigenlayer-contracts.git
43+
[submodule "examples/l2/contracts/lib/forge-std"]
44+
path = examples/l2/contracts/lib/forge-std
45+
url = https://github.com/foundry-rs/forge-std

Makefile

Lines changed: 82 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ CONFIG_FILE?=config-files/config.yaml
77
export OPERATOR_ADDRESS ?= $(shell yq -r '.operator.address' $(CONFIG_FILE))
88
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml
99

10-
OPERATOR_VERSION=v0.15.2
11-
EIGEN_SDK_GO_VERSION_DEVNET=v0.1.13
10+
OPERATOR_VERSION=v0.15.3
11+
EIGEN_SDK_GO_VERSION_DEVNET=v0.2.0-beta.1
1212
EIGEN_SDK_GO_VERSION_TESTNET=v0.2.0-beta.1
1313
EIGEN_SDK_GO_VERSION_MAINNET=v0.2.0-beta.1
1414

@@ -73,12 +73,18 @@ install_foundry:
7373
curl -L https://foundry.paradigm.xyz | bash
7474

7575
install_eigenlayer_cli_devnet: ## Install Eigenlayer CLI v0.11.3 (Devnet compatible)
76-
curl -sSfL https://raw.githubusercontent.com/layr-labs/eigenlayer-cli/master/scripts/install.sh | sh -s -- v0.11.3
76+
curl -sSfL https://raw.githubusercontent.com/layr-labs/eigenlayer-cli/master/scripts/install.sh | sh -s -- v0.13.0
77+
78+
anvil_deploy_all_contracts: anvil_deploy_eigen_contracts anvil_deploy_risc0_contracts anvil_deploy_sp1_contracts anvil_deploy_aligned_contracts
7779

7880
anvil_deploy_eigen_contracts:
7981
@echo "Deploying Eigen Contracts..."
8082
. contracts/scripts/anvil/deploy_eigen_contracts.sh
8183

84+
anvil_deploy_risc0_contracts:
85+
@echo "Deploying RISC0 Contracts..."
86+
. contracts/scripts/anvil/deploy_risc0_contracts.sh
87+
8288
anvil_deploy_sp1_contracts:
8389
@echo "Deploying SP1 Contracts..."
8490
. contracts/scripts/anvil/deploy_sp1_contracts.sh
@@ -155,11 +161,64 @@ anvil_start_with_more_prefunded_accounts:
155161
anvil --load-state contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json --block-time 7 -a 2000
156162

157163
__AGGREGATION_MODE__: ## ____
158-
start_proof_aggregator_local: ## Start the proof aggregator locally using Mock Verifier Contract
159-
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release -- config-files/config-proof-aggregator-mock.yaml
160164

161-
start_proof_aggregator_local_with_proving: ## Start the proof aggregator locally using SP1 Verifier Contract
162-
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --features prove -- config-files/config-proof-aggregator.yaml
165+
is_aggregator_set:
166+
@if [ -z "$(AGGREGATOR)" ]; then \
167+
echo "Error: AGGREGATOR is not set. Please provide arg AGGREGATOR='sp1' or 'risc0'."; \
168+
exit 1; \
169+
fi
170+
171+
reset_last_aggregated_block:
172+
@echo "Resetting last aggregated block..."
173+
@echo '{"last_aggregated_block":0}' > config-files/proof-aggregator.last_aggregated_block.json
174+
175+
start_proof_aggregator_dev: is_aggregator_set reset_last_aggregated_block ## Starts proof aggregator with mock proofs (DEV mode)
176+
AGGREGATOR=$(AGGREGATOR) RISC0_DEV_MODE=1 cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin proof_aggregator -- config-files/config-proof-aggregator-mock.yaml
177+
178+
start_proof_aggregator: is_aggregator_set reset_last_aggregated_block ## Starts proof aggregator with proving activated
179+
AGGREGATOR=$(AGGREGATOR) cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --features prove --bin proof_aggregator -- config-files/config-proof-aggregator.yaml
180+
181+
start_proof_aggregator_dev_ethereum_package: is_aggregator_set reset_last_aggregated_block ## Starts proof aggregator with mock proofs (DEV mode) in ethereum package
182+
AGGREGATOR=$(AGGREGATOR) RISC0_DEV_MODE=1 cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --bin proof_aggregator -- config-files/config-proof-aggregator-mock-ethereum-package.yaml
183+
184+
start_proof_aggregator_ethereum_package: is_aggregator_set reset_last_aggregated_block ## Starts proof aggregator with proving activated in ethereum package
185+
AGGREGATOR=$(AGGREGATOR) cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --features prove --bin proof_aggregator -- config-files/config-proof-aggregator-ethereum-package.yaml
186+
187+
start_proof_aggregator_gpu: is_aggregator_set reset_last_aggregated_block ## Starts proof aggregator with proving + GPU acceleration (CUDA)
188+
AGGREGATOR=$(AGGREGATOR) SP1_PROVER=cuda cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --features prove,gpu --bin proof_aggregator -- config-files/config-proof-aggregator.yaml
189+
190+
start_proof_aggregator_gpu_ethereum_package: is_aggregator_set reset_last_aggregated_block ## Starts proof aggregator with proving activated in ethereum package
191+
AGGREGATOR=$(AGGREGATOR) SP1_PROVER=cuda cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --features prove,gpu --bin proof_aggregator -- config-files/config-proof-aggregator-ethereum-package.yaml
192+
193+
verify_aggregated_proof_sp1_holesky_stage:
194+
@echo "Verifying SP1 in aggregated proofs on holesky..."
195+
@cd batcher/aligned/ && \
196+
cargo run verify-agg-proof \
197+
--network holesky-stage \
198+
--from-block $(FROM_BLOCK) \
199+
--proving_system SP1 \
200+
--public_input ../../scripts/test_files/sp1/sp1_fibonacci_4_1_3.pub \
201+
--program-id-file ../../scripts/test_files/sp1/sp1_fibonacci_4_1_3.vk \
202+
--beacon_url $(BEACON_URL) \
203+
--rpc_url https://ethereum-holesky-rpc.publicnode.com
204+
205+
verify_aggregated_proof_risc0_holesky_stage:
206+
@echo "Verifying RISC0 in aggregated proofs on holesky..."
207+
@cd batcher/aligned/ && \
208+
cargo run verify-agg-proof \
209+
--network holesky-stage \
210+
--from-block $(FROM_BLOCK) \
211+
--proving_system Risc0 \
212+
--program-id-file ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_2_0.bin \
213+
--public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_2_0.pub \
214+
--beacon_url $(BEACON_URL) \
215+
--rpc_url https://ethereum-holesky-rpc.publicnode.com
216+
217+
install_aggregation_mode: ## Install the aggregation mode with proving enabled
218+
cargo install --path aggregation_mode --features prove,gpu --bin proof_aggregator
219+
220+
agg_mode_write_program_ids: ## Write proof aggregator zkvm programs ids
221+
@cd aggregation_mode && ./scripts/build_programs.sh
163222

164223
_AGGREGATOR_:
165224

@@ -297,7 +356,7 @@ operator_remove_from_whitelist:
297356

298357
operator_deposit_into_mock_strategy:
299358
@echo "Depositing into mock strategy"
300-
$(eval STRATEGY_ADDRESS = $(shell jq -r '.addresses.strategies.MOCK' contracts/script/output/devnet/eigenlayer_deployment_output.json))
359+
$(eval STRATEGY_ADDRESS = $(shell jq -r '.addresses.strategies.WETH' contracts/script/output/devnet/eigenlayer_deployment_output.json))
301360
@go run operator/cmd/main.go deposit-into-strategy \
302361
--config $(CONFIG_FILE) \
303362
--strategy-address $(STRATEGY_ADDRESS) \
@@ -527,6 +586,11 @@ batcher_send_burst_groth16: batcher/target/release/aligned
527586
@mkdir -p scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs
528587
@./batcher/aligned/send_burst_tasks.sh $(BURST_SIZE) $(START_COUNTER)
529588

589+
batcher_send_proof_with_random_address:
590+
@cd batcher/aligned/ && ./send_proof_with_random_address.sh
591+
592+
batcher_send_burst_with_random_address:
593+
@cd batcher/aligned/ && ./send_burst_with_random_address.sh
530594

531595
__TASK_SENDER__:
532596
BURST_TIME_SECS ?= 3
@@ -704,12 +768,16 @@ deploy_proof_aggregator:
704768
@echo "Deploying ProofAggregator contract on $(NETWORK) network..."
705769
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/deploy_proof_aggregator.sh
706770

771+
upgrade_proof_aggregator:
772+
@echo "Upgrading ProofAggregator Contract on $(NETWORK) network..."
773+
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/upgrade_proof_aggregator.sh
774+
707775
build_aligned_contracts:
708-
@cd contracts/src/core && forge build
776+
@cd contracts/src/core && forge build --via-ir
709777

710778
show_aligned_error_codes:
711779
@echo "\nAlignedLayerServiceManager errors:"
712-
@cd contracts && forge inspect src/core/IAlignedLayerServiceManager.sol:IAlignedLayerServiceManager errors
780+
@cd contracts && forge inspect src/core/IAlignedLayerServiceManager.sol:IAlignedLayerServiceManager errors
713781
@echo "\nBatcherPaymentService errors:"
714782
@cd contracts && forge inspect src/core/BatcherPaymentService.sol:BatcherPaymentService errors
715783

@@ -1259,6 +1327,7 @@ ethereum_package_inspect: ## Prints detailed information about the net
12591327

12601328
ethereum_package_rm: ## Stops and removes the ethereum_package environment and used resources
12611329
kurtosis enclave rm aligned -f
1330+
kurtosis engine stop
12621331

12631332
batcher_start_ethereum_package: user_fund_payment_service
12641333
@echo "Starting Batcher..."
@@ -1269,11 +1338,11 @@ aggregator_start_ethereum_package:
12691338
$(MAKE) aggregator_start AGG_CONFIG_FILE=config-files/config-aggregator-ethereum-package.yaml
12701339

12711340
operator_start_ethereum_package:
1272-
$(MAKE) operator_start OPERATOR_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
1341+
$(MAKE) operator_start ENVIRONMENT=devnet OPERATOR_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
12731342

12741343
operator_register_start_ethereum_package:
1275-
$(MAKE) operator_full_registration OPERATOR_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml \
1276-
$(MAKE) operator_start OPERATOR_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
1344+
$(MAKE) operator_full_registration OPERATOR_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
1345+
$(MAKE) operator_start ENVIRONMENT=devnet OPERATOR_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
12771346

12781347

12791348
install_spamoor: ## Instal spamoor to spam transactions

0 commit comments

Comments
 (0)