Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/tests/mix-public.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ additional_services:
- tx_fuzz
- forkmon
- dora
- checkpointz
- prometheus
- grafana
- dugtrio
Expand Down
1 change: 1 addition & 0 deletions .github/tests/mix-with-tools-mev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ additional_services:
- tx_fuzz
- forkmon
- dora
- checkpointz
- prometheus
- grafana
- custom_flood
Expand Down
1 change: 1 addition & 0 deletions .github/tests/mix-with-tools-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ additional_services:
- tx_fuzz
- forkmon
- dora
- checkpointz
- prometheus
- grafana
- custom_flood
Expand Down
1 change: 1 addition & 0 deletions .github/tests/mix-with-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ additional_services:
- tx_fuzz
- forkmon
- dora
- checkpointz
- prometheus
- grafana
- dugtrio
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ additional_services:
- blockscout
- blutgang
- broadcaster
- checkpointz
- custom_flood
- dora
- dugtrio
Expand Down Expand Up @@ -851,6 +852,12 @@ dora_params:
# A list of optional extra env_vars the dora container should spin up with
env: {}

# Configuration place for checkpointz - https://github.com/ethpandaops/checkpointz
checkpointz_params:
# Checkpointz docker image to use
# Defaults to the latest image
image: "ethpandaops/checkpointz:latest"

# Define custom file contents to be mounted into containers
# These files are referenced by name in el_extra_mounts, cl_extra_mounts, and vc_extra_mounts
extra_files: {}
Expand Down
22 changes: 22 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tx_fuzz = import_module("./src/tx_fuzz/tx_fuzz.star")
forkmon = import_module("./src/forkmon/forkmon_launcher.star")

