Skip to content
Merged
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
31 changes: 31 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ethereum_package = import_module("github.com/ethpandaops/ethereum-package/main.star")
contract_deployer = import_module("./src/contracts/contract_deployer.star")
l2_launcher = import_module("./src/l2.star")
l2_launcher__hack = import_module("./src/l2__hack.star")
superchain_launcher = import_module("./src/superchain/launcher.star")
supervisor_launcher = import_module("./src/supervisor/launcher.star")
op_challenger_launcher = import_module("./src/challenger/op-challenger/launcher.star")
Expand Down Expand Up @@ -171,6 +172,36 @@ def run(plan, args={}):
observability_helper=observability_helper,
)

for index, chain in enumerate(optimism_args.chains):
# We filter out the supervisors applicable to this network
l2_supervisors_params = [
supervisor_params
for supervisor_params in optimism_args.supervisors
if chain.network_params.network_id
in supervisor_params.superchain.participants
]

original_l2_output__hack = l2s[index]

l2_launcher__hack.launch_l2__hack(
original_l2_output__hack=original_l2_output__hack,
plan=plan,
l2_services_suffix=chain.network_params.name,
l2_args=chain,
jwt_file=jwt_file,
deployment_output=deployment_output,
l1_config=l1_config_env_vars,
l1_priv_key=l1_priv_key,
l1_rpc_url=l1_rpc_url,
global_log_level=global_log_level,
global_node_selectors=global_node_selectors,
global_tolerations=global_tolerations,
persistent=persistent,
observability_helper=observability_helper,
supervisors_params=l2_supervisors_params,
registry=registry,
)

