Skip to content

Commit

Permalink
op-e2e: Support specifying allocs in tests (ethereum-optimism#12216)
Browse files Browse the repository at this point in the history
* op-e2e: Support specifying allocs in tests

Previously, the E2E test suite read a hardcoded set of allocs from the `.devnet` directory. There could only be one logical set of allocs per test suite run. To get around this limitation, we added matrix jobs to the CI pipeline that swapped in different versions of the allocs for alt-DA, MT Cannon, fault proofs, and the L2OO. This was very inefficient and complex: most tests don't need to run against multiple versions of the allocs, and were running 4 separate build jobs when only one was needed.

This PR makes it possible for an individual test to request a specific allocs file. We can now run tests for multiple different configurations of the OP Stack - e.g. alt-DA, L2OO and fault proofs - in a single test run.

To make this work, I updated the test suite's initialization method to read alloc files from multiple suffixed `.devnet-` directories. I made a a new `make devnet-allocs-tests` task to generate them. The allocs are then added to a map, and the rest of the tests use getter methods in the `config` package to locate the appropriate configuration structs.

This PR seems large, but most of the modified files contain limited changes to comply with the new API for selecting test configuration based on alloc type. For example, an `allocType` configuration parameter was added to various system config structs and the `DefaultRollupTestParams` variable was made into a method so that it always returns a copy for easy extension. The important logic happens in the following files:

- Makefile
- .circleci/config.yml
- op-e2e/config/init.go

As part of this PR, I also cleaned up a few issues:

- I removed the external OP Geth shim. It wasn't used anywhere, and was introducing a lot of complexity for little gain.
- I refactored some tests to use top-level test methods rather than subtests so that they could be more easily parallelized.
- I removed references to `UseFaultProofs`, `UseAltDA`, and other environment-based test flags from test utilities. We shouldn't be reading from the environment in test utils. Instead, we should pass in the behavior we want to the test utils themselves.

* code review updates

* fix gastoken test

* fixes
  • Loading branch information
mslipper authored and samlaf committed Nov 10, 2024
1 parent d1b2507 commit da2d5c7
Show file tree
Hide file tree
Showing 67 changed files with 561 additions and 1,263 deletions.
72 changes: 11 additions & 61 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,28 +255,9 @@ jobs:
FOUNDRY_PROFILE: ci
working_directory: packages/contracts-bedrock
- run:
name: Generate L2OO allocs
name: Generate allocs
command: |
DEVNET_L2OO="true" make devnet-allocs
cp -r .devnet/ .devnet-l2oo/
- run:
name: Generate AltDA allocs
command: |
DEVNET_ALTDA="true" make devnet-allocs
cp -r .devnet/ .devnet-altda/
- run:
name: Generate Generic AltDA allocs
command: |
DEVNET_ALTDA="true" GENERIC_ALTDA="true" make devnet-allocs
cp -r .devnet/ .devnet-altda-generic/
- run:
name: Generate MT-Cannon allocs
command: |
USE_MT_CANNON="true" make devnet-allocs
cp -r .devnet/ .devnet-mt-cannon/
- run:
name: Generate default allocs
command: make devnet-allocs
make devnet-allocs-tests
- save_cache:
name: Save Go modules cache
key: gomod-contracts-build-{{ checksum "go.sum" }}
Expand All @@ -296,9 +277,10 @@ jobs:
- "packages/contracts-bedrock/deploy-config/devnetL1.json"
- "packages/contracts-bedrock/deployments/devnetL1"
- ".devnet"
- ".devnet-standard"
- ".devnet-l2oo"
- ".devnet-altda"
- ".devnet-altda-generic"
- ".devnet-alt-da"
- ".devnet-alt-da-generic"
- ".devnet-mt-cannon"
- notify-failures-on-develop

Expand Down Expand Up @@ -929,39 +911,19 @@ jobs:
description: Slack user or group to mention when notifying of failures
type: string
default: ""
environment:
DEVNET_L2OO: 'false'
OP_E2E_USE_L2OO: 'false'
docker:
- image: <<pipeline.parameters.ci_builder_image>>
resource_class: xlarge
parallelism: <<parameters.parallelism>>
steps:
- checkout
- when:
condition:
equal: ['-l2oo', <<parameters.variant>>]
steps:
- run:
name: Set DEVNET_L2OO = true
command: echo 'export DEVNET_L2OO=true' >> $BASH_ENV
- run:
name: Set OP_E2E_USE_L2OO = true
command: echo 'export OP_E2E_USE_L2OO=true' >> $BASH_ENV
- when:
condition:
equal: ['-altda', <<parameters.variant>>]
steps:
- run:
name: Set OP_E2E_USE_ALTDA = true
command: echo 'export OP_E2E_USE_ALTDA=true' >> $BASH_ENV
- when:
condition:
equal: ['-mt-cannon', <<parameters.variant>>]
steps:
- run:
name: Set OP_E2E_USE_MT_CANNON = true
command: echo 'export OP_E2E_USE_MT_CANNON=true' >> $BASH_ENV
name: Set OP_E2E_ALLOC_TYPE = mt-cannon
command: echo 'export OP_E2E_ALLOC_TYPE=mt-cannon' >> $BASH_ENV
- check-changed:
patterns: op-(.+),cannon,contracts-bedrock
- run:
Expand All @@ -981,12 +943,7 @@ jobs:
name: Load devnet-allocs and artifacts
command: |
mkdir -p .devnet
cp /tmp/workspace/.devnet<<parameters.variant>>/allocs-l2-delta.json .devnet/allocs-l2-delta.json
cp /tmp/workspace/.devnet<<parameters.variant>>/allocs-l2-ecotone.json .devnet/allocs-l2-ecotone.json
cp /tmp/workspace/.devnet<<parameters.variant>>/allocs-l2-fjord.json .devnet/allocs-l2-fjord.json
cp /tmp/workspace/.devnet<<parameters.variant>>/allocs-l2-granite.json .devnet/allocs-l2-granite.json
cp /tmp/workspace/.devnet<<parameters.variant>>/allocs-l1.json .devnet/allocs-l1.json
cp /tmp/workspace/.devnet<<parameters.variant>>/addresses.json .devnet/addresses.json
cp -r /tmp/workspace/.devnet* .
cp -r /tmp/workspace/packages/contracts-bedrock/forge-artifacts packages/contracts-bedrock/forge-artifacts
cp /tmp/workspace/packages/contracts-bedrock/deploy-config/devnetL1.json packages/contracts-bedrock/deploy-config/devnetL1.json
cp -r /tmp/workspace/packages/contracts-bedrock/deployments/devnetL1 packages/contracts-bedrock/deployments/devnetL1
Expand Down Expand Up @@ -1470,21 +1427,15 @@ workflows:
uses_artifacts: true
requires: ["contracts-bedrock-build"]
- go-e2e-test:
name: op-e2e-HTTP-tests<< matrix.variant >>
matrix:
parameters:
variant: ["", "-l2oo"]
name: op-e2e-HTTP-tests
module: op-e2e
target: test-http
parallelism: 4
parallelism: 8
requires:
- go-mod-download
- contracts-bedrock-build
- go-e2e-test:
name: op-e2e-action-tests<< matrix.variant >>
matrix:
parameters:
variant: ["", "-l2oo", "-altda"]
name: op-e2e-action-tests
module: op-e2e
target: test-actions
parallelism: 1
Expand Down Expand Up @@ -1526,7 +1477,6 @@ workflows:
- op-e2e-HTTP-tests
- op-e2e-fault-proof-tests
- op-e2e-action-tests
- op-e2e-action-tests-altda
# Not needed for the devnet but we want to make sure they build successfully
- cannon-docker-build
- op-dispute-mon-docker-build
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ packages/contracts-bedrock/deployments/anvil
!.envrc.example
*.log

.devnet
.devnet*

# Ignore local fuzzing results
**/testdata/fuzz/
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,19 @@ devnet-allocs: pre-devnet ## Generates allocations for the local devnet
PYTHONPATH=./bedrock-devnet $(PYTHON) ./bedrock-devnet/main.py --monorepo-dir=. --allocs
.PHONY: devnet-allocs

devnet-allocs-tests:
DEVNET_L2OO=true make devnet-allocs
cp -r .devnet/ .devnet-l2oo/
DEVNET_ALTDA=true make devnet-allocs
cp -r .devnet/ .devnet-alt-da/
DEVNET_ALTDA=false GENERIC_ALTDA=true make devnet-allocs
cp -r .devnet/ .devnet-alt-da-generic/
USE_MT_CANNON=true make devnet-allocs
cp -r .devnet/ .devnet-mt-cannon
make devnet-allocs
cp -r .devnet/ .devnet-standard/
.PHONY: devnet-allocs-tests

devnet-logs: ## Displays logs for the local devnet
@(cd ./ops-bedrock && docker compose logs -f)
.PHONY: devnet-logs
Expand Down
9 changes: 0 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ require (
github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416
github.com/olekukonko/tablewriter v0.0.5
github.com/onsi/gomega v1.34.1
github.com/pkg/errors v0.9.1
github.com/pkg/profile v1.7.0
github.com/prometheus/client_golang v1.20.4
Expand Down Expand Up @@ -86,7 +85,6 @@ require (
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/donovanhide/eventsource v0.0.0-20210830082556-c59027999da0 // indirect
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
Expand Down Expand Up @@ -136,9 +134,6 @@ require (
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 // indirect
github.com/karalabe/hid v1.0.1-0.20240306101548-573246063e52 // indirect
github.com/kilic/bls12-381 v0.1.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/koron/go-ssdp v0.0.4 // indirect
github.com/kr/pretty v0.3.1 // indirect
Expand Down Expand Up @@ -206,9 +201,6 @@ require (
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/protolambda/bls12-381-util v0.1.0 // indirect
github.com/protolambda/zrnt v0.32.2 // indirect
github.com/protolambda/ztyp v0.2.2 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/quic-go v0.46.0 // indirect
github.com/quic-go/webtransport-go v0.8.0 // indirect
Expand All @@ -234,7 +226,6 @@ require (
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.etcd.io/bbolt v1.3.5 // indirect
go.uber.org/automaxprocs v1.5.2 // indirect
go.uber.org/dig v1.18.0 // indirect
go.uber.org/fx v1.22.2 // indirect
go.uber.org/mock v0.4.0 // indirect
Expand Down
20 changes: 0 additions & 20 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnm
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/donovanhide/eventsource v0.0.0-20210830082556-c59027999da0 h1:C7t6eeMaEQVy6e8CarIhscYQlNmw5e3G36y7l7Y21Ao=
github.com/donovanhide/eventsource v0.0.0-20210830082556-c59027999da0/go.mod h1:56wL82FO0bfMU5RvfXoIwSOP2ggqqxT+tAfNEIyxuHw=
github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 h1:qwcF+vdFrvPSEUDSX5RVoRccG8a5DhOdWdQ4zN62zzo=
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
Expand Down Expand Up @@ -357,7 +355,6 @@ github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6w
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
github.com/holiman/uint256 v1.3.1 h1:JfTzmih28bittyHM8z360dCjIA9dbPIBlcTI6lmctQs=
github.com/holiman/uint256 v1.3.1/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
Expand Down Expand Up @@ -394,8 +391,6 @@ github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABo
github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk=
github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o=
github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4=
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 h1:TMtDYDHKYY15rFihtRfck/bfFqNfvcabqvXAFQfAUpY=
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267/go.mod h1:h1nSAbGFqGVzn6Jyl1R/iCcBUHN4g+gW1u9CoBTrb9E=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
Expand All @@ -404,10 +399,6 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/karalabe/hid v1.0.1-0.20240306101548-573246063e52 h1:msKODTL1m0wigztaqILOtla9HeW1ciscYG4xjLtvk5I=
github.com/karalabe/hid v1.0.1-0.20240306101548-573246063e52/go.mod h1:qk1sX/IBgppQNcGCRoj90u6EGC056EBoIc1oEjCWla8=
github.com/kilic/bls12-381 v0.1.0 h1:encrdjqKMEvabVQ7qYOKu1OvhqpK4s47wDYtNiPtlp4=
github.com/kilic/bls12-381 v0.1.0/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
Expand Down Expand Up @@ -667,8 +658,6 @@ github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDj
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
Expand All @@ -694,14 +683,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/protolambda/bls12-381-util v0.1.0 h1:05DU2wJN7DTU7z28+Q+zejXkIsA/MF8JZQGhtBZZiWk=
github.com/protolambda/bls12-381-util v0.1.0/go.mod h1:cdkysJTRpeFeuUVx/TXGDQNMTiRAalk1vQw3TYTHcE4=
github.com/protolambda/ctxlock v0.1.0 h1:rCUY3+vRdcdZXqT07iXgyr744J2DU2LCBIXowYAjBCE=
github.com/protolambda/ctxlock v0.1.0/go.mod h1:vefhX6rIZH8rsg5ZpOJfEDYQOppZi19SfPiGOFrNnwM=
github.com/protolambda/zrnt v0.32.2 h1:KZ48T+3UhsPXNdtE/5QEvGc9DGjUaRI17nJaoznoIaM=
github.com/protolambda/zrnt v0.32.2/go.mod h1:A0fezkp9Tt3GBLATSPIbuY4ywYESyAuc/FFmPKg8Lqs=
github.com/protolambda/ztyp v0.2.2 h1:rVcL3vBu9W/aV646zF6caLS/dyn9BN8NYiuJzicLNyY=
github.com/protolambda/ztyp v0.2.2/go.mod h1:9bYgKGqg3wJqT9ac1gI2hnVb0STQq7p/1lapqrqY1dU=
github.com/prysmaticlabs/gohashtree v0.0.1-alpha.0.20220714111606-acbb2962fb48 h1:cSo6/vk8YpvkLbk9v3FO97cakNmUoxwi2KMP8hd5WIw=
github.com/prysmaticlabs/gohashtree v0.0.1-alpha.0.20220714111606-acbb2962fb48/go.mod h1:4pWaT30XoEx1j8KNJf3TV+E3mQkaufn7mf+jRNb/Fuk=
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
Expand Down Expand Up @@ -827,8 +810,6 @@ go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME=
go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw=
go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE=
go.uber.org/fx v1.22.2 h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw=
Expand Down Expand Up @@ -964,7 +945,6 @@ golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
2 changes: 2 additions & 0 deletions op-chain-ops/genesis/layer_two.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (

type L2AllocsMode string

type L2AllocsModeMap map[L2AllocsMode]*foundry.ForgeAllocs

const (
L2AllocsDelta L2AllocsMode = "delta"
L2AllocsEcotone L2AllocsMode = "ecotone"
Expand Down
28 changes: 4 additions & 24 deletions op-e2e/actions/altda/altda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"math/rand"
"testing"

"github.com/ethereum-optimism/optimism/op-e2e/config"

"github.com/ethereum-optimism/optimism/op-e2e/actions/helpers"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -54,6 +56,7 @@ func NewL2AltDA(t helpers.Testing, params ...AltDAParam) *L2AltDA {
ChannelTimeout: 12,
L1BlockTime: 12,
UseAltDA: true,
AllocType: config.AllocTypeAltDA,
}
for _, apply := range params {
apply(p)
Expand Down Expand Up @@ -96,7 +99,7 @@ func NewL2AltDA(t helpers.Testing, params ...AltDAParam) *L2AltDA {
AddressCorpora: addresses,
Bindings: helpers.NewL2Bindings(t, cl, engine.GethClient()),
}
alice := helpers.NewCrossLayerUser(log, dp.Secrets.Alice, rand.New(rand.NewSource(0xa57b)))
alice := helpers.NewCrossLayerUser(log, dp.Secrets.Alice, rand.New(rand.NewSource(0xa57b)), p.AllocType)
alice.L2.SetUserEnv(l2UserEnv)

contract, err := bindings.NewDataAvailabilityChallenge(sd.RollupCfg.AltDAConfig.DAChallengeAddress, l1Client)
Expand Down Expand Up @@ -261,10 +264,6 @@ func (a *L2AltDA) ActL1Finalized(t helpers.Testing) {

// Commitment is challenged but never resolved, chain reorgs when challenge window expires.
func TestAltDA_ChallengeExpired(gt *testing.T) {
if !e2eutils.UseAltDA() {
gt.Skip("AltDA is not enabled")
}

t := helpers.NewDefaultTesting(gt)
harness := NewL2AltDA(t)

Expand Down Expand Up @@ -321,10 +320,6 @@ func TestAltDA_ChallengeExpired(gt *testing.T) {
// Commitment is challenged after sequencer derived the chain but data disappears. A verifier
// derivation pipeline stalls until the challenge is resolved and then resumes with data from the contract.
func TestAltDA_ChallengeResolved(gt *testing.T) {
if !e2eutils.UseAltDA() {
gt.Skip("AltDA is not enabled")
}

t := helpers.NewDefaultTesting(gt)
harness := NewL2AltDA(t)

Expand Down Expand Up @@ -369,10 +364,6 @@ func TestAltDA_ChallengeResolved(gt *testing.T) {

// DA storage service goes offline while sequencer keeps making blocks. When storage comes back online, it should be able to catch up.
func TestAltDA_StorageError(gt *testing.T) {
if !e2eutils.UseAltDA() {
gt.Skip("AltDA is not enabled")
}

t := helpers.NewDefaultTesting(gt)
harness := NewL2AltDA(t)

Expand All @@ -398,10 +389,6 @@ func TestAltDA_StorageError(gt *testing.T) {
// L1 chain reorgs a resolved challenge so it expires instead causing
// the l2 chain to reorg as well.
func TestAltDA_ChallengeReorg(gt *testing.T) {
if !e2eutils.UseAltDA() {
gt.Skip("AltDA is not enabled")
}

t := helpers.NewDefaultTesting(gt)
harness := NewL2AltDA(t)

Expand Down Expand Up @@ -446,10 +433,6 @@ func TestAltDA_ChallengeReorg(gt *testing.T) {
// Sequencer stalls as data is not available, batcher keeps posting, untracked commitments are
// challenged and resolved, then sequencer resumes and catches up.
func TestAltDA_SequencerStalledMultiChallenges(gt *testing.T) {
if !e2eutils.UseAltDA() {
gt.Skip("AltDA is not enabled")
}

t := helpers.NewDefaultTesting(gt)
a := NewL2AltDA(t)

Expand Down Expand Up @@ -542,9 +525,6 @@ func TestAltDA_SequencerStalledMultiChallenges(gt *testing.T) {
// Verify that finalization happens based on altDA windows.
// based on l2_batcher_test.go L2Finalization
func TestAltDA_Finalization(gt *testing.T) {
if !e2eutils.UseAltDA() {
gt.Skip("AltDA is not enabled")
}
t := helpers.NewDefaultTesting(gt)
a := NewL2AltDA(t)

Expand Down
2 changes: 1 addition & 1 deletion op-e2e/actions/batcher/eip4844_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

func setupEIP4844Test(t helpers.Testing, log log.Logger) (*e2eutils.SetupData, *e2eutils.DeployParams, *helpers.L1Miner, *helpers.L2Sequencer, *helpers.L2Engine, *helpers.L2Verifier, *helpers.L2Engine) {
dp := e2eutils.MakeDeployParams(t, helpers.DefaultRollupTestParams)
dp := e2eutils.MakeDeployParams(t, helpers.DefaultRollupTestParams())
genesisActivation := hexutil.Uint64(0)
dp.DeployConfig.L1CancunTimeOffset = &genesisActivation
dp.DeployConfig.L2GenesisCanyonTimeOffset = &genesisActivation
Expand Down
Loading

0 comments on commit da2d5c7

Please sign in to comment.