Commit aabb9ad4 authored by Barnabas Busa's avatar Barnabas Busa Committed by GitHub

refactor: remove cl-forkmon (#286)

parent ad02c43c
...@@ -242,16 +242,15 @@ To configure the package behaviour, you can modify your `network_params.json` fi ...@@ -242,16 +242,15 @@ To configure the package behaviour, you can modify your `network_params.json` fi
// By default includes // By default includes
// - A transaction spammer & blob spammer is launched to fake transactions sent to the network // - A transaction spammer & blob spammer is launched to fake transactions sent to the network
// - Forkmon for EL & CL will be launched // - Forkmon for EL will be launched
// - A prometheus will be started, coupled with grafana // - A prometheus will be started, coupled with grafana
// - A beacon metrics gazer will be launched // - A beacon metrics gazer will be launched
// - A light beacon chain explorer will be launched // - A light beacon chain explorer will be launched
// - Default: ["tx_spammer", "blob_spammer", "cl_fork_mon", "el_forkmon", "beacon_metrics_gazer", "dora"," "prometheus_grafana"] // - Default: ["tx_spammer", "blob_spammer", "el_forkmon", "beacon_metrics_gazer", "dora"," "prometheus_grafana"]
"additional_services": [ "additional_services": [
"tx_spammer", "tx_spammer",
"blob_spammer", "blob_spammer",
"goomy_blob" "goomy_blob"
"cl_forkmon",
"el_forkmon", "el_forkmon",
"beacon_metrics_gazer", "beacon_metrics_gazer",
"dora", "dora",
......
...@@ -12,7 +12,6 @@ transaction_spammer = import_module( ...@@ -12,7 +12,6 @@ transaction_spammer = import_module(
) )
blob_spammer = import_module("./src/blob_spammer/blob_spammer.star") blob_spammer = import_module("./src/blob_spammer/blob_spammer.star")
goomy_blob = import_module("./src/goomy_blob/goomy_blob.star") goomy_blob = import_module("./src/goomy_blob/goomy_blob.star")
cl_forkmon = import_module("./src/cl_forkmon/cl_forkmon_launcher.star")
el_forkmon = import_module("./src/el_forkmon/el_forkmon_launcher.star") el_forkmon = import_module("./src/el_forkmon/el_forkmon_launcher.star")
beacon_metrics_gazer = import_module( beacon_metrics_gazer = import_module(
"./src/beacon_metrics_gazer/beacon_metrics_gazer_launcher.star" "./src/beacon_metrics_gazer/beacon_metrics_gazer_launcher.star"
...@@ -256,20 +255,6 @@ def run(plan, args={}): ...@@ -256,20 +255,6 @@ def run(plan, args={}):
plan.print("Succesfully launched goomy the blob spammer") plan.print("Succesfully launched goomy the blob spammer")
# We need a way to do time.sleep # We need a way to do time.sleep
# TODO add code that waits for CL genesis # TODO add code that waits for CL genesis
elif additional_service == "cl_forkmon":
plan.print("Launching cl forkmon")
cl_forkmon_config_template = read_file(
static_files.CL_FORKMON_CONFIG_TEMPLATE_FILEPATH
)
cl_forkmon.launch_cl_forkmon(
plan,
cl_forkmon_config_template,
all_cl_client_contexts,
final_genesis_timestamp,
network_params.seconds_per_slot,
network_params.slots_per_epoch,
)
plan.print("Succesfully launched consensus layer forkmon")
elif additional_service == "el_forkmon": elif additional_service == "el_forkmon":
plan.print("Launching el forkmon") plan.print("Launching el forkmon")
el_forkmon_config_template = read_file( el_forkmon_config_template = read_file(
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
"additional_services": [ "additional_services": [
"tx_spammer", "tx_spammer",
"blob_spammer", "blob_spammer",
"cl_forkmon",
"el_forkmon", "el_forkmon",
"beacon_metrics_gazer", "beacon_metrics_gazer",
"dora", "dora",
......
shared_utils = import_module("../shared_utils/shared_utils.star")
SERVICE_NAME = "cl-forkmon"
IMAGE_NAME = "ethpandaops/consensus-monitor:main"
HTTP_PORT_ID = "http"
HTTP_PORT_NUMBER = 80
CL_FORKMON_CONFIG_FILENAME = "cl-forkmon-config.toml"
CL_FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/config"
USED_PORTS = {
HTTP_PORT_ID: shared_utils.new_port_spec(
HTTP_PORT_NUMBER,
shared_utils.TCP_PROTOCOL,
shared_utils.HTTP_APPLICATION_PROTOCOL,
)
}
def launch_cl_forkmon(
plan,
config_template,
cl_client_contexts,
genesis_unix_timestamp,
seconds_per_slot,
slots_per_epoch,
):
all_cl_client_info = []
for client in cl_client_contexts:
client_info = new_cl_client_info(client.ip_addr, client.http_port_num)
all_cl_client_info.append(client_info)
template_data = new_config_template_data(
HTTP_PORT_NUMBER,
all_cl_client_info,
seconds_per_slot,
slots_per_epoch,
genesis_unix_timestamp,
)
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[
CL_FORKMON_CONFIG_FILENAME
] = template_and_data
config_files_artifact_name = plan.render_templates(
template_and_data_by_rel_dest_filepath, "cl-forkmon-config"
)
config = get_config(config_files_artifact_name)
plan.add_service(SERVICE_NAME, config)
def get_config(config_files_artifact_name):
config_file_path = shared_utils.path_join(
CL_FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE, CL_FORKMON_CONFIG_FILENAME
)
return ServiceConfig(
image=IMAGE_NAME,
ports=USED_PORTS,
files={
CL_FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name,
},
cmd=["--config-path", config_file_path],
)
def new_config_template_data(
listen_port_num,
cl_client_info,
seconds_per_slot,
slots_per_epoch,
genesis_unix_timestamp,
):
return {
"ListenPortNum": listen_port_num,
"CLClientInfo": cl_client_info,
"SecondsPerSlot": seconds_per_slot,
"SlotsPerEpoch": slots_per_epoch,
"GenesisUnixTimestamp": genesis_unix_timestamp,
}
def new_cl_client_info(ip_addr, port_num):
return {"IPAddr": ip_addr, "PortNum": port_num}
...@@ -31,7 +31,6 @@ MEV_BOOST_SERVICE_NAME_PREFIX = "mev-boost-" ...@@ -31,7 +31,6 @@ MEV_BOOST_SERVICE_NAME_PREFIX = "mev-boost-"
DEFAULT_ADDITIONAL_SERVICES = [ DEFAULT_ADDITIONAL_SERVICES = [
"tx_spammer", "tx_spammer",
"blob_spammer", "blob_spammer",
"cl_forkmon",
"el_forkmon", "el_forkmon",
"beacon_metrics_gazer", "beacon_metrics_gazer",
"dora", "dora",
......
# The path on the module container where static files are housed # The path on the module container where static files are housed
STATIC_FILES_DIRPATH = "/static_files" STATIC_FILES_DIRPATH = "/static_files"
# CL Forkmon config
CL_FORKMON_CONFIG_TEMPLATE_FILEPATH = (
STATIC_FILES_DIRPATH + "/cl-forkmon-config/config.toml.tmpl"
)
# EL Forkmon config # EL Forkmon config
EL_FORKMON_CONFIG_TEMPLATE_FILEPATH = ( EL_FORKMON_CONFIG_TEMPLATE_FILEPATH = (
STATIC_FILES_DIRPATH + "/el-forkmon-config/config.toml.tmpl" STATIC_FILES_DIRPATH + "/el-forkmon-config/config.toml.tmpl"
......
[network]
name = "pithos"
etherscan_api_key = "some-etherscan-api-key"
[consensus_chain]
seconds_per_slot = {{ .SecondsPerSlot }}
slots_per_epoch = {{ .SlotsPerEpoch }}
genesis_time = {{ .GenesisUnixTimestamp }}
[weak_subjectivity]
provider_endpoint = "http://eth2-ws-provider_eth2_ws_server_1:80"
[monitor]
output_dir = "public"
port = {{ .ListenPortNum }}
{{ range $clClient := .CLClientInfo }}
[[monitor.endpoints]]
consensus = "http://{{ $clClient.IPAddr }}:{{ $clClient.PortNum }}"
execution = "N/A" # This doesn't seem to be used
{{ end }}
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