Skip to content

feat(lighthouse-reth): add new rust client combo#111

Merged
coincashew merged 2 commits intomainfrom
lh
May 12, 2025
Merged

feat(lighthouse-reth): add new rust client combo#111
coincashew merged 2 commits intomainfrom
lh

Conversation

@coincashew
Copy link
Copy Markdown
Owner

@coincashew coincashew commented May 12, 2025

Summary by CodeRabbit

  • New Features

    • Added support for installing a Lighthouse-Reth Ethereum node with automated setup scripts.
    • Expanded client selection menu to include Lighthouse-Reth, a security-focused, performance-oriented option.
  • Improvements

    • Validator key management and public key retrieval dynamically detect the appropriate data directory for Lighthouse validators.
    • Added secondary port environment variables for peer-to-peer communication.
    • Updated validator graffiti string with an added emoji for enhanced identification.
  • Bug Fixes

    • Uninstall process now removes additional Lighthouse validator directories for more thorough cleanup.
  • User Experience

    • Installation scripts include detailed prompts, error handling, and post-install instructions for smoother setup and operation.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 12, 2025

Warning

Rate limit exceeded

@coincashew has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 30 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between a98d3d0 and e6a89b4.

📒 Files selected for processing (3)
  • deploy-lighthouse-reth.py (1 hunks)
  • env (1 hunks)
  • install-lighthouse-reth.sh (1 hunks)

Walkthrough

A new automated installation and configuration workflow for an Ethereum node stack featuring Lighthouse (consensus and validator clients), Reth (execution client), and MEV-Boost was introduced. Supporting multiple networks and installation modes, the update adds new scripts, environment variables, and dynamic path handling for validator keys. Uninstallation and key management scripts are also updated to accommodate new directory structures.

Changes

File(s) Change Summary
deploy-lighthouse-reth.py New Python script for automated setup of Lighthouse (beacon and validator), Reth, and MEV-Boost. Handles user input, system prep, binary downloads, service configuration, and post-install instructions for various staking modes and networks.
install-lighthouse-reth.sh New Bash script for orchestrating the installation of the Lighthouse-Reth stack. Handles prerequisites, Python environment setup, repository cloning, and launches the main deployment script.
env Added environment variables for secondary EL and CL P2P ports; updated validator graffiti to include a giraffe emoji.
ethpillar.sh Expanded client selection menu to include "Lighthouse-Reth" as a new option; invokes the new installation script when selected.
functions.sh, manage_validator_keys.sh Updated logic to dynamically select the validator key directory, preferring /var/lib/lighthouse_validator if it exists, else falling back to /var/lib/lighthouse/validators.
uninstall.sh Updated Lighthouse validator cleanup to also remove /var/lib/lighthouse_validator directory.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant install-lighthouse-reth.sh
    participant deploy-lighthouse-reth.py
    participant System (OS/Packages)
    participant GitHub
    participant Systemd

    User->>install-lighthouse-reth.sh: Start script
    install-lighthouse-reth.sh->>System (OS/Packages): Check OS/CPU, install prerequisites
    install-lighthouse-reth.sh->>System (OS/Packages): Setup Python venv, install dependencies
    install-lighthouse-reth.sh->>GitHub: Clone/update ethpillar repo
    install-lighthouse-reth.sh->>deploy-lighthouse-reth.py: Launch deployment script
    deploy-lighthouse-reth.py->>User: Prompt for config/network/mode
    deploy-lighthouse-reth.py->>System (OS/Packages): Validate environment, prepare system
    deploy-lighthouse-reth.py->>GitHub: Download MEV-Boost, Reth, Lighthouse binaries
    deploy-lighthouse-reth.py->>System (OS/Packages): Install binaries, set permissions
    deploy-lighthouse-reth.py->>Systemd: Generate and install service files
    deploy-lighthouse-reth.py->>User: Summarize setup, provide next steps
Loading

Poem

In the warren of code, a new path appears,
Lighthouse and Reth, now installed with cheers!
With giraffe in the graffiti, and keys tucked away,
MEV-Boost hops in, ready to play.
From setup to service, the journey is bright—
EthPillar’s node stack, now shining with light!
🦒✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (3)
manage_validator_keys.sh (1)

141-147: Validator-type menu width bump is fine, but consider extracting magic numbers

Raising the whiptail width from 88 → 90 brings a little more breathing room—looks good.
Long-term, putting these dimensions in constants (MENU_HEIGHT, MENU_WIDTH) will make future tweaks easier and avoid scattering “magic numbers” through the file.

deploy-lighthouse-reth.py (2)

740-748: Avoid hidden failures when FEE_RECIPIENT_ADDRESS is unset

_feeparameters becomes an empty string when FEE_RECIPIENT_ADDRESS is empty.
If the validator client is launched without this flag the user silently forfeits
MEV / block-tips.

Consider validating before service-file generation:

if VALIDATOR_ENABLED and not FEE_RECIPIENT_ADDRESS:
    sys.exit("ERROR: --fee_address is mandatory for validator modes")

or fail at argument parsing time (required=True when the chosen install mode
needs it).


689-699: Boolean comparisons can be simplified & silence Ruff E712

Throughout the installer (MEVBOOST_ENABLED == True, VALIDATOR_ENABLED == True
…), direct comparisons to True/False are verbose and trigger linter
complaints.

-if MEVBOOST_ENABLED == True:
+if MEVBOOST_ENABLED:

Applying the same simplification globally reduces noise and emphasises intent.

🧰 Tools
🪛 Ruff (0.8.2)

689-689: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)


696-696: f-string without any placeholders

Remove extraneous f prefix

(F541)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a76bb9e and 00ac9f7.

📒 Files selected for processing (7)
  • deploy-lighthouse-reth.py (1 hunks)
  • env (1 hunks)
  • ethpillar.sh (1 hunks)
  • functions.sh (1 hunks)
  • install-lighthouse-reth.sh (1 hunks)
  • manage_validator_keys.sh (2 hunks)
  • uninstall.sh (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
ethpillar.sh (1)
functions.sh (1)
  • runScript (162-179)
install-lighthouse-reth.sh (1)
functions.sh (6)
  • tty_escape (39-39)
  • tty_escape (41-41)
  • tty_mkbold (43-43)
  • shell_join (50-58)
  • exit_on_error (28-35)
  • ohai (60-62)
🪛 Shellcheck (0.10.0)
install-lighthouse-reth.sh

[warning] 37-37: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)


[warning] 72-72: tty_underline appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 74-74: tty_red appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 126-126: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🪛 Ruff (0.8.2)
deploy-lighthouse-reth.py

17-17: fnmatch imported but unused

Remove unused import: fnmatch

(F401)


21-21: shutil imported but unused

Remove unused import: shutil

(F401)


24-24: urllib.request imported but unused

Remove unused import: urllib.request

(F401)


25-25: zipfile imported but unused

Remove unused import: zipfile

(F401)


26-26: Redefinition of unused random from line 18

Remove definition: random

(F811)


29-29: Redefinition of unused tempfile from line 23

Remove definition: tempfile

(F811)


30-30: yaml imported but unused

Remove unused import: yaml

(F401)


31-31: from consolemenu import * used; unable to detect undefined names

(F403)


32-32: from consolemenu.items import * used; unable to detect undefined names

(F403)


34-34: dotenv.dotenv_values imported but unused

Remove unused import: dotenv.dotenv_values

(F401)


35-35: from config import * used; unable to detect undefined names

(F403)


126-126: SelectionMenu may be undefined, or defined from star imports

(F405)


144-144: SelectionMenu may be undefined, or defined from star imports

(F405)


231-231: Screen may be undefined, or defined from star imports

(F405)


231-231: f-string without any placeholders

Remove extraneous f prefix

(F541)


242-245: Return the condition bool(re.match(pattern, ip_port)) directly

Replace with return bool(re.match(pattern, ip_port))

(SIM103)


252-252: Screen may be undefined, or defined from star imports

(F405)


252-252: f-string without any placeholders

Remove extraneous f prefix

(F541)


270-270: f-string without any placeholders

Remove extraneous f prefix

(F541)


273-273: PromptUtils may be undefined, or defined from star imports

(F405)


273-273: Screen may be undefined, or defined from star imports

(F405)


320-320: mainnet_sync_urls may be undefined, or defined from star imports

(F405)


322-322: holesky_sync_urls may be undefined, or defined from star imports

(F405)


324-324: sepolia_sync_urls may be undefined, or defined from star imports

(F405)


326-326: hoodi_sync_urls may be undefined, or defined from star imports

(F405)


328-328: ephemery_sync_urls may be undefined, or defined from star imports

(F405)


353-353: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)


406-406: tar_filename may be undefined, or defined from star imports

(F405)


419-419: f-string without any placeholders

Remove extraneous f prefix

(F541)


422-422: f-string without any placeholders

Remove extraneous f prefix

(F541)


445-445: mainnet_relay_options may be undefined, or defined from star imports

