optimism
optimism copied to clipboard
[DO NOT MERGE] Add a second L2 to `op-e2e`
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()
}
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.
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?
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)
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:
Found curl command with unencrypted URL (e.g. HTTP, FTP, etc.)
Semgrep found 9 sol-style-return-arg-fmt findings:
- packages/contracts-bedrock/scripts/Deployer.sol: L615, L613, L606, L575, L277, L266, L205, L114, L101
Named return arguments to functions must be appended with an underscore (_)
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.
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.
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.
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.
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.