charon-cluster

by Obol Labs

Helm chartv0.6.1App 1.11.3Apache-2.0Verified publisher

Charon is an open-source Ethereum Distributed validator middleware written in golang. This chart deploys a full Charon cluster.

About this chart

Charon Cluster

Charon is an open-source Ethereum Distributed validator middleware written in golang. This chart deploys a full Charon cluster.

Homepage: https://obol.tech/

Source Code

Values

KeyTypeDefaultDescription
affinityobject{}Affinity for pod assignment # ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity # # Example: # affinity: # podAntiAffinity: # requiredDuringSchedulingIgnoredDuringExecution: # - labelSelector: # matchExpressions: # - key: app.kubernetes.io/name # operator: In # values: # - charon # topologyKey: kubernetes.io/hostname #
centralMonitoringobject{"enabled":false,"promEndpoint":"https://vm.monitoring.gcp.obol.tech/write","token":""}Central Monitoring
centralMonitoring.enabledboolfalseSpecifies whether central monitoring should be enabled
centralMonitoring.promEndpointstring"https://vm.monitoring.gcp.obol.tech/write"https endpoint to obol central prometheus
centralMonitoring.tokenstring""The authentication token to the central prometheus
clusterSizeint4The number of charon nodes in the cluster. Minimum is 4
clusterThresholdint3Cluster threshold required for signature reconstruction. Defaults to ceil(n*2/3) if zero. Warning, non-default values decrease security.
config.LockFilestring"/charon/cluster-lock.json"The path to the cluster lock file defining distributed validator cluster. (default ".charon/cluster-lock.json")
config.beaconNodeEndpointsstring""Comma separated list of one or more beacon node endpoint URLs.
config.builderApistring""Enables the builder api. Will only produce builder blocks. Builder API must also be enabled on the validator client. Beacon node must be connected to a builder-relay to access the builder network.
config.directConnectionEnabledstring"true"If enabled, it will set p2pExternalHostname value to the pod name and enable direct connection between cluster nodes
config.featureSetstring"stable"Minimum feature set to enable by default: alpha, beta, or stable. Warning: modify at own risk. (default "stable")
config.featureSetDisablestring""Comma-separated list of features to disable, overriding the default minimum feature set.
config.featureSetEnablestring""Comma-separated list of features to enable, overriding the default minimum feature set.
config.jaegerAddressstring"jaeger:6831"Listening address for jaeger tracing.
config.jaegerServicestring""Service name used for jaeger tracing.
config.logFormatstring"json"Log format; console, logfmt or json (default "console")
config.logLevelstring"info"Log level; debug, info, warn or error (default "info")
config.lokiAddressesstring""Enables sending of logfmt structured logs to these Loki log aggregation server addresses. This is in addition to normal stderr logs.
config.lokiServicestring""Service label sent with logs to Loki.
config.monitoringAddressstring"0.0.0.0:3620"Listening address (ip and port) for the monitoring API (prometheus, pprof). (default "127.0.0.1:3620")
config.noVerifyboolfalseDisables cluster definition and lock file verification.
config.p2pAllowliststring""Comma-separated list of CIDR subnets for allowing only certain peer connections. Example: 192.168.0.0/16 would permit connections to peers on your local network only. The default is to accept all connections.
config.p2pDenyliststring""Comma-separated list of CIDR subnets for disallowing certain peer connections. Example: 192.168.0.0/16 would disallow connections to peers on your local network. The default is to accept all connections.
config.p2pDisableReuseportstring""Disables TCP port reuse for outgoing libp2p connections.
config.p2pExternalHostnamestring""The DNS hostname advertised by libp2p. This may be used to advertise an external DNS.
config.p2pExternalIpstring""The IP address advertised by libp2p. This may be used to advertise an external IP.
config.p2pRelaysstring""Comma-separated list of libp2p relay URLs or multiaddrs. (default [https://0.relay.obol.tech/enr])
config.p2pTcpAddressstring"0.0.0.0:3610"Comma-separated list of listening TCP addresses (ip and port) for libP2P traffic. Empty default doesn't bind to local port therefore only supports outgoing connections.
config.simnetBeaconMockstring""Enables an internal mock beacon node for running a simnet.
config.simnetValidatorKeysDirstring""The directory containing the simnet validator key shares. (default ".charon/validator_keys")
config.simnetValidatorMockstring""Enables an internal mock validator client when running a simnet. Requires simnet-beacon-mock.
config.syntheticBlockProposalsstring""Enables additional synthetic block proposal duties. Used for testing of rare duties.
config.validatorApiAddressstring"0.0.0.0:3600"Listening address (ip and port) for validator-facing traffic proxying the beacon-node API. (default "127.0.0.1:3600")
containerSecurityContextobjectSee values.yamlThe security context for containers
fullnameOverridestring""Provide a name to substitute for the full names of resources
imageobject{"pullPolicy":"IfNotPresent","repository":"obolnetwork/charon","tag":"v1.11.3"}Charon image repository, pull policy, and tag version
imagePullSecretslist[]Credentials to fetch images from private registry # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
livenessProbeobject{"enabled":false,"httpGet":{"path":"/livez"},"initialDelaySeconds":10,"periodSeconds":5}Configure liveness probes # ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
nameOverridestring""Provide a name in place of lighthouse for app: labels
nodeSelectorobject{}Node labels for pod assignment # ref: https://kubernetes.io/docs/user-guide/node-selection/
podAnnotationsobject{}Pod annotations
podDisruptionBudgetobject{"enabled":true,"minAvailable":""}Enable pod disruption budget # ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb
priorityClassNamestring""Used to assign priority to pods # ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
rbacobject{"clusterRules":[{"apiGroups":[""],"resources":["nodes"],"verbs":["get","list","watch"]}],"enabled":true,"name":"","rules":[{"apiGroups":[""],"resources":["services"],"verbs":["get","list","watch"]}]}RBAC configuration. # ref: https://kubernetes.io/docs/reference/access-authn-authz/rbac/
rbac.clusterRuleslist[{"apiGroups":[""],"resources":["nodes"],"verbs":["get","list","watch"]}]Required ClusterRole rules
rbac.clusterRules[0]object{"apiGroups":[""],"resources":["nodes"],"verbs":["get","list","watch"]}Required to obtain the nodes external IP
rbac.enabledbooltrueSpecifies whether RBAC resources are to be created
rbac.namestring""The name of the cluster role to use. If not set and create is true, a name is generated using the fullname template
rbac.ruleslist[{"apiGroups":[""],"resources":["services"],"verbs":["get","list","watch"]}]Required Role rules
rbac.rules[0]object{"apiGroups":[""],"resources":["services"],"verbs":["get","list","watch"]}Required to get information about the serices nodePort.
readinessProbeobject{"enabled":false,"httpGet":{"path":"/readyz"},"initialDelaySeconds":5,"periodSeconds":3}Configure readiness probes # ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
resourcesobject{}Pod resources limits and requests
secretsobject{"clusterlock":"cluster-lock","enrPrivateKey":"charon-enr-private-key","validatorKeys":"validators"}Kubernetes secrets names
secrets.clusterlockstring"cluster-lock"charon cluster lock
secrets.enrPrivateKeystring"charon-enr-private-key"charon enr private key
secrets.validatorKeysstring"validators"validators keys
securityContextobjectSee values.yamlThe security context for pods
serviceobject{"clusterIP":"None","ports":{"monitoring":{"name":"monitoring","port":3620,"protocol":"TCP","targetPort":3620},"p2pTcp":{"name":"p2p-tcp","port":3610,"protocol":"TCP","targetPort":3610},"validatorApi":{"name":"validator-api","port":3600,"protocol":"TCP","targetPort":3600}}}Charon service ports
service.clusterIPstring"None"Headless service to create DNS for each statefulset instance
serviceAccountobject{"annotations":{},"enabled":true,"name":""}Service account # ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.enabledbooltrueSpecifies whether a service account should be created
serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the default template
serviceMonitorobject{"annotations":{},"enabled":true,"interval":"1m","labels":{},"namespace":"","path":"/metrics","relabelings":[],"scheme":"http","scrapeTimeout":"30s","tlsConfig":{}}Prometheus Service Monitor # ref: https://github.com/coreos/prometheus-operator
serviceMonitor.annotationsobject{}Additional ServiceMonitor annotations
serviceMonitor.enabledbooltrueIf true, a ServiceMonitor CRD is created for a prometheus operator. https://github.com/coreos/prometheus-operator
serviceMonitor.intervalstring"1m"ServiceMonitor scrape interval
serviceMonitor.labelsobject{}Additional ServiceMonitor labels
serviceMonitor.namespacestring""Alternative namespace for ServiceMonitor
serviceMonitor.pathstring"/metrics"Path to scrape
serviceMonitor.relabelingslist[]ServiceMonitor relabelings
serviceMonitor.schemestring"http"ServiceMonitor scheme
serviceMonitor.scrapeTimeoutstring"30s"ServiceMonitor scrape timeout
serviceMonitor.tlsConfigobject{}ServiceMonitor TLS configuration
tolerationsobject{}Tolerations for pod assignment # ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
updateStrategystring"RollingUpdate"allows you to configure and disable automated rolling updates for containers, labels, resource request/limits, and annotations for the Pods in a StatefulSet.

How to use this chart

A distributed validator cluster is composed of the following containers:

  • Single execution layer client
  • Single consensus layer client
  • Number of Distributed Validator clients [This chart]
  • Number of Validator clients
  • Prometheus, Grafana and Jaeger clients for monitoring this cluster.

Prerequisites

You have the following charon artifacts created as k8s secrets per each charon node:

  • <cluster-name>-<node-index>-validators i.e charon-cluster-0-validators
  • <cluster-name>-<node-index>-charon-enr-private-key i.e charon-cluster-0-charon-enr-private-key The cluster lock is a single secret for the whole cluster:
  • cluster-lock

e.g. with node0:

kubectl create secret generic charon-enr-private-key --from-file=cluster/node0/charon-enr-private-key
kubectl create secret generic cluster-lock --from-file=node0/cluster-lock.json
kubectl create secret generic validator-keys --from-file=keystore-0.json=cluster/node0/validator_keys/keystore-0.json --from-file=keystore-0.txt=cluster/node0/validator_keys/keystore-0.txt

List of secrets for a cluster `charon-cluster` with 4 nodes are:
```console
charon-cluster-0-charon-enr-private-key
charon-cluster-0-validators
charon-cluster-1-charon-enr-private-key
charon-cluster-1-validators
charon-cluster-2-charon-enr-private-key
charon-cluster-2-validators
charon-cluster-3-charon-enr-private-key
charon-cluster-3-validators
cluster-lock

Add Obol's Helm Charts Repo

helm repo add obol https://obolnetwork.github.io/helm-charts
helm repo update

See helm repo for command documentation.

Install the chart

Install a charon cluster charon-cluster with 4 nodes:

helm upgrade --install charon-cluster obol/charon-cluster \
  --set='clusterSize=4' \
  --set='config.beaconNodeEndpoints=<BEACON_NODES_ENDPOINTS>' \
  --create-namespace \
  --namespace $CHARON_NODE_NAMESPACE

Connect the validator client

  • Update each validator client to connect to charon node API endpoint instead of the beacon node endpoint --beacon-node-api-endpoint="http://CHARON_NODE_SERVICE_NAME:3600"
  • Mount each of the <cluster-name>-<node-index>-validators k8s secrets to the validator client validators folder.

Example of a single teku deployment that pairs

Deploy charon-cluster with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has charon-cluster on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcharon-cluster is pinned at v0.6.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply