Commit 2bae0993 authored by Barnabas Busa's avatar Barnabas Busa Committed by GitHub

feat: add devnets support (#384)

parent 8d400566
participants:
- el_client_type: besu
cl_client_type: lighthouse
additional_services: []
persistent: true
participants: participants:
- el_client_type: besu
cl_client_type: teku
- el_client_type: erigon - el_client_type: erigon
cl_client_type: lighthouse cl_client_type: teku
additional_services: [] additional_services: []
persistent: true persistent: true
participants:
- el_client_type: geth
el_client_image: ethpandaops/geth:master
cl_client_type: teku
cl_client_image: ethpandaops/teku:master
- el_client_type: nethermind
el_client_image: ethpandaops/nethermind:master
cl_client_type: prysm
cl_client_image: ethpandaops/prysm:develop,ethpandaops/prysm-validator:develop
- el_client_type: erigon
el_client_image: ethpandaops/erigon:devel
cl_client_type: nimbus
cl_client_image: ethpandaops/nimbus:unstable
- el_client_type: besu
el_client_image: ethpandaops/besu:main
cl_client_type: lighthouse
cl_client_image: ethpandaops/lighthouse:unstable
- el_client_type: reth
el_client_image: ethpandaops/reth:main
cl_client_type: lodestar
cl_client_image: ethpandaops/lodestar:unstable
- el_client_type: ethereumjs
el_client_image: ethpandaops/ethereumjs:master
cl_client_type: teku
cl_client_image: ethpandaops/teku:master
network_params:
network: "dencun-devnet-12"
additional_services: []
participants:
- el_client_type: geth
cl_client_type: teku
additional_services: []
persistent: true
...@@ -69,6 +69,11 @@ def run(plan, args={}): ...@@ -69,6 +69,11 @@ def run(plan, args={}):
) )
prometheus_additional_metrics_jobs = [] prometheus_additional_metrics_jobs = []
raw_jwt_secret = read_file(static_files.JWT_PATH_FILEPATH)
jwt_file = plan.upload_files(
src=static_files.JWT_PATH_FILEPATH,
name="jwt_file",
)
plan.print("Read the prometheus, grafana templates") plan.print("Read the prometheus, grafana templates")
plan.print( plan.print(
...@@ -86,6 +91,7 @@ def run(plan, args={}): ...@@ -86,6 +91,7 @@ def run(plan, args={}):
args_with_right_defaults.participants, args_with_right_defaults.participants,
network_params, network_params,
args_with_right_defaults.global_client_log_level, args_with_right_defaults.global_client_log_level,
jwt_file,
persistent, persistent,
parallel_keystore_generation, parallel_keystore_generation,
) )
...@@ -117,17 +123,18 @@ def run(plan, args={}): ...@@ -117,17 +123,18 @@ def run(plan, args={}):
all_cl_client_contexts, all_cl_client_contexts,
args_with_right_defaults.participants, args_with_right_defaults.participants,
) )
if network_params.network == "kurtosis":
if network_params.deneb_fork_epoch != 0: if network_params.deneb_fork_epoch != 0:
plan.print("Launching 4788 contract deployer") plan.print("Launching 4788 contract deployer")
el_uri = "http://{0}:{1}".format( el_uri = "http://{0}:{1}".format(
all_el_client_contexts[0].ip_addr, all_el_client_contexts[0].rpc_port_num all_el_client_contexts[0].ip_addr,
) all_el_client_contexts[0].rpc_port_num,
eip4788_deployment.deploy_eip4788_contract_in_background( )
plan, eip4788_deployment.deploy_eip4788_contract_in_background(
genesis_constants.PRE_FUNDED_ACCOUNTS[5].private_key, plan,
el_uri, genesis_constants.PRE_FUNDED_ACCOUNTS[5].private_key,
) el_uri,
)
fuzz_target = "http://{0}:{1}".format( fuzz_target = "http://{0}:{1}".format(
all_el_client_contexts[0].ip_addr, all_el_client_contexts[0].ip_addr,
...@@ -165,17 +172,11 @@ def run(plan, args={}): ...@@ -165,17 +172,11 @@ def run(plan, args={}):
beacon_uri = "{0}:{1}".format( beacon_uri = "{0}:{1}".format(
all_cl_client_contexts[0].ip_addr, all_cl_client_contexts[0].http_port_num all_cl_client_contexts[0].ip_addr, all_cl_client_contexts[0].http_port_num
) )
jwt_secret = plan.run_sh(
run="cat " + constants.JWT_AUTH_PATH + " | tr -d '\n'",
image="busybox",
files={"/data": el_cl_data_files_artifact_uuid},
wait=None,
)
endpoint = mock_mev.launch_mock_mev( endpoint = mock_mev.launch_mock_mev(
plan, plan,
el_uri, el_uri,
beacon_uri, beacon_uri,
jwt_secret.output, raw_jwt_secret,
args_with_right_defaults.global_client_log_level, args_with_right_defaults.global_client_log_level,
) )
mev_endpoints.append(endpoint) mev_endpoints.append(endpoint)
......
...@@ -3,7 +3,6 @@ input_parser = import_module("../../package_io/input_parser.star") ...@@ -3,7 +3,6 @@ input_parser = import_module("../../package_io/input_parser.star")
cl_client_context = import_module("../../cl/cl_client_context.star") cl_client_context = import_module("../../cl/cl_client_context.star")
node_metrics = import_module("../../node_metrics_info.star") node_metrics = import_module("../../node_metrics_info.star")
cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star") cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star")
constants = import_module("../../package_io/constants.star") constants = import_module("../../package_io/constants.star")
blobber_launcher = import_module("../../blobber/blobber_launcher.star") blobber_launcher = import_module("../../blobber/blobber_launcher.star")
...@@ -139,7 +138,10 @@ def launch( ...@@ -139,7 +138,10 @@ def launch(
# Launch Beacon node # Launch Beacon node
beacon_config = get_beacon_config( beacon_config = get_beacon_config(
plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
image, image,
beacon_service_name, beacon_service_name,
bootnode_contexts, bootnode_contexts,
...@@ -263,7 +265,10 @@ def launch( ...@@ -263,7 +265,10 @@ def launch(
def get_beacon_config( def get_beacon_config(
plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
image, image,
service_name, service_name,
boot_cl_client_ctxs, boot_cl_client_ctxs,
...@@ -325,7 +330,7 @@ def get_beacon_config( ...@@ -325,7 +330,7 @@ def get_beacon_config(
# and the option says it's "useful for testing in smaller networks" (unclear what happens in larger networks) # and the option says it's "useful for testing in smaller networks" (unclear what happens in larger networks)
"--disable-packet-filter", "--disable-packet-filter",
"--execution-endpoints=" + EXECUTION_ENGINE_ENDPOINT, "--execution-endpoints=" + EXECUTION_ENGINE_ENDPOINT,
"--jwt-secrets=" + constants.JWT_AUTH_PATH, "--jwt-secrets=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT, "--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT,
# Set per Paris' recommendation to reduce noise in the logs # Set per Paris' recommendation to reduce noise in the logs
"--subscribe-all-subnets", "--subscribe-all-subnets",
...@@ -337,20 +342,31 @@ def get_beacon_config( ...@@ -337,20 +342,31 @@ def get_beacon_config(
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^ # ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
] ]
if boot_cl_client_ctxs != None: if network == "kurtosis":
cmd.append( if boot_cl_client_ctxs != None:
"--boot-nodes=" cmd.append(
+ ",".join( "--boot-nodes="
[ctx.enr for ctx in boot_cl_client_ctxs[: constants.MAX_ENR_ENTRIES]] + ",".join(
[
ctx.enr
for ctx in boot_cl_client_ctxs[: constants.MAX_ENR_ENTRIES]
]
)
) )
) cmd.append(
"--trusted-peers="
+ ",".join(
[
ctx.peer_id
for ctx in boot_cl_client_ctxs[: constants.MAX_ENR_ENTRIES]
]
)
)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
"--trusted-peers=" "--boot-nodes="
+ ",".join( + shared_utils.get_devnet_enrs_list(
[ plan, el_cl_genesis_data.files_artifact_uuid
ctx.peer_id
for ctx in boot_cl_client_ctxs[: constants.MAX_ENR_ENTRIES]
]
) )
) )
...@@ -362,7 +378,8 @@ def get_beacon_config( ...@@ -362,7 +378,8 @@ def get_beacon_config(
endpoint="/eth/v1/node/identity", port_id=BEACON_HTTP_PORT_ID endpoint="/eth/v1/node/identity", port_id=BEACON_HTTP_PORT_ID
) )
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if persistent: if persistent:
...@@ -476,7 +493,9 @@ def get_validator_config( ...@@ -476,7 +493,9 @@ def get_validator_config(
) )
def new_lighthouse_launcher(el_cl_genesis_data): def new_lighthouse_launcher(el_cl_genesis_data, jwt_file, network):
return struct( return struct(
el_cl_genesis_data=el_cl_genesis_data, el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
) )
...@@ -116,7 +116,10 @@ def launch( ...@@ -116,7 +116,10 @@ def launch(
# Launch Beacon node # Launch Beacon node
beacon_config = get_beacon_config( beacon_config = get_beacon_config(
plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
image, image,
beacon_service_name, beacon_service_name,
bootnode_contexts, bootnode_contexts,
...@@ -232,7 +235,10 @@ def launch( ...@@ -232,7 +235,10 @@ def launch(
def get_beacon_config( def get_beacon_config(
plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
image, image,
service_name, service_name,
bootnode_contexts, bootnode_contexts,
...@@ -293,19 +299,26 @@ def get_beacon_config( ...@@ -293,19 +299,26 @@ def get_beacon_config(
"--enr.udp={0}".format(DISCOVERY_PORT_NUM), "--enr.udp={0}".format(DISCOVERY_PORT_NUM),
# Set per Pari's recommendation to reduce noise in the logs # Set per Pari's recommendation to reduce noise in the logs
"--subscribeAllSubnets=true", "--subscribeAllSubnets=true",
"--jwt-secret=" + constants.JWT_AUTH_PATH, "--jwt-secret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
# vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv # vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv
"--metrics", "--metrics",
"--metrics.address=0.0.0.0", "--metrics.address=0.0.0.0",
"--metrics.port={0}".format(METRICS_PORT_NUM), "--metrics.port={0}".format(METRICS_PORT_NUM),
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^ # ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
] ]
if network == "kurtosis":
if bootnode_contexts != None: if bootnode_contexts != None:
cmd.append(
"--bootnodes="
+ ",".join(
[ctx.enr for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]]
)
)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
"--bootnodes=" "--bootnodes="
+ ",".join( + shared_utils.get_devnet_enrs_list(
[ctx.enr for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]] plan, el_cl_genesis_data.files_artifact_uuid
) )
) )
...@@ -313,7 +326,8 @@ def get_beacon_config( ...@@ -313,7 +326,8 @@ def get_beacon_config(
# this is a repeated<proto type>, we convert it into Starlark # this is a repeated<proto type>, we convert it into Starlark
cmd.extend([param for param in extra_params]) cmd.extend([param for param in extra_params])
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if persistent: if persistent:
...@@ -424,7 +438,9 @@ def get_validator_config( ...@@ -424,7 +438,9 @@ def get_validator_config(
) )
def new_lodestar_launcher(el_cl_genesis_data): def new_lodestar_launcher(el_cl_genesis_data, jwt_file, network):
return struct( return struct(
el_cl_genesis_data=el_cl_genesis_data, el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
) )
...@@ -155,7 +155,10 @@ def launch( ...@@ -155,7 +155,10 @@ def launch(
bn_max_mem = int(bn_max_mem) if int(bn_max_mem) > 0 else BEACON_MAX_MEMORY bn_max_mem = int(bn_max_mem) if int(bn_max_mem) > 0 else BEACON_MAX_MEMORY
beacon_config = get_beacon_config( beacon_config = get_beacon_config(
plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
image, image,
beacon_service_name, beacon_service_name,
bootnode_contexts, bootnode_contexts,
...@@ -261,7 +264,10 @@ def launch( ...@@ -261,7 +264,10 @@ def launch(
def get_beacon_config( def get_beacon_config(
plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
image, image,
service_name, service_name,
bootnode_contexts, bootnode_contexts,
...@@ -325,7 +331,7 @@ def get_beacon_config( ...@@ -325,7 +331,7 @@ def get_beacon_config(
"--subscribe-all-subnets=true", "--subscribe-all-subnets=true",
# Nimbus can handle a max of 256 threads, if the host has more then nimbus crashes. Setting it to 4 so it doesn't crash on build servers # Nimbus can handle a max of 256 threads, if the host has more then nimbus crashes. Setting it to 4 so it doesn't crash on build servers
"--num-threads=4", "--num-threads=4",
"--jwt-secret=" + constants.JWT_AUTH_PATH, "--jwt-secret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
# vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv # vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv
"--metrics", "--metrics",
"--metrics-address=0.0.0.0", "--metrics-address=0.0.0.0",
...@@ -346,20 +352,27 @@ def get_beacon_config( ...@@ -346,20 +352,27 @@ def get_beacon_config(
if node_keystore_files != None and not split_mode_enabled: if node_keystore_files != None and not split_mode_enabled:
cmd.extend(validator_flags) cmd.extend(validator_flags)
if bootnode_contexts == None: if network == "kurtosis":
# Copied from https://github.com/status-im/nimbus-eth2/blob/67ab477a27e358d605e99bffeb67f98d18218eca/scripts/launch_local_testnet.sh#L417 if bootnode_contexts == None:
# See explanation there # Copied from https://github.com/status-im/nimbus-eth2/blob/67ab477a27e358d605e99bffeb67f98d18218eca/scripts/launch_local_testnet.sh#L417
cmd.append("--subscribe-all-subnets") # See explanation there
else: cmd.append("--subscribe-all-subnets")
for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]: else:
cmd.append("--bootstrap-node=" + ctx.enr) for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]:
cmd.append("--direct-peer=" + ctx.multiaddr) cmd.append("--bootstrap-node=" + ctx.enr)
cmd.append("--direct-peer=" + ctx.multiaddr)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append(
"--bootstrap-node="
+ shared_utils.get_devnet_enr(plan, el_cl_genesis_data.files_artifact_uuid)
)
if len(extra_params) > 0: if len(extra_params) > 0:
cmd.extend([param for param in extra_params]) cmd.extend([param for param in extra_params])
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if node_keystore_files != None and not split_mode_enabled: if node_keystore_files != None and not split_mode_enabled:
files[ files[
...@@ -465,7 +478,9 @@ def get_validator_config( ...@@ -465,7 +478,9 @@ def get_validator_config(
) )
def new_nimbus_launcher(el_cl_genesis_data): def new_nimbus_launcher(el_cl_genesis_data, jwt_file, network):
return struct( return struct(
el_cl_genesis_data=el_cl_genesis_data, el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
) )
...@@ -142,7 +142,10 @@ def launch( ...@@ -142,7 +142,10 @@ def launch(
bn_max_mem = int(bn_max_mem) if int(bn_max_mem) > 0 else BEACON_MAX_MEMORY bn_max_mem = int(bn_max_mem) if int(bn_max_mem) > 0 else BEACON_MAX_MEMORY
beacon_config = get_beacon_config( beacon_config = get_beacon_config(
plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
beacon_image, beacon_image,
beacon_service_name, beacon_service_name,
bootnode_contexts, bootnode_contexts,
...@@ -250,7 +253,10 @@ def launch( ...@@ -250,7 +253,10 @@ def launch(
def get_beacon_config( def get_beacon_config(
plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
beacon_image, beacon_image,
service_name, service_name,
bootnode_contexts, bootnode_contexts,
...@@ -302,7 +308,7 @@ def get_beacon_config( ...@@ -302,7 +308,7 @@ def get_beacon_config(
"--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT, "--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT,
# Set per Pari's recommendation to reduce noise # Set per Pari's recommendation to reduce noise
"--subscribe-all-subnets=true", "--subscribe-all-subnets=true",
"--jwt-secret=" + constants.JWT_AUTH_PATH, "--jwt-secret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--enable-debug-rpc-endpoints=true", "--enable-debug-rpc-endpoints=true",
# vvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv # vvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv
"--disable-monitoring=false", "--disable-monitoring=false",
...@@ -310,11 +316,17 @@ def get_beacon_config( ...@@ -310,11 +316,17 @@ def get_beacon_config(
"--monitoring-port={0}".format(BEACON_MONITORING_PORT_NUM) "--monitoring-port={0}".format(BEACON_MONITORING_PORT_NUM)
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^ # ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
] ]
if network == "kurtosis":
if bootnode_contexts != None: if bootnode_contexts != None:
for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]: for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]:
cmd.append("--peer=" + ctx.multiaddr) cmd.append("--peer=" + ctx.multiaddr)
cmd.append("--bootstrap-node=" + ctx.enr) cmd.append("--bootstrap-node=" + ctx.enr)
cmd.append("--p2p-static-id=true")
elif network not in constants.PUBLIC_NETWORKS:
cmd.append(
"--bootstrap-node="
+ shared_utils.get_devnet_enr(plan, el_cl_genesis_data.files_artifact_uuid)
)
cmd.append("--p2p-static-id=true") cmd.append("--p2p-static-id=true")
if len(extra_params) > 0: if len(extra_params) > 0:
...@@ -322,7 +334,8 @@ def get_beacon_config( ...@@ -322,7 +334,8 @@ def get_beacon_config(
cmd.extend([param for param in extra_params]) cmd.extend([param for param in extra_params])
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if persistent: if persistent:
...@@ -394,7 +407,6 @@ def get_validator_config( ...@@ -394,7 +407,6 @@ def get_validator_config(
"--monitoring-port={0}".format(VALIDATOR_MONITORING_PORT_NUM), "--monitoring-port={0}".format(VALIDATOR_MONITORING_PORT_NUM),
"--verbosity=" + log_level, "--verbosity=" + log_level,
"--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT, "--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT,
# TODO(old) SOMETHING ABOUT JWT
# vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv # vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv
"--disable-monitoring=false", "--disable-monitoring=false",
"--monitoring-host=0.0.0.0", "--monitoring-host=0.0.0.0",
...@@ -440,10 +452,16 @@ def get_validator_config( ...@@ -440,10 +452,16 @@ def get_validator_config(
def new_prysm_launcher( def new_prysm_launcher(
el_cl_genesis_data, prysm_password_relative_filepath, prysm_password_artifact_uuid el_cl_genesis_data,
jwt_file,
network,
prysm_password_relative_filepath,
prysm_password_artifact_uuid,
): ):
return struct( return struct(
el_cl_genesis_data=el_cl_genesis_data, el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
prysm_password_artifact_uuid=prysm_password_artifact_uuid, prysm_password_artifact_uuid=prysm_password_artifact_uuid,
prysm_password_relative_filepath=prysm_password_relative_filepath, prysm_password_relative_filepath=prysm_password_relative_filepath,
) )
...@@ -3,7 +3,6 @@ input_parser = import_module("../../package_io/input_parser.star") ...@@ -3,7 +3,6 @@ input_parser = import_module("../../package_io/input_parser.star")
cl_client_context = import_module("../../cl/cl_client_context.star") cl_client_context = import_module("../../cl/cl_client_context.star")
node_metrics = import_module("../../node_metrics_info.star") node_metrics = import_module("../../node_metrics_info.star")
cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star") cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star")
constants = import_module("../../package_io/constants.star") constants = import_module("../../package_io/constants.star")
TEKU_BINARY_FILEPATH_IN_IMAGE = "/opt/teku/bin/teku" TEKU_BINARY_FILEPATH_IN_IMAGE = "/opt/teku/bin/teku"
...@@ -145,7 +144,10 @@ def launch( ...@@ -145,7 +144,10 @@ def launch(
bn_max_mem = int(bn_max_mem) if int(bn_max_mem) > 0 else BEACON_MAX_MEMORY bn_max_mem = int(bn_max_mem) if int(bn_max_mem) > 0 else BEACON_MAX_MEMORY
config = get_beacon_config( config = get_beacon_config(
plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
image, image,
beacon_service_name, beacon_service_name,
bootnode_context, bootnode_context,
...@@ -254,7 +256,10 @@ def launch( ...@@ -254,7 +256,10 @@ def launch(
def get_beacon_config( def get_beacon_config(
plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
image, image,
service_name, service_name,
bootnode_contexts, bootnode_contexts,
...@@ -319,7 +324,7 @@ def get_beacon_config( ...@@ -319,7 +324,7 @@ def get_beacon_config(
"--rest-api-port={0}".format(BEACON_HTTP_PORT_NUM), "--rest-api-port={0}".format(BEACON_HTTP_PORT_NUM),
"--rest-api-host-allowlist=*", "--rest-api-host-allowlist=*",
"--data-storage-non-canonical-blocks-enabled=true", "--data-storage-non-canonical-blocks-enabled=true",
"--ee-jwt-secret-file=" + constants.JWT_AUTH_PATH, "--ee-jwt-secret-file=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--ee-endpoint=" + EXECUTION_ENGINE_ENDPOINT, "--ee-endpoint=" + EXECUTION_ENGINE_ENDPOINT,
# vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv # vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv
"--metrics-enabled", "--metrics-enabled",
...@@ -328,6 +333,8 @@ def get_beacon_config( ...@@ -328,6 +333,8 @@ def get_beacon_config(
"--metrics-categories=BEACON,PROCESS,LIBP2P,JVM,NETWORK,PROCESS", "--metrics-categories=BEACON,PROCESS,LIBP2P,JVM,NETWORK,PROCESS",
"--metrics-port={0}".format(BEACON_METRICS_PORT_NUM), "--metrics-port={0}".format(BEACON_METRICS_PORT_NUM),
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^ # ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
# To enable syncing other networks too without checkpoint syncing
"--ignore-weak-subjectivity-period-enabled=true",
] ]
validator_flags = [ validator_flags = [
"--validator-keys={0}:{1}".format( "--validator-keys={0}:{1}".format(
...@@ -344,21 +351,28 @@ def get_beacon_config( ...@@ -344,21 +351,28 @@ def get_beacon_config(
if node_keystore_files != None and not split_mode_enabled: if node_keystore_files != None and not split_mode_enabled:
cmd.extend(validator_flags) cmd.extend(validator_flags)
if network == "kurtosis":
if bootnode_contexts != None: if bootnode_contexts != None:
cmd.append( cmd.append(
"--p2p-discovery-bootnodes=" "--p2p-discovery-bootnodes="
+ ",".join( + ",".join(
[ctx.enr for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]] [ctx.enr for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]]
)
) )
) cmd.append(
"--p2p-static-peers="
+ ",".join(
[
ctx.multiaddr
for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]
]
)
)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
"--p2p-static-peers=" "--p2p-discovery-bootnodes="
+ ",".join( + shared_utils.get_devnet_enrs_list(
[ plan, el_cl_genesis_data.files_artifact_uuid
ctx.multiaddr
for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]
]
) )
) )
...@@ -368,6 +382,7 @@ def get_beacon_config( ...@@ -368,6 +382,7 @@ def get_beacon_config(
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if node_keystore_files != None and not split_mode_enabled: if node_keystore_files != None and not split_mode_enabled:
files[ files[
...@@ -485,5 +500,7 @@ def get_validator_config( ...@@ -485,5 +500,7 @@ def get_validator_config(
) )
def new_teku_launcher(el_cl_genesis_data): def new_teku_launcher(el_cl_genesis_data, jwt_file, network):
return struct(el_cl_genesis_data=el_cl_genesis_data) return struct(
el_cl_genesis_data=el_cl_genesis_data, jwt_file=jwt_file, network=network
)
...@@ -4,7 +4,6 @@ el_client_context = import_module("../../el/el_client_context.star") ...@@ -4,7 +4,6 @@ el_client_context = import_module("../../el/el_client_context.star")
el_admin_node_info = import_module("../../el/el_admin_node_info.star") el_admin_node_info = import_module("../../el/el_admin_node_info.star")
node_metrics = import_module("../../node_metrics_info.star") node_metrics = import_module("../../node_metrics_info.star")
constants = import_module("../../package_io/constants.star") constants = import_module("../../package_io/constants.star")
# The dirpath of the execution data directory on the client container # The dirpath of the execution data directory on the client container
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER = "/opt/besu/execution-data" EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER = "/opt/besu/execution-data"
...@@ -89,8 +88,10 @@ def launch( ...@@ -89,8 +88,10 @@ def launch(
cl_client_name = service_name.split("-")[3] cl_client_name = service_name.split("-")[3]
config = get_config( config = get_config(
launcher.network_id, plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -129,8 +130,10 @@ def launch( ...@@ -129,8 +130,10 @@ def launch(
def get_config( def get_config(
network_id, plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -152,7 +155,6 @@ def get_config( ...@@ -152,7 +155,6 @@ def get_config(
"--genesis-file=" "--genesis-file="
+ constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER
+ "/besu.json", + "/besu.json",
"--network-id=" + network_id,
"--host-allowlist=*", "--host-allowlist=*",
"--rpc-http-enabled=true", "--rpc-http-enabled=true",
"--rpc-http-host=0.0.0.0", "--rpc-http-host=0.0.0.0",
...@@ -167,7 +169,7 @@ def get_config( ...@@ -167,7 +169,7 @@ def get_config(
"--p2p-host=" + PRIVATE_IP_ADDRESS_PLACEHOLDER, "--p2p-host=" + PRIVATE_IP_ADDRESS_PLACEHOLDER,
"--p2p-port={0}".format(DISCOVERY_PORT_NUM), "--p2p-port={0}".format(DISCOVERY_PORT_NUM),
"--engine-rpc-enabled=true", "--engine-rpc-enabled=true",
"--engine-jwt-secret=" + constants.JWT_AUTH_PATH, "--engine-jwt-secret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--engine-host-allowlist=*", "--engine-host-allowlist=*",
"--engine-rpc-port={0}".format(ENGINE_HTTP_RPC_PORT_NUM), "--engine-rpc-port={0}".format(ENGINE_HTTP_RPC_PORT_NUM),
"--sync-mode=FULL", "--sync-mode=FULL",
...@@ -176,15 +178,22 @@ def get_config( ...@@ -176,15 +178,22 @@ def get_config(
"--metrics-host=0.0.0.0", "--metrics-host=0.0.0.0",
"--metrics-port={0}".format(METRICS_PORT_NUM), "--metrics-port={0}".format(METRICS_PORT_NUM),
] ]
if network == "kurtosis":
if len(existing_el_clients) > 0: if len(existing_el_clients) > 0:
cmd.append(
"--bootnodes="
+ ",".join(
[
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
)
)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
"--bootnodes=" "--bootnodes="
+ ",".join( + shared_utils.get_devnet_enodes(
[ plan, el_cl_genesis_data.files_artifact_uuid
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
) )
) )
...@@ -198,6 +207,7 @@ def get_config( ...@@ -198,6 +207,7 @@ def get_config(
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if persistent: if persistent:
...@@ -226,5 +236,9 @@ def get_config( ...@@ -226,5 +236,9 @@ def get_config(
) )
def new_besu_launcher(network_id, el_cl_genesis_data): def new_besu_launcher(el_cl_genesis_data, jwt_file, network):
return struct(network_id=network_id, el_cl_genesis_data=el_cl_genesis_data) return struct(
el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
)
...@@ -90,8 +90,10 @@ def launch( ...@@ -90,8 +90,10 @@ def launch(
cl_client_name = service_name.split("-")[3] cl_client_name = service_name.split("-")[3]
config = get_config( config = get_config(
launcher.network_id, plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -132,8 +134,10 @@ def launch( ...@@ -132,8 +134,10 @@ def launch(
def get_config( def get_config(
network_id, plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -148,8 +152,6 @@ def get_config( ...@@ -148,8 +152,6 @@ def get_config(
extra_labels, extra_labels,
persistent, persistent,
): ):
network_id = network_id
init_datadir_cmd_str = "erigon init --datadir={0} {1}".format( init_datadir_cmd_str = "erigon init --datadir={0} {1}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json", constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json",
...@@ -160,7 +162,6 @@ def get_config( ...@@ -160,7 +162,6 @@ def get_config(
"--log.console.verbosity=" + verbosity_level, "--log.console.verbosity=" + verbosity_level,
"--datadir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, "--datadir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
"--port={0}".format(DISCOVERY_PORT_NUM), "--port={0}".format(DISCOVERY_PORT_NUM),
"--networkid=" + network_id,
"--http.api=eth,erigon,engine,web3,net,debug,trace,txpool,admin", "--http.api=eth,erigon,engine,web3,net,debug,trace,txpool,admin",
"--http.vhosts=*", "--http.vhosts=*",
"--ws", "--ws",
...@@ -170,32 +171,47 @@ def get_config( ...@@ -170,32 +171,47 @@ def get_config(
"--http.addr=0.0.0.0", "--http.addr=0.0.0.0",
"--http.corsdomain=*", "--http.corsdomain=*",
"--http.port={0}".format(WS_RPC_PORT_NUM), "--http.port={0}".format(WS_RPC_PORT_NUM),
"--authrpc.jwtsecret=" + constants.JWT_AUTH_PATH, "--authrpc.jwtsecret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--authrpc.addr=0.0.0.0", "--authrpc.addr=0.0.0.0",
"--authrpc.port={0}".format(ENGINE_RPC_PORT_NUM), "--authrpc.port={0}".format(ENGINE_RPC_PORT_NUM),
"--authrpc.vhosts=*", "--authrpc.vhosts=*",
"--metrics", "--metrics",
"--metrics.addr=0.0.0.0", "--metrics.addr=0.0.0.0",
"--metrics.port={0}".format(METRICS_PORT_NUM), "--metrics.port={0}".format(METRICS_PORT_NUM),
"--db.size.limit=100GB",
] ]
if len(existing_el_clients) > 0: if network == "kurtosis":
if len(existing_el_clients) > 0:
cmd.append(
"--bootnodes="
+ ",".join(
[
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
)
)
cmd.append(
"--staticpeers="
+ ",".join(
[
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
)
)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
"--bootnodes=" "--bootnodes="
+ ",".join( + shared_utils.get_devnet_enodes(
[ plan, el_cl_genesis_data.files_artifact_uuid
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
) )
) )
cmd.append( cmd.append(
"--staticpeers=" "--staticpeers="
+ ",".join( + shared_utils.get_devnet_enodes(
[ plan, el_cl_genesis_data.files_artifact_uuid
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
) )
) )
...@@ -208,6 +224,7 @@ def get_config( ...@@ -208,6 +224,7 @@ def get_config(
command_arg_str = " && ".join(command_arg) command_arg_str = " && ".join(command_arg)
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if persistent: if persistent:
...@@ -236,8 +253,9 @@ def get_config( ...@@ -236,8 +253,9 @@ def get_config(
) )
def new_erigon_launcher(network_id, el_cl_genesis_data): def new_erigon_launcher(el_cl_genesis_data, jwt_file, network):
return struct( return struct(
network_id=network_id,
el_cl_genesis_data=el_cl_genesis_data, el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
) )
...@@ -6,7 +6,6 @@ el_admin_node_info = import_module("../../el/el_admin_node_info.star") ...@@ -6,7 +6,6 @@ el_admin_node_info = import_module("../../el/el_admin_node_info.star")
node_metrics = import_module("../../node_metrics_info.star") node_metrics = import_module("../../node_metrics_info.star")
constants = import_module("../../package_io/constants.star") constants = import_module("../../package_io/constants.star")
RPC_PORT_NUM = 8545 RPC_PORT_NUM = 8545
WS_PORT_NUM = 8546 WS_PORT_NUM = 8546
WS_PORT_ENGINE_NUM = 8547 WS_PORT_ENGINE_NUM = 8547
...@@ -94,7 +93,10 @@ def launch( ...@@ -94,7 +93,10 @@ def launch(
cl_client_name = service_name.split("-")[3] cl_client_name = service_name.split("-")[3]
config = get_config( config = get_config(
plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -132,7 +134,10 @@ def launch( ...@@ -132,7 +134,10 @@ def launch(
def get_config( def get_config(
plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -165,21 +170,28 @@ def get_config( ...@@ -165,21 +170,28 @@ def get_config(
"--wsPort={0}".format(WS_PORT_NUM), "--wsPort={0}".format(WS_PORT_NUM),
"--wsEnginePort={0}".format(WS_PORT_ENGINE_NUM), "--wsEnginePort={0}".format(WS_PORT_ENGINE_NUM),
"--wsEngineAddr=0.0.0.0", "--wsEngineAddr=0.0.0.0",
"--jwt-secret=" + constants.JWT_AUTH_PATH, "--jwt-secret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--extIP={0}".format(PRIVATE_IP_ADDRESS_PLACEHOLDER), "--extIP={0}".format(PRIVATE_IP_ADDRESS_PLACEHOLDER),
"--sync=full", "--sync=full",
"--isSingleNode=true", "--isSingleNode=true",
"--logLevel={0}".format(verbosity_level), "--logLevel={0}".format(verbosity_level),
] ]
if network == "kurtosis":
if len(existing_el_clients) > 0: if len(existing_el_clients) > 0:
cmd.append(
"--bootnodes="
+ ",".join(
[
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
)
)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
"--bootnodes=" "--bootnodes="
+ ",".join( + shared_utils.get_devnet_enodes(
[ plan, el_cl_genesis_data.files_artifact_uuid
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
) )
) )
...@@ -189,6 +201,7 @@ def get_config( ...@@ -189,6 +201,7 @@ def get_config(
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if persistent: if persistent:
...@@ -217,7 +230,9 @@ def get_config( ...@@ -217,7 +230,9 @@ def get_config(
) )
def new_ethereumjs_launcher(el_cl_genesis_data): def new_ethereumjs_launcher(el_cl_genesis_data, jwt_file, network):
return struct( return struct(
el_cl_genesis_data=el_cl_genesis_data, el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
) )
...@@ -99,8 +99,10 @@ def launch( ...@@ -99,8 +99,10 @@ def launch(
cl_client_name = service_name.split("-")[3] cl_client_name = service_name.split("-")[3]
config = get_config( config = get_config(
launcher.network_id, plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -144,8 +146,10 @@ def launch( ...@@ -144,8 +146,10 @@ def launch(
def get_config( def get_config(
network_id, plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -211,7 +215,6 @@ def get_config( ...@@ -211,7 +215,6 @@ def get_config(
), ),
"--verbosity=" + verbosity_level, "--verbosity=" + verbosity_level,
"--datadir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, "--datadir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
"--networkid=" + network_id,
"--http", "--http",
"--http.addr=0.0.0.0", "--http.addr=0.0.0.0",
"--http.vhosts=*", "--http.vhosts=*",
...@@ -230,7 +233,7 @@ def get_config( ...@@ -230,7 +233,7 @@ def get_config(
"--authrpc.port={0}".format(ENGINE_RPC_PORT_NUM), "--authrpc.port={0}".format(ENGINE_RPC_PORT_NUM),
"--authrpc.addr=0.0.0.0", "--authrpc.addr=0.0.0.0",
"--authrpc.vhosts=*", "--authrpc.vhosts=*",
"--authrpc.jwtsecret=" + constants.JWT_AUTH_PATH, "--authrpc.jwtsecret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--syncmode=full", "--syncmode=full",
"--rpc.allow-unprotected-txs", "--rpc.allow-unprotected-txs",
"--metrics", "--metrics",
...@@ -245,14 +248,22 @@ def get_config( ...@@ -245,14 +248,22 @@ def get_config(
if "--ws.api" in arg: if "--ws.api" in arg:
cmd[index] = "--ws.api=admin,engine,net,eth,web3,debug,mev,flashbots" cmd[index] = "--ws.api=admin,engine,net,eth,web3,debug,mev,flashbots"
if len(existing_el_clients) > 0: if network == "kurtosis":
if len(existing_el_clients) > 0:
cmd.append(
"--bootnodes="
+ ",".join(
[
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
)
)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
"--bootnodes=" "--bootnodes="
+ ",".join( + shared_utils.get_devnet_enodes(
[ plan, el_cl_genesis_data.files_artifact_uuid
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
) )
) )
...@@ -269,7 +280,8 @@ def get_config( ...@@ -269,7 +280,8 @@ def get_config(
command_str = " && ".join(subcommand_strs) command_str = " && ".join(subcommand_strs)
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if persistent: if persistent:
files[EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER] = Directory( files[EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER] = Directory(
...@@ -298,15 +310,17 @@ def get_config( ...@@ -298,15 +310,17 @@ def get_config(
def new_geth_launcher( def new_geth_launcher(
network_id,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
final_genesis_timestamp, final_genesis_timestamp,
capella_fork_epoch, capella_fork_epoch,
electra_fork_epoch=None, electra_fork_epoch=None,
): ):
return struct( return struct(
network_id=network_id,
el_cl_genesis_data=el_cl_genesis_data, el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
final_genesis_timestamp=final_genesis_timestamp, final_genesis_timestamp=final_genesis_timestamp,
capella_fork_epoch=capella_fork_epoch, capella_fork_epoch=capella_fork_epoch,
electra_fork_epoch=electra_fork_epoch, electra_fork_epoch=electra_fork_epoch,
......
...@@ -88,7 +88,10 @@ def launch( ...@@ -88,7 +88,10 @@ def launch(
cl_client_name = service_name.split("-")[3] cl_client_name = service_name.split("-")[3]
config = get_config( config = get_config(
plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -128,7 +131,10 @@ def launch( ...@@ -128,7 +131,10 @@ def launch(
def get_config( def get_config(
plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -161,20 +167,27 @@ def get_config( ...@@ -161,20 +167,27 @@ def get_config(
"--Network.ExternalIp={0}".format(PRIVATE_IP_ADDRESS_PLACEHOLDER), "--Network.ExternalIp={0}".format(PRIVATE_IP_ADDRESS_PLACEHOLDER),
"--Network.DiscoveryPort={0}".format(DISCOVERY_PORT_NUM), "--Network.DiscoveryPort={0}".format(DISCOVERY_PORT_NUM),
"--Network.P2PPort={0}".format(DISCOVERY_PORT_NUM), "--Network.P2PPort={0}".format(DISCOVERY_PORT_NUM),
"--JsonRpc.JwtSecretFile=" + constants.JWT_AUTH_PATH, "--JsonRpc.JwtSecretFile=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--Network.OnlyStaticPeers=true", "--Network.OnlyStaticPeers=true",
"--Metrics.Enabled=true", "--Metrics.Enabled=true",
"--Metrics.ExposePort={0}".format(METRICS_PORT_NUM), "--Metrics.ExposePort={0}".format(METRICS_PORT_NUM),
] ]
if network == "kurtosis":
if len(existing_el_clients) > 0: if len(existing_el_clients) > 0:
cmd.append(
"--Network.StaticPeers="
+ ",".join(
[
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
)
)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
"--Network.StaticPeers=" "--Network.StaticPeers="
+ ",".join( + shared_utils.get_devnet_enodes(
[ plan, el_cl_genesis_data.files_artifact_uuid
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
) )
) )
...@@ -184,6 +197,7 @@ def get_config( ...@@ -184,6 +197,7 @@ def get_config(
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if persistent: if persistent:
...@@ -212,5 +226,7 @@ def get_config( ...@@ -212,5 +226,7 @@ def get_config(
) )
def new_nethermind_launcher(el_cl_genesis_data): def new_nethermind_launcher(el_cl_genesis_data, jwt_file, network):
return struct(el_cl_genesis_data=el_cl_genesis_data) return struct(
el_cl_genesis_data=el_cl_genesis_data, jwt_file=jwt_file, network=network
)
...@@ -5,7 +5,6 @@ el_admin_node_info = import_module("../../el/el_admin_node_info.star") ...@@ -5,7 +5,6 @@ el_admin_node_info = import_module("../../el/el_admin_node_info.star")
node_metrics = import_module("../../node_metrics_info.star") node_metrics = import_module("../../node_metrics_info.star")
constants = import_module("../../package_io/constants.star") constants = import_module("../../package_io/constants.star")
RPC_PORT_NUM = 8545 RPC_PORT_NUM = 8545
WS_PORT_NUM = 8546 WS_PORT_NUM = 8546
DISCOVERY_PORT_NUM = 30303 DISCOVERY_PORT_NUM = 30303
...@@ -92,7 +91,10 @@ def launch( ...@@ -92,7 +91,10 @@ def launch(
cl_client_name = service_name.split("-")[3] cl_client_name = service_name.split("-")[3]
config = get_config( config = get_config(
plan,
launcher.el_cl_genesis_data, launcher.el_cl_genesis_data,
launcher.jwt_file,
launcher.network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -131,7 +133,10 @@ def launch( ...@@ -131,7 +133,10 @@ def launch(
def get_config( def get_config(
plan,
el_cl_genesis_data, el_cl_genesis_data,
jwt_file,
network,
image, image,
service_name, service_name,
existing_el_clients, existing_el_clients,
...@@ -171,19 +176,26 @@ def get_config( ...@@ -171,19 +176,26 @@ def get_config(
"--ws.origins=*", "--ws.origins=*",
"--nat=extip:" + PRIVATE_IP_ADDRESS_PLACEHOLDER, "--nat=extip:" + PRIVATE_IP_ADDRESS_PLACEHOLDER,
"--authrpc.port={0}".format(ENGINE_RPC_PORT_NUM), "--authrpc.port={0}".format(ENGINE_RPC_PORT_NUM),
"--authrpc.jwtsecret=" + constants.JWT_AUTH_PATH, "--authrpc.jwtsecret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--authrpc.addr=0.0.0.0", "--authrpc.addr=0.0.0.0",
"--metrics=0.0.0.0:{0}".format(METRICS_PORT_NUM), "--metrics=0.0.0.0:{0}".format(METRICS_PORT_NUM),
] ]
if network == "kurtosis":
if len(existing_el_clients) > 0: if len(existing_el_clients) > 0:
cmd.append(
"--bootnodes="
+ ",".join(
[
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
)
)
elif network not in constants.PUBLIC_NETWORKS:
cmd.append( cmd.append(
"--bootnodes=" "--bootnodes="
+ ",".join( + shared_utils.get_devnet_enodes(
[ plan, el_cl_genesis_data.files_artifact_uuid
ctx.enode
for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES]
]
) )
) )
...@@ -201,6 +213,7 @@ def get_config( ...@@ -201,6 +213,7 @@ def get_config(
files = { files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
} }
if persistent: if persistent:
...@@ -229,7 +242,9 @@ def get_config( ...@@ -229,7 +242,9 @@ def get_config(
) )
def new_reth_launcher(el_cl_genesis_data): def new_reth_launcher(el_cl_genesis_data, jwt_file, network):
return struct( return struct(
el_cl_genesis_data=el_cl_genesis_data, el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network,
) )
...@@ -38,15 +38,24 @@ GENESIS_VALIDATORS_ROOT_PLACEHOLDER = "GENESIS_VALIDATORS_ROOT_PLACEHOLDER" ...@@ -38,15 +38,24 @@ GENESIS_VALIDATORS_ROOT_PLACEHOLDER = "GENESIS_VALIDATORS_ROOT_PLACEHOLDER"
ARCHIVE_MODE = True ARCHIVE_MODE = True
GENESIS_DATA_MOUNTPOINT_ON_CLIENTS = "/data" GENESIS_DATA_MOUNTPOINT_ON_CLIENTS = "/network-configs"
GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER = ( GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER = (
GENESIS_DATA_MOUNTPOINT_ON_CLIENTS + "/data/custom_config_data" GENESIS_DATA_MOUNTPOINT_ON_CLIENTS + "/network-configs"
) )
JWT_AUTH_PATH = GENESIS_DATA_MOUNTPOINT_ON_CLIENTS + "/data/jwt/jwtsecret" JWT_MOUNTPOINT_ON_CLIENTS = "/jwt"
JWT_MOUNT_PATH_ON_CONTAINER = JWT_MOUNTPOINT_ON_CLIENTS + "/jwtsecret"
GENESIS_FORK_VERSION = "0x10000038" GENESIS_FORK_VERSION = "0x10000038"
BELLATRIX_FORK_VERSION = "0x30000038" BELLATRIX_FORK_VERSION = "0x30000038"
CAPELLA_FORK_VERSION = "0x40000038" CAPELLA_FORK_VERSION = "0x40000038"
DENEB_FORK_VERSION = "0x50000038" DENEB_FORK_VERSION = "0x50000038"
ELECTRA_FORK_VERSION = "0x60000038" ELECTRA_FORK_VERSION = "0x60000038"
PUBLIC_NETWORKS = (
"mainnet",
"goerli",
"sepolia",
"holesky",
)
...@@ -64,7 +64,10 @@ def input_parser(plan, input_args): ...@@ -64,7 +64,10 @@ def input_parser(plan, input_args):
# add default eth2 input params # add default eth2 input params
result["mev_type"] = None result["mev_type"] = None
result["mev_params"] = get_default_mev_params() result["mev_params"] = get_default_mev_params()
result["additional_services"] = DEFAULT_ADDITIONAL_SERVICES if result["network_params"]["network"] == "kurtosis":
result["additional_services"] = DEFAULT_ADDITIONAL_SERVICES
else:
result["additional_services"] = []
result["grafana_additional_dashboards"] = [] result["grafana_additional_dashboards"] = []
result["tx_spammer_params"] = get_default_tx_spammer_params() result["tx_spammer_params"] = get_default_tx_spammer_params()
result["custom_flood_params"] = get_default_custom_flood_params() result["custom_flood_params"] = get_default_custom_flood_params()
...@@ -181,6 +184,7 @@ def input_parser(plan, input_args): ...@@ -181,6 +184,7 @@ def input_parser(plan, input_args):
capella_fork_epoch=result["network_params"]["capella_fork_epoch"], capella_fork_epoch=result["network_params"]["capella_fork_epoch"],
deneb_fork_epoch=result["network_params"]["deneb_fork_epoch"], deneb_fork_epoch=result["network_params"]["deneb_fork_epoch"],
electra_fork_epoch=result["network_params"]["electra_fork_epoch"], electra_fork_epoch=result["network_params"]["electra_fork_epoch"],
network=result["network_params"]["network"],
), ),
mev_params=struct( mev_params=struct(
mev_relay_image=result["mev_params"]["mev_relay_image"], mev_relay_image=result["mev_params"]["mev_relay_image"],
...@@ -346,10 +350,14 @@ def parse_network_params(input_args): ...@@ -346,10 +350,14 @@ def parse_network_params(input_args):
"deposit_contract_address is empty or spaces it needs to be of non zero length" "deposit_contract_address is empty or spaces it needs to be of non zero length"
) )
if result["network_params"]["preregistered_validator_keys_mnemonic"].strip() == "": if result["network_params"]["network"] == "kurtosis":
fail( if (
"preregistered_validator_keys_mnemonic is empty or spaces it needs to be of non zero length" result["network_params"]["preregistered_validator_keys_mnemonic"].strip()
) == ""
):
fail(
"preregistered_validator_keys_mnemonic is empty or spaces it needs to be of non zero length"
)
if result["network_params"]["seconds_per_slot"] == 0: if result["network_params"]["seconds_per_slot"] == 0:
fail("seconds_per_slot is 0 needs to be > 0 ") fail("seconds_per_slot is 0 needs to be > 0 ")
...@@ -367,12 +375,17 @@ def parse_network_params(input_args): ...@@ -367,12 +375,17 @@ def parse_network_params(input_args):
): ):
fail("electra can only happen with capella genesis not bellatrix") fail("electra can only happen with capella genesis not bellatrix")
if MIN_VALIDATORS > actual_num_validators: if result["network_params"]["network"] == "kurtosis":
fail( if MIN_VALIDATORS > actual_num_validators:
"We require at least {0} validators but got {1}".format( fail(
MIN_VALIDATORS, actual_num_validators "We require at least {0} validators but got {1}".format(
MIN_VALIDATORS, actual_num_validators
)
) )
) else:
# Don't allow validators on non-kurtosis networks
for participant in result["participants"]:
participant["validator_count"] = 0
return result return result
...@@ -423,6 +436,7 @@ def default_network_params(): ...@@ -423,6 +436,7 @@ def default_network_params():
"capella_fork_epoch": 0, "capella_fork_epoch": 0,
"deneb_fork_epoch": 500, "deneb_fork_epoch": 500,
"electra_fork_epoch": None, "electra_fork_epoch": None,
"network": "kurtosis",
} }
......
This diff is collapsed.
...@@ -56,16 +56,22 @@ def generate_el_cl_genesis_data( ...@@ -56,16 +56,22 @@ def generate_el_cl_genesis_data(
) )
genesis = plan.run_sh( genesis = plan.run_sh(
run="cp /opt/values.env /config/values.env && ./entrypoint.sh all", run="cp /opt/values.env /config/values.env && ./entrypoint.sh all && mkdir /network-configs && mv /data/custom_config_data/* /network-configs/",
image=image, image=image,
files={GENESIS_VALUES_PATH: genesis_generation_config_artifact_name}, files={GENESIS_VALUES_PATH: genesis_generation_config_artifact_name},
store=[StoreSpec(src="/data", name="el-cl-genesis-data")], store=[
StoreSpec(src="/network-configs/", name="el_cl_genesis_data"),
StoreSpec(
src="/network-configs/genesis_validators_root.txt",
name="genesis_validators_root",
),
],
wait=None, wait=None,
) )
genesis_validators_root = plan.run_sh( genesis_validators_root = plan.run_sh(
run="cat /data/data/custom_config_data/genesis_validators_root.txt", run="cat /data/genesis_validators_root.txt",
files={"/data": genesis.files_artifacts[0]}, files={"/data": genesis.files_artifacts[1]},
wait=None, wait=None,
) )
......
constants = import_module("../package_io/constants.star")
TCP_PROTOCOL = "TCP" TCP_PROTOCOL = "TCP"
UDP_PROTOCOL = "UDP" UDP_PROTOCOL = "UDP"
HTTP_APPLICATION_PROTOCOL = "http" HTTP_APPLICATION_PROTOCOL = "http"
...@@ -71,3 +73,51 @@ def label_maker(client, client_type, image, connected_client, extra_labels): ...@@ -71,3 +73,51 @@ def label_maker(client, client_type, image, connected_client, extra_labels):
} }
labels.update(extra_labels) # Add extra_labels to the labels dictionary labels.update(extra_labels) # Add extra_labels to the labels dictionary
return labels return labels
def get_devnet_enodes(plan, filename):
enode_list = plan.run_python(
files={constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: filename},
wait=None,
run="""
with open("/network-configs/network-configs/bootnode.txt") as bootnode_file:
bootnodes = []
for line in bootnode_file:
line = line.strip()
bootnodes.append(line)
print(",".join(bootnodes), end="")
""",
)
return enode_list.output
def get_devnet_enrs_list(plan, filename):
enr_list = plan.run_python(
files={constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: filename},
wait=None,
run="""
with open("/network-configs/network-configs/bootstrap_nodes.txt") as bootnode_file:
bootnodes = []
for line in bootnode_file:
line = line.strip()
bootnodes.append(line)
print(",".join(bootnodes), end="")
""",
)
return enr_list.output
# Prysm and Nimbus needs to have the enrs in a list format
# Can't figure out how to pass each item as a list, as I can't return an array from the starlark function
# So for now I'm just returning the last item in the list
def get_devnet_enr(plan, filename):
enr_items = plan.run_python(
files={constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: filename},
wait=None,
run="""
with open("/network-configs/network-configs/bootstrap_nodes.txt") as bootnode_file:
last_enr = bootnode_file.read().splitlines()[-1]
print(last_enr, end="")
""",
)
return enr_items.output
...@@ -51,3 +51,5 @@ CL_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH = ( ...@@ -51,3 +51,5 @@ CL_GENESIS_GENERATION_CONFIG_TEMPLATE_FILEPATH = (
CL_GENESIS_GENERATION_MNEMONICS_TEMPLATE_FILEPATH = ( CL_GENESIS_GENERATION_MNEMONICS_TEMPLATE_FILEPATH = (
CL_GENESIS_GENERATION_CONFIG_DIRPATH + "/mnemonics.yaml.tmpl" CL_GENESIS_GENERATION_CONFIG_DIRPATH + "/mnemonics.yaml.tmpl"
) )
JWT_PATH_FILEPATH = STATIC_FILES_DIRPATH + "/jwt/jwtsecret"
...@@ -5,7 +5,7 @@ logging: ...@@ -5,7 +5,7 @@ logging:
# Chain network configuration # Chain network configuration
chain: chain:
name: "kurtosis-testnet" name: "kurtosis-testnet"
configPath: "/data/data/custom_config_data/config.yaml" configPath: "/network-configs/network-configs/config.yaml"
displayName: "Kurtosis Testnet" displayName: "Kurtosis Testnet"
# HTTP Server configuration # HTTP Server configuration
......
0xdc49981516e8e72b401a63e6405495a32dafc3939b5d6d83cc319ac0388bca1b
\ No newline at end of file
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