Skip to content

Commit 7c8fcf1

Browse files
authored
Merge branch 'main' into feat/shadow-automation
2 parents 7cee3cb + 6baba7c commit 7c8fcf1

35 files changed

Lines changed: 2386 additions & 168 deletions

README.md

Lines changed: 100 additions & 13 deletions
Large diffs are not rendered by default.

ansible-devnet/genesis/validator-config.yaml

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ validators:
5454
ip: "65.109.131.177"
5555
quic: 9001
5656
metricsPort: 9095
57-
httpPort: 5055
57+
apiPort: 5055
5858
isAggregator: false
5959
count: 1
6060

@@ -97,27 +97,65 @@ validators:
9797
isAggregator: false
9898
count: 1
9999

100-
# - name: "gean_0"
100+
- name: "gean_0"
101+
# node id d8cfb453fbcbcf6bab2fe3d73d6b476101a813e40062e264a7173c79ad51f2b8
102+
# peer id 16Uiu2HAmGbnwXEdBYDtARoSbkQ6wjtakg8EynnNaPcksatU5acXr
103+
privkey: "df008e968231c25c3938d80fee9bcc93b4b9711312cf471c1b6f77e67ad68d08"
104+
enrFields:
105+
# verify /ip4/204.168.134.201/udp/9001/quic-v1/p2p/16Uiu2HAmGbnwXEdBYDtARoSbkQ6wjtakg8EynnNaPcksatU5acXr
106+
ip: "204.168.134.201"
107+
quic: 9001
108+
metricsPort: 9095
109+
apiPort: 5055
110+
isAggregator: false
111+
count: 1
112+
113+
- name: "nlean_0"
114+
# node id 120f7715439bfdcb8025d26ade27488646298a4d9ac99f31ccf4f97fcc60fdfa
115+
# peer id 16Uiu2HAmKyxGoN46ruQqSVzYyNUj2FKTWu7RGCLDGEdpzZ67EAde
116+
privkey: "d94e3dc35e320440c891b66bd82d1aaf2079364162815b32c2633ecae009c84c"
117+
enrFields:
118+
# verify /ip4/95.216.164.165/udp/9001/quic-v1/p2p/16Uiu2HAmKyxGoN46ruQqSVzYyNUj2FKTWu7RGCLDGEdpzZ67EAde
119+
ip: "95.216.164.165"
120+
quic: 9001
121+
metricsPort: 9095
122+
apiPort: 5055
123+
isAggregator: false
124+
count: 1
125+
126+
# - name: "lean_node_0"
127+
# # node id 2289c0a43d51d4f50eee6101c580dbe3aba11eb4a9d32ba9993dd9976c5b994d
128+
# # peer id 16Uiu2HAkxUKxdny94t6WujGhVMBvpQJcTBVFGMGnzzkdyzbNLp7f
129+
# privkey: "520940446264167697a35be635041d651e48989ce2bb36698c444f42a2dd4f6c"
101130
# enrFields:
102-
# ip: "204.168.134.201"
131+
# # verify /ip4/95.217.19.42/udp/9001/quic-v1/p2p/16Uiu2HAkxUKxdny94t6WujGhVMBvpQJcTBVFGMGnzzkdyzbNLp7f
132+
# ip: "95.217.19.42"
103133
# quic: 9001
104134
# metricsPort: 9095
105135
# apiPort: 5055
106136
# isAggregator: false
107137
# count: 1
108138

109-
# - name: "lean_node_0"
139+
# - name: "peam_0"
140+
# # node id 23537364cc6e2547f1ed53909e08e933c53aaed1c32a991e78cdcbc8e62c61cb
141+
# # peer id 16Uiu2HAmVSWJiHJMtfuLkyr8Du4BxTLg9rpgR32QHu1u3YuhcM3R
142+
# privkey: "8c7b62f4c4a35d134649817f44d2839ad15bcfa1fe6b87991f64d6f54f3ef2a1"
110143
# enrFields:
111-
# ip: "95.217.19.42"
144+
# # verify /ip4/95.216.173.151/udp/9001/quic-v1/p2p/16Uiu2HAmVSWJiHJMtfuLkyr8Du4BxTLg9rpgR32QHu1u3YuhcM3R
145+
# ip: "95.216.173.151"
112146
# quic: 9001
113147
# metricsPort: 9095
114148
# apiPort: 5055
115149
# isAggregator: false
116150
# count: 1
117151

118-
# - name: "peam_0"
152+
# - name: "node_0"
153+
# # node id 4a27002fe8c79b68acf1e8af321fd4f3407492ab626de16174105234b4e726a7
154+
# # peer id 16Uiu2HAkxthAvokRQU71Secqos58q38TSXBqHHt5UUM5Viu2EuvF
155+
# privkey: "ebf06c49c66d4d08adaed41e901f49fd7439aa851110cf08c9ae54e9322a696e"
119156
# enrFields:
120-
# ip: "95.216.173.151"
157+
# # verify /ip4/95.216.165.186/udp/9001/quic-v1/p2p/16Uiu2HAkxthAvokRQU71Secqos58q38TSXBqHHt5UUM5Viu2EuvF
158+
# ip: "95.216.165.186"
121159
# quic: 9001
122160
# metricsPort: 9095
123161
# apiPort: 5055

ansible/playbooks/copy-genesis.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,20 +153,30 @@
153153
loop_control:
154154
label: "{{ item }}.key"
155155

156+
- name: Resolve hash-sig key files for this node
157+
vars:
158+
_av: "{{ lookup('file', genesis_dir + '/annotated_validators.yaml') | from_yaml }}"
159+
_assignments: "{{ _av[inventory_hostname] | default([]) }}"
160+
_base: "{{ _assignments | map(attribute='privkey_file') | map('regex_replace', '_sk\\.ssz$', '') | list }}"
161+
set_fact:
162+
node_hash_sig_files: "{{ (_base | product(['_sk.ssz', '_pk.ssz', '_sk.json', '_pk.json']) | map('join') | list) + ['validator-keys-manifest.yaml'] }}"
163+
when: hash_sig_keys_stat.stat.exists
164+
156165
- name: Create hash-sig-keys directory on remote
157166
file:
158167
path: "{{ actual_remote_genesis_dir }}/hash-sig-keys"
159168
state: directory
160169
mode: '0755'
161-
when: hash_sig_keys_stat.stat.exists
170+
when: hash_sig_keys_stat.stat.exists and (node_hash_sig_files | default([]) | length > 0)
162171

163-
- name: Copy hash-sig-keys directory to remote host
172+
- name: Copy hash-sig key files for this node only
164173
copy:
165-
src: "{{ genesis_dir }}/hash-sig-keys/"
166-
dest: "{{ actual_remote_genesis_dir }}/hash-sig-keys/"
167-
mode: '0644'
174+
src: "{{ genesis_dir }}/hash-sig-keys/{{ item }}"
175+
dest: "{{ actual_remote_genesis_dir }}/hash-sig-keys/{{ item }}"
176+
mode: '0600'
168177
force: yes
169-
when: hash_sig_keys_stat.stat.exists
178+
loop: "{{ node_hash_sig_files | default([]) }}"
179+
when: hash_sig_keys_stat.stat.exists and (node_hash_sig_files | default([]) | length > 0)
170180

171181
- name: List files on remote genesis directory
172182
find:

ansible/playbooks/deploy-nodes.yml

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# - node key files (*.key)
99
# - config.yaml, validators.yaml, nodes.yaml
1010
# - genesis.ssz, genesis.json
11-
# - hash-sig-keys/ directory (if exists, for qlean nodes)
11+
# - hash-sig-keys/ directory (if exists): only the sk/pk files for this node's validators
1212

1313
- name: Parse and validate node names
1414
hosts: localhost
@@ -122,7 +122,10 @@
122122

123123
- name: Sync validator-config.yaml to remote host
124124
copy:
125-
src: "{{ local_genesis_dir }}/validator-config.yaml"
125+
# Use the expanded subnet config when --subnets was specified; fall back
126+
# to the standard validator-config.yaml otherwise. The destination is
127+
# always validator-config.yaml so client roles don't need to change.
128+
src: "{{ local_genesis_dir }}/{{ validator_config_basename | default('validator-config.yaml') }}"
126129
dest: "{{ genesis_dir }}/validator-config.yaml"
127130
mode: '0644'
128131
force: yes
@@ -149,6 +152,7 @@
149152
loop:
150153
- config.yaml
151154
- validators.yaml
155+
- annotated_validators.yaml
152156
- nodes.yaml
153157
- genesis.ssz
154158
- genesis.json
@@ -165,23 +169,36 @@
165169
- deploy
166170
- sync
167171