(F405)


447-447: hoodi_relay_options may be undefined, or defined from star imports

(F405)


449-449: holesky_relay_options may be undefined, or defined from star imports

(F405)


451-451: sepolia_relay_options may be undefined, or defined from star imports

(F405)


544-544: f-string without any placeholders

Remove extraneous f prefix

(F541)


555-555: f-string without any placeholders

Remove extraneous f prefix

(F541)


625-626: Use a single if statement instead of nested if statements

(SIM102)


673-673: f-string without any placeholders

Remove extraneous f prefix

(F541)


689-689: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)


696-696: f-string without any placeholders

Remove extraneous f prefix

(F541)


734-737: Use ternary operator _mevparameters = '--builder-proposals' if MEVBOOST_ENABLED == True else '' instead of if-else-block

Replace if-else-block with _mevparameters = '--builder-proposals' if MEVBOOST_ENABLED == True else ''

(SIM108)


734-734: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)


739-739: Avoid equality comparisons to True; use if VALIDATOR_ENABLED: for truth checks

Replace with VALIDATOR_ENABLED

(E712)


751-751: f-string without any placeholders

Remove extraneous f prefix

(F541)


753-753: Local variable bootnodes is assigned to but never used

Remove assignment to unused variable bootnodes

(F841)


754-754: f-string without any placeholders

Remove extraneous f prefix

(F541)


758-758: Avoid equality comparisons to True; use if VALIDATOR_ENABLED: for truth checks

Replace with VALIDATOR_ENABLED

(E712)


798-798: f-string without any placeholders

Remove extraneous f prefix

(F541)


799-799: f-string without any placeholders

Remove extraneous f prefix

(F541)


800-800: f-string without any placeholders

Remove extraneous f prefix

(F541)


821-821: f-string without any placeholders

Remove extraneous f prefix

(F541)


823-823: Avoid equality comparisons to False; use if not NODE_ONLY: for false checks

Replace with not NODE_ONLY

(E712)


826-826: f-string without any placeholders

Remove extraneous f prefix

(F541)


829-829: Avoid equality comparisons to True; use if VALIDATOR_ENABLED: for truth checks

Replace with VALIDATOR_ENABLED

(E712)


831-831: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)


835-835: f-string without any placeholders

Remove extraneous f prefix

(F541)


840-840: PromptUtils may be undefined, or defined from star imports

(F405)


840-840: Screen may be undefined, or defined from star imports

(F405)


840-840: f-string without any placeholders

Remove extraneous f prefix

(F541)


842-842: f-string without any placeholders

Remove extraneous f prefix

(F541)


843-843: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)


844-844: f-string without any placeholders

Remove extraneous f prefix

(F541)


847-847: PromptUtils may be undefined, or defined from star imports

(F405)


847-847: Screen may be undefined, or defined from star imports

(F405)


847-847: f-string without any placeholders

Remove extraneous f prefix

(F541)


850-850: f-string without any placeholders

Remove extraneous f prefix

(F541)


851-851: Avoid equality comparisons to True; use if VALIDATOR_ENABLED: for truth checks

Replace with VALIDATOR_ENABLED

(E712)


852-852: f-string without any placeholders

Remove extraneous f prefix

(F541)


853-853: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)


854-854: f-string without any placeholders

Remove extraneous f prefix

(F541)


859-859: PromptUtils may be undefined, or defined from star imports

(F405)


859-859: Screen may be undefined, or defined from star imports

(F405)


867-867: f-string without any placeholders

Remove extraneous f prefix

(F541)


868-868: PromptUtils may be undefined, or defined from star imports

(F405)


868-868: Screen may be undefined, or defined from star imports

(F405)


868-868: f-string without any placeholders

Remove extraneous f prefix

(F541)


880-880: PromptUtils may be undefined, or defined from star imports

(F405)


880-880: Screen may be undefined, or defined from star imports

(F405)

🔇 Additional comments (7)
env (3)

9-9: New environment variable for secondary execution layer P2P port looks good.

Adding a secondary P2P port for the execution layer will allow for more flexible network configurations in multi-client setups.


14-14: New environment variable for secondary consensus layer P2P port looks good.

Adding a secondary P2P port for the consensus layer complements the EL_P2P_PORT_2 addition and provides consistency in the configuration approach.


21-21: Validator graffiti update with giraffe emoji is fine.

The modification to the graffiti string by adding a giraffe emoji maintains the character limit while providing a unique identifier for this client combination.

uninstall.sh (1)

149-149: Good addition of cleanup for new validator directory.

This change properly extends the Lighthouse validator cleanup process to include the new /var/lib/lighthouse_validator directory, ensuring complete uninstallation.

functions.sh (1)

265-266: Good implementation of dynamic validator directory selection.

The code now intelligently checks for the existence of the new /var/lib/lighthouse_validator directory and falls back to the original path if needed. This provides backward compatibility while supporting the new Lighthouse-Reth client combination.

ethpillar.sh (2)

1494-1497: Menu addition for new client combination looks good.

The menu now includes the Lighthouse-Reth option with an appropriate description highlighting its Rust foundation and focus on security and performance.


1503-1505: Handler for new client combination follows established patterns.

The implementation correctly calls the new installation script with the appropriate argument, maintaining consistency with existing client combination handlers.

@coincashew coincashew force-pushed the lh branch 2 times, most recently from 2b40597 to b55c80f Compare May 12, 2025 21:24
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 4

♻️ Duplicate comments (2)
install-lighthouse-reth.sh (1)

126-126: Guard cd on clone fallback (previously raised)

cd ~/git/ethpillar still lacks || exit 1, so a failed clone that isn’t
“directory exists” will mask the root cause and run the rest of the pipeline in
an unknown directory.

(See earlier review-bot comment SC2164.)

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 126-126: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

deploy-lighthouse-reth.py (1)

14-35: 🛠️ Refactor suggestion

Prune unused & wildcard imports – they mask bugs and hurt startup time

Many modules are imported but never used and from … import * pollutes the
namespace, hiding undefined names (Ruff F401/F403/E…). Tighten the import
section and explicitly pull only what is needed:

-import fnmatch
-import random
-import json
-import tarfile
-import shutil
-import subprocess
-import tempfile
-import urllib.request
-import zipfile
-import random
-import sys
-import platform
-import tempfile
-import yaml
-from consolemenu import *
-from consolemenu.items import *
-import argparse
-from dotenv import load_dotenv, dotenv_values
-from config import *
+import argparse
+import json
+import os
+import platform
+import random
+import subprocess
+import sys
+import tarfile
+import tempfile
+
+from consolemenu import SelectionMenu, PromptUtils, Screen
+from consolemenu.items import FunctionItem
+from dotenv import load_dotenv
+from tqdm import tqdm
+
+# Pull only the symbols actually used from config.py
+from config import (
+    mainnet_sync_urls, holesky_sync_urls, hoodi_sync_urls,
+    sepolia_sync_urls, ephemery_sync_urls,
+    mainnet_relay_options, hoodi_relay_options,
+    holesky_relay_options, sepolia_relay_options,
+)

You’ll then need to update the few references that relied on the star-imports
(SelectionMenu, PromptUtils, etc.) – they’re already in the explicit list
above.
Benefits: faster startup, better static analysis, smaller attack surface.

🧰 Tools
🪛 Ruff (0.8.2)

17-17: fnmatch imported but unused

Remove unused import: fnmatch

(F401)


21-21: shutil imported but unused

Remove unused import: shutil

(F401)


24-24: urllib.request imported but unused

Remove unused import: urllib.request

(F401)


25-25: zipfile imported but unused

Remove unused import: zipfile

(F401)


26-26: Redefinition of unused random from line 18

Remove definition: random

(F811)


29-29: Redefinition of unused tempfile from line 23

Remove definition: tempfile

(F811)


30-30: yaml imported but unused

Remove unused import: yaml

(F401)


31-31: from consolemenu import * used; unable to detect undefined names

(F403)


32-32: from consolemenu.items import * used; unable to detect undefined names

(F403)


34-34: dotenv.dotenv_values imported but unused

Remove unused import: dotenv.dotenv_values

(F401)


35-35: from config import * used; unable to detect undefined names

(F403)

🧹 Nitpick comments (2)
install-lighthouse-reth.sh (1)

115-120: Optional: avoid polluting ~/.local with the virtual-env

Creating a venv directly in ~/.local mixes venv artefacts with user-installed
Python packages. Consider ~/.ethpillar-venv (or similar) instead to keep the
directory clean and easy to remove.

deploy-lighthouse-reth.py (1)

353-357: Pythonic truth checks

if MEVBOOST_ENABLED == True is verbose and flagged by linters (E712). Use a
direct truthy test:

-if MEVBOOST_ENABLED == True and not VALIDATOR_ONLY:
+if MEVBOOST_ENABLED and not VALIDATOR_ONLY:

Same pattern recurs later for VALIDATOR_ENABLED, NODE_ONLY, etc.

