diff --git a/.github/workflows/test-molecule.yml b/.github/workflows/test-molecule.yml index 8e54cbe4f..0c47828f5 100644 --- a/.github/workflows/test-molecule.yml +++ b/.github/workflows/test-molecule.yml @@ -73,6 +73,7 @@ jobs: { role: "update-changes", test: "203" }, { role: "update-changes", test: "213" }, { role: "update-changes", test: "214" }, + { role: "update-changes", test: "215" }, ] fail-fast: false concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }} diff --git a/controls/roles/update-changes/molecule/215/converge.yml b/controls/roles/update-changes/molecule/215/converge.yml new file mode 100644 index 000000000..3f84cb4a2 --- /dev/null +++ b/controls/roles/update-changes/molecule/215/converge.yml @@ -0,0 +1,10 @@ +--- +- name: Converge + hosts: all + vars_files: + - ../../../../defaults/stereum_defaults.yaml + + tasks: + - name: "Include update-changes" + include_role: + name: "update-changes" diff --git a/controls/roles/update-changes/molecule/215/molecule.yml b/controls/roles/update-changes/molecule/215/molecule.yml new file mode 100644 index 000000000..0139287c1 --- /dev/null +++ b/controls/roles/update-changes/molecule/215/molecule.yml @@ -0,0 +1,27 @@ +--- +#dependency: +# name: galaxy +driver: + name: docker +platforms: + - name: "update-changes--2.1.5--ubuntu-23.04" + image: ubuntu:lunar + # - name: "configure-updates--default--centos-8" + # image: geerlingguy/docker-centos8-ansible +provisioner: + name: ansible + env: + ANSIBLE_PIPELINING: "True" +lint: | + set -e + yamllint . + ansible-lint . +scenario: + test_sequence: + - destroy + - create + - prepare + - converge + - idempotence + - verify + - destroy diff --git a/controls/roles/update-changes/molecule/215/playbook.yml b/controls/roles/update-changes/molecule/215/playbook.yml new file mode 100644 index 000000000..710c596cf --- /dev/null +++ b/controls/roles/update-changes/molecule/215/playbook.yml @@ -0,0 +1,7 @@ +--- +- name: Converge + hosts: all + tasks: + - name: "Include update-changes" + include_role: + name: "update-changes" diff --git a/controls/roles/update-changes/molecule/215/prepare.yml b/controls/roles/update-changes/molecule/215/prepare.yml new file mode 100644 index 000000000..f90e4a21f --- /dev/null +++ b/controls/roles/update-changes/molecule/215/prepare.yml @@ -0,0 +1,103 @@ +--- +- name: Prepare + hosts: all + tasks: + - name: Make sure Stereum's config path exists + file: + path: "/etc/stereum/services" + state: directory + owner: "root" + group: "root" + mode: 0644 + become: yes + + - name: Create ValidatorEjectorService config + copy: + dest: "/etc/stereum/services/f12b9300-d46c-c9cc-99a6-e437aa71ef5b.yaml" + owner: "root" + group: "root" + mode: 0644 + content: | + service: ValidatorEjectorService + id: f12b9300-d46c-c9cc-99a6-e437aa71ef5b + configVersion: 1 + command: [] + entrypoint: [] + env: + EXECUTION_NODE: http://stereum-f34a2967-b99d-0edc-cfe9-43e47884fa66:8545 + CONSENSUS_NODE: http://stereum-4c23e774-519b-62ca-9ccf-e9b274cfad8c:5052 + LOCATOR_ADDRESS: "0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8" + STAKING_MODULE_ID: "123" + OPERATOR_ID: "123" + MESSAGES_LOCATION: /app/messages + ORACLE_ADDRESSES_ALLOWLIST: '["0x12A1D74F8697b9f4F1eEBb0a9d0FB6a751366399", + "0xD892c09b556b547c80B7d8c8cB8d75bf541B2284", + "0xf7aE520e99ed3C41180B5E12681d31Aa7302E4e5", + "0xD3b1e36A372Ca250eefF61f90E833Ca070559970", + "0xF0F23944EfC5A63c53632C571E7377b85d5E6B6f", + "0xb29dD2f6672C0DFF2d2f173087739A42877A5172", + "0x3799bDA7B884D33F79CEC926af21160dc47fbe05"]' + HTTP_PORT: "8989" + RUN_METRICS: "true" + RUN_HEALTH_CHECK: "true" + DRY_RUN: "false" + image: lidofinance/validator-ejector:1.6.0 + ports: [] + volumes: + - /opt/stereum/validatorejector-f12b9300-d46c-c9cc-99a6-e437aa71ef5b/messages:/app/messages + user: "2000" + autoupdate: true + network: holesky + dependencies: + executionClients: + - service: GethService + id: f34a2967-b99d-0edc-cfe9-43e47884fa66 + consensusClients: + - service: LighthouseBeaconService + id: 4c23e774-519b-62ca-9ccf-e9b274cfad8c + mevboost: [] + otherServices: [] + become: yes + + - name: Create ValidatorEjectorService config + copy: + dest: "/etc/stereum/services/147c5807-b646-471f-aaa4-5e215ad98b75.yaml" + owner: "root" + group: "root" + mode: 0644 + content: | + service: ValidatorEjectorService + id: 147c5807-b646-471f-aaa4-5e215ad98b75 + configVersion: 1 + command: [] + entrypoint: [] + env: + EXECUTION_NODE: http://stereum-f34a2967-b99d-0edc-cfe9-43e47884fa66:8545 + CONSENSUS_NODE: http://stereum-4c23e774-519b-62ca-9ccf-e9b274cfad8c:5052 + LOCATOR_ADDRESS: "0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8" + STAKING_MODULE_ID: "123" + OPERATOR_ID: "123" + MESSAGES_LOCATION: /app/messages + ORACLE_ADDRESSES_ALLOWLIST: '["0x12A1D74F8697b9f4F1eEBb0a9d0FB6a751366399","0xD892c09b556b547c80B7d8c8cB8d75bf541B2284","0xf7aE520e99ed3C41180B5E12681d31Aa7302E4e5","0x31fa51343297FFce0CC1E67a50B2D3428057D1b1","0x81E411f1BFDa43493D7994F82fb61A415F6b8Fd4","0x4c75FA734a39f3a21C57e583c1c29942F021C6B7","0xD3b1e36A372Ca250eefF61f90E833Ca070559970","0xF0F23944EfC5A63c53632C571E7377b85d5E6B6f","0xb29dD2f6672C0DFF2d2f173087739A42877A5172"]' + HTTP_PORT: "8989" + RUN_METRICS: "true" + RUN_HEALTH_CHECK: "true" + DRY_RUN: "false" + image: lidofinance/validator-ejector:1.6.0 + ports: [] + volumes: + - /opt/stereum/validatorejector-147c5807-b646-471f-aaa4-5e215ad98b75/messages:/app/messages + user: "2000" + autoupdate: true + network: holesky + dependencies: + executionClients: + - service: GethService + id: f34a2967-b99d-0edc-cfe9-43e47884fa66 + consensusClients: + - service: LighthouseBeaconService + id: 4c23e774-519b-62ca-9ccf-e9b274cfad8c + mevboost: [] + otherServices: [] + become: yes +# EOF diff --git a/controls/roles/update-changes/molecule/215/verify.yml b/controls/roles/update-changes/molecule/215/verify.yml new file mode 100644 index 000000000..43ab78117 --- /dev/null +++ b/controls/roles/update-changes/molecule/215/verify.yml @@ -0,0 +1,37 @@ +--- +- name: Verify + hosts: all + gather_facts: false + tasks: + # ValidatorEjectorService + - name: Read ValidatorEjectorService file + slurp: + src: "/etc/stereum/services/f12b9300-d46c-c9cc-99a6-e437aa71ef5b.yaml" + register: Ejector_service_configuration_raw + + # ValidatorEjectorService2 + - name: Read ValidatorEjectorService file + slurp: + src: "/etc/stereum/services/147c5807-b646-471f-aaa4-5e215ad98b75.yaml" + register: Ejector_service_configuration2_raw + + - name: Parse Service configurations + set_fact: + Ejector_service_configuration: "{{ Ejector_service_configuration_raw['content'] | b64decode | from_yaml }}" + Ejector_service_configuration2: "{{ Ejector_service_configuration2_raw['content'] | b64decode | from_yaml }}" + + - debug: + msg: "{{ Ejector_service_configuration }}" + - debug: + msg: "{{ Ejector_service_configuration_raw['content'] | b64decode }}" + + - debug: + msg: "{{ Ejector_service_configuration2 }}" + - debug: + msg: "{{ Ejector_service_configuration2_raw['content'] | b64decode }}" + + - assert: + that: + - Ejector_service_configuration.env.ORACLE_ADDRESSES_ALLOWLIST | from_yaml | length == 10 + - Ejector_service_configuration2.env.ORACLE_ADDRESSES_ALLOWLIST | from_yaml | length == 9 +# EOF diff --git a/controls/roles/update-changes/tasks/2.1.5/ValidatorEjector_changes.yaml b/controls/roles/update-changes/tasks/2.1.5/ValidatorEjector_changes.yaml new file mode 100644 index 000000000..b3bb80a85 --- /dev/null +++ b/controls/roles/update-changes/tasks/2.1.5/ValidatorEjector_changes.yaml @@ -0,0 +1,20 @@ +--- +- name: Read service file + slurp: + src: "{{ item.path }}" + register: service_configuration_raw + +- name: Parse service's configuration + set_fact: + service_configuration: "{{ service_configuration_raw['content'] | b64decode | from_yaml }}" + service_configuration_text: "{{ service_configuration_raw['content'] | b64decode }}" + +- name: Update Oracle Allow List + replace: + path: "{{ item.path }}" + regexp: "(?s)ORACLE_ADDRESSES_ALLOWLIST:.*?][\"']{1}" + replace: "ORACLE_ADDRESSES_ALLOWLIST: '[\"0x12A1D74F8697b9f4F1eEBb0a9d0FB6a751366399\", \"0xD892c09b556b547c80B7d8c8cB8d75bf541B2284\", \"0xf7aE520e99ed3C41180B5E12681d31Aa7302E4e5\", \"0x31fa51343297FFce0CC1E67a50B2D3428057D1b1\", \"0x81E411f1BFDa43493D7994F82fb61A415F6b8Fd4\", \"0x4c75FA734a39f3a21C57e583c1c29942F021C6B7\", \"0xD3b1e36A372Ca250eefF61f90E833Ca070559970\", \"0xF0F23944EfC5A63c53632C571E7377b85d5E6B6f\", \"0xb29dD2f6672C0DFF2d2f173087739A42877A5172\", \"0x3799bDA7B884D33F79CEC926af21160dc47fbe05\"]'" + when: + - service_configuration.service == "ValidatorEjectorService" + - service_configuration.network == "holesky" + - service_configuration.env.ORACLE_ADDRESSES_ALLOWLIST | from_yaml | length < 8 diff --git a/controls/roles/update-changes/tasks/2.1.5/updates-215.yaml b/controls/roles/update-changes/tasks/2.1.5/updates-215.yaml new file mode 100644 index 000000000..9bba3e0df --- /dev/null +++ b/controls/roles/update-changes/tasks/2.1.5/updates-215.yaml @@ -0,0 +1,9 @@ +--- +- name: Find service configs + find: + paths: "/etc/stereum/services" + register: service_config_files + +- name: Include ValidatorEjector Changes + include_tasks: ValidatorEjector_changes.yaml + loop: "{{ service_config_files.files }}" diff --git a/controls/roles/update-changes/tasks/main.yml b/controls/roles/update-changes/tasks/main.yml index 0259e46e4..7c67cbf83 100644 --- a/controls/roles/update-changes/tasks/main.yml +++ b/controls/roles/update-changes/tasks/main.yml @@ -18,4 +18,8 @@ - name: Include 2.1.4 Update Scripts include_tasks: "2.1.4/updates-214.yaml" ignore_errors: yes + +- name: Include 2.1.5 Update Scripts + include_tasks: "2.1.5/updates-215.yaml" + ignore_errors: yes # EOF diff --git a/launcher/src/backend/ethereum-services/ValidatorEjectorService.js b/launcher/src/backend/ethereum-services/ValidatorEjectorService.js index 442fd6ca8..b477391a9 100755 --- a/launcher/src/backend/ethereum-services/ValidatorEjectorService.js +++ b/launcher/src/backend/ethereum-services/ValidatorEjectorService.js @@ -21,7 +21,7 @@ export class ValidatorEjectorService extends NodeService { break; case "holesky": locatorAddress = "0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8" //https://docs.lido.fi/deployed-contracts/holesky#core-protocol - oracleAllowList = '["0x12A1D74F8697b9f4F1eEBb0a9d0FB6a751366399","0xD892c09b556b547c80B7d8c8cB8d75bf541B2284","0xf7aE520e99ed3C41180B5E12681d31Aa7302E4e5","0x31fa51343297FFce0CC1E67a50B2D3428057D1b1","0x81E411f1BFDa43493D7994F82fb61A415F6b8Fd4","0x4c75FA734a39f3a21C57e583c1c29942F021C6B7","0xD3b1e36A372Ca250eefF61f90E833Ca070559970"]' + oracleAllowList = '["0x12A1D74F8697b9f4F1eEBb0a9d0FB6a751366399", "0xD892c09b556b547c80B7d8c8cB8d75bf541B2284", "0xf7aE520e99ed3C41180B5E12681d31Aa7302E4e5", "0x31fa51343297FFce0CC1E67a50B2D3428057D1b1", "0x81E411f1BFDa43493D7994F82fb61A415F6b8Fd4", "0x4c75FA734a39f3a21C57e583c1c29942F021C6B7", "0xD3b1e36A372Ca250eefF61f90E833Ca070559970", "0xF0F23944EfC5A63c53632C571E7377b85d5E6B6f", "0xb29dD2f6672C0DFF2d2f173087739A42877A5172", "0x3799bDA7B884D33F79CEC926af21160dc47fbe05"]' break; case "sepolia": locatorAddress = "0x8f6254332f69557A72b0DA2D5F0Bc07d4CA991E7" //https://docs.lido.fi/deployed-contracts/sepolia#core-protocol diff --git a/launcher/src/backend/tests/integration/LighthouseBeaconService.int.js b/launcher/src/backend/tests/integration/LighthouseBeaconService.int.js index d78cfabe6..0814a8da9 100755 --- a/launcher/src/backend/tests/integration/LighthouseBeaconService.int.js +++ b/launcher/src/backend/tests/integration/LighthouseBeaconService.int.js @@ -81,7 +81,7 @@ test("lighthouse validator import", async () => { await serviceManager.manageServiceState(lhVC.id, "started"); //Waiting for the service to start properly - await testServer.Sleep(60000); + await testServer.Sleep(360000); //import validator const validatorAccountManager = new ValidatorAccountManager(nodeConnection, serviceManager); diff --git a/launcher/src/backend/tests/integration/NimbusBeaconService.int.js b/launcher/src/backend/tests/integration/NimbusBeaconService.int.js index d49f38e91..7fc092803 100755 --- a/launcher/src/backend/tests/integration/NimbusBeaconService.int.js +++ b/launcher/src/backend/tests/integration/NimbusBeaconService.int.js @@ -109,7 +109,6 @@ test("nimbus validator import", async () => { /Listening to incoming network requests/.test(BCstatus.stdout) && /REST service started/.test(BCstatus.stdout) && /Slot start/.test(BCstatus.stdout) && - /Failed to obtain the most recent known block from the execution layer node \(the node is probably not synced\)/.test(BCstatus.stdout) && /Beacon node is online/.test(VCstatus.stdout) && /Beacon node is compatible/.test(VCstatus.stdout) && /Local validator attached/.test(VCstatus.stdout) && @@ -141,7 +140,6 @@ test("nimbus validator import", async () => { } //check nimbus service logs - expect(BCstatus.stdout).toMatch(/Failed to obtain the most recent known block from the execution layer node \(the node is probably not synced\)/); expect(BCstatus.stdout).toMatch(/Starting beacon node/); expect(BCstatus.stdout).toMatch(/Listening to incoming network requests/); expect(BCstatus.stdout).toMatch(/REST service started/);