-
Notifications
You must be signed in to change notification settings - Fork 9
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
10 changed files
with
254 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
shared_utils = import_module( | ||
"github.com/ethpandaops/ethereum-package/src/shared_utils/shared_utils.star" | ||
) | ||
|
||
constants = import_module( | ||
"github.com/ethpandaops/ethereum-package/src/package_io/constants.star" | ||
) | ||
|
||
# | ||
# ---------------------------------- Rundler client ------------------------------------- | ||
# The Docker container runs as the "op-batcher" user so we can't write to root | ||
BATCHER_DATA_DIRPATH_ON_SERVICE_CONTAINER = "/data/op-batcher/op-batcher-data" | ||
|
||
# Port IDs | ||
BATCHER_HTTP_PORT_ID = "http" | ||
|
||
# Port nums | ||
BATCHER_HTTP_PORT_NUM = 8548 | ||
|
||
|
||
def get_used_ports(): | ||
used_ports = { | ||
BATCHER_HTTP_PORT_ID: shared_utils.new_port_spec( | ||
BATCHER_HTTP_PORT_NUM, | ||
shared_utils.TCP_PROTOCOL, | ||
shared_utils.HTTP_APPLICATION_PROTOCOL, | ||
), | ||
} | ||
return used_ports | ||
|
||
|
||
ENTRYPOINT_ARGS = ["sh", "-c"] | ||
|
||
|
||
def launch( | ||
plan, | ||
service_name, | ||
image, | ||
el_context, | ||
cl_context, | ||
l1_config_env_vars, | ||
gs_batcher_private_key, | ||
): | ||
batcher_service_name = "{0}".format(service_name) | ||
|
||
config = get_batcher_config( | ||
plan, | ||
image, | ||
service_name, | ||
el_context, | ||
cl_context, | ||
l1_config_env_vars, | ||
gs_batcher_private_key, | ||
) | ||
|
||
batcher_service = plan.add_service(service_name, config) | ||
|
||
batcher_http_port = batcher_service.ports[BATCHER_HTTP_PORT_ID] | ||
batcher_http_url = "http://{0}:{1}".format( | ||
batcher_service.ip_address, batcher_http_port.number | ||
) | ||
|
||
return "op_batcher" | ||
|
||
|
||
def get_batcher_config( | ||
plan, | ||
image, | ||
service_name, | ||
el_context, | ||
cl_context, | ||
l1_config_env_vars, | ||
gs_batcher_private_key, | ||
): | ||
cmd = [ | ||
"op-batcher", | ||
"--l2-eth-rpc=" + el_context.rpc_http_url, | ||
"--rollup-rpc=" + cl_context.beacon_http_url, | ||
"--poll-interval=1s", | ||
"--sub-safety-margin=6", | ||
"--num-confirmations=1", | ||
"--safe-abort-nonce-too-low-count=3", | ||
"--resubmission-timeout=30s", | ||
"--rpc.addr=0.0.0.0", | ||
"--rpc.port=" + str(BATCHER_HTTP_PORT_NUM), | ||
"--rpc.enable-admin", | ||
"--max-channel-duration=1", | ||
"--l1-eth-rpc=" + l1_config_env_vars["L1_RPC_URL"], | ||
"--private-key=" + gs_batcher_private_key, | ||
"--data-availability-type=blobs", | ||
] | ||
|
||
ports = get_used_ports() | ||
return ServiceConfig( | ||
image=image, | ||
ports=ports, | ||
cmd=cmd, | ||
private_ip_address_placeholder=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# The path on the module container where static files are housed | ||
STATIC_FILES_DIRPATH = "/static_files" | ||
|
||
# Entry Point Config | ||
ENTRYPOINT_CONFIG_FILE_PATH = ( | ||
STATIC_FILES_DIRPATH + "/rundler/entrypoint_config.json" | ||
) | ||
|
||
# Mempool Config | ||
MEMPOOL_CONFIG_FILE_PATH = ( | ||
STATIC_FILES_DIRPATH + "/rundler/mempool_config.json" | ||
) |
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,17 @@ | ||
{ | ||
"entryPoints": [ | ||
{ | ||
"address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", | ||
"builders": [ | ||
{ | ||
"count": 1, | ||
"proxy": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", | ||
"filterId": "pbh-aggregator" | ||
}, | ||
{ | ||
"count": 1 | ||
} | ||
] | ||
} | ||
] | ||
} |
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,16 @@ | ||
{ | ||
"0x0000000000000000000000000000000000000000000000000000000000000000": { | ||
"description": "WorldChain Devnet Mempool", | ||
"chainIds": ["0x20D5E4"], | ||
"entryPoint": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", | ||
"allowlist": [], | ||
"filters": [ | ||
{ | ||
"id": "pbh-aggregator", | ||
"filter": { | ||
"aggregator": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9" | ||
} | ||
} | ||
] | ||
} | ||
} |
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,10 @@ | ||
== Logs == | ||
Deploying: EntryPoint, PBHEntryPoint, PBHEntryPointImplV1, PBHSignatureAggregator, PBHSafe4337Module | ||
EntryPoint Deployed at: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 | ||
PBHEntryPointImplV1 Deployed at: 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 | ||
PBHEntryPoint Deployed at: 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 | ||
PBHSignatureAggregator Deployed at: 0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9 | ||
PBH4337Module Deployed at: 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 | ||
SafeModuleSetup Deployed at: 0x0165878A594ca255338adfa4d48449f69242Eb8F | ||
Safe Singleton Deployed at: 0xa513E6E4b8f2a923D98304ec87F64353C4D5C853 | ||
SafeProxyFactory Deployed at: 0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6 |
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