🧰 Tools
🪛 Ruff (0.8.2)

353-353: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)

🛑 Comments failed to post (4)
install-lighthouse-reth.sh (2)

98-103: 🛠️ Refactor suggestion

Capture failures from both apt-get calls

Only the second command (apt-get install) is checked.
If apt-get update fails (network issues, …​) the script keeps running.

linux_install_pre() {
-    sudo apt-get update
-    sudo apt-get install --no-install-recommends --no-install-suggests -y curl git ccze jq tmux bc
-    exit_on_error $?
+    sudo apt-get update
+    exit_on_error $? "apt-get update"
+
+    sudo apt-get install --no-install-recommends --no-install-suggests -y \
+         curl git ccze jq tmux bc
+    exit_on_error $? "apt-get install prerequisite packages"
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

linux_install_pre() {
    sudo apt-get update
    exit_on_error $? "apt-get update"

    sudo apt-get install --no-install-recommends --no-install-suggests -y \
         curl git ccze jq tmux bc
    exit_on_error $? "apt-get install prerequisite packages"
}

35-42: 🛠️ Refactor suggestion

Fix exit_on_error – array handling & quoting

$@:2 assigns an array into a scalar (SC2124).
Switch to proper shifting and quote variables so the original command is echoed
exactly as executed.

-exit_on_error() {
-    exit_code=$1
-    last_command="${@:2}"
-    if [ $exit_code -ne 0 ]; then
-        >&2 echo "\"${last_command}\" command failed with exit code ${exit_code}."
-        exit $exit_code
-    fi
-}
+exit_on_error() {
+    local exit_code="$1"
+    shift                         # keep the failing command intact
+    local last_command="$*"
+    if [ "$exit_code" -ne 0 ]; then
+        >&2 echo "\"${last_command}\" failed with exit code ${exit_code}."
+        exit "$exit_code"
+    fi
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

exit_on_error() {
    local exit_code="$1"
    shift                         # keep the failing command intact
    local last_command="$*"
    if [ "$exit_code" -ne 0 ]; then
        >&2 echo "\"${last_command}\" failed with exit code ${exit_code}."
        exit "$exit_code"
    fi
}
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 37-37: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)

deploy-lighthouse-reth.py (2)

382-405: ⚠️ Potential issue

Missing checksum / signature verification for downloaded binaries

The script downloads binaries over HTTPS and executes/moves them without
verifying signatures or hashes. A compromised GitHub CDN edge could deliver
malicious payloads.

At minimum, retrieve the SHA256 provided in the GitHub release and compare
before extraction; ideally verify PGP signatures if available.
[security]


240-246: ⚠️ Potential issue

Port-validation regex allows “:?” typo

(:?\d{1,5})? makes the colon optional, so an address like
http://10.0.0.1 without a colon but followed by digits elsewhere in the
string could pass. Use an explicit colon:

-    pattern = r"^(http|https|ws):\/\/((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:?\d{1,5})?$"
+    pattern = r"^(http|https|ws):\/\/((25[0-5]|2[0-4][0-9]|[01]?\d\d?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?\d\d?)(:\d{1,5})?$"

This keeps the semantics (“port is optional, but if present must start with
:”).
Optionally consider accepting hostnames as well.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

def validate_beacon_node_address(ip_port):
    pattern = r"^(http|https|ws):\/\/((25[0-5]|2[0-4][0-9]|[01]?\d\d?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?\d\d?)(:\d{1,5})?$"
    if re.match(pattern, ip_port):
        return True
    else:
        return False
🧰 Tools
🪛 Ruff (0.8.2)

242-245: Return the condition bool(re.match(pattern, ip_port)) directly

Replace with return bool(re.match(pattern, ip_port))

(SIM103)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 3

♻️ Duplicate comments (2)
install-lighthouse-reth.sh (1)

124-128: Guard against cd failure when clone fallback runs
This is the same SC2164 issue flagged previously: if git clone fails for a
reason other than “directory exists”, the cd will leave the script in an
undefined state.

- git clone … || (cd ~/git/ethpillar ; git fetch …)
+ git clone … || (cd ~/git/ethpillar || exit 1 ; git fetch …)
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 126-126: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

deploy-lighthouse-reth.py (1)

17-35: 🛠️ Refactor suggestion

Cull unused & wildcard imports – they hide bugs and slow startup

The import block pulls in duplicates (random, tempfile), many unused modules
(fnmatch, shutil, urllib.request, zipfile, yaml, dotenv_values) and
several * imports. This:

  1. Masks undefined-name errors (star imports pollute the namespace).
  2. Bloats memory/start-up time.
  3. Violates PEP-8 and Ruff F4xx rules.

Suggested clean-up (minimal):

-import fnmatch
-import random
-import json
-import tarfile
-import shutil
-import subprocess
-import tempfile
-import urllib.request
-import zipfile
-import random
-import sys
-import platform
-import tempfile
-import yaml
-from consolemenu import *
-from consolemenu.items import *
-import argparse
-from dotenv import load_dotenv, dotenv_values
-from config import *
-from tqdm import tqdm
+import argparse
+import json
+import os
+import platform
+import random
+import subprocess
+import sys
+import tarfile
+import tempfile
+from consolemenu import SelectionMenu, PromptUtils, Screen
+from consolemenu.items import FunctionItem
+from dotenv import load_dotenv
+from tqdm import tqdm
+from config import (
+    mainnet_sync_urls,
+    holesky_sync_urls,
+    hoodi_sync_urls,
+    sepolia_sync_urls,
+    ephemery_sync_urls,
+    mainnet_relay_options,
+    holesky_relay_options,
+    hoodi_relay_options,
+    sepolia_relay_options,
+)

Removing the unused names will let static-analysis catch genuine mistakes and
makes maintenance easier.

🧰 Tools
🪛 Ruff (0.8.2)

17-17: fnmatch imported but unused

Remove unused import: fnmatch

(F401)


21-21: shutil imported but unused

Remove unused import: shutil

(F401)


24-24: urllib.request imported but unused

Remove unused import: urllib.request

(F401)


25-25: zipfile imported but unused

Remove unused import: zipfile

(F401)


26-26: Redefinition of unused random from line 18

Remove definition: random

(F811)


29-29: Redefinition of unused tempfile from line 23

Remove definition: tempfile

(F811)


30-30: yaml imported but unused

Remove unused import: yaml

(F401)


31-31: from consolemenu import * used; unable to detect undefined names

(F403)


32-32: from consolemenu.items import * used; unable to detect undefined names

(F403)


34-34: dotenv.dotenv_values imported but unused

Remove unused import: dotenv.dotenv_values

(F401)


35-35: from config import * used; unable to detect undefined names

(F403)

🧹 Nitpick comments (1)
deploy-lighthouse-reth.py (1)

280-297: Avoid shell=True with interpolated paths – use arg-lists instead

setup_ephemery_network() executes several sudo rm -rf and mkdir commands
through subprocess.run([...], shell=True) with string concatenation:

subprocess.run([f'sudo rm -rf {testnet_dir}'], shell=True)

Although testnet_dir is internally defined, this pattern invites accidental
shell-injection bugs and disables subprocess’s argument escaping.

- subprocess.run([f'sudo rm -rf {testnet_dir}'], shell=True)
+ subprocess.run(['sudo', 'rm', '-rf', testnet_dir], check=True)

Apply the same change to the subsequent mkdir/chmod calls and any other
os.system usages for safer, more readable code.

🛑 Comments failed to post (3)
install-lighthouse-reth.sh (2)

115-120: ⚠️ Potential issue

Virtual-env is created, but the deployment runs with the system Python

You install packages into ~/.local’s venv (~/.local/bin/pip …) yet later invoke
$python ~/git/ethpillar/deploy-lighthouse-reth.py, which refers to the global
python3. Modules such as console-menu, dotenv, etc. won’t be visible and the
script will crash with ModuleNotFoundError.

Two minimal fixes:

-    $python -m venv ~/.local --system-site-packages
+    $python -m venv ~/.local-    ~/.local/bin/pip install requests console-menu python-dotenv tqdm
+    ~/.local/bin/pip install --upgrade pip
+    ~/.local/bin/pip install requests console-menu python-dotenv tqdm-    $python ~/git/ethpillar/deploy-lighthouse-reth.py
+    ~/.local/bin/python ~/git/ethpillar/deploy-lighthouse-reth.py

(or source the venv’s activate script).
Failing to switch interpreters makes the whole venv setup moot.

Committable suggestion skipped: line range outside the PR's diff.


98-103: 💡 Verification agent

❓ Verification inconclusive

apt-get update is not checked – silent failures break the install later

linux_install_pre() exits on error for the apt-get install call, but a network/DNS hiccup during apt-get update would be ignored and could later cause “package not found” errors.

-linux_install_pre() {
-    sudo apt-get update
-    sudo apt-get install --no-install-recommends --no-install-suggests -y curl git ccze jq tmux bc
-    exit_on_error $?
-}
+linux_install_pre() {
+    sudo apt-get update
+    exit_on_error $? "apt-get update"
+
+    sudo apt-get install --no-install-recommends --no-install-suggests -y \
+        curl git ccze jq tmux bc
+    exit_on_error $? "apt-get install prerequisites"
+}

Ensure apt-get update failures are caught before installation

A network or DNS hiccup during sudo apt-get update would be ignored and could lead to subsequent “package not found” errors. Add an explicit exit_on_error check immediately after the update command.

  • File: install-lighthouse-reth.sh
  • Function: linux_install_pre() (around lines 98–103)
 linux_install_pre() {
-    sudo apt-get update
-    sudo apt-get install --no-install-recommends --no-install-suggests -y curl git ccze jq tmux bc
-    exit_on_error $?
+    sudo apt-get update
+    exit_on_error $? "apt-get update failed"

+    sudo apt-get install --no-install-recommends --no-install-suggests -y \
+        curl git ccze jq tmux bc
+    exit_on_error $? "apt-get install prerequisites failed"
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

linux_install_pre() {
    sudo apt-get update
    exit_on_error $? "apt-get update failed"

    sudo apt-get install --no-install-recommends --no-install-suggests -y \
        curl git ccze jq tmux bc
    exit_on_error $? "apt-get install prerequisites failed"
}
deploy-lighthouse-reth.py (1)

745-749: ⚠️ Potential issue

Fallback beacon-node URL may expand to http://None:<port>

When the user skips prompts and provides neither --vc_only_bn_address nor
CL_IP_ADDRESS in the .env, the else-branch builds:

_beaconnodeparameters = f'--beacon-nodes=http://{CL_IP_ADDRESS}:{CL_REST_PORT}'

If CL_IP_ADDRESS is unset, this yields an invalid URL and the validator client
exits immediately. Consider:

-if CL_IP_ADDRESS:
-    _beaconnodeparameters = f'--beacon-nodes=http://{CL_IP_ADDRESS}:{CL_REST_PORT}'
-else:
-    _beaconnodeparameters = '--beacon-nodes=http://127.0.0.1:5052'
+_beaconnodeparameters = (
+    f'--beacon-nodes=http://{CL_IP_ADDRESS}:{CL_REST_PORT}'
+    if CL_IP_ADDRESS
+    else '--beacon-nodes=http://127.0.0.1:5052'
+)

to ensure a valid default.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
install-lighthouse-reth.sh (1)

126-126: ⚠️ Potential issue

Guard against a failed cd command to avoid masking errors

The cd command can fail silently if the directory doesn't exist, causing subsequent commands to execute in the wrong directory.

Apply this change to handle errors properly:

-git clone https://github.com/coincashew/ethpillar.git ~/git/ethpillar 2> /dev/null || (cd ~/git/ethpillar ; git fetch origin main ; git checkout main ; git pull)
+git clone https://github.com/coincashew/ethpillar.git ~/git/ethpillar 2> /dev/null || (cd ~/git/ethpillar || exit 1 ; git fetch origin main ; git checkout main ; git pull)
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 126-126: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

deploy-lighthouse-reth.py (1)

14-36: 🛠️ Refactor suggestion

Prune unused and duplicate imports

Several modules are imported but never used, and there are duplicate imports that could cause confusion.

Clean up the imports section:

import os
import requests
import re
-import fnmatch
import random
import json
import tarfile
-import shutil
import subprocess
import tempfile
-import urllib.request
-import zipfile
-import random
import sys
import platform
-import tempfile
-import yaml
-from consolemenu import *
-from consolemenu.items import *
+from consolemenu import SelectionMenu, PromptUtils, Screen
+from consolemenu.items import FunctionItem
import argparse
-from dotenv import load_dotenv, dotenv_values
+from dotenv import load_dotenv
-from config import *
+# Import symbols from config explicitly
+from config import (
+    mainnet_sync_urls, holesky_sync_urls, hoodi_sync_urls,
+    sepolia_sync_urls, ephemery_sync_urls, mainnet_relay_options,
+    holesky_relay_options, hoodi_relay_options, sepolia_relay_options
+)
from tqdm import tqdm
🧰 Tools
🪛 Ruff (0.8.2)

17-17: fnmatch imported but unused

Remove unused import: fnmatch

(F401)


21-21: shutil imported but unused

Remove unused import: shutil

(F401)


24-24: urllib.request imported but unused

Remove unused import: urllib.request

(F401)


25-25: zipfile imported but unused

Remove unused import: zipfile

(F401)


26-26: Redefinition of unused random from line 18

Remove definition: random

(F811)


29-29: Redefinition of unused tempfile from line 23

Remove definition: tempfile

(F811)


30-30: yaml imported but unused

Remove unused import: yaml

(F401)


31-31: from consolemenu import * used; unable to detect undefined names

(F403)


32-32: from consolemenu.items import * used; unable to detect undefined names

(F403)


34-34: dotenv.dotenv_values imported but unused

Remove unused import: dotenv.dotenv_values

(F401)


35-35: from config import * used; unable to detect undefined names

(F403)

🧹 Nitpick comments (7)
install-lighthouse-reth.sh (2)

35-42: Fix parameter assignment in exit_on_error

The array assignment syntax uses ${@:2} which can cause issues with word splitting.

Consider using this improved version:

exit_on_error() {
    exit_code=$1
-    last_command="${@:2}"
+    shift
+    last_command="$*"
    if [ $exit_code -ne 0 ]; then
        >&2 echo "\"${last_command}\" command failed with exit code ${exit_code}."
        exit $exit_code
    fi
}
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 37-37: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)


72-76: Remove unused terminal color variables

The variables tty_underline and tty_red are defined but never used in the script.

Consider removing these unused variables or documenting why they are kept for future use:

tty_mkbold() { tty_escape "1;$1"; }
-tty_underline="$(tty_escape "4;39")"
tty_blue="$(tty_mkbold 34)"
-tty_red="$(tty_mkbold 31)"
tty_bold="$(tty_mkbold 39)"
tty_reset="$(tty_escape 0)"
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 72-72: tty_underline appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 74-74: tty_red appears unused. Verify use (or export if used externally).

(SC2034)

deploy-lighthouse-reth.py (5)

240-245: Simplify the beacon node address validation function

The validation function can be more concise.

Simplify the function:

def validate_beacon_node_address(ip_port):
    pattern = r"^(http|https|ws):\/\/((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:?\d{1,5})?$"
-    if re.match(pattern, ip_port):
-        return True
-    else:
-        return False
+    return bool(re.match(pattern, ip_port))
🧰 Tools
🪛 Ruff (0.8.2)

242-245: Return the condition bool(re.match(pattern, ip_port)) directly

Replace with return bool(re.match(pattern, ip_port))

(SIM103)


353-353: Use simplified boolean condition syntax

Instead of comparing boolean values to True or False, use the boolean values directly.

Apply this pattern throughout the code:

-if MEVBOOST_ENABLED == True and not VALIDATOR_ONLY:
+if MEVBOOST_ENABLED and not VALIDATOR_ONLY:

Also on lines 824, 854, and other similar instances.

🧰 Tools
🪛 Ruff (0.8.2)

353-353: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)


