Skip to content

Commit 825b5f5

Browse files
authored
feat: adds support for permissionless game, challenger interop support (ethpandaops#155)
* refactors contract deployment intent file building to use dicts instead of awkward toml builder (serialization to toml is now ugly but will fix this soon) * deploy the permissionless dispute game * adds interop support for challenger (needed to move outside of the l2 deployment submodule)
1 parent 4a2e7be commit 825b5f5

File tree

10 files changed

+220
-217
lines changed

10 files changed

+220
-217
lines changed

main.star

+46-18
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ l2_launcher = import_module("./src/l2.star")
44
op_supervisor_launcher = import_module(
55
"./src/interop/op-supervisor/op_supervisor_launcher.star"
66
)
7+
op_challenger_launcher = import_module(
8+
"./src/challenger/op-challenger/op_challenger_launcher.star"
9+
)
710

811
observability = import_module("./src/observability/observability.star")
912
prometheus = import_module("./src/observability/prometheus/prometheus_launcher.star")
@@ -103,37 +106,62 @@ def run(plan, args):
103106
name="op_jwt_file",
104107
)
105108

106-
all_participants = []
109+
l2s = []
107110
for l2_num, chain in enumerate(optimism_args_with_right_defaults.chains):
108-
all_participants += l2_launcher.launch_l2(
109-
plan,
110-
l2_num,
111-
chain.network_params.name,
112-
chain,
113-
jwt_file,
114-
deployment_output,
115-
l1_config_env_vars,
116-
l1_priv_key,
117-
l1_rpc_url,
118-
global_log_level,
119-
global_node_selectors,
120-
global_tolerations,
121-
persistent,
122-
observability_helper,
123-
interop_params,
111+
l2s.append(
112+
l2_launcher.launch_l2(
113+
plan,
114+
l2_num,
115+
chain.network_params.name,
116+
chain,
117+
jwt_file,
118+
deployment_output,
119+
l1_config_env_vars,
120+
l1_priv_key,
121+
l1_rpc_url,
122+
global_log_level,
123+
global_node_selectors,
124+
global_tolerations,
125+
persistent,
126+
observability_helper,
127+
interop_params,
128+
)
124129
)
125130

126131
if interop_params.enabled:
127132
op_supervisor_launcher.launch(
128133
plan,
129134
l1_config_env_vars,
130135
optimism_args_with_right_defaults.chains,
131-
all_participants,
136+
l2s,
132137
jwt_file,
133138
interop_params.supervisor_params,
134139
observability_helper,
135140
)
136141

142+
# challenger must launch after supervisor because it depends on it for interop
143+
for l2_num, l2 in enumerate(l2s):
144+
chain = optimism_args_with_right_defaults.chains[l2_num]
145+
op_challenger_image = (
146+
chain.challenger_params.image
147+
if chain.challenger_params.image != ""
148+
else input_parser.DEFAULT_CHALLENGER_IMAGES["op-challenger"]
149+
)
150+
op_challenger_launcher.launch(
151+
plan,
152+
l2_num,
153+
"op-challenger-{0}".format(chain.network_params.name),
154+
chain.challenger_params.image,
155+
l2.participants[0].el_context,
156+
l2.participants[0].cl_context,
157+
l1_config_env_vars,
158+
deployment_output,
159+
chain.network_params,
160+
chain.challenger_params,
161+
interop_params,
162+
observability_helper,
163+
)
164+
137165
if observability_helper.enabled and len(observability_helper.metrics_jobs) > 0:
138166
plan.print("Launching prometheus...")
139167
prometheus_private_url = prometheus.launch_prometheus(

src/challenger/op-challenger/op_challenger_launcher.star

+27-8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ ethereum_package_constants = import_module(
99
observability = import_module("../../observability/observability.star")
1010
prometheus = import_module("../../observability/prometheus/prometheus_launcher.star")
1111

12+
interop_constants = import_module("../../interop/constants.star")
13+
util = import_module("../../util.star")
14+
1215
#
1316
# ---------------------------------- Challenger client -------------------------------------
1417
CHALLENGER_DATA_DIRPATH_ON_SERVICE_CONTAINER = "/data/op-challenger/op-challenger-data"
@@ -22,32 +25,32 @@ def get_used_ports():
2225

2326
def launch(
2427
plan,
28+
l2_num,
2529
service_name,
2630
image,
2731
el_context,
2832
cl_context,
2933
l1_config_env_vars,
30-
gs_challenger_private_key,
31-
game_factory_address,
3234
deployment_output,
3335
network_params,
3436
challenger_params,
37+
interop_params,
3538
observability_helper,
3639
):
3740
challenger_service_name = "{0}".format(service_name)
3841

3942
config = get_challenger_config(
4043
plan,
44+
l2_num,
4145
service_name,
4246
image,
4347
el_context,
4448
cl_context,
4549
l1_config_env_vars,
46-
gs_challenger_private_key,
47-
game_factory_address,
4850
deployment_output,
4951
network_params,
5052
challenger_params,
53+
interop_params,
5154
observability_helper,
5255
)
5356

@@ -62,20 +65,33 @@ def launch(
6265

6366
def get_challenger_config(
6467
plan,
68+
l2_num,
6569
service_name,
6670
image,
6771
el_context,
6872
cl_context,
6973
l1_config_env_vars,
70-
gs_challenger_private_key,
71-
game_factory_address,
7274
deployment_output,
7375
network_params,
7476
challenger_params,
77+
interop_params,
7578
observability_helper,
7679
):
7780
ports = dict(get_used_ports())
7881

82+
game_factory_address = util.read_network_config_value(
83+
plan,
84+
deployment_output,
85+
"state",
86+
".opChainDeployments[{0}].disputeGameFactoryProxyAddress".format(l2_num),
87+
)
88+
challenger_key = util.read_network_config_value(
89+
plan,
90+
deployment_output,
91+
"challenger-{0}".format(network_params.network_id),
92+
".privateKey",
93+
)
94+
7995
cmd = [
8096
"op-challenger",
8197
"--cannon-l2-genesis="
@@ -93,9 +109,9 @@ def get_challenger_config(
93109
"--l1-beacon=" + l1_config_env_vars["CL_RPC_URL"],
94110
"--l1-eth-rpc=" + l1_config_env_vars["L1_RPC_URL"],
95111
"--l2-eth-rpc=" + el_context.rpc_http_url,
96-
"--private-key=" + gs_challenger_private_key,
112+
"--private-key=" + challenger_key,
97113
"--rollup-rpc=" + cl_context.beacon_http_url,
98-
"--trace-type=" + "cannon,permissioned",
114+
"--trace-type=" + ",".join(challenger_params.cannon_trace_types),
99115
]
100116

101117
# configure files
@@ -109,6 +125,9 @@ def get_challenger_config(
109125
if observability_helper.enabled:
110126
observability.configure_op_service_metrics(cmd, ports)
111127

128+
if interop_params.enabled:
129+
cmd.append("--supervisor-rpc=" + interop_constants.SUPERVISOR_ENDPOINT)
130+
112131
if (
113132
challenger_params.cannon_prestate_path
114133
and challenger_params.cannon_prestates_url

0 commit comments

Comments
 (0)