Skip to content

Commit 951526d

Browse files
committed
feat: add attestation_committee_count config and auto aggregator selection
1 parent c571bc7 commit 951526d

File tree

13 files changed

+92
-0
lines changed

13 files changed

+92
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ Grafana is started with the two pre-provisioned dashboards from [leanMetrics](ht
8282

8383
> **Note:** The `--metrics` flag only affects local deployments. When using Ansible deployment mode, this flag is ignored. Metrics ports are always exposed by clients regardless of this flag.
8484
85+
### Aggregator Selection
86+
87+
```sh
88+
# Let the system randomly select an aggregator (default behavior)
89+
NETWORK_DIR=local-devnet ./spin-node.sh --node all --generateGenesis
90+
91+
# Manually specify which node should be the aggregator
92+
NETWORK_DIR=local-devnet ./spin-node.sh --node all --generateGenesis --aggregator zeam_0
93+
94+
# The aggregator selection is applied automatically and the isAggregator flag
95+
# is updated in validator-config.yaml before nodes are started
96+
```
97+
8598
## Args
8699

87100
1. `NETWORK_DIR` is an env to specify the network directory. Should have a `genesis` directory with genesis config. A `data` folder will be created inside this `NETWORK_DIR` if not already there.
@@ -131,6 +144,7 @@ Grafana is started with the two pre-provisioned dashboards from [leanMetrics](ht
131144
- If not provided, defaults to `latest` for zeam, ream, and lantern, and `dd67521` for qlean
132145
- The script will automatically pull the specified Docker images before running containers
133146
- Example: `--tag devnet0` or `--tag devnet1`
147+
<<<<<<< HEAD
134148
11. `--metrics` starts a Prometheus + Grafana metrics stack alongside the devnet (local deployments only). When specified:
135149
- Generates `metrics/prometheus/prometheus.yml` from `validator-config.yaml` with scrape targets for all configured nodes
136150
- Starts Prometheus (http://localhost:9090) and Grafana (http://localhost:3000) via Docker Compose
@@ -139,6 +153,15 @@ Grafana is started with the two pre-provisioned dashboards from [leanMetrics](ht
139153
- On Ctrl+C cleanup, the metrics stack is stopped automatically
140154

141155
Note: Client metrics endpoints are always enabled regardless of this flag.
156+
=======
157+
11. `--metrics` enables metrics collection on all nodes. When specified, each client will activate its metrics endpoint according to its implementation. Metrics ports are configured per node in `validator-config.yaml`.
158+
12. `--aggregator` specifies which node should act as the aggregator (1 aggregator per subnet).
159+
- If not provided, one node will be randomly selected as the aggregator
160+
- If provided, the specified node will be set as the aggregator
161+
- The aggregator selection updates the `isAggregator` flag in `validator-config.yaml`
162+
- Example: `--aggregator zeam_0` to make zeam_0 the aggregator
163+
- Example: Without flag, a random node will be selected automatically
164+
>>>>>>> 1030459 (feat: add attestation_committee_count config and auto aggregator selection)
142165
143166
### Clients supported
144167

ansible-devnet/genesis/validator-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ deployment_mode: ansible
44
config:
55
activeEpoch: 18
66
keyType: "hash-sig"
7+
attestation_committee_count: 1
78
validators:
89
- name: "zeam_0"
910
# node id 7d0904dc6d8d7130e0e68d5d3175d0c3cf470f8725f67bd8320882f5b9753cc0

client-cmds/ethlambda-cmd.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ node_binary="$binary_path \
1818
--node-key $configDir/$item.key \
1919
--metrics-address 0.0.0.0 \
2020
--metrics-port $metricsPort \
21+
--attestation-committee-count $attestationCommitteeCount \
2122
$aggregator_flag"
2223

2324
# Command when running as docker container
@@ -28,6 +29,7 @@ node_docker="ghcr.io/lambdaclass/ethlambda:devnet2 \
2829
--node-key /config/$item.key \
2930
--metrics-address 0.0.0.0 \
3031
--metrics-port $metricsPort \
32+
--attestation-committee-count $attestationCommitteeCount \
3133
$aggregator_flag"
3234

3335
node_setup="docker"

client-cmds/grandine-cmd.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ node_binary="$grandine_bin \
1818
--http-address 0.0.0.0 \
1919
--http-port $metricsPort \
2020
--hash-sig-key-dir $configDir/hash-sig-keys \
21+
--attestation-committee-count $attestationCommitteeCount \
2122
$aggregator_flag"
2223

2324
node_docker="sifrai/lean:devnet-2 \
@@ -32,6 +33,7 @@ node_docker="sifrai/lean:devnet-2 \
3233
--http-address 0.0.0.0 \
3334
--http-port $metricsPort \
3435
--hash-sig-key-dir /config/hash-sig-keys \
36+
--attestation-committee-count $attestationCommitteeCount \
3537
$aggregator_flag"
3638

3739
# choose either binary or docker

client-cmds/lantern-cmd.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ node_binary="$scriptDir/lantern/build/lantern_cli \
2929
--http-port 5055 \
3030
--log-level debug \
3131
--hash-sig-key-dir $configDir/hash-sig-keys \
32+
--attestation-committee-count $attestationCommitteeCount \
3233
$aggregator_flag"
3334

3435
node_docker="$LANTERN_IMAGE --data-dir /data \
@@ -44,6 +45,7 @@ node_docker="$LANTERN_IMAGE --data-dir /data \
4445
--http-port 5055 \
4546
--log-level debug \
4647
--hash-sig-key-dir /config/hash-sig-keys \
48+
--attestation-committee-count $attestationCommitteeCount \
4749
$aggregator_flag"
4850

4951
# choose either binary or docker

client-cmds/lighthouse-cmd.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ node_binary="$lighthouse_bin lean_node \
2121
$metrics_flag \
2222
--metrics-address 0.0.0.0 \
2323
--metrics-port $metricsPort \
24+
--attestation-committee-count $attestationCommitteeCount \
2425
$aggregator_flag"
2526

2627
node_docker="hopinheimer/lighthouse:latest lighthouse lean_node \
@@ -35,6 +36,7 @@ node_docker="hopinheimer/lighthouse:latest lighthouse lean_node \
3536
$metrics_flag \
3637
--metrics-address 0.0.0.0 \
3738
--metrics-port $metricsPort \
39+
--attestation-committee-count $attestationCommitteeCount \
3840
$aggregator_flag"
3941

4042
node_setup="docker"

client-cmds/qlean-cmd.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ node_binary="$scriptDir/qlean/build/src/executable/qlean \
2222
--node-id $item --node-key $configDir/$privKeyPath \
2323
--listen-addr /ip4/0.0.0.0/udp/$quicPort/quic-v1 \
2424
--prometheus-port $metricsPort \
25+
--attestation-committee-count $attestationCommitteeCount \
2526
$aggregator_flag \
2627
-ldebug \
2728
-ltrace"
@@ -37,6 +38,7 @@ node_docker="qdrvm/qlean-mini:devnet-2 \
3738
--node-id $item --node-key /config/$privKeyPath \
3839
--listen-addr /ip4/0.0.0.0/udp/$quicPort/quic-v1 \
3940
--prometheus-port $metricsPort \
41+
--attestation-committee-count $attestationCommitteeCount \
4042
$aggregator_flag \
4143
-ldebug \
4244
-ltrace"

client-cmds/ream-cmd.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ node_binary="$scriptDir/../ream/target/release/ream --data-dir $dataDir/$item \
2222
--metrics-address 0.0.0.0 \
2323
--metrics-port $metricsPort \
2424
--http-address 0.0.0.0 \
25+
--attestation-committee-count $attestationCommitteeCount \
2526
$aggregator_flag"
2627

2728
node_docker="ghcr.io/reamlabs/ream:latest-devnet2 --data-dir /data \
@@ -35,6 +36,7 @@ node_docker="ghcr.io/reamlabs/ream:latest-devnet2 --data-dir /data \
3536
--metrics-address 0.0.0.0 \
3637
--metrics-port $metricsPort \
3738
--http-address 0.0.0.0 \
39+
--attestation-committee-count $attestationCommitteeCount \
3840
$aggregator_flag"
3941

4042
# choose either binary or docker

client-cmds/zeam-cmd.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ node_binary="$scriptDir/../zig-out/bin/zeam node \
1919
--node-id $item --node-key $configDir/$item.key \
2020
$metrics_flag \
2121
--api-port $metricsPort \
22+
--attestation-committee-count $attestationCommitteeCount \
2223
$aggregator_flag"
2324

2425
node_docker="--security-opt seccomp=unconfined blockblaz/zeam:devnet2 node \
@@ -28,6 +29,7 @@ node_docker="--security-opt seccomp=unconfined blockblaz/zeam:devnet2 node \
2829
--node-id $item --node-key /config/$item.key \
2930
$metrics_flag \
3031
--api-port $metricsPort \
32+
--attestation-committee-count $attestationCommitteeCount \
3133
$aggregator_flag"
3234

3335
# choose either binary or docker

local-devnet/genesis/validator-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ deployment_mode: local
44
config:
55
activeEpoch: 18
66
keyType: "hash-sig"
7+
attestation_committee_count: 1
78
validators:
89
- name: "zeam_0"
910
# node id 7d0904dc6d8d7130e0e68d5d3175d0c3cf470f8725f67bd8320882f5b9753cc0

0 commit comments

Comments
 (0)