690-693: Use ternary operator for simpler boolean assignments

Several if-else blocks could be simplified using Python's ternary operator.

Simplify conditional assignments:

-if MEVBOOST_ENABLED:
-    _mevparameters='--builder http://127.0.0.1:18550'
-else:
-    _mevparameters=''
+_mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else ''

Apply similar simplifications for other ternary-convertible blocks on lines 735-738, 740-743, etc.

🧰 Tools
🪛 Ruff (0.8.2)

690-693: Use ternary operator _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else '' instead of if-else-block

Replace if-else-block with _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else ''

(SIM108)


751-757: Remove unused bootnodes variable in Ephemery network setup

The bootnodes variable is assigned but never used in this code block.

if eth_network=="ephemery":
    file_path = f"/opt/ethpillar/testnet/bootstrap_nodes.txt"
    with open(file_path, "r") as file:
-        bootnodes = ",".join(file.read().splitlines())
+        # This variable isn't used - remove or use it in _network
    _network=f"--testnet-dir=/opt/ethpillar/testnet"
else:
    _network=f"--network={eth_network}"
🧰 Tools
🪛 Ruff (0.8.2)

752-752: f-string without any placeholders

Remove extraneous f prefix

(F541)


754-754: Local variable bootnodes is assigned to but never used

Remove assignment to unused variable bootnodes

(F841)


755-755: f-string without any placeholders

Remove extraneous f prefix

(F541)


419-423: Remove unnecessary f-string prefixes

There are many f-strings without any expressions that could be simplified to regular strings.

For example:

-os.system(f"sudo mv mev-boost /usr/local/bin")
+os.system("sudo mv mev-boost /usr/local/bin")

