optimism icon indicating copy to clipboard operation
optimism copied to clipboard

[DO NOT MERGE] Add a second L2 to `op-e2e`

Open spacesailor24 opened this issue 1 year ago • 7 comments

A quick and dirty implementation of adding a second hardcoded L2 to op-e2e

~I put this together to help me understand how op-e2e's devnet works, while also providing something to unblock interop cross L2 testing while I transition to working on the larger generalization refactor (https://github.com/ethereum-optimism/protocol-quest/issues/152)~ There is a larger op-e2e refactor on the horizon that's still in the planning phase. This PR would be used to immediately unblock interop testing while the overhaul refactor is implemented

This PR exports a new DefaultSystemConfigInterop function which will return a SystemConfigInterop struct with a Start command that will spin up two L2s (one with chain ID 901 and the other with 902) connected to the same L1 (with chain id 900)

Example Usage:

package op_e2e

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestMultipleL2s(t *testing.T) {
	cfg := DefaultSystemConfigInterop(t)
	sys, err := cfg.Start(t)
	require.Nil(t, err, "Error starting up system")
	defer sys.Close()
}

spacesailor24 avatar Jan 10 '24 02:01 spacesailor24

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 25.26%. Comparing base (ab56faa) to head (31c43ee).

Additional details and impacted files
@@                  Coverage Diff                  @@
##           interop-prototype    #8923      +/-   ##
=====================================================
- Coverage              34.16%   25.26%   -8.91%     
=====================================================
  Files                    172      124      -48     
  Lines                   7258     4976    -2282     
  Branches                1238     1087     -151     
=====================================================
- Hits                    2480     1257    -1223     
+ Misses                  4629     3616    -1013     
+ Partials                 149      103      -46     
Flag Coverage Δ
cannon-go-tests ?
chain-mon-tests 27.14% <ø> (ø)
common-ts-tests ?
contracts-bedrock-tests 19.48% <ø> (ø)
contracts-ts-tests 12.25% <ø> (ø)
core-utils-tests ?
sdk-next-tests 42.18% <ø> (ø)
sdk-tests 42.18% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 48 files with indirect coverage changes

codecov[bot] avatar Jan 10 '24 03:01 codecov[bot]

Nice! How'd this help your understanding of op-e2e?

Are you planning on experimenting with splitting up existing config/start code rather c/p the code?

hamdiallam avatar Jan 10 '24 06:01 hamdiallam

Are you planning on experimenting with splitting up existing config/start code rather c/p the code?

Hamdi and I discussed that after creating some POC deposit/withdraw tests to verify both L2s are configured correctly, the next step would be decoupling the need for L2s to be configured before an L1 can be spun up. The end result of this decoupling would be that op-e2e can start an L1 with a vanilla genesis, then N number of L2s can be dynamically added to the L1 as needed (as opposed to required L2 contracts being added to L1 genesis, required L2 details to be known before the L1 can be started)

spacesailor24 avatar Jan 11 '24 03:01 spacesailor24

Semgrep found 4 port-all-interfaces findings:

Service port is exposed on all interfaces

Ignore this finding from port-all-interfaces.

Semgrep found 2 curl-unencrypted-url findings:

  • op-exporter/README.md: L16
  • indexer/docker-compose.yml: L164

Found curl command with unencrypted URL (e.g. HTTP, FTP, etc.)

Ignore this finding from curl-unencrypted-url.

semgrep-app[bot] avatar Jan 16 '24 22:01 semgrep-app[bot]

Semgrep found 9 sol-style-return-arg-fmt findings:

Named return arguments to functions must be appended with an underscore (_)

Ignore this finding from sol-style-return-arg-fmt.

semgrep-app[bot] avatar Jan 18 '24 04:01 semgrep-app[bot]

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Feb 02 '24 01:02 github-actions[bot]

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Feb 20 '24 01:02 github-actions[bot]

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Mar 07 '24 01:03 github-actions[bot]

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Mar 22 '24 01:03 github-actions[bot]

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Apr 08 '24 01:04 github-actions[bot]