Skip to content

Commit

Permalink
ADD: SSV Changes (#2096)
Browse files Browse the repository at this point in the history
* ADD: SSV Changes

* FIX: New SSV Repo
  • Loading branch information
NeoPlays authored Nov 25, 2024
1 parent 2cd69be commit 6736619
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 5 deletions.
64 changes: 63 additions & 1 deletion controls/roles/update-changes/molecule/223/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,68 @@
mevboost: []
otherServices: []
become: yes

- name: Create SSVNetworkService config
copy:
dest: "/etc/stereum/services/cb941f15-6eef-4e4d-fc81-4d524b627373.yaml"
owner: "root"
group: "root"
mode: 0644
content: |
service: SSVNetworkService
id: cb941f15-6eef-4e4d-fc81-4d524b627373
configVersion: 1
command: make BUILD_PATH=/go/bin/ssvnode start-node && docker logs ssv_node
entrypoint: []
env:
CONFIG_PATH: /data/config.yaml
image: bloxstaking/ssv-node:v1.3.8
ports:
- 0.0.0.0:12000:12000/udp
- 0.0.0.0:13000:13000/tcp
volumes:
- /opt/stereum/ssv_network-cb941f15-6eef-4e4d-fc81-4d524b627373/data:/data
- /opt/stereum/ssv_network-cb941f15-6eef-4e4d-fc81-4d524b627373/secrets:/secrets
user: "2000"
autoupdate: true
network: holesky
dependencies:
executionClients: []
consensusClients: []
mevboost: []
otherServices: []
become: yes

- name: Create SSVNetworkService config
copy:
dest: "/etc/stereum/services/611cf17d-adf7-433e-bc4e-2e38c0f502c3.yaml"
owner: "root"
group: "root"
mode: 0644
content: |
service: SSVNetworkService
id: 611cf17d-adf7-433e-bc4e-2e38c0f502c3
configVersion: 1
command: make BUILD_PATH=/go/bin/ssvnode start-node && docker logs ssv_node
entrypoint: []
env:
CONFIG_PATH: /data/config.yaml
image: ssvlabs/ssv-node:v1.3.8
ports:
- 0.0.0.0:12000:12000/udp
- 0.0.0.0:13000:13000/tcp
volumes:
- /opt/stereum/ssv_network-611cf17d-adf7-433e-bc4e-2e38c0f502c3/data:/data
- /opt/stereum/ssv_network-611cf17d-adf7-433e-bc4e-2e38c0f502c3/secrets:/secrets
user: "2000"
autoupdate: true
network: holesky
dependencies:
executionClients: []
consensusClients: []
mevboost: []
otherServices: []
become: yes

- name: Create ErigonService config
copy:
Expand Down Expand Up @@ -255,7 +317,7 @@
mevboost: []
otherServices: []
become: yes

- name: Create FlashbotsMevBoostService config
copy:
dest: "/etc/stereum/services/5c9c2120-03dc-ffa3-30a8-7faf61f09a3d.yaml"
Expand Down
27 changes: 26 additions & 1 deletion controls/roles/update-changes/molecule/223/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
src: "/etc/stereum/services/580c2c43-ad2a-405d-ab78-eb3678383f59.yaml"
register: Erigon_service_configuration2_raw

# SSVNetworkService
- name: Read SSVNetworkService file
slurp:
src: "/etc/stereum/services/cb941f15-6eef-4e4d-fc81-4d524b627373.yaml"
register: SSVNetwork_service_configuration_raw

# SSVNetworkService2
- name: Read SSVNetworkService file
slurp:
src: "/etc/stereum/services/611cf17d-adf7-433e-bc4e-2e38c0f502c3.yaml"
register: SSVNetwork_service_configuration2_raw

# FlashbotsMevBoostService
- name: Read FlashbotsMevBoostService file
slurp:
Expand All @@ -49,6 +61,8 @@
set_fact:
Ejector_service_configuration: "{{ Ejector_service_configuration_raw['content'] | b64decode | from_yaml }}"
Ejector_service_configuration2: "{{ Ejector_service_configuration2_raw['content'] | b64decode | from_yaml }}"
SSVNetwork_service_configuration: "{{ SSVNetwork_service_configuration_raw['content'] | b64decode | from_yaml }}"
SSVNetwork_service_configuration2: "{{ SSVNetwork_service_configuration2_raw['content'] | b64decode | from_yaml }}"
Ejector_service_configuration3: "{{ Ejector_service_configuration3_raw['content'] | b64decode | from_yaml }}"
Erigon_service_configuration: "{{ Erigon_service_configuration_raw['content'] | b64decode | from_yaml }}"
Erigon_service_configuration2: "{{ Erigon_service_configuration2_raw['content'] | b64decode | from_yaml }}"
Expand Down Expand Up @@ -81,6 +95,15 @@
msg: "{{ Erigon_service_configuration2_raw['content'] | b64decode }}"

- debug:
msg: "{{ SSVNetwork_service_configuration }}"
- debug:
msg: "{{ SSVNetwork_service_configuration_raw['content'] | b64decode }}"

- debug:
msg: "{{ SSVNetwork_service_configuration2 }}"
- debug:
msg: "{{ SSVNetwork_service_configuration2_raw['content'] | b64decode }}"

msg: "{{ Mev_service_configuration }}"
- debug:
msg: "{{ Mev_service_configuration_raw['content'] | b64decode }}"
Expand All @@ -96,10 +119,12 @@
- Ejector_service_configuration.env.ORACLE_ADDRESSES_ALLOWLIST | from_yaml | select('match', '0xEC4BfbAF681eb505B94E4a7849877DC6c600Ca3A') | length == 0
- Ejector_service_configuration2.env.ORACLE_ADDRESSES_ALLOWLIST | from_yaml | select('match', '0xe57B3792aDCc5da47EF4fF588883F0ee0c9835C9') | length == 1
- Ejector_service_configuration2.env.ORACLE_ADDRESSES_ALLOWLIST | from_yaml | select('match', '0xEC4BfbAF681eb505B94E4a7849877DC6c600Ca3A') | length == 0
- SSVNetwork_service_configuration.image | split(':') | first == 'ssvlabs/ssv-node'
- SSVNetwork_service_configuration2.image == 'ssvlabs/ssv-node:v1.3.8'
- Ejector_service_configuration3.env.ORACLE_ADDRESSES_ALLOWLIST | from_yaml | select('match', '0xfe43A8B0b481Ae9fB1862d31826532047d2d538c') | length == 1
- Ejector_service_configuration3.env.ORACLE_ADDRESSES_ALLOWLIST | from_yaml | select('match', '0x3799bDA7B884D33F79CEC926af21160dc47fbe05') | length == 0
- Erigon_service_configuration.image | split(':') | first == 'erigontech/erigon'
- Erigon_service_configuration2.image == 'erigontech/erigon:v2.60.8'
- Mev_service_configuration.entrypoint | select('match', 'eden') | length == 0
- Mev_service_configuration2.entrypoint | select('match', 'eden') | length == 0
# EOF
# EOF
48 changes: 48 additions & 0 deletions controls/roles/update-changes/tasks/2.2.3/ssv_changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
- name: Read service file
slurp:
src: "{{ config_file.path }}"
register: service_configuration_raw

- name: Parse service's configuration
set_fact:
service_configuration: "{{ service_configuration_raw['content'] | b64decode | from_yaml }}"

- name: Update SSV image
when: service_configuration.service == "SSVNetworkService" and "bloxstaking" in service_configuration.image
block:
- name: Download update metadata
uri:
url: https://stereum.net/downloads/updates.json
method: GET
return_content: true
status_code: 200
body_format: json
register: update_data_download

- name: Set update data
set_fact:
update_data: "{{ update_data_test | default(update_data_download) }}"

- name: Get latest version for this service
set_fact:
new_service_docker_image_tag: "{{ update_data.json[service_configuration.network][service_configuration.service] | default(update_data.json['mainnet'][service_configuration.service]) | last }}"

- name: set new config
ansible.utils.update_fact:
updates:
- path: service_configuration.image
value: "ssvlabs/ssv-node:{{ new_service_docker_image_tag }}"
register: updated

- name: update config
set_fact:
new_service_configuration: "{{ updated.service_configuration }}"

- name: Write Config
copy:
dest: "{{ config_file.path }}"
content: "{{ new_service_configuration | to_nice_yaml(indent=2) }}"
owner: "root"
group: "root"
mode: 0644
6 changes: 6 additions & 0 deletions controls/roles/update-changes/tasks/2.2.3/updates-223.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
loop_control:
loop_var: config_file

- name: Include SSV Changes
include_tasks: ssv_changes.yaml
loop: "{{ service_config_files.files }}"
loop_control:
loop_var: config_file

- name: Include Erigon Changes
include_tasks: erigon_changes.yaml
loop: "{{ service_config_files.files }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ MetricsAPIPort: 15000`;
service.setId();
const workingDir = service.buildWorkingDir(dir);

const image = "bloxstaking/ssv-node";
const image = "ssvlabs/ssv-node";

const volumes = [new ServiceVolume(workingDir + "/data", "/data"), new ServiceVolume(workingDir + "/secrets", "/secrets")];

Expand Down
2 changes: 1 addition & 1 deletion launcher/src/backend/tests/unit/SSVNetworkService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ test("buildConfiguration", () => {
expect(ssvService.ports).toHaveLength(2);
expect(ssvService.id).toHaveLength(36);
expect(ssvService.user).toMatch(/2000/);
expect(ssvService.image).toMatch(/bloxstaking\/ssv-node/);
expect(ssvService.image).toMatch(/ssvlabs\/ssv-node/);
expect(ssvService.configVersion).toBe(1);
});

Expand Down
2 changes: 1 addition & 1 deletion launcher/src/components/UI/services-modal/SsvModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export default {
this.ssvTotalConfig = await ControlService.getSSVTotalConfig(this.ssvService.config.serviceID);
// TODO: check image min version
// const imageTag = 'bloxstaking/ssv-node:v1.0.1-hotfix';
// const imageTag = 'ssvlabs/ssv-node:v1.0.1-hotfix';
// const minimumVersion = '1.1.0';
const imageTag = this.ssvTotalConfig.ssvServiceConfig.image;
const minimumVersion = "v1.3.0";
Expand Down

0 comments on commit 6736619

Please sign in to comment.