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

v0.7.0 #980

Merged
merged 60 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
19e76e0
chore: integrate pagerduty to contract alerts (#847)
JuArce Aug 26, 2024
c26f1ee
fix: solidity coding style (#843)
NicolasRampoldi Aug 26, 2024
9047237
fix: add git reset command before checkout (#867)
glpecile Aug 26, 2024
fdd5b12
docs(summary): minor fixes (#868)
cliraa Aug 26, 2024
9b9d293
refactor(explorer): standardize make commands (#865)
glpecile Aug 26, 2024
4868b37
docs: improvements (#845)
uri-99 Aug 26, 2024
288db9e
feat: handle new batch log on separate go routine (#855)
taturosati Aug 27, 2024
61624d9
fix(explorer): show correct cost per proof and remove inspects (#830)
glpecile Aug 27, 2024
2274416
feat: add withdraw method for batchers in servicemanager (#872)
NicolasRampoldi Aug 27, 2024
43b266e
feat: add a deposit to batcher method in servicemanager (#876)
NicolasRampoldi Aug 27, 2024
80cbc1a
feat(explorer): add search by proof hash (#766)
glpecile Aug 27, 2024
b2982a9
fix: change less than = 0 in contracts to == 0to reduce gas costs whe…
NicolasRampoldi Aug 29, 2024
155d5de
fix(explorer): handle empty events from batcher payment system (#888)
glpecile Aug 29, 2024
535f10e
docs: add explanation on zk (#884)
diegokingston Aug 29, 2024
6dec1ec
docs: update operator guide to v0.5.2 (#908)
JuArce Aug 30, 2024
30704cb
chore: update contracts addresses (#895)
JuArce Aug 30, 2024
af3d9c8
fix: swap variables declaration in BatcherPaymentService.sol (#903)
JuArce Aug 30, 2024
96af3e3
chore: update risc0 version in validating public inputs example (#891)
NicolasRampoldi Aug 30, 2024
4134c3a
docs (readme): fix broken links (#912)
NicolasRampoldi Sep 1, 2024
1b20812
fix: normalize address input for /versions/{address} (#914)
JuArce Sep 3, 2024
d5c0dc0
chore(examples): bump zkquiz aligned_sdk dependencies (#896)
PatStiles Sep 3, 2024
94fbaee
fix (sdk): add sender address to wait for verification function (#909)
taturosati Sep 4, 2024
c6d8459
feat (batcher): allow users to specify max fee (#869)
taturosati Sep 4, 2024
81b290d
refactor: 'V2' functionalities to aggregator and operator (#875)
uri-99 Sep 5, 2024
e282e12
feat: add onlyAggregator to respondToTask (#883)
uri-99 Sep 5, 2024
7c32f61
docs: add operator FAQ and troubleshooting guide (#920)
JuArce Sep 5, 2024
323a191
feat: add limit on aggregator spending (#910)
uri-99 Sep 6, 2024
2661d68
docs: fix missing broken links from dir rename (#927)
glpecile Sep 6, 2024
1dcb8ca
docs: update zkRust documentation (#932)
PatStiles Sep 6, 2024
ad76d55
docs: remove supported verifiers from running an operator guide (#929)
glpecile Sep 9, 2024
42cc5f5
Modify docs (#935)
diegokingston Sep 9, 2024
afc61b7
feat(explorer): add operator version via tracker api (#879)
glpecile Sep 9, 2024
55109ad
feat: paymentservice add lock on receive (#859)
uri-99 Sep 10, 2024
dd19e5f
feat: make signing eip 712 compliant (#916)
NicolasRampoldi Sep 10, 2024
09a7044
ci: fix risc0 test failing (#953)
NicolasRampoldi Sep 10, 2024
19af490
refactor: change panic to return false (#959)
NicolasRampoldi Sep 13, 2024
91c954c
feat: add proving system to vk or program code commitment (#939)
entropidelic Sep 13, 2024
0f196f2
Merge branch 'testnet' into staging
uri-99 Sep 16, 2024
f789ee5
chore: remove commented code
uri-99 Sep 16, 2024
dda5633
chore: remove comment
uri-99 Sep 16, 2024
a0829b2
chore: better NewBatchVx comment in aligned.sol
uri-99 Sep 16, 2024
9348ff3
fix: submit_and_wait_verification usage in integrating_aligned.md
uri-99 Sep 16, 2024
13cdc86
fix: Merge testnet to staging v3 (#983)
MauroToscano Sep 16, 2024
9d3c4be
docs: update testnet docs (#973)
JuArce Sep 16, 2024
22c43a4
fix: update cargo.lock
uri-99 Sep 16, 2024
fe29562
docs: fix merge
JuArce Sep 16, 2024
8ae73bc
docs: update staging docs with testnet docs (#973) (#985)
MauroToscano Sep 16, 2024
423beb6
Merge remote-tracking branch 'refs/remotes/origin/testnet' into staging
JuArce Sep 16, 2024
8c87195
docs: fix validating public input example
JuArce Sep 16, 2024
f53cce1
docs: fix validationg public input example (#987)
MauroToscano Sep 16, 2024
ef5178d
Merge branch 'testnet' into staging
MauroToscano Sep 16, 2024
3fabe21
Merge b docs from testnet (#988)
MauroToscano Sep 16, 2024
5fb540f
Update readme with versioning data (#974)
MauroToscano Sep 16, 2024
dd2d0a3
feat: add retry to get batch of s3 (#958)
NicolasRampoldi Sep 16, 2024
4fe73da
fix(explorer): count only active operators for weight (#934)
uri-99 Sep 16, 2024
7e64ee8
docs(explorer): update contents to match latest version (#923)
glpecile Sep 16, 2024
047a65b
feat: aggregator should check if gas is enough before respondToTask (…
uri-99 Sep 16, 2024
45c9a50
Fix operator merkle root retrocompatibility (#996)
uri-99 Sep 19, 2024
dab69be
remove: emit NewBatchV2 from Aligned.sol (#1027)
uri-99 Sep 19, 2024
8f0f803
chore: set operator version to v070 (#1029)
JuArce Sep 19, 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
2 changes: 2 additions & 0 deletions .github/workflows/build-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
run: make build_halo2_ipa_linux
- name: Build Merkle Tree bindings
run: make build_merkle_tree_linux
- name: Build Old Merkle Tree bindings
run: make build_merkle_tree_linux_old
- name: Build operator
run: go build operator/cmd/main.go
- name: Build aggregator
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: aligned-runner

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/explorer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
ssh -o "StrictHostKeyChecking=no" ${USERNAME}@${HOST_NAME} "
cd ${APP_DIR} &&
git fetch &&
git reset --hard HEAD &&
git clean -fd &&
git checkout ${REF} &&
git pull &&
sudo systemctl restart ${SERVICE_NAME}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/lint-contracts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint contracts
on:
push:
branches: [main]
pull_request:
branches: ["*"]
paths:
- "contracts/src/core/*.sol"
- ".github/workflows/lint-contracts.yml"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm install
working-directory: contracts

- name: Run Solhint
run: npm run lint:sol
working-directory: contracts
52 changes: 26 additions & 26 deletions .github/workflows/test-risc-zero.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ on:
pull_request:
branches: ["*"]
paths:
- 'operator/risc_zero/**'
- '.github/workflows/test-risc-zero.yml'
- "operator/risc_zero/**"
- ".github/workflows/test-risc-zero.yml"

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Clear device space
run: |
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Test Risc Zero Rust
run: make test_risc_zero_rust_ffi
- name: Test Risc Zero go bindings
run: make test_risc_zero_go_bindings_linux
test:
runs-on: ubuntu-latest
steps:
- name: Clear device space
run: |
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
cache: false
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Test Risc Zero Rust
run: make test_risc_zero_rust_ffi
- name: Test Risc Zero go bindings
run: make test_risc_zero_go_bindings_linux
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@
[submodule "examples/validating-public-input/contracts/lib/forge-std"]
path = examples/validating-public-input/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "contracts/lib/openzeppelin-contracts"]
path = contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "contracts/lib/openzeppelin-contracts-upgradeable"]
path = contracts/lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
81 changes: 68 additions & 13 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.5.2
OPERATOR_VERSION=v0.7.0

ifeq ($(OS),Linux)
BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux
Expand Down Expand Up @@ -55,6 +55,10 @@ anvil_upgrade_aligned_contracts:
@echo "Upgrading Aligned Contracts..."
. contracts/scripts/anvil/upgrade_aligned_contracts.sh

anvil_upgrade_batcher_payment_service:
@echo "Upgrading BatcherPayments contract..."
. contracts/scripts/anvil/upgrade_batcher_payment_service.sh

anvil_upgrade_registry_coordinator:
@echo "Upgrading Registry Coordinator Contracts..."
. contracts/scripts/anvil/upgrade_registry_coordinator.sh
Expand All @@ -71,6 +75,17 @@ anvil_upgrade_index_registry:
@echo "Upgrading Index Registry Contracts..."
. contracts/scripts/anvil/upgrade_index_registry.sh

anvil_upgrade_add_aggregator:
@echo "Adding Aggregator to Aligned Contracts..."
. contracts/scripts/anvil/upgrade_add_aggregator_to_service_manager.sh

anvil_add_type_hash_to_batcher_payment_service:
@echo "Adding Type Hash to Batcher Payment Service..."
. contracts/scripts/anvil/upgrade_add_type_hash_to_batcher_payment_service.sh

lint_contracts:
@cd contracts && npm run lint:sol

anvil_start:
@echo "Starting Anvil..."
anvil --load-state contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json
Expand Down Expand Up @@ -136,7 +151,7 @@ operator_register_with_eigen_layer:

operator_mint_mock_tokens:
@echo "Minting tokens"
. ./scripts/mint_mock_token.sh $(CONFIG_FILE) 1000
. ./scripts/mint_mock_token.sh $(CONFIG_FILE) 100000000000000000

operator_whitelist_devnet:
@echo "Whitelisting operator"
Expand All @@ -155,7 +170,7 @@ operator_deposit_into_mock_strategy:
@go run operator/cmd/main.go deposit-into-strategy \
--config $(CONFIG_FILE) \
--strategy-address $(STRATEGY_ADDRESS) \
--amount 1000
--amount 100000000000000000

operator_deposit_into_strategy:
@echo "Depositing into strategy"
Expand Down Expand Up @@ -229,7 +244,7 @@ batcher_send_sp1_burst:
--proving_system SP1 \
--proof ../../scripts/test_files/sp1/sp1_fibonacci.proof \
--vm_program ../../scripts/test_files/sp1/sp1_fibonacci.elf \
--repetitions 15 \
--repetitions $(BURST_SIZE) \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
Expand All @@ -256,7 +271,7 @@ batcher_send_risc0_burst:
--proof ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci.proof \
--vm_program ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id.bin \
--public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci.pub \
--repetitions 15 \
--repetitions $(BURST_SIZE) \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)
Expand All @@ -281,6 +296,7 @@ batcher_send_plonk_bn254_burst: batcher/target/release/aligned
--vk ../../scripts/test_files/gnark_plonk_bn254_script/plonk.vk \
--proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 \
--rpc_url $(RPC_URL) \
--repetitions 4 \
--payment_service_addr $(BATCHER_PAYMENTS_CONTRACT_ADDRESS)

batcher_send_plonk_bls12_381_task: batcher/target/release/aligned
Expand Down Expand Up @@ -426,6 +442,14 @@ upgrade_stake_registry: ## Upgrade Stake Registry
@echo "Upgrading Stake Registry..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_stake_registry.sh

upgrade_add_aggregator: ## Add Aggregator to Aligned Contracts
@echo "Adding Aggregator to Aligned Contracts..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_add_aggregator_to_service_manager.sh

upgrade_batcher_payments_add_type_hash: ## Add Type Hash to Batcher Payment Service
@echo "Adding Type Hash to Batcher Payment Service..."
@. contracts/scripts/.env && . contracts/scripts/upgrade_add_type_hash_to_batcher_payment_service.sh

deploy_verify_batch_inclusion_caller:
@echo "Deploying VerifyBatchInclusionCaller contract..."
@. examples/verify/.env && . examples/verify/scripts/deploy_verify_batch_inclusion_caller.sh
Expand All @@ -441,6 +465,12 @@ upgrade_batcher_payment_service:
build_aligned_contracts:
@cd contracts/src/core && forge build

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

__BUILD__:
build_binaries:
@echo "Building aggregator..."
Expand Down Expand Up @@ -497,6 +527,7 @@ test_risc_zero_go_bindings_macos: build_risc_zero_macos

test_risc_zero_go_bindings_linux: build_risc_zero_linux
@echo "Testing RISC Zero Go bindings..."
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(CURDIR)/operator/risc_zero/lib \
go test ./operator/risc_zero/... -v

generate_risc_zero_fibonacci_proof:
Expand All @@ -510,15 +541,29 @@ build_merkle_tree_macos:
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.dylib operator/merkle_tree/lib/libmerkle_tree.dylib
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree/lib/libmerkle_tree.a

build_merkle_tree_macos_old:
@cd operator/merkle_tree_old/lib && cargo build $(RELEASE_FLAG)
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.dylib operator/merkle_tree_old/lib/libmerkle_tree.dylib
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree_old/lib/libmerkle_tree.a

build_merkle_tree_linux:
@cd operator/merkle_tree/lib && cargo build $(RELEASE_FLAG)
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.so operator/merkle_tree/lib/libmerkle_tree.so
@cp operator/merkle_tree/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree/lib/libmerkle_tree.a

build_merkle_tree_linux_old:
@cd operator/merkle_tree_old/lib && cargo build $(RELEASE_FLAG)
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.so operator/merkle_tree_old/lib/libmerkle_tree.so
@cp operator/merkle_tree_old/lib/target/$(TARGET_REL_PATH)/libmerkle_tree.a operator/merkle_tree_old/lib/libmerkle_tree.a

test_merkle_tree_rust_ffi:
@echo "Testing Merkle Tree Rust FFI source code..."
@cd operator/merkle_tree/lib && RUST_MIN_STACK=83886080 cargo t --release

test_merkle_tree_rust_ffi_old:
@echo "Testing Old Merkle Tree Rust FFI source code..."
@cd operator/merkle_tree_old/lib && RUST_MIN_STACK=83886080 cargo t --release

test_merkle_tree_go_bindings_macos: build_merkle_tree_macos
@echo "Testing Merkle Tree Go bindings..."
go test ./operator/merkle_tree/... -v
Expand All @@ -527,6 +572,14 @@ test_merkle_tree_go_bindings_linux: build_merkle_tree_linux
@echo "Testing Merkle Tree Go bindings..."
go test ./operator/merkle_tree/... -v

test_merkle_tree_old_go_bindings_macos: build_merkle_tree_macos_old
@echo "Testing Old Merkle Tree Go bindings..."
go test ./operator/merkle_tree_old/... -v

test_merkle_tree_go_bindings_linux_old: build_merkle_tree_linux_old
@echo "Testing Merkle Tree Go bindings..."
go test ./operator/merkle_tree_old/... -v

__HALO2_KZG_FFI__: ##
build_halo2_kzg_macos:
@cd operator/halo2kzg/lib && cargo build $(RELEASE_FLAG)
Expand Down Expand Up @@ -601,6 +654,7 @@ build_all_ffi_macos: ## Build all FFIs for macOS
@$(MAKE) build_sp1_macos
@$(MAKE) build_risc_zero_macos
@$(MAKE) build_merkle_tree_macos
@$(MAKE) build_merkle_tree_macos_old
@$(MAKE) build_halo2_ipa_macos
@$(MAKE) build_halo2_kzg_macos
@echo "All macOS FFIs built successfully."
Expand All @@ -610,45 +664,46 @@ build_all_ffi_linux: ## Build all FFIs for Linux
@$(MAKE) build_sp1_linux
@$(MAKE) build_risc_zero_linux
@$(MAKE) build_merkle_tree_linux
@$(MAKE) build_merkle_tree_linux_old
@$(MAKE) build_halo2_ipa_linux
@$(MAKE) build_halo2_kzg_linux
@echo "All Linux FFIs built successfully."


__EXPLORER__:
run_explorer: run_db ecto_setup_db
run_explorer: explorer_run_db explorer_ecto_setup_db
@cd explorer/ && \
pnpm install --prefix assets && \
mix setup && \
./start.sh

build_db:
explorer_build_db:
@cd explorer && \
docker build -t explorer-postgres-image .

run_db: remove_db_container
explorer_run_db: explorer_remove_db_container
@cd explorer && \
docker run -d --name explorer-postgres-container -p 5432:5432 -v explorer-postgres-data:/var/lib/postgresql/data explorer-postgres-image

ecto_setup_db:
explorer_ecto_setup_db:
@cd explorer/ && \
./ecto_setup_db.sh

remove_db_container:
explorer_remove_db_container:
@cd explorer && \
docker stop explorer-postgres-container || true && \
docker rm explorer-postgres-container || true

clean_db: remove_db_container
explorer_clean_db: explorer_remove_db_container
@cd explorer && \
docker volume rm explorer-postgres-data || true

dump_db:
explorer_dump_db:
@cd explorer && \
docker exec -t explorer-postgres-container pg_dumpall -c -U explorer_user > dump.$$(date +\%Y\%m\%d_\%H\%M\%S).sql
@echo "Dumped database successfully to /explorer"

recover_db: run_db
explorer_recover_db: explorer_run_db
@read -p $$'\e[32mEnter the dump file to recover (e.g., dump.20230607_123456.sql): \e[0m' DUMP_FILE && \
cd explorer && \
docker cp $$DUMP_FILE explorer-postgres-container:/dump.sql && \
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [Aligned Infrastructure Guide](#aligned-infrastructure-guide)
- [Submitting Proofs to Aligned](#submitting-proofs-to-aligned)
- [Integrating Aligned into your Project](#integrating-aligned-into-your-project)
- [Versioning and Networks](#versioning-and-networks)


## The Project
Expand Down Expand Up @@ -181,3 +182,11 @@ For submitting proofs generated by your own project to the network via CLI, see
## Integrating Aligned into your Project

If you are developing applications using Aligned, we offer a [Rust-SDK](docs/3_guides/1_SDK_how_to.md) for submitting proofs directly to the network within your applications.

## Versioning and Networks

Testnet code and documentation is always in sync with the default [Testnet Branch](https://github.com/yetanotherco/aligned_layer/tree/feat/testnet)

Releases are provided for each version of the testnet.

Latest version of the code, deployed on staging network, is always on [Staging Branch](https://github.com/yetanotherco/aligned_layer/tree/feat/staging)
Loading
Loading