From a2417d69f697b7128c948936a58e09775cb9d49e Mon Sep 17 00:00:00 2001 From: Yorick Downe Date: Sun, 13 Aug 2023 04:04:34 +0000 Subject: [PATCH] Fetch keys from web3signer on startup for Prysm, Teku, Lodestar --- lodestar-vc-only.yml | 1 + lodestar.yml | 1 + lodestar/docker-entrypoint-vc.sh | 11 +++++++++-- prysm/docker-entrypoint-vc.sh | 2 +- teku/docker-entrypoint-vc.sh | 2 +- teku/docker-entrypoint.sh | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lodestar-vc-only.yml b/lodestar-vc-only.yml index dcdc6a2a..60b1999b 100644 --- a/lodestar-vc-only.yml +++ b/lodestar-vc-only.yml @@ -29,6 +29,7 @@ services: - VC_EXTRAS=${VC_EXTRAS:-} - GRAFFITI=${GRAFFITI:-} - DEFAULT_GRAFFITI=${DEFAULT_GRAFFITI:-false} + - WEB3SIGNER=${WEB3SIGNER} volumes: - lsvalidator-data:/var/lib/lodestar/validators - /etc/localtime:/etc/localtime:ro diff --git a/lodestar.yml b/lodestar.yml index cc561f59..d1a63f7b 100644 --- a/lodestar.yml +++ b/lodestar.yml @@ -87,6 +87,7 @@ services: - VC_EXTRAS=${VC_EXTRAS:-} - GRAFFITI=${GRAFFITI:-} - DEFAULT_GRAFFITI=${DEFAULT_GRAFFITI:-false} + - WEB3SIGNER=${WEB3SIGNER} volumes: - lsvalidator-data:/var/lib/lodestar/validators - /etc/localtime:/etc/localtime:ro diff --git a/lodestar/docker-entrypoint-vc.sh b/lodestar/docker-entrypoint-vc.sh index b9a8088a..cb1ecf79 100755 --- a/lodestar/docker-entrypoint-vc.sh +++ b/lodestar/docker-entrypoint-vc.sh @@ -30,12 +30,19 @@ else __doppel="" fi +# Web3signer URL +if [ "${WEB3SIGNER}" = "true" ]; then + __w3s_url="--externalSigner.url http://web3signer:9000 --externalSigner.fetch" +else + __w3s_url="" +fi + if [ "${DEFAULT_GRAFFITI}" = "true" ]; then # Word splitting is desired for the command line parameters # shellcheck disable=SC2086 - exec "$@" ${__mev_boost} ${__beacon_stats} ${__doppel} ${VC_EXTRAS} + exec "$@" ${__mev_boost} ${__beacon_stats} ${__doppel} ${__w3s_url} ${VC_EXTRAS} else # Word splitting is desired for the command line parameters # shellcheck disable=SC2086 - exec "$@" "--graffiti" "${GRAFFITI}" ${__mev_boost} ${__beacon_stats} ${__doppel} ${VC_EXTRAS} + exec "$@" "--graffiti" "${GRAFFITI}" ${__mev_boost} ${__beacon_stats} ${__doppel} ${__w3s_url} ${VC_EXTRAS} fi diff --git a/prysm/docker-entrypoint-vc.sh b/prysm/docker-entrypoint-vc.sh index 927b8e6d..b6164ae1 100755 --- a/prysm/docker-entrypoint-vc.sh +++ b/prysm/docker-entrypoint-vc.sh @@ -24,7 +24,7 @@ fi # Web3signer URL if [ "${WEB3SIGNER}" = "true" ]; then - __w3s_url="--validators-external-signer-url http://web3signer:9000" + __w3s_url="--validators-external-signer-url http://web3signer:9000 --validators-external-signer-public-keys http://web3signer:9000/api/v1/eth2/publicKeys" else __w3s_url="" fi diff --git a/teku/docker-entrypoint-vc.sh b/teku/docker-entrypoint-vc.sh index 9c9906aa..19d561ef 100755 --- a/teku/docker-entrypoint-vc.sh +++ b/teku/docker-entrypoint-vc.sh @@ -42,7 +42,7 @@ fi # Web3signer URL if [ "${WEB3SIGNER}" = "true" ]; then - __w3s_url="--validators-external-signer-url http://web3signer:9000" + __w3s_url="--validators-external-signer-url http://web3signer:9000 --validators-external-signer-public-keys external-signer" else __w3s_url="" fi diff --git a/teku/docker-entrypoint.sh b/teku/docker-entrypoint.sh index 59b8352d..1d3f741c 100755 --- a/teku/docker-entrypoint.sh +++ b/teku/docker-entrypoint.sh @@ -83,7 +83,7 @@ fi # Web3signer URL if [[ "${EMBEDDED_VC}" = "true" && "${WEB3SIGNER}" = "true" ]]; then - __w3s_url="--validators-external-signer-url http://web3signer:9000" + __w3s_url="--validators-external-signer-url http://web3signer:9000 --validators-external-signer-public-keys external-signer" else __w3s_url="" fi