if optimism_args.faucet.enabled:
_install_faucet(
plan=plan,
Expand Down
2 changes: 1 addition & 1 deletion src/conductor/op-conductor/launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_service_config(
#
# TODO This might be later added as a multiplier parameter if needed
"OP_CONDUCTOR_HEALTHCHECK_UNSAFE_INTERVAL": str(
network_params.seconds_per_slot * 3
network_params.seconds_per_slot * 2 + 1
),
"OP_CONDUCTOR_LOG_FORMAT": "logfmt",
"OP_CONDUCTOR_LOG_LEVEL": "info",
Expand Down
61 changes: 61 additions & 0 deletions src/l2__hack.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
participant_network__hack = import_module("./participant_network__hack.star")
blockscout = import_module("./blockscout/blockscout_launcher.star")
_da_server_launcher = import_module("./da/da-server/launcher.star")
_tx_fuzzer_launcher = import_module("./tx-fuzzer/launcher.star")
contract_deployer = import_module("./contracts/contract_deployer.star")
input_parser = import_module("./package_io/input_parser.star")
util = import_module("./util.star")


def launch_l2__hack(
original_l2_output__hack,
plan,
l2_services_suffix,
l2_args,
jwt_file,
deployment_output,
l1_config,
l1_priv_key,
l1_rpc_url,
global_log_level,
global_node_selectors,
global_tolerations,
persistent,
observability_helper,
supervisors_params,
registry=None,
):
network_params = l2_args.network_params
proxyd_params = l2_args.proxyd_params
batcher_params = l2_args.batcher_params
proposer_params = l2_args.proposer_params
mev_params = l2_args.mev_params
conductor_params = l2_args.conductor_params
tx_fuzzer_params = l2_args.tx_fuzzer_params

plan.print("Deploying L2 with name {0}, part 2".format(network_params.name))

participant_network__hack.launch_participant_network__hack(
original_participant_network_output__hack=original_l2_output__hack,
plan=plan,
participants=l2_args.participants,
jwt_file=jwt_file,
network_params=network_params,
proxyd_params=proxyd_params,
batcher_params=batcher_params,
proposer_params=proposer_params,
mev_params=mev_params,
conductor_params=conductor_params,
deployment_output=deployment_output,
l1_config_env_vars=l1_config,
l2_services_suffix=l2_services_suffix,
global_log_level=global_log_level,
global_node_selectors=global_node_selectors,
global_tolerations=global_tolerations,
persistent=persistent,
additional_services=l2_args.additional_services,
observability_helper=observability_helper,
supervisors_params=supervisors_params,
da_server_context=original_l2_output__hack.da_server_context__hack,
registry=registry,
)
97 changes: 1 addition & 96 deletions src/participant_network.star
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
el_cl_client_launcher = import_module("./el_cl_launcher.star")
participant_module = import_module("./participant.star")
input_parser = import_module("./package_io/input_parser.star")
_op_batcher_launcher = import_module("./batcher/op-batcher/launcher.star")
_op_conductor_launcher = import_module("./conductor/op-conductor/launcher.star")
_op_proposer_launcher = import_module("./proposer/op-proposer/launcher.star")
_proxyd_launcher = import_module("./proxyd/launcher.star")
util = import_module("./util.star")
_net = import_module("/src/util/net.star")
Expand Down Expand Up @@ -82,101 +79,9 @@ def launch_participant_network(
observability_helper=observability_helper,
)

conductor_context = (
_op_conductor_launcher.launch(
plan=plan,
params=conductor_params,
network_params=network_params,
deployment_output=deployment_output,
# FIXME We need to plumb the legacy args into the new format so that we make our lives easier when we're switching
el_params=struct(
service_name=all_el_contexts[0].ip_addr,
ports={
_net.RPC_PORT_NAME: _net.port(
number=all_el_contexts[0].rpc_port_num
)
},
),
cl_params=struct(
service_name=all_cl_contexts[0].ip_addr,
ports={
_net.RPC_PORT_NAME: _net.port(number=all_cl_contexts[0].http_port)
},
),
observability_helper=observability_helper,
).context
if conductor_params
else None
)

batcher_key = util.read_network_config_value(
plan,
deployment_output,
"batcher-{0}".format(network_params.network_id),
".privateKey",
)
_op_batcher_launcher.launch(
plan=plan,
params=batcher_params,
# FIXME We need to plumb the legacy args into the new format so that we make our lives easier when we're switching
sequencers_params=[
struct(
el=struct(
service_name=all_el_contexts[0].ip_addr,
ports={
_net.RPC_PORT_NAME: _net.port(
number=all_el_contexts[0].rpc_port_num
)
},
),
cl=struct(
service_name=all_cl_contexts[0].ip_addr,
ports={
_net.RPC_PORT_NAME: _net.port(
number=all_cl_contexts[0].http_port
)
},
),
# Conductor params are not being parsed yet
conductor_params=None,
)
],
l1_config_env_vars=l1_config_env_vars,
gs_batcher_private_key=batcher_key,
network_params=network_params,
observability_helper=observability_helper,
da_server_context=da_server_context,
)

# We'll grab the game factory address from the deployments
game_factory_address = util.read_network_config_value(
plan,
deployment_output,
"state",
'.opChainDeployments[] | select(.id=="{0}") | .DisputeGameFactoryProxy'.format(
util.to_hex_chain_id(network_params.network_id)
),
)

proposer_key = util.read_network_config_value(
plan,
deployment_output,
"proposer-{0}".format(network_params.network_id),
".privateKey",
)
_op_proposer_launcher.launch(
plan=plan,
params=proposer_params,
cl_context=all_cl_contexts[0],
l1_config_env_vars=l1_config_env_vars,
gs_proposer_private_key=proposer_key,
game_factory_address=game_factory_address,
network_params=network_params,
observability_helper=observability_helper,
)

return struct(
name=network_params.name,
network_id=network_params.network_id,
participants=all_participants,
da_server_context__hack=da_server_context,
)
128 changes: 128 additions & 0 deletions src/participant_network__hack.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
_op_batcher_launcher = import_module("./batcher/op-batcher/launcher.star")
_op_conductor_launcher = import_module("./conductor/op-conductor/launcher.star")
_op_proposer_launcher = import_module("./proposer/op-proposer/launcher.star")
util = import_module("./util.star")
_net = import_module("/src/util/net.star")
_registry = import_module("./package_io/registry.star")


def launch_participant_network__hack(
original_participant_network_output__hack,
plan,
participants,
jwt_file,
network_params,
proxyd_params,
batcher_params,
proposer_params,
mev_params,
conductor_params,
deployment_output,
l1_config_env_vars,
l2_services_suffix,
global_log_level,
global_node_selectors,
global_tolerations,
persistent,
additional_services,
observability_helper,
supervisors_params,
da_server_context,
registry=_registry.Registry(),
):
# In the legacy setup the first node is always the sequencer
sequencer_participant = original_participant_network_output__hack.participants[0]
conductor_context = (
_op_conductor_launcher.launch(
plan=plan,
params=conductor_params,
network_params=network_params,
deployment_output=deployment_output,
# FIXME We need to plumb the legacy args into the new format so that we make our lives easier when we're switching
el_params=struct(
service_name=sequencer_participant.el_context.ip_addr,
ports={
_net.RPC_PORT_NAME: _net.port(
number=sequencer_participant.el_context.rpc_port_num
)
},
),
cl_params=struct(
service_name=sequencer_participant.cl_context.ip_addr,
ports={
_net.RPC_PORT_NAME: _net.port(
number=sequencer_participant.cl_context.http_port
)
},
),
observability_helper=observability_helper,
).context
if conductor_params
else None
)

batcher_key = util.read_network_config_value(
plan,
deployment_output,
"batcher-{0}".format(network_params.network_id),
".privateKey",
)
_op_batcher_launcher.launch(
plan=plan,
params=batcher_params,
# FIXME We need to plumb the legacy args into the new format so that we make our lives easier when we're switching
sequencers_params=[
struct(
el=struct(
service_name=sequencer_participant.el_context.ip_addr,
ports={
_net.RPC_PORT_NAME: _net.port(
number=sequencer_participant.el_context.rpc_port_num
)
},
),
cl=struct(
service_name=sequencer_participant.cl_context.ip_addr,
ports={
_net.RPC_PORT_NAME: _net.port(
number=sequencer_participant.cl_context.http_port
)
},
),
# Conductor params are not being parsed yet
conductor_params=None,
)
],
l1_config_env_vars=l1_config_env_vars,
gs_batcher_private_key=batcher_key,
network_params=network_params,
observability_helper=observability_helper,
da_server_context=da_server_context,
)

# We'll grab the game factory address from the deployments
game_factory_address = util.read_network_config_value(
plan,
deployment_output,
"state",
'.opChainDeployments[] | select(.id=="{0}") | .DisputeGameFactoryProxy'.format(
util.to_hex_chain_id(network_params.network_id)
),
)

proposer_key = util.read_network_config_value(
plan,
deployment_output,
"proposer-{0}".format(network_params.network_id),
".privateKey",
)
_op_proposer_launcher.launch(
plan=plan,
params=proposer_params,
cl_context=sequencer_participant.cl_context,
l1_config_env_vars=l1_config_env_vars,
gs_proposer_private_key=proposer_key,
game_factory_address=game_factory_address,
network_params=network_params,
observability_helper=observability_helper,
)
Loading