-os.system(f"rm {tar_filename} LICENSE README.md")
+os.system(f"rm {tar_filename} LICENSE README.md")  # Keep this as f-string since it has a variable

Apply this change throughout the code where f-strings don't contain any expressions (lines 231, 252, 270, etc.).

🧰 Tools
🪛 Ruff (0.8.2)

420-420: f-string without any placeholders

Remove extraneous f prefix

(F541)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b55c80f and dc0f34b.

📒 Files selected for processing (3)
  • deploy-lighthouse-reth.py (1 hunks)
  • env (1 hunks)
  • install-lighthouse-reth.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • env
🧰 Additional context used
🧬 Code Graph Analysis (1)
install-lighthouse-reth.sh (1)
functions.sh (6)
  • tty_escape (39-39)
  • tty_escape (41-41)
  • tty_mkbold (43-43)
  • shell_join (50-58)
  • exit_on_error (28-35)
  • ohai (60-62)
🪛 Shellcheck (0.10.0)
install-lighthouse-reth.sh

[warning] 37-37: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)


[warning] 72-72: tty_underline appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 74-74: tty_red appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 126-126: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🪛 Ruff (0.8.2)
deploy-lighthouse-reth.py

17-17: fnmatch imported but unused

Remove unused import: fnmatch

(F401)


21-21: shutil imported but unused

Remove unused import: shutil

(F401)


24-24: urllib.request imported but unused

Remove unused import: urllib.request

(F401)


25-25: zipfile imported but unused

Remove unused import: zipfile

(F401)


26-26: Redefinition of unused random from line 18

Remove definition: random

(F811)


29-29: Redefinition of unused tempfile from line 23

Remove definition: tempfile

(F811)


30-30: yaml imported but unused

Remove unused import: yaml

(F401)


31-31: from consolemenu import * used; unable to detect undefined names

(F403)


32-32: from consolemenu.items import * used; unable to detect undefined names

(F403)


34-34: dotenv.dotenv_values imported but unused

Remove unused import: dotenv.dotenv_values

(F401)


35-35: from config import * used; unable to detect undefined names

(F403)


126-126: SelectionMenu may be undefined, or defined from star imports

(F405)


144-144: SelectionMenu may be undefined, or defined from star imports

(F405)


231-231: Screen may be undefined, or defined from star imports

(F405)


231-231: f-string without any placeholders

Remove extraneous f prefix

(F541)


242-245: Return the condition bool(re.match(pattern, ip_port)) directly

Replace with return bool(re.match(pattern, ip_port))

(SIM103)


252-252: Screen may be undefined, or defined from star imports

(F405)


252-252: f-string without any placeholders

Remove extraneous f prefix

(F541)


270-270: f-string without any placeholders

Remove extraneous f prefix

(F541)


273-273: PromptUtils may be undefined, or defined from star imports

(F405)


273-273: Screen may be undefined, or defined from star imports

(F405)


320-320: mainnet_sync_urls may be undefined, or defined from star imports

(F405)


322-322: holesky_sync_urls may be undefined, or defined from star imports

(F405)


324-324: sepolia_sync_urls may be undefined, or defined from star imports

(F405)


326-326: hoodi_sync_urls may be undefined, or defined from star imports

(F405)


328-328: ephemery_sync_urls may be undefined, or defined from star imports

(F405)


353-353: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)


420-420: f-string without any placeholders

Remove extraneous f prefix

(F541)


446-446: mainnet_relay_options may be undefined, or defined from star imports

(F405)


448-448: hoodi_relay_options may be undefined, or defined from star imports

(F405)


450-450: holesky_relay_options may be undefined, or defined from star imports

(F405)


452-452: sepolia_relay_options may be undefined, or defined from star imports

(F405)


545-545: f-string without any placeholders

Remove extraneous f prefix

(F541)


556-556: f-string without any placeholders

Remove extraneous f prefix

(F541)


626-627: Use a single if statement instead of nested if statements

(SIM102)


674-674: f-string without any placeholders

Remove extraneous f prefix

(F541)


690-693: Use ternary operator _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else '' instead of if-else-block

Replace if-else-block with _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else ''

(SIM108)


697-697: f-string without any placeholders

Remove extraneous f prefix

(F541)


735-738: Use ternary operator _mevparameters = '--builder-proposals' if MEVBOOST_ENABLED else '' instead of if-else-block

Replace if-else-block with _mevparameters = '--builder-proposals' if MEVBOOST_ENABLED else ''

(SIM108)


752-752: f-string without any placeholders

Remove extraneous f prefix

(F541)


754-754: Local variable bootnodes is assigned to but never used

Remove assignment to unused variable bootnodes

(F841)


755-755: f-string without any placeholders

Remove extraneous f prefix

(F541)


799-799: f-string without any placeholders

Remove extraneous f prefix

(F541)


800-800: f-string without any placeholders

Remove extraneous f prefix

(F541)


801-801: f-string without any placeholders

Remove extraneous f prefix

(F541)


822-822: f-string without any placeholders

Remove extraneous f prefix

(F541)


824-824: Avoid equality comparisons to False; use if not NODE_ONLY: for false checks

Replace with not NODE_ONLY

(E712)


827-827: f-string without any placeholders

Remove extraneous f prefix

(F541)


836-836: f-string without any placeholders

Remove extraneous f prefix

(F541)


841-841: PromptUtils may be undefined, or defined from star imports

(F405)


841-841: Screen may be undefined, or defined from star imports

(F405)


841-841: f-string without any placeholders

Remove extraneous f prefix

(F541)


843-843: f-string without any placeholders

Remove extraneous f prefix

(F541)


845-845: f-string without any placeholders

Remove extraneous f prefix

(F541)


848-848: PromptUtils may be undefined, or defined from star imports

(F405)


848-848: Screen may be undefined, or defined from star imports

(F405)


848-848: f-string without any placeholders

Remove extraneous f prefix

(F541)


851-851: f-string without any placeholders

Remove extraneous f prefix

(F541)


853-853: f-string without any placeholders

Remove extraneous f prefix

(F541)


854-854: Avoid equality comparisons to True; use if MEVBOOST_ENABLED: for truth checks

Replace with MEVBOOST_ENABLED

(E712)


855-855: f-string without any placeholders

Remove extraneous f prefix

(F541)


860-860: PromptUtils may be undefined, or defined from star imports

(F405)


860-860: Screen may be undefined, or defined from star imports

(F405)


868-868: f-string without any placeholders

Remove extraneous f prefix

(F541)


869-869: PromptUtils may be undefined, or defined from star imports

(F405)


869-869: Screen may be undefined, or defined from star imports

(F405)


869-869: f-string without any placeholders

Remove extraneous f prefix

(F541)


881-881: PromptUtils may be undefined, or defined from star imports

(F405)


881-881: Screen may be undefined, or defined from star imports

(F405)

🔇 Additional comments (12)
install-lighthouse-reth.sh (4)

115-115: Python installation commands properly quoted

The parameters are correctly quoted using curly braces (${python}) to avoid unbound-variable errors with set -u. This is a good practice that prevents bash errors when variables are expanded.


82-96: Approve architecture and OS checks

The requirements check function properly validates CPU architecture and operating system compatibility, with helpful error messages guiding users to supported configurations.


104-121: Approve Python installation function

The Python installation function properly handles both fresh installs and updates with appropriate error checking. The virtual environment setup and package installation are correctly implemented.


158-177: Approve final instructions and setup

The script provides clear instructions to the user about what was installed and how to start using the validator. The final message is well-formatted and helpful.

deploy-lighthouse-reth.py (8)

392-393: Approve fix for the previously undefined tar_filename variable

The tar_filename variable is now properly defined before it's used, fixing a potential runtime error that would have occurred during MEV-Boost installation.


404-417: Approve secure tar extraction with path traversal protection

The code correctly implements security checks when extracting the tar file, protecting against path traversal attacks which could otherwise be a serious security vulnerability.


486-491: Approve GitHub API integration for automatic version detection

The script correctly fetches the latest release information from GitHub's API and extracts the version tag, enabling automated installation of the most recent client versions.


759-765: Approve new validator directory structure and permissions

The lighthouse validator setup creates the proper directory structure at /var/lib/lighthouse_validator with restricted permissions (700) and appropriate user ownership, which is essential for secure key management.


565-566: Approve scaling of peer counts for Reth

The script halves the peer count for Reth which is a good practice to optimize resource usage, as Reth is known to be more resource-intensive with high peer counts.


567-586: Approve systemd service configuration for Reth

The systemd service file for Reth is well-configured with appropriate restart settings, permissions, and command-line parameters. The port configurations align with the environment variables, and jwt authentication is properly set up.


766-784: Approve Lighthouse validator service with proper security settings

The validator service configuration includes appropriate security settings, uses the correct data directory, and properly configures metrics and graffiti. The service is set up with the correct user and restart parameters.


858-865: Approve Lido CSM integration and key management workflow

