-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for alt-da with da-server #69
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
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, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ def launch( | |
existing_cl_clients, | ||
l1_config_env_vars, | ||
sequencer_enabled, | ||
da_server_context, | ||
): | ||
beacon_node_identity_recipe = PostHttpRequestRecipe( | ||
endpoint="/", | ||
|
@@ -104,6 +105,7 @@ def launch( | |
l1_config_env_vars, | ||
beacon_node_identity_recipe, | ||
sequencer_enabled, | ||
da_server_context, | ||
) | ||
|
||
beacon_service = plan.add_service(service_name, config) | ||
|
@@ -148,6 +150,7 @@ def get_beacon_config( | |
l1_config_env_vars, | ||
beacon_node_identity_recipe, | ||
sequencer_enabled, | ||
da_server_context, | ||
): | ||
EXECUTION_ENGINE_ENDPOINT = "http://{0}:{1}".format( | ||
el_context.ip_addr, | ||
|
@@ -178,7 +181,11 @@ def get_beacon_config( | |
"--p2p.listen.ip=0.0.0.0", | ||
"--p2p.listen.tcp={0}".format(BEACON_DISCOVERY_PORT_NUM), | ||
"--p2p.listen.udp={0}".format(BEACON_DISCOVERY_PORT_NUM), | ||
"--altda.enabled=" + str(da_server_context.enabled), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar check would be needed here instead of adding it by default to all nodes irrespective of if the da server is present There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see my other comment. enabled is set to false by default, so its safe to add by default (and is what the other docker-compose devnet was doing). |
||
"--altda.da-service=" + str(da_server_context.generic_commitment), | ||
"--altda.da-server=" + da_server_context.http_url, | ||
] | ||
plan.print(da_server_context.generic_commitment) | ||
|
||
sequencer_private_key = util.read_network_config_value( | ||
plan, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
da_server
image complains on this at startup:Incorrect Usage: flag provided but not defined: -generic-commitment
I'd image the
latest
image found hereus-docker.pkg.dev/oplabs-tools-artifacts/images/da-server:latest
is stale and missing the flag?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes confirmed that the latest image is missing the flag. And the more recent one v0.1.0-rc.1 from June gives me this error when I try to run on my mac:
rosetta error: failed to open elf at /lib/ld-musl-x86_64.so.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIth the latest kurtosis 1.3 release I was able to add optimism repo as a submodule and build the da-server image locally: e709d7c