Skip to content

Commit 6f4a2f5

Browse files
committed
feat: proof aggregtor docker
1 parent 50c9c93 commit 6f4a2f5

File tree

5 files changed

+86
-0
lines changed

5 files changed

+86
-0
lines changed

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,9 @@ docker_build_operator:
982982
docker_build_batcher:
983983
docker compose -f docker-compose.yaml --profile batcher build
984984

985+
docker_build_proof_aggregator:
986+
docker compose -f docker-compose.yaml --profile proof-aggregator build
987+
985988
docker_restart_aggregator:
986989
docker compose -f docker-compose.yaml --profile aggregator down
987990
docker compose -f docker-compose.yaml --profile aggregator up -d --remove-orphans --force-recreate
@@ -1002,6 +1005,7 @@ docker_build:
10021005
docker compose -f docker-compose.yaml --profile operator build
10031006
docker compose -f docker-compose.yaml --profile batcher build
10041007
docker compose -f docker-compose.yaml --profile aggregator build
1008+
docker compose -f docker-compose.yaml --profile proof-aggregator build
10051009

10061010
docker_up:
10071011
docker compose -f docker-compose.yaml --profile base up -d --remove-orphans --force-recreate
@@ -1016,10 +1020,12 @@ docker_up:
10161020
docker compose -f docker-compose.yaml --profile operator up -d --remove-orphans --force-recreate
10171021
docker compose -f docker-compose.yaml run --rm user-fund-payment-service-devnet
10181022
docker compose -f docker-compose.yaml --profile batcher up -d --remove-orphans --force-recreate
1023+
docker compose -f docker-compose.yaml --profile proof-aggregator up -d --remove-orphans --force-recreate
10191024
@echo "Up and running"
10201025

10211026
docker_down:
10221027
docker compose -f docker-compose.yaml --profile batcher down
1028+
docker compose -f docker-compose.yaml --profile proof-aggregator down
10231029
docker compose -f docker-compose.yaml --profile operator down
10241030
docker compose -f docker-compose.yaml --profile base down
10251031
@echo "Everything down"
@@ -1171,6 +1177,15 @@ docker_verify_proof_submission_success:
11711177
echo "All proofs verified successfully!"; \
11721178
'
11731179

1180+
docker_proof_aggregator_run_sp1:
1181+
docker exec $(shell docker ps | grep proof_aggregator | awk '{print $$1}') "AGGREGATOR=sp1 /aligned_layer/proof_aggregator_cpu /aligned_layer/config-files/config-proof-aggregator-docker.yaml && echo '{"last_aggregated_block":0}' > config-files/proof-aggregator.last_aggregated_block.json"
1182+
1183+
docker_proof_aggregator_run_risc0:
1184+
docker exec $(shell docker ps | grep proof_aggregator | awk '{print $$1}') "AGGREGATOR=risc0 /aligned_layer/proof_aggregator_cpu /aligned_layer/config-files/config-proof-aggregator-docker.yaml && echo '{"last_aggregated_block":0}' > config-files/proof-aggregator.last_aggregated_block.json"
1185+
1186+
docker_proof_aggregator_verify:
1187+
@(docker logs $$(docker ps | grep proof_aggregator | awk '{print $$1}') | grep -q "Error while aggregating and submitting proofs" && exit 1) || exit 0
1188+
11741189
docker_attach_foundry:
11751190
docker exec -ti $(shell docker ps | grep anvil | awk '{print $$1}') /bin/bash
11761191

@@ -1186,6 +1201,9 @@ docker_attach_operator:
11861201
docker_attach_batcher:
11871202
docker exec -ti $(shell docker ps | grep batcher | awk '{print $$1}') /bin/bash
11881203

1204+
docker_attach_proof_aggregator:
1205+
docker exec -ti $(shell docker ps | grep batcher | awk '{print $$1}') /bin/bash
1206+
11891207
docker_logs_anvil:
11901208
docker compose -f docker-compose.yaml logs anvil -f
11911209

