Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: participant_network & rename participant fields. #508

Merged
merged 38 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e87e3b5
adding local snapshot point
barnabasbusa Feb 14, 2024
c129a65
fix path
barnabasbusa Feb 14, 2024
151a509
fix path
barnabasbusa Feb 14, 2024
c24bd4c
Merge branch 'main' into bbusa/gballet-local-snap
barnabasbusa Feb 29, 2024
fa2b96a
update the url
barnabasbusa Feb 29, 2024
9f76b0f
fix lint
barnabasbusa Feb 29, 2024
090a769
add localhost as the source of snapshot
barnabasbusa Mar 1, 2024
dc178ef
add localhost as the source of snapshot
barnabasbusa Mar 1, 2024
d008a11
add localhost as the source of snapshot
barnabasbusa Mar 1, 2024
1acb16d
make genesis fast again
barnabasbusa Mar 1, 2024
f9b51e6
make url configurable
barnabasbusa Mar 5, 2024
19ed47c
remove shorter slot tiem
barnabasbusa Mar 5, 2024
bf815b7
refactor: participant_network
barnabasbusa Mar 5, 2024
6e859e2
rename to launch
barnabasbusa Mar 5, 2024
a688ac9
fix sepolia test
barnabasbusa Mar 5, 2024
f2ded0d
fix sepolia test
barnabasbusa Mar 5, 2024
267755e
fix lint
barnabasbusa Mar 5, 2024
0a5df2d
fix example
barnabasbusa Mar 5, 2024
56210c9
Merge branch 'bbusa/gballet-local-snap' into bbusa/refactoring
barnabasbusa Mar 5, 2024
b1aa37c
Merge branch 'main' into bbusa/gballet-local-snap
barnabasbusa Mar 5, 2024
ef7071b
Merge branch 'bbusa/gballet-local-snap' into bbusa/refactoring
barnabasbusa Mar 5, 2024
0e4320b
Update holesky-shadowfork-verkle.yaml_norun
barnabasbusa Mar 5, 2024
444bf86
Merge branch 'bbusa/gballet-local-snap' into bbusa/refactoring
barnabasbusa Mar 5, 2024
5f46b91
Merge branch 'main' into bbusa/refactoring
barnabasbusa Mar 5, 2024
1564608
fix some stuff
barnabasbusa Mar 5, 2024
8534479
fix participant
barnabasbusa Mar 5, 2024
73d6923
fix lint
barnabasbusa Mar 5, 2024
581b776
fix contexts
barnabasbusa Mar 5, 2024
d4e8e65
cleanup
barnabasbusa Mar 5, 2024
5340e84
refactor name of validator client to vc
barnabasbusa Mar 5, 2024
22fc5a5
Update src/network_launcher/public_network.star
barnabasbusa Mar 6, 2024
cb17958
Merge branch 'main' into bbusa/refactoring
barnabasbusa Mar 6, 2024
b09a6c1
fix dummy
barnabasbusa Mar 6, 2024
db572b7
refactor!: rename some participant fields (#510)
barnabasbusa Mar 7, 2024
abe313b
fix typo
barnabasbusa Mar 7, 2024
07f406a
fix typo
barnabasbusa Mar 7, 2024
f839f61
add rename script
barnabasbusa Mar 7, 2024
26ff20c
fix rename script to work on mac and linux too
barnabasbusa Mar 7, 2024
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
4 changes: 2 additions & 2 deletions .github/tests/mixed-cl-vc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ participants:
- el_client_type: geth
cl_client_type: teku
use_separate_validator_client: true
validator_client_type: lodestar
vc_client_type: lodestar
barnabasbusa marked this conversation as resolved.
Show resolved Hide resolved
- el_client_type: besu
cl_client_type: nimbus
use_separate_validator_client: true
validator_client_type: lighthouse
vc_client_type: lighthouse
additional_services: []
1 change: 1 addition & 0 deletions .github/tests/sepolia-mix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ participants:
- el_client_type: nethermind
cl_client_type: prysm
- el_client_type: erigon
el_client_image: ethpandaops/erigon:devel-d754b29 # this is a temp fix, till upstream is fixed
cl_client_type: lighthouse
- el_client_type: besu
cl_client_type: lighthouse
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ participants:
# Valid values are nimbus, lighthouse, lodestar, teku, and prysm
# ( The prysm validator only works with a prysm CL client )
# Defaults to matching the chosen CL client (cl_client_type)
validator_client_type: ""
vc_client_type: ""

# The Docker image that should be used for the separate validator client
# Defaults by client:
Expand Down
212 changes: 212 additions & 0 deletions src/cl/cl_client_launcher.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
lighthouse = import_module("./lighthouse/lighthouse_launcher.star")
lodestar = import_module("./lodestar/lodestar_launcher.star")
nimbus = import_module("./nimbus/nimbus_launcher.star")
prysm = import_module("./prysm/prysm_launcher.star")
teku = import_module("./teku/teku_launcher.star")

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")

snooper = import_module("../snooper/snooper_engine_launcher.star")

CL_CLIENT_CONTEXT_BOOTNODE = None


def launch(
plan,
network_params,
el_cl_data,
jwt_file,
keymanager_file,
keymanager_p12_file,
participants,
all_el_client_contexts,
global_log_level,
global_node_selectors,
global_tolerations,
persistent,
network_id,
num_participants,
validator_data,
prysm_password_relative_filepath,
prysm_password_artifact_uuid,
):
plan.print("Launching CL network")

cl_launchers = {
constants.CL_CLIENT_TYPE.lighthouse: {
"launcher": lighthouse.new_lighthouse_launcher(
el_cl_data, jwt_file, network_params.network
),
"launch_method": lighthouse.launch,
},
constants.CL_CLIENT_TYPE.lodestar: {
"launcher": lodestar.new_lodestar_launcher(
el_cl_data, jwt_file, network_params.network
),
"launch_method": lodestar.launch,
},
constants.CL_CLIENT_TYPE.nimbus: {
"launcher": nimbus.new_nimbus_launcher(
el_cl_data,
jwt_file,
network_params.network,
keymanager_file,
),
"launch_method": nimbus.launch,
},
constants.CL_CLIENT_TYPE.prysm: {
"launcher": prysm.new_prysm_launcher(
el_cl_data,
jwt_file,
network_params.network,
prysm_password_relative_filepath,
prysm_password_artifact_uuid,
),
"launch_method": prysm.launch,
},
constants.CL_CLIENT_TYPE.teku: {
"launcher": teku.new_teku_launcher(
el_cl_data,
jwt_file,
network_params.network,
keymanager_file,
keymanager_p12_file,
),
"launch_method": teku.launch,
},
}

all_snooper_engine_contexts = []
all_cl_client_contexts = []
preregistered_validator_keys_for_nodes = (
validator_data.per_node_keystores
if network_params.network == constants.NETWORK_NAME.kurtosis
or constants.NETWORK_NAME.shadowfork in network_params.network
else None
)

for index, participant in enumerate(participants):
cl_client_type = participant.cl_client_type
el_client_type = participant.el_client_type
node_selectors = input_parser.get_client_node_selectors(
participant.node_selectors,
global_node_selectors,
)

if cl_client_type not in cl_launchers:
fail(
"Unsupported launcher '{0}', need one of '{1}'".format(
cl_client_type, ",".join([cl.name for cl in cl_launchers.keys()])
)
)

cl_launcher, launch_method = (
cl_launchers[cl_client_type]["launcher"],
cl_launchers[cl_client_type]["launch_method"],
)

index_str = shared_utils.zfill_custom(index + 1, len(str(len(participants))))

cl_service_name = "cl-{0}-{1}-{2}".format(
index_str, cl_client_type, el_client_type
)
new_cl_node_validator_keystores = None
if participant.validator_count != 0:
new_cl_node_validator_keystores = preregistered_validator_keys_for_nodes[
index
]

el_client_context = all_el_client_contexts[index]

cl_client_context = None
snooper_engine_context = None
if participant.snooper_enabled:
snooper_service_name = "snooper-{0}-{1}-{2}".format(
index_str, cl_client_type, el_client_type
)
snooper_engine_context = snooper.launch(
plan,
snooper_service_name,
el_client_context,
node_selectors,
)
plan.print(
"Successfully added {0} snooper participants".format(
snooper_engine_context
)
)
all_snooper_engine_contexts.append(snooper_engine_context)

if index == 0:
cl_client_context = launch_method(
plan,
cl_launcher,
cl_service_name,
participant.cl_client_image,
participant.cl_client_log_level,
global_log_level,
CL_CLIENT_CONTEXT_BOOTNODE,
el_client_context,
new_cl_node_validator_keystores,
participant.bn_min_cpu,
participant.bn_max_cpu,
participant.bn_min_mem,
participant.bn_max_mem,
participant.snooper_enabled,
snooper_engine_context,
participant.blobber_enabled,
participant.blobber_extra_params,
participant.beacon_extra_params,
participant.beacon_extra_labels,
persistent,
participant.cl_client_volume_size,
participant.cl_tolerations,
participant.tolerations,
global_tolerations,
node_selectors,
participant.use_separate_validator_client,
)
else:
boot_cl_client_ctx = all_cl_client_contexts
cl_client_context = launch_method(
plan,
cl_launcher,
cl_service_name,
participant.cl_client_image,
participant.cl_client_log_level,
global_log_level,
boot_cl_client_ctx,
el_client_context,
new_cl_node_validator_keystores,
participant.bn_min_cpu,
participant.bn_max_cpu,
participant.bn_min_mem,
participant.bn_max_mem,
participant.snooper_enabled,
snooper_engine_context,
participant.blobber_enabled,
participant.blobber_extra_params,
participant.beacon_extra_params,
participant.beacon_extra_labels,
persistent,
participant.cl_client_volume_size,
participant.cl_tolerations,
participant.tolerations,
global_tolerations,
node_selectors,
participant.use_separate_validator_client,
)

# Add participant cl additional prometheus labels
for metrics_info in cl_client_context.cl_nodes_metrics_info:
if metrics_info != None:
metrics_info["config"] = participant.prometheus_config

all_cl_client_contexts.append(cl_client_context)
return (
all_cl_client_contexts,
all_snooper_engine_contexts,
preregistered_validator_keys_for_nodes,
)
Loading
Loading