The script smoothly integrates with Lido CSM staking by providing clear instructions to users and offering to launch the key management script at the appropriate time in the workflow.

🧰 Tools
🪛 Ruff (0.8.2)

860-860: PromptUtils may be undefined, or defined from star imports

(F405)


860-860: Screen may be undefined, or defined from star imports

(F405)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (2)
install-lighthouse-reth.sh (1)

123-127: Still missing a cd … || exit guard – identical to earlier review
The fallback path after a failed git clone can attempt cd ~/git/ethpillar even when the directory doesn’t exist, masking the real error.

-git clone https://github.com/coincashew/ethpillar.git ~/git/ethpillar 2> /dev/null || (cd ~/git/ethpillar ; git fetch origin main ; git checkout main ; git pull)
+git clone https://github.com/coincashew/ethpillar.git ~/git/ethpillar 2>/dev/null \
+  || (cd ~/git/ethpillar || exit 1 ; git fetch origin main ; git checkout main ; git pull)
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 126-126: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

deploy-lighthouse-reth.py (1)

14-37: 🛠️ Refactor suggestion

Prune unused & wildcard imports to unblock static analysis and cut startup time
Many of the imports are unused or duplicated (random, tempfile), and from … import * hides undefined-name errors.

-import fnmatch
-import random
-import json
-import tarfile
-import shutil
-import subprocess
-import tempfile
-import urllib.request
-import zipfile
-import random
-import sys
-import platform
-import tempfile
-import yaml
-from consolemenu import *
-from consolemenu.items import *
-import argparse
-from dotenv import load_dotenv, dotenv_values
-from config import *
-from tqdm import tqdm
+import argparse
+import json
+import os
+import platform
+import re
+import subprocess
+import sys
+import tarfile
+import tempfile
+
+import requests
+from consolemenu import SelectionMenu, PromptUtils, Screen
+from consolemenu.items import FunctionItem
+from dotenv import load_dotenv
+from tqdm import tqdm
+
+# Explicit symbols from config.py
+from config import (
+    mainnet_sync_urls,
+    holesky_sync_urls,
+    hoodi_sync_urls,
+    sepolia_sync_urls,
+    ephemery_sync_urls,
+    mainnet_relay_options,
+    holesky_relay_options,
+    hoodi_relay_options,
+    sepolia_relay_options,
+)

Benefits:
• Ruff / flake8 stop flagging ~40 errors.
• Start-up is faster and memory footprint smaller.
• Undefined names become visible.

🧰 Tools
🪛 Ruff (0.8.2)

17-17: fnmatch imported but unused

Remove unused import: fnmatch

(F401)


21-21: shutil imported but unused

Remove unused import: shutil

(F401)


24-24: urllib.request imported but unused

Remove unused import: urllib.request

(F401)


25-25: zipfile imported but unused

Remove unused import: zipfile

(F401)


26-26: Redefinition of unused random from line 18

Remove definition: random

(F811)


29-29: Redefinition of unused tempfile from line 23

Remove definition: tempfile

(F811)


30-30: yaml imported but unused

Remove unused import: yaml

(F401)


31-31: from consolemenu import * used; unable to detect undefined names

(F403)


32-32: from consolemenu.items import * used; unable to detect undefined names

(F403)


34-34: dotenv.dotenv_values imported but unused

Remove unused import: dotenv.dotenv_values

(F401)


35-35: from config import * used; unable to detect undefined names

(F403)

🧹 Nitpick comments (3)
install-lighthouse-reth.sh (1)

35-42: Handle $@ safely to avoid SC2124 and incorrect command echoing
last_command="${@:2}" stores an array into a scalar, which (a) triggers shellcheck SC2124 and (b) collapses arguments containing spaces. Prefer "${*:2}" (concatenate with word-splitting preserved) or quote-join the array.

-last_command="${@:2}"
+last_command="${*:2}"
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 37-37: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)

deploy-lighthouse-reth.py (2)

335-341: Avoid shell=True with a list argument and unquoted variable interpolation
subprocess.run([f'sudo mkdir -p $(dirname {JWTSECRET_PATH})'], shell=True) passes a list while shell=True expects a string. It also risks word-splitting if the path contains spaces.

-subprocess.run([f'sudo mkdir -p $(dirname {JWTSECRET_PATH})'], shell=True)
+subprocess.run(f"sudo mkdir -p \"$(dirname \"{JWTSECRET_PATH}\")\"", shell=True, check=True)

Using check=True immediately propagates errors.


741-749: String concatenation leaves leading spaces in command – minor but pollutes journal
When _feeparameters or _mevparameters are empty, the resulting string fed to systemd has doubled spaces. You can inline with conditional expressions to remove trailing blanks:

graffiti     = f"--graffiti={GRAFFITI}"
fee_param    = f"--suggested-fee-recipient={FEE_RECIPIENT_ADDRESS}" if FEE_RECIPIENT_ADDRESS else ""
mev_param    = "--builder-proposals" if MEVBOOST_ENABLED else ""
beacon_param = f"--beacon-nodes={BN_ADDRESS or f'http://{CL_IP_ADDRESS}:{CL_REST_PORT}'}"

ExecStart=/usr/local/bin/lighthouse vc {network} {graffiti} {beacon_param} {fee_param} {mev_param}

Cleaner service files aid troubleshooting.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc0f34b and 8592467.

📒 Files selected for processing (3)
  • deploy-lighthouse-reth.py (1 hunks)
  • env (1 hunks)
  • install-lighthouse-reth.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • env
🧰 Additional context used
🧬 Code Graph Analysis (1)
install-lighthouse-reth.sh (1)
functions.sh (6)
  • tty_escape (39-39)
  • tty_escape (41-41)
  • tty_mkbold (43-43)
  • shell_join (50-58)
  • exit_on_error (28-35)
  • ohai (60-62)
🪛 Ruff (0.8.2)
deploy-lighthouse-reth.py

17-17: fnmatch imported but unused

Remove unused import: fnmatch

(F401)


21-21: shutil imported but unused

Remove unused import: shutil

(F401)


24-24: urllib.request imported but unused

Remove unused import: urllib.request

(F401)


25-25: zipfile imported but unused

Remove unused import: zipfile

(F401)


26-26: Redefinition of unused random from line 18

Remove definition: random

(F811)


29-29: Redefinition of unused tempfile from line 23

Remove definition: tempfile

(F811)


30-30: yaml imported but unused

Remove unused import: yaml

(F401)


31-31: from consolemenu import * used; unable to detect undefined names

(F403)


32-32: from consolemenu.items import * used; unable to detect undefined names

(F403)


34-34: dotenv.dotenv_values imported but unused

Remove unused import: dotenv.dotenv_values

(F401)


35-35: from config import * used; unable to detect undefined names

(F403)


126-126: SelectionMenu may be undefined, or defined from star imports

(F405)


144-144: SelectionMenu may be undefined, or defined from star imports

(F405)


231-231: Screen may be undefined, or defined from star imports

(F405)


231-231: f-string without any placeholders

Remove extraneous f prefix

(F541)


242-245: Return the condition bool(re.match(pattern, ip_port)) directly

Replace with return bool(re.match(pattern, ip_port))

(SIM103)


252-252: Screen may be undefined, or defined from star imports

(F405)


252-252: f-string without any placeholders

Remove extraneous f prefix

(F541)


270-270: f-string without any placeholders

Remove extraneous f prefix

(F541)


273-273: PromptUtils may be undefined, or defined from star imports

(F405)


273-273: Screen may be undefined, or defined from star imports

(F405)


320-320: mainnet_sync_urls may be undefined, or defined from star imports

(F405)


322-322: holesky_sync_urls may be undefined, or defined from star imports

(F405)


324-324: sepolia_sync_urls may be undefined, or defined from star imports

(F405)


326-326: hoodi_sync_urls may be undefined, or defined from star imports

(F405)


328-328: ephemery_sync_urls may be undefined, or defined from star imports

(F405)


420-420: f-string without any placeholders

Remove extraneous f prefix

(F541)


446-446: mainnet_relay_options may be undefined, or defined from star imports

(F405)


448-448: hoodi_relay_options may be undefined, or defined from star imports

(F405)


450-450: holesky_relay_options may be undefined, or defined from star imports

(F405)


452-452: sepolia_relay_options may be undefined, or defined from star imports

(F405)


545-545: f-string without any placeholders

Remove extraneous f prefix

(F541)


556-556: f-string without any placeholders

Remove extraneous f prefix

(F541)


626-627: Use a single if statement instead of nested if statements

(SIM102)


674-674: f-string without any placeholders

Remove extraneous f prefix

(F541)


690-693: Use ternary operator _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else '' instead of if-else-block

Replace if-else-block with _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else ''

(SIM108)


697-697: f-string without any placeholders

Remove extraneous f prefix

(F541)


735-738: Use ternary operator _mevparameters = '--builder-proposals' if MEVBOOST_ENABLED else '' instead of if-else-block

