Skip to content

Commit

Permalink
feat: add op-reth
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa committed Jun 7, 2024
1 parent 7d45f7b commit ec641db
Show file tree
Hide file tree
Showing 9 changed files with 368 additions and 202 deletions.
2 changes: 2 additions & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ optimism_package:
participants:
- el_type: op-geth
cl_type: op-node
count: 3
- el_type: op-reth
ethereum_package:
participants:
- el_type: geth
Expand Down
72 changes: 0 additions & 72 deletions src/cl/cl_launcher.star

This file was deleted.

24 changes: 11 additions & 13 deletions src/cl/op-node/op_node_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def launch(
existing_cl_clients,
l1_config_env_vars,
gs_sequencer_private_key,
sequencer_enabled,
):
network_name = shared_utils.get_network_name(launcher.network)

Expand All @@ -91,6 +92,7 @@ def launch(
l1_config_env_vars,
gs_sequencer_private_key,
beacon_node_identity_recipe,
sequencer_enabled,
)

beacon_service = plan.add_service(service_name, config)
Expand Down Expand Up @@ -132,6 +134,7 @@ def get_beacon_config(
l1_config_env_vars,
gs_sequencer_private_key,
beacon_node_identity_recipe,
sequencer_enabled,
):
EXECUTION_ENGINE_ENDPOINT = "http://{0}:{1}".format(
el_context.ip_addr,
Expand All @@ -148,27 +151,27 @@ def get_beacon_config(
"--rpc.addr=0.0.0.0",
"--rpc.port={0}".format(BEACON_HTTP_PORT_NUM),
"--rpc.enable-admin",
"--p2p.sequencer.key=" + gs_sequencer_private_key,
"--l1={0}".format(l1_config_env_vars["L1_RPC_URL"]),
"--l1.rpckind={0}".format(l1_config_env_vars["L1_RPC_KIND"]),
"--l1.beacon={0}".format(l1_config_env_vars["CL_RPC_URL"]),
"--p2p.advertise.ip=" + constants.PRIVATE_IP_ADDRESS_PLACEHOLDER,
"--p2p.advertise.tcp={0}".format(BEACON_DISCOVERY_PORT_NUM),
"--p2p.advertise.udp={0}".format(BEACON_DISCOVERY_PORT_NUM),
"--p2p.listen.ip=0.0.0.0",
"--p2p.listen.tcp={0}".format(BEACON_DISCOVERY_PORT_NUM),
"--p2p.listen.udp={0}".format(BEACON_DISCOVERY_PORT_NUM),
]

if len(existing_cl_clients) == 0:
if sequencer_enabled:
cmd.append("--p2p.sequencer.key=" + gs_sequencer_private_key)
cmd.append("--sequencer.enabled")
cmd.append("--sequencer.l1-confs=5")

if len(existing_cl_clients) > 0:
cmd.append(
"--p2p.static="
"--p2p.bootnodes="
+ ",".join(
[
ctx.beacon_multiaddr
for ctx in existing_cl_clients[: constants.MAX_ENR_ENTRIES]
]
[ctx.enr for ctx in existing_cl_clients[: constants.MAX_ENR_ENTRIES]]
)
)

Expand All @@ -195,9 +198,4 @@ def get_beacon_config(
)


def new_op_node_launcher(el_cl_genesis_data, jwt_file, network_params):
return struct(
el_cl_genesis_data=el_cl_genesis_data,
jwt_file=jwt_file,
network=network_params.network,
)
de
65 changes: 0 additions & 65 deletions src/el/el_launcher.star

This file was deleted.

52 changes: 14 additions & 38 deletions src/el/op-geth/op_geth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -89,34 +89,11 @@ def launch(
service_name,
image,
existing_el_clients,
sequencer_enabled,
sequencer_context,
):
# log_level = input_parser.get_client_log_level_or_default(
# participant_log_level, global_log_level, VERBOSITY_LEVELS
# )

network_name = shared_utils.get_network_name(launcher.network)

# el_min_cpu = int(el_min_cpu) if int(el_min_cpu) > 0 else EXECUTION_MIN_CPU
# el_max_cpu = (
# int(el_max_cpu)
# if int(el_max_cpu) > 0
# else constants.RAM_CPU_OVERRIDES[network_name]["geth_max_cpu"]
# )
# el_min_mem = int(el_min_mem) if int(el_min_mem) > 0 else EXECUTION_MIN_MEMORY
# el_max_mem = (
# int(el_max_mem)
# if int(el_max_mem) > 0
# else constants.RAM_CPU_OVERRIDES[network_name]["geth_max_mem"]
# )

# el_volume_size = (
# el_volume_size
# if int(el_volume_size) > 0
# else constants.VOLUME_SIZE[network_name]["geth_volume_size"]
# )

# cl_client_name = service_name.split("-")[3]

config = get_config(
plan,
launcher.el_cl_genesis_data,
Expand All @@ -126,6 +103,8 @@ def launch(
image,
service_name,
existing_el_clients,
sequencer_enabled,
sequencer_context,
)

service = plan.add_service(service_name, config)
Expand Down Expand Up @@ -164,6 +143,8 @@ def get_config(
image,
service_name,
existing_el_clients,
sequencer_enabled,
sequencer_context,
):
init_datadir_cmd_str = "geth init --datadir={0} {1}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
Expand All @@ -175,8 +156,6 @@ def get_config(

cmd = [
"geth",
# Disable path based storage scheme for electra fork and verkle
# TODO: REMOVE Once geth default db is path based, and builder rebased
"--networkid={0}".format(network_id),
# "--verbosity=" + verbosity_level,
"--datadir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
Expand All @@ -185,8 +164,6 @@ def get_config(
"--http.addr=0.0.0.0",
"--http.vhosts=*",
"--http.corsdomain=*",
# WARNING: The admin info endpoint is enabled so that we can easily get ENR/enode, which means
# that users should NOT store private information in these Kurtosis nodes!
"--http.api=admin,engine,net,eth,web3,debug",
"--ws",
"--ws.addr=0.0.0.0",
Expand All @@ -199,6 +176,7 @@ def get_config(
"--authrpc.vhosts=*",
"--authrpc.jwtsecret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--syncmode=full",
"--nat=extip:" + constants.PRIVATE_IP_ADDRESS_PLACEHOLDER,
"--rpc.allow-unprotected-txs",
"--metrics",
"--metrics.addr=0.0.0.0",
Expand All @@ -208,6 +186,11 @@ def get_config(
"--rollup.disabletxpoolgossip=true",
]

if not sequencer_enabled:
cmd.append(
"--rollup.sequencerhttp={0}".format(sequencer_context.beacon_http_url)
)

if len(existing_el_clients) > 0:
cmd.append(
"--bootnodes="
Expand All @@ -219,10 +202,6 @@ def get_config(
)
)

# if len(extra_params) > 0:
# # this is a repeated<proto type>, we convert it into Starlark
# cmd.extend([param for param in extra_params])

cmd_str = " ".join(cmd)
if network not in constants.PUBLIC_NETWORKS:
subcommand_strs = [
Expand All @@ -237,17 +216,14 @@ def get_config(
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data,
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
}
# if persistent:
# files[EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER] = Directory(
# persistent_key="data-{0}".format(service_name),
# size=el_volume_size,
# )

return ServiceConfig(
image=image,
ports=used_ports,
cmd=[command_str],
files=files,
entrypoint=ENTRYPOINT_ARGS,
private_ip_address_placeholder=constants.PRIVATE_IP_ADDRESS_PLACEHOLDER,
)


Expand Down
Loading

0 comments on commit ec641db

Please sign in to comment.