Skip to content

Commit

Permalink
fix: Obol integration
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorkavenko committed Feb 19, 2024
1 parent 6380f3d commit 0805e05
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ext-network.yml
ext-network.yml.original
.eth/*
.charon/*
validator-ejector/*
!.eth/README.md
!.eth/validator_keys/.empty
!.eth/exit_messages/.empty
Expand Down
13 changes: 10 additions & 3 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ JWT_SECRET=
DISTRIBUTED=
# Authenticated execution client endpoint. This default uses the execution node container.
EL_NODE=http://execution:8551
# EL node for Lido Validator Ejector
VE_EXECUTION_NODE_URL=http://execution:8551
# Consensus client address. This could be comma-separated for Lighthouse or Teku VC clients, with failover,
# or could just be a remote consensus client URL for "validator only" setups.
# For Nimbus VC client, put the first beacon node here, and use VC_EXTRAS for additional.
Expand All @@ -169,6 +171,9 @@ CL_NODE=http://consensus:5052
MEV_NODE=http://mev-boost:18550
# Beacon enpoint for OBOL node
OBOL_NODE_BEACON_ENDPOINT=http://consensus:5052
# Beacon enpoint for Lido Validator Ejector
VE_BEACON_NODE_URL=http://consensus:5052
LIDO_DV_EXIT_BEACON_NODE_URL=http://consensus:5052

# You can set specific version targets and choose binary or compiled from source builds below,
# via "Dockerfile.binary" or "Dockerfile.source"
Expand All @@ -182,10 +187,12 @@ ETH_DOCKER_TAG=
# SSV
SSV_NODE_TAG=latest

# OBOL
# Lido OBOL
OBOL_NODE_TAG=latest
OBOL_CLUSTER_NAME=
OBOL_CLUSTER_ENR_LIST=
VE_OPERATOR_ID=
VE_STAKING_MODULE_ID=
VE_LOCATOR_ADDRESS=
VE_ORACLE_ADDRESSES_ALLOWLIST=

# MEV-Boost
# SRC build target can be a tag, a branch, or a pr as "pr-ID"
Expand Down
123 changes: 88 additions & 35 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ envmigrate() {
CL_NODE BEACON_STATS_API BEACON_STATS_MACHINE EL_P2P_PORT CL_P2P_PORT WEB3SIGNER PRYSM_PORT DOPPELGANGER \
PRYSM_UDP_PORT CL_QUIC_PORT GRAFANA_PORT SIREN_PORT PROMETHEUS_PORT KEY_API_PORT TRAEFIK_WEB_PORT \
TRAEFIK_WEB_HTTP_PORT CL_REST_PORT EL_RPC_PORT EL_WS_PORT EE_PORT ERIGON_TORRENT_PORT LOG_LEVEL JWT_SECRET \
EL_EXTRAS CL_EXTRAS VC_EXTRAS OBOL_CLUSTER_NAME OBOL_CLUSTER_ENR_LIST ARCHIVE_NODE SSV_P2P_PORT SSV_P2P_PORT_UDP OBOL_P2P_PORT ERIGON_P2P_PORT_2 \
EL_EXTRAS CL_EXTRAS VC_EXTRAS ARCHIVE_NODE SSV_P2P_PORT SSV_P2P_PORT_UDP OBOL_P2P_PORT ERIGON_P2P_PORT_2 \
ERIGON_P2P_PORT_3 LODESTAR_HEAP )
TARGET_VARS=( ETH_DOCKER_TAG NIM_SRC_BUILD_TARGET NIM_SRC_REPO NIM_DOCKER_TAG NIM_DOCKER_VC_TAG NIM_DOCKER_REPO \
NIM_DOCKER_VC_REPO NIM_DOCKERFILE TEKU_SRC_BUILD_TARGET TEKU_SRC_REPO TEKU_DOCKER_TAG TEKU_DOCKER_REPO \
Expand Down Expand Up @@ -3485,43 +3485,82 @@ config() {
if [ "${__deployment}" = "lido_obol" ]; then
# We are using the variable
# shellcheck disable=SC2034
OBOL_NODE_BEACON_ENDPOINT="${CL_NODE}"
OBOL_BEACON_NODE_ENDPOINT="${CL_NODE}"
LIDO_DV_EXIT_BEACON_NODE_URL="${CL_NODE}"
VE_BEACON_NODE_URL="${CL_NODE}"
VE_EXECUTION_NODE_URL="${EL_NODE}"
CL_NODE="http://obol-node:3600"
if (whiptail --title "Lido Obol cluster creation" --yesno "Do you have cluster definition url and ENR?" 10 60) then
query_lido_obol_cluster_definition
query_lido_obol_cluster_dkg
case "${NETWORK}" in
"mainnet")
VE_LOCATOR_ADDRESS="0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb"
VE_ORACLE_ADDRESSES_ALLOWLIST='["0x140Bd8FbDc884f48dA7cb1c09bE8A2fAdfea776E","0xA7410857ABbf75043d61ea54e07D57A6EB6EF186","0x404335BcE530400a5814375E7Ec1FB55fAff3eA2","0x946D3b081ed19173dC83Cd974fC69e1e760B7d78","0x007DE4a5F7bc37E2F26c0cb2E8A95006EE9B89b5","0xEC4BfbAF681eb505B94E4a7849877DC6c600Ca3A","0x61c91ECd902EB56e314bB2D5c5C07785444Ea1c8","0x1Ca0fEC59b86F549e1F1184d97cb47794C8Af58d","0xc79F702202E3A6B0B6310B537E786B9ACAA19BAf"]'
VE_STAKING_MODULE_ID="2"
;;
"holesky")
VE_LOCATOR_ADDRESS="0x1eDf09b5023DC86737b59dE68a8130De878984f5"
VE_ORACLE_ADDRESSES_ALLOWLIST='["0x12A1D74F8697b9f4F1eEBb0a9d0FB6a751366399","0xD892c09b556b547c80B7d8c8cB8d75bf541B2284","0xf7aE520e99ed3C41180B5E12681d31Aa7302E4e5","0x31fa51343297FFce0CC1E67a50B2D3428057D1b1"]'
VE_STAKING_MODULE_ID="2"
;;
"goerli")
VE_LOCATOR_ADDRESS="0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8"
VE_ORACLE_ADDRESSES_ALLOWLIST='["0x19b1BEbe4773fEC2496FEf8b81a9c175A823844B","0x7eE534a6081d57AFB25b5Cff627d4D26217BB0E9","0xD3b1e36A372Ca250eefF61f90E833Ca070559970","0xA8aF49FB44AAA8EECa9Ae918bb7c05e2E71c9DE9","0x3799bDA7B884D33F79CEC926af21160dc47fbe05","0x4c75FA734a39f3a21C57e583c1c29942F021C6B7","0xb29dD2f6672C0DFF2d2f173087739A42877A5172","0xfdA7E01B2718C511bF016030010572e833C7aE6A","0x81E411f1BFDa43493D7994F82fb61A415F6b8Fd4"]'
VE_STAKING_MODULE_ID="2"
;;
*)
;;
esac

if (whiptail --title "Lido Obol cluster existing" --yesno "Does your cluster already exist?" 10 60) then
while true; do
__cluster_lock_json=$(cat ./.charon/cluster-lock.json)
# shellcheck disable=SC2086
__cluster_lock_is_valid=$(echo "${__cluster_lock_json}" | jq 'all(.cluster_definition.validators[]; .fee_recipient_address == "'${FEE_RECIPIENT}'" and .withdrawal_address == "'${WITHDRAWAL_CREDENTIALS}'")')
if [[ "${__cluster_lock_is_valid}" =~ "true" ]]; then
echo "Your cluster definition is valid."
break
else
whiptail --title "Lido Obol cluster creation" --msgbox "Your cluster lock file './.charon/cluster-lock.json' is not valid.\n\nCheck that every validator has \`fee_recipient_address\` and \`withdrawal_address\` equal to Lido contracts and try again.\n\nLido fee recipient: '${FEE_RECIPIENT}'\nLido withdrawal credentials: '${WITHDRAWAL_CREDENTIALS}'" 14 90
fi
done
else
query_lido_obol_enr
query_lido_obol_cluster_definition
query_lido_obol_cluster_dkg
if (whiptail --title "Lido Obol cluster creation" --yesno "Do you have cluster definition url and ENR?" 10 60) then
query_lido_obol_cluster_definition
query_lido_obol_cluster_dkg
else
query_lido_obol_enr
query_lido_obol_cluster_definition
query_lido_obol_cluster_dkg
fi
fi
VE_OPERATOR_ID=$(whiptail --title "Lido Operator ID" --inputbox "Put you Operator ID from Lido Operators dashboard \
(right-click to paste)" 10 60 3>&1 1>&2 2>&3)
fi

COMPOSE_FILE="${CONSENSUS_CLIENT}"
if [ -n "${EXECUTION_CLIENT+x}" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:${EXECUTION_CLIENT}"
fi
if [ "${__deployment}" = "ssv" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:ssv.yml"
fi
if [ -n "${GRAFANA_CLIENT+x}" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:${GRAFANA_CLIENT}"
fi
if [ "${MEV_BOOST}" = "true" ] && [ ! "${__deployment}" = "rocket" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:mev-boost.yml"
fi
if [ "${__deployment}" = "lido_ssv" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:ssv.yml"
fi
if [ "${__deployment}" = "lido_obol" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:obol.yml"
fi
if [ "${__deployment}" = "lido_csm" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:lido-deposit-cli.yml"
elif { [ "${__deployment}" = "node" ] || [ "${__deployment}" = "rocket" ]; } \
&& { [ "${NETWORK}" = "goerli" ] || [ "${NETWORK}" = "holesky" ]; }; then
COMPOSE_FILE="${COMPOSE_FILE}:deposit-cli.yml"
fi
COMPOSE_FILE="${CONSENSUS_CLIENT}"
if [ -n "${EXECUTION_CLIENT+x}" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:${EXECUTION_CLIENT}"
fi
if [ "${__deployment}" = "ssv" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:ssv.yml"
fi
if [ -n "${GRAFANA_CLIENT+x}" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:${GRAFANA_CLIENT}"
fi
if [ "${MEV_BOOST}" = "true" ] && [ ! "${__deployment}" = "rocket" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:mev-boost.yml"
fi
if [ "${__deployment}" = "lido_ssv" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:ssv.yml"
fi
if [ "${__deployment}" = "lido_obol" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:lido-obol.yml"
fi
if [ "${__deployment}" = "lido_csm" ]; then
COMPOSE_FILE="${COMPOSE_FILE}:lido-deposit-cli.yml"
elif { [ "${__deployment}" = "node" ] || [ "${__deployment}" = "rocket" ]; } \
&& { [ "${NETWORK}" = "goerli" ] || [ "${NETWORK}" = "holesky" ]; }; then
COMPOSE_FILE="${COMPOSE_FILE}:deposit-cli.yml"
fi
# Not multi-arch, this would break on ARM64
# COMPOSE_FILE="${COMPOSE_FILE}:ethdo.yml"
if [ "${__deployment}" = "rocket" ]; then
Expand Down Expand Up @@ -3556,7 +3595,21 @@ config() {
set_value_in_env
fi
if [ "${__deployment}" = "lido_obol" ]; then
var=OBOL_NODE_BEACON_ENDPOINT
var=OBOL_BEACON_NODE_ENDPOINTS
set_value_in_env
var=VE_EXECUTION_NODE_URL
set_value_in_env
var=VE_BEACON_NODE_URL
set_value_in_env
var=LIDO_DV_EXIT_BEACON_NODE_URL
set_value_in_env
var=VE_OPERATOR_ID
set_value_in_env
var=VE_LOCATOR_ADDRESS
set_value_in_env
var=VE_ORACLE_ADDRESSES_ALLOWLIST
set_value_in_env
var=VE_STAKING_MODULE_ID
set_value_in_env
fi
if [[ "${NETWORK}" = "gnosis" ]] && [[ "${CONSENSUS_CLIENT}" =~ "nimbus" ]] ; then
Expand Down Expand Up @@ -3789,7 +3842,7 @@ fi

cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
# Use this to make sure root doesn't end up owning files
OWNER=$(stat --format=%U .)
OWNER=$(stat -f %Su .)

if [ "${OWNER}" == "root" ]; then
echo "Please install Eth Docker as a non-root user."
Expand Down
80 changes: 80 additions & 0 deletions lido-obol.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: "3.9"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 100m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'

services:
obol-node:
restart: "unless-stopped"
image: obolnetwork/charon:${CHARON_VERSION:-latest}
volumes:
- .charon:/opt/charon/.charon
<<: *logging
environment:
- CHARON_BEACON_NODE_ENDPOINTS=${OBOL_BEACON_NODE_ENDPOINT:-http://consensus:5052}
- CHARON_LOG_LEVEL=${OBOL_LOG_LEVEL:-debug}
- CHARON_LOG_FORMAT=${OBOL_LOG_FORMAT:-console}
- CHARON_P2P_RELAYS=${OBOL_P2P_RELAYS:-https://0.relay.obol.tech,https://1.relay.obol.tech/}
- CHARON_P2P_EXTERNAL_HOSTNAME=${OBOL_P2P_EXTERNAL_HOSTNAME:-} # Empty default required to avoid warnings.
- CHARON_P2P_TCP_ADDRESS=0.0.0.0:${OBOL_P2P_PORT:-3610}
- CHARON_VALIDATOR_API_ADDRESS=0.0.0.0:3600
- CHARON_MONITORING_ADDRESS=0.0.0.0:3620
- CHARON_BUILDER_API=${BUILDER_API_ENABLED:-true}
- CHARON_FEATURE_SET_ENABLE=eager_double_linear,consensus_participate
- CHARON_LOKI_ADDRESSES=${CHARON_LOKI_ADDRESSES:-http://loki:3100/loki/api/v1/push}
- CHARON_LOKI_SERVICE=charon
ports:
- ${OBOL_P2P_PORT:-3610}:${OBOL_P2P_PORT:-3610}/tcp # P2P TCP libp2p
healthcheck:
test: wget -qO- http://localhost:3620/readyz
charon-create-enr:
profiles: ["tools"]
restart: "no"
image: obolnetwork/charon:${OBOL_NODE_TAG:-latest}
command: create enr
volumes:
- .charon:/opt/charon/.charon
charon-run-dkg:
profiles: ["tools"]
restart: "no"
image: obolnetwork/charon:${CHARON_VERSION:-latest}
volumes:
- .charon:/opt/charon/.charon
command: dkg

validator-ejector:
image: lidofinance/validator-ejector:${VALIDATOR_EJECTOR_VERSION:-1.3.0}
user: ":"
volumes:
- ./validator-ejector:/exitmessages
restart: unless-stopped
environment:
- EXECUTION_NODE=${VE_EXECUTION_NODE_URL:-http://execution:8551}
- CONSENSUS_NODE=${VE_BEACON_NODE_URL:-http://consensus:5052}
- LOCATOR_ADDRESS=${VE_LOCATOR_ADDRESS:-0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8}
- STAKING_MODULE_ID=${VE_STAKING_MODULE_ID:-2}
- OPERATOR_ID=${VE_OPERATOR_ID}
- ORACLE_ADDRESSES_ALLOWLIST=${VE_ORACLE_ADDRESSES_ALLOWLIST:-["0x140Bd8FbDc884f48dA7cb1c09bE8A2fAdfea776E","0xA7410857ABbf75043d61ea54e07D57A6EB6EF186","0x404335BcE530400a5814375E7Ec1FB55fAff3eA2","0x946D3b081ed19173dC83Cd974fC69e1e760B7d78","0x007DE4a5F7bc37E2F26c0cb2E8A95006EE9B89b5","0xEC4BfbAF681eb505B94E4a7849877DC6c600Ca3A","0x61c91ECd902EB56e314bB2D5c5C07785444Ea1c8","0x1Ca0fEC59b86F549e1F1184d97cb47794C8Af58d","0xc79F702202E3A6B0B6310B537E786B9ACAA19BAf"]}
- MESSAGES_LOCATION=/exitmessages
- RUN_METRICS=true
- HTTP_PORT=8989
- DISABLE_SECURITY_DONT_USE_IN_PRODUCTION=${DISABLE_EJECTOR_SECURITY:-false}

lido-dv-exit:
image: obolnetwork/lido-dv-exit:${LIDO_DV_EXIT_VERSION:-20d28fd}
user: ":"
volumes:
- ./validator-ejector:/exitmessages
- .charon:/charon
environment:
- LIDODVEXIT_BEACON_NODE_URL=${LIDO_DV_EXIT_BEACON_NODE_URL:-http://consensus:5052}
- LIDODVEXIT_CHARON_RUNTIME_DIR=/charon
- LIDODVEXIT_EJECTOR_EXIT_PATH=/exitmessages
- LIDODVEXIT_EXIT_EPOCH=256
- LIDODVEXIT_LOG_LEVEL=${LIDO_DV_EXIT_LOG_LEVEL:-info}
- LIDODVEXIT_VALIDATOR_QUERY_CHUNK_SIZE=${LIDO_DV_EXIT_VALIDATOR_QUERY_CHUNK_SIZE:-5}
restart: on-failure

0 comments on commit 0805e05

Please sign in to comment.