Skip to content

Commit 50c9c93

Browse files
MarcosNicolauMauroToscanoJuArce
authored
refactor: rename batcher folder to crates (#1951)
Co-authored-by: MauroFab <[email protected]> Co-authored-by: JuArce <[email protected]>
1 parent 3f47eca commit 50c9c93

File tree

106 files changed

+120
-125
lines changed

Some content is hidden

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

106 files changed

+120
-125
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ Please delete options that are not relevant.
2727
- [ ] Has a known issue
2828
- [Link to the open issue addressing it]()
2929
- [ ] If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
30-
- [ ] This PR adds compatibility for operator for both versions and do not change batcher/docs/examples
30+
- [ ] This PR adds compatibility for operator for both versions and do not change crates/docs/examples
3131
- [ ] This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
branches: ["*"]
88
paths:
9-
- "batcher/**"
9+
- "crates/**"
1010
- "aggregation_mode/**"
1111
- ".github/workflows/build-and-test-rust.yml"
1212

@@ -43,24 +43,24 @@ jobs:
4343
path: |
4444
~/.cargo/registry
4545
~/.cargo/git
46-
batcher/target
46+
crates/target
4747
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
4848
restore-keys: |
4949
${{ runner.os }}-rust-
5050
51-
- name: Check formatting of Batcher
51+
- name: Check formatting
5252
run: |
53-
cd batcher
53+
cd crates
5454
cargo fmt --all -- --check
5555
56-
- name: Run Clippy on Batcher
56+
- name: Run Clippy
5757
run: |
58-
cd batcher
58+
cd crates
5959
cargo clippy --all -- -D warnings
6060
6161
- name: Build Batcher
6262
run: |
63-
cd batcher
63+
cd crates
6464
cargo build --all
6565
6666
- name: Check formatting of AggregationMode
@@ -108,14 +108,14 @@ jobs:
108108
path: |
109109
~/.cargo/registry
110110
~/.cargo/git
111-
batcher/target
111+
crates/target
112112
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
113113
restore-keys: |
114114
${{ runner.os }}-rust-
115115
116116
- name: Run Batcher tests
117117
run: |
118-
cd batcher
118+
cd crates
119119
cargo test --all
120120
121121
- name: Run AggregationMode tests

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: make build_batcher_client
2626

2727
- name: Rename binary
28-
run: mv batcher/target/release/aligned ${{ matrix.artifact_name }}
28+
run: mv crates/target/release/aligned ${{ matrix.artifact_name }}
2929

3030
- name: Release
3131
uses: softprops/action-gh-release@v2

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cache
77
**/build
88
**/target
99
scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/**
10-
batcher/aligned/batch_inclusion_responses/*
10+
crates/cli/batch_inclusion_responses/*
1111
**/aligned_verification_data
1212
**/broadcast
1313
volume

Makefile

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ start_proof_aggregator_gpu_ethereum_package: is_aggregator_set reset_last_aggreg
218218

219219
verify_aggregated_proof_sp1:
220220
@echo "Verifying SP1 in aggregated proofs on $(NETWORK)..."
221-
@cd batcher/aligned/ && \
221+
@cd crates/cli/ && \
222222
cargo run verify-agg-proof \
223223
--network $(NETWORK) \
224224
--from-block $(FROM_BLOCK) \
@@ -230,7 +230,7 @@ verify_aggregated_proof_sp1:
230230

231231
verify_aggregated_proof_risc0:
232232
@echo "Verifying RISC0 in aggregated proofs on $(NETWORK)..."
233-
@cd batcher/aligned/ && \
233+
@cd crates/cli/ && \
234234
cargo run verify-agg-proof \
235235
--network $(NETWORK) \
236236
--from-block $(FROM_BLOCK) \
@@ -448,44 +448,44 @@ BURST_SIZE ?= 5
448448
user_fund_payment_service:
449449
@. ./scripts/user_fund_payment_service_devnet.sh
450450

451-
./batcher/aligned-batcher/.env:
452-
@echo "To start the Batcher ./batcher/aligned-batcher/.env needs to be manually set"; false;
451+
./crates/batcher/.env:
452+
@echo "To start the Batcher ./crates/batcher/.env needs to be manually set"; false;
453453

454-
batcher_start: ./batcher/aligned-batcher/.env user_fund_payment_service
454+
batcher_start: ./crates/batcher/.env user_fund_payment_service
455455
@echo "Starting Batcher..."
456-
@cargo run --manifest-path ./batcher/aligned-batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./batcher/aligned-batcher/.env
456+
@cargo run --manifest-path ./crates/batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./crates/batcher/.env
457457

458458
batcher_start_local: user_fund_payment_service
459459
@echo "Starting Batcher..."
460460
@$(MAKE) run_storage &
461-
@cargo run --manifest-path ./batcher/aligned-batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./batcher/aligned-batcher/.env.dev
461+
@cargo run --manifest-path ./crates/batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./crates/batcher/.env.dev
462462

463463
batcher_start_local_no_fund:
464464
@echo "Starting Batcher..."
465465
@$(MAKE) run_storage &
466-
@cargo run --manifest-path ./batcher/aligned-batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./batcher/aligned-batcher/.env.dev
466+
@cargo run --manifest-path ./crates/batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./crates/batcher/.env.dev
467467

468468
install_batcher:
469-
@cargo install --path batcher/aligned-batcher
469+
@cargo install --path crates/batcher
470470

471471
install_aligned:
472-
@./batcher/aligned/install_aligned.sh
472+
@./crates/cli/install_aligned.sh
473473

474474
uninstall_aligned:
475475
@rm -rf ~/.aligned && echo "Aligned uninstalled"
476476

477477
install_aligned_compiling:
478-
@cargo install --path batcher/aligned
478+
@cargo install --path crates/cli
479479

480480
build_batcher_client:
481-
@cd batcher/aligned && cargo b --release
481+
@cd crates/cli && cargo b --release
482482

483-
batcher/target/release/aligned:
484-
@cd batcher/aligned && cargo b --release
483+
crates/target/release/aligned:
484+
@cd crates/cli && cargo b --release
485485

486486
batcher_send_sp1_task:
487487
@echo "Sending SP1 fibonacci task to Batcher..."
488-
@cd batcher/aligned/ && cargo run --release -- submit \
488+
@cd crates/cli/ && cargo run --release -- submit \
489489
--proving_system SP1 \
490490
--proof ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.proof \
491491
--vm_program ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.elf \
@@ -495,7 +495,7 @@ batcher_send_sp1_task:
495495

496496
batcher_send_sp1_burst:
497497
@echo "Sending SP1 fibonacci task to Batcher..."
498-
@cd batcher/aligned/ && cargo run --release -- submit \
498+
@cd crates/cli/ && cargo run --release -- submit \
499499
--proving_system SP1 \
500500
--proof ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.proof \
501501
--vm_program ../../scripts/test_files/sp1/sp1_fibonacci_5_0_0.elf \
@@ -506,11 +506,11 @@ batcher_send_sp1_burst:
506506

507507
batcher_send_infinite_sp1:
508508
@echo "Sending infinite SP1 fibonacci task to Batcher..."
509-
@./batcher/aligned/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh
509+
@./crates/cli/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh
510510

511511
batcher_send_risc0_task:
512512
@echo "Sending Risc0 fibonacci task to Batcher..."
513-
@cd batcher/aligned/ && cargo run --release -- submit \
513+
@cd crates/cli/ && cargo run --release -- submit \
514514
--proving_system Risc0 \
515515
--proof ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_2_0.proof \
516516
--vm_program ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_2_0.bin \
@@ -521,7 +521,7 @@ batcher_send_risc0_task:
521521

522522
batcher_send_risc0_task_no_pub_input:
523523
@echo "Sending Risc0 no pub input task to Batcher..."
524-
@cd batcher/aligned/ && cargo run --release -- submit \
524+
@cd crates/cli/ && cargo run --release -- submit \
525525
--proving_system Risc0 \
526526
--proof ../../scripts/test_files/risc_zero/no_public_inputs/risc_zero_no_pub_input_2_0.proof \
527527
--vm_program ../../scripts/test_files/risc_zero/no_public_inputs/no_pub_input_id_2_0.bin \
@@ -531,7 +531,7 @@ batcher_send_risc0_task_no_pub_input:
531531

532532
batcher_send_risc0_burst:
533533
@echo "Sending Risc0 fibonacci task to Batcher..."
534-
@cd batcher/aligned/ && cargo run --release -- submit \
534+
@cd crates/cli/ && cargo run --release -- submit \
535535
--proving_system Risc0 \
536536
--proof ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_2_0.proof \
537537
--vm_program ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_2_0.bin \
@@ -541,9 +541,9 @@ batcher_send_risc0_burst:
541541
--rpc_url $(RPC_URL) \
542542
--network $(NETWORK)
543543

544-
batcher_send_plonk_bn254_task: batcher/target/release/aligned
544+
batcher_send_plonk_bn254_task: crates/target/release/aligned
545545
@echo "Sending Groth16Bn254 1!=0 task to Batcher..."
546-
@cd batcher/aligned/ && cargo run --release -- submit \
546+
@cd crates/cli/ && cargo run --release -- submit \
547547
--proving_system GnarkPlonkBn254 \
548548
--proof ../../scripts/test_files/gnark_plonk_bn254_script/plonk_0_12_0.proof \
549549
--public_input ../../scripts/test_files/gnark_plonk_bn254_script/plonk_pub_input_0_12_0.pub \
@@ -552,9 +552,9 @@ batcher_send_plonk_bn254_task: batcher/target/release/aligned
552552
--rpc_url $(RPC_URL) \
553553
--network $(NETWORK)
554554

555-
batcher_send_plonk_bn254_burst: batcher/target/release/aligned
555+
batcher_send_plonk_bn254_burst: crates/target/release/aligned
556556
@echo "Sending Groth16Bn254 1!=0 task to Batcher..."
557-
@cd batcher/aligned/ && cargo run --release -- submit \
557+
@cd crates/cli/ && cargo run --release -- submit \
558558
--proving_system GnarkPlonkBn254 \
559559
--proof ../../scripts/test_files/gnark_plonk_bn254_script/plonk_0_12_0.proof \
560560
--public_input ../../scripts/test_files/gnark_plonk_bn254_script/plonk_pub_input_0_12_0.pub \
@@ -564,9 +564,9 @@ batcher_send_plonk_bn254_burst: batcher/target/release/aligned
564564
--repetitions $(BURST_SIZE) \
565565
--network $(NETWORK)
566566

567-
batcher_send_plonk_bls12_381_task: batcher/target/release/aligned
567+
batcher_send_plonk_bls12_381_task: crates/target/release/aligned
568568
@echo "Sending Groth16 BLS12-381 1!=0 task to Batcher..."
569-
@cd batcher/aligned/ && cargo run --release -- submit \
569+
@cd crates/cli/ && cargo run --release -- submit \
570570
--proving_system GnarkPlonkBls12_381 \
571571
--proof ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk_0_12_0.proof \
572572
--public_input ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk_pub_input_0_12_0.pub \
@@ -575,9 +575,9 @@ batcher_send_plonk_bls12_381_task: batcher/target/release/aligned
575575
--rpc_url $(RPC_URL) \
576576
--network $(NETWORK)
577577

578-
batcher_send_plonk_bls12_381_burst: batcher/target/release/aligned
578+
batcher_send_plonk_bls12_381_burst: crates/target/release/aligned
579579
@echo "Sending Groth16 BLS12-381 1!=0 task to Batcher..."
580-
@cd batcher/aligned/ && cargo run --release -- submit \
580+
@cd crates/cli/ && cargo run --release -- submit \
581581
--proving_system GnarkPlonkBls12_381 \
582582
--proof ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk_0_12_0.proof \
583583
--public_input ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk_pub_input_0_12_0.pub \
@@ -587,9 +587,9 @@ batcher_send_plonk_bls12_381_burst: batcher/target/release/aligned
587587
--rpc_url $(RPC_URL) \
588588
--network $(NETWORK)
589589

590-
batcher_send_groth16_bn254_task: batcher/target/release/aligned
590+
batcher_send_groth16_bn254_task: crates/target/release/aligned
591591
@echo "Sending Groth16Bn254 1!=0 task to Batcher..."
592-
@cd batcher/aligned/ && cargo run --release -- submit \
592+
@cd crates/cli/ && cargo run --release -- submit \
593593
--proving_system Groth16Bn254 \
594594
--proof ../../scripts/test_files/gnark_groth16_bn254_script/groth16_0_12_0.proof \
595595
--public_input ../../scripts/test_files/gnark_groth16_bn254_script/groth16_0_12_0.pub \
@@ -598,91 +598,91 @@ batcher_send_groth16_bn254_task: batcher/target/release/aligned
598598
--rpc_url $(RPC_URL) \
599599
--network $(NETWORK)
600600

601-
batcher_send_infinite_groth16: batcher/target/release/aligned ## Send a different Groth16 BN254 proof using the client every 3 seconds
601+
batcher_send_infinite_groth16: crates/target/release/aligned ## Send a different Groth16 BN254 proof using the client every 3 seconds
602602
@mkdir -p scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs
603603
@echo "Sending a different GROTH16 BN254 proof in a loop every n seconds..."
604-
@./batcher/aligned/send_infinite_tasks.sh 4
604+
@./crates/cli/send_infinite_tasks.sh 4
605605

606-
batcher_send_burst_groth16: batcher/target/release/aligned
606+
batcher_send_burst_groth16: crates/target/release/aligned
607607
@echo "Sending a burst of tasks to Batcher..."
608608
@mkdir -p scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs
609-
@./batcher/aligned/send_burst_tasks.sh $(BURST_SIZE) $(START_COUNTER)
609+
@./crates/cli/send_burst_tasks.sh $(BURST_SIZE) $(START_COUNTER)
610610

611611
batcher_send_proof_with_random_address:
612-
@cd batcher/aligned/ && ./send_proof_with_random_address.sh
612+
@cd crates/cli/ && ./send_proof_with_random_address.sh
613613

614614
batcher_send_burst_with_random_address:
615-
@cd batcher/aligned/ && ./send_burst_with_random_address.sh
615+
@cd crates/cli/ && ./send_burst_with_random_address.sh
616616

617617
__TASK_SENDER__:
618618
BURST_TIME_SECS ?= 3
619619

620620
task_sender_generate_groth16_proofs:
621-
@cd batcher/aligned-task-sender && \
621+
@cd crates/task-sender && \
622622
cargo run --release -- generate-proofs \
623623
--number-of-proofs $(NUMBER_OF_PROOFS) --proof-type groth16 \
624624
--dir-to-save-proofs $(CURDIR)/scripts/test_files/task_sender/proofs
625625

626626
# ===== DEVNET =====
627627
task_sender_fund_wallets_devnet:
628-
@cd batcher/aligned-task-sender && \
628+
@cd crates/task-sender && \
629629
cargo run --release -- generate-and-fund-wallets \
630630
--eth-rpc-url http://localhost:8545 \
631631
--network devnet \
632632
--amount-to-deposit 1 \
633633
--amount-to-deposit-to-aligned 0.9999 \
634-
--private-keys-filepath $(CURDIR)/batcher/aligned-task-sender/wallets/devnet
634+
--private-keys-filepath $(CURDIR)/crates/task-sender/wallets/devnet
635635

636636
task_sender_send_infinite_proofs_devnet:
637-
@cd batcher/aligned-task-sender && \
637+
@cd crates/task-sender && \
638638
cargo run --release -- send-infinite-proofs \
639639
--burst-size $(BURST_SIZE) --burst-time-secs $(BURST_TIME_SECS) \
640640
--eth-rpc-url http://localhost:8545 \
641641
--network devnet \
642642
--proofs-dirpath $(CURDIR)/scripts/test_files/task_sender/proofs \
643-
--private-keys-filepath $(CURDIR)/batcher/aligned-task-sender/wallets/devnet
643+
--private-keys-filepath $(CURDIR)/crates/task-sender/wallets/devnet
644644

645645
task_sender_test_connections_devnet:
646-
@cd batcher/aligned-task-sender && \
646+
@cd crates/task-sender && \
647647
cargo run --release -- test-connections \
648648
--num-senders $(NUM_SENDERS) \
649649
--network devnet
650650

651651
# ===== HOLESKY-STAGE =====
652652
task_sender_generate_and_fund_wallets_holesky_stage:
653-
@cd batcher/aligned-task-sender && \
653+
@cd crates/task-sender && \
654654
cargo run --release -- generate-and-fund-wallets \
655655
--eth-rpc-url https://ethereum-holesky-rpc.publicnode.com \
656656
--network holesky-stage \
657657
--funding-wallet-private-key $(FUNDING_WALLET_PRIVATE_KEY) \
658658
--number-wallets $(NUM_WALLETS) \
659659
--amount-to-deposit $(AMOUNT_TO_DEPOSIT) \
660660
--amount-to-deposit-to-aligned $(AMOUNT_TO_DEPOSIT_TO_ALIGNED) \
661-
--private-keys-filepath $(CURDIR)/batcher/aligned-task-sender/wallets/holesky-stage
661+
--private-keys-filepath $(CURDIR)/crates/task-sender/wallets/holesky-stage
662662

663663
task_sender_send_infinite_proofs_holesky_stage:
664-
@cd batcher/aligned-task-sender && \
664+
@cd crates/task-sender && \
665665
cargo run --release -- send-infinite-proofs \
666666
--burst-size $(BURST_SIZE) --burst-time-secs $(BURST_TIME_SECS) \
667667
--eth-rpc-url https://ethereum-holesky-rpc.publicnode.com \
668668
--network holesky-stage \
669669
--proofs-dirpath $(CURDIR)/scripts/test_files/task_sender/proofs \
670-
--private-keys-filepath $(CURDIR)/batcher/aligned-task-sender/wallets/holesky-stage
670+
--private-keys-filepath $(CURDIR)/crates/task-sender/wallets/holesky-stage
671671

672672
task_sender_test_connections_holesky_stage:
673-
@cd batcher/aligned-task-sender && \
673+
@cd crates/task-sender && \
674674
cargo run --release -- test-connections \
675675
--num-senders $(NUM_SENDERS) \
676676
--network holesky-stage
677677

678678
__UTILS__:
679679
aligned_get_user_balance_devnet:
680-
@cd batcher/aligned/ && cargo run --release -- get-user-balance \
680+
@cd crates/cli/ && cargo run --release -- get-user-balance \
681681
--user_addr $(USER_ADDR) \
682682
--network devnet
683683

684684
aligned_get_user_balance_holesky:
685-
@cd batcher/aligned/ && cargo run --release -- get-user-balance \
685+
@cd crates/cli/ && cargo run --release -- get-user-balance \
686686
--rpc_url https://ethereum-holesky-rpc.publicnode.com \
687687
--network holesky \
688688
--user_addr $(USER_ADDR)
@@ -1347,7 +1347,7 @@ ethereum_package_rm: ## Stops and removes the ethereum_package environment and u
13471347
batcher_start_ethereum_package: user_fund_payment_service
13481348
@echo "Starting Batcher..."
13491349
@$(MAKE) run_storage &
1350-
@cargo run --manifest-path ./batcher/aligned-batcher/Cargo.toml --release -- --config ./config-files/config-batcher-ethereum-package.yaml --env-file ./batcher/aligned-batcher/.env.dev
1350+
@cargo run --manifest-path ./crates/batcher/Cargo.toml --release -- --config ./config-files/config-batcher-ethereum-package.yaml --env-file ./crates/batcher/.env.dev
13511351

13521352
aggregator_start_ethereum_package:
13531353
$(MAKE) aggregator_start AGG_CONFIG_FILE=config-files/config-aggregator-ethereum-package.yaml

aggregation_mode/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ciborium = "=0.2.2"
1919
lambdaworks-crypto = { git = "https://github.com/lambdaclass/lambdaworks.git", rev = "5f8f2cfcc8a1a22f77e8dff2d581f1166eefb80b", features = ["serde"]}
2020
rayon = "1.10.0"
2121
# Necessary for the VerificationData type
22-
aligned-sdk = { path = "../batcher/aligned-sdk" }
22+
aligned-sdk = { path = "../crates/sdk/" }
2323
# zkvms
2424
sp1-sdk = "5.0.0"
2525
sp1_aggregation_program = { path = "./aggregation_programs/sp1" }

aggregation_mode/aggregation_programs/risc0/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl Risc0ImageIdAndPubInputs {
2929
// All 3 implementations should match
3030
// The definition on aggregator/mod.rs supports taking proofs from both Risc0 and SP1,
3131
// Additionally, a version that takes the leaves as already hashed data is defined on:
32-
// - batcher/aligned-sdk/src/sdk/aggregation.rs
32+
// - crates/sdk/src/aggregation_layer/types.rs
3333
// This one is used in the SDK since,
3434
// the user may not have access to the proofs that he didn't submit
3535
impl IsMerkleTreeBackend for Risc0ImageIdAndPubInputs {

0 commit comments

Comments
 (0)