From 989f880f20fb86a7e35af1b842019c3d8af050e0 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 20 Jun 2024 15:55:02 +0200 Subject: [PATCH 01/10] feat: add magi --- .github/tests/blockscout.yaml | 3 +- .github/tests/magi.yaml | 15 +++ .github/tests/multiple_l2s.yaml | 3 +- .github/tests/op-erigon.yaml | 5 +- .github/tests/op-geth.yaml | 5 +- .github/tests/op-node.yaml | 3 +- .github/tests/op-reth.yaml | 5 +- .github/tests/single_l2.yaml | 3 +- README.md | 2 + src/cl/magi/magi_launcher.star | 205 +++++++++++++++++++++++++++++++ src/el_cl_launcher.star | 5 + src/package_io/input_parser.star | 1 + 12 files changed, 241 insertions(+), 14 deletions(-) create mode 100644 .github/tests/magi.yaml create mode 100644 src/cl/magi/magi_launcher.star diff --git a/.github/tests/blockscout.yaml b/.github/tests/blockscout.yaml index 7fd40db..55d52b4 100644 --- a/.github/tests/blockscout.yaml +++ b/.github/tests/blockscout.yaml @@ -19,5 +19,4 @@ ethereum_package: - el_type: reth network_params: preset: minimal - additional_services: - - blockscout + additional_services: [] diff --git a/.github/tests/magi.yaml b/.github/tests/magi.yaml new file mode 100644 index 0000000..bbd6a65 --- /dev/null +++ b/.github/tests/magi.yaml @@ -0,0 +1,15 @@ +optimism_package: + participants: + - el_type: op-geth + cl_type: magi + - el_type: op-reth + cl_type: magi + - el_type: op-erigon + cl_type: magi +ethereum_package: + participants: + - el_type: geth + - el_type: reth + network_params: + preset: minimal + additional_services: [] diff --git a/.github/tests/multiple_l2s.yaml b/.github/tests/multiple_l2s.yaml index f0d3606..8a2b3ee 100644 --- a/.github/tests/multiple_l2s.yaml +++ b/.github/tests/multiple_l2s.yaml @@ -17,5 +17,4 @@ ethereum_package: - el_type: reth network_params: preset: minimal - additional_services: - - dora + additional_services: [] diff --git a/.github/tests/op-erigon.yaml b/.github/tests/op-erigon.yaml index 61b150b..9afc1ac 100644 --- a/.github/tests/op-erigon.yaml +++ b/.github/tests/op-erigon.yaml @@ -2,11 +2,12 @@ optimism_package: participants: - el_type: op-erigon cl_type: op-node + - el_type: op-erigon + cl_type: magi ethereum_package: participants: - el_type: geth - el_type: reth network_params: preset: minimal - additional_services: - - dora + additional_services: [] diff --git a/.github/tests/op-geth.yaml b/.github/tests/op-geth.yaml index 1a3085b..d8c5d99 100644 --- a/.github/tests/op-geth.yaml +++ b/.github/tests/op-geth.yaml @@ -2,11 +2,12 @@ optimism_package: participants: - el_type: op-geth cl_type: op-node + - el_type: op-geth + cl_type: magi ethereum_package: participants: - el_type: geth - el_type: reth network_params: preset: minimal - additional_services: - - dora + additional_services: [] diff --git a/.github/tests/op-node.yaml b/.github/tests/op-node.yaml index 0b3bf5a..787fa92 100644 --- a/.github/tests/op-node.yaml +++ b/.github/tests/op-node.yaml @@ -12,5 +12,4 @@ ethereum_package: - el_type: reth network_params: preset: minimal - additional_services: - - dora + additional_services: [] diff --git a/.github/tests/op-reth.yaml b/.github/tests/op-reth.yaml index 0d65a6a..1719280 100644 --- a/.github/tests/op-reth.yaml +++ b/.github/tests/op-reth.yaml @@ -2,11 +2,12 @@ optimism_package: participants: - el_type: op-reth cl_type: op-node + - el_type: op-reth + cl_type: magi ethereum_package: participants: - el_type: geth - el_type: reth network_params: preset: minimal - additional_services: - - dora + additional_services: [] diff --git a/.github/tests/single_l2.yaml b/.github/tests/single_l2.yaml index dde7e3f..58d31d1 100644 --- a/.github/tests/single_l2.yaml +++ b/.github/tests/single_l2.yaml @@ -7,5 +7,4 @@ ethereum_package: - el_type: reth network_params: preset: minimal - additional_services: - - dora + additional_services: [] diff --git a/README.md b/README.md index 8523085..4bb911d 100644 --- a/README.md +++ b/README.md @@ -62,11 +62,13 @@ optimism_package: # The type of CL client that should be started # Valid values are: # op-node + # magi cl_type: op-node # The Docker image that should be used for the CL client; leave blank to use the default for the client type # Defaults by client: # - op-node: parithoshj/op-node:v1 + # - magi: a16zcrypto/magi:latest cl_image: "" # Count of nodes to spin up for this participant diff --git a/src/cl/magi/magi_launcher.star b/src/cl/magi/magi_launcher.star new file mode 100644 index 0000000..de2993f --- /dev/null +++ b/src/cl/magi/magi_launcher.star @@ -0,0 +1,205 @@ +shared_utils = import_module( + "github.com/ethpandaops/ethereum-package/src/shared_utils/shared_utils.star" +) + +cl_context = import_module( + "github.com/ethpandaops/ethereum-package/src/cl/cl_context.star" +) + +cl_node_ready_conditions = import_module( + "github.com/ethpandaops/ethereum-package/src/cl/cl_node_ready_conditions.star" +) +constants = import_module( + "github.com/ethpandaops/ethereum-package/src/package_io/constants.star" +) + +# ---------------------------------- Beacon client ------------------------------------- + +# The Docker container runs as the "magi" user so we can't write to root +BEACON_DATA_DIRPATH_ON_SERVICE_CONTAINER = "/data/magi/magi-beacon-data" +ROLLUP_CONFIG_MOUNT_PATH_ON_CONTAINER = "/network-configs/rollup.json" +# Port IDs +BEACON_TCP_DISCOVERY_PORT_ID = "tcp-discovery" +BEACON_UDP_DISCOVERY_PORT_ID = "udp-discovery" +BEACON_HTTP_PORT_ID = "http" + +# Port nums +BEACON_DISCOVERY_PORT_NUM = 9003 +BEACON_HTTP_PORT_NUM = 8547 + + +def get_used_ports(discovery_port): + used_ports = { + BEACON_TCP_DISCOVERY_PORT_ID: shared_utils.new_port_spec( + discovery_port, shared_utils.TCP_PROTOCOL, wait=None + ), + BEACON_UDP_DISCOVERY_PORT_ID: shared_utils.new_port_spec( + discovery_port, shared_utils.UDP_PROTOCOL, wait=None + ), + BEACON_HTTP_PORT_ID: shared_utils.new_port_spec( + BEACON_HTTP_PORT_NUM, + shared_utils.TCP_PROTOCOL, + shared_utils.HTTP_APPLICATION_PROTOCOL, + ), + } + return used_ports + + +ENTRYPOINT_ARGS = ["sh", "-c"] + +VERBOSITY_LEVELS = { + constants.GLOBAL_LOG_LEVEL.error: "ERROR", + constants.GLOBAL_LOG_LEVEL.warn: "WARN", + constants.GLOBAL_LOG_LEVEL.info: "INFO", + constants.GLOBAL_LOG_LEVEL.debug: "DEBUG", + constants.GLOBAL_LOG_LEVEL.trace: "TRACE", +} + + +def launch( + plan, + launcher, + service_name, + image, + el_context, + existing_cl_clients, + l1_config_env_vars, + gs_sequencer_private_key, + sequencer_enabled, +): + network_name = shared_utils.get_network_name(launcher.network) + + beacon_node_identity_recipe = PostHttpRequestRecipe( + endpoint="/", + content_type="application/json", + body='{"jsonrpc":"2.0","method":"opp2p_self","params":[],"id":1}', + port_id=BEACON_HTTP_PORT_ID, + extract={ + "enr": ".result.ENR", + "multiaddr": ".result.addresses[0]", + "peer_id": ".result.peerID", + }, + ) + + config = get_beacon_config( + plan, + launcher.el_cl_genesis_data, + launcher.jwt_file, + image, + service_name, + el_context, + existing_cl_clients, + l1_config_env_vars, + gs_sequencer_private_key, + beacon_node_identity_recipe, + sequencer_enabled, + ) + + beacon_service = plan.add_service(service_name, config) + + beacon_http_port = beacon_service.ports[BEACON_HTTP_PORT_ID] + beacon_http_url = "http://{0}:{1}".format( + beacon_service.ip_address, beacon_http_port.number + ) + + response = plan.request( + recipe=beacon_node_identity_recipe, service_name=service_name + ) + + beacon_node_enr = response["extract.enr"] + beacon_multiaddr = response["extract.multiaddr"] + beacon_peer_id = response["extract.peer_id"] + + return cl_context.new_cl_context( + "magi", + beacon_node_enr, + beacon_service.ip_address, + beacon_http_port.number, + beacon_http_url, + None, + service_name, + multiaddr=beacon_multiaddr, + peer_id=beacon_peer_id, + ) + + +def get_beacon_config( + plan, + el_cl_genesis_data, + jwt_file, + image, + service_name, + el_context, + existing_cl_clients, + l1_config_env_vars, + gs_sequencer_private_key, + beacon_node_identity_recipe, + sequencer_enabled, +): + EXECUTION_ENGINE_ENDPOINT = "http://{0}:{1}".format( + el_context.ip_addr, + el_context.engine_rpc_port_num, + ) + EXECUTION_RPC_ENDPOINT = "http://{0}:{1}".format( + el_context.ip_addr, + el_context.rpc_port_num, + ) + + used_ports = get_used_ports(BEACON_DISCOVERY_PORT_NUM) + + cmd = [ + "magi", + "--devnet", + "--jwt-file=" + constants.JWT_MOUNT_PATH_ON_CONTAINER, + "--l1-beacon-url={0}".format(l1_config_env_vars["CL_RPC_URL"]), + "--l1-rpc-url={0}".format(l1_config_env_vars["L1_RPC_URL"]), + "--l2-engine-url={0}".format(EXECUTION_ENGINE_ENDPOINT), + "--l2-rpc-url={0}".format(EXECUTION_RPC_ENDPOINT), + "--rpc-addr=0.0.0.0", + "--rpc-port={0}".format(BEACON_HTTP_PORT_NUM), + "--sync-mode=full", + "--network=optimism", + ] + + # if sequencer_enabled: + # cmd.append("--p2p.sequencer.key=" + gs_sequencer_private_key) + # cmd.append("--sequencer.enabled") + # cmd.append("--sequencer.l1-confs=5") + + if len(existing_cl_clients) > 0: + # cmd.append( + # "--p2p.bootnodes=" + # + ",".join( + # [ctx.enr for ctx in existing_cl_clients[: constants.MAX_ENR_ENTRIES]] + # ) + # ) + + files = { + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data, + constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file, + } + ports = {} + ports.update(used_ports) + + return ServiceConfig( + image=image, + ports=ports, + cmd=cmd, + files=files, + private_ip_address_placeholder=constants.PRIVATE_IP_ADDRESS_PLACEHOLDER, + ready_conditions=ReadyCondition( + recipe=beacon_node_identity_recipe, + field="code", + assertion="==", + target_value=200, + timeout="1m", + ), + ) + + +def new_magi_launcher(el_cl_genesis_data, jwt_file, network_params): + return struct( + el_cl_genesis_data=el_cl_genesis_data, + jwt_file=jwt_file, + network=network_params.network, + ) diff --git a/src/el_cl_launcher.star b/src/el_cl_launcher.star index 7dc838f..3043fce 100644 --- a/src/el_cl_launcher.star +++ b/src/el_cl_launcher.star @@ -10,6 +10,7 @@ op_reth = import_module("./el/op-reth/op_reth_launcher.star") op_erigon = import_module("./el/op-erigon/op_erigon_launcher.star") # CL op_node = import_module("./cl/op-node/op_node_launcher.star") +magi = import_module("./cl/magi/magi_launcher.star") def launch( @@ -60,6 +61,10 @@ def launch( ), "launch_method": op_node.launch, }, + "magi": { + "launcher": magi.new_magi_launcher(el_cl_data, jwt_file, network_params), + "launch_method": magi.launch, + }, } all_cl_contexts = [] diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 24edf14..9cb6220 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -10,6 +10,7 @@ DEFAULT_EL_IMAGES = { DEFAULT_CL_IMAGES = { "op-node": "parithoshj/op-node:v1", + "magi": "a16zcrypto/magi:latest", } DEFAULT_BATCHER_IMAGES = { From abe873dfda37d31fe5ae47fa851a2fa42662a9ba Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 20 Jun 2024 15:55:43 +0200 Subject: [PATCH 02/10] fix lint --- src/cl/magi/magi_launcher.star | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cl/magi/magi_launcher.star b/src/cl/magi/magi_launcher.star index de2993f..3fd53ed 100644 --- a/src/cl/magi/magi_launcher.star +++ b/src/cl/magi/magi_launcher.star @@ -166,13 +166,13 @@ def get_beacon_config( # cmd.append("--sequencer.enabled") # cmd.append("--sequencer.l1-confs=5") - if len(existing_cl_clients) > 0: - # cmd.append( - # "--p2p.bootnodes=" - # + ",".join( - # [ctx.enr for ctx in existing_cl_clients[: constants.MAX_ENR_ENTRIES]] - # ) - # ) + # if len(existing_cl_clients) > 0: + # cmd.append( + # "--p2p.bootnodes=" + # + ",".join( + # [ctx.enr for ctx in existing_cl_clients[: constants.MAX_ENR_ENTRIES]] + # ) + # ) files = { constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data, From fee45bf7cb995b04f8f55e08bd0bc436068a3563 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 21 Jun 2024 09:58:57 +0200 Subject: [PATCH 03/10] fix magi --- .github/tests/magi.yaml | 2 ++ .github/workflows/nightly.yml | 2 +- src/cl/magi/magi_launcher.star | 61 +++++++++++++++++--------------- src/package_io/input_parser.star | 3 +- 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/.github/tests/magi.yaml b/.github/tests/magi.yaml index bbd6a65..5a741ea 100644 --- a/.github/tests/magi.yaml +++ b/.github/tests/magi.yaml @@ -1,5 +1,7 @@ optimism_package: participants: + - el_type: op-geth + cl_type: op-node - el_type: op-geth cl_type: magi - el_type: op-reth diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f94d784..434a223 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -47,4 +47,4 @@ jobs: env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} with: - args: "The nightly test for ${{matrix.file_name}} on ethereum-package has failed find it here ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + args: "The nightly test for ${{matrix.file_name}} on optimism-package has failed find it here ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/src/cl/magi/magi_launcher.star b/src/cl/magi/magi_launcher.star index 3fd53ed..f041d2f 100644 --- a/src/cl/magi/magi_launcher.star +++ b/src/cl/magi/magi_launcher.star @@ -69,17 +69,17 @@ def launch( ): network_name = shared_utils.get_network_name(launcher.network) - beacon_node_identity_recipe = PostHttpRequestRecipe( - endpoint="/", - content_type="application/json", - body='{"jsonrpc":"2.0","method":"opp2p_self","params":[],"id":1}', - port_id=BEACON_HTTP_PORT_ID, - extract={ - "enr": ".result.ENR", - "multiaddr": ".result.addresses[0]", - "peer_id": ".result.peerID", - }, - ) + # beacon_node_identity_recipe = PostHttpRequestRecipe( + # endpoint="/", + # content_type="application/json", + # body='{"jsonrpc":"2.0","method":"opp2p_self","params":[],"id":1}', + # port_id=BEACON_HTTP_PORT_ID, + # extract={ + # "enr": ".result.ENR", + # "multiaddr": ".result.addresses[0]", + # "peer_id": ".result.peerID", + # }, + # ) config = get_beacon_config( plan, @@ -91,7 +91,7 @@ def launch( existing_cl_clients, l1_config_env_vars, gs_sequencer_private_key, - beacon_node_identity_recipe, + #beacon_node_identity_recipe, sequencer_enabled, ) @@ -102,24 +102,27 @@ def launch( beacon_service.ip_address, beacon_http_port.number ) - response = plan.request( - recipe=beacon_node_identity_recipe, service_name=service_name - ) + # response = plan.request( + # recipe=beacon_node_identity_recipe, service_name=service_name + # ) - beacon_node_enr = response["extract.enr"] - beacon_multiaddr = response["extract.multiaddr"] - beacon_peer_id = response["extract.peer_id"] + # beacon_node_enr = response["extract.enr"] + # beacon_multiaddr = response["extract.multiaddr"] + # beacon_peer_id = response["extract.peer_id"] return cl_context.new_cl_context( "magi", - beacon_node_enr, + #beacon_node_enr, + None, beacon_service.ip_address, beacon_http_port.number, beacon_http_url, None, service_name, - multiaddr=beacon_multiaddr, - peer_id=beacon_peer_id, + multiaddr=None, + peer_id=None, + # multiaddr=beacon_multiaddr, + # peer_id=beacon_peer_id, ) @@ -133,7 +136,7 @@ def get_beacon_config( existing_cl_clients, l1_config_env_vars, gs_sequencer_private_key, - beacon_node_identity_recipe, + #beacon_node_identity_recipe, sequencer_enabled, ): EXECUTION_ENGINE_ENDPOINT = "http://{0}:{1}".format( @@ -187,13 +190,13 @@ def get_beacon_config( cmd=cmd, files=files, private_ip_address_placeholder=constants.PRIVATE_IP_ADDRESS_PLACEHOLDER, - ready_conditions=ReadyCondition( - recipe=beacon_node_identity_recipe, - field="code", - assertion="==", - target_value=200, - timeout="1m", - ), + # ready_conditions=ReadyCondition( + # recipe=beacon_node_identity_recipe, + # field="code", + # assertion="==", + # target_value=200, + # timeout="1m", + # ), ) diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 9cb6220..68eebbf 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -10,7 +10,8 @@ DEFAULT_EL_IMAGES = { DEFAULT_CL_IMAGES = { "op-node": "parithoshj/op-node:v1", - "magi": "a16zcrypto/magi:latest", + #"magi": "a16zcrypto/magi:latest", + "magi": "bbusa/magi:latest", } DEFAULT_BATCHER_IMAGES = { From cdb23ce9b30e50d673add3b8cc69526f7b7ca90b Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 21 Jun 2024 10:03:11 +0200 Subject: [PATCH 04/10] fix lint --- src/cl/magi/magi_launcher.star | 6 +++--- src/package_io/input_parser.star | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cl/magi/magi_launcher.star b/src/cl/magi/magi_launcher.star index f041d2f..927cd65 100644 --- a/src/cl/magi/magi_launcher.star +++ b/src/cl/magi/magi_launcher.star @@ -91,7 +91,7 @@ def launch( existing_cl_clients, l1_config_env_vars, gs_sequencer_private_key, - #beacon_node_identity_recipe, + # beacon_node_identity_recipe, sequencer_enabled, ) @@ -112,7 +112,7 @@ def launch( return cl_context.new_cl_context( "magi", - #beacon_node_enr, + # beacon_node_enr, None, beacon_service.ip_address, beacon_http_port.number, @@ -136,7 +136,7 @@ def get_beacon_config( existing_cl_clients, l1_config_env_vars, gs_sequencer_private_key, - #beacon_node_identity_recipe, + # beacon_node_identity_recipe, sequencer_enabled, ): EXECUTION_ENGINE_ENDPOINT = "http://{0}:{1}".format( diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 68eebbf..afebb2c 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -10,7 +10,7 @@ DEFAULT_EL_IMAGES = { DEFAULT_CL_IMAGES = { "op-node": "parithoshj/op-node:v1", - #"magi": "a16zcrypto/magi:latest", + # "magi": "a16zcrypto/magi:latest", "magi": "bbusa/magi:latest", } From da4c6ac5867b1aef3b965abab31cc53f493b28b5 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 21 Jun 2024 17:32:51 +0200 Subject: [PATCH 05/10] use upstream docker image --- src/package_io/input_parser.star | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index afebb2c..9cb6220 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -10,8 +10,7 @@ DEFAULT_EL_IMAGES = { DEFAULT_CL_IMAGES = { "op-node": "parithoshj/op-node:v1", - # "magi": "a16zcrypto/magi:latest", - "magi": "bbusa/magi:latest", + "magi": "a16zcrypto/magi:latest", } DEFAULT_BATCHER_IMAGES = { From f24eab3c1282bda616e51233262714a9fe3912bb Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 21 Jun 2024 17:39:13 +0200 Subject: [PATCH 06/10] use upstream docker image --- src/package_io/input_parser.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 9cb6220..a5b66b4 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -10,7 +10,7 @@ DEFAULT_EL_IMAGES = { DEFAULT_CL_IMAGES = { "op-node": "parithoshj/op-node:v1", - "magi": "a16zcrypto/magi:latest", + "magi": "a16zcrypto/magi:master", } DEFAULT_BATCHER_IMAGES = { From 4786cf1bc354d12db2a008634fad4ce0ae3459ca Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 15 Jul 2024 17:18:34 +0200 Subject: [PATCH 07/10] fix lint --- src/el_cl_launcher.star | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/el_cl_launcher.star b/src/el_cl_launcher.star index ca6f911..5674b21 100644 --- a/src/el_cl_launcher.star +++ b/src/el_cl_launcher.star @@ -75,7 +75,8 @@ def launch( "hildr": { "launcher": hildr.new_hildr_launcher(el_cl_data, jwt_file, network_params), "launch_method": hildr.launch, - "magi": { + }, + "magi": { "launcher": magi.new_magi_launcher(el_cl_data, jwt_file, network_params), "launch_method": magi.launch, }, From 314281f5f50a7edaa0e3052bc0bfb144787c3f27 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 15 Jul 2024 17:23:39 +0200 Subject: [PATCH 08/10] fix test --- .github/tests/magi.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/tests/magi.yaml b/.github/tests/magi.yaml index 5a741ea..5db2def 100644 --- a/.github/tests/magi.yaml +++ b/.github/tests/magi.yaml @@ -8,10 +8,3 @@ optimism_package: cl_type: magi - el_type: op-erigon cl_type: magi -ethereum_package: - participants: - - el_type: geth - - el_type: reth - network_params: - preset: minimal - additional_services: [] From 42d27715692ab4866218fa8694bf3768cd906c80 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 29 Aug 2024 19:05:59 +0200 Subject: [PATCH 09/10] fix some typos, update contexts --- src/cl/magi/magi_launcher.star | 18 ++++++------------ src/contracts/contract_deployer.star | 2 +- src/package_io/sanity_check.star | 1 - 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/cl/magi/magi_launcher.star b/src/cl/magi/magi_launcher.star index 927cd65..ac3672b 100644 --- a/src/cl/magi/magi_launcher.star +++ b/src/cl/magi/magi_launcher.star @@ -111,18 +111,12 @@ def launch( # beacon_peer_id = response["extract.peer_id"] return cl_context.new_cl_context( - "magi", - # beacon_node_enr, - None, - beacon_service.ip_address, - beacon_http_port.number, - beacon_http_url, - None, - service_name, - multiaddr=None, - peer_id=None, - # multiaddr=beacon_multiaddr, - # peer_id=beacon_peer_id, + client_name="magi", + enr="", # beacon_node_enr, + ip_addr=beacon_service.ip_address, + http_port=beacon_http_port.number, + beacon_http_url=beacon_http_url, + beacon_service_name=service_name, ) diff --git a/src/contracts/contract_deployer.star b/src/contracts/contract_deployer.star index f0beb62..e240b2e 100644 --- a/src/contracts/contract_deployer.star +++ b/src/contracts/contract_deployer.star @@ -151,7 +151,7 @@ def deploy_l2_contracts( l1_deposit_start_block = plan.run_sh( name="read-l1-deposit-start-block", - description="Getting the L1StandardBridgeProxy address", + description="Getting l1 deposit start block", image="badouralix/curl-jq", run="jq -r .genesis.l1.number /network-configs/rollup.json | tr -d '\n'", files={"/network-configs": op_genesis.files_artifacts[0]}, diff --git a/src/package_io/sanity_check.star b/src/package_io/sanity_check.star index e938863..00e48ca 100644 --- a/src/package_io/sanity_check.star +++ b/src/package_io/sanity_check.star @@ -51,7 +51,6 @@ def validate_params(plan, input_args, category, allowed_params): def sanity_check(plan, input_args): - if type(input_args) == "list": return "Cant bother with your input, you shall pass" From bbbf7677faa8aa568545e28008e76de98cc222cc Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 25 Sep 2024 22:09:34 +0200 Subject: [PATCH 10/10] fix rebase --- .github/tests/magi.yaml | 19 ++++++++++--------- src/cl/magi/magi_launcher.star | 21 +++++++-------------- src/el_cl_launcher.star | 4 +++- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/tests/magi.yaml b/.github/tests/magi.yaml index 5db2def..af5c605 100644 --- a/.github/tests/magi.yaml +++ b/.github/tests/magi.yaml @@ -1,10 +1,11 @@ optimism_package: - participants: - - el_type: op-geth - cl_type: op-node - - el_type: op-geth - cl_type: magi - - el_type: op-reth - cl_type: magi - - el_type: op-erigon - cl_type: magi + chains: + - participants: + - el_type: op-geth + cl_type: op-node + - el_type: op-geth + cl_type: magi + - el_type: op-reth + cl_type: magi + - el_type: op-erigon + cl_type: magi diff --git a/src/cl/magi/magi_launcher.star b/src/cl/magi/magi_launcher.star index ac3672b..292e9e6 100644 --- a/src/cl/magi/magi_launcher.star +++ b/src/cl/magi/magi_launcher.star @@ -64,11 +64,8 @@ def launch( el_context, existing_cl_clients, l1_config_env_vars, - gs_sequencer_private_key, sequencer_enabled, ): - network_name = shared_utils.get_network_name(launcher.network) - # beacon_node_identity_recipe = PostHttpRequestRecipe( # endpoint="/", # content_type="application/json", @@ -83,14 +80,12 @@ def launch( config = get_beacon_config( plan, - launcher.el_cl_genesis_data, - launcher.jwt_file, + launcher, image, service_name, el_context, existing_cl_clients, l1_config_env_vars, - gs_sequencer_private_key, # beacon_node_identity_recipe, sequencer_enabled, ) @@ -122,14 +117,12 @@ def launch( def get_beacon_config( plan, - el_cl_genesis_data, - jwt_file, + launcher, image, service_name, el_context, existing_cl_clients, l1_config_env_vars, - gs_sequencer_private_key, # beacon_node_identity_recipe, sequencer_enabled, ): @@ -172,8 +165,8 @@ def get_beacon_config( # ) files = { - constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data, - constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: launcher.deployment_output, + constants.JWT_MOUNTPOINT_ON_CLIENTS: launcher.jwt_file, } ports = {} ports.update(used_ports) @@ -194,9 +187,9 @@ def get_beacon_config( ) -def new_magi_launcher(el_cl_genesis_data, jwt_file, network_params): +def new_magi_launcher(deployment_output, jwt_file, network_params): return struct( - el_cl_genesis_data=el_cl_genesis_data, + deployment_output=deployment_output, jwt_file=jwt_file, - network=network_params.network, + network_params=network_params, ) diff --git a/src/el_cl_launcher.star b/src/el_cl_launcher.star index 942dcf9..8d00fba 100644 --- a/src/el_cl_launcher.star +++ b/src/el_cl_launcher.star @@ -88,7 +88,9 @@ def launch( "launch_method": hildr.launch, }, "magi": { - "launcher": magi.new_magi_launcher(el_cl_data, jwt_file, network_params), + "launcher": magi.new_magi_launcher( + deployment_output, jwt_file, network_params + ), "launch_method": magi.launch, }, }