Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

samlaf
Copy link

@samlaf samlaf commented Sep 4, 2024

Closes #67

Mimicing the behavior of the docker-compose devnet.

Testing

Only manually deployed everything, and checked that the op-batcher and da-server logs were normal.

README.md Outdated
Comment on lines 132 to 143
# Available services:
# - blockscout
# - da_server
additional_services: []

# Configuration place for da-server - https://github.com/ethereum-optimism/optimism/tree/develop/op-alt-da
da_server_params:
# A list of optional extra params that will be passed to the da-server container for modifying its behaviour
da_server_extra_args: []
generic_commitment: false
Copy link
Author

@samlaf samlaf Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now adding da_server to the additional_services list will by default turn on alt-da with default keccakCommitment mode. the commitment mode can be changed to generic_commitment in the da_server_params.

Given that alt-da and commitment mode and network parameters that affect other services (op-node at least), I feel like they should be somewhere more prominent. Wasn't sure if the network_params section of the config was the right place though. Also doing this might require double checking the settings passed to da_server_params to make sure they agree.

@@ -162,6 +165,9 @@ 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),
Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Author

Choose a reason for hiding this comment

The 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).

da_server_extra_args,
generic_commitment,
):
image = "us-docker.pkg.dev/oplabs-tools-artifacts/images/da-server:devnet"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the devnet tag doesn't exist and is overriding the DEFAULT in the input parser. In general I'd avoid overriding it this way. I'd also add the da_image as a config variable under da_server_params and then set the image return value for ServiceConfig as image=da_server_params.da_server_image. The input parser will populate the default value if none is set, so by default the latest image is used and if specified the config image is used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! 4598487

"--addr=0.0.0.0",
"--port=3100",
"--log.level=debug",
"--generic-commitment=" + str(generic_commitment),
Copy link
Member

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 here us-docker.pkg.dev/oplabs-tools-artifacts/images/da-server:latest is stale and missing the flag?

Copy link
Author

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

Copy link
Author

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

@tynes
Copy link

tynes commented Nov 1, 2024

A modern da-server image was published in this CI run under us-docker.pkg.dev/oplabs-tools-artifacts/images/da-server:latest

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
@samlaf
Copy link
Author

samlaf commented Nov 11, 2024

@mslipper can we sync on what's needed to make this work? Have some questions after the rebase about:

  1. now that there are multiple chains, how to deal with alt-da
    1.1 can it be turned on for one chain but not others?
  2. new deploy image
    2.1 how do I reproduce the logic that I was doing here
    2.2 since there is a single contract deployed now, how to deal with alt-da params?

Currently running into

