Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Oct 21, 2024
1 parent e5a9dc4 commit 12453af
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 11 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,13 @@ optimism_package:
# Defaults to True
fund_dev_accounts: true

# Default batcher configuration
batcher_params:
# The Docker image that should be used for the batcher; leave blank to use the default op-batcher image
batcher_image: ""
image: ""

# A list of optional extra params that will be passed to the batcher container for modifying its behaviour
extra_params: []

# Additional services to run alongside the network
# Defaults to []
Expand Down
4 changes: 3 additions & 1 deletion network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ optimism_package:
holocene_time_offset: ""
interop_time_offset: ""
fund_dev_accounts: true
batcher_image: ""
batcher_params:
image: ""
extra_params: []
additional_services: []
op_contract_deployer_params:
image: mslipper/op-deployer:latest
Expand Down
5 changes: 5 additions & 0 deletions src/batcher/op-batcher/op_batcher_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def launch(
cl_context,
l1_config_env_vars,
gs_batcher_private_key,
batcher_params,
):
batcher_service_name = "{0}".format(service_name)

Expand All @@ -51,6 +52,7 @@ def launch(
cl_context,
l1_config_env_vars,
gs_batcher_private_key,
batcher_params,
)

batcher_service = plan.add_service(service_name, config)
Expand All @@ -71,6 +73,7 @@ def get_batcher_config(
cl_context,
l1_config_env_vars,
gs_batcher_private_key,
batcher_params,
):
cmd = [
"op-batcher",
Expand All @@ -90,6 +93,8 @@ def get_batcher_config(
"--data-availability-type=blobs",
]

cmd += batcher_params.extra_params

ports = get_used_ports()
return ServiceConfig(
image=image,
Expand Down
2 changes: 2 additions & 0 deletions src/cl/hildr/hildr_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ def get_beacon_config(
)
)

cmd += participant.cl_extra_params

files = {
ethereum_package_constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: launcher.deployment_output,
ethereum_package_constants.JWT_MOUNTPOINT_ON_CLIENTS: launcher.jwt_file,
Expand Down
2 changes: 2 additions & 0 deletions src/cl/op-node/op_node_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def get_beacon_config(
)
)

cmd += participant.cl_extra_params

files = {
ethereum_package_constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: launcher.deployment_output,
ethereum_package_constants.JWT_MOUNTPOINT_ON_CLIENTS: launcher.jwt_file,
Expand Down
2 changes: 2 additions & 0 deletions src/l2.star
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def launch_l2(
persistent,
):
network_params = l2_args.network_params
batcher_params = l2_args.batcher_params

plan.print("Deploying L2 with name {0}".format(network_params.name))
jwt_file = plan.upload_files(
Expand All @@ -34,6 +35,7 @@ def launch_l2(
l2_args.participants,
jwt_file,
network_params,
batcher_params,
deployment_output,
l1_config,
l2_services_suffix,
Expand Down
22 changes: 15 additions & 7 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ DEFAULT_PROPOSER_IMAGES = {
"op-proposer": "us-docker.pkg.dev/oplabs-tools-artifacts/images/op-proposer:develop",
}

ATTR_TO_BE_SKIPPED_AT_ROOT = (
"network_params",
"participants",
)

DEFAULT_ADDITIONAL_SERVICES = []


Expand Down Expand Up @@ -87,7 +82,10 @@ def input_parser(plan, input_args):
],
interop_time_offset=result["network_params"]["interop_time_offset"],
fund_dev_accounts=result["network_params"]["fund_dev_accounts"],
batcher_image=result["network_params"]["batcher_image"],
),
batcher_params=struct(
image=result["batcher_params"]["image"],
extra_params=result["batcher_params"]["extra_params"],
),
additional_services=result["additional_services"],
)
Expand All @@ -114,6 +112,9 @@ def parse_network_params(plan, input_args):
network_params = default_network_params()
network_params.update(chain.get("network_params", {}))

batcher_params = default_batcher_params()
batcher_params.update(chain.get("batcher_params", {}))

network_name = network_params["name"]
network_id = network_params["network_id"]

Expand Down Expand Up @@ -157,6 +158,7 @@ def parse_network_params(plan, input_args):
result = {
"participants": participants,
"network_params": network_params,
"batcher_params": batcher_params,
"additional_services": chain.get(
"additional_services", DEFAULT_ADDITIONAL_SERVICES
),
Expand Down Expand Up @@ -189,6 +191,7 @@ def default_chains():
{
"participants": [default_participant()],
"network_params": default_network_params(),
"batcher_params": default_batcher_params(),
"additional_services": DEFAULT_ADDITIONAL_SERVICES,
}
]
Expand All @@ -205,7 +208,12 @@ def default_network_params():
"holocene_time_offset": None,
"interop_time_offset": None,
"fund_dev_accounts": True,
"batcher_image": "",
}

def default_batcher_params():
return {
"image": "",
"extra_params": [],
}


Expand Down
2 changes: 1 addition & 1 deletion src/package_io/sanity_check.star
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ SUBCATEGORY_PARAMS = {
"holocene_time_offset",
"interop_time_offset",
"fund_dev_accounts",
"batcher_image",
],
"batcher_params": ["image", "extra_params"],
}

OP_CONTRACT_DEPLOYER_PARAMS = [
Expand Down
4 changes: 3 additions & 1 deletion src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def launch_participant_network(
participants,
jwt_file,
network_params,
batcher_params,
deployment_output,
l1_config_env_vars,
l2_services_suffix,
Expand Down Expand Up @@ -66,7 +67,7 @@ def launch_participant_network(
".privateKey",
)

op_batcher_image = network_params.batcher_image if network_params.batcher_image != "" else input_parser.DEFAULT_BATCHER_IMAGES["op-batcher"]
op_batcher_image = batcher_params.image if batcher_params.image != "" else input_parser.DEFAULT_BATCHER_IMAGES["op-batcher"]

op_batcher_launcher.launch(
plan,
Expand All @@ -76,6 +77,7 @@ def launch_participant_network(
all_cl_contexts[0],
l1_config_env_vars,
batcher_key,
batcher_params,
)

# The OP Stack don't run the proposer anymore, it has been replaced with the challenger
Expand Down

0 comments on commit 12453af

Please sign in to comment.