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

ADD: mevboost-EL & CL in molecule test #667

Merged
merged 41 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c7823e5
ADD: mevboost-besu-lighthouse in molecule test
gbayasgalan Aug 17, 2022
42c0c62
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 17, 2022
2a0b19b
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 18, 2022
d123668
ADD: mevboost-geth-lighthouse
gbayasgalan Aug 19, 2022
2344257
ADD: mevboost - nethermind - lighthouse
gbayasgalan Aug 19, 2022
79025c3
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 19, 2022
c3d9bd2
ADD: mevboost - geth - lighthouse
gbayasgalan Aug 19, 2022
4c0289b
Merge branch 'mevboost' of https://github.com/gbayasgalan/ethereum-no…
gbayasgalan Aug 19, 2022
d56a0f7
ADD: mevboost - besu - teku
gbayasgalan Aug 19, 2022
058d2ef
ADD: mevboost - nethermind - teku
gbayasgalan Aug 19, 2022
5f38fb6
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 22, 2022
5422e2d
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 23, 2022
3c151ad
ADD: mevboost-nethermind-nimbus
gbayasgalan Aug 23, 2022
ef5c704
ADD: mevboost-geth-nimbus
gbayasgalan Aug 23, 2022
e5d4223
ADD: mevboost-besu-nimbus
gbayasgalan Aug 23, 2022
bea76b8
UPDATE: docker images
gbayasgalan Aug 23, 2022
014450c
EDIT: get docker images
gbayasgalan Aug 23, 2022
1cc47d8
ADD: mevboost-nethermind-prysm
gbayasgalan Aug 24, 2022
b2863e7
ADD: mevboost-geth-prysm
gbayasgalan Aug 24, 2022
a2f6afe
ADD: mevboost-besu-prysm
gbayasgalan Aug 24, 2022
68c52b8
EDIT: modify prysm's parameter for EL
gbayasgalan Aug 24, 2022
0949b34
EDIT: removing `location:` from `create.yaml`
gbayasgalan Aug 24, 2022
51bcc31
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 24, 2022
be2c1c1
EDIT: static mevboost relay (as variable)
gbayasgalan Aug 24, 2022
b21f4bd
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 26, 2022
62c9ec4
EDIT: el+lighthouse, prysm, teku trim down params
gbayasgalan Aug 27, 2022
235f141
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 27, 2022
bf52898
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 29, 2022
e9dcac2
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 30, 2022
2a98fa6
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 30, 2022
85c392a
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Aug 31, 2022
6ba59a8
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Sep 1, 2022
186d679
UPDATE: updating docker images
gbayasgalan Sep 2, 2022
13245eb
UPDATE: docker images
gbayasgalan Sep 2, 2022
aa91df0
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Sep 5, 2022
496ae3e
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Sep 5, 2022
8512105
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Sep 6, 2022
2a11f06
UPDATE: prysm docker image
gbayasgalan Sep 6, 2022
65cd989
EDIT: mevboost - nimbus
gbayasgalan Sep 6, 2022
f546589
EDIT: mevboost - nimbus
gbayasgalan Sep 6, 2022
69092c9
Merge branch 'stereum-dev:main' into mevboost
gbayasgalan Sep 6, 2022
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
12 changes: 12 additions & 0 deletions .github/workflows/test-molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,18 @@ jobs:
{role: "manage-service", test: "monitor-nimbus"},
{role: "manage-service", test: "monitor-prysm"},
{role: "manage-service", test: "monitor-teku"},
{role: "manage-service", test: "mevboost-besu-lighthouse"},
{role: "manage-service", test: "mevboost-besu-nimbus"},
{role: "manage-service", test: "mevboost-besu-prysm"},
{role: "manage-service", test: "mevboost-besu-teku"},
{role: "manage-service", test: "mevboost-geth-lighthouse"},
{role: "manage-service", test: "mevboost-geth-nimbus"},
{role: "manage-service", test: "mevboost-geth-prysm"},
{role: "manage-service", test: "mevboost-geth-teku"},
{role: "manage-service", test: "mevboost-nethermind-lighthouse"},
{role: "manage-service", test: "mevboost-nethermind-nimbus"},
{role: "manage-service", test: "mevboost-nethermind-prysm"},
{role: "manage-service", test: "mevboost-nethermind-teku"},
{role: "manage-service", test: "besu-lighthouse"},
{role: "manage-service", test: "besu-nimbus"},
{role: "manage-service", test: "besu-prysm"},
Expand Down
13 changes: 8 additions & 5 deletions controls/defaults/stereum_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ stereum_static:
install: false
versions:
# consensus clients
lighthouse: v2.5.1
nimbus: multiarch-v22.7.0
teku: "22.8.0"
prysm: v2.1.3
lighthouse: v3.0.0
nimbus: multiarch-v22.8.0
teku: "22.8.1"
prysm: v3.0.0