dora = import_module("./src/dora/dora_launcher.star")
checkpointz = import_module("./src/checkpointz/checkpointz_launcher.star")
dugtrio = import_module("./src/dugtrio/dugtrio_launcher.star")
blutgang = import_module("./src/blutgang/blutgang_launcher.star")
erpc = import_module("./src/erpc/erpc_launcher.star")
Expand Down Expand Up @@ -569,6 +570,27 @@ def run(plan, args={}):
el_cl_data_files_artifact_uuid,
)
plan.print("Successfully launched dora")
elif additional_service == "checkpointz":
plan.print("Launching checkpointz")
checkpointz_config_template = read_file(
static_files.CHECKPOINTZ_CONFIG_TEMPLATE_FILEPATH
)
checkpointz_params = args_with_right_defaults.checkpointz_params
checkpointz.launch_checkpointz(
plan,
checkpointz_config_template,
all_participants,
args_with_right_defaults.participants,
network_params,
checkpointz_params,
global_node_selectors,
global_tolerations,
args_with_right_defaults.port_publisher,
index,
args_with_right_defaults.docker_cache_params,
el_cl_data_files_artifact_uuid,
)
plan.print("Successfully launched checkpointz")
elif additional_service == "dugtrio":
plan.print("Launching dugtrio")
dugtrio_config_template = read_file(
Expand Down
2 changes: 2 additions & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ assertoor_params:
run_opcodes_transaction_test: false
run_lifecycle_test: false
tests: []
checkpointz_params:
image: "ethpandaops/checkpointz:latest"
wait_for_finalization: false
global_log_level: info
snooper_enabled: false
Expand Down
145 changes: 145 additions & 0 deletions src/checkpointz/checkpointz_launcher.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
shared_utils = import_module("../shared_utils/shared_utils.star")
constants = import_module("../package_io/constants.star")

SERVICE_NAME = "checkpointz"

HTTP_PORT_NUMBER = 5555
METRICS_PORT_NUMBER = 9090

CHECKPOINTZ_CONFIG_FILENAME = "checkpointz-config.yaml"

CHECKPOINTZ_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/config"

MIN_CPU = 100
MAX_CPU = 1000
MIN_MEMORY = 128
MAX_MEMORY = 1024

USED_PORTS = {
constants.HTTP_PORT_ID: shared_utils.new_port_spec(
HTTP_PORT_NUMBER,
shared_utils.TCP_PROTOCOL,
shared_utils.HTTP_APPLICATION_PROTOCOL,
),
constants.METRICS_PORT_ID: shared_utils.new_port_spec(
METRICS_PORT_NUMBER,
shared_utils.TCP_PROTOCOL,
shared_utils.HTTP_APPLICATION_PROTOCOL,
),
}


def launch_checkpointz(
plan,
config_template,
participant_contexts,
participant_configs,
network_params,
checkpointz_params,
global_node_selectors,
global_tolerations,
port_publisher,
additional_service_index,
docker_cache_params,
el_cl_data_files_artifact_uuid,
):
tolerations = shared_utils.get_tolerations(global_tolerations=global_tolerations)

all_cl_client_info = []
for index, participant in enumerate(participant_contexts):
full_name, cl_client, _, _ = shared_utils.get_client_names(
participant, index, participant_contexts, participant_configs
)
all_cl_client_info.append(
new_cl_client_info(
cl_client.beacon_http_url,
full_name,
)
)

template_data = new_config_template_data(
network_params.network,
all_cl_client_info,
)

template_and_data = shared_utils.new_template_and_data(
config_template, template_data
)
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath[
CHECKPOINTZ_CONFIG_FILENAME
] = template_and_data

config_files_artifact_name = plan.render_templates(
template_and_data_by_rel_dest_filepath, "checkpointz-config"
)
config = get_config(
config_files_artifact_name,
network_params,
checkpointz_params,
global_node_selectors,
tolerations,
port_publisher,
additional_service_index,
docker_cache_params,
el_cl_data_files_artifact_uuid,
)

plan.add_service(SERVICE_NAME, config)


def get_config(
config_files_artifact_name,
network_params,
checkpointz_params,
node_selectors,
tolerations,
port_publisher,
additional_service_index,
docker_cache_params,
el_cl_data_files_artifact_uuid,
):
config_file_path = shared_utils.path_join(
CHECKPOINTZ_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
CHECKPOINTZ_CONFIG_FILENAME,
)

public_ports = shared_utils.get_additional_service_standard_public_port(
port_publisher,
constants.HTTP_PORT_ID,
additional_service_index,
0,
)

IMAGE_NAME = checkpointz_params.image

return ServiceConfig(
image=IMAGE_NAME,
ports=USED_PORTS,
public_ports=public_ports,
files={
CHECKPOINTZ_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name,
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_data_files_artifact_uuid,
},
cmd=["--config", config_file_path],
min_cpu=MIN_CPU,
max_cpu=MAX_CPU,
min_memory=MIN_MEMORY,
max_memory=MAX_MEMORY,
node_selectors=node_selectors,
tolerations=tolerations,
)


def new_config_template_data(network, cl_client_info):
return {
"Network": network,
"CLClientInfo": cl_client_info,
}


def new_cl_client_info(beacon_http_url, full_name):
return {
"Beacon_HTTP_URL": beacon_http_url,
"FullName": full_name,
}
1 change: 1 addition & 0 deletions src/package_io/constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ FLASHBOTS_MEV_TYPE = "flashbots"
MEV_RS_MEV_TYPE = "mev-rs"
COMMIT_BOOST_MEV_TYPE = "commit-boost"
DEFAULT_DORA_IMAGE = "ethpandaops/dora:latest"
DEFAULT_CHECKPOINTZ_IMAGE = "ethpandaops/checkpointz:latest"
DEFAULT_SPAMOOR_IMAGE = "ethpandaops/spamoor:latest"
DEFAULT_ASSERTOOR_IMAGE = "ethpandaops/assertoor:latest"
DEFAULT_SNOOPER_IMAGE = "ethpandaops/rpc-snooper:latest"
Expand Down
11 changes: 11 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ ATTR_TO_BE_SKIPPED_AT_ROOT = (
"mev_params",
"blockscout_params",
"dora_params",
"checkpointz_params",
"docker_cache_params",
"assertoor_params",
"prometheus_params",
Expand All @@ -90,6 +91,7 @@ def input_parser(plan, input_args):
# add default eth2 input params
result["blockscout_params"] = get_default_blockscout_params()
result["dora_params"] = get_default_dora_params()
result["checkpointz_params"] = get_default_checkpointz_params()
result["docker_cache_params"] = get_default_docker_cache_params()
result["mev_params"] = get_default_mev_params(
result.get("mev_type"), result["network_params"]["preset"]
Expand Down Expand Up @@ -596,6 +598,9 @@ def input_parser(plan, input_args):
verif_image=result["blockscout_params"]["verif_image"],
frontend_image=result["blockscout_params"]["frontend_image"],
),
checkpointz_params=struct(
image=result["checkpointz_params"]["image"],
),
dora_params=struct(
image=result["dora_params"]["image"],
env=result["dora_params"]["env"],
Expand Down Expand Up @@ -1422,6 +1427,12 @@ def get_default_dora_params():
}


def get_default_checkpointz_params():
return {
"image": constants.DEFAULT_CHECKPOINTZ_IMAGE,
}


def get_default_docker_cache_params():
return {
"enabled": False,
Expand Down
4 changes: 4 additions & 0 deletions src/package_io/sanity_check.star
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ SUBCATEGORY_PARAMS = {
"image",
"env",
],
"checkpointz_params": [
"image",
],
"docker_cache_params": [
"enabled",
"url",
Expand Down Expand Up @@ -386,6 +389,7 @@ ADDITIONAL_SERVICES_PARAMS = [
"forkmon",
"blockscout",
"dora",
"checkpointz",
"full_beaconchain_explorer",
"prometheus_grafana",
"prometheus",
Expand Down
3 changes: 3 additions & 0 deletions src/static_files/static_files.star
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ DUGTRIO_CONFIG_TEMPLATE_FILEPATH = (
BLUTGANG_CONFIG_TEMPLATE_FILEPATH = (
STATIC_FILES_DIRPATH + "/blutgang-config/config.toml.tmpl"
)
CHECKPOINTZ_CONFIG_TEMPLATE_FILEPATH = (
STATIC_FILES_DIRPATH + "/checkpointz-config/config.yaml.tmpl"
)
ERPC_CONFIG_TEMPLATE_FILEPATH = STATIC_FILES_DIRPATH + "/erpc-config/erpc.yaml.tmpl"
FORKY_CONFIG_TEMPLATE_FILEPATH = STATIC_FILES_DIRPATH + "/forky-config/config.yaml.tmpl"
TRACOOR_CONFIG_TEMPLATE_FILEPATH = (
Expand Down
25 changes: 25 additions & 0 deletions static_files/checkpointz-config/config.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
global:
listenAddr: ":5555"
logging: "info"
metricsAddr: ":9090"

checkpointz:
mode: "light"
caches:
blocks:
max_items: 200
states:
max_items: 5
historical_epoch_count: 20
frontend:
enabled: true
brand_name: "Checkpointz - {{ .Network }}"
public_url: "http://localhost:5555"

beacon:
upstreams:
{{ range $clClient := .CLClientInfo }}
- name: "{{ $clClient.FullName }}"
address: "{{ $clClient.Beacon_HTTP_URL }}"
dataProvider: true
{{- end }}