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

Modularize ops-bedrock devnet #10608

Closed
jinmel opened this issue May 22, 2024 · 8 comments
Closed

Modularize ops-bedrock devnet #10608

jinmel opened this issue May 22, 2024 · 8 comments

Comments

@jinmel
Copy link

jinmel commented May 22, 2024

Is your feature request related to a problem? Please describe.

The current ops-bedrock devnet is defined in one docker-compose.yml file. This makes spinning up multiple L2s on devnet difficult. We need to have arbitrary number of L2s defined in devnet to test interoperability of opstack chains.

Describe the solution you'd like

Split the docker compose yaml file into base.yml defining containers for L1 layer, and overlays-l2.yml defining containers for L2 layer. Then we can do docker compose -f base.yml -f overlays-l2-A.yml -f overlays-l2-B ... The role and responsibility of the devnet launch script is to manage the meta data files into separate directories so that user can deploy arbitrarily number of L2s to the same devnet.

In order to deduplicate the container definitions in overlays-l2-x.yml, we use extends directive to inherit common configuration for any L2 layer, overriding chain specific metadata and configuration files for each L2 deployments

Describe alternatives you've considered

Defining additional L2 chains statically in docker compose file: It loses extensibility to multiple L2 chains if we are going to test interop message across arbitrary number of chains. If testing interoperability of two chains is enough, this could also be a reasonable choice since it incurs lesser change to current codebase

Additional context

@tynes
Copy link
Contributor

tynes commented May 22, 2024

Hey @jinmel, I would be very supportive of this change and would review a PR if you submitted it

@jinmel
Copy link
Author

jinmel commented May 24, 2024

Hey @tynes, I was working on extending the current ops-bedrock docker compose project and felt that trying to fit multiple L2s into a single Docker Compose setup might not be very scalable and incurs some inevitable hacks such as writing a template for docker compose and generating with different container names. It seems like I might be reinventing the wheel, given what Kubernetes and Kustomize already accomplishes. What are your thoughts on keeping the current devnet as it is and creating a new directory with Kubernetes/Kustomize configurations? This way, people could easily extend it with their own components. For instance, we could run arbistack and opstack within the same network.

@tynes
Copy link
Contributor

tynes commented May 24, 2024

I would prefer to not create a completely new solution for a devnet as it would create additional maintenance overhead for the team. We used to have a minikube based local devnet but at some point we migrated to docker compose. We want to optimize the devnet for easy maintenance and easy + reliable usage for devs who develop their applications on top of it. I would prefer to implement something more minimal that may introduce some tech debt, for example scoping the implementation directly to only supporting 2 L2s. This would remove the need to implement arbitrary templating. Would this unblock your usecase? Then in the future, the project of further improving the devnet can be revisited

@jinmel
Copy link
Author

jinmel commented May 27, 2024

@tynes Great point and thanks for the clear scope of this PR.

@jinmel
Copy link
Author

jinmel commented May 29, 2024

@tynes I first tried to remove the allocs and make all the l1 and l2 genesis dynamic so that it is extensible to multiple L2s in future, but I just found out that allocs to genesis files is important for unitests here: https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts-bedrock#test-setup. I attempted to squeeze in two set of allocs into L1 genesis for two chains, but it seems to create more tech debt than actual gain. What would you say if we had a devnet launch script dedicated for cross chain testing only?

@tynes
Copy link
Contributor

tynes commented Jun 1, 2024

We spoke about a plan going forward:

  • Create an interop devnet deploy script that uses the L1 contracts deploy twice
  • Update the devnet python code in a minimal way to call the interop devnet deploy script, perhaps with an --interop flag
  • Update the devnet python code so that it can call docker compose up twice to bring up 2 L2 systems

The goal is to very minimally modify the python devnet code, since it has a lot of tech debt. This will immediately unblock the development of applications that utilize interop.

For the interop deploy script, it should set the deploy script into state similar to the pattern here:

vm.etch(address(cfg), vm.getDeployedCode("DeployConfig.s.sol:DeployConfig"));
vm.label(address(cfg), "DeployConfig");
vm.allowCheatcodes(address(cfg));

This ensures that we don't have the compile overhead that comes with using CREATE directly in the code, resulting in bloated bytecode

For longer term, we can consider using kurtosis. This can serve the basis for a new devnet as well as a multi client test suite

jinmel added a commit to jinmel/optimism that referenced this issue Jun 8, 2024
 - Deploy script for multiple L2 chains in devnet
 - resolves ethereum-optimism#10608
@tedim52
Copy link

tedim52 commented Jun 13, 2024

Here's a pull request that builds on top of @barnabasbusa work on the optimism-package, it allows you to spin up N optimism rollups locally: ethpandaops/optimism-package#20. Hopefully this helps

protolambda pushed a commit that referenced this issue Aug 1, 2024
Interop deployer script

 - Deploy script for multiple L2 chains in devnet
 - resolves #10608

refactor InteropDeploy.s.sol

interop deployer script

Generates allocs for the interop devnet

Add l2-interop services to docker-compose.yml

Add two interop devnet build targets to the Makefile

L2 interop devnet launch script

lint fix

remove unused import

indent fix

add chain id to op-e2e config

fix failing e2e ci/cd

remove devnetL1-interop.json

revert op-e2e/config/init.go to the original state

force fault proof and no plasma

remove unused env var

dedupe docker images build for interop services

 - Reuse the same docker image as default rollup for all interop
   services
protolambda pushed a commit that referenced this issue Aug 1, 2024
Interop deployer script

 - Deploy script for multiple L2 chains in devnet
 - resolves #10608

refactor InteropDeploy.s.sol

interop deployer script

Generates allocs for the interop devnet

Add l2-interop services to docker-compose.yml

Add two interop devnet build targets to the Makefile

L2 interop devnet launch script

lint fix

remove unused import

indent fix

add chain id to op-e2e config

fix failing e2e ci/cd

remove devnetL1-interop.json

revert op-e2e/config/init.go to the original state

force fault proof and no plasma

remove unused env var

dedupe docker images build for interop services

 - Reuse the same docker image as default rollup for all interop
   services
@protolambda
Copy link
Contributor

Closing. The whole devnet has been refactored into a Kurtosis setup.

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 a pull request may close this issue.

4 participants