# execution clients
geth: v1.10.21
geth: v1.10.22
besu: "22.7.0-RC2"
nethermind: "1.13.5"

# mevboost
mevboost: v0.7.10

# ssv
ssv_network: v0.3.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
--datadir=/opt/app/beacon
--prater=true
--genesis-state=/opt/app/genesis/prysm-prater-genesis.ssz
--http-web3provider=http://stereum-{{ besu_service }}:8551
--execution-endpoint=http://stereum-{{ besu_service }}:8551
--jwt-secret=/engine.jwt
user: "2000"
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
--rpc-host=0.0.0.0
--grpc-gateway-host=0.0.0.0
--p2p-max-peers=100
--http-web3provider=http://stereum-{{ geth_service }}:8551
--execution-endpoint=http://stereum-{{ geth_service }}:8551
--monitoring-port=8080
--monitoring-host=0.0.0.0
--jwt-secret=/engine.jwt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
---
- name: Converge
hosts: all
vars_files:
- ../../../../defaults/stereum_defaults.yaml
vars:
lighthouse_beacon_service: 5bc8cb90-1909-11ed-9142-cf15cf490a91
lighthouse_validator_service: 5e04445c-1909-11ed-b0ac-1b18212b17aa
besu_service: 5c716d90-1909-11ed-986f-931342a7fe9d
mevboost_service: 5c9541ac-1909-11ed-8585-a373c154e6c6

tasks:
# besu service
- block:
- set_fact:
stereum: "{{ stereum_static | combine(stereum_args, recursive=True) }}"
- name: "Include manage-service"
include_role:
name: "manage-service"
vars:
stereum_args:
manage_service:
save: true
state: started
configuration:
service: BesuService
id: "{{ besu_service }}"
image: hyperledger/besu:{{ stereum_static.defaults.versions.besu }}
ports:
- 0.0.0.0:30303:30303/tcp
- 0.0.0.0:30303:30303/udp
entrypoint: ["besu"]
env:
JAVA_OPTS: -Xmx4g
command:
- --network=goerli
- --data-path=/opt/app/data
- --data-storage-format=BONSAI
- --sync-mode=X_SNAP
- --p2p-port=30303
- --p2p-host=0.0.0.0
- --rpc-http-enabled=true
- --rpc-http-host=0.0.0.0
- --rpc-http-cors-origins=*
- --rpc-http-api=ETH,NET,WEB3
- --rpc-ws-enabled=true
- --rpc-ws-api=WEB3,ETH,NET
- --rpc-ws-host=0.0.0.0
- --host-allowlist=*
- --metrics-enabled
- --metrics-host=0.0.0.0
- --logging=INFO
- --engine-rpc-enabled=true
- --engine-host-allowlist=*
- --engine-rpc-port=8551
- --engine-jwt-enabled=true
- --engine-jwt-secret=/engine.jwt
user: "2000"
volumes:
- "/opt/app/services/{{ besu_service }}/data:/opt/app/data"
- "/opt/app/services/{{ besu_service }}/engine.jwt:/engine.jwt"

