-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
src/challenger/op-challenger/op_challenger_launcher.star
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
ethereum_package_shared_utils = import_module( | ||
"github.com/ethpandaops/ethereum-package/src/shared_utils/shared_utils.star" | ||
) | ||
|
||
ethereum_package_constants = import_module( | ||
"github.com/ethpandaops/ethereum-package/src/package_io/constants.star" | ||
) | ||
|
||
# | ||
# ---------------------------------- Challenger client ------------------------------------- | ||
CHALLENGER_DATA_DIRPATH_ON_SERVICE_CONTAINER = "/data/op-challenger/op-challenger-data" | ||
ENTRYPOINT_ARGS = ["sh", "-c"] | ||
|
||
|
||
def get_used_ports(): | ||
used_ports = {} | ||
return used_ports | ||
|
||
|
||
def launch( | ||
plan, | ||
service_name, | ||
image, | ||
el_context, | ||
cl_context, | ||
l1_config_env_vars, | ||
gs_challenger_private_key, | ||
game_factory_address, | ||
deployment_output, | ||
prestates_artifact, | ||
network_params, | ||
challenger_params, | ||
): | ||
challenger_service_name = "{0}".format(service_name) | ||
|
||
config = get_challenger_config( | ||
plan, | ||
service_name, | ||
image, | ||
el_context, | ||
cl_context, | ||
l1_config_env_vars, | ||
gs_challenger_private_key, | ||
game_factory_address, | ||
deployment_output, | ||
prestates_artifact, | ||
network_params, | ||
challenger_params, | ||
) | ||
|
||
challenger_service = plan.add_service(service_name, config) | ||
|
||
return "op_challenger" | ||
|
||
|
||
def get_challenger_config( | ||
plan, | ||
service_name, | ||
image, | ||
el_context, | ||
cl_context, | ||
l1_config_env_vars, | ||
gs_challenger_private_key, | ||
game_factory_address, | ||
deployment_output, | ||
prestates_artifact, | ||
network_params, | ||
challenger_params, | ||
): | ||
cmd = [ | ||
"op-challenger", | ||
"--cannon-l2-genesis=" | ||
+ ethereum_package_constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS | ||
+ "/genesis-{0}.json".format(network_params.network_id), | ||
"--cannon-prestate=/prestates/prestate-proof.json", | ||
"--cannon-rollup-config=" | ||
+ ethereum_package_constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS | ||
+ "/rollup-{0}.json".format(network_params.network_id), | ||
"--game-factory-address=" + game_factory_address, | ||
"--datadir=" + CHALLENGER_DATA_DIRPATH_ON_SERVICE_CONTAINER, | ||
"--l1-beacon=" + l1_config_env_vars["CL_RPC_URL"], | ||
"--l1-eth-rpc=" + l1_config_env_vars["L1_RPC_URL"], | ||
"--l2-eth-rpc=" + el_context.rpc_http_url, | ||
"--private-key=" + gs_challenger_private_key, | ||
"--rollup-rpc=" + cl_context.beacon_http_url, | ||
"--trace-type=" + "cannon,permissioned", | ||
] | ||
cmd += challenger_params.extra_params | ||
cmd = "mkdir -p {0} && {1}".format( | ||
CHALLENGER_DATA_DIRPATH_ON_SERVICE_CONTAINER, " ".join(cmd) | ||
) | ||
|
||
files = { | ||
ethereum_package_constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: deployment_output, | ||
"/prestates": prestates_artifact, | ||
} | ||
|
||
ports = get_used_ports() | ||
return ServiceConfig( | ||
image=image, | ||
ports=ports, | ||
entrypoint=ENTRYPOINT_ARGS, | ||
cmd=[cmd], | ||
files=files, | ||
private_ip_address_placeholder=ethereum_package_constants.PRIVATE_IP_ADDRESS_PLACEHOLDER, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"step": 0, | ||
"pre": "0x03ce1018d75e7f6fbd5e815d64376e1e82a1334456d5a50be0afabeb17a8a421", | ||
"post": "0x0315e881131ef96baffee5184c11c953c7fdfd9285c718cb1ac54a6283c0ea5f", | ||
"state-data": "0x7918ea9554d1b92c840422beadbbd557fa73e66054bc7e06e4c3100367d1e07e000000000000000000000000000000000000000000000000000000000000000000000000000b8e60000b8e640000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007fffd0000000000000000000", | ||
"proof-data": "0x0802e3940000000000000000000000003c01000b2421617c00200008000000008fb7000023bd00f802e00008000000008fa4000023a500040802e39c00000000e6e13ab33c13b7c5ab8dd2460d69d876b824fabf1a061c1de6b52b5059932274db9f30f7255f6be0c6bb974735e3723b3aa819e698556497dbbced9276dc5711652054894e3720fc284b59fc2cab41b8719ad830df29b1c60f393b52d10b98dcedb7e9ffde946fd94f6b2c10b8501ef0193f796656df23aefe537e9a28ffb3ea1ff0a7b9c78670b358b4a0876b2a64ad9006f281facecfec6f4d19c95f4a9ff1d9ddf4224339581003567680d0425facaa73fc6c558ce7767f7ce7451b6aeb801a931a0f0cb866780afd50d61ecd99f52099cefe1ac83f0f3f59c93ce559dd164dc2bc151618c363f38bbfe60a194bd7f239da7eead37fc9271d9a3fd26be85e3db62c86327a8ac8a238265089d931e8ce786881bfe13017c2765b39830875e7ab2a7aedc8d01896c7f7298f10dc8ea15e7ab41750bc7dd6ababfaa8112667b94ed7d7eb2f10bd66bc811505e4728e327ee428e1d89314cac1b6c6a5056504ed6f90a88d44ed0eed9cc7cf9ffec8a44d2e2047a80a260560a95a1906b8e93fa116d2321217e50c05cc0cf5bd69778766cfc63a79cac154b653e9e54177ac4d063edba23c9e364396c62106276860881d8b417d8c16254b5554da28f1e17355f5322b1acc8bea58f0ee9d21f1ff415cacd3460159067ec583ef505f5c2cf1b847b832e5e82e32a2e92ad0a79a9742c465b1383b0f19547b0c308e0b6a637bd531ed482dabb189dbdf9909c82569c822b07a8ed5110418c133764d43785a8fa75b69f138bc4002ffc97516bad2ebfabe121735495387b5072e67a640b0ca8ccb0114224cfa7c0cf3009790ac96e2f7689df915a0ae88b82e238668aefdb3478ab2ffc1e3dd17153f19fe95d2af10a51a85cf0f09b72ee1d6a118be2be1d35845b9f4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd95a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e3774df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652cdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef595531c28e98ea6e36fe4ab6cace6caf693027a8539fe6ee29c3deafe1b70ec5b8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" | ||
} | ||
|