From 82bb160852e59622919ab32f966125edbe11f727 Mon Sep 17 00:00:00 2001 From: Marketen Date: Tue, 2 Apr 2024 18:05:47 +0200 Subject: [PATCH 1/2] add mev boost --- beacon-chain/Dockerfile | 3 +++ beacon-chain/entrypoint.sh | 12 ++++++++++++ dappnode_package.json | 6 +++++- validator/entrypoint.sh | 6 ++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/beacon-chain/Dockerfile b/beacon-chain/Dockerfile index 800212d..e195207 100644 --- a/beacon-chain/Dockerfile +++ b/beacon-chain/Dockerfile @@ -1,6 +1,9 @@ ARG UPSTREAM_VERSION FROM chainsafe/lodestar:${UPSTREAM_VERSION} +# curl is required to check if mev-boost is running +RUN apk update && apk add --no-cache curl + COPY jwtsecret.hex /jwtsecret COPY entrypoint.sh /usr/local/bin/entrypoint.sh diff --git a/beacon-chain/entrypoint.sh b/beacon-chain/entrypoint.sh index 95f7036..bfb6647 100755 --- a/beacon-chain/entrypoint.sh +++ b/beacon-chain/entrypoint.sh @@ -22,6 +22,18 @@ case $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_HOLESKY in ;; esac +# MEV-Boost: https://chainsafe.github.io/lodestar/beacon-management/mev-and-builder-integration/ +if [ -n "$_DAPPNODE_GLOBAL_MEVBOOST_HOLESKY" ] && [ "$_DAPPNODE_GLOBAL_MEVBOOST_HOLESKY" == "true" ]; then + echo "MEV-Boost is enabled" + MEVBOOST_URL="http://mev-boost.mev-boost-holesky.dappnode:18550" + if curl --retry 5 --retry-delay 5 --retry-all-errors "${MEVBOOST_URL}"; then + EXTRA_OPTS="--builder --builder.urls=${MEVBOOST_URL} ${EXTRA_OPTS}" + else + echo "MEV-Boost is enabled but the Holesky MEV-Boost package at ${MEVBOOST_URL} is not reachable" + curl -X POST -G 'http://my.dappnode/notification-send' --data-urlencode 'type=danger' --data-urlencode title="${MEVBOOST_URL} can not be reached" --data-urlencode 'body=Make sure the Holesky MEV-Boost DNP is available and running' + fi +fi + exec node --max-old-space-size=${MEMORY_LIMIT} /usr/app/node_modules/.bin/lodestar \ beacon \ --network=holesky \ diff --git a/dappnode_package.json b/dappnode_package.json index c3fae9b..512b0b9 100644 --- a/dappnode_package.json +++ b/dappnode_package.json @@ -41,8 +41,12 @@ }, "globalEnvs": [ { - "envs": ["EXECUTION_CLIENT_HOLESKY"], + "envs": ["EXECUTION_CLIENT_HOLESKY", "MEVBOOST_HOLESKY"], "services": ["beacon-chain"] + }, + { + "envs": ["MEVBOOST_HOLESKY"], + "services": ["validator"] } ] } diff --git a/validator/entrypoint.sh b/validator/entrypoint.sh index 9ec6491..adeabc6 100755 --- a/validator/entrypoint.sh +++ b/validator/entrypoint.sh @@ -1,5 +1,11 @@ #!/bin/sh +# MEV-Boost: https://chainsafe.github.io/lodestar/beacon-management/mev-and-builder-integration/ +if [ -n "$_DAPPNODE_GLOBAL_MEVBOOST_HOLESKY" ] && [ "$_DAPPNODE_GLOBAL_MEVBOOST_HOLESKY" == "true" ]; then + echo "MEV-Boost is enabled" + EXTRA_OPTS="--builder ${EXTRA_OPTS}" +fi + # Handle Graffiti Character Limit oLang=$LANG oLcAll=$LC_ALL LANG=C LC_ALL=C From cb8aebf6a012605ee6f20dd2cdc380f0edece4dc Mon Sep 17 00:00:00 2001 From: Marketen Date: Tue, 2 Apr 2024 18:29:47 +0200 Subject: [PATCH 2/2] update urls to url --- beacon-chain/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/entrypoint.sh b/beacon-chain/entrypoint.sh index bfb6647..7da5d0c 100755 --- a/beacon-chain/entrypoint.sh +++ b/beacon-chain/entrypoint.sh @@ -27,7 +27,7 @@ if [ -n "$_DAPPNODE_GLOBAL_MEVBOOST_HOLESKY" ] && [ "$_DAPPNODE_GLOBAL_MEVBOOST_ echo "MEV-Boost is enabled" MEVBOOST_URL="http://mev-boost.mev-boost-holesky.dappnode:18550" if curl --retry 5 --retry-delay 5 --retry-all-errors "${MEVBOOST_URL}"; then - EXTRA_OPTS="--builder --builder.urls=${MEVBOOST_URL} ${EXTRA_OPTS}" + EXTRA_OPTS="--builder --builder.url=${MEVBOOST_URL} ${EXTRA_OPTS}" else echo "MEV-Boost is enabled but the Holesky MEV-Boost package at ${MEVBOOST_URL} is not reachable" curl -X POST -G 'http://my.dappnode/notification-send' --data-urlencode 'type=danger' --data-urlencode title="${MEVBOOST_URL} can not be reached" --data-urlencode 'body=Make sure the Holesky MEV-Boost DNP is available and running'