Commit b83d1031 authored by Ethen Pociask's avatar Ethen Pociask

Merge branch 'develop' of https://github.com/epociask/optimism into...

Merge branch 'develop' of https://github.com/epociask/optimism into indexer.withdrawal_type_supplies
parents 2d7ac0a2 99cc9a70
...@@ -4,6 +4,9 @@ parameters: ...@@ -4,6 +4,9 @@ parameters:
ci_builder_image: ci_builder_image:
type: string type: string
default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.30.0 default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.30.0
base_image:
type: string
default: ubuntu-2204:2022.07.1
orbs: orbs:
go: circleci/go@1.8.0 go: circleci/go@1.8.0
...@@ -209,7 +212,7 @@ jobs: ...@@ -209,7 +212,7 @@ jobs:
type: string type: string
default: medium default: medium
machine: machine:
image: ubuntu-2204:2022.07.1 image: <<pipeline.parameters.base_image>>
resource_class: "<<parameters.resource_class>>" resource_class: "<<parameters.resource_class>>"
docker_layer_caching: true # we rely on this for faster builds, and actively warm it up for builds with common stages docker_layer_caching: true # we rely on this for faster builds, and actively warm it up for builds with common stages
steps: steps:
...@@ -640,7 +643,7 @@ jobs: ...@@ -640,7 +643,7 @@ jobs:
todo-issues: todo-issues:
machine: machine:
image: ubuntu-2204:2022.07.1 image: <<pipeline.parameters.base_image>>
steps: steps:
- checkout - checkout
- run: - run:
...@@ -653,7 +656,7 @@ jobs: ...@@ -653,7 +656,7 @@ jobs:
bedrock-markdown: bedrock-markdown:
machine: machine:
image: ubuntu-2204:2022.07.1 image: <<pipeline.parameters.base_image>>
steps: steps:
- checkout - checkout
- check-changed: - check-changed:
...@@ -674,7 +677,7 @@ jobs: ...@@ -674,7 +677,7 @@ jobs:
bedrock-markdown-links: bedrock-markdown-links:
machine: machine:
image: ubuntu-2204:2022.07.1 image: <<pipeline.parameters.base_image>>
steps: steps:
- checkout - checkout
- run: - run:
...@@ -1023,7 +1026,7 @@ jobs: ...@@ -1023,7 +1026,7 @@ jobs:
devnet: devnet:
machine: machine:
image: ubuntu-2204:2022.10.2 image: <<pipeline.parameters.base_image>>
environment: environment:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
DEVNET_NO_BUILD: 'true' DEVNET_NO_BUILD: 'true'
...@@ -1227,6 +1230,45 @@ jobs: ...@@ -1227,6 +1230,45 @@ jobs:
name: "Go mod tidy" name: "Go mod tidy"
command: make mod-tidy && git diff --exit-code command: make mod-tidy && git diff --exit-code
op-service-rethdb-tests:
docker:
- image: <<pipeline.parameters.ci_builder_image>>
steps:
- checkout
- check-changed:
patterns: op-service,op-node
- restore_cache:
name: Restore Go modules cache
key: gomod-{{ checksum "go.sum" }}
- run:
name: Cargo fmt + clippy
command: |
cargo +nightly fmt -- --check
cargo +nightly clippy --all --all-features -- -D warnings
working_directory: op-service/rethdb-reader
- run:
name: Generate testdata db
command: cargo test
working_directory: op-service/rethdb-reader
- run:
name: Build dylib
command: cargo build --release
working_directory: op-service/rethdb-reader
- run:
name: Update LD_LIBRARY_PATH
command: echo 'export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/root/project/op-service/rethdb-reader/target/release"' >> $BASH_ENV
- run:
name: Run op-service RethDB tests
command: |
gotestsum --format=standard-verbose --junitfile=/tmp/test-results/op-service.xml \
-- -parallel=8 -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out \
-run TestRethDB -tags rethdb -v
working_directory: op-service/sources
# TODO(CLI-148): Fix codecov
#- run:
#name: upload coverage
#command: codecov --verbose --clean --flags bedrock-rethdb-go-tests
bedrock-go-tests: # just a helper, that depends on all the actual test jobs bedrock-go-tests: # just a helper, that depends on all the actual test jobs
docker: docker:
- image: <<pipeline.parameters.ci_builder_image>> - image: <<pipeline.parameters.ci_builder_image>>
...@@ -1442,6 +1484,9 @@ workflows: ...@@ -1442,6 +1484,9 @@ workflows:
name: op-service-tests name: op-service-tests
module: op-service module: op-service
requires: ["op-stack-go-lint"] requires: ["op-stack-go-lint"]
- op-service-rethdb-tests:
requires:
- op-stack-go-lint
- go-e2e-test: - go-e2e-test:
name: op-e2e-WS-tests name: op-e2e-WS-tests
module: op-e2e module: op-e2e
...@@ -1491,6 +1536,7 @@ workflows: ...@@ -1491,6 +1536,7 @@ workflows:
- op-e2e-WS-tests - op-e2e-WS-tests
- op-e2e-HTTP-tests - op-e2e-HTTP-tests
- op-e2e-ext-geth-tests - op-e2e-ext-geth-tests
- op-service-rethdb-tests
- docker-build: - docker-build:
name: op-node-docker-build name: op-node-docker-build
docker_name: op-node docker_name: op-node
......
...@@ -7,8 +7,8 @@ toolchain go1.21.1 ...@@ -7,8 +7,8 @@ toolchain go1.21.1
require github.com/ethereum-optimism/optimism v0.0.0 require github.com/ethereum-optimism/optimism v0.0.0
require ( require (
golang.org/x/crypto v0.15.0 // indirect golang.org/x/crypto v0.16.0 // indirect
golang.org/x/sys v0.14.0 // indirect golang.org/x/sys v0.15.0 // indirect
) )
replace github.com/ethereum-optimism/optimism v0.0.0 => ../../.. replace github.com/ethereum-optimism/optimism v0.0.0 => ../../..
...@@ -4,9 +4,9 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb ...@@ -4,9 +4,9 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
...@@ -5,7 +5,7 @@ go 1.21 ...@@ -5,7 +5,7 @@ go 1.21
require ( require (
github.com/BurntSushi/toml v1.3.2 github.com/BurntSushi/toml v1.3.2
github.com/btcsuite/btcd v0.23.3 github.com/btcsuite/btcd v0.23.3
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 github.com/btcsuite/btcd/chaincfg/chainhash v1.0.3
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20231030223232-e16eae11e492 github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20231030223232-e16eae11e492
...@@ -39,11 +39,11 @@ require ( ...@@ -39,11 +39,11 @@ require (
github.com/prometheus/client_golang v1.17.0 github.com/prometheus/client_golang v1.17.0
github.com/stretchr/testify v1.8.4 github.com/stretchr/testify v1.8.4
github.com/urfave/cli/v2 v2.25.7 github.com/urfave/cli/v2 v2.25.7
golang.org/x/crypto v0.15.0 golang.org/x/crypto v0.16.0
golang.org/x/exp v0.0.0-20231006140011-7918f672742d golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/sync v0.5.0 golang.org/x/sync v0.5.0
golang.org/x/term v0.14.0 golang.org/x/term v0.15.0
golang.org/x/time v0.4.0 golang.org/x/time v0.5.0
gorm.io/driver/postgres v1.5.4 gorm.io/driver/postgres v1.5.4
gorm.io/gorm v1.25.5 gorm.io/gorm v1.25.5
) )
...@@ -199,7 +199,7 @@ require ( ...@@ -199,7 +199,7 @@ require (
go.uber.org/zap v1.26.0 // indirect go.uber.org/zap v1.26.0 // indirect
golang.org/x/mod v0.13.0 // indirect golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.14.0 // indirect golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.14.0 // indirect golang.org/x/tools v0.14.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect google.golang.org/protobuf v1.31.0 // indirect
......
...@@ -44,8 +44,8 @@ github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFA ...@@ -44,8 +44,8 @@ github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFA
github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A=
github.com/btcsuite/btcd/btcutil v1.1.0 h1:MO4klnGY+EWJdoWF12Wkuf4AWDBPMpZNeN/jRLrklUU= github.com/btcsuite/btcd/btcutil v1.1.0 h1:MO4klnGY+EWJdoWF12Wkuf4AWDBPMpZNeN/jRLrklUU=
github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.3 h1:SDlJ7bAm4ewvrmZtR0DaiYbQGdKPeaaIm7bM+qRhFeU=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.3/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
...@@ -767,8 +767,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm ...@@ -767,8 +767,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
...@@ -877,13 +877,13 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= ...@@ -877,13 +877,13 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
...@@ -899,8 +899,8 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb ...@@ -899,8 +899,8 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
......
...@@ -41,5 +41,6 @@ ...@@ -41,5 +41,6 @@
"SafeProxyFactory", "SafeProxyFactory",
"DelayedVetoable", "DelayedVetoable",
"ISemver", "ISemver",
"StorageSetter" "StorageSetter",
"SuperchainConfig"
] ]
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package bindings
import (
"encoding/json"
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
const SuperchainConfigStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"src/L1/SuperchainConfig.sol:SuperchainConfig\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"src/L1/SuperchainConfig.sol:SuperchainConfig\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"}],\"types\":{\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var SuperchainConfigStorageLayout = new(solc.StorageLayout)
var SuperchainConfigDeployedBin = "0x608060405234801561001057600080fd5b50600436106100885760003560e01c80636da663551161005b5780636da663551461012a5780637fbf7b6a1461013d578063c23a451a14610153578063c4d66de81461015b57600080fd5b80633f4ba83a1461008d578063452a93201461009757806354fd4d50146100c95780635c975abb14610112575b600080fd5b61009561016e565b005b61009f610294565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101056040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6040516100c09190610768565b61011a6102cd565b60405190151581526020016100c0565b6100956101383660046107b1565b610305565b610145610435565b6040519081526020016100c0565b610145610463565b610095610169366004610880565b61048e565b610176610294565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610235576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f5375706572636861696e436f6e6669673a206f6e6c7920677561726469616e2060448201527f63616e20756e706175736500000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61026961026360017f54176ff9944c4784e5857ec4e5ef560a462c483bf534eda43f91bb01a470b1b76108b6565b60009055565b6040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b60006102c86102c460017fd30e835d3f35624761057ff5b27d558f97bd5be034621e62240e5c0b784abe696108b6565b5490565b905090565b60006102fd6102c460017f54176ff9944c4784e5857ec4e5ef560a462c483bf534eda43f91bb01a470b1b76108b6565b600114905090565b61030d610294565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5375706572636861696e436f6e6669673a206f6e6c7920677561726469616e2060448201527f63616e2070617573650000000000000000000000000000000000000000000000606482015260840161022c565b6103fb6103f560017f54176ff9944c4784e5857ec4e5ef560a462c483bf534eda43f91bb01a470b1b76108b6565b60019055565b7fc32e6d5d6d1de257f64eac19ddb1f700ba13527983849c9486b1ab007ea283818160405161042a9190610768565b60405180910390a150565b61046060017f54176ff9944c4784e5857ec4e5ef560a462c483bf534eda43f91bb01a470b1b76108b6565b81565b61046060017fd30e835d3f35624761057ff5b27d558f97bd5be034621e62240e5c0b784abe696108b6565b600054610100900460ff16158080156104ae5750600054600160ff909116105b806104c85750303b1580156104c8575060005460ff166001145b610554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161022c565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156105b257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6105bb82610642565b801561061e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b9055565b61067561067060017fd30e835d3f35624761057ff5b27d558f97bd5be034621e62240e5c0b784abe696108b6565b829055565b60006040805173ffffffffffffffffffffffffffffffffffffffff841660208201527f7b743789cff01dafdeae47739925425aab5dfd02d0c8229e4a508bcd2b9f42bb9101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526106f291610768565b60405180910390a250565b6000815180845260005b8181101561072357602081850181015186830182015201610707565b81811115610735576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061077b60208301846106fd565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156107c357600080fd5b813567ffffffffffffffff808211156107db57600080fd5b818401915084601f8301126107ef57600080fd5b81358181111561080157610801610782565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561084757610847610782565b8160405282815287602084870101111561086057600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561089257600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461077b57600080fd5b6000828210156108ef577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50039056fea164736f6c634300080f000a"
func init() {
if err := json.Unmarshal([]byte(SuperchainConfigStorageLayoutJSON), SuperchainConfigStorageLayout); err != nil {
panic(err)
}
layouts["SuperchainConfig"] = SuperchainConfigStorageLayout
deployedBytecodes["SuperchainConfig"] = SuperchainConfigDeployedBin
}
...@@ -112,9 +112,9 @@ type DeployConfig struct { ...@@ -112,9 +112,9 @@ type DeployConfig struct {
// L2GenesisCanyonTimeOffset is the number of seconds after genesis block that Canyon hard fork activates. // L2GenesisCanyonTimeOffset is the number of seconds after genesis block that Canyon hard fork activates.
// Set it to 0 to activate at genesis. Nil to disable Canyon. // Set it to 0 to activate at genesis. Nil to disable Canyon.
L2GenesisCanyonTimeOffset *hexutil.Uint64 `json:"l2GenesisCanyonTimeOffset,omitempty"` L2GenesisCanyonTimeOffset *hexutil.Uint64 `json:"l2GenesisCanyonTimeOffset,omitempty"`
// L2GenesisSpanBatchTimeOffset is the number of seconds after genesis block that Span Batch hard fork activates. // L2GenesisDeltaTimeOffset is the number of seconds after genesis block that Delta hard fork activates.
// Set it to 0 to activate at genesis. Nil to disable SpanBatch. // Set it to 0 to activate at genesis. Nil to disable Delta.
L2GenesisSpanBatchTimeOffset *hexutil.Uint64 `json:"l2GenesisSpanBatchTimeOffset,omitempty"` L2GenesisDeltaTimeOffset *hexutil.Uint64 `json:"l2GenesisDeltaTimeOffset,omitempty"`
// L2GenesisBlockExtraData is configurable extradata. Will default to []byte("BEDROCK") if left unspecified. // L2GenesisBlockExtraData is configurable extradata. Will default to []byte("BEDROCK") if left unspecified.
L2GenesisBlockExtraData []byte `json:"l2GenesisBlockExtraData"` L2GenesisBlockExtraData []byte `json:"l2GenesisBlockExtraData"`
// ProxyAdminOwner represents the owner of the ProxyAdmin predeploy on L2. // ProxyAdminOwner represents the owner of the ProxyAdmin predeploy on L2.
...@@ -122,8 +122,8 @@ type DeployConfig struct { ...@@ -122,8 +122,8 @@ type DeployConfig struct {
// FinalSystemOwner is the owner of the system on L1. Any L1 contract that is ownable has // FinalSystemOwner is the owner of the system on L1. Any L1 contract that is ownable has
// this account set as its owner. // this account set as its owner.
FinalSystemOwner common.Address `json:"finalSystemOwner"` FinalSystemOwner common.Address `json:"finalSystemOwner"`
// PortalGuardian represents the GUARDIAN account in the OptimismPortal. Has the ability to pause withdrawals. // SuperchainConfigGuardian represents the GUARDIAN account in the SuperchainConfig. Has the ability to pause withdrawals.
PortalGuardian common.Address `json:"portalGuardian"` SuperchainConfigGuardian common.Address `json:"superchainConfigGuardian"`
// BaseFeeVaultRecipient represents the recipient of fees accumulated in the BaseFeeVault. // BaseFeeVaultRecipient represents the recipient of fees accumulated in the BaseFeeVault.
// Can be an account on L1 or L2, depending on the BaseFeeVaultWithdrawalNetwork value. // Can be an account on L1 or L2, depending on the BaseFeeVaultWithdrawalNetwork value.
BaseFeeVaultRecipient common.Address `json:"baseFeeVaultRecipient"` BaseFeeVaultRecipient common.Address `json:"baseFeeVaultRecipient"`
...@@ -252,8 +252,8 @@ func (d *DeployConfig) Check() error { ...@@ -252,8 +252,8 @@ func (d *DeployConfig) Check() error {
if d.L2OutputOracleStartingBlockNumber == 0 { if d.L2OutputOracleStartingBlockNumber == 0 {
log.Warn("L2OutputOracleStartingBlockNumber is 0, should only be 0 for fresh chains") log.Warn("L2OutputOracleStartingBlockNumber is 0, should only be 0 for fresh chains")
} }
if d.PortalGuardian == (common.Address{}) { if d.SuperchainConfigGuardian == (common.Address{}) {
return fmt.Errorf("%w: PortalGuardian cannot be address(0)", ErrInvalidDeployConfig) return fmt.Errorf("%w: SuperchainConfigGuardian cannot be address(0)", ErrInvalidDeployConfig)
} }
if d.MaxSequencerDrift == 0 { if d.MaxSequencerDrift == 0 {
return fmt.Errorf("%w: MaxSequencerDrift cannot be 0", ErrInvalidDeployConfig) return fmt.Errorf("%w: MaxSequencerDrift cannot be 0", ErrInvalidDeployConfig)
...@@ -463,12 +463,12 @@ func (d *DeployConfig) CanyonTime(genesisTime uint64) *uint64 { ...@@ -463,12 +463,12 @@ func (d *DeployConfig) CanyonTime(genesisTime uint64) *uint64 {
return &v return &v
} }
func (d *DeployConfig) SpanBatchTime(genesisTime uint64) *uint64 { func (d *DeployConfig) DeltaTime(genesisTime uint64) *uint64 {
if d.L2GenesisSpanBatchTimeOffset == nil { if d.L2GenesisDeltaTimeOffset == nil {
return nil return nil
} }
v := uint64(0) v := uint64(0)
if offset := *d.L2GenesisSpanBatchTimeOffset; offset > 0 { if offset := *d.L2GenesisDeltaTimeOffset; offset > 0 {
v = genesisTime + uint64(offset) v = genesisTime + uint64(offset)
} }
return &v return &v
...@@ -512,7 +512,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas ...@@ -512,7 +512,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas
L1SystemConfigAddress: d.SystemConfigProxy, L1SystemConfigAddress: d.SystemConfigProxy,
RegolithTime: d.RegolithTime(l1StartBlock.Time()), RegolithTime: d.RegolithTime(l1StartBlock.Time()),
CanyonTime: d.CanyonTime(l1StartBlock.Time()), CanyonTime: d.CanyonTime(l1StartBlock.Time()),
SpanBatchTime: d.SpanBatchTime(l1StartBlock.Time()), DeltaTime: d.DeltaTime(l1StartBlock.Time()),
}, nil }, nil
} }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"l1GenesisBlockGasLimit": "0x1c9c380", "l1GenesisBlockGasLimit": "0x1c9c380",
"l1GenesisBlockDifficulty": "0x1", "l1GenesisBlockDifficulty": "0x1",
"finalSystemOwner": "0xbcd4042de499d14e55001ccbb24a551f3b954096", "finalSystemOwner": "0xbcd4042de499d14e55001ccbb24a551f3b954096",
"portalGuardian": "0x0000000000000000000000000000000000000112", "superchainConfigGuardian": "0x0000000000000000000000000000000000000112",
"finalizationPeriodSeconds": 2, "finalizationPeriodSeconds": 2,
"l1GenesisBlockMixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "l1GenesisBlockMixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"l1GenesisBlockCoinbase": "0x0000000000000000000000000000000000000000", "l1GenesisBlockCoinbase": "0x0000000000000000000000000000000000000000",
......
...@@ -269,9 +269,9 @@ func OptimismPortal(batch *safe.Batch, implementations superchain.Implementation ...@@ -269,9 +269,9 @@ func OptimismPortal(batch *safe.Batch, implementations superchain.Implementation
return err return err
} }
var portalGuardian common.Address var superchainConfigGuardian common.Address
if config != nil { if config != nil {
portalGuardian = config.PortalGuardian superchainConfigGuardian = config.SuperchainConfigGuardian
} else { } else {
optimismPortal, err := bindings.NewOptimismPortalCaller(common.HexToAddress(list.OptimismPortalProxy.String()), backend) optimismPortal, err := bindings.NewOptimismPortalCaller(common.HexToAddress(list.OptimismPortalProxy.String()), backend)
if err != nil { if err != nil {
...@@ -281,10 +281,10 @@ func OptimismPortal(batch *safe.Batch, implementations superchain.Implementation ...@@ -281,10 +281,10 @@ func OptimismPortal(batch *safe.Batch, implementations superchain.Implementation
if err != nil { if err != nil {
return err return err
} }
portalGuardian = guardian superchainConfigGuardian = guardian
} }
calldata, err := optimismPortalABI.Pack("initialize", common.HexToAddress(list.L2OutputOracleProxy.String()), portalGuardian, common.HexToAddress(chainConfig.SystemConfigAddr.String()), false) calldata, err := optimismPortalABI.Pack("initialize", common.HexToAddress(list.L2OutputOracleProxy.String()), superchainConfigGuardian, common.HexToAddress(chainConfig.SystemConfigAddr.String()), false)
if err != nil { if err != nil {
return err return err
} }
......
...@@ -17,7 +17,7 @@ import ( ...@@ -17,7 +17,7 @@ import (
func TestBlockTimeBatchType(t *testing.T) { func TestBlockTimeBatchType(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
f func(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64)
}{ }{
{"BatchInLastPossibleBlocks", BatchInLastPossibleBlocks}, {"BatchInLastPossibleBlocks", BatchInLastPossibleBlocks},
{"LargeL1Gaps", LargeL1Gaps}, {"LargeL1Gaps", LargeL1Gaps},
...@@ -29,11 +29,11 @@ func TestBlockTimeBatchType(t *testing.T) { ...@@ -29,11 +29,11 @@ func TestBlockTimeBatchType(t *testing.T) {
}) })
} }
spanBatchTimeOffset := hexutil.Uint64(0) deltaTimeOffset := hexutil.Uint64(0)
for _, test := range tests { for _, test := range tests {
test := test test := test
t.Run(test.name+"_SpanBatch", func(t *testing.T) { t.Run(test.name+"_SpanBatch", func(t *testing.T) {
test.f(t, &spanBatchTimeOffset) test.f(t, &deltaTimeOffset)
}) })
} }
} }
...@@ -43,10 +43,10 @@ func TestBlockTimeBatchType(t *testing.T) { ...@@ -43,10 +43,10 @@ func TestBlockTimeBatchType(t *testing.T) {
// where there are also no other batches included in the sequence // where there are also no other batches included in the sequence
// window. // window.
// This is a regression test against the bug fixed in PR #4566 // This is a regression test against the bug fixed in PR #4566
func BatchInLastPossibleBlocks(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func BatchInLastPossibleBlocks(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
dp.DeployConfig.SequencerWindowSize = 4 dp.DeployConfig.SequencerWindowSize = 4
dp.DeployConfig.L2BlockTime = 2 dp.DeployConfig.L2BlockTime = 2
...@@ -154,14 +154,14 @@ func BatchInLastPossibleBlocks(gt *testing.T, spanBatchTimeOffset *hexutil.Uint6 ...@@ -154,14 +154,14 @@ func BatchInLastPossibleBlocks(gt *testing.T, spanBatchTimeOffset *hexutil.Uint6
// Then it generates 3 more L1 blocks. // Then it generates 3 more L1 blocks.
// At this point it can verify that the batches where properly generated. // At this point it can verify that the batches where properly generated.
// Note: It batches submits when possible. // Note: It batches submits when possible.
func LargeL1Gaps(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func LargeL1Gaps(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L1BlockTime = 4 dp.DeployConfig.L1BlockTime = 4
dp.DeployConfig.L2BlockTime = 2 dp.DeployConfig.L2BlockTime = 2
dp.DeployConfig.SequencerWindowSize = 4 dp.DeployConfig.SequencerWindowSize = 4
dp.DeployConfig.MaxSequencerDrift = 32 dp.DeployConfig.MaxSequencerDrift = 32
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
......
...@@ -157,7 +157,7 @@ func (s *L2Batcher) Buffer(t Testing) error { ...@@ -157,7 +157,7 @@ func (s *L2Batcher) Buffer(t Testing) error {
var batchType uint = derive.SingularBatchType var batchType uint = derive.SingularBatchType
var spanBatchBuilder *derive.SpanBatchBuilder = nil var spanBatchBuilder *derive.SpanBatchBuilder = nil
if s.rollupCfg.IsSpanBatch(block.Time()) { if s.rollupCfg.IsDelta(block.Time()) {
batchType = derive.SpanBatchType batchType = derive.SpanBatchType
spanBatchBuilder = derive.NewSpanBatchBuilder(s.rollupCfg.Genesis.L2Time, s.rollupCfg.L2ChainID) spanBatchBuilder = derive.NewSpanBatchBuilder(s.rollupCfg.Genesis.L2Time, s.rollupCfg.L2ChainID)
} }
......
...@@ -25,7 +25,7 @@ import ( ...@@ -25,7 +25,7 @@ import (
func TestL2BatcherBatchType(t *testing.T) { func TestL2BatcherBatchType(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
f func(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64)
}{ }{
{"NormalBatcher", NormalBatcher}, {"NormalBatcher", NormalBatcher},
{"L2Finalization", L2Finalization}, {"L2Finalization", L2Finalization},
...@@ -41,16 +41,16 @@ func TestL2BatcherBatchType(t *testing.T) { ...@@ -41,16 +41,16 @@ func TestL2BatcherBatchType(t *testing.T) {
}) })
} }
spanBatchTimeOffset := hexutil.Uint64(0) deltaTimeOffset := hexutil.Uint64(0)
for _, test := range tests { for _, test := range tests {
test := test test := test
t.Run(test.name+"_SpanBatch", func(t *testing.T) { t.Run(test.name+"_SpanBatch", func(t *testing.T) {
test.f(t, &spanBatchTimeOffset) test.f(t, &deltaTimeOffset)
}) })
} }
} }
func NormalBatcher(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func NormalBatcher(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
p := &e2eutils.TestParams{ p := &e2eutils.TestParams{
MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12)
...@@ -59,7 +59,7 @@ func NormalBatcher(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -59,7 +59,7 @@ func NormalBatcher(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
L1BlockTime: 12, L1BlockTime: 12,
} }
dp := e2eutils.MakeDeployParams(t, p) dp := e2eutils.MakeDeployParams(t, p)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log)
...@@ -128,10 +128,10 @@ func NormalBatcher(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -128,10 +128,10 @@ func NormalBatcher(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
require.NotNil(t, vTx) require.NotNil(t, vTx)
} }
func L2Finalization(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func L2Finalization(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
miner, engine, sequencer := setupSequencerTest(t, sd, log) miner, engine, sequencer := setupSequencerTest(t, sd, log)
...@@ -235,10 +235,10 @@ func L2Finalization(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -235,10 +235,10 @@ func L2Finalization(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
} }
// L2FinalizationWithSparseL1 tests that safe L2 blocks can be finalized even if we do not regularly get a L1 finalization signal // L2FinalizationWithSparseL1 tests that safe L2 blocks can be finalized even if we do not regularly get a L1 finalization signal
func L2FinalizationWithSparseL1(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func L2FinalizationWithSparseL1(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
miner, engine, sequencer := setupSequencerTest(t, sd, log) miner, engine, sequencer := setupSequencerTest(t, sd, log)
...@@ -294,11 +294,11 @@ func L2FinalizationWithSparseL1(gt *testing.T, spanBatchTimeOffset *hexutil.Uint ...@@ -294,11 +294,11 @@ func L2FinalizationWithSparseL1(gt *testing.T, spanBatchTimeOffset *hexutil.Uint
// GarbageBatch tests the behavior of an invalid/malformed output channel frame containing // GarbageBatch tests the behavior of an invalid/malformed output channel frame containing
// valid batches being submitted to the batch inbox. These batches should always be rejected // valid batches being submitted to the batch inbox. These batches should always be rejected
// and the safe L2 head should remain unaltered. // and the safe L2 head should remain unaltered.
func GarbageBatch(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func GarbageBatch(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
p := defaultRollupTestParams p := defaultRollupTestParams
dp := e2eutils.MakeDeployParams(t, p) dp := e2eutils.MakeDeployParams(t, p)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
for _, garbageKind := range GarbageKinds { for _, garbageKind := range GarbageKinds {
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlError) log := testlog.Logger(t, log.LvlError)
...@@ -374,7 +374,7 @@ func GarbageBatch(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -374,7 +374,7 @@ func GarbageBatch(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
} }
} }
func ExtendedTimeWithoutL1Batches(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func ExtendedTimeWithoutL1Batches(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
p := &e2eutils.TestParams{ p := &e2eutils.TestParams{
MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12) MaxSequencerDrift: 20, // larger than L1 block time we simulate in this test (12)
...@@ -383,7 +383,7 @@ func ExtendedTimeWithoutL1Batches(gt *testing.T, spanBatchTimeOffset *hexutil.Ui ...@@ -383,7 +383,7 @@ func ExtendedTimeWithoutL1Batches(gt *testing.T, spanBatchTimeOffset *hexutil.Ui
L1BlockTime: 12, L1BlockTime: 12,
} }
dp := e2eutils.MakeDeployParams(t, p) dp := e2eutils.MakeDeployParams(t, p)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlError) log := testlog.Logger(t, log.LvlError)
miner, engine, sequencer := setupSequencerTest(t, sd, log) miner, engine, sequencer := setupSequencerTest(t, sd, log)
...@@ -433,7 +433,7 @@ func ExtendedTimeWithoutL1Batches(gt *testing.T, spanBatchTimeOffset *hexutil.Ui ...@@ -433,7 +433,7 @@ func ExtendedTimeWithoutL1Batches(gt *testing.T, spanBatchTimeOffset *hexutil.Ui
// The goal of this test is to quickly run through an otherwise very slow process of submitting and including lots of data. // The goal of this test is to quickly run through an otherwise very slow process of submitting and including lots of data.
// This does not test the batcher code, but is really focused at testing the batcher utils // This does not test the batcher code, but is really focused at testing the batcher utils
// and channel-decoding verifier code in the derive package. // and channel-decoding verifier code in the derive package.
func BigL2Txs(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func BigL2Txs(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
p := &e2eutils.TestParams{ p := &e2eutils.TestParams{
MaxSequencerDrift: 100, MaxSequencerDrift: 100,
...@@ -442,7 +442,7 @@ func BigL2Txs(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -442,7 +442,7 @@ func BigL2Txs(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
L1BlockTime: 12, L1BlockTime: 12,
} }
dp := e2eutils.MakeDeployParams(t, p) dp := e2eutils.MakeDeployParams(t, p)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlInfo) log := testlog.Logger(t, log.LvlInfo)
miner, engine, sequencer := setupSequencerTest(t, sd, log) miner, engine, sequencer := setupSequencerTest(t, sd, log)
......
...@@ -19,7 +19,7 @@ import ( ...@@ -19,7 +19,7 @@ import (
func TestProposerBatchType(t *testing.T) { func TestProposerBatchType(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
f func(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64)
}{ }{
{"RunProposerTest", RunProposerTest}, {"RunProposerTest", RunProposerTest},
} }
...@@ -30,19 +30,19 @@ func TestProposerBatchType(t *testing.T) { ...@@ -30,19 +30,19 @@ func TestProposerBatchType(t *testing.T) {
}) })
} }
spanBatchTimeOffset := hexutil.Uint64(0) deltaTimeOffset := hexutil.Uint64(0)
for _, test := range tests { for _, test := range tests {
test := test test := test
t.Run(test.name+"_SpanBatch", func(t *testing.T) { t.Run(test.name+"_SpanBatch", func(t *testing.T) {
test.f(t, &spanBatchTimeOffset) test.f(t, &deltaTimeOffset)
}) })
} }
} }
func RunProposerTest(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func RunProposerTest(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log)
......
...@@ -22,9 +22,9 @@ import ( ...@@ -22,9 +22,9 @@ import (
"github.com/ethereum-optimism/optimism/op-service/testlog" "github.com/ethereum-optimism/optimism/op-service/testlog"
) )
func setupReorgTest(t Testing, config *e2eutils.TestParams, spanBatchTimeOffset *hexutil.Uint64) (*e2eutils.SetupData, *e2eutils.DeployParams, *L1Miner, *L2Sequencer, *L2Engine, *L2Verifier, *L2Engine, *L2Batcher) { func setupReorgTest(t Testing, config *e2eutils.TestParams, deltaTimeOffset *hexutil.Uint64) (*e2eutils.SetupData, *e2eutils.DeployParams, *L1Miner, *L2Sequencer, *L2Engine, *L2Verifier, *L2Engine, *L2Batcher) {
dp := e2eutils.MakeDeployParams(t, config) dp := e2eutils.MakeDeployParams(t, config)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
...@@ -50,7 +50,7 @@ func setupReorgTestActors(t Testing, dp *e2eutils.DeployParams, sd *e2eutils.Set ...@@ -50,7 +50,7 @@ func setupReorgTestActors(t Testing, dp *e2eutils.DeployParams, sd *e2eutils.Set
func TestReorgBatchType(t *testing.T) { func TestReorgBatchType(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
f func(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64)
}{ }{
{"ReorgOrphanBlock", ReorgOrphanBlock}, {"ReorgOrphanBlock", ReorgOrphanBlock},
{"ReorgFlipFlop", ReorgFlipFlop}, {"ReorgFlipFlop", ReorgFlipFlop},
...@@ -66,18 +66,18 @@ func TestReorgBatchType(t *testing.T) { ...@@ -66,18 +66,18 @@ func TestReorgBatchType(t *testing.T) {
}) })
} }
spanBatchTimeOffset := hexutil.Uint64(0) deltaTimeOffset := hexutil.Uint64(0)
for _, test := range tests { for _, test := range tests {
test := test test := test
t.Run(test.name+"_SpanBatch", func(t *testing.T) { t.Run(test.name+"_SpanBatch", func(t *testing.T) {
test.f(t, &spanBatchTimeOffset) test.f(t, &deltaTimeOffset)
}) })
} }
} }
func ReorgOrphanBlock(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func ReorgOrphanBlock(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
sd, _, miner, sequencer, _, verifier, verifierEng, batcher := setupReorgTest(t, defaultRollupTestParams, spanBatchTimeOffset) sd, _, miner, sequencer, _, verifier, verifierEng, batcher := setupReorgTest(t, defaultRollupTestParams, deltaTimeOffset)
verifEngClient := verifierEng.EngineClient(t, sd.RollupCfg) verifEngClient := verifierEng.EngineClient(t, sd.RollupCfg)
sequencer.ActL2PipelineFull(t) sequencer.ActL2PipelineFull(t)
...@@ -143,9 +143,9 @@ func ReorgOrphanBlock(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -143,9 +143,9 @@ func ReorgOrphanBlock(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
require.Equal(t, verifier.L2Safe(), sequencer.L2Safe(), "verifier and sequencer see same safe L2 block, while only verifier dealt with the orphan and replay") require.Equal(t, verifier.L2Safe(), sequencer.L2Safe(), "verifier and sequencer see same safe L2 block, while only verifier dealt with the orphan and replay")
} }
func ReorgFlipFlop(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func ReorgFlipFlop(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
sd, _, miner, sequencer, _, verifier, verifierEng, batcher := setupReorgTest(t, defaultRollupTestParams, spanBatchTimeOffset) sd, _, miner, sequencer, _, verifier, verifierEng, batcher := setupReorgTest(t, defaultRollupTestParams, deltaTimeOffset)
minerCl := miner.L1Client(t, sd.RollupCfg) minerCl := miner.L1Client(t, sd.RollupCfg)
verifEngClient := verifierEng.EngineClient(t, sd.RollupCfg) verifEngClient := verifierEng.EngineClient(t, sd.RollupCfg)
checkVerifEngine := func() { checkVerifEngine := func() {
...@@ -220,12 +220,12 @@ func ReorgFlipFlop(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -220,12 +220,12 @@ func ReorgFlipFlop(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
verifier.ActL2PipelineFull(t) verifier.ActL2PipelineFull(t)
require.Equal(t, sd.RollupCfg.Genesis.L1, verifier.L2Safe().L1Origin, "expected to be back at genesis origin after losing A0 and A1") require.Equal(t, sd.RollupCfg.Genesis.L1, verifier.L2Safe().L1Origin, "expected to be back at genesis origin after losing A0 and A1")
if sd.RollupCfg.SpanBatchTime == nil { if sd.RollupCfg.DeltaTime == nil {
// before span batch hard fork // before delta hard fork
require.NotZero(t, verifier.L2Safe().Number, "still preserving old L2 blocks that did not reference reorged L1 chain (assuming more than one L2 block per L1 block)") require.NotZero(t, verifier.L2Safe().Number, "still preserving old L2 blocks that did not reference reorged L1 chain (assuming more than one L2 block per L1 block)")
require.Equal(t, verifier.L2Safe(), verifier.L2Unsafe(), "head is at safe block after L1 reorg") require.Equal(t, verifier.L2Safe(), verifier.L2Unsafe(), "head is at safe block after L1 reorg")
} else { } else {
// after span batch hard fork // after delta hard fork
require.Zero(t, verifier.L2Safe().Number, "safe head is at genesis block because span batch referenced reorged L1 chain is not accepted") require.Zero(t, verifier.L2Safe().Number, "safe head is at genesis block because span batch referenced reorged L1 chain is not accepted")
require.Equal(t, verifier.L2Unsafe().ID(), sequencer.L2Unsafe().ParentID(), "head is at the highest unsafe block that references canonical L1 chain(genesis block)") require.Equal(t, verifier.L2Unsafe().ID(), sequencer.L2Unsafe().ParentID(), "head is at the highest unsafe block that references canonical L1 chain(genesis block)")
batcher.l2BufferedBlock = eth.L2BlockRef{} // must reset batcher to resubmit blocks included in the last batch batcher.l2BufferedBlock = eth.L2BlockRef{} // must reset batcher to resubmit blocks included in the last batch
...@@ -364,7 +364,7 @@ func ReorgFlipFlop(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -364,7 +364,7 @@ func ReorgFlipFlop(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
// Verifier // Verifier
// - Unsafe head is 62 // - Unsafe head is 62
// - Safe head is 42 // - Safe head is 42
func DeepReorg(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func DeepReorg(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
// Create actor and verification engine client // Create actor and verification engine client
...@@ -373,7 +373,7 @@ func DeepReorg(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -373,7 +373,7 @@ func DeepReorg(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
SequencerWindowSize: 20, SequencerWindowSize: 20,
ChannelTimeout: 120, ChannelTimeout: 120,
L1BlockTime: 4, L1BlockTime: 4,
}, spanBatchTimeOffset) }, deltaTimeOffset)
minerCl := miner.L1Client(t, sd.RollupCfg) minerCl := miner.L1Client(t, sd.RollupCfg)
l2Client := seqEngine.EthClient() l2Client := seqEngine.EthClient()
verifEngClient := verifierEng.EngineClient(t, sd.RollupCfg) verifEngClient := verifierEng.EngineClient(t, sd.RollupCfg)
...@@ -599,7 +599,7 @@ type rpcWrapper struct { ...@@ -599,7 +599,7 @@ type rpcWrapper struct {
// RestartOpGeth tests that the sequencer can restart its execution engine without rollup-node restart, // RestartOpGeth tests that the sequencer can restart its execution engine without rollup-node restart,
// including recovering the finalized/safe state of L2 chain without reorging. // including recovering the finalized/safe state of L2 chain without reorging.
func RestartOpGeth(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func RestartOpGeth(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dbPath := path.Join(t.TempDir(), "testdb") dbPath := path.Join(t.TempDir(), "testdb")
dbOption := func(_ *ethconfig.Config, nodeCfg *node.Config) error { dbOption := func(_ *ethconfig.Config, nodeCfg *node.Config) error {
...@@ -607,7 +607,7 @@ func RestartOpGeth(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -607,7 +607,7 @@ func RestartOpGeth(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
return nil return nil
} }
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
jwtPath := e2eutils.WriteDefaultJWT(t) jwtPath := e2eutils.WriteDefaultJWT(t)
...@@ -695,10 +695,10 @@ func RestartOpGeth(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -695,10 +695,10 @@ func RestartOpGeth(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
// ConflictingL2Blocks tests that a second copy of the sequencer stack cannot introduce an alternative // ConflictingL2Blocks tests that a second copy of the sequencer stack cannot introduce an alternative
// L2 block (compared to something already secured by the first sequencer): // L2 block (compared to something already secured by the first sequencer):
// the alt block is not synced by the verifier, in unsafe and safe sync modes. // the alt block is not synced by the verifier, in unsafe and safe sync modes.
func ConflictingL2Blocks(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func ConflictingL2Blocks(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
...@@ -805,7 +805,7 @@ func ConflictingL2Blocks(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -805,7 +805,7 @@ func ConflictingL2Blocks(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
require.Equal(t, sequencer.L2Unsafe(), altSequencer.L2Unsafe(), "and gets back in harmony with original sequencer") require.Equal(t, sequencer.L2Unsafe(), altSequencer.L2Unsafe(), "and gets back in harmony with original sequencer")
} }
func SyncAfterReorg(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func SyncAfterReorg(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
testingParams := e2eutils.TestParams{ testingParams := e2eutils.TestParams{
MaxSequencerDrift: 60, MaxSequencerDrift: 60,
...@@ -813,7 +813,7 @@ func SyncAfterReorg(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -813,7 +813,7 @@ func SyncAfterReorg(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
ChannelTimeout: 2, ChannelTimeout: 2,
L1BlockTime: 12, L1BlockTime: 12,
} }
sd, dp, miner, sequencer, seqEngine, verifier, _, batcher := setupReorgTest(t, &testingParams, spanBatchTimeOffset) sd, dp, miner, sequencer, seqEngine, verifier, _, batcher := setupReorgTest(t, &testingParams, deltaTimeOffset)
l2Client := seqEngine.EthClient() l2Client := seqEngine.EthClient()
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
addresses := e2eutils.CollectAddresses(sd, dp) addresses := e2eutils.CollectAddresses(sd, dp)
......
...@@ -23,8 +23,8 @@ import ( ...@@ -23,8 +23,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
// TestDropSpanBatchBeforeHardfork tests behavior of op-node before SpanBatch hardfork. // TestDropSpanBatchBeforeHardfork tests behavior of op-node before Delta hardfork.
// op-node must drop SpanBatch before SpanBatch hardfork. // op-node must drop SpanBatch before Delta hardfork.
func TestDropSpanBatchBeforeHardfork(gt *testing.T) { func TestDropSpanBatchBeforeHardfork(gt *testing.T) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
p := &e2eutils.TestParams{ p := &e2eutils.TestParams{
...@@ -34,8 +34,8 @@ func TestDropSpanBatchBeforeHardfork(gt *testing.T) { ...@@ -34,8 +34,8 @@ func TestDropSpanBatchBeforeHardfork(gt *testing.T) {
L1BlockTime: 12, L1BlockTime: 12,
} }
dp := e2eutils.MakeDeployParams(t, p) dp := e2eutils.MakeDeployParams(t, p)
// do not activate SpanBatch hardfork for verifier // do not activate Delta hardfork for verifier
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = nil dp.DeployConfig.L2GenesisDeltaTimeOffset = nil
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlError) log := testlog.Logger(t, log.LvlError)
miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log)
...@@ -44,8 +44,8 @@ func TestDropSpanBatchBeforeHardfork(gt *testing.T) { ...@@ -44,8 +44,8 @@ func TestDropSpanBatchBeforeHardfork(gt *testing.T) {
rollupSeqCl := sequencer.RollupClient() rollupSeqCl := sequencer.RollupClient()
dp2 := e2eutils.MakeDeployParams(t, p) dp2 := e2eutils.MakeDeployParams(t, p)
minTs := hexutil.Uint64(0) minTs := hexutil.Uint64(0)
// activate SpanBatch hardfork for batcher. so batcher will submit SpanBatches to L1. // activate Delta hardfork for batcher. so batcher will submit SpanBatches to L1.
dp2.DeployConfig.L2GenesisSpanBatchTimeOffset = &minTs dp2.DeployConfig.L2GenesisDeltaTimeOffset = &minTs
sd2 := e2eutils.Setup(t, dp2, defaultAlloc) sd2 := e2eutils.Setup(t, dp2, defaultAlloc)
batcher := NewL2Batcher(log, sd2.RollupCfg, &BatcherCfg{ batcher := NewL2Batcher(log, sd2.RollupCfg, &BatcherCfg{
MinL1TxSize: 0, MinL1TxSize: 0,
...@@ -114,8 +114,8 @@ func TestDropSpanBatchBeforeHardfork(gt *testing.T) { ...@@ -114,8 +114,8 @@ func TestDropSpanBatchBeforeHardfork(gt *testing.T) {
require.ErrorIs(t, err, ethereum.NotFound) require.ErrorIs(t, err, ethereum.NotFound)
} }
// TestAcceptSingularBatchAfterHardfork tests behavior of op-node after SpanBatch hardfork. // TestAcceptSingularBatchAfterHardfork tests behavior of op-node after Delta hardfork.
// op-node must accept SingularBatch after SpanBatch hardfork. // op-node must accept SingularBatch after Delta hardfork.
func TestAcceptSingularBatchAfterHardfork(gt *testing.T) { func TestAcceptSingularBatchAfterHardfork(gt *testing.T) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
p := &e2eutils.TestParams{ p := &e2eutils.TestParams{
...@@ -127,8 +127,8 @@ func TestAcceptSingularBatchAfterHardfork(gt *testing.T) { ...@@ -127,8 +127,8 @@ func TestAcceptSingularBatchAfterHardfork(gt *testing.T) {
minTs := hexutil.Uint64(0) minTs := hexutil.Uint64(0)
dp := e2eutils.MakeDeployParams(t, p) dp := e2eutils.MakeDeployParams(t, p)
// activate SpanBatch hardfork for verifier. // activate Delta hardfork for verifier.
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = &minTs dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlError) log := testlog.Logger(t, log.LvlError)
miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log)
...@@ -137,8 +137,8 @@ func TestAcceptSingularBatchAfterHardfork(gt *testing.T) { ...@@ -137,8 +137,8 @@ func TestAcceptSingularBatchAfterHardfork(gt *testing.T) {
rollupSeqCl := sequencer.RollupClient() rollupSeqCl := sequencer.RollupClient()
dp2 := e2eutils.MakeDeployParams(t, p) dp2 := e2eutils.MakeDeployParams(t, p)
// not activate SpanBatch hardfork for batcher // not activate Delta hardfork for batcher
dp2.DeployConfig.L2GenesisSpanBatchTimeOffset = nil dp2.DeployConfig.L2GenesisDeltaTimeOffset = nil
sd2 := e2eutils.Setup(t, dp2, defaultAlloc) sd2 := e2eutils.Setup(t, dp2, defaultAlloc)
batcher := NewL2Batcher(log, sd2.RollupCfg, &BatcherCfg{ batcher := NewL2Batcher(log, sd2.RollupCfg, &BatcherCfg{
MinL1TxSize: 0, MinL1TxSize: 0,
...@@ -213,8 +213,8 @@ func TestSpanBatchEmptyChain(gt *testing.T) { ...@@ -213,8 +213,8 @@ func TestSpanBatchEmptyChain(gt *testing.T) {
} }
dp := e2eutils.MakeDeployParams(t, p) dp := e2eutils.MakeDeployParams(t, p)
minTs := hexutil.Uint64(0) minTs := hexutil.Uint64(0)
// Activate SpanBatch hardfork // Activate Delta hardfork
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = &minTs dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlError) log := testlog.Logger(t, log.LvlError)
miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log)
...@@ -270,8 +270,8 @@ func TestSpanBatchLowThroughputChain(gt *testing.T) { ...@@ -270,8 +270,8 @@ func TestSpanBatchLowThroughputChain(gt *testing.T) {
} }
dp := e2eutils.MakeDeployParams(t, p) dp := e2eutils.MakeDeployParams(t, p)
minTs := hexutil.Uint64(0) minTs := hexutil.Uint64(0)
// Activate SpanBatch hardfork // Activate Delta hardfork
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = &minTs dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlError) log := testlog.Logger(t, log.LvlError)
miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log)
......
...@@ -27,7 +27,7 @@ import ( ...@@ -27,7 +27,7 @@ import (
func TestSyncBatchType(t *testing.T) { func TestSyncBatchType(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
f func(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64)
}{ }{
{"DerivationWithFlakyL1RPC", DerivationWithFlakyL1RPC}, {"DerivationWithFlakyL1RPC", DerivationWithFlakyL1RPC},
{"FinalizeWhileSyncing", FinalizeWhileSyncing}, {"FinalizeWhileSyncing", FinalizeWhileSyncing},
...@@ -39,19 +39,19 @@ func TestSyncBatchType(t *testing.T) { ...@@ -39,19 +39,19 @@ func TestSyncBatchType(t *testing.T) {
}) })
} }
spanBatchTimeOffset := hexutil.Uint64(0) deltaTimeOffset := hexutil.Uint64(0)
for _, test := range tests { for _, test := range tests {
test := test test := test
t.Run(test.name+"_SpanBatch", func(t *testing.T) { t.Run(test.name+"_SpanBatch", func(t *testing.T) {
test.f(t, &spanBatchTimeOffset) test.f(t, &deltaTimeOffset)
}) })
} }
} }
func DerivationWithFlakyL1RPC(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func DerivationWithFlakyL1RPC(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlError) // mute all the temporary derivation errors that we forcefully create log := testlog.Logger(t, log.LvlError) // mute all the temporary derivation errors that we forcefully create
_, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log)
...@@ -88,10 +88,10 @@ func DerivationWithFlakyL1RPC(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64 ...@@ -88,10 +88,10 @@ func DerivationWithFlakyL1RPC(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64
require.Equal(t, sequencer.L2Unsafe(), verifier.L2Safe(), "verifier is synced") require.Equal(t, sequencer.L2Unsafe(), verifier.L2Safe(), "verifier is synced")
} }
func FinalizeWhileSyncing(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func FinalizeWhileSyncing(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlError) // mute all the temporary derivation errors that we forcefully create log := testlog.Logger(t, log.LvlError) // mute all the temporary derivation errors that we forcefully create
_, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log) _, _, miner, sequencer, _, verifier, _, batcher := setupReorgTestActors(t, dp, sd, log)
...@@ -207,8 +207,8 @@ func TestInvalidPayloadInSpanBatch(gt *testing.T) { ...@@ -207,8 +207,8 @@ func TestInvalidPayloadInSpanBatch(gt *testing.T) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
minTs := hexutil.Uint64(0) minTs := hexutil.Uint64(0)
// Activate SpanBatch hardfork // Activate Delta hardfork
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = &minTs dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs
dp.DeployConfig.L2BlockTime = 2 dp.DeployConfig.L2BlockTime = 2
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlInfo) log := testlog.Logger(t, log.LvlInfo)
...@@ -330,8 +330,8 @@ func TestSpanBatchAtomicity_Consolidation(gt *testing.T) { ...@@ -330,8 +330,8 @@ func TestSpanBatchAtomicity_Consolidation(gt *testing.T) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
minTs := hexutil.Uint64(0) minTs := hexutil.Uint64(0)
// Activate SpanBatch hardfork // Activate Delta hardfork
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = &minTs dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs
dp.DeployConfig.L2BlockTime = 2 dp.DeployConfig.L2BlockTime = 2
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlInfo) log := testlog.Logger(t, log.LvlInfo)
...@@ -389,8 +389,8 @@ func TestSpanBatchAtomicity_ForceAdvance(gt *testing.T) { ...@@ -389,8 +389,8 @@ func TestSpanBatchAtomicity_ForceAdvance(gt *testing.T) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
minTs := hexutil.Uint64(0) minTs := hexutil.Uint64(0)
// Activate SpanBatch hardfork // Activate Delta hardfork
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = &minTs dp.DeployConfig.L2GenesisDeltaTimeOffset = &minTs
dp.DeployConfig.L2BlockTime = 2 dp.DeployConfig.L2BlockTime = 2
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlInfo) log := testlog.Logger(t, log.LvlInfo)
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
func TestSystemConfigBatchType(t *testing.T) { func TestSystemConfigBatchType(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
f func(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64)
}{ }{
{"BatcherKeyRotation", BatcherKeyRotation}, {"BatcherKeyRotation", BatcherKeyRotation},
{"GPOParamsChange", GPOParamsChange}, {"GPOParamsChange", GPOParamsChange},
...@@ -37,23 +37,23 @@ func TestSystemConfigBatchType(t *testing.T) { ...@@ -37,23 +37,23 @@ func TestSystemConfigBatchType(t *testing.T) {
}) })
} }
spanBatchTimeOffset := hexutil.Uint64(0) deltaTimeOffset := hexutil.Uint64(0)
for _, test := range tests { for _, test := range tests {
test := test test := test
t.Run(test.name+"_SpanBatch", func(t *testing.T) { t.Run(test.name+"_SpanBatch", func(t *testing.T) {
test.f(t, &spanBatchTimeOffset) test.f(t, &deltaTimeOffset)
}) })
} }
} }
// BatcherKeyRotation tests that batcher A can operate, then be replaced with batcher B, then ignore old batcher A, // BatcherKeyRotation tests that batcher A can operate, then be replaced with batcher B, then ignore old batcher A,
// and that the change to batcher B is reverted properly upon reorg of L1. // and that the change to batcher B is reverted properly upon reorg of L1.
func BatcherKeyRotation(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func BatcherKeyRotation(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2BlockTime = 2 dp.DeployConfig.L2BlockTime = 2
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log)
...@@ -228,10 +228,10 @@ func BatcherKeyRotation(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -228,10 +228,10 @@ func BatcherKeyRotation(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
// GPOParamsChange tests that the GPO params can be updated to adjust fees of L2 transactions, // GPOParamsChange tests that the GPO params can be updated to adjust fees of L2 transactions,
// and that the L1 data fees to the L2 transaction are applied correctly before, during and after the GPO update in L2. // and that the L1 data fees to the L2 transaction are applied correctly before, during and after the GPO update in L2.
func GPOParamsChange(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func GPOParamsChange(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log)
...@@ -358,10 +358,10 @@ func GPOParamsChange(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { ...@@ -358,10 +358,10 @@ func GPOParamsChange(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) {
// GasLimitChange tests that the gas limit can be configured to L1, // GasLimitChange tests that the gas limit can be configured to L1,
// and that the L2 changes the gas limit instantly at the exact block that adopts the L1 origin with // and that the L2 changes the gas limit instantly at the exact block that adopts the L1 origin with
// the gas limit change event. And checks if a verifier node can reproduce the same gas limit change. // the gas limit change event. And checks if a verifier node can reproduce the same gas limit change.
func GasLimitChange(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func GasLimitChange(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset dp.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
miner, seqEngine, sequencer := setupSequencerTest(t, sd, log) miner, seqEngine, sequencer := setupSequencerTest(t, sd, log)
......
...@@ -14,11 +14,11 @@ import ( ...@@ -14,11 +14,11 @@ import (
) )
type hardforkScheduledTest struct { type hardforkScheduledTest struct {
name string name string
regolithTime *hexutil.Uint64 regolithTime *hexutil.Uint64
spanBatchTime *hexutil.Uint64 deltaTime *hexutil.Uint64
activateRegolith bool activateRegolith bool
activateSpanBatch bool activateDelta bool
} }
// TestCrossLayerUser tests that common actions of the CrossLayerUser actor work in various regolith configurations: // TestCrossLayerUser tests that common actions of the CrossLayerUser actor work in various regolith configurations:
...@@ -34,17 +34,17 @@ func TestCrossLayerUser(t *testing.T) { ...@@ -34,17 +34,17 @@ func TestCrossLayerUser(t *testing.T) {
futureTime := hexutil.Uint64(20) futureTime := hexutil.Uint64(20)
farFutureTime := hexutil.Uint64(2000) farFutureTime := hexutil.Uint64(2000)
tests := []hardforkScheduledTest{ tests := []hardforkScheduledTest{
{name: "NoRegolith", regolithTime: nil, activateRegolith: false, spanBatchTime: nil, activateSpanBatch: false}, {name: "NoRegolith", regolithTime: nil, activateRegolith: false, deltaTime: nil, activateDelta: false},
{name: "NotYetRegolith", regolithTime: &farFutureTime, activateRegolith: false, spanBatchTime: nil, activateSpanBatch: false}, {name: "NotYetRegolith", regolithTime: &farFutureTime, activateRegolith: false, deltaTime: nil, activateDelta: false},
{name: "RegolithAtGenesis", regolithTime: &zeroTime, activateRegolith: true, spanBatchTime: nil, activateSpanBatch: false}, {name: "RegolithAtGenesis", regolithTime: &zeroTime, activateRegolith: true, deltaTime: nil, activateDelta: false},
{name: "RegolithAfterGenesis", regolithTime: &futureTime, activateRegolith: true, spanBatchTime: nil, activateSpanBatch: false}, {name: "RegolithAfterGenesis", regolithTime: &futureTime, activateRegolith: true, deltaTime: nil, activateDelta: false},
{name: "NoSpanBatch", regolithTime: &zeroTime, activateRegolith: true, spanBatchTime: nil, activateSpanBatch: false}, {name: "NoDelta", regolithTime: &zeroTime, activateRegolith: true, deltaTime: nil, activateDelta: false},
{name: "NotYetSpanBatch", regolithTime: &zeroTime, activateRegolith: true, {name: "NotYetDelta", regolithTime: &zeroTime, activateRegolith: true,
spanBatchTime: &farFutureTime, activateSpanBatch: false}, deltaTime: &farFutureTime, activateDelta: false},
{name: "SpanBatchAtGenesis", regolithTime: &zeroTime, activateRegolith: true, {name: "DeltaAtGenesis", regolithTime: &zeroTime, activateRegolith: true,
spanBatchTime: &zeroTime, activateSpanBatch: true}, deltaTime: &zeroTime, activateDelta: true},
{name: "SpanBatchAfterGenesis", regolithTime: &zeroTime, activateRegolith: true, {name: "DeltaAfterGenesis", regolithTime: &zeroTime, activateRegolith: true,
spanBatchTime: &futureTime, activateSpanBatch: true}, deltaTime: &futureTime, activateDelta: true},
} }
for _, test := range tests { for _, test := range tests {
test := test // Use a fixed reference as the tests run in parallel test := test // Use a fixed reference as the tests run in parallel
...@@ -58,7 +58,7 @@ func runCrossLayerUserTest(gt *testing.T, test hardforkScheduledTest) { ...@@ -58,7 +58,7 @@ func runCrossLayerUserTest(gt *testing.T, test hardforkScheduledTest) {
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams) dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
dp.DeployConfig.L2GenesisRegolithTimeOffset = test.regolithTime dp.DeployConfig.L2GenesisRegolithTimeOffset = test.regolithTime
dp.DeployConfig.L2GenesisSpanBatchTimeOffset = test.spanBatchTime dp.DeployConfig.L2GenesisDeltaTimeOffset = test.deltaTime
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug) log := testlog.Logger(t, log.LvlDebug)
......
...@@ -36,7 +36,7 @@ func TestERC20BridgeDeposits(t *testing.T) { ...@@ -36,7 +36,7 @@ func TestERC20BridgeDeposits(t *testing.T) {
l1Client := sys.Clients["l1"] l1Client := sys.Clients["l1"]
l2Client := sys.Clients["sequencer"] l2Client := sys.Clients["sequencer"]
opts, err := bind.NewKeyedTransactorWithChainID(sys.cfg.Secrets.Alice, cfg.L1ChainIDBig()) opts, err := bind.NewKeyedTransactorWithChainID(sys.Cfg.Secrets.Alice, cfg.L1ChainIDBig())
require.Nil(t, err) require.Nil(t, err)
// Deploy WETH9 // Deploy WETH9
...@@ -57,7 +57,7 @@ func TestERC20BridgeDeposits(t *testing.T) { ...@@ -57,7 +57,7 @@ func TestERC20BridgeDeposits(t *testing.T) {
require.Equal(t, big.NewInt(params.Ether), wethBalance) require.Equal(t, big.NewInt(params.Ether), wethBalance)
// Deploy L2 WETH9 // Deploy L2 WETH9
l2Opts, err := bind.NewKeyedTransactorWithChainID(sys.cfg.Secrets.Alice, cfg.L2ChainIDBig()) l2Opts, err := bind.NewKeyedTransactorWithChainID(sys.Cfg.Secrets.Alice, cfg.L2ChainIDBig())
require.NoError(t, err) require.NoError(t, err)
optimismMintableTokenFactory, err := bindings.NewOptimismMintableERC20Factory(predeploys.OptimismMintableERC20FactoryAddr, l2Client) optimismMintableTokenFactory, err := bindings.NewOptimismMintableERC20Factory(predeploys.OptimismMintableERC20FactoryAddr, l2Client)
require.NoError(t, err) require.NoError(t, err)
......
...@@ -94,9 +94,9 @@ func applyCannonConfig( ...@@ -94,9 +94,9 @@ func applyCannonConfig(
) { ) {
require := require.New(t) require := require.New(t)
c.CannonL2 = l2Endpoint c.CannonL2 = l2Endpoint
c.CannonBin = "../cannon/bin/cannon" c.CannonBin = "../../cannon/bin/cannon"
c.CannonServer = "../op-program/bin/op-program" c.CannonServer = "../../op-program/bin/op-program"
c.CannonAbsolutePreState = "../op-program/bin/prestate.json" c.CannonAbsolutePreState = "../../op-program/bin/prestate.json"
c.CannonSnapshotFreq = 10_000_000 c.CannonSnapshotFreq = 10_000_000
genesisBytes, err := json.Marshal(l2Genesis) genesisBytes, err := json.Marshal(l2Genesis)
......
...@@ -158,7 +158,7 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) * ...@@ -158,7 +158,7 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) *
L1SystemConfigAddress: deployConf.SystemConfigProxy, L1SystemConfigAddress: deployConf.SystemConfigProxy,
RegolithTime: deployConf.RegolithTime(uint64(deployConf.L1GenesisBlockTimestamp)), RegolithTime: deployConf.RegolithTime(uint64(deployConf.L1GenesisBlockTimestamp)),
CanyonTime: deployConf.CanyonTime(uint64(deployConf.L1GenesisBlockTimestamp)), CanyonTime: deployConf.CanyonTime(uint64(deployConf.L1GenesisBlockTimestamp)),
SpanBatchTime: deployConf.SpanBatchTime(uint64(deployConf.L1GenesisBlockTimestamp)), DeltaTime: deployConf.DeltaTime(uint64(deployConf.L1GenesisBlockTimestamp)),
} }
require.NoError(t, rollupCfg.Check()) require.NoError(t, rollupCfg.Check())
......
package faultproofs
import (
"context"
"testing"
"time"
op_e2e "github.com/ethereum-optimism/optimism/op-e2e"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/disputegame"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/stretchr/testify/require"
)
func TestChallengerCompleteDisputeGame(t *testing.T) {
op_e2e.InitParallel(t, op_e2e.UseExecutor(1))
tests := []struct {
name string
rootClaimAlphabet string
otherAlphabet string
expectedResult disputegame.Status
expectStep bool
}{
{
name: "ChallengerWins_DefenseStep",
rootClaimAlphabet: "abcdexyz",
otherAlphabet: disputegame.CorrectAlphabet,
expectedResult: disputegame.StatusChallengerWins,
expectStep: true,
},
{
name: "DefenderWins_DefenseStep",
rootClaimAlphabet: disputegame.CorrectAlphabet,
otherAlphabet: "abcdexyz",
expectedResult: disputegame.StatusDefenderWins,
expectStep: false,
},
{
name: "ChallengerWins_AttackStep",
rootClaimAlphabet: "abcdefghzyx",
otherAlphabet: disputegame.CorrectAlphabet,
expectedResult: disputegame.StatusChallengerWins,
expectStep: true,
},
{
name: "DefenderWins_AttackStep",
rootClaimAlphabet: disputegame.CorrectAlphabet,
otherAlphabet: "abcdexyz",
expectedResult: disputegame.StatusDefenderWins,
expectStep: false,
},
{
name: "DefenderIncorrectAtTraceZero",
rootClaimAlphabet: "zyxwvut",
otherAlphabet: disputegame.CorrectAlphabet,
expectedResult: disputegame.StatusChallengerWins,
expectStep: true,
},
{
name: "ChallengerIncorrectAtTraceZero",
rootClaimAlphabet: disputegame.CorrectAlphabet,
otherAlphabet: "zyxwvut",
expectedResult: disputegame.StatusDefenderWins,
expectStep: false,
},
{
name: "DefenderIncorrectAtLastTraceIndex",
rootClaimAlphabet: "abcdefghijklmnoz",
otherAlphabet: disputegame.CorrectAlphabet,
expectedResult: disputegame.StatusChallengerWins,
expectStep: true,
},
{
name: "ChallengerIncorrectAtLastTraceIndex",
rootClaimAlphabet: disputegame.CorrectAlphabet,
otherAlphabet: "abcdefghijklmnoz",
expectedResult: disputegame.StatusDefenderWins,
expectStep: false,
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
op_e2e.InitParallel(t, op_e2e.UseExecutor(1))
ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t)
t.Cleanup(sys.Close)
disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys.Cfg.L1Deployments, l1Client)
game := disputeGameFactory.StartAlphabetGame(ctx, test.rootClaimAlphabet)
require.NotNil(t, game)
gameDuration := game.GameDuration(ctx)
game.StartChallenger(ctx, sys.NodeEndpoint("l1"), "Defender",
challenger.WithAgreeProposedOutput(false),
challenger.WithPrivKey(sys.Cfg.Secrets.Mallory),
)
game.StartChallenger(ctx, sys.NodeEndpoint("l1"), "Challenger",
// Agree with the proposed output, so disagree with the root claim
challenger.WithAgreeProposedOutput(true),
challenger.WithAlphabet(test.otherAlphabet),
challenger.WithPrivKey(sys.Cfg.Secrets.Alice),
)
// Wait for a claim at the maximum depth that has been countered to indicate we're ready to resolve the game
game.WaitForClaimAtMaxDepth(ctx, test.expectStep)
sys.TimeTravelClock.AdvanceTime(gameDuration)
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game.WaitForInactivity(ctx, 10, true)
game.LogGameData(ctx)
require.EqualValues(t, test.expectedResult, game.Status(ctx))
})
}
}
func TestChallengerCompleteExhaustiveDisputeGame(t *testing.T) {
op_e2e.InitParallel(t, op_e2e.UseExecutor(1))
testCase := func(t *testing.T, isRootCorrect bool) {
ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t)
t.Cleanup(sys.Close)
disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys.Cfg.L1Deployments, l1Client)
rootClaimedAlphabet := disputegame.CorrectAlphabet
if !isRootCorrect {
rootClaimedAlphabet = "abcdexyz"
}
game := disputeGameFactory.StartAlphabetGame(ctx, rootClaimedAlphabet)
require.NotNil(t, game)
gameDuration := game.GameDuration(ctx)
// Start honest challenger
game.StartChallenger(ctx, sys.NodeEndpoint("l1"), "Challenger",
challenger.WithAgreeProposedOutput(!isRootCorrect),
challenger.WithAlphabet(disputegame.CorrectAlphabet),
challenger.WithPrivKey(sys.Cfg.Secrets.Alice),
// Ensures the challenger responds to all claims before test timeout
challenger.WithPollInterval(time.Millisecond*400),
)
// Start dishonest challenger
dishonestHelper := game.CreateDishonestHelper(disputegame.CorrectAlphabet, 4, !isRootCorrect)
dishonestHelper.ExhaustDishonestClaims(ctx)
// Wait until we've reached max depth before checking for inactivity
game.WaitForClaimAtDepth(ctx, int(game.MaxDepth(ctx)))
// Wait for 4 blocks of no challenger responses. The challenger may still be stepping on invalid claims at max depth
game.WaitForInactivity(ctx, 4, false)
sys.TimeTravelClock.AdvanceTime(gameDuration)
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
expectedStatus := disputegame.StatusChallengerWins
if isRootCorrect {
expectedStatus = disputegame.StatusDefenderWins
}
game.WaitForInactivity(ctx, 10, true)
game.LogGameData(ctx)
require.EqualValues(t, expectedStatus, game.Status(ctx))
}
t.Run("RootCorrect", func(t *testing.T) {
op_e2e.InitParallel(t, op_e2e.UseExecutor(1))
testCase(t, true)
})
t.Run("RootIncorrect", func(t *testing.T) {
op_e2e.InitParallel(t, op_e2e.UseExecutor(1))
testCase(t, false)
})
}
package faultproofs
import (
"context"
"math/big"
"testing"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/trace/alphabet"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
op_e2e "github.com/ethereum-optimism/optimism/op-e2e"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/disputegame"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)
func TestMultipleCannonGames(t *testing.T) {
op_e2e.InitParallel(t, op_e2e.UsesCannon, op_e2e.UseExecutor(0))
ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t)
t.Cleanup(sys.Close)
gameFactory := disputegame.NewFactoryHelper(t, ctx, sys.Cfg.L1Deployments, l1Client)
// Start a challenger with the correct alphabet trace
challenger := gameFactory.StartChallenger(ctx, sys.NodeEndpoint("l1"), "TowerDefense",
challenger.WithCannon(t, sys.RollupConfig, sys.L2GenesisCfg, sys.NodeEndpoint("sequencer")),
challenger.WithPrivKey(sys.Cfg.Secrets.Alice),
challenger.WithAgreeProposedOutput(true),
)
game1 := gameFactory.StartCannonGame(ctx, common.Hash{0x01, 0xaa})
game2 := gameFactory.StartCannonGame(ctx, common.Hash{0x01, 0xbb})
game1.WaitForClaimCount(ctx, 2)
game2.WaitForClaimCount(ctx, 2)
game1Claim := game1.GetClaimValue(ctx, 1)
game2Claim := game2.GetClaimValue(ctx, 1)
require.NotEqual(t, game1Claim, game2Claim, "games should have different cannon traces")
// Check that the helper finds the game directories correctly
challenger.VerifyGameDataExists(game1, game2)
// Push both games down to the step function
maxDepth := game1.MaxDepth(ctx)
for claimCount := int64(1); claimCount <= maxDepth; {
// Challenger should respond to both games
claimCount++
game1.WaitForClaimCount(ctx, claimCount)
game2.WaitForClaimCount(ctx, claimCount)
// Progress both games
game1.Defend(ctx, claimCount-1, common.Hash{0xaa})
game2.Defend(ctx, claimCount-1, common.Hash{0xaa})
claimCount++
}
game1.WaitForClaimAtMaxDepth(ctx, true)
game2.WaitForClaimAtMaxDepth(ctx, true)
gameDuration := game1.GameDuration(ctx)
sys.TimeTravelClock.AdvanceTime(gameDuration)
require.NoError(t, wait.ForNextBlock(ctx, l1Client))
game1.WaitForInactivity(ctx, 10, true)
game2.WaitForInactivity(ctx, 10, true)
game1.LogGameData(ctx)
game2.LogGameData(ctx)
require.EqualValues(t, disputegame.StatusChallengerWins, game1.Status(ctx))
require.EqualValues(t, disputegame.StatusChallengerWins, game2.Status(ctx))
// Check that the game directories are removed
challenger.WaitForGameDataDeletion(ctx, game1, game2)
}
func TestMultipleGameTypes(t *testing.T) {
op_e2e.InitParallel(t, op_e2e.UsesCannon, op_e2e.UseExecutor(0))
ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t)
t.Cleanup(sys.Close)
gameFactory := disputegame.NewFactoryHelper(t, ctx, sys.Cfg.L1Deployments, l1Client)
// Start a challenger with both cannon and alphabet support
gameFactory.StartChallenger(ctx, sys.NodeEndpoint("l1"), "TowerDefense",
challenger.WithCannon(t, sys.RollupConfig, sys.L2GenesisCfg, sys.NodeEndpoint("sequencer")),
challenger.WithAlphabet(disputegame.CorrectAlphabet),
challenger.WithPrivKey(sys.Cfg.Secrets.Alice),
challenger.WithAgreeProposedOutput(true),
)
game1 := gameFactory.StartCannonGame(ctx, common.Hash{0x01, 0xaa})
game2 := gameFactory.StartAlphabetGame(ctx, "xyzabc")
// Wait for the challenger to respond to both games
game1.WaitForClaimCount(ctx, 2)
game2.WaitForClaimCount(ctx, 2)
game1Response := game1.GetClaimValue(ctx, 1)
game2Response := game2.GetClaimValue(ctx, 1)
// The alphabet game always posts the same traces, so if they're different they can't both be from the alphabet.
require.NotEqual(t, game1Response, game2Response, "should have posted different claims")
// Now check they aren't both just from different cannon games by confirming the alphabet value.
correctAlphabet := alphabet.NewTraceProvider(disputegame.CorrectAlphabet, uint64(game2.MaxDepth(ctx)))
expectedClaim, err := correctAlphabet.Get(ctx, types.NewPositionFromGIndex(big.NewInt(1)).Attack())
require.NoError(t, err)
require.Equal(t, expectedClaim, game2Response)
// We don't confirm the cannon value because generating the correct claim is expensive
// Just being different is enough to confirm the challenger isn't just playing two alphabet games incorrectly
}
package faultproofs
import (
"context"
"testing"
op_e2e "github.com/ethereum-optimism/optimism/op-e2e"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/disputegame"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)
func TestOutputCannonGame(t *testing.T) {
op_e2e.InitParallel(t, op_e2e.UsesCannon, op_e2e.UseExecutor(0))
ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t)
t.Cleanup(sys.Close)
rollupEndpoint := sys.RollupNodes["sequencer"].HTTPEndpoint()
l1Endpoint := sys.NodeEndpoint("l1")
l2Endpoint := sys.NodeEndpoint("sequencer")
require.NotEqual(t, rollupEndpoint, l2Endpoint)
disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys.Cfg.L1Deployments, l1Client)
game := disputeGameFactory.StartOutputCannonGame(ctx, rollupEndpoint, common.Hash{0x01})
game.LogGameData(ctx)
game.StartChallenger(ctx, sys.RollupConfig, sys.L2GenesisCfg, rollupEndpoint, l1Endpoint, l2Endpoint, "Challenger",
// Agree with the proposed output, so disagree with the root claim
challenger.WithAgreeProposedOutput(true),
challenger.WithPrivKey(sys.Cfg.Secrets.Alice),
)
game.LogGameData(ctx)
maxDepth := game.MaxDepth(ctx)
// Challenger should post an output root to counter claims down to the leaf level of the top game
// TODO(client-pod#43): Load the depth of the top game from the contract instead of deriving it
for i := int64(1); i <= maxDepth/2+1; i += 2 {
game.WaitForCorrectOutputRoot(ctx, i)
game.Attack(ctx, i, common.Hash{0xaa})
game.LogGameData(ctx)
}
}
package faultproofs
import (
"context"
"testing"
op_e2e "github.com/ethereum-optimism/optimism/op-e2e"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/disputegame"
l2oo2 "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/l2oo"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/stretchr/testify/require"
)
func startFaultDisputeSystem(t *testing.T) (*op_e2e.System, *ethclient.Client) {
cfg := op_e2e.DefaultSystemConfig(t)
delete(cfg.Nodes, "verifier")
cfg.DeployConfig.SequencerWindowSize = 4
cfg.DeployConfig.FinalizationPeriodSeconds = 2
cfg.SupportL1TimeTravel = true
cfg.DeployConfig.L2OutputOracleSubmissionInterval = 1
cfg.NonFinalizedProposals = true // Submit output proposals asap
sys, err := cfg.Start(t)
require.Nil(t, err, "Error starting up system")
return sys, sys.Clients["l1"]
}
// setupDisputeGameForInvalidOutputRoot sets up an L2 chain with at least one valid output root followed by an invalid output root.
// A cannon dispute game is started to dispute the invalid output root with the correct root claim provided.
// An honest challenger is run to defend the root claim (ie disagree with the invalid output root).
func setupDisputeGameForInvalidOutputRoot(t *testing.T, outputRoot common.Hash) (*op_e2e.System, *ethclient.Client, *disputegame.CannonGameHelper, *disputegame.HonestHelper) {
ctx := context.Background()
sys, l1Client := startFaultDisputeSystem(t)
l2oo := l2oo2.NewL2OOHelper(t, sys.Cfg.L1Deployments, l1Client, sys.Cfg.Secrets.Proposer, sys.RollupConfig)
// Wait for one valid output root to be submitted
l2oo.WaitForProposals(ctx, 1)
err := sys.L2OutputSubmitter.Driver().StopL2OutputSubmitting()
require.NoError(t, err)
sys.L2OutputSubmitter = nil
// Submit an invalid output root
l2oo.PublishNextOutput(ctx, outputRoot)
l1Endpoint := sys.NodeEndpoint("l1")
l2Endpoint := sys.NodeEndpoint("sequencer")
// Dispute the new output root by creating a new game with the correct cannon trace.
disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys.Cfg.L1Deployments, l1Client)
game, correctTrace := disputeGameFactory.StartCannonGameWithCorrectRoot(ctx, sys.RollupConfig, sys.L2GenesisCfg, l1Endpoint, l2Endpoint,
challenger.WithPrivKey(sys.Cfg.Secrets.Mallory),
)
require.NotNil(t, game)
// Start the honest challenger
game.StartChallenger(ctx, sys.RollupConfig, sys.L2GenesisCfg, l1Endpoint, l2Endpoint, "Defender",
// Disagree with the proposed output, so agree with the (correct) root claim
challenger.WithAgreeProposedOutput(false),
challenger.WithPrivKey(sys.Cfg.Secrets.Mallory),
)
return sys, l1Client, game, correctTrace
}
...@@ -53,7 +53,7 @@ func TestTxGasSameAsBlockGasLimit(t *testing.T) { ...@@ -53,7 +53,7 @@ func TestTxGasSameAsBlockGasLimit(t *testing.T) {
require.Nil(t, err, "Error starting up system") require.Nil(t, err, "Error starting up system")
defer sys.Close() defer sys.Close()
ethPrivKey := sys.cfg.Secrets.Alice ethPrivKey := sys.Cfg.Secrets.Alice
tx := types.MustSignNewTx(ethPrivKey, types.LatestSignerForChainID(cfg.L2ChainIDBig()), &types.DynamicFeeTx{ tx := types.MustSignNewTx(ethPrivKey, types.LatestSignerForChainID(cfg.L2ChainIDBig()), &types.DynamicFeeTx{
ChainID: cfg.L2ChainIDBig(), ChainID: cfg.L2ChainIDBig(),
Gas: 29_999_999, Gas: 29_999_999,
......
...@@ -248,7 +248,7 @@ type EthInstance interface { ...@@ -248,7 +248,7 @@ type EthInstance interface {
} }
type System struct { type System struct {
cfg SystemConfig Cfg SystemConfig
RollupConfig *rollup.Config RollupConfig *rollup.Config
...@@ -335,7 +335,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste ...@@ -335,7 +335,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste
} }
sys := &System{ sys := &System{
cfg: cfg, Cfg: cfg,
EthInstances: make(map[string]EthInstance), EthInstances: make(map[string]EthInstance),
Clients: make(map[string]*ethclient.Client), Clients: make(map[string]*ethclient.Client),
RawClients: make(map[string]*rpc.Client), RawClients: make(map[string]*rpc.Client),
...@@ -433,7 +433,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste ...@@ -433,7 +433,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste
L1SystemConfigAddress: cfg.DeployConfig.SystemConfigProxy, L1SystemConfigAddress: cfg.DeployConfig.SystemConfigProxy,
RegolithTime: cfg.DeployConfig.RegolithTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), RegolithTime: cfg.DeployConfig.RegolithTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)),
CanyonTime: cfg.DeployConfig.CanyonTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), CanyonTime: cfg.DeployConfig.CanyonTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)),
SpanBatchTime: cfg.DeployConfig.SpanBatchTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)), DeltaTime: cfg.DeployConfig.DeltaTime(uint64(cfg.DeployConfig.L1GenesisBlockTimestamp)),
ProtocolVersionsAddress: cfg.L1Deployments.ProtocolVersionsProxy, ProtocolVersionsAddress: cfg.L1Deployments.ProtocolVersionsProxy,
} }
} }
...@@ -690,7 +690,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste ...@@ -690,7 +690,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste
Format: oplog.FormatText, Format: oplog.FormatText,
}, },
} }
proposer, err := l2os.ProposerServiceFromCLIConfig(context.Background(), "0.0.1", proposerCLIConfig, sys.cfg.Loggers["proposer"]) proposer, err := l2os.ProposerServiceFromCLIConfig(context.Background(), "0.0.1", proposerCLIConfig, sys.Cfg.Loggers["proposer"])
if err != nil { if err != nil {
return nil, fmt.Errorf("unable to setup l2 output submitter: %w", err) return nil, fmt.Errorf("unable to setup l2 output submitter: %w", err)
} }
...@@ -700,7 +700,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste ...@@ -700,7 +700,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste
sys.L2OutputSubmitter = proposer sys.L2OutputSubmitter = proposer
var batchType uint = derive.SingularBatchType var batchType uint = derive.SingularBatchType
if cfg.DeployConfig.L2GenesisSpanBatchTimeOffset != nil && *cfg.DeployConfig.L2GenesisSpanBatchTimeOffset == hexutil.Uint64(0) { if cfg.DeployConfig.L2GenesisDeltaTimeOffset != nil && *cfg.DeployConfig.L2GenesisDeltaTimeOffset == hexutil.Uint64(0) {
batchType = derive.SpanBatchType batchType = derive.SpanBatchType
} }
batcherMaxL1TxSizeBytes := cfg.BatcherMaxL1TxSizeBytes batcherMaxL1TxSizeBytes := cfg.BatcherMaxL1TxSizeBytes
...@@ -726,11 +726,11 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste ...@@ -726,11 +726,11 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste
Level: log.LvlInfo, Level: log.LvlInfo,
Format: oplog.FormatText, Format: oplog.FormatText,
}, },
Stopped: sys.cfg.DisableBatcher, // Batch submitter may be enabled later Stopped: sys.Cfg.DisableBatcher, // Batch submitter may be enabled later
BatchType: batchType, BatchType: batchType,
} }
// Batch Submitter // Batch Submitter
batcher, err := bss.BatcherServiceFromCLIConfig(context.Background(), "0.0.1", batcherCLIConfig, sys.cfg.Loggers["batcher"]) batcher, err := bss.BatcherServiceFromCLIConfig(context.Background(), "0.0.1", batcherCLIConfig, sys.Cfg.Loggers["batcher"])
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to setup batch submitter: %w", err) return nil, fmt.Errorf("failed to setup batch submitter: %w", err)
} }
......
...@@ -74,11 +74,11 @@ func testVerifyL2OutputRootEmptyBlock(t *testing.T, detached bool, spanBatchActi ...@@ -74,11 +74,11 @@ func testVerifyL2OutputRootEmptyBlock(t *testing.T, detached bool, spanBatchActi
// But not too small to ensure that our claim and subsequent state change is published // But not too small to ensure that our claim and subsequent state change is published
cfg.DeployConfig.SequencerWindowSize = 16 cfg.DeployConfig.SequencerWindowSize = 16
if spanBatchActivated { if spanBatchActivated {
// Activate span batch hard fork // Activate delta hard fork
minTs := hexutil.Uint64(0) minTs := hexutil.Uint64(0)
cfg.DeployConfig.L2GenesisSpanBatchTimeOffset = &minTs cfg.DeployConfig.L2GenesisDeltaTimeOffset = &minTs
} else { } else {
cfg.DeployConfig.L2GenesisSpanBatchTimeOffset = nil cfg.DeployConfig.L2GenesisDeltaTimeOffset = nil
} }
sys, err := cfg.Start(t) sys, err := cfg.Start(t)
...@@ -179,11 +179,11 @@ func testVerifyL2OutputRoot(t *testing.T, detached bool, spanBatchActivated bool ...@@ -179,11 +179,11 @@ func testVerifyL2OutputRoot(t *testing.T, detached bool, spanBatchActivated bool
// We don't need a verifier - just the sequencer is enough // We don't need a verifier - just the sequencer is enough
delete(cfg.Nodes, "verifier") delete(cfg.Nodes, "verifier")
if spanBatchActivated { if spanBatchActivated {
// Activate span batch hard fork // Activate delta hard fork
minTs := hexutil.Uint64(0) minTs := hexutil.Uint64(0)
cfg.DeployConfig.L2GenesisSpanBatchTimeOffset = &minTs cfg.DeployConfig.L2GenesisDeltaTimeOffset = &minTs
} else { } else {
cfg.DeployConfig.L2GenesisSpanBatchTimeOffset = nil cfg.DeployConfig.L2GenesisDeltaTimeOffset = nil
} }
sys, err := cfg.Start(t) sys, err := cfg.Start(t)
......
...@@ -50,7 +50,7 @@ import ( ...@@ -50,7 +50,7 @@ import (
func TestSystemBatchType(t *testing.T) { func TestSystemBatchType(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
f func(gt *testing.T, spanBatchTimeOffset *hexutil.Uint64) f func(gt *testing.T, deltaTimeOffset *hexutil.Uint64)
}{ }{
{"StopStartBatcher", StopStartBatcher}, {"StopStartBatcher", StopStartBatcher},
} }
...@@ -61,11 +61,11 @@ func TestSystemBatchType(t *testing.T) { ...@@ -61,11 +61,11 @@ func TestSystemBatchType(t *testing.T) {
}) })
} }
spanBatchTimeOffset := hexutil.Uint64(0) deltaTimeOffset := hexutil.Uint64(0)
for _, test := range tests { for _, test := range tests {
test := test test := test
t.Run(test.name+"_SpanBatch", func(t *testing.T) { t.Run(test.name+"_SpanBatch", func(t *testing.T) {
test.f(t, &spanBatchTimeOffset) test.f(t, &deltaTimeOffset)
}) })
} }
} }
...@@ -192,10 +192,10 @@ func runE2ESystemTest(t *testing.T, sys *System) { ...@@ -192,10 +192,10 @@ func runE2ESystemTest(t *testing.T, sys *System) {
l2Verif := sys.Clients["verifier"] l2Verif := sys.Clients["verifier"]
// Transactor Account // Transactor Account
ethPrivKey := sys.cfg.Secrets.Alice ethPrivKey := sys.Cfg.Secrets.Alice
// Send Transaction & wait for success // Send Transaction & wait for success
fromAddr := sys.cfg.Secrets.Addresses().Alice fromAddr := sys.Cfg.Secrets.Addresses().Alice
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel() defer cancel()
...@@ -203,11 +203,11 @@ func runE2ESystemTest(t *testing.T, sys *System) { ...@@ -203,11 +203,11 @@ func runE2ESystemTest(t *testing.T, sys *System) {
require.Nil(t, err) require.Nil(t, err)
// Send deposit transaction // Send deposit transaction
opts, err := bind.NewKeyedTransactorWithChainID(ethPrivKey, sys.cfg.L1ChainIDBig()) opts, err := bind.NewKeyedTransactorWithChainID(ethPrivKey, sys.Cfg.L1ChainIDBig())
require.Nil(t, err) require.Nil(t, err)
mintAmount := big.NewInt(1_000_000_000_000) mintAmount := big.NewInt(1_000_000_000_000)
opts.Value = mintAmount opts.Value = mintAmount
SendDepositTx(t, sys.cfg, l1Client, l2Verif, opts, func(l2Opts *DepositTxOpts) {}) SendDepositTx(t, sys.Cfg, l1Client, l2Verif, opts, func(l2Opts *DepositTxOpts) {})
// Confirm balance // Confirm balance
ctx, cancel = context.WithTimeout(context.Background(), 15*time.Second) ctx, cancel = context.WithTimeout(context.Background(), 15*time.Second)
...@@ -220,7 +220,7 @@ func runE2ESystemTest(t *testing.T, sys *System) { ...@@ -220,7 +220,7 @@ func runE2ESystemTest(t *testing.T, sys *System) {
require.Equal(t, mintAmount, diff, "Did not get expected balance change") require.Equal(t, mintAmount, diff, "Did not get expected balance change")
// Submit TX to L2 sequencer node // Submit TX to L2 sequencer node
receipt := SendL2Tx(t, sys.cfg, l2Seq, ethPrivKey, func(opts *TxOpts) { receipt := SendL2Tx(t, sys.Cfg, l2Seq, ethPrivKey, func(opts *TxOpts) {
opts.Value = big.NewInt(1_000_000_000) opts.Value = big.NewInt(1_000_000_000)
opts.Nonce = 1 // Already have deposit opts.Nonce = 1 // Already have deposit
opts.ToAddr = &common.Address{0xff, 0xff} opts.ToAddr = &common.Address{0xff, 0xff}
...@@ -1256,11 +1256,11 @@ func TestFees(t *testing.T) { ...@@ -1256,11 +1256,11 @@ func TestFees(t *testing.T) {
require.Equal(t, balanceDiff, totalFee, "balances should add up") require.Equal(t, balanceDiff, totalFee, "balances should add up")
} }
func StopStartBatcher(t *testing.T, spanBatchTimeOffset *hexutil.Uint64) { func StopStartBatcher(t *testing.T, deltaTimeOffset *hexutil.Uint64) {
InitParallel(t) InitParallel(t)
cfg := DefaultSystemConfig(t) cfg := DefaultSystemConfig(t)
cfg.DeployConfig.L2GenesisSpanBatchTimeOffset = spanBatchTimeOffset cfg.DeployConfig.L2GenesisDeltaTimeOffset = deltaTimeOffset
sys, err := cfg.Start(t) sys, err := cfg.Start(t)
require.Nil(t, err, "Error starting up system") require.Nil(t, err, "Error starting up system")
defer sys.Close() defer sys.Close()
......
...@@ -132,7 +132,7 @@ func TestL2SequencerRPCDepositTx(t *testing.T) { ...@@ -132,7 +132,7 @@ func TestL2SequencerRPCDepositTx(t *testing.T) {
// Obtain our sequencer, verifier, and transactor keypair. // Obtain our sequencer, verifier, and transactor keypair.
l2Seq := sys.Clients["sequencer"] l2Seq := sys.Clients["sequencer"]
l2Verif := sys.Clients["verifier"] l2Verif := sys.Clients["verifier"]
txSigningKey := sys.cfg.Secrets.Alice txSigningKey := sys.Cfg.Secrets.Alice
require.Nil(t, err) require.Nil(t, err)
// Create a deposit tx to send over RPC. // Create a deposit tx to send over RPC.
......
...@@ -26,7 +26,7 @@ var encodeBufferPool = sync.Pool{ ...@@ -26,7 +26,7 @@ var encodeBufferPool = sync.Pool{
const ( const (
// SingularBatchType is the first version of Batch format, representing a single L2 block. // SingularBatchType is the first version of Batch format, representing a single L2 block.
SingularBatchType = 0 SingularBatchType = 0
// SpanBatchType is the Batch version used after SpanBatch hard fork, representing a span of L2 blocks. // SpanBatchType is the Batch version used after Delta hard fork, representing a span of L2 blocks.
SpanBatchType = 1 SpanBatchType = 1
) )
......
...@@ -73,7 +73,7 @@ func buildSpanBatches(t *testing.T, parent *eth.L2BlockRef, singularBatches []*S ...@@ -73,7 +73,7 @@ func buildSpanBatches(t *testing.T, parent *eth.L2BlockRef, singularBatches []*S
return spanBatches return spanBatches
} }
func getSpanBatchTime(batchType int) *uint64 { func getDeltaTime(batchType int) *uint64 {
minTs := uint64(0) minTs := uint64(0)
if batchType == SpanBatchType { if batchType == SpanBatchType {
return &minTs return &minTs
...@@ -182,7 +182,7 @@ func BatchQueueNewOrigin(t *testing.T, batchType int) { ...@@ -182,7 +182,7 @@ func BatchQueueNewOrigin(t *testing.T, batchType int) {
BlockTime: 2, BlockTime: 2,
MaxSequencerDrift: 600, MaxSequencerDrift: 600,
SeqWindowSize: 2, SeqWindowSize: 2,
SpanBatchTime: getSpanBatchTime(batchType), DeltaTime: getDeltaTime(batchType),
} }
input := &fakeBatchQueueInput{ input := &fakeBatchQueueInput{
...@@ -243,7 +243,7 @@ func BatchQueueEager(t *testing.T, batchType int) { ...@@ -243,7 +243,7 @@ func BatchQueueEager(t *testing.T, batchType int) {
BlockTime: 2, BlockTime: 2,
MaxSequencerDrift: 600, MaxSequencerDrift: 600,
SeqWindowSize: 30, SeqWindowSize: 30,
SpanBatchTime: getSpanBatchTime(batchType), DeltaTime: getDeltaTime(batchType),
L2ChainID: chainId, L2ChainID: chainId,
} }
...@@ -321,7 +321,7 @@ func BatchQueueInvalidInternalAdvance(t *testing.T, batchType int) { ...@@ -321,7 +321,7 @@ func BatchQueueInvalidInternalAdvance(t *testing.T, batchType int) {
BlockTime: 2, BlockTime: 2,
MaxSequencerDrift: 600, MaxSequencerDrift: 600,
SeqWindowSize: 2, SeqWindowSize: 2,
SpanBatchTime: getSpanBatchTime(batchType), DeltaTime: getDeltaTime(batchType),
L2ChainID: chainId, L2ChainID: chainId,
} }
...@@ -440,7 +440,7 @@ func BatchQueueMissing(t *testing.T, batchType int) { ...@@ -440,7 +440,7 @@ func BatchQueueMissing(t *testing.T, batchType int) {
BlockTime: 2, BlockTime: 2,
MaxSequencerDrift: 600, MaxSequencerDrift: 600,
SeqWindowSize: 2, SeqWindowSize: 2,
SpanBatchTime: getSpanBatchTime(batchType), DeltaTime: getDeltaTime(batchType),
L2ChainID: chainId, L2ChainID: chainId,
} }
...@@ -557,7 +557,7 @@ func BatchQueueAdvancedEpoch(t *testing.T, batchType int) { ...@@ -557,7 +557,7 @@ func BatchQueueAdvancedEpoch(t *testing.T, batchType int) {
BlockTime: 2, BlockTime: 2,
MaxSequencerDrift: 600, MaxSequencerDrift: 600,
SeqWindowSize: 30, SeqWindowSize: 30,
SpanBatchTime: getSpanBatchTime(batchType), DeltaTime: getDeltaTime(batchType),
L2ChainID: chainId, L2ChainID: chainId,
} }
...@@ -644,7 +644,7 @@ func BatchQueueShuffle(t *testing.T, batchType int) { ...@@ -644,7 +644,7 @@ func BatchQueueShuffle(t *testing.T, batchType int) {
BlockTime: 2, BlockTime: 2,
MaxSequencerDrift: 600, MaxSequencerDrift: 600,
SeqWindowSize: 30, SeqWindowSize: 30,
SpanBatchTime: getSpanBatchTime(batchType), DeltaTime: getDeltaTime(batchType),
L2ChainID: chainId, L2ChainID: chainId,
} }
...@@ -742,7 +742,7 @@ func TestBatchQueueOverlappingSpanBatch(t *testing.T) { ...@@ -742,7 +742,7 @@ func TestBatchQueueOverlappingSpanBatch(t *testing.T) {
BlockTime: 2, BlockTime: 2,
MaxSequencerDrift: 600, MaxSequencerDrift: 600,
SeqWindowSize: 30, SeqWindowSize: 30,
SpanBatchTime: getSpanBatchTime(SpanBatchType), DeltaTime: getDeltaTime(SpanBatchType),
L2ChainID: chainId, L2ChainID: chainId,
} }
...@@ -847,7 +847,7 @@ func TestBatchQueueComplex(t *testing.T) { ...@@ -847,7 +847,7 @@ func TestBatchQueueComplex(t *testing.T) {
BlockTime: 2, BlockTime: 2,
MaxSequencerDrift: 600, MaxSequencerDrift: 600,
SeqWindowSize: 30, SeqWindowSize: 30,
SpanBatchTime: getSpanBatchTime(SpanBatchType), DeltaTime: getDeltaTime(SpanBatchType),
L2ChainID: chainId, L2ChainID: chainId,
} }
...@@ -965,7 +965,7 @@ func TestBatchQueueResetSpan(t *testing.T) { ...@@ -965,7 +965,7 @@ func TestBatchQueueResetSpan(t *testing.T) {
BlockTime: 2, BlockTime: 2,
MaxSequencerDrift: 600, MaxSequencerDrift: 600,
SeqWindowSize: 30, SeqWindowSize: 30,
SpanBatchTime: getSpanBatchTime(SpanBatchType), DeltaTime: getDeltaTime(SpanBatchType),
L2ChainID: chainId, L2ChainID: chainId,
} }
......
...@@ -186,8 +186,8 @@ func checkSpanBatch(ctx context.Context, cfg *rollup.Config, log log.Logger, l1B ...@@ -186,8 +186,8 @@ func checkSpanBatch(ctx context.Context, cfg *rollup.Config, log log.Logger, l1B
} }
batchOrigin = l1Blocks[1] batchOrigin = l1Blocks[1]
} }
if !cfg.IsSpanBatch(batchOrigin.Time) { if !cfg.IsDelta(batchOrigin.Time) {
log.Warn("received SpanBatch with L1 origin before SpanBatch hard fork") log.Warn("received SpanBatch with L1 origin before Delta hard fork")
return BatchDrop return BatchDrop
} }
......
This diff is collapsed.
...@@ -98,7 +98,7 @@ func (cr *ChannelInReader) NextBatch(ctx context.Context) (Batch, error) { ...@@ -98,7 +98,7 @@ func (cr *ChannelInReader) NextBatch(ctx context.Context) (Batch, error) {
} }
return singularBatch, nil return singularBatch, nil
case SpanBatchType: case SpanBatchType:
if origin := cr.Origin(); !cr.cfg.IsSpanBatch(origin.Time) { if origin := cr.Origin(); !cr.cfg.IsDelta(origin.Time) {
// Check hard fork activation with the L1 inclusion block time instead of the L1 origin block time. // Check hard fork activation with the L1 inclusion block time instead of the L1 origin block time.
// Therefore, even if the batch passed this rule, it can be dropped in the batch queue. // Therefore, even if the batch passed this rule, it can be dropped in the batch queue.
// This is just for early dropping invalid batches as soon as possible. // This is just for early dropping invalid batches as soon as possible.
......
...@@ -75,11 +75,13 @@ type Config struct { ...@@ -75,11 +75,13 @@ type Config struct {
// Active if RegolithTime != nil && L2 block timestamp >= *RegolithTime, inactive otherwise. // Active if RegolithTime != nil && L2 block timestamp >= *RegolithTime, inactive otherwise.
RegolithTime *uint64 `json:"regolith_time,omitempty"` RegolithTime *uint64 `json:"regolith_time,omitempty"`
// CanyonTime sets the activation time of the next network upgrade. // CanyonTime sets the activation time of the next network upgrade.
// Active if CanyonTime != nil && L2 block timestamp >= *CanyonTime, inactive otherwise. // Active if CanyonTime != nil && L2 block timestamp >= *CanyonTime, inactive otherwise.
CanyonTime *uint64 `json:"canyon_time,omitempty"` CanyonTime *uint64 `json:"canyon_time,omitempty"`
SpanBatchTime *uint64 `json:"span_batch_time,omitempty"` // DeltaTime sets the activation time of the next network upgrade.
// Active if DeltaTime != nil && L2 block timestamp >= *DeltaTime, inactive otherwise.
DeltaTime *uint64 `json:"delta_time,omitempty"`
// Note: below addresses are part of the block-derivation process, // Note: below addresses are part of the block-derivation process,
// and required to be the same network-wide to stay in consensus. // and required to be the same network-wide to stay in consensus.
...@@ -274,8 +276,9 @@ func (c *Config) IsCanyon(timestamp uint64) bool { ...@@ -274,8 +276,9 @@ func (c *Config) IsCanyon(timestamp uint64) bool {
return c.CanyonTime != nil && timestamp >= *c.CanyonTime return c.CanyonTime != nil && timestamp >= *c.CanyonTime
} }
func (c *Config) IsSpanBatch(timestamp uint64) bool { // IsDelta returns true if the Delta hardfork is active at or past the given timestamp.
return c.SpanBatchTime != nil && timestamp >= *c.SpanBatchTime func (c *Config) IsDelta(timestamp uint64) bool {
return c.DeltaTime != nil && timestamp >= *c.DeltaTime
} }
// Description outputs a banner describing the important parts of rollup configuration in a human-readable form. // Description outputs a banner describing the important parts of rollup configuration in a human-readable form.
...@@ -306,7 +309,7 @@ func (c *Config) Description(l2Chains map[string]string) string { ...@@ -306,7 +309,7 @@ func (c *Config) Description(l2Chains map[string]string) string {
banner += "Post-Bedrock Network Upgrades (timestamp based):\n" banner += "Post-Bedrock Network Upgrades (timestamp based):\n"
banner += fmt.Sprintf(" - Regolith: %s\n", fmtForkTimeOrUnset(c.RegolithTime)) banner += fmt.Sprintf(" - Regolith: %s\n", fmtForkTimeOrUnset(c.RegolithTime))
banner += fmt.Sprintf(" - Canyon: %s\n", fmtForkTimeOrUnset(c.CanyonTime)) banner += fmt.Sprintf(" - Canyon: %s\n", fmtForkTimeOrUnset(c.CanyonTime))
banner += fmt.Sprintf(" - SpanBatch: %s\n", fmtForkTimeOrUnset(c.SpanBatchTime)) banner += fmt.Sprintf(" - Delta: %s\n", fmtForkTimeOrUnset(c.DeltaTime))
// Report the protocol version // Report the protocol version
banner += fmt.Sprintf("Node supports up to OP-Stack Protocol Version: %s\n", OPStackSupport) banner += fmt.Sprintf("Node supports up to OP-Stack Protocol Version: %s\n", OPStackSupport)
return banner return banner
...@@ -333,7 +336,7 @@ func (c *Config) LogDescription(log log.Logger, l2Chains map[string]string) { ...@@ -333,7 +336,7 @@ func (c *Config) LogDescription(log log.Logger, l2Chains map[string]string) {
"l2_block_number", c.Genesis.L2.Number, "l1_block_hash", c.Genesis.L1.Hash.String(), "l2_block_number", c.Genesis.L2.Number, "l1_block_hash", c.Genesis.L1.Hash.String(),
"l1_block_number", c.Genesis.L1.Number, "regolith_time", fmtForkTimeOrUnset(c.RegolithTime), "l1_block_number", c.Genesis.L1.Number, "regolith_time", fmtForkTimeOrUnset(c.RegolithTime),
"canyon_time", fmtForkTimeOrUnset(c.CanyonTime), "canyon_time", fmtForkTimeOrUnset(c.CanyonTime),
"span_batch_time", fmtForkTimeOrUnset(c.SpanBatchTime), "delta_time", fmtForkTimeOrUnset(c.DeltaTime),
) )
} }
......
...@@ -19,10 +19,10 @@ import ( ...@@ -19,10 +19,10 @@ import (
// setupL2OutputOracle deploys the L2 Output Oracle contract to a simulated backend // setupL2OutputOracle deploys the L2 Output Oracle contract to a simulated backend
func setupL2OutputOracle() (common.Address, *bind.TransactOpts, *backends.SimulatedBackend, *bindings.L2OutputOracle, error) { func setupL2OutputOracle() (common.Address, *bind.TransactOpts, *backends.SimulatedBackend, *bindings.L2OutputOracle, error) {
privateKey, err := crypto.GenerateKey() privateKey, err := crypto.GenerateKey()
from := crypto.PubkeyToAddress(privateKey.PublicKey)
if err != nil { if err != nil {
return common.Address{}, nil, nil, nil, err return common.Address{}, nil, nil, nil, err
} }
from := crypto.PubkeyToAddress(privateKey.PublicKey)
opts, err := bind.NewKeyedTransactorWithChainID(privateKey, big.NewInt(1337)) opts, err := bind.NewKeyedTransactorWithChainID(privateKey, big.NewInt(1337))
if err != nil { if err != nil {
return common.Address{}, nil, nil, nil, err return common.Address{}, nil, nil, nil, err
......
...@@ -3,3 +3,6 @@ target/ ...@@ -3,3 +3,6 @@ target/
# Bindings # Bindings
rdb.h rdb.h
# Testdata DB
testdata/db
This diff is collapsed.
...@@ -9,7 +9,18 @@ name = "rethdbreader" ...@@ -9,7 +9,18 @@ name = "rethdbreader"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[dependencies] [dependencies]
reth = { git = "https://github.com/paradigmxyz/reth.git" } # reth
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "b58bfe6" }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", rev = "b58bfe6" }
reth-db = { git = "https://github.com/paradigmxyz/reth.git", rev = "b58bfe6" }
reth-rpc-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "b58bfe6" }
reth-blockchain-tree = { git = "https://github.com/paradigmxyz/reth.git", rev = "b58bfe6" }
# misc
serde = "1.0.190" serde = "1.0.190"
serde_json = "1.0.107" serde_json = "1.0.107"
anyhow = "1.0.75" anyhow = "1.0.75"
[dev-dependencies]
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", rev = "b58bfe6" }
alloy-rlp = "0.3.3"
.PHONY: testdata
testdata:
mkdir -p testdata
@echo "Fetching block RLP and receipts for block #18,663,292 from ethereum mainnet"
cast rpc debug_getRawBlock 0x11CC77C | jq -r | xxd -r -p > testdata/block.rlp
cast rpc debug_getRawReceipts 0x11CC77C | jq -r > testdata/receipts.json
@echo "Done. Generating testdata DB & testing integrity..."
cargo test
...@@ -27,6 +27,14 @@ cargo doc --open ...@@ -27,6 +27,14 @@ cargo doc --open
cargo +nightly fmt -- && cargo +nightly clippy --all --all-features -- -D warnings cargo +nightly fmt -- && cargo +nightly clippy --all --all-features -- -D warnings
``` ```
**Generating `testdata`**
The testdata block and `reth` database can be generated by running the `testdata` make directive:
```sh
ETH_RPC_URL="<your_L1_RPC_URL>" make testdata
```
**Generating the C header** **Generating the C header**
To generate the C header, first install `cbindgen` via `cargo install cbindgen --force`. Then, run the generation script: To generate the C header, first install `cbindgen` via `cargo install cbindgen --force`. Then, run the generation script:
......
reorder_imports = true
imports_granularity = "Crate"
use_small_heuristics = "Max"
comment_width = 100
wrap_comments = true
binop_separator = "Back"
trailing_comma = "Vertical"
trailing_semicolon = false
use_field_init_shorthand = true
format_code_in_doc_comments = true
doc_comment_code_block_width = 100
...@@ -8,8 +8,8 @@ mod receipts; ...@@ -8,8 +8,8 @@ mod receipts;
/// Read the receipts for a blockhash from the RETH database directly. /// Read the receipts for a blockhash from the RETH database directly.
/// ///
/// # Safety /// # Safety
/// - All possible nil pointer dereferences are checked, and the function will return a /// - All possible nil pointer dereferences are checked, and the function will return a failing
/// failing [ReceiptsResult] if any are found. /// [ReceiptsResult] if any are found.
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn rdb_read_receipts( pub unsafe extern "C" fn rdb_read_receipts(
block_hash: *const u8, block_hash: *const u8,
......
...@@ -2,16 +2,14 @@ ...@@ -2,16 +2,14 @@
//! [reth] database. //! [reth] database.
use anyhow::{anyhow, Result}; use anyhow::{anyhow, Result};
use reth::{ use reth_blockchain_tree::noop::NoopBlockchainTree;
blockchain_tree::noop::NoopBlockchainTree, use reth_db::open_db_read_only;
primitives::{ use reth_primitives::{
BlockHashOrNumber, Receipt, TransactionKind, TransactionMeta, TransactionSigned, MAINNET, BlockHashOrNumber, Receipt, TransactionKind, TransactionMeta, TransactionSigned, MAINNET, U128,
U128, U256, U64, U256, U64,
},
providers::{providers::BlockchainProvider, BlockReader, ProviderFactory, ReceiptProvider},
rpc::types::{Log, TransactionReceipt},
utils::db::open_db_read_only,
}; };
use reth_provider::{providers::BlockchainProvider, BlockReader, ProviderFactory, ReceiptProvider};
use reth_rpc_types::{Log, TransactionReceipt};
use std::{ffi::c_char, path::Path}; use std::{ffi::c_char, path::Path};
/// A [ReceiptsResult] is a wrapper around a JSON string containing serialized [TransactionReceipt]s /// A [ReceiptsResult] is a wrapper around a JSON string containing serialized [TransactionReceipt]s
...@@ -30,28 +28,20 @@ pub struct ReceiptsResult { ...@@ -30,28 +28,20 @@ pub struct ReceiptsResult {
impl ReceiptsResult { impl ReceiptsResult {
/// Constructs a successful [ReceiptsResult] from a JSON string. /// Constructs a successful [ReceiptsResult] from a JSON string.
pub fn success(data: *mut char, data_len: usize) -> Self { pub fn success(data: *mut char, data_len: usize) -> Self {
Self { Self { data, data_len, error: false }
data,
data_len,
error: false,
}
} }
/// Constructs a failing [ReceiptsResult] with a null pointer to the data. /// Constructs a failing [ReceiptsResult] with a null pointer to the data.
pub fn fail() -> Self { pub fn fail() -> Self {
Self { Self { data: std::ptr::null_mut(), data_len: 0, error: true }
data: std::ptr::null_mut(),
data_len: 0,
error: true,
}
} }
} }
/// Read the receipts for a blockhash from the RETH database directly. /// Read the receipts for a blockhash from the RETH database directly.
/// ///
/// # Safety /// # Safety
/// - All possible nil pointer dereferences are checked, and the function will return a /// - All possible nil pointer dereferences are checked, and the function will return a failing
/// failing [ReceiptsResult] if any are found. /// [ReceiptsResult] if any are found.
#[inline(always)] #[inline(always)]
pub(crate) unsafe fn read_receipts_inner( pub(crate) unsafe fn read_receipts_inner(
block_hash: *const u8, block_hash: *const u8,
...@@ -83,9 +73,8 @@ pub(crate) unsafe fn read_receipts_inner( ...@@ -83,9 +73,8 @@ pub(crate) unsafe fn read_receipts_inner(
let provider = BlockchainProvider::new(factory, NoopBlockchainTree::default())?; let provider = BlockchainProvider::new(factory, NoopBlockchainTree::default())?;
// Fetch the block and the receipts within it // Fetch the block and the receipts within it
let block = provider let block =
.block_by_hash(block_hash.into())? provider.block_by_hash(block_hash.into())?.ok_or(anyhow!("Failed to fetch block"))?;
.ok_or(anyhow!("Failed to fetch block"))?;
let receipts = provider let receipts = provider
.receipts_by_block(BlockHashOrNumber::Hash(block_hash.into()))? .receipts_by_block(BlockHashOrNumber::Hash(block_hash.into()))?
.ok_or(anyhow!("Failed to fetch block receipts"))?; .ok_or(anyhow!("Failed to fetch block receipts"))?;
...@@ -165,11 +154,7 @@ fn build_transaction_receipt_with_block_receipts( ...@@ -165,11 +154,7 @@ fn build_transaction_receipt_with_block_receipts(
// TODO pre-byzantium receipts have a post-transaction state root // TODO pre-byzantium receipts have a post-transaction state root
state_root: None, state_root: None,
logs_bloom: receipt.bloom_slow(), logs_bloom: receipt.bloom_slow(),
status_code: if receipt.success { status_code: if receipt.success { Some(U64::from(1)) } else { Some(U64::from(0)) },
Some(U64::from(1))
} else {
Some(U64::from(0))
},
// EIP-4844 fields // EIP-4844 fields
blob_gas_price: None, blob_gas_price: None,
...@@ -209,3 +194,144 @@ fn build_transaction_receipt_with_block_receipts( ...@@ -209,3 +194,144 @@ fn build_transaction_receipt_with_block_receipts(
Some(res_receipt) Some(res_receipt)
} }
#[cfg(test)]
mod test {
use super::*;
use alloy_rlp::Decodable;
use reth_db::database::Database;
use reth_primitives::{
address, b256, bloom, hex, Address, Block, Bytes, ReceiptWithBloom, Receipts,
SealedBlockWithSenders, U8,
};
use reth_provider::{BlockWriter, BundleStateWithReceipts, DatabaseProvider};
use reth_revm::revm::db::BundleState;
use std::{ffi::CString, fs::File, path::Path};
#[inline]
fn dummy_block_with_receipts() -> Result<(Block, Vec<Receipt>)> {
// To generate testdata (block 18,663,292 on Ethereum Mainnet):
// 1. BLOCK RLP: `cast rpc debug_getRawBlock 0x11CC77C | jq -r | xxd -r -p >
// testdata/block.rlp`
// 2. RECEIPTS RLP: `cast rpc debug_getRawReceipts 0x11CC77C | jq -r >
// testdata/receipts.json`
let block_rlp = include_bytes!("../testdata/block.rlp");
let block = Block::decode(&mut block_rlp.as_ref())?;
let receipt_rlp: Vec<Vec<u8>> = serde_json::from_str(include_str!(
"../testdata/receipts.json"
))
.map(|v: Vec<String>| {
v.into_iter().map(|s| hex::decode(s)).collect::<Result<Vec<Vec<u8>>, _>>()
})??;
let receipts = receipt_rlp
.iter()
.map(|r| ReceiptWithBloom::decode(&mut r.as_slice()).map(|r| r.receipt))
.collect::<Result<Vec<Receipt>, _>>()?;
Ok((block, receipts))
}
#[inline]
fn open_receipts_testdata_db() -> Result<()> {
if File::open("testdata/db").is_ok() {
return Ok(())
}
// Open a RW handle to the MDBX database
let db = reth_db::init_db(Path::new("testdata/db"), None).map_err(|e| anyhow!(e))?;
let pr = DatabaseProvider::new_rw(db.tx_mut()?, MAINNET.clone());
// Grab the dummy block and receipts
let (mut block, receipts) = dummy_block_with_receipts()?;
// Patch: The block's current state root expects the rest of the chain history to be in the
// DB; manually override it. Otherwise, the DatabaseProvider will fail to commit the
// block.
block.header.state_root = reth_primitives::constants::EMPTY_ROOT_HASH;
// Fetch the block number and tx senders for bundle state creation.
let block_number = block.header.number;
let senders = block
.body
.iter()
.map(|tx| tx.recover_signer())
.collect::<Option<Vec<Address>>>()
.ok_or(anyhow!("Failed to recover signers"))?;
// Commit the bundle state to the database
pr.append_blocks_with_bundle_state(
vec![SealedBlockWithSenders { block: block.seal_slow(), senders }],
BundleStateWithReceipts::new(
BundleState::default(),
Receipts::from_block_receipt(receipts),
block_number,
),
None,
)?;
pr.commit()?;
Ok(())
}
#[test]
fn fetch_receipts() {
open_receipts_testdata_db().unwrap();
unsafe {
let mut block_hash =
b256!("6a229123d607c2232a8b0bdd36f90745945d05181018e64e60ff2b93ab6b52e5");
let receipts_res = super::read_receipts_inner(
block_hash.as_mut_ptr(),
32,
CString::new("testdata/db").unwrap().into_raw() as *const c_char,
)
.unwrap();
let receipts_data =
std::slice::from_raw_parts(receipts_res.data as *const u8, receipts_res.data_len);
let receipt = {
let mut receipts: Vec<TransactionReceipt> =
serde_json::from_slice(receipts_data).unwrap();
receipts.remove(0)
};
// Check the first receipt in the block for validity
assert_eq!(receipt.transaction_type, U8::from(2));
assert_eq!(receipt.status_code, Some(U64::from(1)));
assert_eq!(receipt.cumulative_gas_used, U256::from(115_316));
assert_eq!(receipt.logs_bloom, bloom!("00200000000000000000000080001000000000000000000000000000000000000000000000000000000000000000100002000100080000000000000000000000000000000000000000000008000000200000000400000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000400000000000001000000000000000100000000080000004000000000000000000000000000000000000002000000000000000000000000000000000000000006000000000000000000000000000000000000001000000000000000000000200000000000000100000000020000000000000000000000000000000010"));
assert_eq!(
receipt.logs[0].address,
address!("c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2")
);
assert_eq!(
receipt.logs[0].topics[0],
b256!("ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")
);
assert_eq!(
receipt.logs[0].topics[1],
b256!("00000000000000000000000000000000003b3cc22af3ae1eac0440bcee416b40")
);
assert_eq!(
receipt.logs[0].data,
Bytes::from_static(
hex!("00000000000000000000000000000000000000000000000008a30cd230000000")
.as_slice()
)
);
assert_eq!(receipt.from, address!("41d3ab85aafed2ef9e644cb7d3bbca2fc4d8cac8"));
assert_eq!(receipt.to, Some(address!("00000000003b3cc22af3ae1eac0440bcee416b40")));
assert_eq!(
receipt.transaction_hash,
Some(b256!("88b2d153a4e893ba91ac235325c44b1aa0c802fcb42657701e1a73e1c675f7ca"))
);
assert_eq!(receipt.block_number, Some(U256::from(18_663_292)));
assert_eq!(receipt.block_hash, Some(block_hash));
assert_eq!(receipt.transaction_index, U64::from(0));
crate::rdb_free_string(receipts_res.data as *mut c_char);
}
}
}
This diff is collapsed.
//go:build rethdb
package sources
import (
"math/big"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/require"
)
func TestRethDBReceiptsLoad(t *testing.T) {
t.Parallel()
// ETH Mainnet block #18,663,292
//
// https://etherscan.io/tx/0x88b2d153a4e893ba91ac235325c44b1aa0c802fcb42657701e1a73e1c675f7ca
//
// NOTE: The block hash differs from the live block due to a state root mismatch. In order to generate
// a testdata database with only this block in it, the state root of the block was modified.
// Old State Root: 0xaf81a692d228d56d35c80d65aeba59636b4671403054f6c57446c0e3e4d951c8
// New State Root (Empty MPT): 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421
blockHash := common.HexToHash("0x6a229123d607c2232a8b0bdd36f90745945d05181018e64e60ff2b93ab6b52e5")
res, err := FetchRethReceipts("../rethdb-reader/testdata/db", &blockHash)
require.NoError(t, err)
receipt := (*types.Receipt)(res[0])
require.Equal(t, receipt.Type, uint8(2))
require.Equal(t, receipt.Status, uint64(1))
require.Equal(t, receipt.CumulativeGasUsed, uint64(115_316))
require.Equal(t, receipt.Bloom, types.BytesToBloom(common.Hex2Bytes("00200000000000000000000080001000000000000000000000000000000000000000000000000000000000000000100002000100080000000000000000000000000000000000000000000008000000200000000400000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000400000000000001000000000000000100000000080000004000000000000000000000000000000000000002000000000000000000000000000000000000000006000000000000000000000000000000000000001000000000000000000000200000000000000100000000020000000000000000000000000000000010")))
require.Equal(t, receipt.Logs[0].Address, common.HexToAddress("c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"))
require.Equal(t, receipt.Logs[0].Topics[0], common.HexToHash("ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"))
require.Equal(t, receipt.Logs[0].Topics[1], common.HexToHash("00000000000000000000000000000000003b3cc22af3ae1eac0440bcee416b40"))
require.Equal(t, receipt.Logs[0].Data, common.Hex2Bytes("00000000000000000000000000000000000000000000000008a30cd230000000"))
require.Equal(t, receipt.TxHash, common.HexToHash("0x88b2d153a4e893ba91ac235325c44b1aa0c802fcb42657701e1a73e1c675f7ca"))
require.Equal(t, receipt.BlockHash, blockHash)
require.Equal(t, receipt.BlockNumber, big.NewInt(18_663_292))
require.Equal(t, receipt.TransactionIndex, uint(0))
}
...@@ -7,7 +7,7 @@ ARG TARGETARCH ...@@ -7,7 +7,7 @@ ARG TARGETARCH
ARG TARGET_BASE_IMAGE=alpine:3.18 ARG TARGET_BASE_IMAGE=alpine:3.18
# We may be cross-building for another platform. Specify which platform we need as builder. # We may be cross-building for another platform. Specify which platform we need as builder.
FROM --platform=$BUILDPLATFORM golang:1.21.3-alpine3.18 as builder FROM --platform=$TARGETPLATFORM golang:1.21.3-alpine3.18 as builder
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
...@@ -42,43 +42,43 @@ ARG GIT_DATE ...@@ -42,43 +42,43 @@ ARG GIT_DATE
# Build the Go services, utilizing caches and share the many common packages. # Build the Go services, utilizing caches and share the many common packages.
# The "id" defaults to the value of "target", the cache will thus be reused during this build. # The "id" defaults to the value of "target", the cache will thus be reused during this build.
# "sharing" defaults to "shared", the cache will thus be available to other concurrent docker builds. # "sharing" defaults to "shared", the cache will thus be available to other concurrent docker builds.
FROM --platform=$BUILDPLATFORM builder as cannon-builder FROM --platform=$TARGETPLATFORM builder as cannon-builder
ARG CANNON_VERSION=v0.0.0 ARG CANNON_VERSION=v0.0.0
RUN --mount=type=cache,target=/root/.cache/go-build cd cannon && make cannon \ RUN --mount=type=cache,target=/root/.cache/go-build cd cannon && make cannon \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$CANNON_VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$CANNON_VERSION"
FROM --platform=$BUILDPLATFORM builder as op-program-builder FROM --platform=$TARGETPLATFORM builder as op-program-builder
ARG OP_PROGRAM_VERSION=v0.0.0 ARG OP_PROGRAM_VERSION=v0.0.0
# note: we only build the host, that's all the user needs. No Go MIPS cross-build in docker # note: we only build the host, that's all the user needs. No Go MIPS cross-build in docker
RUN --mount=type=cache,target=/root/.cache/go-build cd op-program && make op-program-host \ RUN --mount=type=cache,target=/root/.cache/go-build cd op-program && make op-program-host \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROGRAM_VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROGRAM_VERSION"
FROM --platform=$BUILDPLATFORM builder as op-heartbeat-builder FROM --platform=$TARGETPLATFORM builder as op-heartbeat-builder
ARG OP_HEARTBEAT_VERSION=v0.0.0 ARG OP_HEARTBEAT_VERSION=v0.0.0
RUN --mount=type=cache,target=/root/.cache/go-build cd op-heartbeat && make op-heartbeat \ RUN --mount=type=cache,target=/root/.cache/go-build cd op-heartbeat && make op-heartbeat \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_HEARTBEAT_VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_HEARTBEAT_VERSION"
FROM --platform=$BUILDPLATFORM builder as op-wheel-builder FROM --platform=$TARGETPLATFORM builder as op-wheel-builder
ARG OP_WHEEL_VERSION=v0.0.0 ARG OP_WHEEL_VERSION=v0.0.0
RUN --mount=type=cache,target=/root/.cache/go-build cd op-wheel && make op-wheel \ RUN --mount=type=cache,target=/root/.cache/go-build cd op-wheel && make op-wheel \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_WHEEL_VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_WHEEL_VERSION"
FROM --platform=$BUILDPLATFORM builder as op-node-builder FROM --platform=$TARGETPLATFORM builder as op-node-builder
ARG OP_NODE_VERSION=v0.0.0 ARG OP_NODE_VERSION=v0.0.0
RUN --mount=type=cache,target=/root/.cache/go-build cd op-node && make op-node \ RUN --mount=type=cache,target=/root/.cache/go-build cd op-node && make op-node \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_NODE_VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_NODE_VERSION"
FROM --platform=$BUILDPLATFORM builder as op-challenger-builder FROM --platform=$TARGETPLATFORM builder as op-challenger-builder
ARG OP_CHALLENGER_VERSION=v0.0.0 ARG OP_CHALLENGER_VERSION=v0.0.0
RUN --mount=type=cache,target=/root/.cache/go-build cd op-challenger && make op-challenger \ RUN --mount=type=cache,target=/root/.cache/go-build cd op-challenger && make op-challenger \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_CHALLENGER_VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_CHALLENGER_VERSION"
FROM --platform=$BUILDPLATFORM builder as op-batcher-builder FROM --platform=$TARGETPLATFORM builder as op-batcher-builder
ARG OP_BATCHER_VERSION=v0.0.0 ARG OP_BATCHER_VERSION=v0.0.0
RUN --mount=type=cache,target=/root/.cache/go-build cd op-batcher && make op-batcher \ RUN --mount=type=cache,target=/root/.cache/go-build cd op-batcher && make op-batcher \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_BATCHER_VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_BATCHER_VERSION"
FROM --platform=$BUILDPLATFORM builder as op-proposer-builder FROM --platform=$TARGETPLATFORM builder as op-proposer-builder
ARG OP_PROPOSER_VERSION=v0.0.0 ARG OP_PROPOSER_VERSION=v0.0.0
RUN --mount=type=cache,target=/root/.cache/go-build cd op-proposer && make op-proposer \ RUN --mount=type=cache,target=/root/.cache/go-build cd op-proposer && make op-proposer \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROPOSER_VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROPOSER_VERSION"
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
}, },
"dependencies": { "dependencies": {
"@eth-optimism/core-utils": "workspace:*", "@eth-optimism/core-utils": "workspace:*",
"@sentry/node": "^7.80.1", "@sentry/node": "^7.82.0",
"bcfg": "^0.2.1", "bcfg": "^0.2.1",
"body-parser": "^1.20.2", "body-parser": "^1.20.2",
"commander": "^11.1.0", "commander": "^11.1.0",
......
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352379) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352322)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950542) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950484)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 540708) GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 540698)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4052922) GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4052891)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 442085) GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 442003)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3487812) GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3487752)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 43010) GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 42970)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 86653) GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 86629)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68485) GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68462)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68988) GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68899)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 143255) GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 153527)
\ No newline at end of file \ No newline at end of file
...@@ -62,7 +62,8 @@ ...@@ -62,7 +62,8 @@
| l2Sender | address | 50 | 0 | 20 | src/L1/OptimismPortal.sol:OptimismPortal | | l2Sender | address | 50 | 0 | 20 | src/L1/OptimismPortal.sol:OptimismPortal |
| finalizedWithdrawals | mapping(bytes32 => bool) | 51 | 0 | 32 | src/L1/OptimismPortal.sol:OptimismPortal | | finalizedWithdrawals | mapping(bytes32 => bool) | 51 | 0 | 32 | src/L1/OptimismPortal.sol:OptimismPortal |
| provenWithdrawals | mapping(bytes32 => struct OptimismPortal.ProvenWithdrawal) | 52 | 0 | 32 | src/L1/OptimismPortal.sol:OptimismPortal | | provenWithdrawals | mapping(bytes32 => struct OptimismPortal.ProvenWithdrawal) | 52 | 0 | 32 | src/L1/OptimismPortal.sol:OptimismPortal |
| paused | bool | 53 | 0 | 1 | src/L1/OptimismPortal.sol:OptimismPortal | | spacer_53_0_1 | bool | 53 | 0 | 1 | src/L1/OptimismPortal.sol:OptimismPortal |
| superchainConfig | contract SuperchainConfig | 53 | 1 | 20 | src/L1/OptimismPortal.sol:OptimismPortal |
======================= =======================
➡ src/L1/SystemConfig.sol:SystemConfig ➡ src/L1/SystemConfig.sol:SystemConfig
......
...@@ -67,6 +67,9 @@ The spec for the deploy config is defined by the `deployConfigSpec` located insi ...@@ -67,6 +67,9 @@ The spec for the deploy config is defined by the `deployConfigSpec` located insi
### Execution ### Execution
Before deploying the contracts, you can verify the state diff produced by the deploy script using the `runWithStateDiff()` function signature which produces the outputs inside [`snapshots/state-diff/`](./snapshots/state-diff).
Run the deployment with state diffs by executing: `forge script -vvv scripts/Deploy.s.sol:Deploy --sig 'runWithStateDiff()' --rpc-url $ETH_RPC_URL --broadcast --private-key $PRIVATE_KEY`.
1. Set the env vars `ETH_RPC_URL`, `PRIVATE_KEY` and `ETHERSCAN_API_KEY` if contract verification is desired 1. Set the env vars `ETH_RPC_URL`, `PRIVATE_KEY` and `ETHERSCAN_API_KEY` if contract verification is desired
1. Deploy the contracts with `forge script -vvv scripts/Deploy.s.sol:Deploy --rpc-url $ETH_RPC_URL --broadcast --private-key $PRIVATE_KEY` 1. Deploy the contracts with `forge script -vvv scripts/Deploy.s.sol:Deploy --rpc-url $ETH_RPC_URL --broadcast --private-key $PRIVATE_KEY`
Pass the `--verify` flag to verify the deployments automatically with Etherscan. Pass the `--verify` flag to verify the deployments automatically with Etherscan.
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"sequencerFeeVaultWithdrawalNetwork": "remote", "sequencerFeeVaultWithdrawalNetwork": "remote",
"proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"portalGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "superchainConfigGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalizationPeriodSeconds": 2, "finalizationPeriodSeconds": 2,
"fundDevAccounts": true, "fundDevAccounts": true,
"l2GenesisBlockBaseFeePerGas": "0x1", "l2GenesisBlockBaseFeePerGas": "0x1",
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
"eip1559Elasticity": 6, "eip1559Elasticity": 6,
"l1GenesisBlockTimestamp": "0x64c811bf", "l1GenesisBlockTimestamp": "0x64c811bf",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"l2GenesisSpanBatchTimeOffset": "0x0", "l2GenesisDeltaTimeOffset": "0x0",
"l2GenesisCanyonTimeOffset": "0x40", "l2GenesisCanyonTimeOffset": "0x40",
"faultGameAbsolutePrestate": "0x03c7ae758795765c6664a5d39bf63841c71ff191e9189522bad8ebff5d4eca98", "faultGameAbsolutePrestate": "0x03c7ae758795765c6664a5d39bf63841c71ff191e9189522bad8ebff5d4eca98",
"faultGameMaxDepth": 30, "faultGameMaxDepth": 30,
......
{ {
"finalSystemOwner": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "finalSystemOwner": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"portalGuardian": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "superchainConfigGuardian": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"l1StartingBlockTag": "0x6ffc1bf3754c01f6bb9fe057c1578b87a8571ce2e9be5ca14bace6eccfd336c7", "l1StartingBlockTag": "0x6ffc1bf3754c01f6bb9fe057c1578b87a8571ce2e9be5ca14bace6eccfd336c7",
"l1ChainID": 5, "l1ChainID": 5,
"l2ChainID": 420, "l2ChainID": 420,
......
{ {
"finalSystemOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "finalSystemOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"portalGuardian": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "superchainConfigGuardian": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"proxyAdminOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "proxyAdminOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"l1StartingBlockTag": "earliest", "l1StartingBlockTag": "earliest",
"l1ChainID": 900, "l1ChainID": 900,
......
{ {
"finalSystemOwner": "0x858F0751ef8B4067f0d2668C076BDB50a8549fbF", "finalSystemOwner": "0x858F0751ef8B4067f0d2668C076BDB50a8549fbF",
"portalGuardian": "0x858F0751ef8B4067f0d2668C076BDB50a8549fbF", "superchainConfigGuardian": "0x858F0751ef8B4067f0d2668C076BDB50a8549fbF",
"l1StartingBlockTag": "0x19c7e6b18fe156e45f4cfef707294fd8f079fa9c30a7b7cd6ec1ce3682ec6a2e", "l1StartingBlockTag": "0x19c7e6b18fe156e45f4cfef707294fd8f079fa9c30a7b7cd6ec1ce3682ec6a2e",
"l1ChainID": 5, "l1ChainID": 5,
"l2ChainID": 998, "l2ChainID": 998,
......
{ {
"finalSystemOwner": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A", "finalSystemOwner": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A",
"portalGuardian": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A", "superchainConfigGuardian": "0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A",
"l1StartingBlockTag": "0x438335a20d98863a4c0c97999eb2481921ccd28553eac6f913af7c12aec04108", "l1StartingBlockTag": "0x438335a20d98863a4c0c97999eb2481921ccd28553eac6f913af7c12aec04108",
"l1ChainID": 1, "l1ChainID": 1,
"l2ChainID": 10, "l2ChainID": 10,
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"batchInboxAddress": "0x454A2A86132C937AD4eFc8721f1b85418f92cbCe", "batchInboxAddress": "0x454A2A86132C937AD4eFc8721f1b85418f92cbCe",
"batchSenderAddress": "0x7224e05E6cF6E07aFBE1eFa09a3fA23A637DD485", "batchSenderAddress": "0x7224e05E6cF6E07aFBE1eFa09a3fA23A637DD485",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"portalGuardian": "0x45eFFbD799Ab49122eeEAB75B78D9C56A187F9A7", "superchainConfigGuardian": "0x45eFFbD799Ab49122eeEAB75B78D9C56A187F9A7",
"l2OutputOracleSubmissionInterval": 180, "l2OutputOracleSubmissionInterval": 180,
"l2OutputOracleStartingTimestamp": -1, "l2OutputOracleStartingTimestamp": -1,
"l2OutputOracleProposer": "0xD457799C5ba870D609f21048c67a9b11aC611BF0", "l2OutputOracleProposer": "0xD457799C5ba870D609f21048c67a9b11aC611BF0",
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"batchInboxAddress": "0xC1B90E1e459aBBDcEc4DCF90dA45ba077d83BFc5", "batchInboxAddress": "0xC1B90E1e459aBBDcEc4DCF90dA45ba077d83BFc5",
"batchSenderAddress": "0x99526b0e49A95833E734EB556A6aBaFFAb0Ee167", "batchSenderAddress": "0x99526b0e49A95833E734EB556A6aBaFFAb0Ee167",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"portalGuardian": "0x39E13D1AB040F6EA58CE19998edCe01B3C365f84", "superchainConfigGuardian": "0x39E13D1AB040F6EA58CE19998edCe01B3C365f84",
"l2OutputOracleSubmissionInterval": 1800, "l2OutputOracleSubmissionInterval": 1800,
"l2OutputOracleStartingTimestamp": -1, "l2OutputOracleStartingTimestamp": -1,
"l2OutputOracleProposer": "0x69968Ce0E92d9c101BAd81de55EFbcb69603cFe3", "l2OutputOracleProposer": "0x69968Ce0E92d9c101BAd81de55EFbcb69603cFe3",
......
{ {
"finalSystemOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301", "finalSystemOwner": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"portalGuardian": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301", "superchainConfigGuardian": "0xfd1D2e729aE8eEe2E146c033bf4400fE75284301",
"l1StartingBlockTag": "0x48f520cf4ddaf34c8336e6e490632ea3cf1e5e93b0b2bc6e917557e31845371b", "l1StartingBlockTag": "0x48f520cf4ddaf34c8336e6e490632ea3cf1e5e93b0b2bc6e917557e31845371b",
"l1ChainID": 11155111, "l1ChainID": 11155111,
"l2ChainID": 11155420, "l2ChainID": 11155420,
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"batchInboxAddress": "0xcF628E24aC574866D3d0a7CFE4e9DA7278b7ef13", "batchInboxAddress": "0xcF628E24aC574866D3d0a7CFE4e9DA7278b7ef13",
"batchSenderAddress": "0x427c9a666d3b27873111cE3894712Bf64C6343A0", "batchSenderAddress": "0x427c9a666d3b27873111cE3894712Bf64C6343A0",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"portalGuardian": "0x45eFFbD799Ab49122eeEAB75B78D9C56A187F9A7", "superchainConfigGuardian": "0x45eFFbD799Ab49122eeEAB75B78D9C56A187F9A7",
"l2OutputOracleSubmissionInterval": 180, "l2OutputOracleSubmissionInterval": 180,
"l2OutputOracleStartingTimestamp": 0, "l2OutputOracleStartingTimestamp": 0,
"l2OutputOracleProposer": "0xa98B585654fC03E2fEa3FAB56E1C851E4f5c2B54", "l2OutputOracleProposer": "0xa98B585654fC03E2fEa3FAB56E1C851E4f5c2B54",
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"batchInboxAddress": "0x6F54Ca6F6EdE96662024Ffd61BFd18f3f4e34DFf", "batchInboxAddress": "0x6F54Ca6F6EdE96662024Ffd61BFd18f3f4e34DFf",
"batchSenderAddress": "0x625726c858dBF78c0125436C943Bf4b4bE9d9033", "batchSenderAddress": "0x625726c858dBF78c0125436C943Bf4b4bE9d9033",
"l2GenesisRegolithTimeOffset": "0x0", "l2GenesisRegolithTimeOffset": "0x0",
"portalGuardian": "0xC72aE5c7cc9a332699305E29F68Be66c73b60542", "superchainConfigGuardian": "0xC72aE5c7cc9a332699305E29F68Be66c73b60542",
"l2OutputOracleSubmissionInterval": 1800, "l2OutputOracleSubmissionInterval": 1800,
"l2OutputOracleStartingTimestamp": -1, "l2OutputOracleStartingTimestamp": -1,
"l2OutputOracleProposer": "0x48247032092e7b0ecf5dEF611ad89eaf3fC888Dd", "l2OutputOracleProposer": "0x48247032092e7b0ecf5dEF611ad89eaf3fC888Dd",
......
...@@ -28,6 +28,7 @@ build_info_path = 'artifacts/build-info' ...@@ -28,6 +28,7 @@ build_info_path = 'artifacts/build-info'
ffi = true ffi = true
fs_permissions = [ fs_permissions = [
{ access='read-write', path='./.resource-metering.csv' }, { access='read-write', path='./.resource-metering.csv' },
{ access='read-write', path='./snapshots/' },
{ access='read-write', path='./deployments/' }, { access='read-write', path='./deployments/' },
{ access='read', path='./deploy-config/' }, { access='read', path='./deploy-config/' },
{ access='read', path='./periphery-deploy-config/' }, { access='read', path='./periphery-deploy-config/' },
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
"coverage:lcov": "pnpm build:go-ffi && forge coverage --report lcov", "coverage:lcov": "pnpm build:go-ffi && forge coverage --report lcov",
"deploy": "./scripts/deploy.sh", "deploy": "./scripts/deploy.sh",
"gas-snapshot:no-build": "forge snapshot --match-contract GasBenchMark", "gas-snapshot:no-build": "forge snapshot --match-contract GasBenchMark",
"statediff": "./scripts/statediff.sh && git diff --exit-code",
"gas-snapshot": "pnpm build:go-ffi && pnpm gas-snapshot:no-build", "gas-snapshot": "pnpm build:go-ffi && pnpm gas-snapshot:no-build",
"storage-snapshot": "./scripts/storage-snapshot.sh", "storage-snapshot": "./scripts/storage-snapshot.sh",
"abi-snapshot": "npx tsx scripts/generate-snapshots.ts", "abi-snapshot": "npx tsx scripts/generate-snapshots.ts",
...@@ -47,7 +48,7 @@ ...@@ -47,7 +48,7 @@
"lint": "pnpm lint:fix && pnpm lint:check" "lint": "pnpm lint:fix && pnpm lint:check"
}, },
"devDependencies": { "devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.12.0", "@typescript-eslint/eslint-plugin": "^6.13.0",
"@typescript-eslint/parser": "^6.11.0", "@typescript-eslint/parser": "^6.11.0",
"tsx": "^4.5.0", "tsx": "^4.5.0",
"typescript": "^5.3.2" "typescript": "^5.3.2"
......
...@@ -9,6 +9,7 @@ import { Constants } from "src/libraries/Constants.sol"; ...@@ -9,6 +9,7 @@ import { Constants } from "src/libraries/Constants.sol";
import { L1StandardBridge } from "src/L1/L1StandardBridge.sol"; import { L1StandardBridge } from "src/L1/L1StandardBridge.sol";
import { L2OutputOracle } from "src/L1/L2OutputOracle.sol"; import { L2OutputOracle } from "src/L1/L2OutputOracle.sol";
import { ProtocolVersion, ProtocolVersions } from "src/L1/ProtocolVersions.sol"; import { ProtocolVersion, ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { OptimismPortal } from "src/L1/OptimismPortal.sol"; import { OptimismPortal } from "src/L1/OptimismPortal.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol"; import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol"; import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
...@@ -42,7 +43,7 @@ library ChainAssertions { ...@@ -42,7 +43,7 @@ library ChainAssertions {
checkL2OutputOracle(_prox, _cfg, _l2OutputOracleStartingTimestamp, _l2OutputOracleStartingBlockNumber); checkL2OutputOracle(_prox, _cfg, _l2OutputOracleStartingTimestamp, _l2OutputOracleStartingBlockNumber);
checkOptimismMintableERC20Factory(_prox); checkOptimismMintableERC20Factory(_prox);
checkL1ERC721Bridge(_prox); checkL1ERC721Bridge(_prox);
checkOptimismPortal({ _contracts: _prox, _cfg: _cfg, _isPaused: false }); checkOptimismPortal({ _contracts: _prox, _cfg: _cfg, _isProxy: true });
checkProtocolVersions({ _contracts: _prox, _cfg: _cfg, _isProxy: true }); checkProtocolVersions({ _contracts: _prox, _cfg: _cfg, _isProxy: true });
} }
...@@ -134,28 +135,25 @@ library ChainAssertions { ...@@ -134,28 +135,25 @@ library ChainAssertions {
} }
/// @notice Asserts the OptimismPortal is setup correctly /// @notice Asserts the OptimismPortal is setup correctly
function checkOptimismPortal( function checkOptimismPortal(Types.ContractSet memory _contracts, DeployConfig _cfg, bool _isProxy) internal view {
Types.ContractSet memory _contracts,
DeployConfig _cfg,
bool _isPaused
)
internal
view
{
OptimismPortal portal = OptimismPortal(payable(_contracts.OptimismPortal)); OptimismPortal portal = OptimismPortal(payable(_contracts.OptimismPortal));
address guardian = _cfg.portalGuardian(); address guardian = _cfg.superchainConfigGuardian();
if (guardian.code.length == 0) { if (guardian.code.length == 0) {
console.log("Portal guardian has no code: %s", guardian); console.log("Guardian has no code: %s", guardian);
} }
require(address(portal.L2_ORACLE()) == _contracts.L2OutputOracle); require(address(portal.L2_ORACLE()) == _contracts.L2OutputOracle);
require(address(portal.l2Oracle()) == _contracts.L2OutputOracle); require(address(portal.l2Oracle()) == _contracts.L2OutputOracle);
require(portal.GUARDIAN() == _cfg.portalGuardian());
require(portal.guardian() == _cfg.portalGuardian());
require(address(portal.SYSTEM_CONFIG()) == _contracts.SystemConfig); require(address(portal.SYSTEM_CONFIG()) == _contracts.SystemConfig);
require(address(portal.systemConfig()) == _contracts.SystemConfig); require(address(portal.systemConfig()) == _contracts.SystemConfig);
require(portal.paused() == _isPaused);
if (_isProxy) {
require(portal.GUARDIAN() == _cfg.superchainConfigGuardian());
require(portal.guardian() == _cfg.superchainConfigGuardian());
require(address(portal.superchainConfig()) == address(_contracts.SuperchainConfig));
require(portal.paused() == SuperchainConfig(_contracts.SuperchainConfig).paused());
}
} }
/// @notice Asserts that the ProtocolVersions is setup correctly /// @notice Asserts that the ProtocolVersions is setup correctly
...@@ -178,4 +176,18 @@ library ChainAssertions { ...@@ -178,4 +176,18 @@ library ChainAssertions {
require(ProtocolVersion.unwrap(versions.recommended()) == 0); require(ProtocolVersion.unwrap(versions.recommended()) == 0);
} }
} }
/// @notice Asserts that the SuperchainConfig is setup correctly
function checkSuperchainConfig(
Types.ContractSet memory _contracts,
DeployConfig _cfg,
bool _isPaused
)
internal
view
{
SuperchainConfig superchainConfig = SuperchainConfig(_contracts.SuperchainConfig);
require(superchainConfig.guardian() == _cfg.superchainConfigGuardian());
require(superchainConfig.paused() == _isPaused);
}
} }
...@@ -15,7 +15,7 @@ contract DeployConfig is Script { ...@@ -15,7 +15,7 @@ contract DeployConfig is Script {
string internal _json; string internal _json;
address public finalSystemOwner; address public finalSystemOwner;
address public portalGuardian; address public superchainConfigGuardian;
uint256 public l1ChainID; uint256 public l1ChainID;
uint256 public l2ChainID; uint256 public l2ChainID;
uint256 public l2BlockTime; uint256 public l2BlockTime;
...@@ -64,7 +64,7 @@ contract DeployConfig is Script { ...@@ -64,7 +64,7 @@ contract DeployConfig is Script {
} }
finalSystemOwner = stdJson.readAddress(_json, "$.finalSystemOwner"); finalSystemOwner = stdJson.readAddress(_json, "$.finalSystemOwner");
portalGuardian = stdJson.readAddress(_json, "$.portalGuardian"); superchainConfigGuardian = stdJson.readAddress(_json, "$.superchainConfigGuardian");
l1ChainID = stdJson.readUint(_json, "$.l1ChainID"); l1ChainID = stdJson.readUint(_json, "$.l1ChainID");
l2ChainID = stdJson.readUint(_json, "$.l2ChainID"); l2ChainID = stdJson.readUint(_json, "$.l2ChainID");
l2BlockTime = stdJson.readUint(_json, "$.l2BlockTime"); l2BlockTime = stdJson.readUint(_json, "$.l2BlockTime");
......
...@@ -370,7 +370,7 @@ abstract contract Deployer is Script { ...@@ -370,7 +370,7 @@ abstract contract Deployer is Script {
} }
/// @notice Returns the receipt of a deployment transaction. /// @notice Returns the receipt of a deployment transaction.
function _getDeployReceiptByContractAddress(address addr) internal returns (string memory) { function _getDeployReceiptByContractAddress(address _addr) internal returns (string memory receipt_) {
string[] memory cmd = new string[](3); string[] memory cmd = new string[](3);
cmd[0] = Executables.bash; cmd[0] = Executables.bash;
cmd[1] = "-c"; cmd[1] = "-c";
...@@ -378,64 +378,64 @@ abstract contract Deployer is Script { ...@@ -378,64 +378,64 @@ abstract contract Deployer is Script {
Executables.jq, Executables.jq,
" -r '.receipts[] | select(.contractAddress == ", " -r '.receipts[] | select(.contractAddress == ",
'"', '"',
vm.toString(addr), vm.toString(_addr),
'"', '"',
")' < ", ")' < ",
deployPath deployPath
); );
bytes memory res = vm.ffi(cmd); bytes memory res = vm.ffi(cmd);
string memory receipt = string(res); string memory receipt = string(res);
return receipt; receipt_ = receipt;
} }
/// @notice Returns the devdoc for a deployed contract. /// @notice Returns the devdoc for a deployed contract.
function getDevDoc(string memory _name) internal returns (string memory) { function getDevDoc(string memory _name) internal returns (string memory doc_) {
string[] memory cmd = new string[](3); string[] memory cmd = new string[](3);
cmd[0] = Executables.bash; cmd[0] = Executables.bash;
cmd[1] = "-c"; cmd[1] = "-c";
cmd[2] = string.concat(Executables.jq, " -r '.devdoc' < ", _getForgeArtifactPath(_name)); cmd[2] = string.concat(Executables.jq, " -r '.devdoc' < ", _getForgeArtifactPath(_name));
bytes memory res = vm.ffi(cmd); bytes memory res = vm.ffi(cmd);
return string(res); doc_ = string(res);
} }
/// @notice Returns the storage layout for a deployed contract. /// @notice Returns the storage layout for a deployed contract.
function getStorageLayout(string memory _name) internal returns (string memory) { function getStorageLayout(string memory _name) internal returns (string memory layout_) {
string[] memory cmd = new string[](3); string[] memory cmd = new string[](3);
cmd[0] = Executables.bash; cmd[0] = Executables.bash;
cmd[1] = "-c"; cmd[1] = "-c";
cmd[2] = string.concat(Executables.jq, " -r '.storageLayout' < ", _getForgeArtifactPath(_name)); cmd[2] = string.concat(Executables.jq, " -r '.storageLayout' < ", _getForgeArtifactPath(_name));
bytes memory res = vm.ffi(cmd); bytes memory res = vm.ffi(cmd);
return string(res); layout_ = string(res);
} }
/// @notice Returns the abi for a deployed contract. /// @notice Returns the abi for a deployed contract.
function getAbi(string memory _name) internal returns (string memory) { function getAbi(string memory _name) public returns (string memory abi_) {
string[] memory cmd = new string[](3); string[] memory cmd = new string[](3);
cmd[0] = Executables.bash; cmd[0] = Executables.bash;
cmd[1] = "-c"; cmd[1] = "-c";
cmd[2] = string.concat(Executables.jq, " -r '.abi' < ", _getForgeArtifactPath(_name)); cmd[2] = string.concat(Executables.jq, " -r '.abi' < ", _getForgeArtifactPath(_name));
bytes memory res = vm.ffi(cmd); bytes memory res = vm.ffi(cmd);
return string(res); abi_ = string(res);
} }
/// @notice Returns the userdoc for a deployed contract. /// @notice Returns the userdoc for a deployed contract.
function getUserDoc(string memory _name) internal returns (string memory) { function getUserDoc(string memory _name) internal returns (string memory doc_) {
string[] memory cmd = new string[](3); string[] memory cmd = new string[](3);
cmd[0] = Executables.bash; cmd[0] = Executables.bash;
cmd[1] = "-c"; cmd[1] = "-c";
cmd[2] = string.concat(Executables.jq, " -r '.userdoc' < ", _getForgeArtifactPath(_name)); cmd[2] = string.concat(Executables.jq, " -r '.userdoc' < ", _getForgeArtifactPath(_name));
bytes memory res = vm.ffi(cmd); bytes memory res = vm.ffi(cmd);
return string(res); doc_ = string(res);
} }
/// @notice /// @notice
function getMetadata(string memory _name) internal returns (string memory) { function getMetadata(string memory _name) internal returns (string memory metadata_) {
string[] memory cmd = new string[](3); string[] memory cmd = new string[](3);
cmd[0] = Executables.bash; cmd[0] = Executables.bash;
cmd[1] = "-c"; cmd[1] = "-c";
cmd[2] = string.concat(Executables.jq, " '.metadata | tostring' < ", _getForgeArtifactPath(_name)); cmd[2] = string.concat(Executables.jq, " '.metadata | tostring' < ", _getForgeArtifactPath(_name));
bytes memory res = vm.ffi(cmd); bytes memory res = vm.ffi(cmd);
return string(res); metadata_ = string(res);
} }
/// @dev Pulls the `_initialized` storage slot information from the Forge artifacts for a given contract. /// @dev Pulls the `_initialized` storage slot information from the Forge artifacts for a given contract.
...@@ -459,7 +459,7 @@ abstract contract Deployer is Script { ...@@ -459,7 +459,7 @@ abstract contract Deployer is Script {
} }
/// @dev Returns the value of the internal `_initialized` storage slot for a given contract. /// @dev Returns the value of the internal `_initialized` storage slot for a given contract.
function loadInitializedSlot(string memory _contractName, bool _isProxy) internal returns (uint8 initialized_) { function loadInitializedSlot(string memory _contractName, bool _isProxy) public returns (uint8 initialized_) {
StorageSlot memory slot = getInitializedSlot(_contractName); StorageSlot memory slot = getInitializedSlot(_contractName);
if (_isProxy) { if (_isProxy) {
_contractName = string.concat(_contractName, "Proxy"); _contractName = string.concat(_contractName, "Proxy");
......
...@@ -12,5 +12,6 @@ library Types { ...@@ -12,5 +12,6 @@ library Types {
address SystemConfig; address SystemConfig;
address L1ERC721Bridge; address L1ERC721Bridge;
address ProtocolVersions; address ProtocolVersions;
address SuperchainConfig;
} }
} }
...@@ -7,7 +7,7 @@ if [ -n "${DEPLOY_VERIFY:-}" ]; then ...@@ -7,7 +7,7 @@ if [ -n "${DEPLOY_VERIFY:-}" ]; then
fi fi
echo "> Deploying contracts" echo "> Deploying contracts"
forge script -vvv scripts/Deploy.s.sol:Deploy --rpc-url "$DEPLOY_ETH_RPC_URL" --broadcast --private-key "$DEPLOY_PRIVATE_KEY" $verify_flag forge script -vvv scripts/Deploy.s.sol:Deploy --rpc-url "$DEPLOY_ETH_RPC_URL" --sig 'runWithStateDiff()' --broadcast --private-key "$DEPLOY_PRIVATE_KEY" $verify_flag
if [ -n "${DEPLOY_GENERATE_HARDHAT_ARTIFACTS:-}" ]; then if [ -n "${DEPLOY_GENERATE_HARDHAT_ARTIFACTS:-}" ]; then
echo "> Generating hardhat artifacts" echo "> Generating hardhat artifacts"
......
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail
# Create a L2 genesis.json suitable for the solidity tests to # Create a L2 genesis.json suitable for the solidity tests to
# ingest using `vm.loadAllocs(string)`. # ingest using `vm.loadAllocs(string)`.
# This script depends on the relative path to the op-node from # This script depends on the relative path to the op-node from
...@@ -30,3 +32,16 @@ if [ ! -f "$OUTFILE_L2" ]; then ...@@ -30,3 +32,16 @@ if [ ! -f "$OUTFILE_L2" ]; then
--outfile.l2 "$OUTFILE_L2" \ --outfile.l2 "$OUTFILE_L2" \
--outfile.rollup "$OUTFILE_ROLLUP" > /dev/null 2>&1 --outfile.rollup "$OUTFILE_ROLLUP" > /dev/null 2>&1
fi fi
# Wait for the L2 outfile to be over 8M for up to 2 seconds
# This is a hack to ensure that the outfile is fully written
# before the solidity tests try to read it
for i in {1..8}; do
if [ $(du -m "$OUTFILE_L2" | cut -f1) -ge 8 ]; then
exit 0
fi
sleep 0.25
done
echo "L2 genesis file not generated in time. Exiting."
exit 1
\ No newline at end of file
...@@ -28,7 +28,7 @@ blockhash=$(echo "$block" | awk '/hash/ { print $2 }') ...@@ -28,7 +28,7 @@ blockhash=$(echo "$block" | awk '/hash/ { print $2 }')
config=$(cat << EOL config=$(cat << EOL
{ {
"finalSystemOwner": "$GS_ADMIN_ADDRESS", "finalSystemOwner": "$GS_ADMIN_ADDRESS",
"portalGuardian": "$GS_ADMIN_ADDRESS", "superchainConfigGuardian": "$GS_ADMIN_ADDRESS",
"l1StartingBlockTag": "$blockhash", "l1StartingBlockTag": "$blockhash",
......
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import { stdJson } from "forge-std/StdJson.sol";
import { VmSafe } from "forge-std/Vm.sol";
/// @title LibStateDiff
/// @author refcell
/// @notice Library to write StateDiff output to json.
library LibStateDiff {
/// @notice Accepts an array of AccountAccess structs from the Vm and encodes them as a json string.
/// @param _accountAccesses Array of AccountAccess structs.
/// @return serialized_ string
function encodeAccountAccesses(VmSafe.AccountAccess[] memory _accountAccesses)
internal
returns (string memory serialized_)
{
string[] memory accountAccesses = new string[](_accountAccesses.length);
for (uint256 i = 0; i < _accountAccesses.length; i++) {
accountAccesses[i] = serializeAccountAccess(_accountAccesses[i]);
}
serialized_ = stdJson.serialize("accountAccessElem", "accountAccesses", accountAccesses);
}
/// @notice Turns an AccountAccess into a json serialized string
/// @param _accountAccess The AccountAccess to serialize
/// @return serialized_ The json serialized string
function serializeAccountAccess(VmSafe.AccountAccess memory _accountAccess)
internal
returns (string memory serialized_)
{
string memory json = "";
json = stdJson.serialize("accountAccess", "chainInfo", serializeChainInfo(_accountAccess.chainInfo));
json = stdJson.serialize("accountAccess", "kind", serializeAccountAccessKind(_accountAccess.kind));
json = stdJson.serialize("accountAccess", "account", _accountAccess.account);
json = stdJson.serialize("accountAccess", "accessor", _accountAccess.accessor);
json = stdJson.serialize("accountAccess", "initialized", _accountAccess.initialized);
json = stdJson.serialize("accountAccess", "oldBalance", _accountAccess.oldBalance);
json = stdJson.serialize("accountAccess", "newBalance", _accountAccess.newBalance);
json = stdJson.serialize("accountAccess", "deployedCode", _accountAccess.deployedCode);
json = stdJson.serialize("accountAccess", "value", _accountAccess.value);
json = stdJson.serialize("accountAccess", "data", _accountAccess.data);
json = stdJson.serialize("accountAccess", "reverted", _accountAccess.reverted);
json = stdJson.serialize(
"accountAccess", "storageAccesses", serializeStorageAccesses(_accountAccess.storageAccesses)
);
serialized_ = json;
}
/// @notice Accepts a VmSafe.ChainInfo struct and encodes it as a json string.
/// @param _chainInfo The ChainInfo struct to serialize
/// @return serialized_ string
function serializeChainInfo(VmSafe.ChainInfo memory _chainInfo) internal returns (string memory serialized_) {
string memory json = "";
json = stdJson.serialize("chainInfo", "forkId", _chainInfo.forkId);
json = stdJson.serialize("chainInfo", "chainId", _chainInfo.chainId);
serialized_ = json;
}
/// @notice Turns an AccountAccessKind into a string.
/// @param _kind The AccountAccessKind to serialize
/// @return serialized_ The string representation of the AccountAccessKind
function serializeAccountAccessKind(VmSafe.AccountAccessKind _kind)
internal
pure
returns (string memory serialized_)
{
if (_kind == VmSafe.AccountAccessKind.Call) {
serialized_ = "Call";
} else if (_kind == VmSafe.AccountAccessKind.DelegateCall) {
serialized_ = "DelegateCall";
} else if (_kind == VmSafe.AccountAccessKind.CallCode) {
serialized_ = "CallCode";
} else if (_kind == VmSafe.AccountAccessKind.StaticCall) {
serialized_ = "StaticCall";
} else if (_kind == VmSafe.AccountAccessKind.Create) {
serialized_ = "Create";
} else if (_kind == VmSafe.AccountAccessKind.SelfDestruct) {
serialized_ = "SelfDestruct";
} else {
serialized_ = "Resume";
}
}
/// @notice Accepts an array of StorageAccess structs from the Vm and encodes each as a json string.
/// @param _storageAccesses Array of StorageAccess structs.
/// @return serialized_ The list of json serialized StorageAccess structs.
function serializeStorageAccesses(VmSafe.StorageAccess[] memory _storageAccesses)
internal
returns (string[] memory serialized_)
{
serialized_ = new string[](_storageAccesses.length);
for (uint256 i = 0; i < _storageAccesses.length; i++) {
serialized_[i] = serializeStorageAccess(_storageAccesses[i]);
}
}
/// @notice Turns a StorageAccess into a json serialized string
/// @param _storageAccess The StorageAccess to serialize
/// @return serialized_ The json serialized string
function serializeStorageAccess(VmSafe.StorageAccess memory _storageAccess)
internal
returns (string memory serialized_)
{
string memory json = "";
json = stdJson.serialize("storageAccess", "account", _storageAccess.account);
json = stdJson.serialize("storageAccess", "slot", _storageAccess.slot);
json = stdJson.serialize("storageAccess", "isWrite", _storageAccess.isWrite);
json = stdJson.serialize("storageAccess", "previousValue", _storageAccess.previousValue);
json = stdJson.serialize("storageAccess", "newValue", _storageAccess.newValue);
json = stdJson.serialize("storageAccess", "reverted", _storageAccess.reverted);
serialized_ = json;
}
}
#!/usr/bin/env bash
set -euo pipefail
echo "> Deploying contracts to generate state diff (non-broadcast)"
forge script -vvv scripts/Deploy.s.sol:Deploy --sig 'runWithStateDiff()'
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
"src/L1/L1ERC721Bridge.sol": "0x0e57251c77c052cec3a537b1dd4bb30eaff083a9d2b7bfb4cff342641ffd690d", "src/L1/L1ERC721Bridge.sol": "0x0e57251c77c052cec3a537b1dd4bb30eaff083a9d2b7bfb4cff342641ffd690d",
"src/L1/L1StandardBridge.sol": "0xc63b9a99a8e61321930a848c67d950a26356343e12e4376a2b12e03e44e8d8da", "src/L1/L1StandardBridge.sol": "0xc63b9a99a8e61321930a848c67d950a26356343e12e4376a2b12e03e44e8d8da",
"src/L1/L2OutputOracle.sol": "0xbc8acf3cdf2ea6107e2f9fad37e68a8f039f289d88b2ce002920c9ae00310450", "src/L1/L2OutputOracle.sol": "0xbc8acf3cdf2ea6107e2f9fad37e68a8f039f289d88b2ce002920c9ae00310450",
"src/L1/OptimismPortal.sol": "0x1f2ee207a5802d7c33a70aacd81e19c3880e593fa71c82adf02414d71066b934", "src/L1/OptimismPortal.sol": "0x0b86047802c87795d2bf8f2c68a8accff18966564a836197dcdf81573405f7db",
"src/L1/ProtocolVersions.sol": "0x6401853c57ca29e8e9bb38173b5ac9f0856395a325324a08eeb965cc831f0419", "src/L1/ProtocolVersions.sol": "0x6401853c57ca29e8e9bb38173b5ac9f0856395a325324a08eeb965cc831f0419",
"src/L1/SuperchainConfig.sol": "0x316e49c6d1d34d3172916015a049039d04364aabe0f0ddfa29472354a1fe6ea9",
"src/L1/SystemConfig.sol": "0xc24454da676297e0cd718ebf017933c5b1084e389e78ebe2a69d31053ea2f051", "src/L1/SystemConfig.sol": "0xc24454da676297e0cd718ebf017933c5b1084e389e78ebe2a69d31053ea2f051",
"src/L2/BaseFeeVault.sol": "0xe36f9be65c910694e60a14f266f9b6569f01b4ddd74fa0557305eb83e7e9d112", "src/L2/BaseFeeVault.sol": "0xe36f9be65c910694e60a14f266f9b6569f01b4ddd74fa0557305eb83e7e9d112",
"src/L2/GasPriceOracle.sol": "0x88efffbd40f8d012d700a5d7fde0d92266f65e9d7006cd8f034bacaa036d0eb2", "src/L2/GasPriceOracle.sol": "0x88efffbd40f8d012d700a5d7fde0d92266f65e9d7006cd8f034bacaa036d0eb2",
......
...@@ -235,9 +235,9 @@ ...@@ -235,9 +235,9 @@
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "uint256", "internalType": "bytes32",
"name": "_l2BlockNumber", "name": "_localContext",
"type": "uint256" "type": "bytes32"
}, },
{ {
"internalType": "uint256", "internalType": "uint256",
......
...@@ -49,9 +49,9 @@ ...@@ -49,9 +49,9 @@
"type": "bytes" "type": "bytes"
}, },
{ {
"internalType": "uint256", "internalType": "bytes32",
"name": "_localContext", "name": "_localContext",
"type": "uint256" "type": "bytes32"
} }
], ],
"name": "step", "name": "step",
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "uint256", "internalType": "bytes32",
"name": "_localContext", "name": "_localContext",
"type": "uint256" "type": "bytes32"
}, },
{ {
"internalType": "bytes32", "internalType": "bytes32",
......
This diff is collapsed.
This diff is collapsed.
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
"label": "mapping(uint256 => struct BlockOracle.BlockInfo)", "label": "mapping(uint256 => struct BlockOracle.BlockInfo)",
"offset": 0, "offset": 0,
"slot": "0", "slot": "0",
"type": "t_mapping(t_uint256,t_struct(BlockInfo)81992_storage)" "type": "t_mapping(t_uint256,t_struct(BlockInfo)82480_storage)"
} }
] ]
\ No newline at end of file
...@@ -39,20 +39,20 @@ ...@@ -39,20 +39,20 @@
"label": "mapping(GameType => contract IDisputeGame)", "label": "mapping(GameType => contract IDisputeGame)",
"offset": 0, "offset": 0,
"slot": "101", "slot": "101",
"type": "t_mapping(t_userDefinedValueType(GameType)86039,t_contract(IDisputeGame)83713)" "type": "t_mapping(t_userDefinedValueType(GameType)86527,t_contract(IDisputeGame)84201)"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "mapping(Hash => GameId)", "label": "mapping(Hash => GameId)",
"offset": 0, "offset": 0,
"slot": "102", "slot": "102",
"type": "t_mapping(t_userDefinedValueType(Hash)86021,t_userDefinedValueType(GameId)86033)" "type": "t_mapping(t_userDefinedValueType(Hash)86509,t_userDefinedValueType(GameId)86521)"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "GameId[]", "label": "GameId[]",
"offset": 0, "offset": 0,
"slot": "103", "slot": "103",
"type": "t_array(t_userDefinedValueType(GameId)86033)dyn_storage" "type": "t_array(t_userDefinedValueType(GameId)86521)dyn_storage"
} }
] ]
\ No newline at end of file
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
"label": "mapping(string => struct Drippie.DripState)", "label": "mapping(string => struct Drippie.DripState)",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
"type": "t_mapping(t_string_memory_ptr,t_struct(DripState)89080_storage)" "type": "t_mapping(t_string_memory_ptr,t_struct(DripState)89568_storage)"
} }
] ]
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"label": "mapping(bytes32 => struct Attestation)", "label": "mapping(bytes32 => struct Attestation)",
"offset": 0, "offset": 0,
"slot": "50", "slot": "50",
"type": "t_mapping(t_bytes32,t_struct(Attestation)55167_storage)" "type": "t_mapping(t_bytes32,t_struct(Attestation)55340_storage)"
}, },
{ {
"bytes": "32", "bytes": "32",
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
"label": "mapping(contract IFaucetAuthModule => struct Faucet.ModuleConfig)", "label": "mapping(contract IFaucetAuthModule => struct Faucet.ModuleConfig)",
"offset": 0, "offset": 0,
"slot": "0", "slot": "0",
"type": "t_mapping(t_contract(IFaucetAuthModule)90001,t_struct(ModuleConfig)89678_storage)" "type": "t_mapping(t_contract(IFaucetAuthModule)90489,t_struct(ModuleConfig)90166_storage)"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "mapping(contract IFaucetAuthModule => mapping(bytes32 => uint256))", "label": "mapping(contract IFaucetAuthModule => mapping(bytes32 => uint256))",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
"type": "t_mapping(t_contract(IFaucetAuthModule)90001,t_mapping(t_bytes32,t_uint256))" "type": "t_mapping(t_contract(IFaucetAuthModule)90489,t_mapping(t_bytes32,t_uint256))"
}, },
{ {
"bytes": "32", "bytes": "32",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment