Skip to content

Commit

Permalink
fix: limit enodes and enrs to max 20 (#289)
Browse files Browse the repository at this point in the history
Signed-off-by: Barnabas Busa <[email protected]>
  • Loading branch information
barnabasbusa authored Nov 29, 2024
1 parent 1bf4fea commit 470d78f
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions roles/ethereum_post_network_setup/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,51 @@
# Generate missing network config files
- name: Generate enodes.txt for EL clients
ansible.builtin.copy:
content: |
{% for host in (groups['ethereum_node']) | sort | unique %}
content: |-
{% for host in (groups['ethereum_node'] | sort | unique)[:20] -%}
{% if hostvars[host]['ethereum_node_fact_el_enode'] is defined %}
{{ hostvars[host]['ethereum_node_fact_el_enode'] }}
{%- if not loop.last %}
{% endif %}
{% endif %}
{% endfor %}
dest: "{{ ethereum_genesis_generator_output_dir }}/metadata/enodes.txt"
mode: "0644"
- name: Generate "bootstrap_nodes.txt" for CL clients
ansible.builtin.copy:
content: |
{% for host in (groups['ethereum_node'] + groups['bootnode']) | sort | unique %}
content: |-
{% for host in ((groups['ethereum_node'] + groups['bootnode']) | sort | unique)[:20] -%}
{% if hostvars[host]['cl_bootnode_fact_enr'] is defined %}
{{ hostvars[host]['cl_bootnode_fact_enr'] }}
{%- if not loop.last %}
{% endif %}
{% endif %}
{% if hostvars[host]['ethereum_node_fact_cl_enr'] is defined %}
{{ hostvars[host]['ethereum_node_fact_cl_enr'] }}
{%- if not loop.last %}
{% endif %}
{% endif %}
{% endfor %}
dest: "{{ ethereum_genesis_generator_output_dir }}/metadata/bootstrap_nodes.txt"
mode: "0644"
- name: Generate "bootstrap_nodes.yaml" for Prysm
ansible.builtin.copy:
content: |
{% for host in (groups['ethereum_node'] + groups['bootnode']) | sort | unique %}
content: |-
{% for host in ((groups['ethereum_node'] + groups['bootnode']) | sort | unique)[:20] -%}
{% if hostvars[host]['cl_bootnode_fact_enr'] is defined %}
- {{ hostvars[host]['cl_bootnode_fact_enr'] }}
{%- if not loop.last %}
{% endif %}
{% endif %}
{% if hostvars[host]['ethereum_node_fact_cl_enr'] is defined %}
- {{ hostvars[host]['ethereum_node_fact_cl_enr'] }}
{%- if not loop.last %}
{% endif %}
{% endif %}
{% endfor %}
dest: "{{ ethereum_genesis_generator_output_dir }}/metadata/bootstrap_nodes.yaml"
Expand Down

0 comments on commit 470d78f

Please sign in to comment.