# lh beacon service
- block:
- set_fact:
stereum: "{{ stereum_static | combine(stereum_args, recursive=True) }}"
- name: "Include manage-service"
include_role:
name: "manage-service"
vars:
stereum_args:
manage_service:
save: true
state: started
configuration:
service: LighthouseBeaconService
id: "{{ lighthouse_beacon_service }}"
image: sigp/lighthouse:{{ stereum_static.defaults.versions.lighthouse }}
env: {}
ports:
- 0.0.0.0:9000:9000/tcp
- 0.0.0.0:9000:9000/udp
command:
- lighthouse
- --network=goerli
- --debug-level=info
- beacon_node
- --datadir=/opt/app/beacon
- --http
- --http-address=0.0.0.0
- --http-allow-sync-stalled
- --metrics
- --metrics-address=0.0.0.0
- --execution-endpoints=http://stereum-{{ besu_service }}:8551
- --execution-jwt=/engine.jwt
- --builder=http://stereum-{{ mevboost_service }}:18550
- --enr-udp-port=9000
- --enr-tcp-port=9000
- --discovery-port=9000
entrypoint: []
user: "2000"
volumes:
- "/opt/app/services/{{ lighthouse_beacon_service }}/beacon/lighthouse:/opt/app/beacon"
- "/opt/app/services/{{ lighthouse_beacon_service }}/slasher:/opt/app/slasher"
- "/opt/app/services/{{ besu_service }}/engine.jwt:/engine.jwt"

# lh validator service
- block:
- set_fact:
stereum: "{{ stereum_static | combine(stereum_args, recursive=True) }}"
- name: "Include manage-service"
include_role:
name: "manage-service"
vars:
stereum_args:
manage_service:
save: true
state: started
configuration:
service: LighthouseValidatorService
id: "{{ lighthouse_validator_service }}"
image: sigp/lighthouse:{{ stereum_static.defaults.versions.lighthouse }}
env: {}
command:
- lighthouse
- vc
- --debug-level=info
- --network=goerli
- --beacon-nodes=http://stereum-{{ lighthouse_beacon_service }}:5052
- --datadir=/opt/app/validator
- --init-slashing-protection
- --graffiti="stereum.net"
- --metrics
- --metrics-address=0.0.0.0
- --http
- --http-address=0.0.0.0
- --unencrypted-http-transport
- --suggested-fee-recipient=0x5dC29815e46dfb5EAb5C57606f8e2A5FbBdb454e
- --builder-proposals
entrypoint: []
user: "2000"
volumes:
- "/opt/app/services/{{ lighthouse_validator_service }}/validator:/opt/app/validator"

# mevboost service
- block:
- set_fact:
stereum: "{{ stereum_static | combine(stereum_args, recursive=True) }}"
- name: "Include manage-service"
include_role:
name: "manage-service"
vars:
stereum_args:
manage_service:
save: true
state: started
configuration:
service: MevBoostService
id: "{{ mevboost_service }}"
image: flashbots/mev-boost:{{ stereum_static.defaults.versions.mevboost }}
env: {}
ports: []
command: []
entrypoint:
- /app/mev-boost
- -addr
- 0.0.0.0:18550
- -goerli
- -relay-check
- -relays
- https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@builder-relay-goerli.flashbots.net
user: "2000"
volumes: []

# EOF
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
- name: Create
hosts: localhost
connection: local
gather_facts: false
no_log: "{{ molecule_no_log }}"
vars:
ssh_port: 22
ssh_user: root
ssh_path: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}/ssh_key"
tasks:
- name: Create SSH key
user:
name: "{{ lookup('env', 'USER') }}"
generate_ssh_key: true
ssh_key_file: "{{ ssh_path }}"
force: true
register: generated_ssh_key

