Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reth include SSV RocketPool StakeWise contract in full #1924

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,13 @@ __delete_reth() {
return 0
fi

# Has db been initialized?
__db_exists=$(dodocker run --rm -v "$(dodocker volume ls -q -f "name=$(basename "$(realpath .)")[_-]reth-el-data")":"/var/lib/reth" \
alpine:3 sh -c 'if [ -f "/var/lib/reth/db/database.version" ]; then echo true; else echo false; fi')
if [ "$__db_exists" = "false" ]; then
return 0
fi

# Check Reth db version
__db_version="$(__dodocker run --rm -v "$(__dodocker volume ls -q -f "name=$(basename "$(realpath .)")[_-]reth-el-data")":"/var/lib/reth" \
alpine:3 cat /var/lib/reth/db/database.version)"
Expand Down
68 changes: 63 additions & 5 deletions reth/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,75 @@ case ${LOG_LEVEL} in
;;
esac

__static=""
if [ -n "${STATIC_DIR}" ] && [ ! "${STATIC_DIR}" = ".nada" ]; then
echo "Using separate static files directory at ${STATIC_DIR}."
__static="--datadir.static-files /var/lib/static"
fi

if [ "${ARCHIVE_NODE}" = "true" ]; then
echo "Reth archive node without pruning"
__prune=""
else
__prune="--full"
fi
if [ ! -f "/var/lib/reth/reth.toml" ]; then # Configure ssv, rocketpool, stakewise contracts
# Word splitting is desired for the command line parameters
# shellcheck disable=SC2086
reth init ${__network} --datadir /var/lib/reth ${__static}
cat <<EOF >> /var/lib/reth/reth.toml

__static=""
if [ -n "${STATIC_DIR}" ] && [ ! "${STATIC_DIR}" = ".nada" ]; then
echo "Using separate static files directory at ${STATIC_DIR}."
__static="--datadir.static-files /var/lib/static"
[prune]
block_interval = 5

[prune.segments]
sender_recovery = "full"

[prune.segments.receipts]
before = 0

[prune.segments.account_history]
distance = 10064

[prune.segments.storage_history]
distance = 10064
EOF
case "${NETWORK}" in
mainnet)
echo "Configuring Reth pruning to include RocketPool, SSV and StakeWise contracts"
cat <<EOF >> /var/lib/reth/reth.toml

[prune.segments.receipts_log_filter.0x00000000219ab540356cBB839Cbe05303d7705Fa]
before = 0

[prune.segments.receipts_log_filter.0xDD9BC35aE942eF0cFa76930954a156B3fF30a4E1]
before = 0

[prune.segments.receipts_log_filter.0xEE4d2A71cF479e0D3d0c3c2C923dbfEB57E73111]
before = 0

[prune.segments.receipts_log_filter.0x6B5815467da09DaA7DC83Db21c9239d98Bb487b5]
before = 0
EOF
;;
holesky)
echo "Configuring Reth pruning to include RocketPool, SSV and StakeWise contracts"
cat <<EOF >> /var/lib/reth/reth.toml

[prune.segments.receipts_log_filter.0x4242424242424242424242424242424242424242]
before = 0

[prune.segments.receipts_log_filter.0x38A4794cCEd47d3baf7370CcC43B560D3a1beEFA]
before = 0

[prune.segments.receipts_log_filter.0x9D210F9169bc6Cf49152F21A57A446bCcaA87b33]
before = 0

[prune.segments.receipts_log_filter.0xB580799Bf7d62721D1a523f0FDF2f5Ed7BA4e259]
before = 0
EOF
;;
esac
fi
fi

if [ -f /var/lib/reth/prune-marker ]; then
Expand Down