Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 0.8.0 #47

Merged
merged 35 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a8d8ace
fix(code quality): Remove unnescessary error check in aggregator (#1009)
PatStiles Sep 23, 2024
07e6f34
refactor(batcher): batch building algorithm (#1008)
entropidelic Sep 24, 2024
d70ac35
chore(security): Bump gnark version (#991)
PatStiles Sep 24, 2024
9d7a2d0
fix(code quality): Remove panics from functions that return result (#…
PatStiles Sep 24, 2024
bc6f49d
fix(audit): Batcher contains unmaintained and yanked crates (#995)
PatStiles Sep 24, 2024
9358698
fix(code quality): Improve error for S3 upload in Batcher (#1014)
PatStiles Sep 24, 2024
c9518d7
refactor: remove 0 check in recovered address in BatcherPaymentServic…
MarcosNicolau Sep 25, 2024
a280147
fix: set LD_LIBRARY_PATH on operator build (#1091)
JuArce Sep 26, 2024
23d5eca
Pull hotfixes to staging (#1096)
MauroToscano Sep 26, 2024
c771d51
chore(examples): Bump `aligned-sdk` in examples to v0.7.2 (#1079)
PatStiles Sep 26, 2024
ad1c754
chore(examples): Bump `aligned-sdk` in examples to v0.7.2 (#1079) (#1…
MauroToscano Sep 26, 2024
91f263e
chore: update bindings
IAvecilla Sep 26, 2024
e6ce437
fix: update groth16 vk and proof files
IAvecilla Sep 26, 2024
60276cd
fix: groth16 burst test for new gnark version (#1102)
IAvecilla Sep 27, 2024
54c3aa3
feat(audit): Emit events in Operator whitelist (#1107)
PatStiles Sep 27, 2024
39fe8a7
feat(audit): Use block timestamp instead of block number. (#1085)
PatStiles Sep 27, 2024
139f8bc
Improve docs (#1111)
diegokingston Sep 28, 2024
d6c2e34
Update 0_supported_verifiers.md
MauroToscano Sep 28, 2024
88f276c
fix: batcher sends proof even if eip712 signature contents are incomp…
uri-99 Sep 30, 2024
014bd4d
fix(contracts): check address are not zero in initialization (#1094)
MarcosNicolau Sep 30, 2024
d128869
feat(): Add docs to generating proofs for zkrust (#1063)
PatStiles Sep 30, 2024
cf84ee8
docs: add guide to run operator using systemd (#1078)
JuArce Sep 30, 2024
6b1a4ae
fix: operator double signature (#1088)
MarcosNicolau Oct 1, 2024
decd1c7
feat: migrate cbor lib and add Fuzzer for cbor serialization (#1110)
IAvecilla Oct 1, 2024
fd7b975
feat(ffi): ffi refactors (#1092)
PatStiles Oct 2, 2024
84202a5
ci: add job to run batcher tests (#1126)
IAvecilla Oct 2, 2024
32a0e66
feat(sdk): Add Max Fee Estimate. Update zkQuiz to better represent ho…
PatStiles Oct 2, 2024
2fec136
Pull changes from testnet to staging (#1147)
MauroToscano Oct 2, 2024
ba808d2
Revert gnark upgrade (#1150)
MauroToscano Oct 2, 2024
ed05207
chore: install aligned from latest tag and update OPERATOR_VERSION (#…
JuArce Oct 2, 2024
601a50d
feat: add fund_payment_service and get_balance_in_payment_sevice on s…
uri-99 Oct 2, 2024
042d8d8
v0.8.0 (#1123)
MauroToscano Oct 2, 2024
b68aba7
Merge tag 'v0.8.0' into update_to_0_8_0
gabrielbosio Oct 8, 2024
f6fe98c
Add Rust setup step
gabrielbosio Oct 8, 2024
a9e2cbb
Make test job use custom runner
gabrielbosio Oct 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-rust-projects
name: build-and-test-rust-projects

on:
merge_group:
Expand Down Expand Up @@ -46,3 +46,30 @@ jobs:
run: |
cd batcher
cargo build --all

test:
runs-on: ubuntu-custom
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
override: true
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
batcher/target
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-
- name: Run tests
run: |
cd batcher
cargo test --all
59 changes: 40 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ OS := $(shell uname -s)
CONFIG_FILE?=config-files/config.yaml
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml

OPERATOR_VERSION=v0.7.2
OPERATOR_VERSION=v0.8.0

ifeq ($(OS),Linux)
BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux
Expand Down Expand Up @@ -112,7 +112,7 @@ operator_register_and_start: operator_full_registration operator_start

build_operator: deps
@echo "Building Operator..."
@go build -ldflags "-X main.Version=$(OPERATOR_VERSION)" -o ./operator/build/aligned-operator ./operator/cmd/main.go
@go build -ldflags "-X main.Version=$(OPERATOR_VERSION) -r $(LD_LIBRARY_PATH):$(CURDIR)/operator/risc_zero/lib" -o ./operator/build/aligned-operator ./operator/cmd/main.go
@echo "Operator built into /operator/build/aligned-operator"

update_operator:
Expand All @@ -121,6 +121,22 @@ update_operator:
@make build_operator
@./operator/build/aligned-operator --version

operator_valid_marshall_fuzz_macos:
@cd operator/pkg && go test -fuzz=FuzzValidMarshall -ldflags=-extldflags=-Wl,-ld_classic

operator_valid_marshall_fuzz_linux:
@cd operator/pkg && \
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(CURDIR)/operator/risc_zero/lib \
go test -fuzz=FuzzValidMarshall

operator_marshall_unmarshall_fuzz_macos:
@cd operator/pkg && go test -fuzz=FuzzMarshalUnmarshal -ldflags=-extldflags=-Wl,-ld_classic

operator_marshall_unmarshall_fuzz_linux:
@cd operator/pkg && \
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(CURDIR)/operator/risc_zero/lib \
go test -fuzz=FuzzMarshalUnmarshal

bindings:
cd contracts && ./generate-go-bindings.sh

Expand Down Expand Up @@ -159,6 +175,12 @@ operator_whitelist_devnet:
@echo "Operator address: $(OPERATOR_ADDRESS)"
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/whitelist_operator.sh $(OPERATOR_ADDRESS)

operator_remove_devnet:
@echo "Removing operator"
$(eval OPERATOR_ADDRESS = $(shell yq -r '.operator.address' $(CONFIG_FILE)))
@echo "Operator address: $(OPERATOR_ADDRESS)"
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/remove_operator.sh $(OPERATOR_ADDRESS)

operator_whitelist:
@echo "Whitelisting operator $(OPERATOR_ADDRESS)"
@. contracts/scripts/.env && . contracts/scripts/whitelist_operator.sh $(OPERATOR_ADDRESS)
Expand Down Expand Up @@ -226,7 +248,7 @@ batcher/target/release/aligned:


RPC_URL=http://localhost:8545
BATCHER_PAYMENTS_CONTRACT_ADDRESS=0x7969c5eD335650692Bc04293B07F5BF2e7A673C0
NETWORK=devnet # devnet | holesky-stage | holesky

batcher_send_sp1_task:
@echo "Sending SP1 fibonacci task to Batcher..."
Expand All @@ -236,7 +258,7 @@ batcher_send_sp1_task:
--vm_program ../../scripts/test_files/sp1/sp1_fibonacci.elf \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_sp1_burst:
@echo "Sending SP1 fibonacci task to Batcher..."
Expand All @@ -247,7 +269,7 @@ batcher_send_sp1_burst:
--repetitions $(BURST_SIZE) \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_infinite_sp1:
@echo "Sending infinite SP1 fibonacci task to Batcher..."
Expand All @@ -262,7 +284,7 @@ batcher_send_risc0_task:
--public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci.pub \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_risc0_burst:
@echo "Sending Risc0 fibonacci task to Batcher..."
Expand All @@ -274,7 +296,7 @@ batcher_send_risc0_burst:
--repetitions $(BURST_SIZE) \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_plonk_bn254_task: batcher/target/release/aligned
@echo "Sending Groth16Bn254 1!=0 task to Batcher..."
Expand All @@ -285,7 +307,7 @@ batcher_send_plonk_bn254_task: batcher/target/release/aligned
--vk ../../scripts/test_files/gnark_plonk_bn254_script/plonk.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_plonk_bn254_burst: batcher/target/release/aligned
@echo "Sending Groth16Bn254 1!=0 task to Batcher..."
Expand All @@ -297,7 +319,7 @@ batcher_send_plonk_bn254_burst: batcher/target/release/aligned
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--repetitions 4 \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_plonk_bls12_381_task: batcher/target/release/aligned
@echo "Sending Groth16 BLS12-381 1!=0 task to Batcher..."
Expand All @@ -308,7 +330,7 @@ batcher_send_plonk_bls12_381_task: batcher/target/release/aligned
--vk ../../scripts/test_files/gnark_plonk_bls12_381_script/plonk.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_plonk_bls12_381_burst: batcher/target/release/aligned
@echo "Sending Groth16 BLS12-381 1!=0 task to Batcher..."
Expand All @@ -320,8 +342,7 @@ batcher_send_plonk_bls12_381_burst: batcher/target/release/aligned
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--repetitions 15 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)

--network $(NETWORK)

batcher_send_groth16_bn254_task: batcher/target/release/aligned
@echo "Sending Groth16Bn254 1!=0 task to Batcher..."
Expand All @@ -332,7 +353,7 @@ batcher_send_groth16_bn254_task: batcher/target/release/aligned
--vk ../../scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_1_groth16.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_infinite_groth16: batcher/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
Expand All @@ -352,7 +373,7 @@ batcher_send_halo2_ipa_task: batcher/target/release/aligned
--public_input ../../scripts/test_files/halo2_ipa/pub_input.bin \
--vk ../../scripts/test_files/halo2_ipa/params.bin \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_halo2_ipa_task_burst_5: batcher/target/release/aligned
@echo "Sending Halo2 IPA 1!=0 task to Batcher..."
Expand All @@ -363,7 +384,7 @@ batcher_send_halo2_ipa_task_burst_5: batcher/target/release/aligned
--vk ../../scripts/test_files/halo2_ipa/params.bin \
--repetitions 5 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_halo2_kzg_task: batcher/target/release/aligned
@echo "Sending Halo2 KZG 1!=0 task to Batcher..."
Expand All @@ -374,7 +395,7 @@ batcher_send_halo2_kzg_task: batcher/target/release/aligned
--vk ../../scripts/test_files/halo2_kzg/params.bin \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_halo2_kzg_task_burst_5: batcher/target/release/aligned
@echo "Sending Halo2 KZG 1!=0 task to Batcher..."
Expand All @@ -386,7 +407,7 @@ batcher_send_halo2_kzg_task_burst_5: batcher/target/release/aligned
--repetitions 5 \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
--network $(NETWORK)

batcher_send_mina_task:
@echo "Sending Mina state task to Batcher..."
Expand Down Expand Up @@ -509,9 +530,9 @@ build_aligned_contracts:

show_aligned_error_codes:
@echo "\nAlignedLayerServiceManager errors:"
@cd contracts/src/core && forge inspect IAlignedLayerServiceManager.sol:IAlignedLayerServiceManager errors
@cd contracts && forge inspect src/core/IAlignedLayerServiceManager.sol:IAlignedLayerServiceManager errors
@echo "\nBatcherPaymentService errors:"
@cd contracts/src/core && forge inspect BatcherPaymentService.sol:BatcherPaymentService errors
@cd contracts && forge inspect src/core/BatcherPaymentService.sol:BatcherPaymentService errors

__BUILD__:
build_binaries:
Expand Down
Loading
Loading