- name: Register the SSH key name
set_fact:
ssh_key_name: "molecule-generated-{{ 12345 | random | to_uuid }}"

- name: Register SSH key for test instance(s)
hcloud_ssh_key:
name: "{{ ssh_key_name }}"
public_key: "{{ generated_ssh_key.ssh_public_key }}"
state: present

- name: Create molecule instance(s)
hcloud_server:
name: "{{ item.name }}"
server_type: "{{ item.server_type }}"
ssh_keys:
- "{{ ssh_key_name }}"
volumes: "{{ item.volumes | default(omit) }}"
image: "{{ item.image }}"
location: "hel1"
datacenter: "{{ item.datacenter | default(omit) }}"
user_data: "{{ item.user_data | default(omit) }}"
api_token: "{{ lookup('env', 'HCLOUD_TOKEN') }}"
state: present
register: server
with_items: "{{ molecule_yml.platforms }}"
async: 7200
poll: 0

- name: Wait for instance(s) creation to complete
async_status:
jid: "{{ item.ansible_job_id }}"
register: hetzner_jobs
until: hetzner_jobs.finished
retries: 300
with_items: "{{ server.results }}"

- name: Attach Server to Subnetwork(s)
hcloud_server_network:
network: "{{ item.network.name }}"
server: "{{ item.name }}"
ip: "{{ item.network.ip }}"
api_token: "{{ lookup('env', 'HCLOUD_TOKEN') }}"
state: "present"
loop: "{{ molecule_yml.platforms }}"
when: molecule_yml.platforms is search('network')

- name: Populate instance config dict
set_fact:
instance_conf_dict: {
'instance': "{{ item.hcloud_server.name }}",
'ssh_key_name': "{{ ssh_key_name }}",
'address': "{{ item.hcloud_server.ipv4_address }}",
'user': "{{ ssh_user }}",
'port': "{{ ssh_port }}",
'identity_file': "{{ ssh_path }}", }
with_items: "{{ hetzner_jobs.results }}"
register: instance_config_dict
when: server.changed | bool

- name: Convert instance config dict to a list
set_fact:
instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}"
when: server.changed | bool

- name: Dump instance config
copy:
content: "{{ instance_conf | to_json | from_json | to_yaml }}"
dest: "{{ molecule_instance_config }}"
when: server.changed | bool

- name: Wait for SSH
wait_for:
port: "{{ ssh_port }}"
host: "{{ item.address }}"
search_regex: SSH
delay: 10
with_items: "{{ lookup('file', molecule_instance_config) | from_yaml }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
- name: Destroy
hosts: localhost
connection: local
gather_facts: false
no_log: "{{ molecule_no_log }}"
tasks:
- name: Populate the instance config
block:
- name: Populate instance config from file
set_fact:
instance_conf: "{{ lookup('file', molecule_instance_config) | from_yaml }}"
skip_instances: false
rescue:
- name: Populate instance config when file missing
set_fact:
instance_conf: {}
skip_instances: true

- name: Destroy molecule instance(s)
hcloud_server:
name: "{{ item.instance }}"
api_token: "{{ lookup('env', 'HCLOUD_TOKEN') }}"
state: absent
register: server
with_items: "{{ instance_conf }}"
when: not skip_instances
async: 7200
poll: 0

- name: Wait for instance(s) deletion to complete
async_status:
jid: "{{ item.ansible_job_id }}"
register: hetzner_jobs
until: hetzner_jobs.finished
retries: 300
with_items: "{{ server.results }}"

- name: Remove registered SSH key
hcloud_ssh_key:
name: "{{ instance_conf[0].ssh_key_name }}"
state: absent
when:
- not skip_instances
- instance_conf | length # must contain at least one instance

- name: Populate instance config
set_fact:
instance_conf: {}

- name: Dump instance config
copy:
content: "{{ instance_conf | to_yaml }}"
dest: "{{ molecule_instance_config }}"
when: server.changed | bool
Loading