Replace if-else-block with _mevparameters = '--builder-proposals' if MEVBOOST_ENABLED else ''

(SIM108)


752-752: f-string without any placeholders

Remove extraneous f prefix

(F541)


754-754: Local variable bootnodes is assigned to but never used

Remove assignment to unused variable bootnodes

(F841)


755-755: f-string without any placeholders

Remove extraneous f prefix

(F541)


799-799: f-string without any placeholders

Remove extraneous f prefix

(F541)


800-800: f-string without any placeholders

Remove extraneous f prefix

(F541)


801-801: f-string without any placeholders

Remove extraneous f prefix

(F541)


822-822: f-string without any placeholders

Remove extraneous f prefix

(F541)


824-824: Avoid equality comparisons to False; use if not NODE_ONLY: for false checks

Replace with not NODE_ONLY

(E712)


827-827: f-string without any placeholders

Remove extraneous f prefix

(F541)


836-836: f-string without any placeholders

Remove extraneous f prefix

(F541)


841-841: PromptUtils may be undefined, or defined from star imports

(F405)


841-841: Screen may be undefined, or defined from star imports

(F405)


841-841: f-string without any placeholders

Remove extraneous f prefix

(F541)


843-843: f-string without any placeholders

Remove extraneous f prefix

(F541)


845-845: f-string without any placeholders

Remove extraneous f prefix

(F541)


848-848: PromptUtils may be undefined, or defined from star imports

(F405)


848-848: Screen may be undefined, or defined from star imports

(F405)


848-848: f-string without any placeholders

Remove extraneous f prefix

(F541)


851-851: f-string without any placeholders

Remove extraneous f prefix

(F541)


853-853: f-string without any placeholders

Remove extraneous f prefix

(F541)


855-855: f-string without any placeholders

Remove extraneous f prefix

(F541)


860-860: PromptUtils may be undefined, or defined from star imports

(F405)


860-860: Screen may be undefined, or defined from star imports

(F405)


868-868: f-string without any placeholders

Remove extraneous f prefix

(F541)


869-869: PromptUtils may be undefined, or defined from star imports

(F405)


869-869: Screen may be undefined, or defined from star imports

(F405)


869-869: f-string without any placeholders

Remove extraneous f prefix

(F541)


881-881: PromptUtils may be undefined, or defined from star imports

(F405)


881-881: Screen may be undefined, or defined from star imports

(F405)

🪛 Shellcheck (0.10.0)
install-lighthouse-reth.sh

[warning] 37-37: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)


[warning] 72-72: tty_underline appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 74-74: tty_red appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 126-126: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (4)
install-lighthouse-reth.sh (1)

126-126: 🛠️ Refactor suggestion

Guard against cd failure when the clone falls back

When the first git clone attempt fails, the script tries to CD to the directory and update it. If the directory doesn't exist (for reasons other than "already cloned"), the CD command would fail silently and potentially mask the original error.

Apply this fix to make failures explicit:

-git clone https://github.com/coincashew/ethpillar.git ~/git/ethpillar 2> /dev/null || (cd ~/git/ethpillar ; git fetch origin main ; git checkout main ; git pull)
+git clone https://github.com/coincashew/ethpillar.git ~/git/ethpillar 2> /dev/null || (cd ~/git/ethpillar || exit 1 ; git fetch origin main ; git checkout main ; git pull)
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 126-126: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

deploy-lighthouse-reth.py (3)

124-137: ⚠️ Potential issue

Verify network parameter in non-interactive mode

If --skip_prompts is used without specifying a network, eth_network will be an empty string, causing problems later.

Add validation for required parameters:

if not args.network and not args.skip_prompts:
    # Ask the user for Ethereum network
    index = SelectionMenu.get_selection(valid_networks,title='Node Install Quickstart :: CoinCashew.com',subtitle='Installs Reth EL / Lighthouse BN / Lighthouse VC / MEVboost\nSelect Ethereum network:')

    # Exit selected
    if index == len(valid_networks):
        exit(0)

    # Set network
    eth_network=valid_networks[index]
    eth_network=eth_network.lower()
else:
    eth_network=args.network.lower()
+    # Validate network in non-interactive mode
+    if args.skip_prompts and not eth_network:
+        print("Error: --network is required when using --skip_prompts")
+        exit(1)
🧰 Tools
🪛 Ruff (0.8.2)

126-126: SelectionMenu may be undefined, or defined from star imports

(F405)


55-68: 🛠️ Refactor suggestion

Add defaults for environment variables to prevent None in service files

When environment variables are missing, os.getenv() returns None, which could end up in systemd service files as literal "None" strings, causing services to fail.

Add default values for critical parameters:

# Set options to parsed arguments
-EL_P2P_PORT=os.getenv('EL_P2P_PORT')
-EL_P2P_PORT_2=os.getenv('EL_P2P_PORT_2')
-EL_RPC_PORT=os.getenv('EL_RPC_PORT')
+EL_P2P_PORT=os.getenv('EL_P2P_PORT', '30303')
+EL_P2P_PORT_2=os.getenv('EL_P2P_PORT_2', '30304')
+EL_RPC_PORT=os.getenv('EL_RPC_PORT', '8551')
EL_MAX_PEER_COUNT=int(os.getenv('EL_MAX_PEER_COUNT', '50'))
-CL_P2P_PORT=os.getenv('CL_P2P_PORT')
-CL_P2P_PORT_2=os.getenv('CL_P2P_PORT_2')
-CL_REST_PORT=os.getenv('CL_REST_PORT')
-CL_MAX_PEER_COUNT=os.getenv('CL_MAX_PEER_COUNT')
-CL_IP_ADDRESS=os.getenv('CL_IP_ADDRESS')
-JWTSECRET_PATH=os.getenv('JWTSECRET_PATH')
-GRAFFITI=os.getenv('GRAFFITI')
+CL_P2P_PORT=os.getenv('CL_P2P_PORT', '9000')
+CL_P2P_PORT_2=os.getenv('CL_P2P_PORT_2', '9001')
+CL_REST_PORT=os.getenv('CL_REST_PORT', '5052')
+CL_MAX_PEER_COUNT=os.getenv('CL_MAX_PEER_COUNT', '50')
+CL_IP_ADDRESS=os.getenv('CL_IP_ADDRESS', '127.0.0.1')
+JWTSECRET_PATH=os.getenv('JWTSECRET_PATH', '/secrets/jwtsecret')
+GRAFFITI=os.getenv('GRAFFITI', 'ethPillar/coincashew')

17-35: 🛠️ Refactor suggestion

Prune unused and duplicate imports

Several modules are imported but never used, and wildcard imports make it difficult to trace where names are coming from.

Clean up imports for better maintainability:

import os
import requests
import re
-import fnmatch
import random
import json
import tarfile
-import shutil
import subprocess
import tempfile
-import urllib.request
-import zipfile
-import random
import sys
import platform
-import tempfile
-import yaml
-from consolemenu import *
-from consolemenu.items import *
+from consolemenu import SelectionMenu, PromptUtils, Screen
+from consolemenu.items import FunctionItem
import argparse
-from dotenv import load_dotenv, dotenv_values
-from config import *
+from dotenv import load_dotenv
+# Import specific names from config instead of using wildcard
+from config import (
+    mainnet_sync_urls, holesky_sync_urls, hoodi_sync_urls,
+    sepolia_sync_urls, ephemery_sync_urls, 
+    mainnet_relay_options, holesky_relay_options,
+    hoodi_relay_options, sepolia_relay_options
+)
from tqdm import tqdm
🧰 Tools
🪛 Ruff (0.8.2)

17-17: fnmatch imported but unused

Remove unused import: fnmatch

(F401)


21-21: shutil imported but unused

Remove unused import: shutil

(F401)


24-24: urllib.request imported but unused

Remove unused import: urllib.request

(F401)


25-25: zipfile imported but unused

Remove unused import: zipfile

(F401)


26-26: Redefinition of unused random from line 18

Remove definition: random

(F811)


29-29: Redefinition of unused tempfile from line 23

Remove definition: tempfile

(F811)


30-30: yaml imported but unused

Remove unused import: yaml

(F401)


31-31: from consolemenu import * used; unable to detect undefined names

(F403)


32-32: from consolemenu.items import * used; unable to detect undefined names

(F403)


34-34: dotenv.dotenv_values imported but unused

Remove unused import: dotenv.dotenv_values

(F401)


35-35: from config import * used; unable to detect undefined names

(F403)

🧹 Nitpick comments (5)
install-lighthouse-reth.sh (2)

72-74: Remove unused terminal formatting variables

These formatting variables are defined but never used in the script.

-tty_underline="$(tty_escape "4;39")"
-tty_red="$(tty_mkbold 31)"
+# Remove if unused or keep for potential future use
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 72-72: tty_underline appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 74-74: tty_red appears unused. Verify use (or export if used externally).

(SC2034)


37-37: Consider using the correct array assignment syntax

