Commit c2af1437 authored by Luca | Serenita's avatar Luca | Serenita Committed by GitHub

feat: add vero `vc_type` (#827)

Adds the Vero validator client as a supported `vc_type`.

The Vero VC doesn't handle keys and requires a remote signer to be used
(`use_remote_signer: true`). It can handle the minimal preset, as well
as custom `seconds_per_slot` values.

I've added the "Vero - Detailed" Grafana dashboard. I'm not sure if it's
a good fit for this repo, let me know if you'd like me to remove it.

---------
Co-authored-by: default avatarBarnabas Busa <barnabas.busa@ethereum.org>
parent 28717036
participants:
- el_type: besu
cl_type: grandine
use_separate_vc: true
vc_type: vero
use_remote_signer: true
- el_type: erigon
cl_type: lighthouse
use_separate_vc: true
vc_type: vero
use_remote_signer: true
- el_type: ethereumjs
cl_type: lodestar
use_separate_vc: true
vc_type: vero
use_remote_signer: true
- el_type: geth
cl_type: nimbus
use_separate_vc: true
vc_type: vero
use_remote_signer: true
- el_type: nethermind
cl_type: prysm
use_separate_vc: true
vc_type: vero
use_remote_signer: true
- el_type: reth
cl_type: teku
use_separate_vc: true
vc_type: vero
use_remote_signer: true
...@@ -289,7 +289,7 @@ participants: ...@@ -289,7 +289,7 @@ participants:
# VC (Validator Client) Specific flags # VC (Validator Client) Specific flags
# The type of validator client that should be used # The type of validator client that should be used
# Valid values are nimbus, lighthouse, lodestar, teku, and prysm # Valid values are nimbus, lighthouse, lodestar, teku, prysm and vero
# ( The prysm validator only works with a prysm CL client ) # ( The prysm validator only works with a prysm CL client )
# Defaults to matching the chosen CL client (cl_type) # Defaults to matching the chosen CL client (cl_type)
vc_type: "" vc_type: ""
...@@ -301,6 +301,7 @@ participants: ...@@ -301,6 +301,7 @@ participants:
# - nimbus: statusim/nimbus-validator-client:multiarch-latest # - nimbus: statusim/nimbus-validator-client:multiarch-latest
# - prysm: gcr.io/prysmaticlabs/prysm/validator:latest # - prysm: gcr.io/prysmaticlabs/prysm/validator:latest
# - teku: consensys/teku:latest # - teku: consensys/teku:latest
# - vero: ghcr.io/serenita-org/vero:master
vc_image: "" vc_image: ""
# The number of validator clients to run for this participant # The number of validator clients to run for this participant
......
...@@ -24,6 +24,7 @@ VC_TYPE = struct( ...@@ -24,6 +24,7 @@ VC_TYPE = struct(
nimbus="nimbus", nimbus="nimbus",
prysm="prysm", prysm="prysm",
teku="teku", teku="teku",
vero="vero",
) )
REMOTE_SIGNER_TYPE = struct(web3signer="web3signer") REMOTE_SIGNER_TYPE = struct(web3signer="web3signer")
......
...@@ -41,6 +41,7 @@ DEFAULT_VC_IMAGES = { ...@@ -41,6 +41,7 @@ DEFAULT_VC_IMAGES = {
"prysm": "gcr.io/prysmaticlabs/prysm/validator:stable", "prysm": "gcr.io/prysmaticlabs/prysm/validator:stable",
"teku": "consensys/teku:latest", "teku": "consensys/teku:latest",
"grandine": "sifrai/grandine:stable", "grandine": "sifrai/grandine:stable",
"vero": "ghcr.io/serenita-org/vero:master",
} }
DEFAULT_VC_IMAGES_MINIMAL = { DEFAULT_VC_IMAGES_MINIMAL = {
...@@ -50,6 +51,7 @@ DEFAULT_VC_IMAGES_MINIMAL = { ...@@ -50,6 +51,7 @@ DEFAULT_VC_IMAGES_MINIMAL = {
"prysm": "ethpandaops/prysm-validator:develop-minimal", "prysm": "ethpandaops/prysm-validator:develop-minimal",
"teku": "consensys/teku:latest", "teku": "consensys/teku:latest",
"grandine": "ethpandaops/grandine:develop-minimal", "grandine": "ethpandaops/grandine:develop-minimal",
"vero": "ghcr.io/serenita-org/vero:master",
} }
DEFAULT_REMOTE_SIGNER_IMAGES = { DEFAULT_REMOTE_SIGNER_IMAGES = {
...@@ -1201,6 +1203,9 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ ...@@ -1201,6 +1203,9 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ
if participant["cl_type"] == "grandine": if participant["cl_type"] == "grandine":
participant["cl_extra_params"].append("--builder-url={0}".format(mev_url)) participant["cl_extra_params"].append("--builder-url={0}".format(mev_url))
if participant["vc_type"] == "vero":
participant["vc_extra_params"].append("--use-external-builder")
num_participants = len(parsed_arguments_dict["participants"]) num_participants = len(parsed_arguments_dict["participants"])
index_str = shared_utils.zfill_custom( index_str = shared_utils.zfill_custom(
num_participants + 1, len(str(num_participants + 1)) num_participants + 1, len(str(num_participants + 1))
......
...@@ -117,7 +117,7 @@ def get_config( ...@@ -117,7 +117,7 @@ def get_config(
"files": files, "files": files,
"env_vars": env, "env_vars": env,
"labels": shared_utils.label_maker( "labels": shared_utils.label_maker(
client=constants.CL_TYPE.lighthouse, client=constants.VC_TYPE.lighthouse,
client_type=constants.CLIENT_TYPES.validator, client_type=constants.CLIENT_TYPES.validator,
image=image, image=image,
connected_client=cl_context.client_name, connected_client=cl_context.client_name,
......
...@@ -133,7 +133,7 @@ def get_config( ...@@ -133,7 +133,7 @@ def get_config(
"files": files, "files": files,
"env_vars": env_vars, "env_vars": env_vars,
"labels": shared_utils.label_maker( "labels": shared_utils.label_maker(
client=constants.CL_TYPE.lodestar, client=constants.VC_TYPE.lodestar,
client_type=constants.CLIENT_TYPES.validator, client_type=constants.CLIENT_TYPES.validator,
image=image, image=image,
connected_client=cl_context.client_name, connected_client=cl_context.client_name,
......
...@@ -105,7 +105,7 @@ def get_config( ...@@ -105,7 +105,7 @@ def get_config(
"files": files, "files": files,
"env_vars": participant.vc_extra_env_vars, "env_vars": participant.vc_extra_env_vars,
"labels": shared_utils.label_maker( "labels": shared_utils.label_maker(
client=constants.CL_TYPE.nimbus, client=constants.VC_TYPE.nimbus,
client_type=constants.CLIENT_TYPES.validator, client_type=constants.CLIENT_TYPES.validator,
image=image, image=image,
connected_client=cl_context.client_name, connected_client=cl_context.client_name,
......
...@@ -123,7 +123,7 @@ def get_config( ...@@ -123,7 +123,7 @@ def get_config(
"files": files, "files": files,
"env_vars": participant.vc_extra_env_vars, "env_vars": participant.vc_extra_env_vars,
"labels": shared_utils.label_maker( "labels": shared_utils.label_maker(
client=constants.CL_TYPE.prysm, client=constants.VC_TYPE.prysm,
client_type=constants.CLIENT_TYPES.validator, client_type=constants.CLIENT_TYPES.validator,
image=image, image=image,
connected_client=cl_context.client_name, connected_client=cl_context.client_name,
......
...@@ -119,7 +119,7 @@ def get_config( ...@@ -119,7 +119,7 @@ def get_config(
"files": files, "files": files,
"env_vars": participant.vc_extra_env_vars, "env_vars": participant.vc_extra_env_vars,
"labels": shared_utils.label_maker( "labels": shared_utils.label_maker(
client=constants.CL_TYPE.teku, client=constants.VC_TYPE.teku,
client_type=constants.CLIENT_TYPES.validator, client_type=constants.CLIENT_TYPES.validator,
image=image, image=image,
connected_client=cl_context.client_name, connected_client=cl_context.client_name,
......
...@@ -8,6 +8,7 @@ lodestar = import_module("./lodestar.star") ...@@ -8,6 +8,7 @@ lodestar = import_module("./lodestar.star")
nimbus = import_module("./nimbus.star") nimbus = import_module("./nimbus.star")
prysm = import_module("./prysm.star") prysm = import_module("./prysm.star")
teku = import_module("./teku.star") teku = import_module("./teku.star")
vero = import_module("./vero.star")
vc_shared = import_module("./shared.star") vc_shared = import_module("./shared.star")
shared_utils = import_module("../shared_utils/shared_utils.star") shared_utils = import_module("../shared_utils/shared_utils.star")
...@@ -151,6 +152,24 @@ def launch( ...@@ -151,6 +152,24 @@ def launch(
port_publisher=port_publisher, port_publisher=port_publisher,
vc_index=vc_index, vc_index=vc_index,
) )
elif vc_type == constants.VC_TYPE.vero:
if remote_signer_context == None:
fail("vero VC requires `use_remote_signer` to be true")
if keymanager_enabled:
fail("vero VC doesn't support the Keymanager API")
config = vero.get_config(
participant=participant,
image=image,
global_log_level=global_log_level,
beacon_http_url=beacon_http_url,
cl_context=cl_context,
remote_signer_context=remote_signer_context,
full_name=full_name,
tolerations=tolerations,
node_selectors=node_selectors,
port_publisher=port_publisher,
vc_index=vc_index,
)
elif vc_type == constants.VC_TYPE.grandine: elif vc_type == constants.VC_TYPE.grandine:
fail("Grandine VC is not yet supported") fail("Grandine VC is not yet supported")
else: else:
......
constants = import_module("../package_io/constants.star")
input_parser = import_module("../package_io/input_parser.star")
shared_utils = import_module("../shared_utils/shared_utils.star")
vc_shared = import_module("./shared.star")
VERBOSITY_LEVELS = {
constants.GLOBAL_LOG_LEVEL.error: "ERROR",
constants.GLOBAL_LOG_LEVEL.warn: "WARNING",
constants.GLOBAL_LOG_LEVEL.info: "INFO",
constants.GLOBAL_LOG_LEVEL.debug: "DEBUG",
}
def get_config(
participant,
image,
global_log_level,
beacon_http_url,
cl_context,
remote_signer_context,
full_name,
tolerations,
node_selectors,
port_publisher,
vc_index,
):
log_level = input_parser.get_client_log_level_or_default(
participant.vc_log_level, global_log_level, VERBOSITY_LEVELS
)
cmd = [
"--remote-signer-url={0}".format(remote_signer_context.http_url),
"--beacon-node-urls=" + beacon_http_url,
"--fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT,
"--graffiti=" + full_name,
"--metrics-address=0.0.0.0",
"--metrics-port={0}".format(vc_shared.VALIDATOR_CLIENT_METRICS_PORT_NUM),
"--log-level=" + log_level,
]
if len(participant.vc_extra_params) > 0:
# this is a repeated<proto type>, we convert it into Starlark
cmd.extend([param for param in participant.vc_extra_params])
public_ports = {}
if port_publisher.vc_enabled:
public_ports_for_component = shared_utils.get_public_ports_for_component(
"vc", port_publisher, vc_index
)
public_port_assignments = {
constants.METRICS_PORT_ID: public_ports_for_component[0]
}
public_ports = shared_utils.get_port_specs(public_port_assignments)
ports = {}
ports.update(vc_shared.VALIDATOR_CLIENT_USED_PORTS)
config_args = {
"image": image,
"ports": ports,
"public_ports": public_ports,
"cmd": cmd,
"env_vars": participant.vc_extra_env_vars,
"labels": shared_utils.label_maker(
client=constants.VC_TYPE.vero,
client_type=constants.CLIENT_TYPES.validator,
image=image,
connected_client=cl_context.client_name,
extra_labels=participant.vc_extra_labels,
supernode=participant.supernode,
),
"tolerations": tolerations,
"node_selectors": node_selectors,
}
if participant.vc_min_cpu > 0:
config_args["min_cpu"] = participant.vc_min_cpu
if participant.vc_max_cpu > 0:
config_args["max_cpu"] = participant.vc_max_cpu
if participant.vc_min_mem > 0:
config_args["min_memory"] = participant.vc_min_mem
if participant.vc_max_mem > 0:
config_args["max_memory"] = participant.vc_max_mem
return ServiceConfig(**config_args)
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment