Skip to content

Commit

Permalink
Lido CSM - add Validator Client Only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
coincashew committed Oct 20, 2024
1 parent bbee77b commit 69e2354
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 10 deletions.
24 changes: 20 additions & 4 deletions deploy-nimbus-nethermind.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def clear_screen():
valid_networks = ['MAINNET', 'HOLESKY', 'SEPOLIA']
valid_exec_clients = ['NETHERMIND']
valid_consensus_clients = ['NIMBUS']
valid_install_configs = ['Solo Staking Node', 'Full Node Only', 'Lido CSM Staking Node', 'Validator Client Only', 'Failover Staking Node']
valid_install_configs = ['Solo Staking Node', 'Full Node Only', 'Lido CSM Staking Node', 'Lido CSM Validator Client Only' ,'Validator Client Only', 'Failover Staking Node']

# Load environment variables from env file
load_dotenv("env")
Expand Down Expand Up @@ -173,6 +173,22 @@ def get_computer_platform():
exit(1)
GRAFFITI=CSM_GRAFFITI
MEV_MIN_BID=CSM_MEV_MIN_BID
case "Lido CSM Validator Client Only":
NODE_ONLY=False
MEVBOOST_ENABLED=True
VALIDATOR_ENABLED=True
VALIDATOR_ONLY=True
if eth_network == "mainnet":
FEE_RECIPIENT_ADDRESS=CSM_FEE_RECIPIENT_ADDRESS_MAINNET
CSM_WITHDRAWAL_ADDRESS=CSM_WITHDRAWAL_ADDRESS_MAINNET
elif eth_network == "holesky":
FEE_RECIPIENT_ADDRESS=CSM_FEE_RECIPIENT_ADDRESS_HOLESKY
CSM_WITHDRAWAL_ADDRESS=CSM_WITHDRAWAL_ADDRESS_HOLESKY
else:
print(f'Unsupported Lido CSM Staking Node network: {eth_network}')
exit(1)
GRAFFITI=CSM_GRAFFITI
MEV_MIN_BID=CSM_MEV_MIN_BID
case "Validator Client Only":
NODE_ONLY=False
MEVBOOST_ENABLED=True
Expand Down Expand Up @@ -245,7 +261,7 @@ def validate_beacon_node_address(ip_port):
message=f'\nConfirmation: Verify your settings\n\nNetwork: {eth_network.upper()}\nInstallation configuration: {install_config}\nFee Recipient Address: {FEE_RECIPIENT_ADDRESS}\n\nIs this correct?'
elif install_config == "Full Node Only":
message=f'\nConfirmation: Verify your settings\n\nNetwork: {eth_network.upper()}\nInstallation configuration: {install_config}\n\nIs this correct?'
elif install_config == "Validator Client Only":
elif install_config == "Validator Client Only" or install_config == "Lido CSM Validator Client Only" :
message=f'\nConfirmation: Verify your settings\n\nNetwork: {eth_network.upper()}\nInstallation configuration: {install_config}\nConsensus client (beacon node) address: {BN_ADDRESS}\n\nIs this correct?'
else:
print(f"\nError: Unknown install_config")
Expand Down Expand Up @@ -761,7 +777,7 @@ def finish_install():
os.system(f'sudo systemctl enable mevboost')

# Ask CSM staker if they to manage validator keystores
if install_config == 'Lido CSM Staking Node':
if install_config == 'Lido CSM Staking Node' or install_config == 'Lido CSM Validator Client Only':
answer=PromptUtils(Screen()).prompt_for_yes_or_no(f"\nWould you like to generate or import new Lido CSM validator keys now?\nReminder: Set the Lido withdrawal address to: {CSM_WITHDRAWAL_ADDRESS}")
if answer:
os.chdir(os.path.expanduser("~/git/ethpillar"))
Expand All @@ -781,7 +797,7 @@ def finish_install():
print(f'\nReminder for Failover Staking Node configurations:\n1. Consensus Client: Expose consensus client RPC port\n2. UFW Firewall: Update to allow incoming traffic on port {CL_REST_PORT}\n3. UFW firewall: Whitelist the validator(s) IP address.')

# Validator Client Only overrides
if install_config == 'Validator Client Only':
if install_config == 'Validator Client Only' or install_config == 'Lido CSM Validator Client Only':
answer=PromptUtils(Screen()).prompt_for_yes_or_no(f"Would you like update your EL/CL override settings now?\nYour validator client needs to know EL/CL settings.\nIf not, update later at\nEthPillar > System Administration > Override environment variables.")
if answer:
command = ['nano', '~/git/ethpillar/.env.overrides']
Expand Down
27 changes: 23 additions & 4 deletions deploy-teku-besu.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def clear_screen():
valid_networks = ['MAINNET', 'HOLESKY', 'SEPOLIA', 'EPHEMERY']
valid_exec_clients = ['BESU']
valid_consensus_clients = ['TEKU']
valid_install_configs = ['Solo Staking Node', 'Full Node Only', 'Lido CSM Staking Node', 'Validator Client Only', 'Failover Staking Node']
valid_install_configs = ['Solo Staking Node', 'Full Node Only', 'Lido CSM Staking Node', 'Lido CSM Validator Client Only', 'Validator Client Only', 'Failover Staking Node']

# Load environment variables from env file
load_dotenv("env")
Expand Down Expand Up @@ -174,6 +174,25 @@ def get_computer_platform():
exit(1)
GRAFFITI=CSM_GRAFFITI
MEV_MIN_BID=CSM_MEV_MIN_BID
case "Lido CSM Validator Client Only":
NODE_ONLY=False
MEVBOOST_ENABLED=True
VALIDATOR_ENABLED=True
VALIDATOR_ONLY=True
if eth_network == "mainnet":
FEE_RECIPIENT_ADDRESS=CSM_FEE_RECIPIENT_ADDRESS_MAINNET
CSM_WITHDRAWAL_ADDRESS=CSM_WITHDRAWAL_ADDRESS_MAINNET
elif eth_network == "holesky":
FEE_RECIPIENT_ADDRESS=CSM_FEE_RECIPIENT_ADDRESS_HOLESKY
CSM_WITHDRAWAL_ADDRESS=CSM_WITHDRAWAL_ADDRESS_HOLESKY
elif eth_network == "ephemery":
FEE_RECIPIENT_ADDRESS=CSM_FEE_RECIPIENT_ADDRESS_HOLESKY
CSM_WITHDRAWAL_ADDRESS=CSM_WITHDRAWAL_ADDRESS_HOLESKY
else:
print(f'Unsupported Lido CSM Staking Node network: {eth_network}')
exit(1)
GRAFFITI=CSM_GRAFFITI
MEV_MIN_BID=CSM_MEV_MIN_BID
case "Validator Client Only":
NODE_ONLY=False
MEVBOOST_ENABLED=True
Expand Down Expand Up @@ -250,7 +269,7 @@ def validate_beacon_node_address(ip_port):
message=f'\nConfirmation: Verify your settings\n\nNetwork: {eth_network.upper()}\nInstallation configuration: {install_config}\nFee Recipient Address: {FEE_RECIPIENT_ADDRESS}\n\nIs this correct?'
elif install_config == "Full Node Only":
message=f'\nConfirmation: Verify your settings\n\nNetwork: {eth_network.upper()}\nInstallation configuration: {install_config}\n\nIs this correct?'
elif install_config == "Validator Client Only":
elif install_config == "Validator Client Only" or install_config == "Lido CSM Validator Client Only":
message=f'\nConfirmation: Verify your settings\n\nNetwork: {eth_network.upper()}\nInstallation configuration: {install_config}\nConsensus client (beacon node) address: {BN_ADDRESS}\n\nIs this correct?'
else:
print(f"\nError: Unknown install_config")
Expand Down Expand Up @@ -736,7 +755,7 @@ def finish_install():
os.system(f'sudo systemctl enable mevboost')

# Ask CSM staker if they to manage validator keystores
if install_config == 'Lido CSM Staking Node':
if install_config == 'Lido CSM Staking Node' or install_config == "Lido CSM Validator Client Only":
answer=PromptUtils(Screen()).prompt_for_yes_or_no(f"\nWould you like to generate or import new Lido CSM validator keys now?\nReminder: Set the Lido withdrawal address to: {CSM_WITHDRAWAL_ADDRESS}")
if answer:
os.chdir(os.path.expanduser("~/git/ethpillar"))
Expand All @@ -756,7 +775,7 @@ def finish_install():
print(f'\nReminder for Failover Staking Node configurations:\n1. Consensus Client: Expose consensus client RPC port\n2. UFW Firewall: Update to allow incoming traffic on port {CL_REST_PORT}\n3. UFW firewall: Whitelist the validator(s) IP address.')

# Validator Client Only overrides
if install_config == 'Validator Client Only':
if install_config == 'Validator Client Only' or install_config == "Lido CSM Validator Client Only":
answer=PromptUtils(Screen()).prompt_for_yes_or_no(f"Would you like update your EL/CL override settings now?\nYour validator client needs to know EL/CL settings.\nIf not, update later at\nEthPillar > System Administration > Override environment variables.")
if answer:
command = ['nano', '~/git/ethpillar/.env.overrides']
Expand Down
8 changes: 6 additions & 2 deletions ethpillar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# 🙌 Ask questions on Discord:
# * https://discord.gg/dEpAVWgFNB

EP_VERSION="2.2.3"
EP_VERSION="2.3.0"

# VARIABLES
export BASE_DIR="$HOME/git/ethpillar" && cd $BASE_DIR
Expand Down Expand Up @@ -1072,7 +1072,11 @@ function setNodeMode(){
elif [[ -f /etc/systemd/system/execution.service ]] && [[ -f /etc/systemd/system/consensus.service ]]; then
NODE_MODE="Full Node Only"
elif [[ -f /etc/systemd/system/validator.service ]]; then
NODE_MODE="Validator Client Only"
if [[ $(grep --ignore-case -oE "${CSM_FEE_RECIPIENT_ADDRESS_MAINNET}" /etc/systemd/system/validator.service) || $(grep --ignore-case -oE "${CSM_FEE_RECIPIENT_ADDRESS_HOLESKY}" /etc/systemd/system/validator.service) ]]; then
NODE_MODE="Lido CSM Validator Client Only"
else
NODE_MODE="Validator Client Only"
fi
else
NODE_MODE="Not Installed"
fi
Expand Down

0 comments on commit 69e2354

Please sign in to comment.