Adding service with name 'op-cl-1-op-node-op-geth-op-kurtosis' and image 'us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:develop'
There was an error executing Starlark code 
An error occurred executing instruction (number 53) at github.com/ethpandaops/optimism-package/src/cl/op-node/op_node_launcher.star[111:38]:
  add_service(name="op-cl-1-op-node-op-geth-op-kurtosis", config=ServiceConfig(image="us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:develop", ports={"http": PortSpec(number=8547, transport_protocol="TCP", application_protocol="http"), "tcp-discovery": PortSpec(number=9003, transport_protocol="TCP", application_protocol="", wait=None), "udp-discovery": PortSpec(number=9003, transport_protocol="UDP", application_protocol="", wait=None)}, files={"/jwt": "op_jwt_fileop-kurtosis", "/network-configs": "op-deployer-configs"}, cmd=["op-node", "--l2=http://{{kurtosis:e995f4edb12d4eb3890675434a1f1568:ip_address.runtime_value}}:8551", "--l2.jwt-secret=/jwt/jwtsecret", "--verifier.l1-confs=4", "--rollup.config=/network-configs/rollup-2151908.json", "--rpc.addr=0.0.0.0", "--rpc.port=8547", "--rpc.enable-admin", "--l1=http://{{kurtosis:c8383bad3e6e4953869dc85e90c35da0:ip_address.runtime_value}}:8545", "--l1.rpckind=standard", "--l1.beacon=http://{{kurtosis:85b24650d167427881daeee5e6044c56:ip_address.runtime_value}}:4000", "--l1.trustrpc", "--p2p.advertise.ip=KURTOSIS_IP_ADDR_PLACEHOLDER", "--p2p.advertise.tcp=9003", "--p2p.advertise.udp=9003", "--p2p.listen.ip=0.0.0.0", "--p2p.listen.tcp=9003", "--p2p.listen.udp=9003", "--altda.enabled=True", "--altda.da-service=False", "--altda.da-server=http://{{kurtosis:ce7f17c729234860ba0b62c0c9403235:ip_address.runtime_value}}:3100", "--p2p.sequencer.key={{kurtosis:910094fe17b84e50bee25e6535ba1d50:output.runtime_value}}", "--sequencer.enabled", "--sequencer.l1-confs=5"], env_vars={}, private_ip_address_placeholder="KURTOSIS_IP_ADDR_PLACEHOLDER", ready_conditions=ReadyCondition(recipe=PostHttpRequestRecipe(port_id="http", endpoint="/", body="{\"jsonrpc\":\"2.0\",\"method\":\"opp2p_self\",\"params\":[],\"id\":1}", content_type="application/json", extract={"enr": ".result.ENR", "multiaddr": ".result.addresses[0]", "peer_id": ".result.peerID"}), field="code", assertion="==", target_value=200, timeout="1m"), labels={"ethereum-package.client": "op-node", "ethereum-package.client-image": "us-docker.pkg.dev-oplabs-tools-artifacts-images-op-node_develop", "ethereum-package.client-type": "beacon", "ethereum-package.connected-client": "op-geth", "ethereum-package.sha256": ""}, tolerations=[], node_selectors={}))
  Caused by: Unexpected error occurred starting service 'op-cl-1-op-node-op-geth-op-kurtosis'
  Caused by: An error occurred waiting for all TCP and UDP ports to be open for service 'op-cl-1-op-node-op-geth-op-kurtosis' with private IP '172.16.28.21'; this is usually due to a misconfiguration in the service itself, so here are the logs:
  == SERVICE 'op-cl-1-op-node-op-geth-op-kurtosis' LOGS ===================================
  t=2024-11-11T18:21:48+0000 lvl=info msg="Not opted in to ProtocolVersions signal loading, disabling ProtocolVersions contract now."
  t=2024-11-11T18:21:48+0000 lvl=info msg="No persisted sequencer state loaded"
  t=2024-11-11T18:21:48+0000 lvl=warn msg="Alt-DA Mode is a Beta feature of the MIT licensed OP Stack.  While it has received initial review from core contributors, it is still undergoing testing, and may have bugs or other issues."
  t=2024-11-11T18:21:48+0000 lvl=info msg="Rollup Config" l2_chain_id=2151908 l2_network="unknown L2" l1_chain_id=3151908 l1_network="unknown L1" l2_start_time=1731349298 l2_block_hash=0x189b7b4b79be3302539cee58b48c5e9405b62d0fa80ec2e976a5b3cf589f4732 l2_block_number=0 l1_block_hash=0xe975615094de1f0a9e07e9fff8951b3a3c9ea8d944eb7ec3b338afad02f32198 l1_block_number=12 regolith_time="@ genesis" canyon_time="@ genesis" delta_time="@ genesis" ecotone_time="@ genesis" fjord_time="@ genesis" granite_time="@ genesis" holocene_time="(not configured)" interop_time="(not configured)" alt_da=false
  t=2024-11-11T18:21:48+0000 lvl=warn msg="Alt-DA Mode is a Beta feature of the MIT licensed OP Stack.  While it has received initial review from core contributors, it is still undergoing testing, and may have bugs or other issues."
  t=2024-11-11T18:21:48+0000 lvl=info msg="Initializing rollup node" version=untagged-a786daaf-1731328107
  t=2024-11-11T18:21:48+0000 lvl=info msg="Connected to L1 Beacon API, ready for EIP-4844 blobs retrieval." version=Lighthouse/v5.3.0-2e0eb6d/aarch64-linux
  t=2024-11-11T18:21:48+0000 lvl=error msg="Error initializing the rollup node" err="failed to init L2: failed to get altDA config: no altDA config"
  t=2024-11-11T18:21:48+0000 lvl=crit msg="Application failed" message="failed to setup: unable to create the rollup node: failed to init L2: failed to get altDA config: no altDA config"
  
  == FINISHED SERVICE 'op-cl-1-op-node-op-geth-op-kurtosis' LOGS ===================================
  Caused by: An error occurred while waiting for all TCP and UDP ports to be open
  Caused by: Unsuccessful ports check for IP '172.16.28.21' and port spec '{privatePortSpec:0x40010ebd70}', even after '240' retries with '500' milliseconds in between retries. Timeout '2m0s' has been reached
  Caused by: An error occurred while calling network address '172.16.28.21:8547' with port protocol 'TCP' and using time out '200ms'
  Caused by: dial tcp 172.16.28.21:8547: i/o timeout

Also not sure why 5-8 enclaves get created now. Seems like most of them are empty anyways?

@tynes
Copy link

tynes commented Nov 19, 2024

1.1 can it be turned on for one chain but not others?

For simplicity we should enforce all altda or all rollup. Adding a single altda chain to a cluster would essentially make all of them have altda levels of security

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add alt-da workflow
3 participants