diff --git a/shared/services/config/rocket-pool-config.go b/shared/services/config/rocket-pool-config.go index 179af9cfc..753f47813 100644 --- a/shared/services/config/rocket-pool-config.go +++ b/shared/services/config/rocket-pool-config.go @@ -1383,6 +1383,14 @@ func (cfg *RocketPoolConfig) GetMevBoostOpenPorts() string { return fmt.Sprintf("\"%s\"", portMode.DockerPortMapping(port)) } +// Used by text/template to select an entrypoint based on which consensus client is used. +func (cfg *RocketPoolConfig) GetEth2Entrypoint() string { + if client, _ := cfg.GetSelectedConsensusClient(); client == config.ConsensusClient_Prysm { + return "bash" + } + return "sh" +} + // The title for the config func (cfg *RocketPoolConfig) GetConfigTitle() string { return cfg.Title diff --git a/shared/services/rocketpool/assets/install/templates/eth2.tmpl b/shared/services/rocketpool/assets/install/templates/eth2.tmpl index 1852ec903..9187c59c3 100644 --- a/shared/services/rocketpool/assets/install/templates/eth2.tmpl +++ b/shared/services/rocketpool/assets/install/templates/eth2.tmpl @@ -94,11 +94,9 @@ services: - dac_override security_opt: - no-new-privileges - {{- if ne .ConsensusClient.String "prysm"}} - entrypoint: sh - {{- else}} - {{- /* prysm has bash but not sh and may need us to download genesis for testnets */}} - entrypoint: bash + entrypoint: {{ .GetEth2Entrypoint }} + {{- if eq .ConsensusClient.String "prysm"}} + {{- /* prysm may need us to download genesis for testnets */}} depends_on: eth2_genesis_downloader: condition: service_completed_successfully diff --git a/shared/services/rocketpool/assets/install/templates/validator.tmpl b/shared/services/rocketpool/assets/install/templates/validator.tmpl index d4f98608e..75a1bd1a3 100644 --- a/shared/services/rocketpool/assets/install/templates/validator.tmpl +++ b/shared/services/rocketpool/assets/install/templates/validator.tmpl @@ -45,11 +45,7 @@ services: {{- if eq .ConsensusClient.String "teku"}} - TEKU_USE_SLASHING_PROTECTION={{.Teku.UseSlashingProtection}} {{- end}} - {{- if eq .ConsensusClient.String "prysm"}} - entrypoint: bash - {{- else}} - entrypoint: sh - {{- end}} + entrypoint: {{ .GetEth2Entrypoint }} command: "/setup/start-vc.sh" cap_drop: - all