-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD: New Oracle Allowlist and Update Script (#1900)
* FIX: Tests * ADD: New Oracle Allowlist and Update Script * FIX: conditionals and add another case * FIX: regex * FIX: Conditionals the 2nd * FIX: regex the 2nd * FIX: Quotes * FIX: regex the 3rd
- Loading branch information
Showing
12 changed files
with
220 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
vars_files: | ||
- ../../../../defaults/stereum_defaults.yaml | ||
|
||
tasks: | ||
- name: "Include update-changes" | ||
include_role: | ||
name: "update-changes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include update-changes" | ||
include_role: | ||
name: "update-changes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
20 changes: 20 additions & 0 deletions
20
controls/roles/update-changes/tasks/2.1.5/ValidatorEjector_changes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters