-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for alt-da with da-server
fix: type bugs in da_server related configs chore: refactor da-server launcher to not hardcode image feat: add optimism repo as submodule to build da-server image revert: changes to network_params.yaml
- Loading branch information
Showing
14 changed files
with
209 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "optimism"] | ||
path = optimism | ||
url = [email protected]:ethereum-optimism/optimism.git |
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,98 @@ | ||
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" | ||
) | ||
|
||
# The dirpath of the data directory on the da-server container | ||
# note that we use /home which is available but not persistent | ||
# because we aren't mounting an external kurtosis file | ||
# this means that the data is lost when the container is deleted | ||
DATA_DIRPATH_ON_DA_SERVER_CONTAINER = "/home" | ||
|
||
# Port IDs | ||
DA_SERVER_HTTP_PORT_ID = "http" | ||
|
||
# Port nums | ||
DA_SERVER_HTTP_PORT_NUM = 3100 | ||
|
||
|
||
def get_used_ports(): | ||
used_ports = { | ||
DA_SERVER_HTTP_PORT_ID: shared_utils.new_port_spec( | ||
DA_SERVER_HTTP_PORT_NUM, | ||
shared_utils.TCP_PROTOCOL, | ||
shared_utils.HTTP_APPLICATION_PROTOCOL, | ||
), | ||
} | ||
return used_ports | ||
|
||
def launch( | ||
plan, | ||
service_name, | ||
image, | ||
da_server_extra_args, | ||
generic_commitment, | ||
): | ||
|
||
config = get_da_server_config( | ||
plan, | ||
service_name, | ||
image, | ||
da_server_extra_args, | ||
generic_commitment, | ||
) | ||
|
||
da_server_service = plan.add_service(service_name, config) | ||
|
||
http_url = "http://{0}:{1}".format(da_server_service.ip_address, DA_SERVER_HTTP_PORT_NUM) | ||
return new_da_server_context( | ||
http_url=http_url, | ||
generic_commitment=generic_commitment, | ||
) | ||
|
||
|
||
def get_da_server_config( | ||
plan, | ||
service_name, | ||
image, | ||
da_server_extra_args, | ||
generic_commitment, | ||
): | ||
ports = get_used_ports() | ||
|
||
cmd = [ | ||
"da-server", | ||
"--file.path=" + DATA_DIRPATH_ON_DA_SERVER_CONTAINER, | ||
"--addr=0.0.0.0", | ||
"--port=3100", | ||
"--log.level=debug", | ||
"--generic-commitment=" + str(generic_commitment), | ||
] | ||
|
||
if len(da_server_extra_args) > 0: | ||
cmd.extend([param for param in da_server_extra_args]) | ||
|
||
return ServiceConfig( | ||
image=image, | ||
ports=ports, | ||
cmd=cmd, | ||
private_ip_address_placeholder=constants.PRIVATE_IP_ADDRESS_PLACEHOLDER, | ||
) | ||
|
||
def disabled_da_server_context(): | ||
return new_da_server_context( | ||
http_url="", | ||
generic_commitment=True, | ||
) | ||
|
||
def new_da_server_context( | ||
http_url, | ||
generic_commitment | ||
): | ||
return struct( | ||
enabled=http_url != "", | ||
http_url=http_url, | ||
generic_commitment=generic_commitment, | ||
) |
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
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
Oops, something went wrong.