From b5ebe9a037a9791f2da4d04b492fc244a31ee07e Mon Sep 17 00:00:00 2001 From: Marcos Nicolau Date: Tue, 27 May 2025 12:28:26 -0300 Subject: [PATCH 1/8] refactor: rename batcher to crates --- aggregation_mode/Cargo.toml | 2 +- batcher/Cargo.toml | 3 --- batcher/package-lock.json | 6 ------ .../proof-aggregator.last_aggregated_block.json | 2 +- {batcher => crates}/Cargo.lock | 0 crates/Cargo.toml | 6 ++++++ .../aligned-batcher => crates/batcher}/.env.dev | 0 .../aligned-batcher => crates/batcher}/.env.docker | 0 .../aligned-batcher => crates/batcher}/.env.example | 0 .../aligned-batcher => crates/batcher}/Cargo.toml | 2 +- .../aligned-batcher => crates/batcher}/build.rs | 0 .../aligned-batcher => crates/batcher}/gnark/go.mod | 0 .../aligned-batcher => crates/batcher}/gnark/go.sum | 0 .../batcher}/gnark/verifier.go | 0 .../batcher}/rust-toolchain | 0 .../batcher}/src/config/mod.rs | 0 .../batcher}/src/connection.rs | 0 .../batcher}/src/eth/mod.rs | 0 .../batcher}/src/eth/payment_service.rs | 0 .../batcher}/src/eth/service_manager.rs | 0 .../batcher}/src/eth/utils.rs | 0 .../batcher}/src/gnark/mod.rs | 0 .../aligned-batcher => crates/batcher}/src/lib.rs | 0 .../aligned-batcher => crates/batcher}/src/main.rs | 0 .../batcher}/src/metrics.rs | 0 .../batcher}/src/retry/batcher_retryables.rs | 0 .../batcher}/src/retry/mod.rs | 0 .../batcher}/src/risc_zero/mod.rs | 0 .../batcher}/src/s3/mod.rs | 0 .../batcher}/src/sp1/mod.rs | 0 .../batcher}/src/telemetry/mod.rs | 0 .../batcher}/src/telemetry/sender.rs | 0 .../batcher}/src/types/batch_queue.rs | 0 .../batcher}/src/types/batch_state.rs | 0 .../batcher}/src/types/errors.rs | 0 .../batcher}/src/types/mod.rs | 0 .../batcher}/src/types/user_state.rs | 0 .../batcher}/src/zk_utils/mod.rs | 0 {batcher/aligned => crates/cli}/Cargo.toml | 2 +- .../cli}/abi/AlignedLayerServiceManager.json | 0 .../cli}/generate_proof_and_send.sh | 0 .../aligned => crates/cli}/get_proof_test_files.sh | 0 {batcher/aligned => crates/cli}/install_aligned.sh | 0 .../cli}/rust-toolchain | 0 {batcher/aligned => crates/cli}/send_burst_tasks.sh | 0 .../cli}/send_burst_with_random_address.sh | 0 .../cli}/send_infinite_sp1_tasks/requirements.txt | 0 .../send_infinite_sp1_tasks.sh | 0 .../aligned => crates/cli}/send_infinite_tasks.sh | 0 .../cli}/send_proof_with_random_address.sh | 0 {batcher/aligned => crates/cli}/src/main.rs | 0 {batcher/aligned-sdk => crates/sdk}/Cargo.toml | 0 .../sdk}/abi/AlignedLayerServiceManager.json | 0 .../sdk}/abi/AlignedProofAggregationService.json | 0 .../sdk}/abi/BatcherPaymentService.json | 0 .../sdk}/src/aggregation_layer/helpers.rs | 0 .../sdk}/src/aggregation_layer/mod.rs | 0 .../sdk}/src/aggregation_layer/types.rs | 0 {batcher/aligned-sdk => crates/sdk}/src/beacon.rs | 0 .../sdk}/src/common/constants.rs | 0 .../aligned-sdk => crates/sdk}/src/common/errors.rs | 0 .../aligned-sdk => crates/sdk}/src/common/mod.rs | 0 .../aligned-sdk => crates/sdk}/src/common/types.rs | 0 .../sdk}/src/communication/batch.rs | 0 .../sdk}/src/communication/messaging.rs | 0 .../sdk}/src/communication/mod.rs | 0 .../sdk}/src/communication/protocol.rs | 0 .../sdk}/src/communication/serialization.rs | 0 .../sdk}/src/eth/aligned_proof_agg_service.rs | 0 .../sdk}/src/eth/aligned_service_manager.rs | 0 .../sdk}/src/eth/batcher_payment_service.rs | 0 {batcher/aligned-sdk => crates/sdk}/src/eth/mod.rs | 0 {batcher/aligned-sdk => crates/sdk}/src/lib.rs | 0 .../sdk}/src/verification_layer/mod.rs | 0 .../sdk}/test_files/groth16_bn254/plonk.proof | Bin .../sdk}/test_files/groth16_bn254/plonk.vk | Bin .../test_files/groth16_bn254/plonk_pub_input.pub | Bin .../sdk}/test_files/sp1/sp1_fibonacci.elf | Bin .../sdk}/test_files/sp1/sp1_fibonacci.proof | Bin .../task-sender}/Cargo.toml | 2 +- .../task-sender}/README.md | 0 .../aligned => crates/task-sender}/rust-toolchain | 0 .../task-sender}/src/commands.rs | 0 .../task-sender}/src/lib.rs | 0 .../task-sender}/src/main.rs | 0 .../task-sender}/src/structs.rs | 0 .../task-sender}/wallets/devnet | 0 .../task-sender}/wallets/devnet-backup | 0 .../task-sender}/wallets/holesky-stage | 0 .../aligned-integration/Cargo.toml | 2 +- examples/zkquiz/quiz/script/Cargo.toml | 2 +- operator/merkle_tree/lib/Cargo.toml | 2 +- 92 files changed, 14 insertions(+), 17 deletions(-) delete mode 100644 batcher/Cargo.toml delete mode 100644 batcher/package-lock.json rename {batcher => crates}/Cargo.lock (100%) create mode 100644 crates/Cargo.toml rename {batcher/aligned-batcher => crates/batcher}/.env.dev (100%) rename {batcher/aligned-batcher => crates/batcher}/.env.docker (100%) rename {batcher/aligned-batcher => crates/batcher}/.env.example (100%) rename {batcher/aligned-batcher => crates/batcher}/Cargo.toml (96%) rename {batcher/aligned-batcher => crates/batcher}/build.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/gnark/go.mod (100%) rename {batcher/aligned-batcher => crates/batcher}/gnark/go.sum (100%) rename {batcher/aligned-batcher => crates/batcher}/gnark/verifier.go (100%) rename {batcher/aligned-batcher => crates/batcher}/rust-toolchain (100%) rename {batcher/aligned-batcher => crates/batcher}/src/config/mod.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/connection.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/eth/mod.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/eth/payment_service.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/eth/service_manager.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/eth/utils.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/gnark/mod.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/lib.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/main.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/metrics.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/retry/batcher_retryables.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/retry/mod.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/risc_zero/mod.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/s3/mod.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/sp1/mod.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/telemetry/mod.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/telemetry/sender.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/types/batch_queue.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/types/batch_state.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/types/errors.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/types/mod.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/types/user_state.rs (100%) rename {batcher/aligned-batcher => crates/batcher}/src/zk_utils/mod.rs (100%) rename {batcher/aligned => crates/cli}/Cargo.toml (94%) rename {batcher/aligned => crates/cli}/abi/AlignedLayerServiceManager.json (100%) rename {batcher/aligned => crates/cli}/generate_proof_and_send.sh (100%) rename {batcher/aligned => crates/cli}/get_proof_test_files.sh (100%) rename {batcher/aligned => crates/cli}/install_aligned.sh (100%) rename {batcher/aligned-task-sender => crates/cli}/rust-toolchain (100%) rename {batcher/aligned => crates/cli}/send_burst_tasks.sh (100%) rename {batcher/aligned => crates/cli}/send_burst_with_random_address.sh (100%) rename {batcher/aligned => crates/cli}/send_infinite_sp1_tasks/requirements.txt (100%) rename {batcher/aligned => crates/cli}/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh (100%) rename {batcher/aligned => crates/cli}/send_infinite_tasks.sh (100%) rename {batcher/aligned => crates/cli}/send_proof_with_random_address.sh (100%) rename {batcher/aligned => crates/cli}/src/main.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/Cargo.toml (100%) rename {batcher/aligned-sdk => crates/sdk}/abi/AlignedLayerServiceManager.json (100%) rename {batcher/aligned-sdk => crates/sdk}/abi/AlignedProofAggregationService.json (100%) rename {batcher/aligned-sdk => crates/sdk}/abi/BatcherPaymentService.json (100%) rename {batcher/aligned-sdk => crates/sdk}/src/aggregation_layer/helpers.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/aggregation_layer/mod.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/aggregation_layer/types.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/beacon.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/common/constants.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/common/errors.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/common/mod.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/common/types.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/communication/batch.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/communication/messaging.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/communication/mod.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/communication/protocol.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/communication/serialization.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/eth/aligned_proof_agg_service.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/eth/aligned_service_manager.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/eth/batcher_payment_service.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/eth/mod.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/lib.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/src/verification_layer/mod.rs (100%) rename {batcher/aligned-sdk => crates/sdk}/test_files/groth16_bn254/plonk.proof (100%) rename {batcher/aligned-sdk => crates/sdk}/test_files/groth16_bn254/plonk.vk (100%) rename {batcher/aligned-sdk => crates/sdk}/test_files/groth16_bn254/plonk_pub_input.pub (100%) rename {batcher/aligned-sdk => crates/sdk}/test_files/sp1/sp1_fibonacci.elf (100%) rename {batcher/aligned-sdk => crates/sdk}/test_files/sp1/sp1_fibonacci.proof (100%) rename {batcher/aligned-task-sender => crates/task-sender}/Cargo.toml (94%) rename {batcher/aligned-task-sender => crates/task-sender}/README.md (100%) rename {batcher/aligned => crates/task-sender}/rust-toolchain (100%) rename {batcher/aligned-task-sender => crates/task-sender}/src/commands.rs (100%) rename {batcher/aligned-task-sender => crates/task-sender}/src/lib.rs (100%) rename {batcher/aligned-task-sender => crates/task-sender}/src/main.rs (100%) rename {batcher/aligned-task-sender => crates/task-sender}/src/structs.rs (100%) rename {batcher/aligned-task-sender => crates/task-sender}/wallets/devnet (100%) rename {batcher/aligned-task-sender => crates/task-sender}/wallets/devnet-backup (100%) rename {batcher/aligned-task-sender => crates/task-sender}/wallets/holesky-stage (100%) diff --git a/aggregation_mode/Cargo.toml b/aggregation_mode/Cargo.toml index fe40bbd5ac..997c57e885 100644 --- a/aggregation_mode/Cargo.toml +++ b/aggregation_mode/Cargo.toml @@ -18,7 +18,7 @@ reqwest = { version = "0.12" } ciborium = "=0.2.2" lambdaworks-crypto = { git = "https://github.com/lambdaclass/lambdaworks.git", rev = "5f8f2cfcc8a1a22f77e8dff2d581f1166eefb80b", features = ["serde"]} # Necessary for the VerificationData type -aligned-sdk = { path = "../batcher/aligned-sdk/" } +aligned-sdk = { path = "../crates/sdk/" } # zkvms sp1-sdk = "4.1.3" sp1_aggregation_program = { path = "./aggregation_programs/sp1/" } 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/config-files/proof-aggregator.last_aggregated_block.json b/config-files/proof-aggregator.last_aggregated_block.json index ba4603abe6..cba9fae91c 100644 --- a/config-files/proof-aggregator.last_aggregated_block.json +++ b/config-files/proof-aggregator.last_aggregated_block.json @@ -1 +1 @@ -{"last_aggregated_block":0} +{"last_aggregated_block":2006} \ No newline at end of file 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..9a6dd0258c --- /dev/null +++ b/crates/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +name = "aligned-rust" +version = "0.1.0" +edition = "2021" +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 703c2c321e..960742506a 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 = "v4.1.7" } 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 60a5e81b68..c21b4aaa04 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 100% rename from batcher/aligned/generate_proof_and_send.sh rename to crates/cli/generate_proof_and_send.sh 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 100% rename from batcher/aligned/send_burst_tasks.sh rename to crates/cli/send_burst_tasks.sh 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 100% 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 diff --git a/batcher/aligned/send_infinite_tasks.sh b/crates/cli/send_infinite_tasks.sh similarity index 100% rename from batcher/aligned/send_infinite_tasks.sh rename to crates/cli/send_infinite_tasks.sh 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 100% rename from batcher/aligned-sdk/src/verification_layer/mod.rs rename to crates/sdk/src/verification_layer/mod.rs 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/examples/validating-public-input/aligned-integration/Cargo.toml b/examples/validating-public-input/aligned-integration/Cargo.toml index b95940c4bb..42ae700598 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 = "../../../batcher/sdk" } tokio = { version = "1.37.0", features = [ "io-std", "time", diff --git a/examples/zkquiz/quiz/script/Cargo.toml b/examples/zkquiz/quiz/script/Cargo.toml index c41d3ffca2..1c5a2a640a 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 = "v4.1.7" } -aligned-sdk = { path = "../../../../batcher/aligned-sdk" } +aligned-sdk = { path = "../../../../batcher/sdk" } ethers = { version = "2.0", features = ["ws", "rustls"] } rpassword = "7.3.1" diff --git a/operator/merkle_tree/lib/Cargo.toml b/operator/merkle_tree/lib/Cargo.toml index 3e019ea662..114e0539ea 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 = "../../../batcher/sdk" } ciborium = "=0.2.2" log = "0.4.21" From c08304c38d7bcb9bc6a0b06fee64c1a2c4213aa4 Mon Sep 17 00:00:00 2001 From: Marcos Nicolau Date: Tue, 27 May 2025 12:49:01 -0300 Subject: [PATCH 2/8] refactor: make targets --- Makefile | 100 +++++++++++++++++++++++++++---------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/Makefile b/Makefile index 2dd76a11bc..02ef4bbc26 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ start_proof_aggregator_gpu_ethereum_package: is_aggregator_set reset_last_aggreg verify_aggregated_proof_sp1_holesky_stage: @echo "Verifying SP1 in aggregated proofs on holesky..." - @cd batcher/aligned/ && \ + @cd crates/cli/ && \ cargo run verify-agg-proof \ --network holesky-stage \ --from-block $(FROM_BLOCK) \ @@ -204,7 +204,7 @@ verify_aggregated_proof_sp1_holesky_stage: verify_aggregated_proof_risc0_holesky_stage: @echo "Verifying RISC0 in aggregated proofs on holesky..." - @cd batcher/aligned/ && \ + @cd crates/cli/ && \ cargo run verify-agg-proof \ --network holesky-stage \ --from-block $(FROM_BLOCK) \ @@ -424,40 +424,40 @@ 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 RPC_URL=http://localhost:8545 @@ -465,7 +465,7 @@ NETWORK=devnet # devnet | holesky-stage | holesky 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_4_1_3.proof \ --vm_program ../../scripts/test_files/sp1/sp1_fibonacci_4_1_3.elf \ @@ -475,7 +475,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_4_1_3.proof \ --vm_program ../../scripts/test_files/sp1/sp1_fibonacci_4_1_3.elf \ @@ -486,11 +486,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 \ @@ -501,7 +501,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 \ @@ -511,7 +511,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 \ @@ -521,9 +521,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.proof \ --public_input ../../scripts/test_files/gnark_plonk_bn254_script/plonk_pub_input.pub \ @@ -532,9 +532,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.proof \ --public_input ../../scripts/test_files/gnark_plonk_bn254_script/plonk_pub_input.pub \ @@ -544,9 +544,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.proof \ --public_input ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk_pub_input.pub \ @@ -555,9 +555,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.proof \ --public_input ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk_pub_input.pub \ @@ -567,9 +567,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_infinite_script/infinite_proofs/ineq_1_groth16.proof \ --public_input ../../scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_1_groth16.pub \ @@ -578,59 +578,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 \ @@ -638,31 +638,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) @@ -1334,7 +1334,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 From 99441c0f0c2a8a6e7eac2caa06d460c10856e024 Mon Sep 17 00:00:00 2001 From: Marcos Nicolau Date: Tue, 27 May 2025 12:49:27 -0300 Subject: [PATCH 3/8] refactor: rust ci --- .github/workflows/build-and-test-rust.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-test-rust.yml b/.github/workflows/build-and-test-rust.yml index 170def1de3..0d0088a3ca 100644 --- a/.github/workflows/build-and-test-rust.yml +++ b/.github/workflows/build-and-test-rust.yml @@ -48,19 +48,19 @@ jobs: 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 From 2fee7f6c60b5f83694e2599b2214a44dac676870 Mon Sep 17 00:00:00 2001 From: Marcos Nicolau Date: Tue, 27 May 2025 13:04:06 -0300 Subject: [PATCH 4/8] refactor: update missing paths --- .github/pull_request_template.md | 2 +- .github/workflows/build-and-test-rust.yml | 6 +-- .github/workflows/release.yml | 2 +- .gitignore | 2 +- .../aggregation_programs/risc0/src/lib.rs | 2 +- .../aggregation_programs/sp1/src/lib.rs | 2 +- aggregation_mode/src/aggregators/mod.rs | 2 +- crates/cli/generate_proof_and_send.sh | 2 +- crates/cli/send_burst_tasks.sh | 2 +- .../send_infinite_sp1_tasks.sh | 2 +- crates/cli/send_infinite_tasks.sh | 2 +- crates/sdk/src/verification_layer/mod.rs | 2 +- docker/aligned_base.Dockerfile | 6 +-- docker/batcher.Dockerfile | 50 +++++++++---------- docs/1_introduction/1_try_aligned.md | 15 +++--- docs/3_guides/6_setup_aligned.md | 2 +- docs/3_guides/9_aligned_cli.md | 2 +- .../templates/services/batcher.service.j2 | 2 +- infra/services/batcher.service | 2 +- operator/merkle_tree/lib/Cargo.toml | 2 +- 20 files changed, 55 insertions(+), 54 deletions(-) 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 0d0088a3ca..122c1b4853 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,7 +43,7 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git - batcher/target + crates/target key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-rust- @@ -108,7 +108,7 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git - batcher/target + crates/target key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-rust- 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 e9cc53946c..303cc18890 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/aggregation_mode/aggregation_programs/risc0/src/lib.rs b/aggregation_mode/aggregation_programs/risc0/src/lib.rs index 1e1dc303f5..6477f7a629 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 736948a865..86c93c4ae2 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 bafb947fd9..c5bec0f31a 100644 --- a/aggregation_mode/src/aggregators/mod.rs +++ b/aggregation_mode/src/aggregators/mod.rs @@ -139,7 +139,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/crates/cli/generate_proof_and_send.sh b/crates/cli/generate_proof_and_send.sh index 42d01b8fbd..4aae071bed 100755 --- a/crates/cli/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/crates/cli/send_burst_tasks.sh b/crates/cli/send_burst_tasks.sh index f46464aa6c..9cc2db2699 100755 --- a/crates/cli/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/crates/cli/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh b/crates/cli/send_infinite_sp1_tasks/send_infinite_sp1_tasks.sh index 620a465719..3f1487422a 100755 --- a/crates/cli/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/crates/cli/send_infinite_tasks.sh b/crates/cli/send_infinite_tasks.sh index 90e24a4013..3b147a084e 100755 --- a/crates/cli/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.proof \ --public_input ../../scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_${counter}_groth16.pub \ diff --git a/crates/sdk/src/verification_layer/mod.rs b/crates/sdk/src/verification_layer/mod.rs index 392e558a4d..8f3888b11a 100644 --- a/crates/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/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 be5635e3af..a1785d9493 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 8037aeb188..db8573348a 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/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 114e0539ea..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/sdk" } +aligned-sdk = { path = "../../../crates/sdk" } ciborium = "=0.2.2" log = "0.4.21" From 09dd2341605bba451b2e11f0e37335f086fe1f70 Mon Sep 17 00:00:00 2001 From: Marcos Nicolau Date: Tue, 27 May 2025 13:35:10 -0300 Subject: [PATCH 5/8] ci: fix batcher path --- .github/workflows/build-and-test-rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-rust.yml b/.github/workflows/build-and-test-rust.yml index 122c1b4853..200a39a0bd 100644 --- a/.github/workflows/build-and-test-rust.yml +++ b/.github/workflows/build-and-test-rust.yml @@ -115,7 +115,7 @@ jobs: - name: Run Batcher tests run: | - cd batcher + cd crates cargo test --all - name: Run AggregationMode tests From 7ce1641c12e2de9700d8609331fc278f37c610f7 Mon Sep 17 00:00:00 2001 From: Marcos Nicolau Date: Mon, 2 Jun 2025 11:08:59 -0300 Subject: [PATCH 6/8] chore: fix some examples path --- examples/validating-public-input/aligned-integration/Cargo.toml | 2 +- examples/zkquiz/quiz/script/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/validating-public-input/aligned-integration/Cargo.toml b/examples/validating-public-input/aligned-integration/Cargo.toml index 42ae700598..972c0b291d 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/sdk" } +aligned-sdk = { path = "../../../crates/sdk" } tokio = { version = "1.37.0", features = [ "io-std", "time", diff --git a/examples/zkquiz/quiz/script/Cargo.toml b/examples/zkquiz/quiz/script/Cargo.toml index 1c5a2a640a..421c8637f0 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 = "v4.1.7" } -aligned-sdk = { path = "../../../../batcher/sdk" } +aligned-sdk = { path = "../../../../crates/sdk" } ethers = { version = "2.0", features = ["ws", "rustls"] } rpassword = "7.3.1" From cfd9a804860dab31fcb453944c66daf312a73141 Mon Sep 17 00:00:00 2001 From: JuArce <52429267+JuArce@users.noreply.github.com> Date: Fri, 6 Jun 2025 17:19:48 -0300 Subject: [PATCH 7/8] fix: revert last aggregated block file for devnet --- config-files/proof-aggregator.last_aggregated_block.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config-files/proof-aggregator.last_aggregated_block.json b/config-files/proof-aggregator.last_aggregated_block.json index cba9fae91c..ba4603abe6 100644 --- a/config-files/proof-aggregator.last_aggregated_block.json +++ b/config-files/proof-aggregator.last_aggregated_block.json @@ -1 +1 @@ -{"last_aggregated_block":2006} \ No newline at end of file +{"last_aggregated_block":0} From adbe1ba4ef3310abee41db6b151a6f5f4677e0cc Mon Sep 17 00:00:00 2001 From: Marcos Nicolau Date: Fri, 6 Jun 2025 18:58:34 -0300 Subject: [PATCH 8/8] fix: cargo.toml warnings --- crates/Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/crates/Cargo.toml b/crates/Cargo.toml index 9a6dd0258c..b14f980c5c 100644 --- a/crates/Cargo.toml +++ b/crates/Cargo.toml @@ -1,6 +1,3 @@ [workspace] -name = "aligned-rust" -version = "0.1.0" -edition = "2021" resolver = "2" members = ["./batcher", "./sdk", "./cli", "./task-sender"]