Skip to content

Commit

Permalink
feat: use eth-network-package to spin up participant network (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 authored May 9, 2023
1 parent 41e3d2c commit 91029ac
Show file tree
Hide file tree
Showing 38 changed files with 19 additions and 2,884 deletions.
23 changes: 18 additions & 5 deletions main.star
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
participant_network = import_module("github.com/kurtosis-tech/eth2-package/src/participant_network/participant_network.star")
parse_input = import_module("github.com/kurtosis-tech/eth2-package/src/package_io/parse_input.star")

static_files = import_module("github.com/kurtosis-tech/eth2-package/src/static_files/static_files.star")
genesis_constants = import_module("github.com/kurtosis-tech/eth2-package/src/participant_network/prelaunch_data_generator/genesis_constants/genesis_constants.star")
genesis_constants = import_module("github.com/kurtosis-tech/eth-network-package/src/prelaunch_data_generator/genesis_constants/genesis_constants.star")

eth_network_module = import_module("github.com/kurtosis-tech/eth-network-package/main.star")
transaction_spammer = import_module("github.com/kurtosis-tech/eth2-package/src/transaction_spammer/transaction_spammer.star")
forkmon = import_module("github.com/kurtosis-tech/eth2-package/src/forkmon/forkmon_launcher.star")
prometheus = import_module("github.com/kurtosis-tech/eth2-package/src/prometheus/prometheus_launcher.star")
grafana =import_module("github.com/kurtosis-tech/eth2-package/src/grafana/grafana_launcher.star")
testnet_verifier = import_module("github.com/kurtosis-tech/eth2-package/src/testnet_verifier/testnet_verifier.star")
mev_boost_launcher_module = import_module("github.com/kurtosis-tech/eth2-package/src/mev_boost/mev_boost_launcher.star")

GRAFANA_USER = "admin"
GRAFANA_PASSWORD = "admin"
Expand All @@ -17,6 +18,9 @@ GRAFANA_DASHBOARD_PATH_URL = "/d/QdTOwy-nz/eth2-merge-kurtosis-module-dashboard?
FIRST_NODE_FINALIZATION_FACT = "cl-boot-finalization-fact"
HTTP_PORT_ID_FOR_FACT = "http"

MEV_BOOST_SERVICE_NAME_PREFIX = "mev-boost-"
MEV_BOOST_SHOULD_CHECK_RELAY = True

def run(plan, args):
args_with_right_defaults = parse_input.parse_input(args)

Expand All @@ -30,14 +34,23 @@ def run(plan, args):
plan.print("Read the prometheus, grafana templates")

plan.print("Launching participant network with {0} participants and the following network params {1}".format(num_participants, network_params))
all_participants, cl_gensis_timestamp = participant_network.launch_participant_network(plan, args_with_right_defaults.participants, network_params, args_with_right_defaults.global_client_log_level)
all_participants, cl_genesis_timestamp = eth_network_module.run(plan, args)

all_el_client_contexts = []
all_cl_client_contexts = []
for participant in all_participants:
all_el_client_contexts.append(participant.el_client_context)
all_cl_client_contexts.append(participant.cl_client_context)


# spin up mev boost contexts
all_mevboost_contexts = []
for index, participant in enumerate(args_with_right_defaults.participants):
mev_boost_context = None
if hasattr(participant, "builder_network_params") and participant.builder_network_params != None:
mev_boost_launcher = mev_boost_launcher_module.new_mev_boost_launcher(MEV_BOOST_SHOULD_CHECK_RELAY, participant.builder_network_params.relay_endpoints)
mev_boost_service_name = "{0}{1}".format(MEV_BOOST_SERVICE_NAME_PREFIX, index)
mev_boost_context = mev_boost_launcher_module.launch_mevboost(plan, mev_boost_launcher, mev_boost_service_name, network_params.network_id)
all_mevboost_contexts.append(mev_boost_context)

if not args_with_right_defaults.launch_additional_services:
return
Expand All @@ -51,7 +64,7 @@ def run(plan, args):

plan.print("Launching forkmon")
forkmon_config_template = read_file(static_files.FORKMON_CONFIG_TEMPLATE_FILEPATH)
forkmon.launch_forkmon(plan, forkmon_config_template, all_cl_client_contexts, cl_gensis_timestamp, network_params.seconds_per_slot, network_params.slots_per_epoch)
forkmon.launch_forkmon(plan, forkmon_config_template, all_cl_client_contexts, cl_genesis_timestamp, network_params.seconds_per_slot, network_params.slots_per_epoch)
plan.print("Succesfully launched forkmon")

plan.print("Launching prometheus...")
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
shared_utils = import_module("github.com/kurtosis-tech/eth2-package/src/shared_utils/shared_utils.star")
mev_boost_context = ("github.com/kurtosis-tech/eth2-package/src/participant_network/mev_boost/mev_boost_context.star")
mev_boost_context = ("github.com/kurtosis-tech/eth2-package/src/mev_boost/mev_boost_context.star")

FLASHBOTS_MEV_BOOST_IMAGE = "flashbots/mev-boost"
FLASHBOTS_MEV_BOOST_PORT = 18550
Expand Down
9 changes: 0 additions & 9 deletions src/participant_network/cl/cl_client_context.star

This file was deleted.

6 changes: 0 additions & 6 deletions src/participant_network/cl/cl_node_health_checker.star

This file was deleted.

7 changes: 0 additions & 7 deletions src/participant_network/cl/cl_node_metrics_info.star

This file was deleted.

303 changes: 0 additions & 303 deletions src/participant_network/cl/lighthouse/lighthouse_launcher.star

This file was deleted.

Loading

0 comments on commit 91029ac

Please sign in to comment.