172+
- name: Resolve hash-sig key files for this node
173+
vars:
174+
_av: "{{ lookup('file', local_genesis_dir + '/annotated_validators.yaml') | from_yaml }}"
175+
_assignments: "{{ _av[node_name] | default([]) }}"
176+
_base: "{{ _assignments | map(attribute='privkey_file') | map('regex_replace', '_sk\\.ssz$', '') | list }}"
177+
set_fact:
178+
node_hash_sig_files: "{{ (_base | product(['_sk.ssz', '_pk.ssz', '_sk.json', '_pk.json']) | map('join') | list) + ['validator-keys-manifest.yaml'] }}"
179+
when: hash_sig_keys_local.stat.exists
180+
tags:
181+
- deploy
182+
- sync
183+
168184
- name: Create hash-sig-keys directory on remote
169185
file:
170186
path: "{{ genesis_dir }}/hash-sig-keys"
171187
state: directory
172188
mode: '0755'
173-
when: hash_sig_keys_local.stat.exists
189+
when: hash_sig_keys_local.stat.exists and (node_hash_sig_files | default([]) | length > 0)
174190
tags:
175191
- deploy
176192
- sync
177193

178-
- name: Sync hash-sig-keys directory (for qlean nodes)
194+
- name: Copy hash-sig key files for this node only
179195
copy:
180-
src: "{{ local_genesis_dir }}/hash-sig-keys/"
181-
dest: "{{ genesis_dir }}/hash-sig-keys/"
182-
mode: '0644'
196+
src: "{{ local_genesis_dir }}/hash-sig-keys/{{ item }}"
197+
dest: "{{ genesis_dir }}/hash-sig-keys/{{ item }}"
198+
mode: '0600'
183199
force: yes
184-
when: hash_sig_keys_local.stat.exists
200+
loop: "{{ node_hash_sig_files | default([]) }}"
201+
when: hash_sig_keys_local.stat.exists and (node_hash_sig_files | default([]) | length > 0)
185202
tags:
186203
- deploy
187204
- sync
@@ -199,6 +216,9 @@
199216
- lighthouse
200217
- grandine
201218
- ethlambda
219+
- gean
220+
- nlean
221+
- peam
202222
- deploy
203223

204224
- name: Include common role
@@ -224,3 +244,37 @@
224244
tags:
225245
- deploy
226246

247+
# When --replace-with is used, sync updated config yamls to all remote hosts
248+
- name: Sync updated config files to all hosts after replacement
249+
hosts: all:!local
250+
gather_facts: no
251+
vars:
252+
genesis_dir: "{{ remote_genesis_dir | default('/opt/lean-quickstart/genesis') }}"
253+
local_genesis_dir: "{{ hostvars['localhost']['local_genesis_dir_path'] }}"
254+
tasks:
255+
- name: Sync config yamls to all hosts
256+
copy:
257+
src: "{{ local_genesis_dir }}/{{ item }}"
258+
dest: "{{ genesis_dir }}/{{ item }}"
259+
mode: '0644'
260+
force: yes
261+
loop:
262+
- validators.yaml
263+
- annotated_validators.yaml
264+
- nodes.yaml
265+
- validator-config.yaml
266+
when: sync_all_hosts | default(false) | bool
267+
tags:
268+
- deploy
269+
- sync
270+
271+
- name: Sync validator-keys-manifest to all hosts
272+
copy:
273+
src: "{{ local_genesis_dir }}/hash-sig-keys/validator-keys-manifest.yaml"
274+
dest: "{{ genesis_dir }}/hash-sig-keys/validator-keys-manifest.yaml"
275+
mode: '0644'
276+
force: yes
277+
when: sync_all_hosts | default(false) | bool
278+
tags:
279+
- deploy
280+
- sync

ansible/playbooks/helpers/deploy-single-node.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,31 @@
8686
- ethlambda
8787
- deploy
8888

89+
- name: Deploy Gean node
90+
include_role:
91+
name: gean
92+
when: client_type == "gean"
93+
tags:
94+
- gean
95+
- deploy
96+
97+
- name: Deploy Nlean node
98+
include_role:
99+
name: nlean
100+
when: client_type == "nlean"
101+
tags:
102+
- nlean
103+
- deploy
104+
105+
- name: Deploy Peam node
106+
include_role:
107+
name: peam
108+
when: client_type == "peam"
109+
tags:
110+
- peam
111+
- deploy
112+
89113
- name: Fail if unknown client type
90114
fail:
91-
msg: "Unknown client type '{{ client_type }}' for node '{{ node_name }}'. Expected: zeam, ream, qlean, lantern, lighthouse, grandine or ethlambda"
92-
when: client_type not in ["zeam", "ream", "qlean", "lantern", "lighthouse", "grandine", "ethlambda"]
115+
msg: "Unknown client type '{{ client_type }}' for node '{{ node_name }}'. Expected: zeam, ream, qlean, lantern, lighthouse, grandine, ethlambda, gean, nlean or peam"
116+
when: client_type not in ["zeam", "ream", "qlean", "lantern", "lighthouse", "grandine", "ethlambda", "gean", "nlean", "peam"]

0 commit comments

Comments
 (0)