diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b3f517954e..2483812c4f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -27,5 +27,5 @@ Please delete options that are not relevant. - [ ] Has a known issue - [Link to the open issue addressing it]() - [ ] If your PR changes the Operator compatibility (Ex: Upgrade prover versions) - - [ ] This PR adds compatibility for operator for both versions and do not change batcher/docs/examples + - [ ] This PR adds compatibility for operator for both versions and do not change crates/docs/examples - [ ] This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible diff --git a/.github/workflows/build-and-test-rust.yml b/.github/workflows/build-and-test-rust.yml index 170def1de3..200a39a0bd 100644 --- a/.github/workflows/build-and-test-rust.yml +++ b/.github/workflows/build-and-test-rust.yml @@ -6,7 +6,7 @@ on: pull_request: branches: ["*"] paths: - - "batcher/**" + - "crates/**" - "aggregation_mode/**" - ".github/workflows/build-and-test-rust.yml" @@ -43,24 +43,24 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git - batcher/target + crates/target key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-rust- - - name: Check formatting of Batcher + - name: Check formatting run: | - cd batcher + cd crates cargo fmt --all -- --check - - name: Run Clippy on Batcher + - name: Run Clippy run: | - cd batcher + cd crates cargo clippy --all -- -D warnings - name: Build Batcher run: | - cd batcher + cd crates cargo build --all - name: Check formatting of AggregationMode @@ -108,14 +108,14 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git - batcher/target + crates/target key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-rust- - name: Run Batcher tests run: | - cd batcher + cd crates cargo test --all - name: Run AggregationMode tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41cdc93600..8f7d33f335 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: run: make build_batcher_client - name: Rename binary - run: mv batcher/target/release/aligned ${{ matrix.artifact_name }} + run: mv crates/target/release/aligned ${{ matrix.artifact_name }} - name: Release uses: softprops/action-gh-release@v2 diff --git a/.gitignore b/.gitignore index 7d1a972759..d32b05a922 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ cache **/build **/target scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/** -batcher/aligned/batch_inclusion_responses/* +crates/cli/batch_inclusion_responses/* **/aligned_verification_data **/broadcast volume diff --git a/Makefile b/Makefile index bb60b51740..08821ca384 100644 --- a/Makefile +++ b/Makefile @@ -204,7 +204,7 @@ start_proof_aggregator_gpu_ethereum_package: is_aggregator_set reset_last_aggreg verify_aggregated_proof_sp1: @echo "Verifying SP1 in aggregated proofs on $(NETWORK)..." - @cd batcher/aligned/ && \ + @cd crates/cli/ && \ cargo run verify-agg-proof \ --network $(NETWORK) \ --from-block $(FROM_BLOCK) \ @@ -216,7 +216,7 @@ verify_aggregated_proof_sp1: verify_aggregated_proof_risc0: @echo "Verifying RISC0 in aggregated proofs on $(NETWORK)..." - @cd batcher/aligned/ && \ + @cd crates/cli/ && \ cargo run verify-agg-proof \ --network $(NETWORK) \ --from-block $(FROM_BLOCK) \ @@ -434,44 +434,44 @@ BURST_SIZE ?= 5 user_fund_payment_service: @. ./scripts/user_fund_payment_service_devnet.sh -./batcher/aligned-batcher/.env: - @echo "To start the Batcher ./batcher/aligned-batcher/.env needs to be manually set"; false; +./crates/batcher/.env: + @echo "To start the Batcher ./crates/batcher/.env needs to be manually set"; false; -batcher_start: ./batcher/aligned-batcher/.env user_fund_payment_service +batcher_start: ./crates/batcher/.env user_fund_payment_service @echo "Starting Batcher..." - @cargo run --manifest-path ./batcher/aligned-batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./batcher/aligned-batcher/.env + @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 @echo "Starting Batcher..." @$(MAKE) run_storage & - @cargo run --manifest-path ./batcher/aligned-batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./batcher/aligned-batcher/.env.dev + @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) run_storage & - @cargo run --manifest-path ./batcher/aligned-batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./batcher/aligned-batcher/.env.dev + @cargo run --manifest-path ./crates/batcher/Cargo.toml --release -- --config ./config-files/config-batcher.yaml --env-file ./crates/batcher/.env.dev install_batcher: - @cargo install --path batcher/aligned-batcher + @cargo install --path crates/batcher install_aligned: - @./batcher/aligned/install_aligned.sh + @./crates/cli/install_aligned.sh uninstall_aligned: @rm -rf ~/.aligned && echo "Aligned uninstalled" install_aligned_compiling: - @cargo install --path batcher/aligned + @cargo install --path crates/cli build_batcher_client: - @cd batcher/aligned && cargo b --release + @cd crates/cli && cargo b --release -batcher/target/release/aligned: - @cd batcher/aligned && cargo b --release +crates/target/release/aligned: + @cd crates/cli && cargo b --release batcher_send_sp1_task: @echo "Sending SP1 fibonacci task to Batcher..." - @cd batcher/aligned/ && cargo run --release -- submit \ + @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 \ @@ -481,7 +481,7 @@ batcher_send_sp1_task: batcher_send_sp1_burst: @echo "Sending SP1 fibonacci task to Batcher..." - @cd batcher/aligned/ && cargo run --release -- submit \ + @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 \ @@ -492,11 +492,11 @@ batcher_send_sp1_burst: batcher_send_infinite_sp1: @echo "Sending infinite SP1 fibonacci task to Batcher..." - @./batcher/aligned/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh + @./crates/cli/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh batcher_send_risc0_task: @echo "Sending Risc0 fibonacci task to Batcher..." - @cd batcher/aligned/ && cargo run --release -- submit \ + @cd crates/cli/ && cargo run --release -- submit \ --proving_system Risc0 \ --proof ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_2_0.proof \ --vm_program ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_2_0.bin \ @@ -507,7 +507,7 @@ batcher_send_risc0_task: batcher_send_risc0_task_no_pub_input: @echo "Sending Risc0 no pub input task to Batcher..." - @cd batcher/aligned/ && cargo run --release -- submit \ + @cd crates/cli/ && cargo run --release -- submit \ --proving_system Risc0 \ --proof ../../scripts/test_files/risc_zero/no_public_inputs/risc_zero_no_pub_input_2_0.proof \ --vm_program ../../scripts/test_files/risc_zero/no_public_inputs/no_pub_input_id_2_0.bin \ @@ -517,7 +517,7 @@ batcher_send_risc0_task_no_pub_input: batcher_send_risc0_burst: @echo "Sending Risc0 fibonacci task to Batcher..." - @cd batcher/aligned/ && cargo run --release -- submit \ + @cd crates/cli/ && cargo run --release -- submit \ --proving_system Risc0 \ --proof ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_2_0.proof \ --vm_program ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_2_0.bin \ @@ -527,9 +527,9 @@ batcher_send_risc0_burst: --rpc_url $(RPC_URL) \ --network $(NETWORK) -batcher_send_plonk_bn254_task: batcher/target/release/aligned +batcher_send_plonk_bn254_task: crates/target/release/aligned @echo "Sending Groth16Bn254 1!=0 task to Batcher..." - @cd batcher/aligned/ && cargo run --release -- submit \ + @cd crates/cli/ && cargo run --release -- submit \ --proving_system GnarkPlonkBn254 \ --proof ../../scripts/test_files/gnark_plonk_bn254_script/plonk_0_12_0.proof \ --public_input ../../scripts/test_files/gnark_plonk_bn254_script/plonk_pub_input_0_12_0.pub \ @@ -538,9 +538,9 @@ batcher_send_plonk_bn254_task: batcher/target/release/aligned --rpc_url $(RPC_URL) \ --network $(NETWORK) -batcher_send_plonk_bn254_burst: batcher/target/release/aligned +batcher_send_plonk_bn254_burst: crates/target/release/aligned @echo "Sending Groth16Bn254 1!=0 task to Batcher..." - @cd batcher/aligned/ && cargo run --release -- submit \ + @cd crates/cli/ && cargo run --release -- submit \ --proving_system GnarkPlonkBn254 \ --proof ../../scripts/test_files/gnark_plonk_bn254_script/plonk_0_12_0.proof \ --public_input ../../scripts/test_files/gnark_plonk_bn254_script/plonk_pub_input_0_12_0.pub \ @@ -550,9 +550,9 @@ batcher_send_plonk_bn254_burst: batcher/target/release/aligned --repetitions $(BURST_SIZE) \ --network $(NETWORK) -batcher_send_plonk_bls12_381_task: batcher/target/release/aligned +batcher_send_plonk_bls12_381_task: crates/target/release/aligned @echo "Sending Groth16 BLS12-381 1!=0 task to Batcher..." - @cd batcher/aligned/ && cargo run --release -- submit \ + @cd crates/cli/ && cargo run --release -- submit \ --proving_system GnarkPlonkBls12_381 \ --proof ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk_0_12_0.proof \ --public_input ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk_pub_input_0_12_0.pub \ @@ -561,9 +561,9 @@ batcher_send_plonk_bls12_381_task: batcher/target/release/aligned --rpc_url $(RPC_URL) \ --network $(NETWORK) -batcher_send_plonk_bls12_381_burst: batcher/target/release/aligned +batcher_send_plonk_bls12_381_burst: crates/target/release/aligned @echo "Sending Groth16 BLS12-381 1!=0 task to Batcher..." - @cd batcher/aligned/ && cargo run --release -- submit \ + @cd crates/cli/ && cargo run --release -- submit \ --proving_system GnarkPlonkBls12_381 \ --proof ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk_0_12_0.proof \ --public_input ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk_pub_input_0_12_0.pub \ @@ -573,9 +573,9 @@ batcher_send_plonk_bls12_381_burst: batcher/target/release/aligned --rpc_url $(RPC_URL) \ --network $(NETWORK) -batcher_send_groth16_bn254_task: batcher/target/release/aligned +batcher_send_groth16_bn254_task: crates/target/release/aligned @echo "Sending Groth16Bn254 1!=0 task to Batcher..." - @cd batcher/aligned/ && cargo run --release -- submit \ + @cd crates/cli/ && cargo run --release -- submit \ --proving_system Groth16Bn254 \ --proof ../../scripts/test_files/gnark_groth16_bn254_script/groth16_0_12_0.proof \ --public_input ../../scripts/test_files/gnark_groth16_bn254_script/groth16_0_12_0.pub \ @@ -584,59 +584,59 @@ batcher_send_groth16_bn254_task: batcher/target/release/aligned --rpc_url $(RPC_URL) \ --network $(NETWORK) -batcher_send_infinite_groth16: batcher/target/release/aligned ## Send a different Groth16 BN254 proof using the client every 3 seconds +batcher_send_infinite_groth16: crates/target/release/aligned ## Send a different Groth16 BN254 proof using the client every 3 seconds @mkdir -p scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs @echo "Sending a different GROTH16 BN254 proof in a loop every n seconds..." - @./batcher/aligned/send_infinite_tasks.sh 4 + @./crates/cli/send_infinite_tasks.sh 4 -batcher_send_burst_groth16: batcher/target/release/aligned +batcher_send_burst_groth16: crates/target/release/aligned @echo "Sending a burst of tasks to Batcher..." @mkdir -p scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs - @./batcher/aligned/send_burst_tasks.sh $(BURST_SIZE) $(START_COUNTER) + @./crates/cli/send_burst_tasks.sh $(BURST_SIZE) $(START_COUNTER) batcher_send_proof_with_random_address: - @cd batcher/aligned/ && ./send_proof_with_random_address.sh + @cd crates/cli/ && ./send_proof_with_random_address.sh batcher_send_burst_with_random_address: - @cd batcher/aligned/ && ./send_burst_with_random_address.sh + @cd crates/cli/ && ./send_burst_with_random_address.sh __TASK_SENDER__: BURST_TIME_SECS ?= 3 task_sender_generate_groth16_proofs: - @cd batcher/aligned-task-sender && \ + @cd crates/task-sender && \ cargo run --release -- generate-proofs \ --number-of-proofs $(NUMBER_OF_PROOFS) --proof-type groth16 \ --dir-to-save-proofs $(CURDIR)/scripts/test_files/task_sender/proofs # ===== DEVNET ===== task_sender_fund_wallets_devnet: - @cd batcher/aligned-task-sender && \ + @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)/batcher/aligned-task-sender/wallets/devnet + --private-keys-filepath $(CURDIR)/crates/task-sender/wallets/devnet task_sender_send_infinite_proofs_devnet: - @cd batcher/aligned-task-sender && \ + @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)/batcher/aligned-task-sender/wallets/devnet + --private-keys-filepath $(CURDIR)/crates/task-sender/wallets/devnet task_sender_test_connections_devnet: - @cd batcher/aligned-task-sender && \ + @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 batcher/aligned-task-sender && \ + @cd crates/task-sender && \ cargo run --release -- generate-and-fund-wallets \ --eth-rpc-url https://ethereum-holesky-rpc.publicnode.com \ --network holesky-stage \ @@ -644,31 +644,31 @@ task_sender_generate_and_fund_wallets_holesky_stage: --number-wallets $(NUM_WALLETS) \ --amount-to-deposit $(AMOUNT_TO_DEPOSIT) \ --amount-to-deposit-to-aligned $(AMOUNT_TO_DEPOSIT_TO_ALIGNED) \ - --private-keys-filepath $(CURDIR)/batcher/aligned-task-sender/wallets/holesky-stage + --private-keys-filepath $(CURDIR)/crates/task-sender/wallets/holesky-stage task_sender_send_infinite_proofs_holesky_stage: - @cd batcher/aligned-task-sender && \ + @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)/batcher/aligned-task-sender/wallets/holesky-stage + --private-keys-filepath $(CURDIR)/crates/task-sender/wallets/holesky-stage task_sender_test_connections_holesky_stage: - @cd batcher/aligned-task-sender && \ + @cd crates/task-sender && \ cargo run --release -- test-connections \ --num-senders $(NUM_SENDERS) \ --network holesky-stage __UTILS__: aligned_get_user_balance_devnet: - @cd batcher/aligned/ && cargo run --release -- get-user-balance \ + @cd crates/cli/ && cargo run --release -- get-user-balance \ --user_addr $(USER_ADDR) \ --network devnet aligned_get_user_balance_holesky: - @cd batcher/aligned/ && cargo run --release -- get-user-balance \ + @cd crates/cli/ && cargo run --release -- get-user-balance \ --rpc_url https://ethereum-holesky-rpc.publicnode.com \ --network holesky \ --user_addr $(USER_ADDR) @@ -1333,7 +1333,7 @@ ethereum_package_rm: ## Stops and removes the ethereum_package environment and u batcher_start_ethereum_package: user_fund_payment_service @echo "Starting Batcher..." @$(MAKE) run_storage & - @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 + @cargo run --manifest-path ./crates/batcher/Cargo.toml --release -- --config ./config-files/config-batcher-ethereum-package.yaml --env-file ./crates/batcher/.env.dev aggregator_start_ethereum_package: $(MAKE) aggregator_start AGG_CONFIG_FILE=config-files/config-aggregator-ethereum-package.yaml diff --git a/aggregation_mode/Cargo.toml b/aggregation_mode/Cargo.toml index 6116514e17..d29067dd2d 100644 --- a/aggregation_mode/Cargo.toml +++ b/aggregation_mode/Cargo.toml @@ -19,7 +19,7 @@ ciborium = "=0.2.2" lambdaworks-crypto = { git = "https://github.com/lambdaclass/lambdaworks.git", rev = "5f8f2cfcc8a1a22f77e8dff2d581f1166eefb80b", features = ["serde"]} rayon = "1.10.0" # Necessary for the VerificationData type -aligned-sdk = { path = "../batcher/aligned-sdk" } +aligned-sdk = { path = "../crates/sdk/" } # zkvms sp1-sdk = "5.0.0" sp1_aggregation_program = { path = "./aggregation_programs/sp1" } diff --git a/aggregation_mode/aggregation_programs/risc0/src/lib.rs b/aggregation_mode/aggregation_programs/risc0/src/lib.rs index 6848669e34..117be11578 100644 --- a/aggregation_mode/aggregation_programs/risc0/src/lib.rs +++ b/aggregation_mode/aggregation_programs/risc0/src/lib.rs @@ -29,7 +29,7 @@ impl Risc0ImageIdAndPubInputs { // All 3 implementations should match // The definition on aggregator/mod.rs supports taking proofs from both Risc0 and SP1, // Additionally, a version that takes the leaves as already hashed data is defined on: -// - batcher/aligned-sdk/src/sdk/aggregation.rs +// - crates/sdk/src/aggregation_layer/types.rs // This one is used in the SDK since, // the user may not have access to the proofs that he didn't submit impl IsMerkleTreeBackend for Risc0ImageIdAndPubInputs { diff --git a/aggregation_mode/aggregation_programs/sp1/src/lib.rs b/aggregation_mode/aggregation_programs/sp1/src/lib.rs index 45862c629e..bae221ddf3 100644 --- a/aggregation_mode/aggregation_programs/sp1/src/lib.rs +++ b/aggregation_mode/aggregation_programs/sp1/src/lib.rs @@ -26,7 +26,7 @@ impl SP1VkAndPubInputs { // All 3 implementations should match // The definition on aggregator/mod.rs supports taking proofs from both Risc0 and SP1, // Additionally, a version that takes the leaves as already hashed data is defined on: -// - batcher/aligned-sdk/src/sdk/aggregation.rs +// - crates/sdk/src/aggregation_layer/types.rs // This one is used in the SDK since // the user may not have access to the proofs that they didn't submit impl IsMerkleTreeBackend for SP1VkAndPubInputs { diff --git a/aggregation_mode/src/aggregators/mod.rs b/aggregation_mode/src/aggregators/mod.rs index 72d22edfdb..45b9a7df0e 100644 --- a/aggregation_mode/src/aggregators/mod.rs +++ b/aggregation_mode/src/aggregators/mod.rs @@ -181,7 +181,7 @@ impl AlignedProof { // All 3 implementations should match // The definition on aggregator/mod.rs supports taking proofs from both Risc0 and SP1, // Additionally, a version that takes the leaves as already hashed data is defined on: -// - batcher/aligned-sdk/src/sdk/aggregation.rs +// - crates/sdk/src/aggregation_layer/types.rs // This one is used in the SDK since, // the user may not have access to the proofs that he didn't submit impl IsMerkleTreeBackend for AlignedProof { diff --git a/batcher/Cargo.toml b/batcher/Cargo.toml deleted file mode 100644 index ddec141070..0000000000 --- a/batcher/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[workspace] -members = ["aligned-batcher", "aligned-sdk", "aligned", "aligned-task-sender"] -resolver = "2" diff --git a/batcher/package-lock.json b/batcher/package-lock.json deleted file mode 100644 index 8343585011..0000000000 --- a/batcher/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "batcher", - "lockfileVersion": 3, - "requires": true, - "packages": {} -} diff --git a/batcher/Cargo.lock b/crates/Cargo.lock similarity index 100% rename from batcher/Cargo.lock rename to crates/Cargo.lock diff --git a/crates/Cargo.toml b/crates/Cargo.toml new file mode 100644 index 0000000000..b14f980c5c --- /dev/null +++ b/crates/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +resolver = "2" +members = ["./batcher", "./sdk", "./cli", "./task-sender"] diff --git a/batcher/aligned-batcher/.env.dev b/crates/batcher/.env.dev similarity index 100% rename from batcher/aligned-batcher/.env.dev rename to crates/batcher/.env.dev diff --git a/batcher/aligned-batcher/.env.docker b/crates/batcher/.env.docker similarity index 100% rename from batcher/aligned-batcher/.env.docker rename to crates/batcher/.env.docker diff --git a/batcher/aligned-batcher/.env.example b/crates/batcher/.env.example similarity index 100% rename from batcher/aligned-batcher/.env.example rename to crates/batcher/.env.example diff --git a/batcher/aligned-batcher/Cargo.toml b/crates/batcher/Cargo.toml similarity index 96% rename from batcher/aligned-batcher/Cargo.toml rename to crates/batcher/Cargo.toml index 6d6adafbc0..2335b70a68 100644 --- a/batcher/aligned-batcher/Cargo.toml +++ b/crates/batcher/Cargo.toml @@ -25,7 +25,7 @@ serde_yaml = "0.9.34" sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", rev = "v5.0.0" } risc0-zkvm = { git = "https://github.com/risc0/risc0", tag = "v2.0.0" } bincode = "1.3.3" -aligned-sdk = { path = "../aligned-sdk" } +aligned-sdk = { path = "../sdk" } ciborium = "=0.2.2" priority-queue = "2.1.0" reqwest = { version = "0.12", features = ["json"] } diff --git a/batcher/aligned-batcher/build.rs b/crates/batcher/build.rs similarity index 100% rename from batcher/aligned-batcher/build.rs rename to crates/batcher/build.rs diff --git a/batcher/aligned-batcher/gnark/go.mod b/crates/batcher/gnark/go.mod similarity index 100% rename from batcher/aligned-batcher/gnark/go.mod rename to crates/batcher/gnark/go.mod diff --git a/batcher/aligned-batcher/gnark/go.sum b/crates/batcher/gnark/go.sum similarity index 100% rename from batcher/aligned-batcher/gnark/go.sum rename to crates/batcher/gnark/go.sum diff --git a/batcher/aligned-batcher/gnark/verifier.go b/crates/batcher/gnark/verifier.go similarity index 100% rename from batcher/aligned-batcher/gnark/verifier.go rename to crates/batcher/gnark/verifier.go diff --git a/batcher/aligned-batcher/rust-toolchain b/crates/batcher/rust-toolchain similarity index 100% rename from batcher/aligned-batcher/rust-toolchain rename to crates/batcher/rust-toolchain diff --git a/batcher/aligned-batcher/src/config/mod.rs b/crates/batcher/src/config/mod.rs similarity index 100% rename from batcher/aligned-batcher/src/config/mod.rs rename to crates/batcher/src/config/mod.rs diff --git a/batcher/aligned-batcher/src/connection.rs b/crates/batcher/src/connection.rs similarity index 100% rename from batcher/aligned-batcher/src/connection.rs rename to crates/batcher/src/connection.rs diff --git a/batcher/aligned-batcher/src/eth/mod.rs b/crates/batcher/src/eth/mod.rs similarity index 100% rename from batcher/aligned-batcher/src/eth/mod.rs rename to crates/batcher/src/eth/mod.rs diff --git a/batcher/aligned-batcher/src/eth/payment_service.rs b/crates/batcher/src/eth/payment_service.rs similarity index 100% rename from batcher/aligned-batcher/src/eth/payment_service.rs rename to crates/batcher/src/eth/payment_service.rs diff --git a/batcher/aligned-batcher/src/eth/service_manager.rs b/crates/batcher/src/eth/service_manager.rs similarity index 100% rename from batcher/aligned-batcher/src/eth/service_manager.rs rename to crates/batcher/src/eth/service_manager.rs diff --git a/batcher/aligned-batcher/src/eth/utils.rs b/crates/batcher/src/eth/utils.rs similarity index 100% rename from batcher/aligned-batcher/src/eth/utils.rs rename to crates/batcher/src/eth/utils.rs diff --git a/batcher/aligned-batcher/src/gnark/mod.rs b/crates/batcher/src/gnark/mod.rs similarity index 100% rename from batcher/aligned-batcher/src/gnark/mod.rs rename to crates/batcher/src/gnark/mod.rs diff --git a/batcher/aligned-batcher/src/lib.rs b/crates/batcher/src/lib.rs similarity index 100% rename from batcher/aligned-batcher/src/lib.rs rename to crates/batcher/src/lib.rs diff --git a/batcher/aligned-batcher/src/main.rs b/crates/batcher/src/main.rs similarity index 100% rename from batcher/aligned-batcher/src/main.rs rename to crates/batcher/src/main.rs diff --git a/batcher/aligned-batcher/src/metrics.rs b/crates/batcher/src/metrics.rs similarity index 100% rename from batcher/aligned-batcher/src/metrics.rs rename to crates/batcher/src/metrics.rs diff --git a/batcher/aligned-batcher/src/retry/batcher_retryables.rs b/crates/batcher/src/retry/batcher_retryables.rs similarity index 100% rename from batcher/aligned-batcher/src/retry/batcher_retryables.rs rename to crates/batcher/src/retry/batcher_retryables.rs diff --git a/batcher/aligned-batcher/src/retry/mod.rs b/crates/batcher/src/retry/mod.rs similarity index 100% rename from batcher/aligned-batcher/src/retry/mod.rs rename to crates/batcher/src/retry/mod.rs diff --git a/batcher/aligned-batcher/src/risc_zero/mod.rs b/crates/batcher/src/risc_zero/mod.rs similarity index 100% rename from batcher/aligned-batcher/src/risc_zero/mod.rs rename to crates/batcher/src/risc_zero/mod.rs diff --git a/batcher/aligned-batcher/src/s3/mod.rs b/crates/batcher/src/s3/mod.rs similarity index 100% rename from batcher/aligned-batcher/src/s3/mod.rs rename to crates/batcher/src/s3/mod.rs diff --git a/batcher/aligned-batcher/src/sp1/mod.rs b/crates/batcher/src/sp1/mod.rs similarity index 100% rename from batcher/aligned-batcher/src/sp1/mod.rs rename to crates/batcher/src/sp1/mod.rs diff --git a/batcher/aligned-batcher/src/telemetry/mod.rs b/crates/batcher/src/telemetry/mod.rs similarity index 100% rename from batcher/aligned-batcher/src/telemetry/mod.rs rename to crates/batcher/src/telemetry/mod.rs diff --git a/batcher/aligned-batcher/src/telemetry/sender.rs b/crates/batcher/src/telemetry/sender.rs similarity index 100% rename from batcher/aligned-batcher/src/telemetry/sender.rs rename to crates/batcher/src/telemetry/sender.rs diff --git a/batcher/aligned-batcher/src/types/batch_queue.rs b/crates/batcher/src/types/batch_queue.rs similarity index 100% rename from batcher/aligned-batcher/src/types/batch_queue.rs rename to crates/batcher/src/types/batch_queue.rs diff --git a/batcher/aligned-batcher/src/types/batch_state.rs b/crates/batcher/src/types/batch_state.rs similarity index 100% rename from batcher/aligned-batcher/src/types/batch_state.rs rename to crates/batcher/src/types/batch_state.rs diff --git a/batcher/aligned-batcher/src/types/errors.rs b/crates/batcher/src/types/errors.rs similarity index 100% rename from batcher/aligned-batcher/src/types/errors.rs rename to crates/batcher/src/types/errors.rs diff --git a/batcher/aligned-batcher/src/types/mod.rs b/crates/batcher/src/types/mod.rs similarity index 100% rename from batcher/aligned-batcher/src/types/mod.rs rename to crates/batcher/src/types/mod.rs diff --git a/batcher/aligned-batcher/src/types/user_state.rs b/crates/batcher/src/types/user_state.rs similarity index 100% rename from batcher/aligned-batcher/src/types/user_state.rs rename to crates/batcher/src/types/user_state.rs diff --git a/batcher/aligned-batcher/src/zk_utils/mod.rs b/crates/batcher/src/zk_utils/mod.rs similarity index 100% rename from batcher/aligned-batcher/src/zk_utils/mod.rs rename to crates/batcher/src/zk_utils/mod.rs diff --git a/batcher/aligned/Cargo.toml b/crates/cli/Cargo.toml similarity index 94% rename from batcher/aligned/Cargo.toml rename to crates/cli/Cargo.toml index 892aecaff5..238a751ebe 100644 --- a/batcher/aligned/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -25,6 +25,6 @@ env_logger = "0.11.3" clap = { version = "4.5.4", features = ["derive"] } lambdaworks-crypto = { git = "https://github.com/lambdaclass/lambdaworks.git", rev = "efd46f0b0aea3aa95d94bba7de86cb96611b40d3", features = ["serde"] } ethers = { version = "2.0", features = ["ws", "rustls"] } -aligned-sdk = { path = "../aligned-sdk" } +aligned-sdk = { path = "../sdk" } rpassword = "7.3.1" sha3 = { version = "0.10.8" } diff --git a/batcher/aligned/abi/AlignedLayerServiceManager.json b/crates/cli/abi/AlignedLayerServiceManager.json similarity index 100% rename from batcher/aligned/abi/AlignedLayerServiceManager.json rename to crates/cli/abi/AlignedLayerServiceManager.json diff --git a/batcher/aligned/generate_proof_and_send.sh b/crates/cli/generate_proof_and_send.sh similarity index 97% rename from batcher/aligned/generate_proof_and_send.sh rename to crates/cli/generate_proof_and_send.sh index 0decf36f4c..f87c1cd51e 100755 --- a/batcher/aligned/generate_proof_and_send.sh +++ b/crates/cli/generate_proof_and_send.sh @@ -32,7 +32,7 @@ if [ -z "$NETWORK" ]; then fi cmd=( - ./batcher/target/release/aligned + ./crates/target/release/aligned submit --proving_system Groth16Bn254 --repetitions "$repetitions" diff --git a/batcher/aligned/get_proof_test_files.sh b/crates/cli/get_proof_test_files.sh similarity index 100% rename from batcher/aligned/get_proof_test_files.sh rename to crates/cli/get_proof_test_files.sh diff --git a/batcher/aligned/install_aligned.sh b/crates/cli/install_aligned.sh similarity index 100% rename from batcher/aligned/install_aligned.sh rename to crates/cli/install_aligned.sh diff --git a/batcher/aligned-task-sender/rust-toolchain b/crates/cli/rust-toolchain similarity index 100% rename from batcher/aligned-task-sender/rust-toolchain rename to crates/cli/rust-toolchain diff --git a/batcher/aligned/send_burst_tasks.sh b/crates/cli/send_burst_tasks.sh similarity index 90% rename from batcher/aligned/send_burst_tasks.sh rename to crates/cli/send_burst_tasks.sh index f46464aa6c..9cc2db2699 100755 --- a/batcher/aligned/send_burst_tasks.sh +++ b/crates/cli/send_burst_tasks.sh @@ -27,7 +27,7 @@ fi while true do # Run in backaground to be able to run onece per second, and not wait for the previous one to finish - . ./batcher/aligned/generate_proof_and_send.sh $counter $burst & + . ./crates/cli/generate_proof_and_send.sh $counter $burst & sleep 3 counter=$((counter + 1)) done diff --git a/batcher/aligned/send_burst_with_random_address.sh b/crates/cli/send_burst_with_random_address.sh similarity index 100% rename from batcher/aligned/send_burst_with_random_address.sh rename to crates/cli/send_burst_with_random_address.sh diff --git a/batcher/aligned/send_infinite_sp1_tasks/requirements.txt b/crates/cli/send_infinite_sp1_tasks/requirements.txt similarity index 100% rename from batcher/aligned/send_infinite_sp1_tasks/requirements.txt rename to crates/cli/send_infinite_sp1_tasks/requirements.txt diff --git a/batcher/aligned/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh b/crates/cli/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh similarity index 97% rename from batcher/aligned/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh rename to crates/cli/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh index 620a465719..3f1487422a 100755 --- a/batcher/aligned/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh +++ b/crates/cli/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh @@ -18,7 +18,7 @@ if [ -z "$NETWORK" ]; then NETWORK="devnet" fi -cd ./batcher/aligned +cd ./crates/cli while true do diff --git a/batcher/aligned/send_infinite_tasks.sh b/crates/cli/send_infinite_tasks.sh similarity index 95% rename from batcher/aligned/send_infinite_tasks.sh rename to crates/cli/send_infinite_tasks.sh index 21113c9994..2a657c5e35 100755 --- a/batcher/aligned/send_infinite_tasks.sh +++ b/crates/cli/send_infinite_tasks.sh @@ -26,7 +26,7 @@ do go run scripts/test_files/gnark_groth16_bn254_infinite_script/cmd/main.go $counter - cd ./batcher/aligned && cargo run --release -- submit \ + cd ./crates/cli && cargo run --release -- submit \ --proving_system Groth16Bn254 \ --proof ../../scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_${counter}_groth16_0_12_0.proof \ --public_input ../../scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_${counter}_groth16_0_12_0.pub \ diff --git a/batcher/aligned/send_proof_with_random_address.sh b/crates/cli/send_proof_with_random_address.sh similarity index 100% rename from batcher/aligned/send_proof_with_random_address.sh rename to crates/cli/send_proof_with_random_address.sh diff --git a/batcher/aligned/src/main.rs b/crates/cli/src/main.rs similarity index 100% rename from batcher/aligned/src/main.rs rename to crates/cli/src/main.rs diff --git a/batcher/aligned-sdk/Cargo.toml b/crates/sdk/Cargo.toml similarity index 100% rename from batcher/aligned-sdk/Cargo.toml rename to crates/sdk/Cargo.toml diff --git a/batcher/aligned-sdk/abi/AlignedLayerServiceManager.json b/crates/sdk/abi/AlignedLayerServiceManager.json similarity index 100% rename from batcher/aligned-sdk/abi/AlignedLayerServiceManager.json rename to crates/sdk/abi/AlignedLayerServiceManager.json diff --git a/batcher/aligned-sdk/abi/AlignedProofAggregationService.json b/crates/sdk/abi/AlignedProofAggregationService.json similarity index 100% rename from batcher/aligned-sdk/abi/AlignedProofAggregationService.json rename to crates/sdk/abi/AlignedProofAggregationService.json diff --git a/batcher/aligned-sdk/abi/BatcherPaymentService.json b/crates/sdk/abi/BatcherPaymentService.json similarity index 100% rename from batcher/aligned-sdk/abi/BatcherPaymentService.json rename to crates/sdk/abi/BatcherPaymentService.json diff --git a/batcher/aligned-sdk/src/aggregation_layer/helpers.rs b/crates/sdk/src/aggregation_layer/helpers.rs similarity index 100% rename from batcher/aligned-sdk/src/aggregation_layer/helpers.rs rename to crates/sdk/src/aggregation_layer/helpers.rs diff --git a/batcher/aligned-sdk/src/aggregation_layer/mod.rs b/crates/sdk/src/aggregation_layer/mod.rs similarity index 100% rename from batcher/aligned-sdk/src/aggregation_layer/mod.rs rename to crates/sdk/src/aggregation_layer/mod.rs diff --git a/batcher/aligned-sdk/src/aggregation_layer/types.rs b/crates/sdk/src/aggregation_layer/types.rs similarity index 100% rename from batcher/aligned-sdk/src/aggregation_layer/types.rs rename to crates/sdk/src/aggregation_layer/types.rs diff --git a/batcher/aligned-sdk/src/beacon.rs b/crates/sdk/src/beacon.rs similarity index 100% rename from batcher/aligned-sdk/src/beacon.rs rename to crates/sdk/src/beacon.rs diff --git a/batcher/aligned-sdk/src/common/constants.rs b/crates/sdk/src/common/constants.rs similarity index 100% rename from batcher/aligned-sdk/src/common/constants.rs rename to crates/sdk/src/common/constants.rs diff --git a/batcher/aligned-sdk/src/common/errors.rs b/crates/sdk/src/common/errors.rs similarity index 100% rename from batcher/aligned-sdk/src/common/errors.rs rename to crates/sdk/src/common/errors.rs diff --git a/batcher/aligned-sdk/src/common/mod.rs b/crates/sdk/src/common/mod.rs similarity index 100% rename from batcher/aligned-sdk/src/common/mod.rs rename to crates/sdk/src/common/mod.rs diff --git a/batcher/aligned-sdk/src/common/types.rs b/crates/sdk/src/common/types.rs similarity index 100% rename from batcher/aligned-sdk/src/common/types.rs rename to crates/sdk/src/common/types.rs diff --git a/batcher/aligned-sdk/src/communication/batch.rs b/crates/sdk/src/communication/batch.rs similarity index 100% rename from batcher/aligned-sdk/src/communication/batch.rs rename to crates/sdk/src/communication/batch.rs diff --git a/batcher/aligned-sdk/src/communication/messaging.rs b/crates/sdk/src/communication/messaging.rs similarity index 100% rename from batcher/aligned-sdk/src/communication/messaging.rs rename to crates/sdk/src/communication/messaging.rs diff --git a/batcher/aligned-sdk/src/communication/mod.rs b/crates/sdk/src/communication/mod.rs similarity index 100% rename from batcher/aligned-sdk/src/communication/mod.rs rename to crates/sdk/src/communication/mod.rs diff --git a/batcher/aligned-sdk/src/communication/protocol.rs b/crates/sdk/src/communication/protocol.rs similarity index 100% rename from batcher/aligned-sdk/src/communication/protocol.rs rename to crates/sdk/src/communication/protocol.rs diff --git a/batcher/aligned-sdk/src/communication/serialization.rs b/crates/sdk/src/communication/serialization.rs similarity index 100% rename from batcher/aligned-sdk/src/communication/serialization.rs rename to crates/sdk/src/communication/serialization.rs diff --git a/batcher/aligned-sdk/src/eth/aligned_proof_agg_service.rs b/crates/sdk/src/eth/aligned_proof_agg_service.rs similarity index 100% rename from batcher/aligned-sdk/src/eth/aligned_proof_agg_service.rs rename to crates/sdk/src/eth/aligned_proof_agg_service.rs diff --git a/batcher/aligned-sdk/src/eth/aligned_service_manager.rs b/crates/sdk/src/eth/aligned_service_manager.rs similarity index 100% rename from batcher/aligned-sdk/src/eth/aligned_service_manager.rs rename to crates/sdk/src/eth/aligned_service_manager.rs diff --git a/batcher/aligned-sdk/src/eth/batcher_payment_service.rs b/crates/sdk/src/eth/batcher_payment_service.rs similarity index 100% rename from batcher/aligned-sdk/src/eth/batcher_payment_service.rs rename to crates/sdk/src/eth/batcher_payment_service.rs diff --git a/batcher/aligned-sdk/src/eth/mod.rs b/crates/sdk/src/eth/mod.rs similarity index 100% rename from batcher/aligned-sdk/src/eth/mod.rs rename to crates/sdk/src/eth/mod.rs diff --git a/batcher/aligned-sdk/src/lib.rs b/crates/sdk/src/lib.rs similarity index 100% rename from batcher/aligned-sdk/src/lib.rs rename to crates/sdk/src/lib.rs diff --git a/batcher/aligned-sdk/src/verification_layer/mod.rs b/crates/sdk/src/verification_layer/mod.rs similarity index 99% rename from batcher/aligned-sdk/src/verification_layer/mod.rs rename to crates/sdk/src/verification_layer/mod.rs index 392e558a4d..8f3888b11a 100644 --- a/batcher/aligned-sdk/src/verification_layer/mod.rs +++ b/crates/sdk/src/verification_layer/mod.rs @@ -178,7 +178,7 @@ pub async fn calculate_fee_per_proof_for_batch_of_size( // Price of 1 proof in a batch of size `num_proofs_in_batch` i.e. (1 / `num_proofs_in_batch`). // The computed price is adjusted with respect to the percentage multiplier from: - // https://github.com/yetanotherco/aligned_layer/blob/staging/batcher/aligned-batcher/src/lib.rs#L1401 + // https://github.com/yetanotherco/aligned_layer/blob/staging/crates/batcher/src/lib.rs#L1401 let fee_per_proof = (U256::from(estimated_gas_per_proof) * gas_price * U256::from(GAS_PRICE_PERCENTAGE_MULTIPLIER)) diff --git a/batcher/aligned-sdk/test_files/groth16_bn254/plonk.proof b/crates/sdk/test_files/groth16_bn254/plonk.proof similarity index 100% rename from batcher/aligned-sdk/test_files/groth16_bn254/plonk.proof rename to crates/sdk/test_files/groth16_bn254/plonk.proof diff --git a/batcher/aligned-sdk/test_files/groth16_bn254/plonk.vk b/crates/sdk/test_files/groth16_bn254/plonk.vk similarity index 100% rename from batcher/aligned-sdk/test_files/groth16_bn254/plonk.vk rename to crates/sdk/test_files/groth16_bn254/plonk.vk diff --git a/batcher/aligned-sdk/test_files/groth16_bn254/plonk_pub_input.pub b/crates/sdk/test_files/groth16_bn254/plonk_pub_input.pub similarity index 100% rename from batcher/aligned-sdk/test_files/groth16_bn254/plonk_pub_input.pub rename to crates/sdk/test_files/groth16_bn254/plonk_pub_input.pub diff --git a/batcher/aligned-sdk/test_files/sp1/sp1_fibonacci.elf b/crates/sdk/test_files/sp1/sp1_fibonacci.elf similarity index 100% rename from batcher/aligned-sdk/test_files/sp1/sp1_fibonacci.elf rename to crates/sdk/test_files/sp1/sp1_fibonacci.elf diff --git a/batcher/aligned-sdk/test_files/sp1/sp1_fibonacci.proof b/crates/sdk/test_files/sp1/sp1_fibonacci.proof similarity index 100% rename from batcher/aligned-sdk/test_files/sp1/sp1_fibonacci.proof rename to crates/sdk/test_files/sp1/sp1_fibonacci.proof diff --git a/batcher/aligned-task-sender/Cargo.toml b/crates/task-sender/Cargo.toml similarity index 94% rename from batcher/aligned-task-sender/Cargo.toml rename to crates/task-sender/Cargo.toml index 94f08fb5ef..50d7099e2c 100644 --- a/batcher/aligned-task-sender/Cargo.toml +++ b/crates/task-sender/Cargo.toml @@ -27,6 +27,6 @@ log = "0.4.21" env_logger = "0.11.3" clap = { version = "4.5.4", features = ["derive"] } ethers = { version = "2.0", features = ["ws", "rustls", "eip712"] } -aligned-sdk = { path = "../aligned-sdk" } +aligned-sdk = { path = "../sdk" } rpassword = "7.3.1" sha3 = { version = "0.10.8" } diff --git a/batcher/aligned-task-sender/README.md b/crates/task-sender/README.md similarity index 100% rename from batcher/aligned-task-sender/README.md rename to crates/task-sender/README.md diff --git a/batcher/aligned/rust-toolchain b/crates/task-sender/rust-toolchain similarity index 100% rename from batcher/aligned/rust-toolchain rename to crates/task-sender/rust-toolchain diff --git a/batcher/aligned-task-sender/src/commands.rs b/crates/task-sender/src/commands.rs similarity index 100% rename from batcher/aligned-task-sender/src/commands.rs rename to crates/task-sender/src/commands.rs diff --git a/batcher/aligned-task-sender/src/lib.rs b/crates/task-sender/src/lib.rs similarity index 100% rename from batcher/aligned-task-sender/src/lib.rs rename to crates/task-sender/src/lib.rs diff --git a/batcher/aligned-task-sender/src/main.rs b/crates/task-sender/src/main.rs similarity index 100% rename from batcher/aligned-task-sender/src/main.rs rename to crates/task-sender/src/main.rs diff --git a/batcher/aligned-task-sender/src/structs.rs b/crates/task-sender/src/structs.rs similarity index 100% rename from batcher/aligned-task-sender/src/structs.rs rename to crates/task-sender/src/structs.rs diff --git a/batcher/aligned-task-sender/wallets/devnet b/crates/task-sender/wallets/devnet similarity index 100% rename from batcher/aligned-task-sender/wallets/devnet rename to crates/task-sender/wallets/devnet diff --git a/batcher/aligned-task-sender/wallets/devnet-backup b/crates/task-sender/wallets/devnet-backup similarity index 100% rename from batcher/aligned-task-sender/wallets/devnet-backup rename to crates/task-sender/wallets/devnet-backup diff --git a/batcher/aligned-task-sender/wallets/holesky-stage b/crates/task-sender/wallets/holesky-stage similarity index 100% rename from batcher/aligned-task-sender/wallets/holesky-stage rename to crates/task-sender/wallets/holesky-stage diff --git a/docker/aligned_base.Dockerfile b/docker/aligned_base.Dockerfile index 24d48c0e8c..3bd9a2af39 100644 --- a/docker/aligned_base.Dockerfile +++ b/docker/aligned_base.Dockerfile @@ -61,7 +61,7 @@ RUN cargo chef prepare --recipe-path /aligned_layer/operator/merkle_tree/lib/rec FROM chef AS chef_builder -COPY batcher/aligned-sdk /aligned_layer/batcher/aligned-sdk/ +COPY crates/sdk /aligned_layer/crates/sdk/ # build_sp1_linux COPY operator/sp1/ /aligned_layer/operator/sp1/ @@ -88,8 +88,8 @@ ENV TARGET_REL_PATH=release ENV CARGO_NET_GIT_FETCH_WITH_CLI=true COPY operator/ /aligned_layer/operator/ -COPY batcher/ /aligned_layer/batcher/ -COPY --from=chef_builder /aligned_layer/batcher/aligned-sdk /aligned_layer/batcher/aligned-sdk +COPY crates/ /aligned_layer/crates/ +COPY --from=chef_builder /aligned_layer/crates/sdk /aligned_layer/crates/sdk # build_sp1_linux COPY --from=chef_builder /aligned_layer/operator/sp1/lib/target/ /aligned_layer/operator/sp1/lib/target/ diff --git a/docker/batcher.Dockerfile b/docker/batcher.Dockerfile index 0f7689abb8..399b124cb2 100644 --- a/docker/batcher.Dockerfile +++ b/docker/batcher.Dockerfile @@ -2,46 +2,46 @@ FROM ghcr.io/yetanotherco/aligned_layer/aligned_base:latest AS base COPY go.mod . COPY go.sum . -COPY batcher/aligned-batcher/gnark/verifier.go /aligned_layer/batcher/aligned-batcher/gnark/verifier.go +COPY crates/batcher/gnark/verifier.go /aligned_layer/crates/batcher/gnark/verifier.go RUN apt update -y && apt install -y gcc -RUN go build -buildmode=c-archive -o libverifier.a /aligned_layer/batcher/aligned-batcher/gnark/verifier.go +RUN go build -buildmode=c-archive -o libverifier.a /aligned_layer/crates/batcher/gnark/verifier.go FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef FROM chef AS planner -COPY batcher/aligned-batcher/Cargo.toml /aligned_layer/batcher/aligned-batcher/Cargo.toml -COPY batcher/aligned-batcher/src/main.rs /aligned_layer/batcher/aligned-batcher/src/main.rs -WORKDIR /aligned_layer/batcher/aligned-batcher/ -RUN cargo chef prepare --recipe-path /aligned_layer/batcher/aligned-batcher/recipe.json +COPY crates/batcher/Cargo.toml /aligned_layer/crates/batcher/Cargo.toml +COPY crates/batcher/src/main.rs /aligned_layer/crates/batcher/src/main.rs +WORKDIR /aligned_layer/crates/batcher/ +RUN cargo chef prepare --recipe-path /aligned_layer/crates/batcher/recipe.json -COPY batcher/aligned/Cargo.toml /aligned_layer/batcher/aligned/Cargo.toml -COPY batcher/aligned/src/main.rs /aligned_layer/batcher/aligned/src/main.rs -WORKDIR /aligned_layer/batcher/aligned/ -RUN cargo chef prepare --recipe-path /aligned_layer/batcher/aligned/recipe.json +COPY crates/cli/Cargo.toml /aligned_layer/crates/cli/Cargo.toml +COPY crates/cli/src/main.rs /aligned_layer/crates/cli/src/main.rs +WORKDIR /aligned_layer/crates/cli/ +RUN cargo chef prepare --recipe-path /aligned_layer/crates/cli/recipe.json FROM chef AS chef_builder -COPY batcher/aligned-sdk/ /aligned_layer/batcher/aligned-sdk/ +COPY crates/sdk/ /aligned_layer/crates/sdk/ -COPY --from=planner /aligned_layer/batcher/aligned-batcher/recipe.json /aligned_layer/batcher/aligned-batcher/recipe.json -WORKDIR /aligned_layer/batcher/aligned-batcher -RUN cargo chef cook --release --recipe-path /aligned_layer/batcher/aligned-batcher/recipe.json +COPY --from=planner /aligned_layer/crates/batcher/recipe.json /aligned_layer/crates/batcher/recipe.json +WORKDIR /aligned_layer/crates/batcher +RUN cargo chef cook --release --recipe-path /aligned_layer/crates/batcher/recipe.json -COPY --from=planner /aligned_layer/batcher/aligned/recipe.json /aligned_layer/batcher/aligned/recipe.json -WORKDIR /aligned_layer/batcher/aligned/ -RUN cargo chef cook --release --recipe-path /aligned_layer/batcher/aligned/recipe.json +COPY --from=planner /aligned_layer/crates/cli/recipe.json /aligned_layer/crates/cli/recipe.json +WORKDIR /aligned_layer/crates/cli/ +RUN cargo chef cook --release --recipe-path /aligned_layer/crates/cli/recipe.json FROM base AS builder COPY . /aligned_layer/ -COPY --from=chef_builder /aligned_layer/batcher/aligned-batcher/target/ /aligned_layer/batcher/aligned-batcher/target/ -WORKDIR /aligned_layer/batcher/aligned-batcher/ -RUN cargo build --manifest-path /aligned_layer/batcher/aligned-batcher/Cargo.toml --release +COPY --from=chef_builder /aligned_layer/crates/batcher/target/ /aligned_layer/crates/batcher/target/ +WORKDIR /aligned_layer/crates/batcher/ +RUN cargo build --manifest-path /aligned_layer/crates/batcher/Cargo.toml --release -COPY --from=chef_builder /aligned_layer/batcher/aligned/target/ /aligned_layer/batcher/aligned/target/ -WORKDIR /aligned_layer/batcher/aligned/ -RUN cargo build --manifest-path /aligned_layer/batcher/aligned/Cargo.toml --release +COPY --from=chef_builder /aligned_layer/crates/cli/target/ /aligned_layer/crates/cli/target/ +WORKDIR /aligned_layer/crates/cli/ +RUN cargo build --manifest-path /aligned_layer/crates/cli/Cargo.toml --release COPY scripts/test_files/gnark_groth16_bn254_infinite_script/ /aligned_layer/scripts/test_files/gnark_groth16_bn254_infinite_script/ WORKDIR /aligned_layer @@ -52,8 +52,8 @@ RUN rm -rf operator/ FROM debian:bookworm-slim AS final COPY --from=builder /aligned_layer /aligned_layer -COPY --from=builder /aligned_layer/batcher/target/release/aligned-batcher /usr/local/bin/ -COPY --from=builder /aligned_layer/batcher/target/release/aligned /usr/local/bin/ +COPY --from=builder /aligned_layer/crates/target/release/aligned-batcher /usr/local/bin/ +COPY --from=builder /aligned_layer/crates/target/release/aligned /usr/local/bin/ COPY --from=builder /aligned_layer/gnark_groth16_bn254_infinite_script /usr/local/bin COPY ./contracts/script ./contracts/script COPY ../scripts/test_files/ ./scripts/test_files diff --git a/docs/1_introduction/1_try_aligned.md b/docs/1_introduction/1_try_aligned.md index 717f8ad6f6..d6bd7fe7ba 100644 --- a/docs/1_introduction/1_try_aligned.md +++ b/docs/1_introduction/1_try_aligned.md @@ -14,15 +14,15 @@ We will download a previously generated SP1 proof, send it to Aligned for verifi 1. Download and install Aligned to send proofs in the testnet: ```bash -curl -L https://raw.githubusercontent.com/yetanotherco/aligned_layer/main/batcher/aligned/install_aligned.sh | bash +curl -L https://raw.githubusercontent.com/yetanotherco/aligned_layer/main/crates/cli/install_aligned.sh | bash ``` -2. Run the ```source``` command that should appear in the shell +2. Run the `source` command that should appear in the shell 3. Download the example SP1 proof file together with the ELF file of the proved program using: ```bash -curl -L https://raw.githubusercontent.com/yetanotherco/aligned_layer/main/batcher/aligned/get_proof_test_files.sh | bash +curl -L https://raw.githubusercontent.com/yetanotherco/aligned_layer/main/crates/cli/get_proof_test_files.sh | bash ``` 4. Send the proof to be verified in Aligned with @@ -56,7 +56,7 @@ Use the link in the response to check the status of your transaction in the Alig aligned verify-proof-onchain \ --aligned-verification-data ~/.aligned/aligned_verification_data/*.cbor \ --rpc_url https://ethereum-holesky-rpc.publicnode.com \ ---network holesky +--network holesky ``` This is reading the result of the proof verification in Ethereum. @@ -74,9 +74,10 @@ If the proof wasn't verified, you should get this result: ``` Aligned works in: -- macOS Arm64 (M1 or higher) -- Linux x86 with GLIBC_2.32 or superior (For example, Ubuntu 22.04 or higher) + +- macOS Arm64 (M1 or higher) +- Linux x86 with GLIBC_2.32 or superior (For example, Ubuntu 22.04 or higher) If you don't meet these requirements, you can compile the binaries yourself following the [README](https://github.com/yetanotherco/aligned_layer) -To try Aligned with other proving systems, check [this](../3_guides/0_submitting_proofs.md) guide +To try Aligned with other proving systems, check [this](../3_guides/0_submitting_proofs.md) guide diff --git a/docs/3_guides/6_setup_aligned.md b/docs/3_guides/6_setup_aligned.md index 35b617357f..5ff947f6cd 100644 --- a/docs/3_guides/6_setup_aligned.md +++ b/docs/3_guides/6_setup_aligned.md @@ -126,7 +126,7 @@ make batcher_start_local This starts a [localstack](https://www.localstack.cloud/) to act as a replacement for S3. -If you want to use the batcher under a real `S3` connection you'll need to specify the environment variables under `batcher/aligned-batcher/.env` and then run: +If you want to use the batcher under a real `S3` connection you'll need to specify the environment variables under `crates/batcher/.env` and then run: ```bash make batcher_start diff --git a/docs/3_guides/9_aligned_cli.md b/docs/3_guides/9_aligned_cli.md index 79699dda1a..174763229a 100644 --- a/docs/3_guides/9_aligned_cli.md +++ b/docs/3_guides/9_aligned_cli.md @@ -9,7 +9,7 @@ This document serves as a reference for the commands of the Aligned CLI. 1. Download and install Aligned from the Aligned GitHub repo `https://github.com/yetanotherco/aligned_layer`: ```bash - curl -L https://raw.githubusercontent.com/yetanotherco/aligned_layer/main/batcher/aligned/install_aligned.sh | bash + curl -L https://raw.githubusercontent.com/yetanotherco/aligned_layer/main/crates/cli/install_aligned.sh | bash ``` 2. A source command will be printed in your terminal after installation. Execute that command to update your shell environment. diff --git a/examples/validating-public-input/aligned-integration/Cargo.toml b/examples/validating-public-input/aligned-integration/Cargo.toml index 7483a98515..b88767ce07 100644 --- a/examples/validating-public-input/aligned-integration/Cargo.toml +++ b/examples/validating-public-input/aligned-integration/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -aligned-sdk = { path = "../../../batcher/aligned-sdk" } +aligned-sdk = { path = "../../../crates/sdk" } tokio = { version = "1.45.1", features = [ "io-std", "time", diff --git a/examples/zkquiz/quiz/script/Cargo.toml b/examples/zkquiz/quiz/script/Cargo.toml index 2d85704491..de78505b00 100644 --- a/examples/zkquiz/quiz/script/Cargo.toml +++ b/examples/zkquiz/quiz/script/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git", rev = "v5.0.0" } -aligned-sdk = { path = "../../../../batcher/aligned-sdk" } +aligned-sdk = { path = "../../../../crates/sdk" } ethers = { version = "2.0", features = ["ws", "rustls"] } rpassword = "7.3.1" diff --git a/infra/ansible/playbooks/templates/services/batcher.service.j2 b/infra/ansible/playbooks/templates/services/batcher.service.j2 index 231e319633..106abd538c 100644 --- a/infra/ansible/playbooks/templates/services/batcher.service.j2 +++ b/infra/ansible/playbooks/templates/services/batcher.service.j2 @@ -4,7 +4,7 @@ After=network.target [Service] Type=simple -WorkingDirectory=/home/{{ ansible_user }}/repos/batcher/aligned_layer/batcher +WorkingDirectory=/home/{{ ansible_user }}/repos/batcher/aligned_layer/crates ExecStart=/home/{{ ansible_user }}/.cargo/bin/aligned-batcher --config /home/{{ ansible_user }}/config/config-batcher.yaml --env-file /home/{{ ansible_user }}/config/.env.batcher Restart=always RestartSec=1 diff --git a/infra/services/batcher.service b/infra/services/batcher.service index 0b27ddef6a..324bd6b4fa 100644 --- a/infra/services/batcher.service +++ b/infra/services/batcher.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=simple -WorkingDirectory=/home/{{ ansible_user }}/repos/batcher/aligned_layer/batcher +WorkingDirectory=/home/{{ ansible_user }}/repos/batcher/aligned_layer/crates ExecStart=/home/{{ ansible_user }}/.cargo/bin/aligned-batcher --config /home/{{ ansible_user }}/config/config-batcher-holesky.yaml --env-file /home/{{ ansible_user }}/config/.env.batcher Restart=always RestartSec=1 diff --git a/operator/merkle_tree/lib/Cargo.toml b/operator/merkle_tree/lib/Cargo.toml index 3e019ea662..ca59bfc7ad 100644 --- a/operator/merkle_tree/lib/Cargo.toml +++ b/operator/merkle_tree/lib/Cargo.toml @@ -10,7 +10,7 @@ bincode = "1.3.3" lambdaworks-crypto = { git = "https://github.com/lambdaclass/lambdaworks.git", rev = "5f8f2cfcc8a1a22f77e8dff2d581f1166eefb80b", features = ["serde"] } hex = "0.4.3" sha3 = "0.10.8" -aligned-sdk = { path = "../../../batcher/aligned-sdk" } +aligned-sdk = { path = "../../../crates/sdk" } ciborium = "=0.2.2" log = "0.4.21"