The current syntax assigns an array expansion to a string variable, which works but isn't ideal.

If you need the arguments as a string, be explicit:

-last_command="${@:2}"
+# Option 1: Keep as string, but be explicit
+last_command="$(printf '%s ' "${@:2}")"
+# Option 2: Use as array if you need to preserve argument structure
+last_command=("${@:2}")
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 37-37: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)

deploy-lighthouse-reth.py (3)

231-231: Remove unnecessary f-string prefixes

Several strings have an f prefix but don't contain any expressions to evaluate.

Remove unnecessary f prefixes from strings that don't use interpolation:

-    FEE_RECIPIENT_ADDRESS = Screen().input(f'Enter your Ethereum address (aka Fee Recipient Address)\n Hints: \n - Use ETH adddress from a hardware wallet.\n - Do not use an exchange address.\n > ')
+    FEE_RECIPIENT_ADDRESS = Screen().input('Enter your Ethereum address (aka Fee Recipient Address)\n Hints: \n - Use ETH adddress from a hardware wallet.\n - Do not use an exchange address.\n > ')

-        BN_ADDRESS = Screen().input(f'\nEnter your consensus client (beacon node) address.\nExample: http://192.168.1.123:5052\n > ')
+        BN_ADDRESS = Screen().input('\nEnter your consensus client (beacon node) address.\nExample: http://192.168.1.123:5052\n > ')

-    answer=PromptUtils(Screen()).prompt_for_yes_or_no(f'{message}')
+    answer=PromptUtils(Screen()).prompt_for_yes_or_no(message)

Also applies to: 252-252, 273-273

🧰 Tools
🪛 Ruff (0.8.2)

231-231: Screen may be undefined, or defined from star imports

(F405)


231-231: f-string without any placeholders

Remove extraneous f prefix

(F541)


690-693: Use ternary operators for cleaner conditional assignments

The code can be simplified using ternary operators where appropriate.

Simplify conditional assignments:

-        if MEVBOOST_ENABLED:
-            _mevparameters='--builder http://127.0.0.1:18550'
-        else:
-            _mevparameters=''
+        _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else ''

-    if MEVBOOST_ENABLED:
-        _mevparameters='--builder-proposals'
-    else:
-        _mevparameters=''
+    _mevparameters = '--builder-proposals' if MEVBOOST_ENABLED else ''

Also applies to: 735-738

🧰 Tools
🪛 Ruff (0.8.2)

690-693: Use ternary operator _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else '' instead of if-else-block

Replace if-else-block with _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else ''

(SIM108)


828-828: Use Pythonic boolean syntax

Using NODE_ONLY == False is less idiomatic than not NODE_ONLY.

-    if NODE_ONLY == False:
+    if not NODE_ONLY:
🧰 Tools
🪛 Ruff (0.8.2)

828-828: Avoid equality comparisons to False; use if not NODE_ONLY: for false checks

Replace with not NODE_ONLY

(E712)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8592467 and a98d3d0.

📒 Files selected for processing (3)
  • deploy-lighthouse-reth.py (1 hunks)
  • env (1 hunks)
  • install-lighthouse-reth.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • env
🧰 Additional context used
🪛 Ruff (0.8.2)
deploy-lighthouse-reth.py

17-17: fnmatch imported but unused

Remove unused import: fnmatch

(F401)


21-21: shutil imported but unused

Remove unused import: shutil

(F401)


24-24: urllib.request imported but unused

Remove unused import: urllib.request

(F401)


25-25: zipfile imported but unused

Remove unused import: zipfile

(F401)


26-26: Redefinition of unused random from line 18

Remove definition: random

(F811)


29-29: Redefinition of unused tempfile from line 23

Remove definition: tempfile

(F811)


30-30: yaml imported but unused

Remove unused import: yaml

(F401)


31-31: from consolemenu import * used; unable to detect undefined names

(F403)


32-32: from consolemenu.items import * used; unable to detect undefined names

(F403)


34-34: dotenv.dotenv_values imported but unused

Remove unused import: dotenv.dotenv_values

(F401)


35-35: from config import * used; unable to detect undefined names

(F403)


126-126: SelectionMenu may be undefined, or defined from star imports

(F405)


144-144: SelectionMenu may be undefined, or defined from star imports

(F405)


231-231: Screen may be undefined, or defined from star imports

(F405)


231-231: f-string without any placeholders

Remove extraneous f prefix

(F541)


242-245: Return the condition bool(re.match(pattern, ip_port)) directly

Replace with return bool(re.match(pattern, ip_port))

(SIM103)


252-252: Screen may be undefined, or defined from star imports

(F405)


252-252: f-string without any placeholders

Remove extraneous f prefix

(F541)


270-270: f-string without any placeholders

Remove extraneous f prefix

(F541)


273-273: PromptUtils may be undefined, or defined from star imports

(F405)


273-273: Screen may be undefined, or defined from star imports

(F405)


320-320: mainnet_sync_urls may be undefined, or defined from star imports

(F405)


322-322: holesky_sync_urls may be undefined, or defined from star imports

(F405)


324-324: sepolia_sync_urls may be undefined, or defined from star imports

(F405)


326-326: hoodi_sync_urls may be undefined, or defined from star imports

(F405)


328-328: ephemery_sync_urls may be undefined, or defined from star imports

(F405)


420-420: f-string without any placeholders

Remove extraneous f prefix

(F541)


446-446: mainnet_relay_options may be undefined, or defined from star imports

(F405)


448-448: hoodi_relay_options may be undefined, or defined from star imports

(F405)


450-450: holesky_relay_options may be undefined, or defined from star imports

(F405)


452-452: sepolia_relay_options may be undefined, or defined from star imports

(F405)


545-545: f-string without any placeholders

Remove extraneous f prefix

(F541)


556-556: f-string without any placeholders

Remove extraneous f prefix

(F541)


626-627: Use a single if statement instead of nested if statements

(SIM102)


674-674: f-string without any placeholders

Remove extraneous f prefix

(F541)


690-693: Use ternary operator _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else '' instead of if-else-block

Replace if-else-block with _mevparameters = '--builder http://127.0.0.1:18550' if MEVBOOST_ENABLED else ''

(SIM108)


697-697: f-string without any placeholders

Remove extraneous f prefix

(F541)


735-738: Use ternary operator _mevparameters = '--builder-proposals' if MEVBOOST_ENABLED else '' instead of if-else-block

Replace if-else-block with _mevparameters = '--builder-proposals' if MEVBOOST_ENABLED else ''

(SIM108)


756-756: f-string without any placeholders

Remove extraneous f prefix

(F541)


758-758: Local variable bootnodes is assigned to but never used

Remove assignment to unused variable bootnodes

(F841)


759-759: f-string without any placeholders

Remove extraneous f prefix

(F541)


803-803: f-string without any placeholders

Remove extraneous f prefix

(F541)


804-804: f-string without any placeholders

Remove extraneous f prefix

(F541)


805-805: f-string without any placeholders

Remove extraneous f prefix

(F541)


826-826: f-string without any placeholders

Remove extraneous f prefix

(F541)


828-828: Avoid equality comparisons to False; use if not NODE_ONLY: for false checks

Replace with not NODE_ONLY

(E712)


831-831: f-string without any placeholders

Remove extraneous f prefix

(F541)


840-840: f-string without any placeholders

Remove extraneous f prefix

(F541)


845-845: PromptUtils may be undefined, or defined from star imports

(F405)


845-845: Screen may be undefined, or defined from star imports

(F405)


845-845: f-string without any placeholders

Remove extraneous f prefix

(F541)


847-847: f-string without any placeholders

Remove extraneous f prefix

(F541)


849-849: f-string without any placeholders

Remove extraneous f prefix

(F541)


852-852: PromptUtils may be undefined, or defined from star imports

(F405)


852-852: Screen may be undefined, or defined from star imports

(F405)


852-852: f-string without any placeholders

Remove extraneous f prefix

(F541)


855-855: f-string without any placeholders

Remove extraneous f prefix

(F541)


857-857: f-string without any placeholders

Remove extraneous f prefix

(F541)


859-859: f-string without any placeholders

Remove extraneous f prefix

(F541)


864-864: PromptUtils may be undefined, or defined from star imports

(F405)


864-864: Screen may be undefined, or defined from star imports

(F405)


872-872: f-string without any placeholders

Remove extraneous f prefix

(F541)


873-873: PromptUtils may be undefined, or defined from star imports

(F405)


873-873: Screen may be undefined, or defined from star imports

(F405)


873-873: f-string without any placeholders

Remove extraneous f prefix

(F541)


885-885: PromptUtils may be undefined, or defined from star imports

(F405)


885-885: Screen may be undefined, or defined from star imports

(F405)

🪛 Shellcheck (0.10.0)
install-lighthouse-reth.sh

[warning] 37-37: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)


[warning] 72-72: tty_underline appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 74-74: tty_red appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 126-126: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant