Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion kurtosis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: github.com/ethpandaops/optimism-package
name: github.com/dzejkop/optimism-package
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: github.com/dzejkop/optimism-package
name: github.com/ethpandaops/optimism-package

description: |
# Optimism Package
This is a Kurtosis package for deploying an Optimism Rollup
3 changes: 2 additions & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ethereum_package_static_files = import_module(
_registry = import_module("./src/package_io/registry.star")


def run(plan, args={}):
def run(plan, args={}, custom_launchers=None):
"""Deploy Optimism L2s on an Ethereum L1.

Args:
Expand Down Expand Up @@ -135,6 +135,7 @@ def run(plan, args={}):
persistent=persistent,
observability_helper=observability_helper,
supervisors_params=l2_supervisors_params,
custom_launchers=custom_launchers,
registry=registry,
)
)
Expand Down
50 changes: 50 additions & 0 deletions src/el_cl_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def launch(
observability_helper,
supervisors_params,
da_server_context,
custom_launchers,
registry=_registry.Registry(),
):
el_launchers = {
Expand Down Expand Up @@ -99,6 +100,17 @@ def launch(
},
}

if custom_launchers and "el_launcher" in custom_launchers:
el_launchers["custom"] = {
"launcher": custom_launchers["el_launcher"]["launcher"](
deployment_output,
jwt_file,
network_params.network,
network_params.network_id,
),
"launch_method": custom_launchers["el_launcher"]["launch_method"],
}

el_builder_launchers = {
"op-geth": {
"launcher": op_geth_builder.new_op_geth_builder_launcher(
Expand Down Expand Up @@ -129,6 +141,17 @@ def launch(
},
}

if custom_launchers and "el_builder_launcher" in custom_launchers:
el_builder_launchers["custom"] = {
"launcher": custom_launchers["el_builder_launcher"]["launcher"](
deployment_output,
jwt_file,
network_params.network,
network_params.network_id,
),
"launch_method": custom_launchers["el_builder_launcher"]["launch_method"],
}

cl_launchers = {
"op-node": {
"launcher": op_node.new_op_node_launcher(
Expand All @@ -150,6 +173,14 @@ def launch(
},
}

if custom_launchers and "cl_launcher" in custom_launchers:
cl_launchers["custom"] = {
"launcher": custom_launchers["cl_launcher"]["launcher"](
deployment_output, jwt_file, network_params
),
"launch_method": custom_launchers["cl_launcher"]["launch_method"],
}

cl_builder_launchers = {
"op-node": {
"launcher": op_node_builder.new_op_node_builder_launcher(
Expand All @@ -159,6 +190,14 @@ def launch(
},
}

if custom_launchers and "cl_builder_launcher" in custom_launchers:
cl_builder_launchers["custom"] = {
"launcher": custom_launchers["cl_builder_launcher"]["launcher"](
deployment_output, jwt_file, network_params
),
"launch_method": custom_launchers["cl_builder_launcher"]["launch_method"],
}

sidecar_launchers = {
"rollup-boost": {
"launcher": rollup_boost.new_rollup_boost_launcher(
Expand All @@ -171,6 +210,17 @@ def launch(
}
}

if custom_launchers and "sidecar_launcher" in custom_launchers:
sidecar_launchers["custom"] = {
"launcher": custom_launchers["sidecar_launcher"]["launcher"](
deployment_output,
jwt_file,
network_params.network,
network_params.network_id,
),
"launch_method": custom_launchers["sidecar_launcher"]["launch_method"],
}

all_cl_contexts = []
all_el_contexts = []
sequencer_enabled = True
Expand Down
2 changes: 2 additions & 0 deletions src/l2.star
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def launch_l2(
persistent,
observability_helper,
supervisors_params,
custom_launchers,
registry=None,
):
network_params = l2_args.network_params
Expand Down Expand Up @@ -69,6 +70,7 @@ def launch_l2(
observability_helper=observability_helper,
supervisors_params=supervisors_params,
da_server_context=da_server_context,
custom_launchers=custom_launchers,
registry=registry,
)

Expand Down
2 changes: 2 additions & 0 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def launch_participant_network(
observability_helper,
supervisors_params,
da_server_context,
custom_launchers,
registry=_registry.Registry(),
):
num_participants = len(participants)
Expand All @@ -52,6 +53,7 @@ def launch_participant_network(
observability_helper=observability_helper,
supervisors_params=supervisors_params,
da_server_context=da_server_context,
custom_launchers=custom_launchers,
registry=registry,
)

Expand Down
95 changes: 95 additions & 0 deletions test/el_cl_launcher_test.star
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def test_launch_with_defaults(plan):
observability_helper=observability_helper,
supervisors_params=parsed_input_args.supervisors,
da_server_context=da_server_context,
custom_launchers=None,
)

el_service_name = "op-el-2151908-1-op-reth-op-node-"
Expand Down Expand Up @@ -205,6 +206,7 @@ def test_launch_with_el_op_besu(plan):
observability_helper=observability_helper,
supervisors_params=parsed_input_args.supervisors,
da_server_context=da_server_context,
custom_launchers=None,
)

el_service_name = "op-el-2151908-1-op-besu-op-node-"
Expand Down Expand Up @@ -259,6 +261,99 @@ def test_launch_with_el_op_besu(plan):
],
)


def test_launch_with_custom_launcher(plan):
parsed_input_args = input_parser.input_parser(
plan,
{
"chains": [
{
"participants": [
{
"el_type": "custom",
"el_image": "op-reth:latest",
"cl_type": "op-node",
"cl_image": "op-node:latest",
}
]
}
]
},
)

observability_helper = observability.make_helper(parsed_input_args.observability)
chains = parsed_input_args.chains
chain = chains[0]

# We'll mock read_network_config_value since it returns a runtime value that we would not be able to retrieve
sequencer_private_key_mock = "sequencer_private_key"
kurtosistest.mock(util, "read_network_config_value").mock_return_value(
sequencer_private_key_mock
)

all_el_contexts, all_cl_contexts = el_cl_launcher.launch(
plan=plan,
jwt_file=jwt_file,
network_params=chain.network_params,
mev_params=chain.mev_params,
deployment_output=deployment_output,
participants=chain.participants,
num_participants=len(chains),
l1_config_env_vars=l1_config_env_vars,
l2_services_suffix="",
global_log_level="info",
global_node_selectors=[],
global_tolerations=[],
persistent=False,
additional_services=[],
observability_helper=observability_helper,
interop_params=parsed_input_args.interop,
da_server_context=da_server_context,
custom_launchers={
"el_launcher": {
"launcher": custom_launcher,
"launch_method": custom_launch,
},
},
)

el_service_name = "custom-launcher"
el_service = plan.get_service(el_service_name)
el_service_config = kurtosistest.get_service_config(el_service_name)

expect.eq(el_service_config.image, "custom-image")

pass


def custom_launcher(deployment_output, jwt_file, network, network_id):
pass


def custom_launch(
plan,
launcher,
service_name,
participant,
global_log_level,
persistent,
tolerations,
node_selectors,
existing_el_clients,
sequencer_enabled,
sequencer_context,
observability_helper,
interop_params,
):
plan.add_service("custom-launcher", ServiceConfig(image="custom-image"))

# Just some mocked data that's used in other parts of the codebase
return struct(
client_name="custom",
el_metrics_info=[],
ip_addr="192.168.0.1",
engine_rpc_port_num=123,
)
# TODO Once files are available on kurtosistest.get_service_config, make sure the JWT file is being mounted


Expand Down