Skip to content

Commit

Permalink
pass thru interop_params, set supervisor envvars on node and geth
Browse files Browse the repository at this point in the history
  • Loading branch information
edobry committed Dec 19, 2024
1 parent 1cb7b33 commit 5d94b62
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 4 deletions.
18 changes: 16 additions & 2 deletions src/cl/op-node/op_node_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ethereum_package_input_parser = import_module(
constants = import_module("../../package_io/constants.star")

util = import_module("../../util.star")
op_supervisor_launcher = import_module("../../supervisor/op-supervisor/op_supervisor_launcher.star")

# ---------------------------------- Beacon client -------------------------------------

Expand Down Expand Up @@ -73,6 +74,7 @@ def launch(
existing_cl_clients,
l1_config_env_vars,
sequencer_enabled,
interop_params,
):
beacon_node_identity_recipe = PostHttpRequestRecipe(
endpoint="/",
Expand Down Expand Up @@ -104,6 +106,7 @@ def launch(
l1_config_env_vars,
beacon_node_identity_recipe,
sequencer_enabled,
interop_params,
)

beacon_service = plan.add_service(service_name, config)
Expand Down Expand Up @@ -148,6 +151,7 @@ def get_beacon_config(
l1_config_env_vars,
beacon_node_identity_recipe,
sequencer_enabled,
interop_params,
):
EXECUTION_ENGINE_ENDPOINT = "http://{0}:{1}".format(
el_context.ip_addr,
Expand Down Expand Up @@ -225,7 +229,11 @@ def get_beacon_config(
ports = {}
ports.update(used_ports)

env_vars = participant.cl_extra_env_vars
env_vars = dict(participant.cl_extra_env_vars)

if interop_params.enabled:
env_vars["OP_NODE_SUPERVISOR"] = op_supervisor_launcher.SUPERVISOR_ENDPOINT

config_args = {
"image": participant.cl_image,
"ports": ports,
Expand Down Expand Up @@ -262,9 +270,15 @@ def get_beacon_config(
return ServiceConfig(**config_args)


def new_op_node_launcher(deployment_output, jwt_file, network_params):
def new_op_node_launcher(
deployment_output,
jwt_file,
network_params,
interop_params
):
return struct(
deployment_output=deployment_output,
jwt_file=jwt_file,
network_params=network_params,
interop_params=interop_params,
)
3 changes: 3 additions & 0 deletions src/el/op-besu/op_besu_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def launch(
existing_el_clients,
sequencer_enabled,
sequencer_context,
interop_params,
):
log_level = ethereum_package_input_parser.get_client_log_level_or_default(
participant.el_log_level, global_log_level, VERBOSITY_LEVELS
Expand Down Expand Up @@ -275,10 +276,12 @@ def new_op_besu_launcher(
jwt_file,
network,
network_id,
interop_params,
):
return struct(
deployment_output=deployment_output,
jwt_file=jwt_file,
network=network,
network_id=network_id,
interop_params=interop_params,
)
3 changes: 3 additions & 0 deletions src/el/op-erigon/op_erigon_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def launch(
existing_el_clients,
sequencer_enabled,
sequencer_context,
interop_params,
):
log_level = ethereum_package_input_parser.get_client_log_level_or_default(
participant.el_log_level, global_log_level, VERBOSITY_LEVELS
Expand Down Expand Up @@ -270,10 +271,12 @@ def new_op_erigon_launcher(
jwt_file,
network,
network_id,
interop_params,
):
return struct(
deployment_output=deployment_output,
jwt_file=jwt_file,
network=network,
network_id=network_id,
interop_params=interop_params,
)
13 changes: 12 additions & 1 deletion src/el/op-geth/op_geth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ethereum_package_constants = import_module(
)

constants = import_module("../../package_io/constants.star")
op_supervisor_launcher = import_module("../../supervisor/op-supervisor/op_supervisor_launcher.star")

RPC_PORT_NUM = 8545
WS_PORT_NUM = 8546
Expand Down Expand Up @@ -104,6 +105,7 @@ def launch(
existing_el_clients,
sequencer_enabled,
sequencer_context,
interop_params
):
log_level = ethereum_package_input_parser.get_client_log_level_or_default(
participant.el_log_level, global_log_level, VERBOSITY_LEVELS
Expand All @@ -124,6 +126,7 @@ def launch(
cl_client_name,
sequencer_enabled,
sequencer_context,
interop_params
)

service = plan.add_service(service_name, config)
Expand Down Expand Up @@ -166,6 +169,7 @@ def get_config(
cl_client_name,
sequencer_enabled,
sequencer_context,
interop_params
):
init_datadir_cmd_str = "geth init --datadir={0} --state.scheme=hash {1}".format(
EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER,
Expand Down Expand Up @@ -248,7 +252,12 @@ def get_config(
constants.EL_TYPE.op_geth + "_volume_size"
],
)
env_vars = participant.el_extra_env_vars

env_vars = dict(participant.cl_extra_env_vars)

if interop_params.enabled:
env_vars["GETH_ROLLUP_INTEROPRPC"] = op_supervisor_launcher.SUPERVISOR_ENDPOINT

config_args = {
"image": participant.el_image,
"ports": used_ports,
Expand Down Expand Up @@ -284,10 +293,12 @@ def new_op_geth_launcher(
jwt_file,
network,
network_id,
interop_params
):
return struct(
deployment_output=deployment_output,
jwt_file=jwt_file,
network=network,
network_id=network_id,
interop_params=interop_params,
)
3 changes: 3 additions & 0 deletions src/el/op-nethermind/op_nethermind_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def launch(
existing_el_clients,
sequencer_enabled,
sequencer_context,
interop_params,
):
log_level = ethereum_package_input_parser.get_client_log_level_or_default(
participant.el_log_level, global_log_level, VERBOSITY_LEVELS
Expand Down Expand Up @@ -260,10 +261,12 @@ def new_nethermind_launcher(
jwt_file,
network,
network_id,
interop_params,
):
return struct(
deployment_output=deployment_output,
jwt_file=jwt_file,
network=network,
network_id=network_id,
interop_params=interop_params,
)
3 changes: 3 additions & 0 deletions src/el/op-reth/op_reth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def launch(
existing_el_clients,
sequencer_enabled,
sequencer_context,
interop_params,
):
log_level = ethereum_package_input_parser.get_client_log_level_or_default(
participant.el_log_level, global_log_level, VERBOSITY_LEVELS
Expand Down Expand Up @@ -257,10 +258,12 @@ def new_op_reth_launcher(
jwt_file,
network,
network_id,
interop_params,
):
return struct(
deployment_output=deployment_output,
jwt_file=jwt_file,
network=network,
network_id=network_id,
interop_params=interop_params,
)
11 changes: 10 additions & 1 deletion src/el_cl_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def launch(
global_tolerations,
persistent,
additional_services,
interop_params,
):
el_launchers = {
"op-geth": {
Expand All @@ -45,6 +46,7 @@ def launch(
jwt_file,
network_params.network,
network_params.network_id,
interop_params
),
"launch_method": op_geth.launch,
},
Expand All @@ -54,6 +56,7 @@ def launch(
jwt_file,
network_params.network,
network_params.network_id,
interop_params
),
"launch_method": op_reth.launch,
},
Expand All @@ -63,6 +66,7 @@ def launch(
jwt_file,
network_params.network,
network_params.network_id,
interop_params
),
"launch_method": op_erigon.launch,
},
Expand All @@ -72,6 +76,7 @@ def launch(
jwt_file,
network_params.network,
network_params.network_id,
interop_params
),
"launch_method": op_nethermind.launch,
},
Expand All @@ -81,6 +86,7 @@ def launch(
jwt_file,
network_params.network,
network_params.network_id,
interop_params
),
"launch_method": op_besu.launch,
},
Expand All @@ -89,7 +95,7 @@ def launch(
cl_launchers = {
"op-node": {
"launcher": op_node.new_op_node_launcher(
deployment_output, jwt_file, network_params
deployment_output, jwt_file, network_params, interop_params
),
"launch_method": op_node.launch,
},
Expand Down Expand Up @@ -223,6 +229,7 @@ def launch(
all_el_contexts,
sequencer_enabled,
sequencer_context,
interop_params,
)

if rollup_boost_enabled:
Expand All @@ -241,6 +248,7 @@ def launch(
all_el_contexts,
sequencer_enabled,
sequencer_context,
interop_params,
)
else:
el_builder_context = struct(
Expand Down Expand Up @@ -282,6 +290,7 @@ def launch(
all_cl_contexts,
l1_config_env_vars,
sequencer_enabled,
interop_params,
)

sequencer_enabled = False
Expand Down
2 changes: 2 additions & 0 deletions src/l2.star
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def launch_l2(
global_node_selectors,
global_tolerations,
persistent,
interop_params,
):
network_params = l2_args.network_params
batcher_params = l2_args.batcher_params
Expand All @@ -46,6 +47,7 @@ def launch_l2(
global_tolerations,
persistent,
l2_args.additional_services,
interop_params,
)

all_el_contexts = []
Expand Down
2 changes: 2 additions & 0 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def launch_participant_network(
global_tolerations,
persistent,
additional_services,
interop_params,
):
num_participants = len(participants)
# First EL and sequencer CL
Expand All @@ -39,6 +40,7 @@ def launch_participant_network(
global_tolerations,
persistent,
additional_services,
interop_params,
)

all_participants = []
Expand Down

0 comments on commit 5d94b62

Please sign in to comment.