@@ -1198,6 +1216,9 @@ docker_logs_operator:
11981216
docker_logs_batcher:
11991217
docker compose -f docker-compose.yaml logs batcher -f
12001218

1219+
docker_logs_proof_aggregator:
1220+
docker compose -f docker-compose.yaml logs proof-aggregator -f
1221+
12011222
__TELEMETRY__:
12021223
# Collector, Jaeger and Elixir API
12031224
telemetry_full_start: telemetry_compile_bls_verifier open_telemetry_start telemetry_start
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
aligned_service_manager_address: "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8"
2+
proof_aggregation_service_address: "0xFD471836031dc5108809D173A067e8486B9047A3"
3+
eth_rpc_url: "http://anvil:8545"
4+
eth_ws_url: "ws://anvil:8545"
5+
max_proofs_in_queue: 1000
6+
last_aggregated_block_filepath: config-files/proof-aggregator.last_aggregated_block.json
7+
proofs_per_chunk: 512 # Amount of proofs to process per chunk
8+
# This number comes from the blob data limit
9+
# Since each blob has a capacity of (4096 * 32) = 131.072 bytes
10+
# But to not surpass the field modulus we pad with a 0xo byte so we have (4096 * 31) = 126.976 bytes
11+
# of usable data
12+
# Since each proof commitments takes 32 bytes hash
13+
# We can aggregate as much proofs as 126.976 / 32 = 3968 per blob
14+
total_proofs_limit: 3968
15+
16+
17+
ecdsa:
18+
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"
19+
private_key_store_password: ""

docker-compose.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ services:
117117
dockerfile: docker/batcher.Dockerfile
118118
profiles:
119119
- batcher
120+
121+
proof_aggregator:
122+
image: ghcr.io/yetanotherco/aligned_layer/proof_aggregator:latest
123+
build:
124+
context: .
125+
dockerfile: docker/proof-aggregator.Dockerfile
126+
profiles:
127+
- proof-aggregator
120128

121129
aligned_base:
122130
image: ghcr.io/yetanotherco/aligned_layer/aligned_base:latest

docker/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,26 @@ And you can run this to attach to the anvil/foundry container and run `cast` wit
9292
make docker_attach_foundry
9393
```
9494

95+
## Aggregation
96+
97+
To aggregate SP1 proofs:
98+
99+
```shell
100+
make docker_proof_aggregator_run_sp1
101+
```
102+
103+
For Risc0:
104+
105+
```shell
106+
make docker_proof_aggregator_run_risc0
107+
```
108+
109+
To verify that the proofs have been aggregated correctly:
110+
111+
```shell
112+
make docker_proof_aggregator_verify
113+
```
114+
95115
## Logs
96116

97117
You can watch logs for the components with the following commands:
@@ -111,3 +131,7 @@ make docker_logs_operator
111131
```shell
112132
make docker_logs_batcher
113133
```
134+
135+
```shell
136+
make docker_logs_proof_aggregator
137+
```

docker/proof-aggregator.Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM ghcr.io/yetanotherco/aligned_layer/aligned_base:latest AS base
2+
3+
RUN apt update -y && apt install -y gcc
4+
5+
WORKDIR /aligned_layer/aggregation_mode/
6+
RUN cargo build --features prove --release --bin proof_aggregator_cpu
7+
8+
FROM debian:bookworm-slim AS final
9+
10+
COPY --from=base /aligned_layer/aggregation_mode/target/release/ /aligned_layer/proof_aggregator_cpu
11+
COPY ./config-files/config-proof-aggregator-docker.yaml ./config-files/
12+
COPY ./config-files/anvil.proof-aggregator.ecdsa.key.json ./config-files/
13+
14+
RUN apt update -y && apt install -y libssl-dev ca-certificates

0 commit comments

Comments
 (0)