Commit d1bad88d authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

Merge pull request #3959 from ethereum-optimism/develop

Develop -> Master PR
parents 6528ae75 2710a9f1
---
'@eth-optimism/contracts-bedrock': patch
---
Has ProxyAdmin use Ownable instead of Owned
---
'@eth-optimism/contracts-bedrock': patch
---
Tweaks variable ordering in OptimismPortal
---
'@eth-optimism/hardhat-node': patch
---
Trigger a release of the hardhat-node
---
'@eth-optimism/drippie-mon': patch
'@eth-optimism/fault-detector': patch
'@eth-optimism/message-relayer': patch
'@eth-optimism/replica-healthcheck': patch
---
Fixes how versions are imported for BaseServiceV2 services
---
'@eth-optimism/contracts-bedrock': patch
---
Removes the unused DeployConfig contract
---
'@eth-optimism/endpoint-monitor': patch
'@eth-optimism/indexer': patch
---
Update go-ethereum to v1.10.26
---
'@eth-optimism/contracts-bedrock': patch
---
Add comments to SystemConfig.sol
...@@ -88,6 +88,9 @@ jobs: ...@@ -88,6 +88,9 @@ jobs:
environment: environment:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
parameters: parameters:
docker_name:
description: Docker image name
type: string
docker_tags: docker_tags:
description: Docker image tags as csv description: Docker image tags as csv
type: string type: string
...@@ -101,10 +104,14 @@ jobs: ...@@ -101,10 +104,14 @@ jobs:
description: Docker build target description: Docker build target
type: string type: string
default: "" default: ""
registry:
description: Docker registry
type: string
default: "us-central1-docker.pkg.dev"
repo: repo:
description: Docker repo description: Docker repo
type: string type: string
default: "" default: "bedrock-goerli-development/images"
machine: machine:
image: ubuntu-2204:2022.07.1 image: ubuntu-2204:2022.07.1
resource_class: xlarge resource_class: xlarge
...@@ -125,8 +132,10 @@ jobs: ...@@ -125,8 +132,10 @@ jobs:
name: Build with context name: Build with context
command: | command: |
echo "$DOCKER_HUB_READ_ONLY_TOKEN" | docker login -u "$DOCKER_HUB_READ_ONLY_USER" --password-stdin echo "$DOCKER_HUB_READ_ONLY_TOKEN" | docker login -u "$DOCKER_HUB_READ_ONLY_USER" --password-stdin
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|")
docker build \ docker build \
$(echo -ne "<< parameters.docker_tags >>" | sed "s/,/\n/g" | sed -e 's/^/-t /' | tr '\n' ' ') \ $(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
-f <<parameters.docker_file>> \ -f <<parameters.docker_file>> \
--target <<parameters.target>> \ --target <<parameters.target>> \
<<parameters.docker_context>> <<parameters.docker_context>>
...@@ -137,15 +146,42 @@ jobs: ...@@ -137,15 +146,42 @@ jobs:
name: Build name: Build
command: | command: |
echo "$DOCKER_HUB_READ_ONLY_TOKEN" | docker login -u "$DOCKER_HUB_READ_ONLY_USER" --password-stdin echo "$DOCKER_HUB_READ_ONLY_TOKEN" | docker login -u "$DOCKER_HUB_READ_ONLY_USER" --password-stdin
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|")
docker build \ docker build \
$(echo -ne "<< parameters.docker_tags >>" | sed "s/,/\n/g" | sed -e 's/^/-t /' | tr '\n' ' ') \ $(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
-f <<parameters.docker_file>> \ -f <<parameters.docker_file>> \
<<parameters.docker_context>> <<parameters.docker_context>>
- run: - run:
name: Publish name: Publish
command: | command: |
gcloud auth configure-docker us-central1-docker.pkg.dev gcloud auth configure-docker <<parameters.registry>>
docker push <<parameters.docker_tags>> IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|${IMAGE_BASE}:|")
echo -ne $DOCKER_TAGS | tr ' ' '\n' | xargs -L1 docker push
docker-tag-op-stack-release:
parameters:
registry:
description: Docker registry
type: string
default: "us-central1-docker.pkg.dev"
repo:
description: Docker repo
type: string
default: "bedrock-goerli-development/images"
docker:
- image: cimg/python:3.7
resource_class: small
steps:
- gcp-cli/install
- gcp-oidc-authenticate
- checkout
- run:
name: Tag
command: |
gcloud auth configure-docker <<parameters.registry>>
./ops/scripts/ci-docker-tag-op-stack-release.sh <<parameters.registry>>/<<parameters.repo>> $CIRCLE_TAG $CIRCLE_SHA1
contracts-bedrock-tests: contracts-bedrock-tests:
docker: docker:
...@@ -262,101 +298,6 @@ jobs: ...@@ -262,101 +298,6 @@ jobs:
name: Upload coverage name: Upload coverage
command: codecov --verbose --clean --flags <<parameters.coverage_flag>> command: codecov --verbose --clean --flags <<parameters.coverage_flag>>
bedrock-go-tests:
docker:
- image: ethereumoptimism/ci-builder:latest
resource_class: xlarge
steps:
- checkout
- run:
name: Check if we should run
command: |
shopt -s inherit_errexit
CHANGED=$(check-changed "op-(batcher|bindings|e2e|node|proposer|chain-ops)" || echo "TRUE")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- run:
name: lint op-bindings
command: |
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell ./...
working_directory: op-bindings
- run:
name: lint op-node
command: |
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell ./...
working_directory: op-node
- run:
name: lint op-proposer
command: |
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell ./...
working_directory: op-proposer
- run:
name: lint op-batcher
command: |
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell ./...
working_directory: op-batcher
- run:
name: lint op-e2e
command: |
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell ./...
working_directory: op-e2e
- run:
name: lint op-service
command: |
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell ./...
working_directory: op-service
- run:
name: lint op-chain-ops
command: |
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell ./...
working_directory: op-chain-ops
- run:
name: prep results dir
command: mkdir -p /test-results
- run:
name: test op-node
command: |
gotestsum --junitfile /test-results/op-node.xml -- -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out -covermode=atomic ./...
working_directory: op-node
- run:
name: test op-proposer
command: |
gotestsum --junitfile /test-results/op-proposer.xml -- -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out -covermode=atomic ./...
working_directory: op-proposer
- run:
name: test op-batcher
command: |
gotestsum --junitfile /test-results/op-batcher.xml -- -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out -covermode=atomic ./...
working_directory: op-batcher
- run:
name: test op-e2e (WS)
command: |
gotestsum --format standard-verbose --junitfile /test-results/op-e2e.xml -- -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out -covermode=atomic ./...
working_directory: op-e2e
- run:
name: test op-e2e (HTTP)
command: |
OP_E2E_USE_HTTP=true gotestsum --junitfile /test-results/op-e2e.xml -- -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out -covermode=atomic ./...
working_directory: op-e2e
- run:
name: test op-service
command: |
gotestsum --junitfile /test-results/op-service.xml -- -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out -covermode=atomic ./...
working_directory: op-service
- run:
name: test op-chain-ops
command: |
gotestsum --junitfile /test-results/op-chain-ops.xml -- -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out -covermode=atomic ./...
working_directory: op-chain-ops
- run:
name: upload coverage
command: codecov --verbose --clean --flags bedrock-go-tests
- store_test_results:
path: /test-results
- run:
command: echo "Done."
bedrock-markdown: bedrock-markdown:
machine: machine:
image: ubuntu-2204:2022.07.1 image: ubuntu-2204:2022.07.1
...@@ -435,6 +376,73 @@ jobs: ...@@ -435,6 +376,73 @@ jobs:
command: npx depcheck command: npx depcheck
working_directory: integration-tests working_directory: integration-tests
go-lint:
parameters:
module:
description: Go Module Name
type: string
docker:
- image: cimg/go:1.19
steps:
- checkout
- run:
name: run lint
command: |
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint -e "errors.As" -e "errors.Is" ./...
working_directory: <<parameters.module>>
go-test:
parameters:
module:
description: Go Module Name
type: string
docker:
- image: ethereumoptimism/ci-builder:latest # only used to enable codecov.
resource_class: xlarge
steps:
- checkout
- run:
name: prep results dir
command: mkdir -p /tmp/test-results
- run:
name: run tests
command: |
gotestsum --format=standard-verbose --junitfile=/tmp/test-results/<<parameters.module>>.xml \
-- -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out ./...
working_directory: <<parameters.module>>
- run:
name: upload coverage
command: codecov --verbose --clean --flags bedrock-go-tests
- store_test_results:
path: /tmp/test-results
go-e2e-test:
parameters:
module:
description: Go Module Name
type: string
use_http:
description: If the op-e2e package should use HTTP clients
type: string
docker:
- image: cimg/go:1.19
parallelism: 6
resource_class: xlarge
steps:
- checkout
- run:
name: prep results dir
command: mkdir -p /tmp/test-results
- run:
name: run tests
command: |
OP_TESTLOG_DISABLE_COLOR=true OP_E2E_DISABLE_PARALLEL=true OP_E2E_USE_HTTP=<<parameters.use_http>> gotestsum \
--format=standard-verbose --junitfile=/tmp/test-results/<<parameters.module>>_http_<<parameters.use_http>>.xml \
$(go list ./... | circleci tests split --split-by=timings)
working_directory: <<parameters.module>>
- store_test_results:
path: /tmp/test-results
go-lint-test-build: go-lint-test-build:
parameters: parameters:
binary_name: binary_name:
...@@ -705,6 +713,13 @@ jobs: ...@@ -705,6 +713,13 @@ jobs:
- run: - run:
command: "! grep 'pass.*=false' /tmp/hive.log" command: "! grep 'pass.*=false' /tmp/hive.log"
bedrock-go-tests:
docker:
- image: cimg/go:1.19
resource_class: medium
steps:
- run: echo Done
workflows: workflows:
main: main:
jobs: jobs:
...@@ -800,9 +815,6 @@ workflows: ...@@ -800,9 +815,6 @@ workflows:
- depcheck: - depcheck:
requires: requires:
- yarn-monorepo - yarn-monorepo
- bedrock-go-tests
- fuzz-op-node
- bedrock-markdown
# - devnet: # - devnet:
# name: devnet (with deployed contracts) # name: devnet (with deployed contracts)
# deploy: true # deploy: true
...@@ -841,28 +853,95 @@ workflows: ...@@ -841,28 +853,95 @@ workflows:
- integration-tests - integration-tests
- semgrep-scan - semgrep-scan
- go-mod-tidy - go-mod-tidy
- fuzz-op-node
- bedrock-markdown
- go-lint:
name: op-batcher-lint
module: op-batcher
- go-lint:
name: op-bindings-lint
module: op-bindings
- go-lint:
name: op-chain-ops-lint
module: op-chain-ops
- go-lint:
name: op-e2e-lint
module: op-e2e
- go-lint:
name: op-node-lint
module: op-node
- go-lint:
name: op-proposer-lint
module: op-proposer
- go-lint:
name: op-service-lint
module: op-service
- go-test:
name: op-batcher-tests
module: op-batcher
- go-test:
name: op-bindings-tests
module: op-bindings
- go-test:
name: op-chain-ops-tests
module: op-chain-ops
- go-test:
name: op-node-tests
module: op-node
# TODO: override resource class
- go-test:
name: op-proposer-tests
module: op-proposer
- go-test:
name: op-service-tests
module: op-service
- go-e2e-test:
name: op-e2e-WS-tests
module: op-e2e
use_http: "false"
- go-e2e-test:
name: op-e2e-HTTP-tests
module: op-e2e
use_http: "true"
- bedrock-go-tests:
requires:
- op-batcher-lint
- op-bindings-lint
- op-chain-ops-lint
- op-e2e-lint
- op-node-lint
- op-proposer-lint
- op-service-lint
- op-batcher-tests
- op-bindings-tests
- op-chain-ops-tests
- op-node-tests
- op-proposer-tests
- op-service-tests
- op-e2e-WS-tests
- op-e2e-HTTP-tests
- docker-publish: - docker-publish:
name: op-node-publish-dev name: op-node-publish-dev
docker_file: op-node/Dockerfile docker_file: op-node/Dockerfile
docker_tags: us-central1-docker.pkg.dev/bedrock-goerli-development/images/op-node:<<pipeline.git.revision>> docker_name: op-node
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context: . docker_context: .
repo: us-central1-docker.pkg.dev
context: context:
- gcr - gcr
- docker-publish: - docker-publish:
name: op-batcher-publish-dev name: op-batcher-publish-dev
docker_file: op-batcher/Dockerfile docker_file: op-batcher/Dockerfile
docker_tags: us-central1-docker.pkg.dev/bedrock-goerli-development/images/op-batcher:<<pipeline.git.revision>> docker_name: op-batcher
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context: . docker_context: .
repo: us-central1-docker.pkg.dev
context: context:
- gcr - gcr
- docker-publish: - docker-publish:
name: op-proposer-publish-dev name: op-proposer-publish-dev
docker_file: op-proposer/Dockerfile docker_file: op-proposer/Dockerfile
docker_tags: us-central1-docker.pkg.dev/bedrock-goerli-development/images/op-proposer:<<pipeline.git.revision>> docker_name: op-proposer
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context: . docker_context: .
repo: us-central1-docker.pkg.dev
context: context:
- gcr - gcr
- hive-test: - hive-test:
...@@ -889,3 +968,14 @@ workflows: ...@@ -889,3 +968,14 @@ workflows:
- op-node-publish-dev - op-node-publish-dev
- op-batcher-publish-dev - op-batcher-publish-dev
- op-proposer-publish-dev - op-proposer-publish-dev
release:
jobs:
- docker-tag-op-stack-release:
name: docker-tag-op-stack-release
filters:
tags:
only: /^op-[a-z0-9\-]*\/v.*/
branches:
ignore: /.*/
context:
- gcr-release
...@@ -156,7 +156,7 @@ jobs: ...@@ -156,7 +156,7 @@ jobs:
context: ./ops/docker/hardhat context: ./ops/docker/hardhat
file: ./Dockerfile file: ./Dockerfile
push: true push: true
tags: ethereumoptimism/hardhat-node:${{ needs.release.outputs.gas-oracle }},ethereumoptimism/hardhat-node:latest tags: ethereumoptimism/hardhat-node:${{ needs.release.outputs.hardhat-node }},ethereumoptimism/hardhat-node:latest
ci-builder: ci-builder:
name: Publish ci-builder ${{ needs.release.outputs.ci-builder }} name: Publish ci-builder ${{ needs.release.outputs.ci-builder }}
......
...@@ -17,7 +17,7 @@ module.exports = { ...@@ -17,7 +17,7 @@ module.exports = {
bracketSpacing: true, bracketSpacing: true,
// These options are specific to the Solidity Plugin // These options are specific to the Solidity Plugin
explicitTypes: 'always', explicitTypes: 'always',
compiler: '>=0.8.10', compiler: '>=0.8.15',
}, },
}, },
], ],
......
...@@ -77,7 +77,6 @@ Refer to the Directory Structure section below to understand which packages are ...@@ -77,7 +77,6 @@ Refer to the Directory Structure section below to understand which packages are
~~ BEDROCK upgrade - Not production-ready yet, part of next major upgrade ~~ ~~ BEDROCK upgrade - Not production-ready yet, part of next major upgrade ~~
├── <a href="./packages">packages</a> ├── <a href="./packages">packages</a>
│ ├── <a href="./packages/integration-tests-bedrock">integration-tests-bedrock</a>: Bedrock integration tests.
│ └── <a href="./packages/contracts-bedrock">contracts-bedrock</a>: Bedrock smart contracts. To be merged with ./packages/contracts. │ └── <a href="./packages/contracts-bedrock">contracts-bedrock</a>: Bedrock smart contracts. To be merged with ./packages/contracts.
├── <a href="./op-bindings">op-bindings</a>: Go bindings for Bedrock smart contracts. ├── <a href="./op-bindings">op-bindings</a>: Go bindings for Bedrock smart contracts.
├── <a href="./op-batcher">op-batcher</a>: L2-Batch Submitter, submits bundles of batches to L1 ├── <a href="./op-batcher">op-batcher</a>: L2-Batch Submitter, submits bundles of batches to L1
......
steps: steps:
- name: 'gcr.io/kaniko-project/executor:latest'
args:
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-node:$_TAG
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-node:$COMMIT_SHA
- --dockerfile=op-node/Dockerfile
- --cache=true
- --cache-ttl=48h
waitFor: ['-']
- name: 'gcr.io/kaniko-project/executor:latest'
args:
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-batcher:$_TAG
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-batcher:$COMMIT_SHA
- --dockerfile=./op-batcher/Dockerfile
- --cache=true
- --cache-ttl=48h
waitFor: ['-']
- name: 'gcr.io/kaniko-project/executor:latest'
args:
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-proposer:$_TAG
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/op-proposer:$COMMIT_SHA
- --dockerfile=./op-proposer/Dockerfile
- --cache=true
- --cache-ttl=48h
waitFor: ['-']
- name: 'gcr.io/kaniko-project/executor:latest' - name: 'gcr.io/kaniko-project/executor:latest'
args: args:
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/deployer-bedrock:$_TAG - --destination=us-central1-docker.pkg.dev/$PROJECT_ID/images/deployer-bedrock:$_TAG
...@@ -42,4 +18,4 @@ steps: ...@@ -42,4 +18,4 @@ steps:
- --cache-ttl=48h - --cache-ttl=48h
waitFor: ['-'] waitFor: ['-']
options: options:
machineType: N1_HIGHCPU_32 machineType: N1_HIGHCPU_32
\ No newline at end of file
...@@ -5,7 +5,7 @@ go 1.18 ...@@ -5,7 +5,7 @@ go 1.18
require ( require (
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220923210602-7121648c1f26 github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220923210602-7121648c1f26
github.com/ethereum-optimism/optimism/op-service v0.8.8 github.com/ethereum-optimism/optimism/op-service v0.8.8
github.com/ethereum/go-ethereum v1.10.23 github.com/ethereum/go-ethereum v1.10.26
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.13.0 github.com/prometheus/client_golang v1.13.0
github.com/urfave/cli v1.22.9 github.com/urfave/cli v1.22.9
......
...@@ -192,8 +192,8 @@ github.com/ethereum-optimism/optimism/op-service v0.8.8 h1:k5E78Zr2cGU0SwjoHpFXu ...@@ -192,8 +192,8 @@ github.com/ethereum-optimism/optimism/op-service v0.8.8 h1:k5E78Zr2cGU0SwjoHpFXu
github.com/ethereum-optimism/optimism/op-service v0.8.8/go.mod h1:K0uybOhICTc2yfhrRj0cD1m7aPkOf5C9e6bUmvf4rGA= github.com/ethereum-optimism/optimism/op-service v0.8.8/go.mod h1:K0uybOhICTc2yfhrRj0cD1m7aPkOf5C9e6bUmvf4rGA=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg= github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y= github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y=
github.com/ethereum/go-ethereum v1.10.23 h1:Xk8XAT4/UuqcjMLIMF+7imjkg32kfVFKoeyQDaO2yWM= github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s=
github.com/ethereum/go-ethereum v1.10.23/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
......
...@@ -20,7 +20,7 @@ use ( ...@@ -20,7 +20,7 @@ use (
./teleportr ./teleportr
) )
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be
// For local debugging: // For local debugging:
//replace github.com/ethereum/go-ethereum v1.10.23 => ../go-ethereum //replace github.com/ethereum/go-ethereum v1.10.26 => ../go-ethereum
...@@ -50,7 +50,6 @@ github.com/Shopify/sarama v1.19.0 h1:9oksLxC6uxVPHPVYUmq6xhr1BOF/hHobWH2UzO67z1s ...@@ -50,7 +50,6 @@ github.com/Shopify/sarama v1.19.0 h1:9oksLxC6uxVPHPVYUmq6xhr1BOF/hHobWH2UzO67z1s
github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8=
github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=
github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw=
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af h1:wVe6/Ea46ZMeNkQjjBW6xcqyQA/j5e0D6GytH95g0gQ= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af h1:wVe6/Ea46ZMeNkQjjBW6xcqyQA/j5e0D6GytH95g0gQ=
...@@ -81,16 +80,14 @@ github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 h1:y4B3+GPxKlrigF1ha ...@@ -81,16 +80,14 @@ github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 h1:y4B3+GPxKlrigF1ha
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625 h1:ckJgFhFWywOx+YLEMIJsTb+NV6NexWICk5+AMSuz3ss= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625 h1:ckJgFhFWywOx+YLEMIJsTb+NV6NexWICk5+AMSuz3ss=
github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ=
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw=
github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4= github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4=
github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE= github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE=
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc=
github.com/btcsuite/winsvc v1.0.0 h1:J9B4L7e3oqhXOcm+2IuNApwzQec85lE+QaikUcCs+dk=
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23 h1:D21IyuvjDCshj1/qq+pCNd3VZOAEI9jy6Bi131YlXgI= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23 h1:D21IyuvjDCshj1/qq+pCNd3VZOAEI9jy6Bi131YlXgI=
github.com/c-bata/go-prompt v0.2.2 h1:uyKRz6Z6DUyj49QVijyM339UJV9yhbr70gESwbNU3e0= github.com/c-bata/go-prompt v0.2.2 h1:uyKRz6Z6DUyj49QVijyM339UJV9yhbr70gESwbNU3e0=
github.com/casbin/casbin/v2 v2.1.2 h1:bTwon/ECRx9dwBy2ewRVr5OiqjeXSGiTUY74sDPQi/g= github.com/casbin/casbin/v2 v2.1.2 h1:bTwon/ECRx9dwBy2ewRVr5OiqjeXSGiTUY74sDPQi/g=
github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=
github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE=
github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=
...@@ -108,12 +105,15 @@ github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572 h1:+R8G1+Ftumd0 ...@@ -108,12 +105,15 @@ github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572 h1:+R8G1+Ftumd0
github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f h1:C43yEtQ6NIf4ftFXD/V55gnGFgPbMQobd//YlnLjUJ8= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f h1:C43yEtQ6NIf4ftFXD/V55gnGFgPbMQobd//YlnLjUJ8=
github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04= github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04=
github.com/coreos/go-etcd v2.0.0+incompatible h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo= github.com/coreos/go-etcd v2.0.0+incompatible h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d h1:t5Wuyh53qYyg9eqn4BbnlIT+vmhyww0TatL+zT3uWgI= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d h1:t5Wuyh53qYyg9eqn4BbnlIT+vmhyww0TatL+zT3uWgI=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf h1:CAKfRE2YtTUIjjh1bkBtyYFaUT/WmOqsJjgtihT0vMI= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf h1:CAKfRE2YtTUIjjh1bkBtyYFaUT/WmOqsJjgtihT0vMI=
github.com/crate-crypto/go-ipa v0.0.0-20220523130400-f11357ae11c7 h1:6IrxszG5G+O7zhtkWxq6+unVvnrm1fqV2Pe+T95DUzw=
github.com/crate-crypto/go-ipa v0.0.0-20220523130400-f11357ae11c7/go.mod h1:gFnFS95y8HstDP6P9pPwzrxOOC5TRDkwbM+ao15ChAI=
github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c h1:/ovYnF02fwL0kvspmy9AuyKg1JhdTRUgPw4nUxd9oZM= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c h1:/ovYnF02fwL0kvspmy9AuyKg1JhdTRUgPw4nUxd9oZM=
github.com/dave/jennifer v1.2.0 h1:S15ZkFMRoJ36mGAQgWL1tnr0NQJh9rZ8qatseX/VbBc= github.com/dave/jennifer v1.2.0 h1:S15ZkFMRoJ36mGAQgWL1tnr0NQJh9rZ8qatseX/VbBc=
github.com/decred/dcrd/lru v1.0.0 h1:Kbsb1SFDsIlaupWPwsPp+dkxiBY1frcS07PCPgotKz8=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8 h1:akOQj8IVgoeFfBTzGOEQakCYshWD6RNo1M5pivFXt70= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8 h1:akOQj8IVgoeFfBTzGOEQakCYshWD6RNo1M5pivFXt70=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
...@@ -144,6 +144,8 @@ github.com/ethereum-optimism/op-geth v0.0.0-20221025133509-99f188dc2f4a h1:qxa/c ...@@ -144,6 +144,8 @@ github.com/ethereum-optimism/op-geth v0.0.0-20221025133509-99f188dc2f4a h1:qxa/c
github.com/ethereum-optimism/op-geth v0.0.0-20221025133509-99f188dc2f4a/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo= github.com/ethereum-optimism/op-geth v0.0.0-20221025133509-99f188dc2f4a/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-20221028165624-03aeaf2c39a5 h1:b0ySUX1hwS14+VDdXRS90eKA2S0IANYMftAP0CQGpoU= github.com/ethereum-optimism/op-geth v0.0.0-20221028165624-03aeaf2c39a5 h1:b0ySUX1hwS14+VDdXRS90eKA2S0IANYMftAP0CQGpoU=
github.com/ethereum-optimism/op-geth v0.0.0-20221028165624-03aeaf2c39a5/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo= github.com/ethereum-optimism/op-geth v0.0.0-20221028165624-03aeaf2c39a5/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-20221104125741-d6c1bb9a110d h1:rDRvYVDftip53l1igBiLa3+CLPmIH2r0of2GTArMC60=
github.com/ethereum-optimism/op-geth v0.0.0-20221104125741-d6c1bb9a110d/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc=
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
...@@ -157,6 +159,8 @@ github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM ...@@ -157,6 +159,8 @@ github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM
github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc= github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 h1:IZqZOB2fydHte3kUgxrzK5E1fW7RQGeDwE8F/ZZnUYc=
github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8=
github.com/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8= github.com/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8=
github.com/gballet/go-verkle v0.0.0-20220902153445-097bd83b7732 h1:AB7YjNrzlVHsYz06zCULVV2zYCEft82P86dSmtwxKL0=
github.com/gballet/go-verkle v0.0.0-20220902153445-097bd83b7732/go.mod h1:o/XfIXWi4/GqbQirfRm5uTbXMG5NpqxkxblnbZ+QM9I=
github.com/getkin/kin-openapi v0.61.0 h1:6awGqF5nG5zkVpMsAih1QH4VgzS8phTxECUWIFo7zko= github.com/getkin/kin-openapi v0.61.0 h1:6awGqF5nG5zkVpMsAih1QH4VgzS8phTxECUWIFo7zko=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g=
...@@ -260,10 +264,8 @@ github.com/iris-contrib/schema v0.0.1 h1:10g/WnoRR+U+XXHWKBHeNy/+tZmM2kcAVGLOsz+ ...@@ -260,10 +264,8 @@ github.com/iris-contrib/schema v0.0.1 h1:10g/WnoRR+U+XXHWKBHeNy/+tZmM2kcAVGLOsz+
github.com/jbenet/go-cienv v0.1.0 h1:Vc/s0QbQtoxX8MwwSLWWh+xNNZvM3Lw7NsTcHrvvhMc= github.com/jbenet/go-cienv v0.1.0 h1:Vc/s0QbQtoxX8MwwSLWWh+xNNZvM3Lw7NsTcHrvvhMc=
github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e h1:UvSe12bq+Uj2hWd8aOlwPmoZ+CITRFrdit+sDGfAg8U= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e h1:UvSe12bq+Uj2hWd8aOlwPmoZ+CITRFrdit+sDGfAg8U=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1 h1:ujPKutqRlJtcfWk6toYVYagwra7HQHbXOaS171b4Tg8= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1 h1:ujPKutqRlJtcfWk6toYVYagwra7HQHbXOaS171b4Tg8=
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=
github.com/jsternberg/zap-logfmt v1.0.0 h1:0Dz2s/eturmdUS34GM82JwNEdQ9hPoJgqptcEKcbpzY= github.com/jsternberg/zap-logfmt v1.0.0 h1:0Dz2s/eturmdUS34GM82JwNEdQ9hPoJgqptcEKcbpzY=
...@@ -279,20 +281,23 @@ github.com/kataras/pio v0.0.2 h1:6NAi+uPJ/Zuid6mrAKlgpbI11/zK/lV4B2rxWaJN98Y= ...@@ -279,20 +281,23 @@ github.com/kataras/pio v0.0.2 h1:6NAi+uPJ/Zuid6mrAKlgpbI11/zK/lV4B2rxWaJN98Y=
github.com/kataras/sitemap v0.0.5 h1:4HCONX5RLgVy6G4RkYOV3vKNcma9p236LdGOipJsaFE= github.com/kataras/sitemap v0.0.5 h1:4HCONX5RLgVy6G4RkYOV3vKNcma9p236LdGOipJsaFE=
github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE= github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio=
github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w=
github.com/klauspost/cpuid/v2 v2.0.14/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= github.com/klauspost/cpuid/v2 v2.0.14/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6 h1:KAZ1BW2TCmT6PRihDPpocIy1QTtsAsrx6TneU/4+CMg= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6 h1:KAZ1BW2TCmT6PRihDPpocIy1QTtsAsrx6TneU/4+CMg=
github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada h1:3L+neHp83cTjegPdCiOxVOJtRIy7/8RldvMTsyPYH10= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada h1:3L+neHp83cTjegPdCiOxVOJtRIy7/8RldvMTsyPYH10=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4= github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4=
github.com/labstack/echo/v4 v4.5.0 h1:JXk6H5PAw9I3GwizqUHhYyS4f45iyGebR/c1xNCeOCY= github.com/labstack/echo/v4 v4.5.0 h1:JXk6H5PAw9I3GwizqUHhYyS4f45iyGebR/c1xNCeOCY=
github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0= github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/libp2p/go-addr-util v0.1.0 h1:acKsntI33w2bTU7tC9a0SaPimJGfSI0bFKC18ChxeVI= github.com/libp2p/go-addr-util v0.1.0 h1:acKsntI33w2bTU7tC9a0SaPimJGfSI0bFKC18ChxeVI=
github.com/libp2p/go-conn-security-multistream v0.3.0 h1:9UCIKlBL1hC9u7nkMXpD1nkc/T53PKMAn3/k9ivBAVc= github.com/libp2p/go-conn-security-multistream v0.3.0 h1:9UCIKlBL1hC9u7nkMXpD1nkc/T53PKMAn3/k9ivBAVc=
github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc=
github.com/libp2p/go-libp2p v0.20.0/go.mod h1:g0C5Fu+aXXbCXkusCzLycuBowEih3ElmDqtbo61Em7k= github.com/libp2p/go-libp2p v0.20.0/go.mod h1:g0C5Fu+aXXbCXkusCzLycuBowEih3ElmDqtbo61Em7k=
github.com/libp2p/go-libp2p v0.22.0/go.mod h1:UDolmweypBSjQb2f7xutPnwZ/fxioLbMBxSjRksxxU4=
github.com/libp2p/go-libp2p-circuit v0.6.0 h1:rw/HlhmUB3OktS/Ygz6+2XABOmHKzZpPUuMNUMosj8w= github.com/libp2p/go-libp2p-circuit v0.6.0 h1:rw/HlhmUB3OktS/Ygz6+2XABOmHKzZpPUuMNUMosj8w=
github.com/libp2p/go-libp2p-core v0.16.1/go.mod h1:O3i/7y+LqUb0N+qhzXjBjjpchgptWAVMG1Voegk7b4c= github.com/libp2p/go-libp2p-core v0.16.1/go.mod h1:O3i/7y+LqUb0N+qhzXjBjjpchgptWAVMG1Voegk7b4c=
github.com/libp2p/go-libp2p-core v0.19.0/go.mod h1:AkA+FUKQfYt1FLNef5fOPlo/naAWjKy/RCjkcPjqzYg= github.com/libp2p/go-libp2p-core v0.19.0/go.mod h1:AkA+FUKQfYt1FLNef5fOPlo/naAWjKy/RCjkcPjqzYg=
...@@ -301,6 +306,7 @@ github.com/libp2p/go-libp2p-nat v0.1.0 h1:vigUi2MEN+fwghe5ijpScxtbbDz+L/6y8XwlzY ...@@ -301,6 +306,7 @@ github.com/libp2p/go-libp2p-nat v0.1.0 h1:vigUi2MEN+fwghe5ijpScxtbbDz+L/6y8XwlzY
github.com/libp2p/go-libp2p-noise v0.3.0 h1:NCVH7evhVt9njbTQshzT7N1S3Q6fjj9M11FCgfH5+cA= github.com/libp2p/go-libp2p-noise v0.3.0 h1:NCVH7evhVt9njbTQshzT7N1S3Q6fjj9M11FCgfH5+cA=
github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k= github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k=
github.com/libp2p/go-libp2p-quic-transport v0.17.0 h1:yFh4Gf5MlToAYLuw/dRvuzYd1EnE2pX3Lq1N6KDiWRQ= github.com/libp2p/go-libp2p-quic-transport v0.17.0 h1:yFh4Gf5MlToAYLuw/dRvuzYd1EnE2pX3Lq1N6KDiWRQ=
github.com/libp2p/go-libp2p-resource-manager v0.1.5 h1:7J6t9KLFS0MxXDTfqA6rwfVCZl/yLQnXW5LpZjHAANI=
github.com/libp2p/go-libp2p-resource-manager v0.5.1/go.mod h1:CggtV6EZb+Y0dGh41q5ezO4udcVKyhcEFpydHD8EMe0= github.com/libp2p/go-libp2p-resource-manager v0.5.1/go.mod h1:CggtV6EZb+Y0dGh41q5ezO4udcVKyhcEFpydHD8EMe0=
github.com/libp2p/go-libp2p-tls v0.3.1 h1:lsE2zYte+rZCEOHF72J1Fg3XK3dGQyKvI6i5ehJfEp0= github.com/libp2p/go-libp2p-tls v0.3.1 h1:lsE2zYte+rZCEOHF72J1Fg3XK3dGQyKvI6i5ehJfEp0=
github.com/libp2p/go-libp2p-transport-upgrader v0.7.1 h1:MSMe+tUfxpC9GArTz7a4G5zQKQgGh00Vio87d3j3xIg= github.com/libp2p/go-libp2p-transport-upgrader v0.7.1 h1:MSMe+tUfxpC9GArTz7a4G5zQKQgGh00Vio87d3j3xIg=
...@@ -313,16 +319,25 @@ github.com/libp2p/go-tcp-transport v0.5.1 h1:edOOs688VLZAozWC7Kj5/6HHXKNwi9M6wgR ...@@ -313,16 +319,25 @@ github.com/libp2p/go-tcp-transport v0.5.1 h1:edOOs688VLZAozWC7Kj5/6HHXKNwi9M6wgR
github.com/libp2p/go-ws-transport v0.6.0 h1:326XBL6Q+5CQ2KtjXz32+eGu02W/Kz2+Fm4SpXdr0q4= github.com/libp2p/go-ws-transport v0.6.0 h1:326XBL6Q+5CQ2KtjXz32+eGu02W/Kz2+Fm4SpXdr0q4=
github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI= github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI=
github.com/libp2p/go-yamux/v3 v3.1.1/go.mod h1:jeLEQgLXqE2YqX1ilAClIfCMDY+0uXQUKmmb/qp0gT4= github.com/libp2p/go-yamux/v3 v3.1.1/go.mod h1:jeLEQgLXqE2YqX1ilAClIfCMDY+0uXQUKmmb/qp0gT4=
github.com/libp2p/go-yamux/v3 v3.1.2 h1:lNEy28MBk1HavUAlzKgShp+F6mn/ea1nDYWftZhFW9Q=
github.com/libp2p/go-yamux/v3 v3.1.2/go.mod h1:jeLEQgLXqE2YqX1ilAClIfCMDY+0uXQUKmmb/qp0gT4=
github.com/libp2p/zeroconf/v2 v2.1.1 h1:XAuSczA96MYkVwH+LqqqCUZb2yH3krobMJ1YE+0hG2s= github.com/libp2p/zeroconf/v2 v2.1.1 h1:XAuSczA96MYkVwH+LqqqCUZb2yH3krobMJ1YE+0hG2s=
github.com/libp2p/zeroconf/v2 v2.2.0 h1:Cup06Jv6u81HLhIj1KasuNM/RHHrJ8T7wOTS4+Tv53Q=
github.com/libp2p/zeroconf/v2 v2.2.0/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs=
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743 h1:143Bb8f8DuGWck/xpNUOckBVYfFbBTnLevfRZ1aVVqo= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743 h1:143Bb8f8DuGWck/xpNUOckBVYfFbBTnLevfRZ1aVVqo=
github.com/lightstep/lightstep-tracer-go v0.18.1 h1:vi1F1IQ8N7hNWytK9DpJsUfQhGuNSc19z330K6vl4zk= github.com/lightstep/lightstep-tracer-go v0.18.1 h1:vi1F1IQ8N7hNWytK9DpJsUfQhGuNSc19z330K6vl4zk=
github.com/lucas-clemente/quic-go v0.27.1/go.mod h1:AzgQoPda7N+3IqMMMkywBKggIFo2KT6pfnlrQ2QieeI= github.com/lucas-clemente/quic-go v0.27.1/go.mod h1:AzgQoPda7N+3IqMMMkywBKggIFo2KT6pfnlrQ2QieeI=
github.com/lucas-clemente/quic-go v0.28.1/go.mod h1:oGz5DKK41cJt5+773+BSO9BXDsREY4HLf7+0odGAPO0=
github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8= github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8=
github.com/lyft/protoc-gen-validate v0.0.13 h1:KNt/RhmQTOLr7Aj8PsJ7mTronaFyx80mRTT9qF261dA= github.com/lyft/protoc-gen-validate v0.0.13 h1:KNt/RhmQTOLr7Aj8PsJ7mTronaFyx80mRTT9qF261dA=
github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=
github.com/marten-seemann/qpack v0.2.1 h1:jvTsT/HpCn2UZJdP+UUB53FfUUgeOyG5K1ns0OJOGVs=
github.com/marten-seemann/qtls-go1-15 v0.1.4 h1:RehYMOyRW8hPVEja1KBVsFVNSm35Jj9Mvs5yNoZZ28A= github.com/marten-seemann/qtls-go1-15 v0.1.4 h1:RehYMOyRW8hPVEja1KBVsFVNSm35Jj9Mvs5yNoZZ28A=
github.com/marten-seemann/qtls-go1-16 v0.1.5 h1:o9JrYPPco/Nukd/HpOHMHZoBDXQqoNtUCmny98/1uqQ=
github.com/marten-seemann/qtls-go1-17 v0.1.2 h1:JADBlm0LYiVbuSySCHeY863dNkcpMmDR7s0bLKJeYlQ=
github.com/marten-seemann/qtls-go1-17 v0.1.2/go.mod h1:C2ekUKcDdz9SDWxec1N/MvcXBpaX9l3Nx67XaR84L5s=
github.com/marten-seemann/qtls-go1-19 v0.1.0-beta.1/go.mod h1:5HTDWtVudo/WFsHKRNuOhWlbdjrfs5JHrYb0wIJqGpI=
github.com/marten-seemann/webtransport-go v0.1.1/go.mod h1:kBEh5+RSvOA4troP1vyOVBWK4MIMzDICXVrvCPrYcrM=
github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd h1:HvFwW+cm9bCbZ/+vuGNq7CRWXql8c0y8nGeYpqmpvmk= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd h1:HvFwW+cm9bCbZ/+vuGNq7CRWXql8c0y8nGeYpqmpvmk=
github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q=
github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104 h1:d8RFOZ2IiFtFWBcKEHAFYJcPTf0wY5q0exFNJZVWa1U= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104 h1:d8RFOZ2IiFtFWBcKEHAFYJcPTf0wY5q0exFNJZVWa1U=
...@@ -461,27 +476,34 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t ...@@ -461,27 +476,34 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t
go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0=
go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U=
go4.org v0.0.0-20180809161055-417644f6feb5 h1:+hE86LblG4AyDgwMCLTE6FOlM9+qjHSYS+rKqxUVdsM= go4.org v0.0.0-20180809161055-417644f6feb5 h1:+hE86LblG4AyDgwMCLTE6FOlM9+qjHSYS+rKqxUVdsM=
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d h1:E2M5QgjZ/Jg+ObCQAudsXxuTsLj7Nl5RV/lZcQZmKSo= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d h1:E2M5QgjZ/Jg+ObCQAudsXxuTsLj7Nl5RV/lZcQZmKSo=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 h1:rxKZ2gOnYxjfmakvUUqh9Gyb6KXfrj7JWTxORTYqb0E= golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 h1:rxKZ2gOnYxjfmakvUUqh9Gyb6KXfrj7JWTxORTYqb0E=
golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220630215102-69896b714898/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220630215102-69896b714898/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
...@@ -502,6 +524,7 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc ...@@ -502,6 +524,7 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211020174200-9d6173849985/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
...@@ -513,6 +536,7 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc ...@@ -513,6 +536,7 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0=
...@@ -540,6 +564,7 @@ google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRR ...@@ -540,6 +564,7 @@ google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRR
google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8=
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
...@@ -580,7 +605,9 @@ google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX ...@@ -580,7 +605,9 @@ google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX
google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
...@@ -588,6 +615,7 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ ...@@ -588,6 +615,7 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ
google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q=
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
......
...@@ -6,7 +6,7 @@ replace github.com/ethereum-optimism/optimism/op-bindings v0.0.0 => ../op-bindin ...@@ -6,7 +6,7 @@ replace github.com/ethereum-optimism/optimism/op-bindings v0.0.0 => ../op-bindin
require ( require (
github.com/ethereum-optimism/optimism/op-bindings v0.0.0 github.com/ethereum-optimism/optimism/op-bindings v0.0.0
github.com/ethereum/go-ethereum v1.10.23 github.com/ethereum/go-ethereum v1.10.26
github.com/getsentry/sentry-go v0.12.0 github.com/getsentry/sentry-go v0.12.0
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0 github.com/gorilla/mux v1.8.0
......
...@@ -79,8 +79,8 @@ func TestBedrockIndexer(t *testing.T) { ...@@ -79,8 +79,8 @@ func TestBedrockIndexer(t *testing.T) {
RESTPort: 7980, RESTPort: 7980,
DisableIndexer: false, DisableIndexer: false,
Bedrock: true, Bedrock: true,
BedrockL1StandardBridgeAddress: predeploys.DevL1StandardBridgeAddr, BedrockL1StandardBridgeAddress: cfg.DeployConfig.L1StandardBridgeProxy,
BedrockOptimismPortalAddress: predeploys.DevOptimismPortalAddr, BedrockOptimismPortalAddress: cfg.DeployConfig.OptimismPortalProxy,
} }
idxr, err := indexer.NewIndexer(idxrCfg) idxr, err := indexer.NewIndexer(idxrCfg)
require.NoError(t, err) require.NoError(t, err)
......
...@@ -3,122 +3,274 @@ package op_batcher ...@@ -3,122 +3,274 @@ package op_batcher
import ( import (
"bytes" "bytes"
"errors" "errors"
"fmt"
"io" "io"
"math"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
) )
var ErrReorg = errors.New("block does not extend existing chain") var ErrReorg = errors.New("block does not extend existing chain")
// txID is an opaque identifier for a transaction.
// It's internal fields should not be inspected after creation & are subject to change.
// This ID must be trivially comparable & work as a map key.
type txID struct { type txID struct {
chID derive.ChannelID chID derive.ChannelID
frameNumber uint16 frameNumber uint16
} }
func (id txID) String() string {
return fmt.Sprintf("%s:%d", id.chID.String(), id.frameNumber)
}
// TerminalString implements log.TerminalStringer, formatting a string for console
// output during logging.
func (id txID) TerminalString() string {
return fmt.Sprintf("%s:%d", id.chID.TerminalString(), id.frameNumber)
}
type taggedData struct { type taggedData struct {
data []byte data []byte
id txID id txID
} }
// channelManager stores a contiguous set of blocks & turns them into channels.
// Upon receiving tx confirmation (or a tx failure), it does channel error handling.
//
// For simplicity, it only creates a single pending channel at a time & waits for
// the channel to either successfully be submitted or timeout before creating a new
// channel.
// Functions on channelManager are not safe for concurrent access.
type channelManager struct { type channelManager struct {
// All blocks since the last request for new tx data log log.Logger
channelTimeout uint64
// All blocks since the last request for new tx data.
blocks []*types.Block blocks []*types.Block
datas []taggedData datas []taggedData
// Pending data returned by TxData waiting on Tx Confirmed/Failed
// id of the pending channel
pendingChannel derive.ChannelID
// list of blocks in the channel. Saved in case the channel must be rebuilt
pendingBlocks []*types.Block
// Set of unconfirmed txID -> frame data. For tx resubmission
pendingTransactions map[txID][]byte
// Set of confirmed txID -> inclusion block. For determining if the channel is timed out
confirmedTransactions map[txID]eth.BlockID
}
func NewChannelManager(log log.Logger, channelTimeout uint64) *channelManager {
return &channelManager{
log: log,
channelTimeout: channelTimeout,
pendingTransactions: make(map[txID][]byte),
confirmedTransactions: make(map[txID]eth.BlockID),
}
} }
// Clear clears the entire state of the channel manager. // Clear clears the entire state of the channel manager.
// It is intended to be used after an L2 reorg. // It is intended to be used after an L2 reorg.
func (s *channelManager) Clear() { func (s *channelManager) Clear() {
s.log.Trace("clearing channel manager state")
s.blocks = s.blocks[:0] s.blocks = s.blocks[:0]
s.datas = s.datas[:0] s.datas = s.datas[:0]
} }
// func (s *channelManager) TxConfirmed(id txID, inclusionBlock eth.BlockID) { // TxFailed records a transaction as failed. It will attempt to resubmit the data
// // todo: implement // in the failed transaction.
// } func (s *channelManager) TxFailed(id txID) {
if data, ok := s.pendingTransactions[id]; ok {
s.log.Trace("marked transaction as failed", "id", id)
s.datas = append(s.datas, taggedData{data, id})
delete(s.pendingTransactions, id)
} else {
s.log.Info("marked transaction as failed despite having no record of it.", "id", id)
}
}
// TxData returns the next tx.data that should be submitted to L1. // TxConfirmed marks a transaction as confirmed on L1. Unfortunately even if all frames in
// It is very simple & currently ignores the l1Head provided (this will change). // a channel have been marked as confirmed on L1 the channel may be invalid & need to be
// It may buffer very large channels as well. // resubmitted.
func (s *channelManager) TxData(l1Head eth.L1BlockRef) ([]byte, txID, error) { // This function may reset the pending channel if the pending channel has timed out.
// Note: l1Head is not actually used in this function. func (s *channelManager) TxConfirmed(id txID, inclusionBlock eth.BlockID) {
s.log.Trace("marked transaction as confirmed", "id", id, "block", inclusionBlock)
if _, ok := s.pendingTransactions[id]; !ok {
s.log.Info("marked transaction as confirmed despite having no record of it", "id", id, "block", inclusionBlock)
// TODO: This can occur if we clear the channel while there are still pending transactions
// We need to keep track of stale transactions instead
return
}
delete(s.pendingTransactions, id)
s.confirmedTransactions[id] = inclusionBlock
// Return a pre-existing frame if we have it. // If this channel timed out, put the pending blocks back into the local saved blocks
if len(s.datas) != 0 { // and then reset this state so it can try to build a new channel.
r := s.datas[0] if s.pendingChannelIsTimedOut() {
s.datas = s.datas[1:] s.log.Warn("Channel timed out", "chID", s.pendingChannel)
return r.data, r.id, nil s.blocks = append(s.pendingBlocks, s.blocks...)
s.clearPendingChannel()
}
// If we are done with this channel, record that.
if s.pendingChannelIsFullySubmitted() {
s.log.Info("Channel is fully submitted", "chID", s.pendingChannel)
s.clearPendingChannel()
} }
}
// Also return io.EOF if we cannot create a channel // clearPendingChannel resets all pending state back to an initialized but empty state.
if len(s.blocks) == 0 { // TODO: Create separate "pending" state
return nil, txID{}, io.EOF func (s *channelManager) clearPendingChannel() {
s.pendingChannel = derive.ChannelID{}
s.pendingBlocks = nil
s.pendingTransactions = make(map[txID][]byte)
s.confirmedTransactions = make(map[txID]eth.BlockID)
}
// pendingChannelIsTimedOut returns true if submitted channel has timed out.
// A channel has timed out if the difference in L1 Inclusion blocks between
// the first & last included block is greater than or equal to the channel timeout.
func (s *channelManager) pendingChannelIsTimedOut() bool {
if s.pendingChannel == (derive.ChannelID{}) {
return false // no channel to be timed out
}
// No confirmed transactions => not timed out
if len(s.confirmedTransactions) == 0 {
return false
} }
// If there are confirmed transactions, find the first + last confirmed block numbers
min := uint64(math.MaxUint64)
max := uint64(0)
for _, inclusionBlock := range s.confirmedTransactions {
if inclusionBlock.Number < min {
min = inclusionBlock.Number
}
if inclusionBlock.Number > max {
max = inclusionBlock.Number
}
}
return max-min >= s.channelTimeout
}
// Add all pending blocks to a channel // pendingChannelIsFullySubmitted returns true if the channel has been fully submitted.
func (s *channelManager) pendingChannelIsFullySubmitted() bool {
if s.pendingChannel == (derive.ChannelID{}) {
return false // todo: can decide either way here. Nonsensical answer though
}
return len(s.pendingTransactions)+len(s.datas) == 0
}
// blocksToFrames turns a set of blocks into a set of frames inside a channel.
// It will only create a single channel which contains up to `MAX_RLP_BYTES`. Any
// blocks not added to the channel are returned. It uses the max supplied frame size.
func blocksToFrames(blocks []*types.Block, maxFrameSize uint64) (derive.ChannelID, [][]byte, []*types.Block, error) {
ch, err := derive.NewChannelOut() ch, err := derive.NewChannelOut()
if err != nil { if err != nil {
return nil, txID{}, err return derive.ChannelID{}, nil, nil, err
} }
// TODO: use peek/pop paradigm here instead of manually slicing
i := 0 i := 0
// Cap length at 100 blocks for ; i < len(blocks); i++ {
l := len(s.blocks) if err := ch.AddBlock(blocks[i]); err == derive.ErrTooManyRLPBytes {
if l > 100 {
l = 100
}
for ; i < l; i++ {
if err := ch.AddBlock(s.blocks[i]); err == derive.ErrTooManyRLPBytes {
break break
} else if err != nil { } else if err != nil {
return nil, txID{}, err return derive.ChannelID{}, nil, nil, err
} }
// TODO: limit the RLP size of the channel to be lower than the limit to enable
// channels to be fully submitted on time.
} }
if err := ch.Close(); err != nil { if err := ch.Close(); err != nil {
return nil, txID{}, err return derive.ChannelID{}, nil, nil, err
} }
var t []taggedData var frames [][]byte
frameNumber := uint16(0)
for { for {
var buf bytes.Buffer var buf bytes.Buffer
buf.WriteByte(derive.DerivationVersion0) buf.WriteByte(derive.DerivationVersion0)
err := ch.OutputFrame(&buf, 120_000) err := ch.OutputFrame(&buf, maxFrameSize-1)
if err != io.EOF && err != nil { if err != io.EOF && err != nil {
return nil, txID{}, err return derive.ChannelID{}, nil, nil, err
} }
frames = append(frames, buf.Bytes())
t = append(t, taggedData{
data: buf.Bytes(),
id: txID{ch.ID(), frameNumber},
})
frameNumber += 1
if err == io.EOF { if err == io.EOF {
break break
} }
} }
return ch.ID(), frames, blocks[i:], nil
}
s.datas = append(s.datas, t...) // nextTxData pops off s.datas & handles updating the internal state
// Say i = 0, 1 are added to the channel, but i = 2 returns ErrTooManyRLPBytes. i remains 2 & is inclusive, so this works. func (s *channelManager) nextTxData() ([]byte, txID, error) {
// Say all blocks are added, i will be len(blocks) after exiting the loop (but never inside the loop). if len(s.datas) != 0 {
s.blocks = s.blocks[i:] r := s.datas[0]
s.log.Trace("returning next tx data", "id", r.id)
if len(s.datas) == 0 { s.pendingTransactions[r.id] = r.data
s.datas = s.datas[1:]
return r.data, r.id, nil
} else {
return nil, txID{}, io.EOF // TODO: not enough data error instead return nil, txID{}, io.EOF // TODO: not enough data error instead
} }
}
// TxData returns the next tx.data that should be submitted to L1.
// It is very simple & currently ignores the l1Head provided (this will change).
// It may buffer very large channels as well.
func (s *channelManager) TxData(l1Head eth.L1BlockRef) ([]byte, txID, error) {
channelPending := s.pendingChannel != (derive.ChannelID{})
s.log.Debug("Requested tx data", "l1Head", l1Head, "channel_pending", channelPending, "block_count", len(s.blocks))
// Short circuit if there is a pending channel.
// We either submit the next frame from that channel or
if channelPending {
return s.nextTxData()
}
// If we have no saved blocks, we will not be able to create valid frames
if len(s.blocks) == 0 {
return nil, txID{}, io.EOF
}
// Select range of blocks
end := len(s.blocks)
if end > 100 {
end = 100
}
blocks := s.blocks[:end]
s.blocks = s.blocks[end:]
chID, frames, leftOverBlocks, err := blocksToFrames(blocks, 120_000)
// If the range of blocks serialized to be too large, restore
// blocks that could not be included inside the channel
if len(leftOverBlocks) != 0 {
s.blocks = append(leftOverBlocks, s.blocks...)
}
// TODO: Ensure that len(frames) < math.MaxUint16. Should not happen though. One tricky part
// is ensuring that s.blocks is properly restored.
if err != nil {
s.log.Warn("Failed to create channel from blocks", "err", err)
return nil, txID{}, err
}
s.log.Info("Created channel", "chID", chID, "frame_count", len(frames), "l1Head", l1Head)
var t []taggedData
for i, data := range frames {
t = append(t, taggedData{data: data, id: txID{chID: chID, frameNumber: uint16(i)}})
}
// Load up pending state. Note: pending transactions is taken care of by nextTxData
s.datas = t
s.pendingChannel = chID
s.pendingBlocks = blocks[:len(leftOverBlocks)]
return s.nextTxData()
r := s.datas[0]
s.datas = s.datas[1:]
return r.data, r.id, nil
} }
// AddL2Block saves an L2 block to the internal state. It returns ErrReorg // AddL2Block saves an L2 block to the internal state. It returns ErrReorg
// if the block does not extend the last block loaded into the state. // if the block does not extend the last block loaded into the state.
// If no block is already in the channel, the the parent hash check is skipped. // If no block is already in the channel, the the parent hash check is skipped.
// TODO: Phantom last block b/c if the local state is fully drained we can reorg without realizing it.
func (s *channelManager) AddL2Block(block *types.Block) error { func (s *channelManager) AddL2Block(block *types.Block) error {
if len(s.blocks) > 0 { if len(s.blocks) > 0 {
if s.blocks[len(s.blocks)-1].Hash() != block.ParentHash() { if s.blocks[len(s.blocks)-1].Hash() != block.ParentHash() {
......
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
"sync" "sync"
"time" "time"
hdwallet "github.com/ethereum-optimism/go-ethereum-hdwallet"
"github.com/ethereum-optimism/optimism/op-batcher/sequencer" "github.com/ethereum-optimism/optimism/op-batcher/sequencer"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-proposer/txmgr" "github.com/ethereum-optimism/optimism/op-proposer/txmgr"
...@@ -18,7 +19,6 @@ import ( ...@@ -18,7 +19,6 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
hdwallet "github.com/miguelmota/go-ethereum-hdwallet"
) )
// BatchSubmitter encapsulates a service responsible for submitting L2 tx // BatchSubmitter encapsulates a service responsible for submitting L2 tx
...@@ -150,7 +150,7 @@ func NewBatchSubmitter(cfg Config, l log.Logger) (*BatchSubmitter, error) { ...@@ -150,7 +150,7 @@ func NewBatchSubmitter(cfg Config, l log.Logger) (*BatchSubmitter, error) {
txMgr: NewTransactionManger(l, txManagerConfig, batchInboxAddress, chainID, sequencerPrivKey, l1Client), txMgr: NewTransactionManger(l, txManagerConfig, batchInboxAddress, chainID, sequencerPrivKey, l1Client),
done: make(chan struct{}), done: make(chan struct{}),
log: l, log: l,
state: new(channelManager), state: NewChannelManager(l, cfg.ChannelTimeout),
// TODO: this context only exists because the even loop doesn't reach done // TODO: this context only exists because the even loop doesn't reach done
// if the tx manager is blocking forever due to e.g. insufficient balance. // if the tx manager is blocking forever due to e.g. insufficient balance.
ctx: ctx, ctx: ctx,
...@@ -234,7 +234,7 @@ func (l *BatchSubmitter) calculateL2BlockRangeToStore(ctx context.Context) (eth. ...@@ -234,7 +234,7 @@ func (l *BatchSubmitter) calculateL2BlockRangeToStore(ctx context.Context) (eth.
if l.lastStoredBlock == (eth.BlockID{}) { if l.lastStoredBlock == (eth.BlockID{}) {
l.log.Info("Starting batch-submitter work at safe-head", "safe", syncStatus.SafeL2) l.log.Info("Starting batch-submitter work at safe-head", "safe", syncStatus.SafeL2)
l.lastStoredBlock = syncStatus.SafeL2.ID() l.lastStoredBlock = syncStatus.SafeL2.ID()
} else if l.lastStoredBlock.Number <= syncStatus.SafeL2.Number { } else if l.lastStoredBlock.Number < syncStatus.SafeL2.Number {
l.log.Warn("last submitted block lagged behind L2 safe head: batch submission will continue from the safe head now", "last", l.lastStoredBlock, "safe", syncStatus.SafeL2) l.log.Warn("last submitted block lagged behind L2 safe head: batch submission will continue from the safe head now", "last", l.lastStoredBlock, "safe", syncStatus.SafeL2)
l.lastStoredBlock = syncStatus.SafeL2.ID() l.lastStoredBlock = syncStatus.SafeL2.ID()
} }
...@@ -269,18 +269,33 @@ func (l *BatchSubmitter) loop() { ...@@ -269,18 +269,33 @@ func (l *BatchSubmitter) loop() {
l.loadBlocksIntoState(l.ctx) l.loadBlocksIntoState(l.ctx)
// Empty the state after loading into it on every iteration. // Empty the state after loading into it on every iteration.
blockLoop:
for { for {
// Collect the output frame // Collect the output frame
data, _, err := l.state.TxData(eth.L1BlockRef{}) data, id, err := l.state.TxData(eth.L1BlockRef{})
if err == io.EOF { if err == io.EOF {
l.log.Trace("no transaction data available")
break // local for loop break // local for loop
} else if err != nil { } else if err != nil {
l.log.Error("unable to get tx data", "err", err) l.log.Error("unable to get tx data", "err", err)
break break
} }
// Drop receipt + error for now // Record TX Status
if _, err := l.txMgr.SendTransaction(l.ctx, data); err != nil { if receipt, err := l.txMgr.SendTransaction(l.ctx, data); err != nil {
l.log.Error("Failed to send transaction", "err", err) l.log.Error("Failed to send transaction", "err", err)
l.state.TxFailed(id)
} else {
l.log.Info("Transaction confirmed", "tx_hash", receipt.TxHash, "status", receipt.Status, "block_hash", receipt.BlockHash, "block_number", receipt.BlockNumber)
l.state.TxConfirmed(id, eth.BlockID{Number: receipt.BlockNumber.Uint64(), Hash: receipt.BlockHash})
}
// hack to exit this loop. Proper fix is to do request another send tx or parallel tx sending
// from the channel manager rather than sending the channel in a loop. This stalls b/c if the
// context is cancelled while sending, it will never fuilly clearing the pending txns.
select {
case <-l.ctx.Done():
break blockLoop
default:
} }
} }
......
...@@ -3,11 +3,11 @@ module github.com/ethereum-optimism/optimism/op-batcher ...@@ -3,11 +3,11 @@ module github.com/ethereum-optimism/optimism/op-batcher
go 1.18 go 1.18
require ( require (
github.com/ethereum-optimism/optimism/op-node v0.9.0 github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3
github.com/ethereum-optimism/optimism/op-proposer v0.9.0 github.com/ethereum-optimism/optimism/op-node v0.10.0
github.com/ethereum-optimism/optimism/op-service v0.9.0 github.com/ethereum-optimism/optimism/op-proposer v0.10.0
github.com/ethereum/go-ethereum v1.10.23 github.com/ethereum-optimism/optimism/op-service v0.10.0
github.com/miguelmota/go-ethereum-hdwallet v0.1.1 github.com/ethereum/go-ethereum v1.10.26
github.com/urfave/cli v1.22.9 github.com/urfave/cli v1.22.9
) )
...@@ -15,15 +15,15 @@ require ( ...@@ -15,15 +15,15 @@ require (
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.22.1 // indirect github.com/btcsuite/btcd v0.23.3 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/btcsuite/btcd/btcutil v1.1.0 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/ethereum-optimism/optimism/op-bindings v0.9.0 // indirect github.com/ethereum-optimism/optimism/op-bindings v0.10.0 // indirect
github.com/fjl/memsize v0.0.1 // indirect github.com/fjl/memsize v0.0.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect github.com/go-stack/stack v1.8.1 // indirect
...@@ -36,31 +36,33 @@ require ( ...@@ -36,31 +36,33 @@ require (
github.com/hashicorp/go-bexpr v0.1.11 // indirect github.com/hashicorp/go-bexpr v0.1.11 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.0 // indirect github.com/holiman/uint256 v1.2.0 // indirect
github.com/huin/goupnp v1.0.3 // indirect github.com/huin/goupnp v1.0.3 // indirect
github.com/ipfs/go-cid v0.2.0 // indirect github.com/ipfs/go-cid v0.3.2 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect github.com/klauspost/cpuid/v2 v2.1.1 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-core v0.19.1 // indirect github.com/libp2p/go-libp2p v0.23.3 // indirect
github.com/libp2p/go-libp2p-pubsub v0.7.1 // indirect github.com/libp2p/go-libp2p-pubsub v0.8.1 // indirect
github.com/libp2p/go-openssl v0.0.7 // indirect github.com/libp2p/go-openssl v0.1.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/pointerstructure v1.2.1 // indirect github.com/mitchellh/pointerstructure v1.2.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.0.4 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multiaddr v0.6.0 // indirect github.com/multiformats/go-multiaddr v0.7.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multicodec v0.5.0 // indirect github.com/multiformats/go-multicodec v0.6.0 // indirect
github.com/multiformats/go-multihash v0.2.0 // indirect github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect github.com/multiformats/go-varint v0.0.6 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
...@@ -79,16 +81,16 @@ require ( ...@@ -79,16 +81,16 @@ require (
github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect github.com/tklauser/numcpus v0.5.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/urfave/cli/v2 v2.11.1 // indirect github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 // indirect golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
google.golang.org/protobuf v1.28.1 // indirect google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
lukechampine.com/blake3 v1.1.7 // indirect lukechampine.com/blake3 v1.1.7 // indirect
) )
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be
This source diff could not be displayed because it is too large. You can view the blob instead.
package ast
import (
"regexp"
"sort"
"strconv"
"strings"
"github.com/ethereum-optimism/optimism/op-bindings/solc"
)
var remapTypeRe = regexp.MustCompile(`^(t_[\w_]+\([\w]+\))([\d]+)(_[\w]+)?$`)
// CanonicalizeASTIDs canonicalizes AST IDs in storage layouts so that they
// don't cause unnecessary conflicts/diffs. The implementation is not
// particularly efficient, but is plenty fast enough for our purposes.
// It works in two passes:
//
// 1. First, it finds all AST IDs in storage and types, and builds a
// map to replace them in the second pass.
// 2. The second pass performs the replacement.
//
// This function returns a copy of the passed-in storage layout. The
// inefficiency comes from replaceType, which performs a linear
// search of all replacements when performing substring matches of
// composite types.
func CanonicalizeASTIDs(in *solc.StorageLayout) *solc.StorageLayout {
lastId := uint(1000)
astIDRemappings := make(map[uint]uint)
typeRemappings := make(map[string]string)
for _, slot := range in.Storage {
astIDRemappings[slot.AstId] = lastId
lastId++
}
// Go map iteration order is random, so we need to sort
// keys here in order to prevent non-determinism.
var sortedOldTypes sort.StringSlice
for oldType := range in.Types {
sortedOldTypes = append(sortedOldTypes, oldType)
}
sortedOldTypes.Sort()
for _, oldType := range sortedOldTypes {
matches := remapTypeRe.FindAllStringSubmatch(oldType, -1)
if len(matches) == 0 {
continue
}
replaceAstID := matches[0][2]
newType := strings.Replace(oldType, replaceAstID, strconv.Itoa(int(lastId)), 1)
typeRemappings[oldType] = newType
lastId++
}
outLayout := &solc.StorageLayout{
Types: make(map[string]solc.StorageLayoutType),
}
for _, slot := range in.Storage {
outLayout.Storage = append(outLayout.Storage, solc.StorageLayoutEntry{
AstId: astIDRemappings[slot.AstId],
Contract: slot.Contract,
Label: slot.Label,
Offset: slot.Offset,
Slot: slot.Slot,
Type: replaceType(typeRemappings, slot.Type),
})
}
for _, oldType := range sortedOldTypes {
value := in.Types[oldType]
newType := replaceType(typeRemappings, oldType)
outLayout.Types[newType] = solc.StorageLayoutType{
Encoding: value.Encoding,
Label: value.Label,
NumberOfBytes: value.NumberOfBytes,
Key: replaceType(typeRemappings, value.Key),
Value: replaceType(typeRemappings, value.Value),
}
}
return outLayout
}
func replaceType(typeRemappings map[string]string, in string) string {
if typeRemappings[in] != "" {
return typeRemappings[in]
}
for oldType, newType := range typeRemappings {
if strings.Contains(in, oldType) {
return strings.Replace(in, oldType, newType, 1)
}
}
return in
}
package ast
import (
"encoding/json"
"os"
"path"
"testing"
"github.com/ethereum-optimism/optimism/op-bindings/solc"
"github.com/stretchr/testify/require"
)
type astIDTest struct {
In *solc.StorageLayout `json:"in"`
Out *solc.StorageLayout `json:"out"`
}
func TestCanonicalize(t *testing.T) {
tests := []struct {
name string
filename string
}{
{
"simple",
"simple.json",
},
{
"remap public variables",
"public-variables.json",
},
{
"values in storage",
"values-in-storage.json",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
f, err := os.Open(path.Join("testdata", tt.filename))
require.NoError(t, err)
dec := json.NewDecoder(f)
var testData astIDTest
require.NoError(t, dec.Decode(&testData))
require.NoError(t, f.Close())
// Run 100 times to make sure that we aren't relying
// on random map iteration order.
for i := 0; i < 100; i++ {
require.Equal(t, testData.Out, CanonicalizeASTIDs(testData.In))
}
})
}
}
{
"in": {
"storage": [
{
"astId": 37343,
"contract": "contracts/universal/ProxyAdmin.sol:ProxyAdmin",
"label": "owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 27905,
"contract": "contracts/universal/ProxyAdmin.sol:ProxyAdmin",
"label": "proxyType",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_enum(ProxyType)27899)"
},
{
"astId": 27910,
"contract": "contracts/universal/ProxyAdmin.sol:ProxyAdmin",
"label": "implementationName",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_address,t_string_storage)"
},
{
"astId": 27914,
"contract": "contracts/universal/ProxyAdmin.sol:ProxyAdmin",
"label": "addressManager",
"offset": 0,
"slot": "3",
"type": "t_contract(AddressManager)4431"
},
{
"astId": 27918,
"contract": "contracts/universal/ProxyAdmin.sol:ProxyAdmin",
"label": "upgrading",
"offset": 20,
"slot": "3",
"type": "t_bool"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_contract(AddressManager)4431": {
"encoding": "inplace",
"label": "contract AddressManager",
"numberOfBytes": "20"
},
"t_enum(ProxyType)27899": {
"encoding": "inplace",
"label": "enum ProxyAdmin.ProxyType",
"numberOfBytes": "1"
},
"t_mapping(t_address,t_enum(ProxyType)27899)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => enum ProxyAdmin.ProxyType)",
"numberOfBytes": "32",
"value": "t_enum(ProxyType)27899"
},
"t_mapping(t_address,t_string_storage)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => string)",
"numberOfBytes": "32",
"value": "t_string_storage"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
}
}
},
"out": {
"storage": [
{
"astId": 1000,
"contract": "contracts/universal/ProxyAdmin.sol:ProxyAdmin",
"label": "owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 1001,
"contract": "contracts/universal/ProxyAdmin.sol:ProxyAdmin",
"label": "proxyType",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_enum(ProxyType)1006)"
},
{
"astId": 1002,
"contract": "contracts/universal/ProxyAdmin.sol:ProxyAdmin",
"label": "implementationName",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_address,t_string_storage)"
},
{
"astId": 1003,
"contract": "contracts/universal/ProxyAdmin.sol:ProxyAdmin",
"label": "addressManager",
"offset": 0,
"slot": "3",
"type": "t_contract(AddressManager)1005"
},
{
"astId": 1004,
"contract": "contracts/universal/ProxyAdmin.sol:ProxyAdmin",
"label": "upgrading",
"offset": 20,
"slot": "3",
"type": "t_bool"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_contract(AddressManager)1005": {
"encoding": "inplace",
"label": "contract AddressManager",
"numberOfBytes": "20"
},
"t_enum(ProxyType)1006": {
"encoding": "inplace",
"label": "enum ProxyAdmin.ProxyType",
"numberOfBytes": "1"
},
"t_mapping(t_address,t_enum(ProxyType)1006)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => enum ProxyAdmin.ProxyType)",
"numberOfBytes": "32",
"value": "t_enum(ProxyType)1006"
},
"t_mapping(t_address,t_string_storage)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => string)",
"numberOfBytes": "32",
"value": "t_string_storage"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
{
"in": {
"storage": [
{
"astId": 2533,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "number",
"offset": 0,
"slot": "0",
"type": "t_uint64"
},
{
"astId": 2536,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "timestamp",
"offset": 8,
"slot": "0",
"type": "t_uint64"
},
{
"astId": 2539,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "basefee",
"offset": 0,
"slot": "1",
"type": "t_uint256"
},
{
"astId": 2542,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "hash",
"offset": 0,
"slot": "2",
"type": "t_bytes32"
},
{
"astId": 2545,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "sequenceNumber",
"offset": 0,
"slot": "3",
"type": "t_uint64"
},
{
"astId": 2548,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "batcherHash",
"offset": 0,
"slot": "4",
"type": "t_bytes32"
},
{
"astId": 2551,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "l1FeeOverhead",
"offset": 0,
"slot": "5",
"type": "t_uint256"
},
{
"astId": 2554,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "l1FeeScalar",
"offset": 0,
"slot": "6",
"type": "t_uint256"
}
],
"types": {
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint64": {
"encoding": "inplace",
"label": "uint64",
"numberOfBytes": "8"
}
}
},
"out": {
"storage": [
{
"astId": 1000,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "number",
"offset": 0,
"slot": "0",
"type": "t_uint64"
},
{
"astId": 1001,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "timestamp",
"offset": 8,
"slot": "0",
"type": "t_uint64"
},
{
"astId": 1002,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "basefee",
"offset": 0,
"slot": "1",
"type": "t_uint256"
},
{
"astId": 1003,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "hash",
"offset": 0,
"slot": "2",
"type": "t_bytes32"
},
{
"astId": 1004,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "sequenceNumber",
"offset": 0,
"slot": "3",
"type": "t_uint64"
},
{
"astId": 1005,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "batcherHash",
"offset": 0,
"slot": "4",
"type": "t_bytes32"
},
{
"astId": 1006,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "l1FeeOverhead",
"offset": 0,
"slot": "5",
"type": "t_uint256"
},
{
"astId": 1007,
"contract": "contracts/L2/L1Block.sol:L1Block",
"label": "l1FeeScalar",
"offset": 0,
"slot": "6",
"type": "t_uint256"
}
],
"types": {
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint64": {
"encoding": "inplace",
"label": "uint64",
"numberOfBytes": "8"
}
}
}
}
\ No newline at end of file
{
"in": {
"storage": [
{
"astId": 1000,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_balances",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_address,t_uint256)"
},
{
"astId": 1001,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_allowances",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_mapping(t_address,t_uint256))"
},
{
"astId": 1002,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_totalSupply",
"offset": 0,
"slot": "2",
"type": "t_uint256"
},
{
"astId": 1003,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_name",
"offset": 0,
"slot": "3",
"type": "t_string_storage"
},
{
"astId": 1004,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_symbol",
"offset": 0,
"slot": "4",
"type": "t_string_storage"
},
{
"astId": 1005,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_nonces",
"offset": 0,
"slot": "5",
"type": "t_mapping(t_address,t_struct(Counter)1012_storage)"
},
{
"astId": 1006,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT",
"offset": 0,
"slot": "6",
"type": "t_bytes32"
},
{
"astId": 1007,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_delegates",
"offset": 0,
"slot": "7",
"type": "t_mapping(t_address,t_address)"
},
{
"astId": 1008,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_checkpoints",
"offset": 0,
"slot": "8",
"type": "t_mapping(t_address,t_array(t_struct(Checkpoint)1011_storage)dyn_storage)"
},
{
"astId": 1009,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_totalSupplyCheckpoints",
"offset": 0,
"slot": "9",
"type": "t_array(t_struct(Checkpoint)1011_storage)dyn_storage"
},
{
"astId": 1010,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_owner",
"offset": 0,
"slot": "10",
"type": "t_address"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_struct(Checkpoint)1011_storage)dyn_storage": {
"encoding": "dynamic_array",
"label": "struct ERC20Votes.Checkpoint[]",
"numberOfBytes": "32"
},
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_address)": {
"encoding": "mapping",
"label": "mapping(address =u003e address)",
"numberOfBytes": "32",
"key": "t_address",
"value": "t_address"
},
"t_mapping(t_address,t_array(t_struct(Checkpoint)1011_storage)dyn_storage)": {
"encoding": "mapping",
"label": "mapping(address =u003e struct ERC20Votes.Checkpoint[])",
"numberOfBytes": "32",
"key": "t_address",
"value": "t_array(t_struct(Checkpoint)1011_storage)dyn_storage"
},
"t_mapping(t_address,t_mapping(t_address,t_uint256))": {
"encoding": "mapping",
"label": "mapping(address =u003e mapping(address =u003e uint256))",
"numberOfBytes": "32",
"key": "t_address",
"value": "t_mapping(t_address,t_uint256)"
},
"t_mapping(t_address,t_struct(Counter)1012_storage)": {
"encoding": "mapping",
"label": "mapping(address =u003e struct Counters.Counter)",
"numberOfBytes": "32",
"key": "t_address",
"value": "t_struct(Counter)1012_storage"
},
"t_mapping(t_address,t_uint256)": {
"encoding": "mapping",
"label": "mapping(address =u003e uint256)",
"numberOfBytes": "32",
"key": "t_address",
"value": "t_uint256"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Checkpoint)1011_storage": {
"encoding": "inplace",
"label": "struct ERC20Votes.Checkpoint",
"numberOfBytes": "32"
},
"t_struct(Counter)1012_storage": {
"encoding": "inplace",
"label": "struct Counters.Counter",
"numberOfBytes": "32"
},
"t_uint224": {
"encoding": "inplace",
"label": "uint224",
"numberOfBytes": "28"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint32": {
"encoding": "inplace",
"label": "uint32",
"numberOfBytes": "4"
}
}
},
"out": {
"storage": [
{
"astId": 1000,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_balances",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_address,t_uint256)"
},
{
"astId": 1001,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_allowances",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_mapping(t_address,t_uint256))"
},
{
"astId": 1002,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_totalSupply",
"offset": 0,
"slot": "2",
"type": "t_uint256"
},
{
"astId": 1003,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_name",
"offset": 0,
"slot": "3",
"type": "t_string_storage"
},
{
"astId": 1004,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_symbol",
"offset": 0,
"slot": "4",
"type": "t_string_storage"
},
{
"astId": 1005,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_nonces",
"offset": 0,
"slot": "5",
"type": "t_mapping(t_address,t_struct(Counter)1012_storage)"
},
{
"astId": 1006,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT",
"offset": 0,
"slot": "6",
"type": "t_bytes32"
},
{
"astId": 1007,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_delegates",
"offset": 0,
"slot": "7",
"type": "t_mapping(t_address,t_address)"
},
{
"astId": 1008,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_checkpoints",
"offset": 0,
"slot": "8",
"type": "t_mapping(t_address,t_array(t_struct(Checkpoint)1011_storage)dyn_storage)"
},
{
"astId": 1009,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_totalSupplyCheckpoints",
"offset": 0,
"slot": "9",
"type": "t_array(t_struct(Checkpoint)1011_storage)dyn_storage"
},
{
"astId": 1010,
"contract": "contracts/L2/GovernanceToken.sol:GovernanceToken",
"label": "_owner",
"offset": 0,
"slot": "10",
"type": "t_address"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_struct(Checkpoint)1011_storage)dyn_storage": {
"encoding": "dynamic_array",
"label": "struct ERC20Votes.Checkpoint[]",
"numberOfBytes": "32"
},
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_address)": {
"encoding": "mapping",
"label": "mapping(address =u003e address)",
"numberOfBytes": "32",
"key": "t_address",
"value": "t_address"
},
"t_mapping(t_address,t_array(t_struct(Checkpoint)1011_storage)dyn_storage)": {
"encoding": "mapping",
"label": "mapping(address =u003e struct ERC20Votes.Checkpoint[])",
"numberOfBytes": "32",
"key": "t_address",
"value": "t_array(t_struct(Checkpoint)1011_storage)dyn_storage"
},
"t_mapping(t_address,t_mapping(t_address,t_uint256))": {
"encoding": "mapping",
"label": "mapping(address =u003e mapping(address =u003e uint256))",
"numberOfBytes": "32",
"key": "t_address",
"value": "t_mapping(t_address,t_uint256)"
},
"t_mapping(t_address,t_struct(Counter)1012_storage)": {
"encoding": "mapping",
"label": "mapping(address =u003e struct Counters.Counter)",
"numberOfBytes": "32",
"key": "t_address",
"value": "t_struct(Counter)1012_storage"
},
"t_mapping(t_address,t_uint256)": {
"encoding": "mapping",
"label": "mapping(address =u003e uint256)",
"numberOfBytes": "32",
"key": "t_address",
"value": "t_uint256"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Checkpoint)1011_storage": {
"encoding": "inplace",
"label": "struct ERC20Votes.Checkpoint",
"numberOfBytes": "32"
},
"t_struct(Counter)1012_storage": {
"encoding": "inplace",
"label": "struct Counters.Counter",
"numberOfBytes": "32"
},
"t_uint224": {
"encoding": "inplace",
"label": "uint224",
"numberOfBytes": "28"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint32": {
"encoding": "inplace",
"label": "uint32",
"numberOfBytes": "4"
}
}
}
}
\ No newline at end of file
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const DeployerWhitelistStorageLayoutJSON = "{\"storage\":[{\"astId\":4375,\"contract\":\"contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist\",\"label\":\"owner\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":4380,\"contract\":\"contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist\",\"label\":\"whitelist\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"}}}" const DeployerWhitelistStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist\",\"label\":\"owner\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":1001,\"contract\":\"contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist\",\"label\":\"whitelist\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"}}}"
var DeployerWhitelistStorageLayout = new(solc.StorageLayout) var DeployerWhitelistStorageLayout = new(solc.StorageLayout)
......
...@@ -30,8 +30,8 @@ var ( ...@@ -30,8 +30,8 @@ var (
// GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract. // GasPriceOracleMetaData contains all meta data concerning the GasPriceOracle contract.
var GasPriceOracleMetaData = &bind.MetaData{ var GasPriceOracleMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"decimals\",\"type\":\"uint256\"}],\"name\":\"DecimalsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"overhead\",\"type\":\"uint256\"}],\"name\":\"OverheadUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"scalar\",\"type\":\"uint256\"}],\"name\":\"ScalarUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"baseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1GasUsed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1BaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"overhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"decimals\",\"type\":\"uint256\"}],\"name\":\"DecimalsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"overhead\",\"type\":\"uint256\"}],\"name\":\"OverheadUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"scalar\",\"type\":\"uint256\"}],\"name\":\"ScalarUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"baseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1Fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"getL1GasUsed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1BaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"overhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
Bin: "0x60e060405234801561001057600080fd5b50604051610e54380380610e5483398101604081905261002f91610182565b600080600161003d33610058565b60809290925260a05260c052610052816100a8565b506101b2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100b0610126565b6001600160a01b03811661011a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61012381610058565b50565b6000546001600160a01b031633146101805760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610111565b565b60006020828403121561019457600080fd5b81516001600160a01b03811681146101ab57600080fd5b9392505050565b60805160a05160c051610c736101e160003960006103370152600061030e015260006102e50152610c736000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c8063715018a611610081578063f2fde38b1161005b578063f2fde38b14610177578063f45e65d81461018a578063fe173b971461012c57600080fd5b8063715018a6146101325780638da5cb5b1461013c578063de26c4a11461016457600080fd5b8063519b4bd3116100b2578063519b4bd31461010f57806354fd4d50146101175780636ef25c3a1461012c57600080fd5b80630c18c162146100d9578063313ce567146100f457806349948e0e146100fc575b600080fd5b6100e1610192565b6040519081526020015b60405180910390f35b6100e1600681565b6100e161010a3660046107c3565b61021c565b6100e161027d565b61011f6102de565b6040516100eb91906108c2565b486100e1565b61013a610381565b005b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100eb565b6100e16101723660046107c3565b610395565b61013a610185366004610913565b610444565b6100e1610500565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102179190610950565b905090565b60008061022883610395565b9050600061023461027d565b61023e9083610998565b9050600061024e6006600a610af7565b9050600061025a610500565b6102649084610998565b905060006102728383610b32565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b60606103097f0000000000000000000000000000000000000000000000000000000000000000610561565b6103327f0000000000000000000000000000000000000000000000000000000000000000610561565b61035b7f0000000000000000000000000000000000000000000000000000000000000000610561565b60405160200161036d93929190610b46565b604051602081830303815290604052905090565b61038961069e565b610393600061071f565b565b80516000908190815b81811015610418578481815181106103b8576103b8610bbc565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036103f8576103f1600484610beb565b9250610406565b610403601084610beb565b92505b8061041081610c03565b91505061039e565b506000610423610192565b61042d9084610beb565b905061043b81610440610beb565b95945050505050565b61044c61069e565b73ffffffffffffffffffffffffffffffffffffffff81166104f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104fd8161071f565b50565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b6060816000036105a457505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156105ce57806105b881610c03565b91506105c79050600a83610b32565b91506105a8565b60008167ffffffffffffffff8111156105e9576105e9610794565b6040519080825280601f01601f191660200182016040528015610613576020820181803683370190505b5090505b841561069657610628600183610c3b565b9150610635600a86610c52565b610640906030610beb565b60f81b81838151811061065557610655610bbc565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061068f600a86610b32565b9450610617565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610393576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104eb565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156107d557600080fd5b813567ffffffffffffffff808211156107ed57600080fd5b818401915084601f83011261080157600080fd5b81358181111561081357610813610794565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561085957610859610794565b8160405282815287602084870101111561087257600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b838110156108ad578181015183820152602001610895565b838111156108bc576000848401525b50505050565b60208152600082518060208401526108e1816040850160208701610892565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561092557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461094957600080fd5b9392505050565b60006020828403121561096257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156109d0576109d0610969565b500290565b600181815b80851115610a2e57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610a1457610a14610969565b80851615610a2157918102915b93841c93908002906109da565b509250929050565b600082610a4557506001610af1565b81610a5257506000610af1565b8160018114610a685760028114610a7257610a8e565b6001915050610af1565b60ff841115610a8357610a83610969565b50506001821b610af1565b5060208310610133831016604e8410600b8410161715610ab1575081810a610af1565b610abb83836109d5565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610aed57610aed610969565b0290505b92915050565b60006109498383610a36565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610b4157610b41610b03565b500490565b60008451610b58818460208901610892565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610b94816001850160208a01610892565b60019201918201528351610baf816002840160208801610892565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008219821115610bfe57610bfe610969565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610c3457610c34610969565b5060010190565b600082821015610c4d57610c4d610969565b500390565b600082610c6157610c61610b03565b50069056fea164736f6c634300080f000a", Bin: "0x60e060405234801561001057600080fd5b506000608081905260a052600160c05260805160a05160c051610a0161004f60003960006102c1015260006102980152600061026f0152610a016000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c806354fd4d5011610076578063de26c4a11161005b578063de26c4a114610101578063f45e65d814610114578063fe173b97146100fb57600080fd5b806354fd4d50146100e65780636ef25c3a146100fb57600080fd5b80630c18c162146100a8578063313ce567146100c357806349948e0e146100cb578063519b4bd3146100de575b600080fd5b6100b061011c565b6040519081526020015b60405180910390f35b6100b0600681565b6100b06100d9366004610587565b6101a6565b6100b0610207565b6100ee610268565b6040516100ba9190610686565b486100b0565b6100b061010f366004610587565b61030b565b6100b06103ba565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a191906106d7565b905090565b6000806101b28361030b565b905060006101be610207565b6101c8908361071f565b905060006101d86006600a61087e565b905060006101e46103ba565b6101ee908461071f565b905060006101fc83836108c0565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60606102937f000000000000000000000000000000000000000000000000000000000000000061041b565b6102bc7f000000000000000000000000000000000000000000000000000000000000000061041b565b6102e57f000000000000000000000000000000000000000000000000000000000000000061041b565b6040516020016102f7939291906108d4565b604051602081830303815290604052905090565b80516000908190815b8181101561038e5784818151811061032e5761032e61094a565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361036e57610367600484610979565b925061037c565b610379601084610979565b92505b8061038681610991565b915050610314565b50600061039961011c565b6103a39084610979565b90506103b181610440610979565b95945050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60608160000361045e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610488578061047281610991565b91506104819050600a836108c0565b9150610462565b60008167ffffffffffffffff8111156104a3576104a3610558565b6040519080825280601f01601f1916602001820160405280156104cd576020820181803683370190505b5090505b8415610550576104e26001836109c9565b91506104ef600a866109e0565b6104fa906030610979565b60f81b81838151811061050f5761050f61094a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610549600a866108c0565b94506104d1565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561059957600080fd5b813567ffffffffffffffff808211156105b157600080fd5b818401915084601f8301126105c557600080fd5b8135818111156105d7576105d7610558565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561061d5761061d610558565b8160405282815287602084870101111561063657600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b83811015610671578181015183820152602001610659565b83811115610680576000848401525b50505050565b60208152600082518060208401526106a5816040850160208701610656565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156106e957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610757576107576106f0565b500290565b600181815b808511156107b557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561079b5761079b6106f0565b808516156107a857918102915b93841c9390800290610761565b509250929050565b6000826107cc57506001610878565b816107d957506000610878565b81600181146107ef57600281146107f957610815565b6001915050610878565b60ff84111561080a5761080a6106f0565b50506001821b610878565b5060208310610133831016604e8410600b8410161715610838575081810a610878565b610842838361075c565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610874576108746106f0565b0290505b92915050565b600061088a83836107bd565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826108cf576108cf610891565b500490565b600084516108e6818460208901610656565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610922816001850160208a01610656565b6001920191820152835161093d816002840160208801610656565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000821982111561098c5761098c6106f0565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109c2576109c26106f0565b5060010190565b6000828210156109db576109db6106f0565b500390565b6000826109ef576109ef610891565b50069056fea164736f6c634300080f000a",
} }
// GasPriceOracleABI is the input ABI used to generate the binding from. // GasPriceOracleABI is the input ABI used to generate the binding from.
...@@ -43,7 +43,7 @@ var GasPriceOracleABI = GasPriceOracleMetaData.ABI ...@@ -43,7 +43,7 @@ var GasPriceOracleABI = GasPriceOracleMetaData.ABI
var GasPriceOracleBin = GasPriceOracleMetaData.Bin var GasPriceOracleBin = GasPriceOracleMetaData.Bin
// DeployGasPriceOracle deploys a new Ethereum contract, binding an instance of GasPriceOracle to it. // DeployGasPriceOracle deploys a new Ethereum contract, binding an instance of GasPriceOracle to it.
func DeployGasPriceOracle(auth *bind.TransactOpts, backend bind.ContractBackend, _owner common.Address) (common.Address, *types.Transaction, *GasPriceOracle, error) { func DeployGasPriceOracle(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *GasPriceOracle, error) {
parsed, err := GasPriceOracleMetaData.GetAbi() parsed, err := GasPriceOracleMetaData.GetAbi()
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
...@@ -52,7 +52,7 @@ func DeployGasPriceOracle(auth *bind.TransactOpts, backend bind.ContractBackend, ...@@ -52,7 +52,7 @@ func DeployGasPriceOracle(auth *bind.TransactOpts, backend bind.ContractBackend,
return common.Address{}, nil, nil, errors.New("GetABI returned nil") return common.Address{}, nil, nil, errors.New("GetABI returned nil")
} }
address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(GasPriceOracleBin), backend, _owner) address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(GasPriceOracleBin), backend)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
} }
...@@ -418,37 +418,6 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) Overhead() (*big.Int, error) ...@@ -418,37 +418,6 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) Overhead() (*big.Int, error)
return _GasPriceOracle.Contract.Overhead(&_GasPriceOracle.CallOpts) return _GasPriceOracle.Contract.Overhead(&_GasPriceOracle.CallOpts)
} }
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_GasPriceOracle *GasPriceOracleCaller) Owner(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _GasPriceOracle.contract.Call(opts, &out, "owner")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_GasPriceOracle *GasPriceOracleSession) Owner() (common.Address, error) {
return _GasPriceOracle.Contract.Owner(&_GasPriceOracle.CallOpts)
}
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_GasPriceOracle *GasPriceOracleCallerSession) Owner() (common.Address, error) {
return _GasPriceOracle.Contract.Owner(&_GasPriceOracle.CallOpts)
}
// Scalar is a free data retrieval call binding the contract method 0xf45e65d8. // Scalar is a free data retrieval call binding the contract method 0xf45e65d8.
// //
// Solidity: function scalar() view returns(uint256) // Solidity: function scalar() view returns(uint256)
...@@ -511,48 +480,6 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) Version() (string, error) { ...@@ -511,48 +480,6 @@ func (_GasPriceOracle *GasPriceOracleCallerSession) Version() (string, error) {
return _GasPriceOracle.Contract.Version(&_GasPriceOracle.CallOpts) return _GasPriceOracle.Contract.Version(&_GasPriceOracle.CallOpts)
} }
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_GasPriceOracle *GasPriceOracleTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) {
return _GasPriceOracle.contract.Transact(opts, "renounceOwnership")
}
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_GasPriceOracle *GasPriceOracleSession) RenounceOwnership() (*types.Transaction, error) {
return _GasPriceOracle.Contract.RenounceOwnership(&_GasPriceOracle.TransactOpts)
}
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_GasPriceOracle *GasPriceOracleTransactorSession) RenounceOwnership() (*types.Transaction, error) {
return _GasPriceOracle.Contract.RenounceOwnership(&_GasPriceOracle.TransactOpts)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_GasPriceOracle *GasPriceOracleTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {
return _GasPriceOracle.contract.Transact(opts, "transferOwnership", newOwner)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_GasPriceOracle *GasPriceOracleSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
return _GasPriceOracle.Contract.TransferOwnership(&_GasPriceOracle.TransactOpts, newOwner)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_GasPriceOracle *GasPriceOracleTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
return _GasPriceOracle.Contract.TransferOwnership(&_GasPriceOracle.TransactOpts, newOwner)
}
// GasPriceOracleDecimalsUpdatedIterator is returned from FilterDecimalsUpdated and is used to iterate over the raw logs and unpacked data for DecimalsUpdated events raised by the GasPriceOracle contract. // GasPriceOracleDecimalsUpdatedIterator is returned from FilterDecimalsUpdated and is used to iterate over the raw logs and unpacked data for DecimalsUpdated events raised by the GasPriceOracle contract.
type GasPriceOracleDecimalsUpdatedIterator struct { type GasPriceOracleDecimalsUpdatedIterator struct {
Event *GasPriceOracleDecimalsUpdated // Event containing the contract specifics and raw log Event *GasPriceOracleDecimalsUpdated // Event containing the contract specifics and raw log
...@@ -821,159 +748,6 @@ func (_GasPriceOracle *GasPriceOracleFilterer) ParseOverheadUpdated(log types.Lo ...@@ -821,159 +748,6 @@ func (_GasPriceOracle *GasPriceOracleFilterer) ParseOverheadUpdated(log types.Lo
return event, nil return event, nil
} }
// GasPriceOracleOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the GasPriceOracle contract.
type GasPriceOracleOwnershipTransferredIterator struct {
Event *GasPriceOracleOwnershipTransferred // Event containing the contract specifics and raw log
contract *bind.BoundContract // Generic contract to use for unpacking event data
event string // Event name to use for unpacking event data
logs chan types.Log // Log channel receiving the found contract events
sub ethereum.Subscription // Subscription for errors, completion and termination
done bool // Whether the subscription completed delivering logs
fail error // Occurred error to stop iteration
}
// Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure.
func (it *GasPriceOracleOwnershipTransferredIterator) Next() bool {
// If the iterator failed, stop iterating
if it.fail != nil {
return false
}
// If the iterator completed, deliver directly whatever's available
if it.done {
select {
case log := <-it.logs:
it.Event = new(GasPriceOracleOwnershipTransferred)
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
it.fail = err
return false
}
it.Event.Raw = log
return true
default:
return false
}
}
// Iterator still in progress, wait for either a data or an error event
select {
case log := <-it.logs:
it.Event = new(GasPriceOracleOwnershipTransferred)
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
it.fail = err
return false
}
it.Event.Raw = log
return true
case err := <-it.sub.Err():
it.done = true
it.fail = err
return it.Next()
}
}
// Error returns any retrieval or parsing error occurred during filtering.
func (it *GasPriceOracleOwnershipTransferredIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *GasPriceOracleOwnershipTransferredIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// GasPriceOracleOwnershipTransferred represents a OwnershipTransferred event raised by the GasPriceOracle contract.
type GasPriceOracleOwnershipTransferred struct {
PreviousOwner common.Address
NewOwner common.Address
Raw types.Log // Blockchain specific contextual infos
}
// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
//
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
func (_GasPriceOracle *GasPriceOracleFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*GasPriceOracleOwnershipTransferredIterator, error) {
var previousOwnerRule []interface{}
for _, previousOwnerItem := range previousOwner {
previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
}
var newOwnerRule []interface{}
for _, newOwnerItem := range newOwner {
newOwnerRule = append(newOwnerRule, newOwnerItem)
}
logs, sub, err := _GasPriceOracle.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
if err != nil {
return nil, err
}
return &GasPriceOracleOwnershipTransferredIterator{contract: _GasPriceOracle.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil
}
// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
//
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
func (_GasPriceOracle *GasPriceOracleFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *GasPriceOracleOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
var previousOwnerRule []interface{}
for _, previousOwnerItem := range previousOwner {
previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
}
var newOwnerRule []interface{}
for _, newOwnerItem := range newOwner {
newOwnerRule = append(newOwnerRule, newOwnerItem)
}
logs, sub, err := _GasPriceOracle.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
if err != nil {
return nil, err
}
return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe()
for {
select {
case log := <-logs:
// New log arrived, parse the event and forward to the user
event := new(GasPriceOracleOwnershipTransferred)
if err := _GasPriceOracle.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
return err
}
event.Raw = log
select {
case sink <- event:
case err := <-sub.Err():
return err
case <-quit:
return nil
}
case err := <-sub.Err():
return err
case <-quit:
return nil
}
}
}), nil
}
// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
//
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
func (_GasPriceOracle *GasPriceOracleFilterer) ParseOwnershipTransferred(log types.Log) (*GasPriceOracleOwnershipTransferred, error) {
event := new(GasPriceOracleOwnershipTransferred)
if err := _GasPriceOracle.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// GasPriceOracleScalarUpdatedIterator is returned from FilterScalarUpdated and is used to iterate over the raw logs and unpacked data for ScalarUpdated events raised by the GasPriceOracle contract. // GasPriceOracleScalarUpdatedIterator is returned from FilterScalarUpdated and is used to iterate over the raw logs and unpacked data for ScalarUpdated events raised by the GasPriceOracle contract.
type GasPriceOracleScalarUpdatedIterator struct { type GasPriceOracleScalarUpdatedIterator struct {
Event *GasPriceOracleScalarUpdated // Event containing the contract specifics and raw log Event *GasPriceOracleScalarUpdated // Event containing the contract specifics and raw log
......
...@@ -9,11 +9,11 @@ import ( ...@@ -9,11 +9,11 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const GasPriceOracleStorageLayoutJSON = "{\"storage\":[{\"astId\":29827,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":2150,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_1_0_32\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":2153,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_2_0_32\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":2156,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_3_0_32\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_uint256\"},{\"astId\":2159,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_4_0_32\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_uint256\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const GasPriceOracleStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":1001,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_1_0_32\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":1002,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_2_0_32\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":1003,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_3_0_32\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_uint256\"},{\"astId\":1004,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_4_0_32\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_uint256\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var GasPriceOracleStorageLayout = new(solc.StorageLayout) var GasPriceOracleStorageLayout = new(solc.StorageLayout)
var GasPriceOracleDeployedBin = "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c8063715018a611610081578063f2fde38b1161005b578063f2fde38b14610177578063f45e65d81461018a578063fe173b971461012c57600080fd5b8063715018a6146101325780638da5cb5b1461013c578063de26c4a11461016457600080fd5b8063519b4bd3116100b2578063519b4bd31461010f57806354fd4d50146101175780636ef25c3a1461012c57600080fd5b80630c18c162146100d9578063313ce567146100f457806349948e0e146100fc575b600080fd5b6100e1610192565b6040519081526020015b60405180910390f35b6100e1600681565b6100e161010a3660046107c3565b61021c565b6100e161027d565b61011f6102de565b6040516100eb91906108c2565b486100e1565b61013a610381565b005b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100eb565b6100e16101723660046107c3565b610395565b61013a610185366004610913565b610444565b6100e1610500565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102179190610950565b905090565b60008061022883610395565b9050600061023461027d565b61023e9083610998565b9050600061024e6006600a610af7565b9050600061025a610500565b6102649084610998565b905060006102728383610b32565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b60606103097f0000000000000000000000000000000000000000000000000000000000000000610561565b6103327f0000000000000000000000000000000000000000000000000000000000000000610561565b61035b7f0000000000000000000000000000000000000000000000000000000000000000610561565b60405160200161036d93929190610b46565b604051602081830303815290604052905090565b61038961069e565b610393600061071f565b565b80516000908190815b81811015610418578481815181106103b8576103b8610bbc565b01602001517fff00000000000000000000000000000000000000000000000000000000000000166000036103f8576103f1600484610beb565b9250610406565b610403601084610beb565b92505b8061041081610c03565b91505061039e565b506000610423610192565b61042d9084610beb565b905061043b81610440610beb565b95945050505050565b61044c61069e565b73ffffffffffffffffffffffffffffffffffffffff81166104f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104fd8161071f565b50565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b6060816000036105a457505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156105ce57806105b881610c03565b91506105c79050600a83610b32565b91506105a8565b60008167ffffffffffffffff8111156105e9576105e9610794565b6040519080825280601f01601f191660200182016040528015610613576020820181803683370190505b5090505b841561069657610628600183610c3b565b9150610635600a86610c52565b610640906030610beb565b60f81b81838151811061065557610655610bbc565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061068f600a86610b32565b9450610617565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610393576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104eb565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156107d557600080fd5b813567ffffffffffffffff808211156107ed57600080fd5b818401915084601f83011261080157600080fd5b81358181111561081357610813610794565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561085957610859610794565b8160405282815287602084870101111561087257600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b838110156108ad578181015183820152602001610895565b838111156108bc576000848401525b50505050565b60208152600082518060208401526108e1816040850160208701610892565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561092557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461094957600080fd5b9392505050565b60006020828403121561096257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156109d0576109d0610969565b500290565b600181815b80851115610a2e57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610a1457610a14610969565b80851615610a2157918102915b93841c93908002906109da565b509250929050565b600082610a4557506001610af1565b81610a5257506000610af1565b8160018114610a685760028114610a7257610a8e565b6001915050610af1565b60ff841115610a8357610a83610969565b50506001821b610af1565b5060208310610133831016604e8410600b8410161715610ab1575081810a610af1565b610abb83836109d5565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610aed57610aed610969565b0290505b92915050565b60006109498383610a36565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610b4157610b41610b03565b500490565b60008451610b58818460208901610892565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610b94816001850160208a01610892565b60019201918201528351610baf816002840160208801610892565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008219821115610bfe57610bfe610969565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610c3457610c34610969565b5060010190565b600082821015610c4d57610c4d610969565b500390565b600082610c6157610c61610b03565b50069056fea164736f6c634300080f000a" var GasPriceOracleDeployedBin = "0x608060405234801561001057600080fd5b50600436106100a35760003560e01c806354fd4d5011610076578063de26c4a11161005b578063de26c4a114610101578063f45e65d814610114578063fe173b97146100fb57600080fd5b806354fd4d50146100e65780636ef25c3a146100fb57600080fd5b80630c18c162146100a8578063313ce567146100c357806349948e0e146100cb578063519b4bd3146100de575b600080fd5b6100b061011c565b6040519081526020015b60405180910390f35b6100b0600681565b6100b06100d9366004610587565b6101a6565b6100b0610207565b6100ee610268565b6040516100ba9190610686565b486100b0565b6100b061010f366004610587565b61030b565b6100b06103ba565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638b239f736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a191906106d7565b905090565b6000806101b28361030b565b905060006101be610207565b6101c8908361071f565b905060006101d86006600a61087e565b905060006101e46103ba565b6101ee908461071f565b905060006101fc83836108c0565b979650505050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16635cf249696040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60606102937f000000000000000000000000000000000000000000000000000000000000000061041b565b6102bc7f000000000000000000000000000000000000000000000000000000000000000061041b565b6102e57f000000000000000000000000000000000000000000000000000000000000000061041b565b6040516020016102f7939291906108d4565b604051602081830303815290604052905090565b80516000908190815b8181101561038e5784818151811061032e5761032e61094a565b01602001517fff000000000000000000000000000000000000000000000000000000000000001660000361036e57610367600484610979565b925061037c565b610379601084610979565b92505b8061038681610991565b915050610314565b50600061039961011c565b6103a39084610979565b90506103b181610440610979565b95945050505050565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16639e8c49666040518163ffffffff1660e01b8152600401602060405180830381865afa15801561017d573d6000803e3d6000fd5b60608160000361045e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610488578061047281610991565b91506104819050600a836108c0565b9150610462565b60008167ffffffffffffffff8111156104a3576104a3610558565b6040519080825280601f01601f1916602001820160405280156104cd576020820181803683370190505b5090505b8415610550576104e26001836109c9565b91506104ef600a866109e0565b6104fa906030610979565b60f81b81838151811061050f5761050f61094a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610549600a866108c0565b94506104d1565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561059957600080fd5b813567ffffffffffffffff808211156105b157600080fd5b818401915084601f8301126105c557600080fd5b8135818111156105d7576105d7610558565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561061d5761061d610558565b8160405282815287602084870101111561063657600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b83811015610671578181015183820152602001610659565b83811115610680576000848401525b50505050565b60208152600082518060208401526106a5816040850160208701610656565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156106e957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610757576107576106f0565b500290565b600181815b808511156107b557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561079b5761079b6106f0565b808516156107a857918102915b93841c9390800290610761565b509250929050565b6000826107cc57506001610878565b816107d957506000610878565b81600181146107ef57600281146107f957610815565b6001915050610878565b60ff84111561080a5761080a6106f0565b50506001821b610878565b5060208310610133831016604e8410600b8410161715610838575081810a610878565b610842838361075c565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610874576108746106f0565b0290505b92915050565b600061088a83836107bd565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826108cf576108cf610891565b500490565b600084516108e6818460208901610656565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610922816001850160208a01610656565b6001920191820152835161093d816002840160208801610656565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000821982111561098c5761098c6106f0565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109c2576109c26106f0565b5060010190565b6000828210156109db576109db6106f0565b500390565b6000826109ef576109ef610891565b50069056fea164736f6c634300080f000a"
func init() { func init() {
if err := json.Unmarshal([]byte(GasPriceOracleStorageLayoutJSON), GasPriceOracleStorageLayout); err != nil { if err := json.Unmarshal([]byte(GasPriceOracleStorageLayoutJSON), GasPriceOracleStorageLayout); err != nil {
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const GovernanceTokenStorageLayoutJSON = "{\"storage\":[{\"astId\":30177,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_balances\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":30183,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_allowances\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":30185,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_totalSupply\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":30187,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_name\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_string_storage\"},{\"astId\":30189,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_symbol\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_string_storage\"},{\"astId\":31554,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_nonces\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_mapping(t_address,t_struct(Counter)33740_storage)\"},{\"astId\":31562,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_PERMIT_TYPEHASH_DEPRECATED_SLOT\",\"offset\":0,\"slot\":\"6\",\"type\":\"t_bytes32\"},{\"astId\":30895,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_delegates\",\"offset\":0,\"slot\":\"7\",\"type\":\"t_mapping(t_address,t_address)\"},{\"astId\":30901,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_checkpoints\",\"offset\":0,\"slot\":\"8\",\"type\":\"t_mapping(t_address,t_array(t_struct(Checkpoint)30886_storage)dyn_storage)\"},{\"astId\":30905,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_totalSupplyCheckpoints\",\"offset\":0,\"slot\":\"9\",\"type\":\"t_array(t_struct(Checkpoint)30886_storage)dyn_storage\"},{\"astId\":29827,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"10\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_struct(Checkpoint)30886_storage)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"struct ERC20Votes.Checkpoint[]\",\"numberOfBytes\":\"32\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_address,t_address)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e address)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_address\"},\"t_mapping(t_address,t_array(t_struct(Checkpoint)30886_storage)dyn_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct ERC20Votes.Checkpoint[])\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_array(t_struct(Checkpoint)30886_storage)dyn_storage\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_struct(Counter)33740_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct Counters.Counter)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(Counter)33740_storage\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"},\"t_struct(Checkpoint)30886_storage\":{\"encoding\":\"inplace\",\"label\":\"struct ERC20Votes.Checkpoint\",\"numberOfBytes\":\"32\"},\"t_struct(Counter)33740_storage\":{\"encoding\":\"inplace\",\"label\":\"struct Counters.Counter\",\"numberOfBytes\":\"32\"},\"t_uint224\":{\"encoding\":\"inplace\",\"label\":\"uint224\",\"numberOfBytes\":\"28\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint32\":{\"encoding\":\"inplace\",\"label\":\"uint32\",\"numberOfBytes\":\"4\"}}}" const GovernanceTokenStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_balances\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":1001,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_allowances\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":1002,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_totalSupply\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":1003,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_name\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_string_storage\"},{\"astId\":1004,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_symbol\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_string_storage\"},{\"astId\":1005,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_nonces\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_mapping(t_address,t_struct(Counter)1012_storage)\"},{\"astId\":1006,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_PERMIT_TYPEHASH_DEPRECATED_SLOT\",\"offset\":0,\"slot\":\"6\",\"type\":\"t_bytes32\"},{\"astId\":1007,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_delegates\",\"offset\":0,\"slot\":\"7\",\"type\":\"t_mapping(t_address,t_address)\"},{\"astId\":1008,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_checkpoints\",\"offset\":0,\"slot\":\"8\",\"type\":\"t_mapping(t_address,t_array(t_struct(Checkpoint)1011_storage)dyn_storage)\"},{\"astId\":1009,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_totalSupplyCheckpoints\",\"offset\":0,\"slot\":\"9\",\"type\":\"t_array(t_struct(Checkpoint)1011_storage)dyn_storage\"},{\"astId\":1010,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"10\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_struct(Checkpoint)1011_storage)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"struct ERC20Votes.Checkpoint[]\",\"numberOfBytes\":\"32\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_address,t_address)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e address)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_address\"},\"t_mapping(t_address,t_array(t_struct(Checkpoint)1011_storage)dyn_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct ERC20Votes.Checkpoint[])\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_array(t_struct(Checkpoint)1011_storage)dyn_storage\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_struct(Counter)1012_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct Counters.Counter)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(Counter)1012_storage\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"},\"t_struct(Checkpoint)1011_storage\":{\"encoding\":\"inplace\",\"label\":\"struct ERC20Votes.Checkpoint\",\"numberOfBytes\":\"32\"},\"t_struct(Counter)1012_storage\":{\"encoding\":\"inplace\",\"label\":\"struct Counters.Counter\",\"numberOfBytes\":\"32\"},\"t_uint224\":{\"encoding\":\"inplace\",\"label\":\"uint224\",\"numberOfBytes\":\"28\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint32\":{\"encoding\":\"inplace\",\"label\":\"uint32\",\"numberOfBytes\":\"4\"}}}"
var GovernanceTokenStorageLayout = new(solc.StorageLayout) var GovernanceTokenStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L1BlockStorageLayoutJSON = "{\"storage\":[{\"astId\":2477,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"number\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint64\"},{\"astId\":2480,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"timestamp\",\"offset\":8,\"slot\":\"0\",\"type\":\"t_uint64\"},{\"astId\":2483,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"basefee\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":2486,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"hash\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_bytes32\"},{\"astId\":2489,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"sequenceNumber\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_uint64\"},{\"astId\":2492,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"batcherHash\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_bytes32\"},{\"astId\":2495,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"l1FeeOverhead\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_uint256\"},{\"astId\":2498,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"l1FeeScalar\",\"offset\":0,\"slot\":\"6\",\"type\":\"t_uint256\"}],\"types\":{\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"}}}" const L1BlockStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"number\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint64\"},{\"astId\":1001,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"timestamp\",\"offset\":8,\"slot\":\"0\",\"type\":\"t_uint64\"},{\"astId\":1002,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"basefee\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":1003,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"hash\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_bytes32\"},{\"astId\":1004,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"sequenceNumber\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_uint64\"},{\"astId\":1005,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"batcherHash\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_bytes32\"},{\"astId\":1006,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"l1FeeOverhead\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_uint256\"},{\"astId\":1007,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"l1FeeScalar\",\"offset\":0,\"slot\":\"6\",\"type\":\"t_uint256\"}],\"types\":{\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"}}}"
var L1BlockStorageLayout = new(solc.StorageLayout) var L1BlockStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L1BlockNumberStorageLayoutJSON = "{\"storage\":null,\"types\":null}" const L1BlockNumberStorageLayoutJSON = "{\"storage\":null,\"types\":{}}"
var L1BlockNumberStorageLayout = new(solc.StorageLayout) var L1BlockNumberStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L1CrossDomainMessengerStorageLayoutJSON = "{\"storage\":[{\"astId\":26016,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":29204,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_initialized\",\"offset\":20,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":29207,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_initializing\",\"offset\":21,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":29818,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)50_storage\"},{\"astId\":29076,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":29196,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":29369,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_paused\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_bool\"},{\"astId\":29474,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":29489,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_status\",\"offset\":0,\"slot\":\"151\",\"type\":\"t_uint256\"},{\"astId\":29533,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"152\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":26068,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_201_0_32\",\"offset\":0,\"slot\":\"201\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":26073,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_202_0_32\",\"offset\":0,\"slot\":\"202\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":26078,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"successfulMessages\",\"offset\":0,\"slot\":\"203\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":26081,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"xDomainMsgSender\",\"offset\":0,\"slot\":\"204\",\"type\":\"t_address\"},{\"astId\":26084,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"msgNonce\",\"offset\":0,\"slot\":\"205\",\"type\":\"t_uint240\"},{\"astId\":26089,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"receivedMessages\",\"offset\":0,\"slot\":\"206\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":26094,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"207\",\"type\":\"t_array(t_uint256)42_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)42_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[42]\",\"numberOfBytes\":\"1344\"},\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)50_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_uint240\":{\"encoding\":\"inplace\",\"label\":\"uint240\",\"numberOfBytes\":\"30\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" const L1CrossDomainMessengerStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":1001,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_initialized\",\"offset\":20,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1002,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_initializing\",\"offset\":21,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1003,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)1019_storage\"},{\"astId\":1004,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1005,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)1018_storage\"},{\"astId\":1006,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_paused\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_bool\"},{\"astId\":1007,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_array(t_uint256)1018_storage\"},{\"astId\":1008,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_status\",\"offset\":0,\"slot\":\"151\",\"type\":\"t_uint256\"},{\"astId\":1009,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"152\",\"type\":\"t_array(t_uint256)1018_storage\"},{\"astId\":1010,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_201_0_32\",\"offset\":0,\"slot\":\"201\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1011,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_202_0_32\",\"offset\":0,\"slot\":\"202\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1012,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"successfulMessages\",\"offset\":0,\"slot\":\"203\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1013,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"xDomainMsgSender\",\"offset\":0,\"slot\":\"204\",\"type\":\"t_address\"},{\"astId\":1014,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"msgNonce\",\"offset\":0,\"slot\":\"205\",\"type\":\"t_uint240\"},{\"astId\":1015,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"receivedMessages\",\"offset\":0,\"slot\":\"206\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1016,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"207\",\"type\":\"t_array(t_uint256)1017_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)1017_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[42]\",\"numberOfBytes\":\"1344\"},\"t_array(t_uint256)1018_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)1019_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_uint240\":{\"encoding\":\"inplace\",\"label\":\"uint240\",\"numberOfBytes\":\"30\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var L1CrossDomainMessengerStorageLayout = new(solc.StorageLayout) var L1CrossDomainMessengerStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L2CrossDomainMessengerStorageLayoutJSON = "{\"storage\":[{\"astId\":26016,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":29204,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_initialized\",\"offset\":20,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":29207,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_initializing\",\"offset\":21,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":29818,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)50_storage\"},{\"astId\":29076,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":29196,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":29369,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_paused\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_bool\"},{\"astId\":29474,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":29489,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_status\",\"offset\":0,\"slot\":\"151\",\"type\":\"t_uint256\"},{\"astId\":29533,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"152\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":26068,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_201_0_32\",\"offset\":0,\"slot\":\"201\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":26073,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_202_0_32\",\"offset\":0,\"slot\":\"202\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":26078,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"successfulMessages\",\"offset\":0,\"slot\":\"203\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":26081,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"xDomainMsgSender\",\"offset\":0,\"slot\":\"204\",\"type\":\"t_address\"},{\"astId\":26084,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"msgNonce\",\"offset\":0,\"slot\":\"205\",\"type\":\"t_uint240\"},{\"astId\":26089,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"receivedMessages\",\"offset\":0,\"slot\":\"206\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":26094,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"207\",\"type\":\"t_array(t_uint256)42_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)42_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[42]\",\"numberOfBytes\":\"1344\"},\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)50_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_uint240\":{\"encoding\":\"inplace\",\"label\":\"uint240\",\"numberOfBytes\":\"30\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" const L2CrossDomainMessengerStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":1001,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_initialized\",\"offset\":20,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1002,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_initializing\",\"offset\":21,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1003,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)1019_storage\"},{\"astId\":1004,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1005,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)1018_storage\"},{\"astId\":1006,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_paused\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_bool\"},{\"astId\":1007,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_array(t_uint256)1018_storage\"},{\"astId\":1008,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_status\",\"offset\":0,\"slot\":\"151\",\"type\":\"t_uint256\"},{\"astId\":1009,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"152\",\"type\":\"t_array(t_uint256)1018_storage\"},{\"astId\":1010,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_201_0_32\",\"offset\":0,\"slot\":\"201\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1011,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_202_0_32\",\"offset\":0,\"slot\":\"202\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1012,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"successfulMessages\",\"offset\":0,\"slot\":\"203\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1013,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"xDomainMsgSender\",\"offset\":0,\"slot\":\"204\",\"type\":\"t_address\"},{\"astId\":1014,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"msgNonce\",\"offset\":0,\"slot\":\"205\",\"type\":\"t_uint240\"},{\"astId\":1015,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"receivedMessages\",\"offset\":0,\"slot\":\"206\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1016,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"207\",\"type\":\"t_array(t_uint256)1017_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)1017_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[42]\",\"numberOfBytes\":\"1344\"},\"t_array(t_uint256)1018_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)1019_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_uint240\":{\"encoding\":\"inplace\",\"label\":\"uint240\",\"numberOfBytes\":\"30\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var L2CrossDomainMessengerStorageLayout = new(solc.StorageLayout) var L2CrossDomainMessengerStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L2ERC721BridgeStorageLayoutJSON = "{\"storage\":[{\"astId\":26499,\"contract\":\"contracts/L2/L2ERC721Bridge.sol:L2ERC721Bridge\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_array(t_uint256)49_storage\"}],\"types\":{\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const L2ERC721BridgeStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L2/L2ERC721Bridge.sol:L2ERC721Bridge\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_array(t_uint256)1001_storage\"}],\"types\":{\"t_array(t_uint256)1001_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var L2ERC721BridgeStorageLayout = new(solc.StorageLayout) var L2ERC721BridgeStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L2StandardBridgeStorageLayoutJSON = "{\"storage\":[{\"astId\":28367,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":28370,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"spacer_1_0_20\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_address\"},{\"astId\":28377,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"deposits\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":28382,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_array(t_uint256)47_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)47_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[47]\",\"numberOfBytes\":\"1504\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const L2StandardBridgeStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":1001,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"spacer_1_0_20\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_address\"},{\"astId\":1002,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"deposits\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":1003,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_array(t_uint256)1004_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)1004_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[47]\",\"numberOfBytes\":\"1504\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var L2StandardBridgeStorageLayout = new(solc.StorageLayout) var L2StandardBridgeStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L2ToL1MessagePasserStorageLayoutJSON = "{\"storage\":[{\"astId\":3183,\"contract\":\"contracts/L2/L2ToL1MessagePasser.sol:L2ToL1MessagePasser\",\"label\":\"sentMessages\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":3186,\"contract\":\"contracts/L2/L2ToL1MessagePasser.sol:L2ToL1MessagePasser\",\"label\":\"nonce\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"}],\"types\":{\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const L2ToL1MessagePasserStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L2/L2ToL1MessagePasser.sol:L2ToL1MessagePasser\",\"label\":\"sentMessages\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":1001,\"contract\":\"contracts/L2/L2ToL1MessagePasser.sol:L2ToL1MessagePasser\",\"label\":\"nonce\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"}],\"types\":{\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var L2ToL1MessagePasserStorageLayout = new(solc.StorageLayout) var L2ToL1MessagePasserStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const LegacyERC20ETHStorageLayoutJSON = "{\"storage\":[{\"astId\":30177,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_balances\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":30183,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_allowances\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":30185,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_totalSupply\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":30187,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_name\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_string_storage\"},{\"astId\":30189,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_symbol\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_string_storage\"},{\"astId\":26889,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"remoteToken\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_address\"},{\"astId\":26892,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"bridge\",\"offset\":0,\"slot\":\"6\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const LegacyERC20ETHStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_balances\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":1001,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_allowances\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":1002,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_totalSupply\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":1003,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_name\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_string_storage\"},{\"astId\":1004,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_symbol\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_string_storage\"},{\"astId\":1005,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"remoteToken\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_address\"},{\"astId\":1006,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"bridge\",\"offset\":0,\"slot\":\"6\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var LegacyERC20ETHStorageLayout = new(solc.StorageLayout) var LegacyERC20ETHStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const LegacyMessagePasserStorageLayoutJSON = "{\"storage\":[{\"astId\":5018,\"contract\":\"contracts/legacy/LegacyMessagePasser.sol:LegacyMessagePasser\",\"label\":\"sentMessages\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_bytes32,t_bool)\"}],\"types\":{\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"}}}" const LegacyMessagePasserStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/legacy/LegacyMessagePasser.sol:LegacyMessagePasser\",\"label\":\"sentMessages\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_bytes32,t_bool)\"}],\"types\":{\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"}}}"
var LegacyMessagePasserStorageLayout = new(solc.StorageLayout) var LegacyMessagePasserStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const OptimismMintableERC20FactoryStorageLayoutJSON = "{\"storage\":null,\"types\":null}" const OptimismMintableERC20FactoryStorageLayoutJSON = "{\"storage\":null,\"types\":{}}"
var OptimismMintableERC20FactoryStorageLayout = new(solc.StorageLayout) var OptimismMintableERC20FactoryStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const OptimismMintableERC721FactoryStorageLayoutJSON = "{\"storage\":[{\"astId\":27439,\"contract\":\"contracts/universal/OptimismMintableERC721Factory.sol:OptimismMintableERC721Factory\",\"label\":\"isOptimismMintableERC721\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"}}}" const OptimismMintableERC721FactoryStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/universal/OptimismMintableERC721Factory.sol:OptimismMintableERC721Factory\",\"label\":\"isOptimismMintableERC721\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"}}}"
var OptimismMintableERC721FactoryStorageLayout = new(solc.StorageLayout) var OptimismMintableERC721FactoryStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const OptimismPortalStorageLayoutJSON = "{\"storage\":[{\"astId\":30017,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":30020,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1618,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"params\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_struct(ResourceParams)1588_storage\"},{\"astId\":1623,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_array(t_uint256)48_storage\"},{\"astId\":1189,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"l2Sender\",\"offset\":0,\"slot\":\"50\",\"type\":\"t_address\"},{\"astId\":1202,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"finalizedWithdrawals\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_mapping(t_bytes32,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)48_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[48]\",\"numberOfBytes\":\"1536\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_struct(ResourceParams)1588_storage\":{\"encoding\":\"inplace\",\"label\":\"struct ResourceMetering.ResourceParams\",\"numberOfBytes\":\"32\"},\"t_uint128\":{\"encoding\":\"inplace\",\"label\":\"uint128\",\"numberOfBytes\":\"16\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" const OptimismPortalStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"params\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_struct(ResourceParams)1007_storage\"},{\"astId\":1003,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_array(t_uint256)1006_storage\"},{\"astId\":1004,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"l2Sender\",\"offset\":0,\"slot\":\"50\",\"type\":\"t_address\"},{\"astId\":1005,\"contract\":\"contracts/L1/OptimismPortal.sol:OptimismPortal\",\"label\":\"finalizedWithdrawals\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_mapping(t_bytes32,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)1006_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[48]\",\"numberOfBytes\":\"1536\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_struct(ResourceParams)1007_storage\":{\"encoding\":\"inplace\",\"label\":\"struct ResourceMetering.ResourceParams\",\"numberOfBytes\":\"32\"},\"t_uint128\":{\"encoding\":\"inplace\",\"label\":\"uint128\",\"numberOfBytes\":\"16\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var OptimismPortalStorageLayout = new(solc.StorageLayout) var OptimismPortalStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const ProxyStorageLayoutJSON = "{\"storage\":null,\"types\":null}" const ProxyStorageLayoutJSON = "{\"storage\":null,\"types\":{}}"
var ProxyStorageLayout = new(solc.StorageLayout) var ProxyStorageLayout = new(solc.StorageLayout)
......
...@@ -30,8 +30,8 @@ var ( ...@@ -30,8 +30,8 @@ var (
// ProxyAdminMetaData contains all meta data concerning the ProxyAdmin contract. // ProxyAdminMetaData contains all meta data concerning the ProxyAdmin contract.
var ProxyAdminMetaData = &bind.MetaData{ var ProxyAdminMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnerUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"contractAddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_proxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newAdmin\",\"type\":\"address\"}],\"name\":\"changeProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_proxy\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_proxy\",\"type\":\"address\"}],\"name\":\"getProxyImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"implementationName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUpgrading\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"proxyType\",\"outputs\":[{\"internalType\":\"enumProxyAdmin.ProxyType\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAddressManager\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"setImplementationName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"enumProxyAdmin.ProxyType\",\"name\":\"_type\",\"type\":\"uint8\"}],\"name\":\"setProxyType\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_upgrading\",\"type\":\"bool\"}],\"name\":\"setUpgrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_proxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"upgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_proxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"upgradeAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"contractAddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_proxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newAdmin\",\"type\":\"address\"}],\"name\":\"changeProxyAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_proxy\",\"type\":\"address\"}],\"name\":\"getProxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_proxy\",\"type\":\"address\"}],\"name\":\"getProxyImplementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"implementationName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUpgrading\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"proxyType\",\"outputs\":[{\"internalType\":\"enumProxyAdmin.ProxyType\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractAddressManager\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"setImplementationName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"enumProxyAdmin.ProxyType\",\"name\":\"_type\",\"type\":\"uint8\"}],\"name\":\"setProxyType\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_upgrading\",\"type\":\"bool\"}],\"name\":\"setUpgrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_proxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"upgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_proxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"upgradeAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]",
Bin: "0x60806040526003805460ff60a01b1916905534801561001d57600080fd5b50604051611d13380380611d1383398101604081905261003c9161008b565b600080546001600160a01b0319166001600160a01b03831690811782556040518392907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a350506100bb565b60006020828403121561009d57600080fd5b81516001600160a01b03811681146100b457600080fd5b9392505050565b611c49806100ca6000396000f3fe6080604052600436106100f35760003560e01c8063860f7cda1161008a57806399a88ec41161005957806399a88ec4146102db5780639b2ea4bd146102fb578063b79472621461031b578063f3b7dead1461035657600080fd5b8063860f7cda1461025b5780638d52d4a01461027b5780638da5cb5b1461029b5780639623609d146102c857600080fd5b8063238181ae116100c6578063238181ae146101a45780633ab76e9f146101d15780636bd9f516146101fe5780637eff275e1461023b57600080fd5b80630652b57a146100f857806307c8f7b01461011a57806313af40351461013a578063204e1c7a1461015a575b600080fd5b34801561010457600080fd5b506101186101133660046114c6565b610376565b005b34801561012657600080fd5b506101186101353660046114e3565b610443565b34801561014657600080fd5b506101186101553660046114c6565b61050e565b34801561016657600080fd5b5061017a6101753660046114c6565b6105ff565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101b057600080fd5b506101c46101bf3660046114c6565b610820565b60405161019b919061157b565b3480156101dd57600080fd5b5060035461017a9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561020a57600080fd5b5061022e6102193660046114c6565b60016020526000908152604090205460ff1681565b60405161019b91906115bd565b34801561024757600080fd5b506101186102563660046115fe565b6108ba565b34801561026757600080fd5b50610118610276366004611759565b610ae6565b34801561028757600080fd5b506101186102963660046117a9565b610b96565b3480156102a757600080fd5b5060005461017a9073ffffffffffffffffffffffffffffffffffffffff1681565b6101186102d63660046117db565b610c83565b3480156102e757600080fd5b506101186102f63660046115fe565b610f13565b34801561030757600080fd5b50610118610316366004611851565b61121c565b34801561032757600080fd5b5060035474010000000000000000000000000000000000000000900460ff16604051901515815260200161019b565b34801561036257600080fd5b5061017a6103713660046114c6565b61132b565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b6003805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461058f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604081205460ff168181600281111561063b5761063b61158e565b036106b6578273ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106af9190611898565b9392505050565b60018160028111156106ca576106ca61158e565b0361071a578273ffffffffffffffffffffffffffffffffffffffff1663aaf10f426040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068b573d6000803e3d6000fd5b600281600281111561072e5761072e61158e565b036107b85760035473ffffffffffffffffffffffffffffffffffffffff8481166000908152600260205260409081902090517fbf40fac1000000000000000000000000000000000000000000000000000000008152919092169163bf40fac19161079b9190600401611902565b602060405180830381865afa15801561068b573d6000803e3d6000fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f50726f787941646d696e3a20756e6b6e6f776e2070726f78792074797065000060448201526064016103f3565b50919050565b60026020526000908152604090208054610839906118b5565b80601f0160208091040260200160405190810160405280929190818152602001828054610865906118b5565b80156108b25780601f10610887576101008083540402835291602001916108b2565b820191906000526020600020905b81548152906001019060200180831161089557829003601f168201915b505050505081565b60005473ffffffffffffffffffffffffffffffffffffffff16331461093b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081205460ff16908160028111156109775761097761158e565b03610a03576040517f8f28397000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152841690638f283970906024015b600060405180830381600087803b1580156109e657600080fd5b505af11580156109fa573d6000803e3d6000fd5b50505050505050565b6001816002811115610a1757610a1761158e565b03610a70576040517f13af403500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906313af4035906024016109cc565b6002816002811115610a8457610a8461158e565b036107b8576003546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301529091169063f2fde38b906024016109cc565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610b67576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600260205260409020610ae182826119f1565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160208190526040909120805483927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911690836002811115610c7a57610c7a61158e565b02179055505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081205460ff1690816002811115610d4057610d4061158e565b03610e06576040517f4f1ef28600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851690634f1ef286903490610d9b9087908790600401611b0b565b60006040518083038185885af1158015610db9573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610e009190810190611b42565b50610f0d565b610e108484610f13565b60008473ffffffffffffffffffffffffffffffffffffffff163484604051610e389190611bb9565b60006040518083038185875af1925050503d8060008114610e75576040519150601f19603f3d011682016040523d82523d6000602084013e610e7a565b606091505b5050905080610f0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f50726f787941646d696e3a2063616c6c20746f2070726f78792061667465722060448201527f75706772616465206661696c656400000000000000000000000000000000000060648201526084016103f3565b505b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081205460ff1690816002811115610fd057610fd061158e565b03611029576040517f3659cfe600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152841690633659cfe6906024016109cc565b600181600281111561103d5761103d61158e565b036110bc576040517f9b0b0fda0000000000000000000000000000000000000000000000000000000081527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152841690639b0b0fda906044016109cc565b60028160028111156110d0576110d061158e565b036112145773ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604081208054611105906118b5565b80601f0160208091040260200160405190810160405280929190818152602001828054611131906118b5565b801561117e5780601f106111535761010080835404028352916020019161117e565b820191906000526020600020905b81548152906001019060200180831161116157829003601f168201915b50506003546040517f9b2ea4bd00000000000000000000000000000000000000000000000000000000815294955073ffffffffffffffffffffffffffffffffffffffff1693639b2ea4bd93506111dc92508591508790600401611bd5565b600060405180830381600087803b1580156111f657600080fd5b505af115801561120a573d6000803e3d6000fd5b5050505050505050565b610ae1611c0d565b60005473ffffffffffffffffffffffffffffffffffffffff16331461129d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b6003546040517f9b2ea4bd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690639b2ea4bd906112f59085908590600401611bd5565b600060405180830381600087803b15801561130f57600080fd5b505af1158015611323573d6000803e3d6000fd5b505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604081205460ff16818160028111156113675761136761158e565b036113b7578273ffffffffffffffffffffffffffffffffffffffff1663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068b573d6000803e3d6000fd5b60018160028111156113cb576113cb61158e565b0361141b578273ffffffffffffffffffffffffffffffffffffffff1663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068b573d6000803e3d6000fd5b600281600281111561142f5761142f61158e565b036107b857600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068b573d6000803e3d6000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146114c357600080fd5b50565b6000602082840312156114d857600080fd5b81356106af816114a1565b6000602082840312156114f557600080fd5b813580151581146106af57600080fd5b60005b83811015611520578181015183820152602001611508565b83811115610f0d5750506000910152565b60008151808452611549816020860160208601611505565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006106af6020830184611531565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600383106115f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000806040838503121561161157600080fd5b823561161c816114a1565b9150602083013561162c816114a1565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156116ad576116ad611637565b604052919050565b600067ffffffffffffffff8211156116cf576116cf611637565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600061170e611709846116b5565b611666565b905082815283838301111561172257600080fd5b828260208301376000602084830101529392505050565b600082601f83011261174a57600080fd5b6106af838335602085016116fb565b6000806040838503121561176c57600080fd5b8235611777816114a1565b9150602083013567ffffffffffffffff81111561179357600080fd5b61179f85828601611739565b9150509250929050565b600080604083850312156117bc57600080fd5b82356117c7816114a1565b915060208301356003811061162c57600080fd5b6000806000606084860312156117f057600080fd5b83356117fb816114a1565b9250602084013561180b816114a1565b9150604084013567ffffffffffffffff81111561182757600080fd5b8401601f8101861361183857600080fd5b611847868235602084016116fb565b9150509250925092565b6000806040838503121561186457600080fd5b823567ffffffffffffffff81111561187b57600080fd5b61188785828601611739565b925050602083013561162c816114a1565b6000602082840312156118aa57600080fd5b81516106af816114a1565b600181811c908216806118c957607f821691505b60208210810361081a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000602080835260008454611916816118b5565b80848701526040600180841660008114611937576001811461196f5761199d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838a01528284151560051b8a0101955061199d565b896000528660002060005b858110156119955781548b820186015290830190880161197a565b8a0184019650505b509398975050505050505050565b601f821115610ae157600081815260208120601f850160051c810160208610156119d25750805b601f850160051c820191505b81811015611323578281556001016119de565b815167ffffffffffffffff811115611a0b57611a0b611637565b611a1f81611a1984546118b5565b846119ab565b602080601f831160018114611a725760008415611a3c5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555611323565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611abf57888601518255948401946001909101908401611aa0565b5085821015611afb57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000611b3a6040830184611531565b949350505050565b600060208284031215611b5457600080fd5b815167ffffffffffffffff811115611b6b57600080fd5b8201601f81018413611b7c57600080fd5b8051611b8a611709826116b5565b818152856020838501011115611b9f57600080fd5b611bb0826020830160208601611505565b95945050505050565b60008251611bcb818460208701611505565b9190910192915050565b604081526000611be86040830185611531565b905073ffffffffffffffffffffffffffffffffffffffff831660208301529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfea164736f6c634300080f000a", Bin: "0x60806040526003805460ff60a01b191690553480156200001e57600080fd5b5060405162001a6c38038062001a6c8339810160408190526200004191620000ae565b6200004c336200005e565b62000057816200005e565b50620000e0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620000c157600080fd5b81516001600160a01b0381168114620000d957600080fd5b9392505050565b61197c80620000f06000396000f3fe60806040526004361061010e5760003560e01c8063860f7cda116100a557806399a88ec411610074578063b794726211610059578063b794726214610329578063f2fde38b14610364578063f3b7dead1461038457600080fd5b806399a88ec4146102e95780639b2ea4bd1461030957600080fd5b8063860f7cda1461026b5780638d52d4a01461028b5780638da5cb5b146102ab5780639623609d146102d657600080fd5b80633ab76e9f116100e15780633ab76e9f146101cc5780636bd9f516146101f9578063715018a6146102365780637eff275e1461024b57600080fd5b80630652b57a1461011357806307c8f7b014610135578063204e1c7a14610155578063238181ae1461019f575b600080fd5b34801561011f57600080fd5b5061013361012e3660046111f9565b6103a4565b005b34801561014157600080fd5b50610133610150366004611216565b6103f3565b34801561016157600080fd5b506101756101703660046111f9565b610445565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101ab57600080fd5b506101bf6101ba3660046111f9565b61066b565b60405161019691906112ae565b3480156101d857600080fd5b506003546101759073ffffffffffffffffffffffffffffffffffffffff1681565b34801561020557600080fd5b506102296102143660046111f9565b60016020526000908152604090205460ff1681565b60405161019691906112f0565b34801561024257600080fd5b50610133610705565b34801561025757600080fd5b50610133610266366004611331565b610719565b34801561027757600080fd5b5061013361028636600461148c565b6108cc565b34801561029757600080fd5b506101336102a63660046114dc565b610903565b3480156102b757600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610175565b6101336102e436600461150e565b610977565b3480156102f557600080fd5b50610133610304366004611331565b610b8e565b34801561031557600080fd5b50610133610324366004611584565b610e1e565b34801561033557600080fd5b5060035474010000000000000000000000000000000000000000900460ff166040519015158152602001610196565b34801561037057600080fd5b5061013361037f3660046111f9565b610eb4565b34801561039057600080fd5b5061017561039f3660046111f9565b610f6b565b6103ac6110e1565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6103fb6110e1565b6003805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604081205460ff1681816002811115610481576104816112c1565b036104fc578273ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f591906115cb565b9392505050565b6001816002811115610510576105106112c1565b03610560578273ffffffffffffffffffffffffffffffffffffffff1663aaf10f426040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b6002816002811115610574576105746112c1565b036105fe5760035473ffffffffffffffffffffffffffffffffffffffff8481166000908152600260205260409081902090517fbf40fac1000000000000000000000000000000000000000000000000000000008152919092169163bf40fac1916105e19190600401611635565b602060405180830381865afa1580156104d1573d6000803e3d6000fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f50726f787941646d696e3a20756e6b6e6f776e2070726f78792074797065000060448201526064015b60405180910390fd5b50919050565b60026020526000908152604090208054610684906115e8565b80601f01602080910402602001604051908101604052809291908181526020018280546106b0906115e8565b80156106fd5780601f106106d2576101008083540402835291602001916106fd565b820191906000526020600020905b8154815290600101906020018083116106e057829003601f168201915b505050505081565b61070d6110e1565b6107176000611162565b565b6107216110e1565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081205460ff169081600281111561075d5761075d6112c1565b036107e9576040517f8f28397000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152841690638f283970906024015b600060405180830381600087803b1580156107cc57600080fd5b505af11580156107e0573d6000803e3d6000fd5b50505050505050565b60018160028111156107fd576107fd6112c1565b03610856576040517f13af403500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906313af4035906024016107b2565b600281600281111561086a5761086a6112c1565b036105fe576003546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301529091169063f2fde38b906024016107b2565b505050565b6108d46110e1565b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090206108c78282611724565b61090b6110e1565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160208190526040909120805483927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091169083600281111561096e5761096e6112c1565b02179055505050565b61097f6110e1565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081205460ff16908160028111156109bb576109bb6112c1565b03610a81576040517f4f1ef28600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851690634f1ef286903490610a16908790879060040161183e565b60006040518083038185885af1158015610a34573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610a7b9190810190611875565b50610b88565b610a8b8484610b8e565b60008473ffffffffffffffffffffffffffffffffffffffff163484604051610ab391906118ec565b60006040518083038185875af1925050503d8060008114610af0576040519150601f19603f3d011682016040523d82523d6000602084013e610af5565b606091505b5050905080610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f50726f787941646d696e3a2063616c6c20746f2070726f78792061667465722060448201527f75706772616465206661696c6564000000000000000000000000000000000000606482015260840161065c565b505b50505050565b610b966110e1565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081205460ff1690816002811115610bd257610bd26112c1565b03610c2b576040517f3659cfe600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152841690633659cfe6906024016107b2565b6001816002811115610c3f57610c3f6112c1565b03610cbe576040517f9b0b0fda0000000000000000000000000000000000000000000000000000000081527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152841690639b0b0fda906044016107b2565b6002816002811115610cd257610cd26112c1565b03610e165773ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604081208054610d07906115e8565b80601f0160208091040260200160405190810160405280929190818152602001828054610d33906115e8565b8015610d805780601f10610d5557610100808354040283529160200191610d80565b820191906000526020600020905b815481529060010190602001808311610d6357829003601f168201915b50506003546040517f9b2ea4bd00000000000000000000000000000000000000000000000000000000815294955073ffffffffffffffffffffffffffffffffffffffff1693639b2ea4bd9350610dde92508591508790600401611908565b600060405180830381600087803b158015610df857600080fd5b505af1158015610e0c573d6000803e3d6000fd5b5050505050505050565b6108c7611940565b610e266110e1565b6003546040517f9b2ea4bd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690639b2ea4bd90610e7e9085908590600401611908565b600060405180830381600087803b158015610e9857600080fd5b505af1158015610eac573d6000803e3d6000fd5b505050505050565b610ebc6110e1565b73ffffffffffffffffffffffffffffffffffffffff8116610f5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161065c565b610f6881611162565b50565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604081205460ff1681816002811115610fa757610fa76112c1565b03610ff7578273ffffffffffffffffffffffffffffffffffffffff1663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b600181600281111561100b5761100b6112c1565b0361105b578273ffffffffffffffffffffffffffffffffffffffff1663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b600281600281111561106f5761106f6112c1565b036105fe57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314610717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161065c565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff81168114610f6857600080fd5b60006020828403121561120b57600080fd5b81356104f5816111d7565b60006020828403121561122857600080fd5b813580151581146104f557600080fd5b60005b8381101561125357818101518382015260200161123b565b83811115610b885750506000910152565b6000815180845261127c816020860160208601611238565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006104f56020830184611264565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b602081016003831061132b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000806040838503121561134457600080fd5b823561134f816111d7565b9150602083013561135f816111d7565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156113e0576113e061136a565b604052919050565b600067ffffffffffffffff8211156114025761140261136a565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600061144161143c846113e8565b611399565b905082815283838301111561145557600080fd5b828260208301376000602084830101529392505050565b600082601f83011261147d57600080fd5b6104f58383356020850161142e565b6000806040838503121561149f57600080fd5b82356114aa816111d7565b9150602083013567ffffffffffffffff8111156114c657600080fd5b6114d28582860161146c565b9150509250929050565b600080604083850312156114ef57600080fd5b82356114fa816111d7565b915060208301356003811061135f57600080fd5b60008060006060848603121561152357600080fd5b833561152e816111d7565b9250602084013561153e816111d7565b9150604084013567ffffffffffffffff81111561155a57600080fd5b8401601f8101861361156b57600080fd5b61157a8682356020840161142e565b9150509250925092565b6000806040838503121561159757600080fd5b823567ffffffffffffffff8111156115ae57600080fd5b6115ba8582860161146c565b925050602083013561135f816111d7565b6000602082840312156115dd57600080fd5b81516104f5816111d7565b600181811c908216806115fc57607f821691505b602082108103610665577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000602080835260008454611649816115e8565b8084870152604060018084166000811461166a57600181146116a2576116d0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838a01528284151560051b8a010195506116d0565b896000528660002060005b858110156116c85781548b82018601529083019088016116ad565b8a0184019650505b509398975050505050505050565b601f8211156108c757600081815260208120601f850160051c810160208610156117055750805b601f850160051c820191505b81811015610eac57828155600101611711565b815167ffffffffffffffff81111561173e5761173e61136a565b6117528161174c84546115e8565b846116de565b602080601f8311600181146117a5576000841561176f5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610eac565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156117f2578886015182559484019460019091019084016117d3565b508582101561182e57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061186d6040830184611264565b949350505050565b60006020828403121561188757600080fd5b815167ffffffffffffffff81111561189e57600080fd5b8201601f810184136118af57600080fd5b80516118bd61143c826113e8565b8181528560208385010111156118d257600080fd5b6118e3826020830160208601611238565b95945050505050565b600082516118fe818460208701611238565b9190910192915050565b60408152600061191b6040830185611264565b905073ffffffffffffffffffffffffffffffffffffffff831660208301529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfea164736f6c634300080f000a",
} }
// ProxyAdminABI is the input ABI used to generate the binding from. // ProxyAdminABI is the input ABI used to generate the binding from.
...@@ -439,6 +439,27 @@ func (_ProxyAdmin *ProxyAdminTransactorSession) ChangeProxyAdmin(_proxy common.A ...@@ -439,6 +439,27 @@ func (_ProxyAdmin *ProxyAdminTransactorSession) ChangeProxyAdmin(_proxy common.A
return _ProxyAdmin.Contract.ChangeProxyAdmin(&_ProxyAdmin.TransactOpts, _proxy, _newAdmin) return _ProxyAdmin.Contract.ChangeProxyAdmin(&_ProxyAdmin.TransactOpts, _proxy, _newAdmin)
} }
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_ProxyAdmin *ProxyAdminTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) {
return _ProxyAdmin.contract.Transact(opts, "renounceOwnership")
}
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_ProxyAdmin *ProxyAdminSession) RenounceOwnership() (*types.Transaction, error) {
return _ProxyAdmin.Contract.RenounceOwnership(&_ProxyAdmin.TransactOpts)
}
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_ProxyAdmin *ProxyAdminTransactorSession) RenounceOwnership() (*types.Transaction, error) {
return _ProxyAdmin.Contract.RenounceOwnership(&_ProxyAdmin.TransactOpts)
}
// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd. // SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd.
// //
// Solidity: function setAddress(string _name, address _address) returns() // Solidity: function setAddress(string _name, address _address) returns()
...@@ -502,27 +523,6 @@ func (_ProxyAdmin *ProxyAdminTransactorSession) SetImplementationName(_address c ...@@ -502,27 +523,6 @@ func (_ProxyAdmin *ProxyAdminTransactorSession) SetImplementationName(_address c
return _ProxyAdmin.Contract.SetImplementationName(&_ProxyAdmin.TransactOpts, _address, _name) return _ProxyAdmin.Contract.SetImplementationName(&_ProxyAdmin.TransactOpts, _address, _name)
} }
// SetOwner is a paid mutator transaction binding the contract method 0x13af4035.
//
// Solidity: function setOwner(address newOwner) returns()
func (_ProxyAdmin *ProxyAdminTransactor) SetOwner(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {
return _ProxyAdmin.contract.Transact(opts, "setOwner", newOwner)
}
// SetOwner is a paid mutator transaction binding the contract method 0x13af4035.
//
// Solidity: function setOwner(address newOwner) returns()
func (_ProxyAdmin *ProxyAdminSession) SetOwner(newOwner common.Address) (*types.Transaction, error) {
return _ProxyAdmin.Contract.SetOwner(&_ProxyAdmin.TransactOpts, newOwner)
}
// SetOwner is a paid mutator transaction binding the contract method 0x13af4035.
//
// Solidity: function setOwner(address newOwner) returns()
func (_ProxyAdmin *ProxyAdminTransactorSession) SetOwner(newOwner common.Address) (*types.Transaction, error) {
return _ProxyAdmin.Contract.SetOwner(&_ProxyAdmin.TransactOpts, newOwner)
}
// SetProxyType is a paid mutator transaction binding the contract method 0x8d52d4a0. // SetProxyType is a paid mutator transaction binding the contract method 0x8d52d4a0.
// //
// Solidity: function setProxyType(address _address, uint8 _type) returns() // Solidity: function setProxyType(address _address, uint8 _type) returns()
...@@ -565,6 +565,27 @@ func (_ProxyAdmin *ProxyAdminTransactorSession) SetUpgrading(_upgrading bool) (* ...@@ -565,6 +565,27 @@ func (_ProxyAdmin *ProxyAdminTransactorSession) SetUpgrading(_upgrading bool) (*
return _ProxyAdmin.Contract.SetUpgrading(&_ProxyAdmin.TransactOpts, _upgrading) return _ProxyAdmin.Contract.SetUpgrading(&_ProxyAdmin.TransactOpts, _upgrading)
} }
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_ProxyAdmin *ProxyAdminTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {
return _ProxyAdmin.contract.Transact(opts, "transferOwnership", newOwner)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_ProxyAdmin *ProxyAdminSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
return _ProxyAdmin.Contract.TransferOwnership(&_ProxyAdmin.TransactOpts, newOwner)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_ProxyAdmin *ProxyAdminTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
return _ProxyAdmin.Contract.TransferOwnership(&_ProxyAdmin.TransactOpts, newOwner)
}
// Upgrade is a paid mutator transaction binding the contract method 0x99a88ec4. // Upgrade is a paid mutator transaction binding the contract method 0x99a88ec4.
// //
// Solidity: function upgrade(address _proxy, address _implementation) returns() // Solidity: function upgrade(address _proxy, address _implementation) returns()
...@@ -607,9 +628,9 @@ func (_ProxyAdmin *ProxyAdminTransactorSession) UpgradeAndCall(_proxy common.Add ...@@ -607,9 +628,9 @@ func (_ProxyAdmin *ProxyAdminTransactorSession) UpgradeAndCall(_proxy common.Add
return _ProxyAdmin.Contract.UpgradeAndCall(&_ProxyAdmin.TransactOpts, _proxy, _implementation, _data) return _ProxyAdmin.Contract.UpgradeAndCall(&_ProxyAdmin.TransactOpts, _proxy, _implementation, _data)
} }
// ProxyAdminOwnerUpdatedIterator is returned from FilterOwnerUpdated and is used to iterate over the raw logs and unpacked data for OwnerUpdated events raised by the ProxyAdmin contract. // ProxyAdminOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ProxyAdmin contract.
type ProxyAdminOwnerUpdatedIterator struct { type ProxyAdminOwnershipTransferredIterator struct {
Event *ProxyAdminOwnerUpdated // Event containing the contract specifics and raw log Event *ProxyAdminOwnershipTransferred // Event containing the contract specifics and raw log
contract *bind.BoundContract // Generic contract to use for unpacking event data contract *bind.BoundContract // Generic contract to use for unpacking event data
event string // Event name to use for unpacking event data event string // Event name to use for unpacking event data
...@@ -623,7 +644,7 @@ type ProxyAdminOwnerUpdatedIterator struct { ...@@ -623,7 +644,7 @@ type ProxyAdminOwnerUpdatedIterator struct {
// Next advances the iterator to the subsequent event, returning whether there // Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is // are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure. // returned and Error() can be queried for the exact failure.
func (it *ProxyAdminOwnerUpdatedIterator) Next() bool { func (it *ProxyAdminOwnershipTransferredIterator) Next() bool {
// If the iterator failed, stop iterating // If the iterator failed, stop iterating
if it.fail != nil { if it.fail != nil {
return false return false
...@@ -632,7 +653,7 @@ func (it *ProxyAdminOwnerUpdatedIterator) Next() bool { ...@@ -632,7 +653,7 @@ func (it *ProxyAdminOwnerUpdatedIterator) Next() bool {
if it.done { if it.done {
select { select {
case log := <-it.logs: case log := <-it.logs:
it.Event = new(ProxyAdminOwnerUpdated) it.Event = new(ProxyAdminOwnershipTransferred)
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
it.fail = err it.fail = err
return false return false
...@@ -647,7 +668,7 @@ func (it *ProxyAdminOwnerUpdatedIterator) Next() bool { ...@@ -647,7 +668,7 @@ func (it *ProxyAdminOwnerUpdatedIterator) Next() bool {
// Iterator still in progress, wait for either a data or an error event // Iterator still in progress, wait for either a data or an error event
select { select {
case log := <-it.logs: case log := <-it.logs:
it.Event = new(ProxyAdminOwnerUpdated) it.Event = new(ProxyAdminOwnershipTransferred)
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
it.fail = err it.fail = err
return false return false
...@@ -663,60 +684,60 @@ func (it *ProxyAdminOwnerUpdatedIterator) Next() bool { ...@@ -663,60 +684,60 @@ func (it *ProxyAdminOwnerUpdatedIterator) Next() bool {
} }
// Error returns any retrieval or parsing error occurred during filtering. // Error returns any retrieval or parsing error occurred during filtering.
func (it *ProxyAdminOwnerUpdatedIterator) Error() error { func (it *ProxyAdminOwnershipTransferredIterator) Error() error {
return it.fail return it.fail
} }
// Close terminates the iteration process, releasing any pending underlying // Close terminates the iteration process, releasing any pending underlying
// resources. // resources.
func (it *ProxyAdminOwnerUpdatedIterator) Close() error { func (it *ProxyAdminOwnershipTransferredIterator) Close() error {
it.sub.Unsubscribe() it.sub.Unsubscribe()
return nil return nil
} }
// ProxyAdminOwnerUpdated represents a OwnerUpdated event raised by the ProxyAdmin contract. // ProxyAdminOwnershipTransferred represents a OwnershipTransferred event raised by the ProxyAdmin contract.
type ProxyAdminOwnerUpdated struct { type ProxyAdminOwnershipTransferred struct {
User common.Address PreviousOwner common.Address
NewOwner common.Address NewOwner common.Address
Raw types.Log // Blockchain specific contextual infos Raw types.Log // Blockchain specific contextual infos
} }
// FilterOwnerUpdated is a free log retrieval operation binding the contract event 0x8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76. // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
// //
// Solidity: event OwnerUpdated(address indexed user, address indexed newOwner) // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
func (_ProxyAdmin *ProxyAdminFilterer) FilterOwnerUpdated(opts *bind.FilterOpts, user []common.Address, newOwner []common.Address) (*ProxyAdminOwnerUpdatedIterator, error) { func (_ProxyAdmin *ProxyAdminFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ProxyAdminOwnershipTransferredIterator, error) {
var userRule []interface{} var previousOwnerRule []interface{}
for _, userItem := range user { for _, previousOwnerItem := range previousOwner {
userRule = append(userRule, userItem) previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
} }
var newOwnerRule []interface{} var newOwnerRule []interface{}
for _, newOwnerItem := range newOwner { for _, newOwnerItem := range newOwner {
newOwnerRule = append(newOwnerRule, newOwnerItem) newOwnerRule = append(newOwnerRule, newOwnerItem)
} }
logs, sub, err := _ProxyAdmin.contract.FilterLogs(opts, "OwnerUpdated", userRule, newOwnerRule) logs, sub, err := _ProxyAdmin.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &ProxyAdminOwnerUpdatedIterator{contract: _ProxyAdmin.contract, event: "OwnerUpdated", logs: logs, sub: sub}, nil return &ProxyAdminOwnershipTransferredIterator{contract: _ProxyAdmin.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil
} }
// WatchOwnerUpdated is a free log subscription operation binding the contract event 0x8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76. // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
// //
// Solidity: event OwnerUpdated(address indexed user, address indexed newOwner) // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
func (_ProxyAdmin *ProxyAdminFilterer) WatchOwnerUpdated(opts *bind.WatchOpts, sink chan<- *ProxyAdminOwnerUpdated, user []common.Address, newOwner []common.Address) (event.Subscription, error) { func (_ProxyAdmin *ProxyAdminFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ProxyAdminOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
var userRule []interface{} var previousOwnerRule []interface{}
for _, userItem := range user { for _, previousOwnerItem := range previousOwner {
userRule = append(userRule, userItem) previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
} }
var newOwnerRule []interface{} var newOwnerRule []interface{}
for _, newOwnerItem := range newOwner { for _, newOwnerItem := range newOwner {
newOwnerRule = append(newOwnerRule, newOwnerItem) newOwnerRule = append(newOwnerRule, newOwnerItem)
} }
logs, sub, err := _ProxyAdmin.contract.WatchLogs(opts, "OwnerUpdated", userRule, newOwnerRule) logs, sub, err := _ProxyAdmin.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -726,8 +747,8 @@ func (_ProxyAdmin *ProxyAdminFilterer) WatchOwnerUpdated(opts *bind.WatchOpts, s ...@@ -726,8 +747,8 @@ func (_ProxyAdmin *ProxyAdminFilterer) WatchOwnerUpdated(opts *bind.WatchOpts, s
select { select {
case log := <-logs: case log := <-logs:
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(ProxyAdminOwnerUpdated) event := new(ProxyAdminOwnershipTransferred)
if err := _ProxyAdmin.contract.UnpackLog(event, "OwnerUpdated", log); err != nil { if err := _ProxyAdmin.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
return err return err
} }
event.Raw = log event.Raw = log
...@@ -748,12 +769,12 @@ func (_ProxyAdmin *ProxyAdminFilterer) WatchOwnerUpdated(opts *bind.WatchOpts, s ...@@ -748,12 +769,12 @@ func (_ProxyAdmin *ProxyAdminFilterer) WatchOwnerUpdated(opts *bind.WatchOpts, s
}), nil }), nil
} }
// ParseOwnerUpdated is a log parse operation binding the contract event 0x8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76. // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
// //
// Solidity: event OwnerUpdated(address indexed user, address indexed newOwner) // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
func (_ProxyAdmin *ProxyAdminFilterer) ParseOwnerUpdated(log types.Log) (*ProxyAdminOwnerUpdated, error) { func (_ProxyAdmin *ProxyAdminFilterer) ParseOwnershipTransferred(log types.Log) (*ProxyAdminOwnershipTransferred, error) {
event := new(ProxyAdminOwnerUpdated) event := new(ProxyAdminOwnershipTransferred)
if err := _ProxyAdmin.contract.UnpackLog(event, "OwnerUpdated", log); err != nil { if err := _ProxyAdmin.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
return nil, err return nil, err
} }
event.Raw = log event.Raw = log
......
...@@ -9,11 +9,11 @@ import ( ...@@ -9,11 +9,11 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const ProxyAdminStorageLayoutJSON = "{\"storage\":[{\"astId\":37277,\"contract\":\"contracts/universal/ProxyAdmin.sol:ProxyAdmin\",\"label\":\"owner\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":27839,\"contract\":\"contracts/universal/ProxyAdmin.sol:ProxyAdmin\",\"label\":\"proxyType\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_enum(ProxyType)27833)\"},{\"astId\":27844,\"contract\":\"contracts/universal/ProxyAdmin.sol:ProxyAdmin\",\"label\":\"implementationName\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_mapping(t_address,t_string_storage)\"},{\"astId\":27848,\"contract\":\"contracts/universal/ProxyAdmin.sol:ProxyAdmin\",\"label\":\"addressManager\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_contract(AddressManager)4365\"},{\"astId\":27852,\"contract\":\"contracts/universal/ProxyAdmin.sol:ProxyAdmin\",\"label\":\"upgrading\",\"offset\":20,\"slot\":\"3\",\"type\":\"t_bool\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_contract(AddressManager)4365\":{\"encoding\":\"inplace\",\"label\":\"contract AddressManager\",\"numberOfBytes\":\"20\"},\"t_enum(ProxyType)27833\":{\"encoding\":\"inplace\",\"label\":\"enum ProxyAdmin.ProxyType\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_enum(ProxyType)27833)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e enum ProxyAdmin.ProxyType)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_enum(ProxyType)27833\"},\"t_mapping(t_address,t_string_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e string)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_string_storage\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"}}}" const ProxyAdminStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/universal/ProxyAdmin.sol:ProxyAdmin\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":1001,\"contract\":\"contracts/universal/ProxyAdmin.sol:ProxyAdmin\",\"label\":\"proxyType\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_enum(ProxyType)1006)\"},{\"astId\":1002,\"contract\":\"contracts/universal/ProxyAdmin.sol:ProxyAdmin\",\"label\":\"implementationName\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_mapping(t_address,t_string_storage)\"},{\"astId\":1003,\"contract\":\"contracts/universal/ProxyAdmin.sol:ProxyAdmin\",\"label\":\"addressManager\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_contract(AddressManager)1005\"},{\"astId\":1004,\"contract\":\"contracts/universal/ProxyAdmin.sol:ProxyAdmin\",\"label\":\"upgrading\",\"offset\":20,\"slot\":\"3\",\"type\":\"t_bool\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_contract(AddressManager)1005\":{\"encoding\":\"inplace\",\"label\":\"contract AddressManager\",\"numberOfBytes\":\"20\"},\"t_enum(ProxyType)1006\":{\"encoding\":\"inplace\",\"label\":\"enum ProxyAdmin.ProxyType\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_enum(ProxyType)1006)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e enum ProxyAdmin.ProxyType)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_enum(ProxyType)1006\"},\"t_mapping(t_address,t_string_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e string)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_string_storage\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"}}}"
var ProxyAdminStorageLayout = new(solc.StorageLayout) var ProxyAdminStorageLayout = new(solc.StorageLayout)
var ProxyAdminDeployedBin = "0x6080604052600436106100f35760003560e01c8063860f7cda1161008a57806399a88ec41161005957806399a88ec4146102db5780639b2ea4bd146102fb578063b79472621461031b578063f3b7dead1461035657600080fd5b8063860f7cda1461025b5780638d52d4a01461027b5780638da5cb5b1461029b5780639623609d146102c857600080fd5b8063238181ae116100c6578063238181ae146101a45780633ab76e9f146101d15780636bd9f516146101fe5780637eff275e1461023b57600080fd5b80630652b57a146100f857806307c8f7b01461011a57806313af40351461013a578063204e1c7a1461015a575b600080fd5b34801561010457600080fd5b506101186101133660046114c6565b610376565b005b34801561012657600080fd5b506101186101353660046114e3565b610443565b34801561014657600080fd5b506101186101553660046114c6565b61050e565b34801561016657600080fd5b5061017a6101753660046114c6565b6105ff565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101b057600080fd5b506101c46101bf3660046114c6565b610820565b60405161019b919061157b565b3480156101dd57600080fd5b5060035461017a9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561020a57600080fd5b5061022e6102193660046114c6565b60016020526000908152604090205460ff1681565b60405161019b91906115bd565b34801561024757600080fd5b506101186102563660046115fe565b6108ba565b34801561026757600080fd5b50610118610276366004611759565b610ae6565b34801561028757600080fd5b506101186102963660046117a9565b610b96565b3480156102a757600080fd5b5060005461017a9073ffffffffffffffffffffffffffffffffffffffff1681565b6101186102d63660046117db565b610c83565b3480156102e757600080fd5b506101186102f63660046115fe565b610f13565b34801561030757600080fd5b50610118610316366004611851565b61121c565b34801561032757600080fd5b5060035474010000000000000000000000000000000000000000900460ff16604051901515815260200161019b565b34801561036257600080fd5b5061017a6103713660046114c6565b61132b565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b6003805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461058f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604081205460ff168181600281111561063b5761063b61158e565b036106b6578273ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106af9190611898565b9392505050565b60018160028111156106ca576106ca61158e565b0361071a578273ffffffffffffffffffffffffffffffffffffffff1663aaf10f426040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068b573d6000803e3d6000fd5b600281600281111561072e5761072e61158e565b036107b85760035473ffffffffffffffffffffffffffffffffffffffff8481166000908152600260205260409081902090517fbf40fac1000000000000000000000000000000000000000000000000000000008152919092169163bf40fac19161079b9190600401611902565b602060405180830381865afa15801561068b573d6000803e3d6000fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f50726f787941646d696e3a20756e6b6e6f776e2070726f78792074797065000060448201526064016103f3565b50919050565b60026020526000908152604090208054610839906118b5565b80601f0160208091040260200160405190810160405280929190818152602001828054610865906118b5565b80156108b25780601f10610887576101008083540402835291602001916108b2565b820191906000526020600020905b81548152906001019060200180831161089557829003601f168201915b505050505081565b60005473ffffffffffffffffffffffffffffffffffffffff16331461093b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081205460ff16908160028111156109775761097761158e565b03610a03576040517f8f28397000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152841690638f283970906024015b600060405180830381600087803b1580156109e657600080fd5b505af11580156109fa573d6000803e3d6000fd5b50505050505050565b6001816002811115610a1757610a1761158e565b03610a70576040517f13af403500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906313af4035906024016109cc565b6002816002811115610a8457610a8461158e565b036107b8576003546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301529091169063f2fde38b906024016109cc565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610b67576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600260205260409020610ae182826119f1565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160208190526040909120805483927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911690836002811115610c7a57610c7a61158e565b02179055505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081205460ff1690816002811115610d4057610d4061158e565b03610e06576040517f4f1ef28600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851690634f1ef286903490610d9b9087908790600401611b0b565b60006040518083038185885af1158015610db9573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610e009190810190611b42565b50610f0d565b610e108484610f13565b60008473ffffffffffffffffffffffffffffffffffffffff163484604051610e389190611bb9565b60006040518083038185875af1925050503d8060008114610e75576040519150601f19603f3d011682016040523d82523d6000602084013e610e7a565b606091505b5050905080610f0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f50726f787941646d696e3a2063616c6c20746f2070726f78792061667465722060448201527f75706772616465206661696c656400000000000000000000000000000000000060648201526084016103f3565b505b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081205460ff1690816002811115610fd057610fd061158e565b03611029576040517f3659cfe600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152841690633659cfe6906024016109cc565b600181600281111561103d5761103d61158e565b036110bc576040517f9b0b0fda0000000000000000000000000000000000000000000000000000000081527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152841690639b0b0fda906044016109cc565b60028160028111156110d0576110d061158e565b036112145773ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604081208054611105906118b5565b80601f0160208091040260200160405190810160405280929190818152602001828054611131906118b5565b801561117e5780601f106111535761010080835404028352916020019161117e565b820191906000526020600020905b81548152906001019060200180831161116157829003601f168201915b50506003546040517f9b2ea4bd00000000000000000000000000000000000000000000000000000000815294955073ffffffffffffffffffffffffffffffffffffffff1693639b2ea4bd93506111dc92508591508790600401611bd5565b600060405180830381600087803b1580156111f657600080fd5b505af115801561120a573d6000803e3d6000fd5b5050505050505050565b610ae1611c0d565b60005473ffffffffffffffffffffffffffffffffffffffff16331461129d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103f3565b6003546040517f9b2ea4bd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690639b2ea4bd906112f59085908590600401611bd5565b600060405180830381600087803b15801561130f57600080fd5b505af1158015611323573d6000803e3d6000fd5b505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604081205460ff16818160028111156113675761136761158e565b036113b7578273ffffffffffffffffffffffffffffffffffffffff1663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068b573d6000803e3d6000fd5b60018160028111156113cb576113cb61158e565b0361141b578273ffffffffffffffffffffffffffffffffffffffff1663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068b573d6000803e3d6000fd5b600281600281111561142f5761142f61158e565b036107b857600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068b573d6000803e3d6000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146114c357600080fd5b50565b6000602082840312156114d857600080fd5b81356106af816114a1565b6000602082840312156114f557600080fd5b813580151581146106af57600080fd5b60005b83811015611520578181015183820152602001611508565b83811115610f0d5750506000910152565b60008151808452611549816020860160208601611505565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006106af6020830184611531565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600383106115f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000806040838503121561161157600080fd5b823561161c816114a1565b9150602083013561162c816114a1565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156116ad576116ad611637565b604052919050565b600067ffffffffffffffff8211156116cf576116cf611637565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600061170e611709846116b5565b611666565b905082815283838301111561172257600080fd5b828260208301376000602084830101529392505050565b600082601f83011261174a57600080fd5b6106af838335602085016116fb565b6000806040838503121561176c57600080fd5b8235611777816114a1565b9150602083013567ffffffffffffffff81111561179357600080fd5b61179f85828601611739565b9150509250929050565b600080604083850312156117bc57600080fd5b82356117c7816114a1565b915060208301356003811061162c57600080fd5b6000806000606084860312156117f057600080fd5b83356117fb816114a1565b9250602084013561180b816114a1565b9150604084013567ffffffffffffffff81111561182757600080fd5b8401601f8101861361183857600080fd5b611847868235602084016116fb565b9150509250925092565b6000806040838503121561186457600080fd5b823567ffffffffffffffff81111561187b57600080fd5b61188785828601611739565b925050602083013561162c816114a1565b6000602082840312156118aa57600080fd5b81516106af816114a1565b600181811c908216806118c957607f821691505b60208210810361081a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000602080835260008454611916816118b5565b80848701526040600180841660008114611937576001811461196f5761199d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838a01528284151560051b8a0101955061199d565b896000528660002060005b858110156119955781548b820186015290830190880161197a565b8a0184019650505b509398975050505050505050565b601f821115610ae157600081815260208120601f850160051c810160208610156119d25750805b601f850160051c820191505b81811015611323578281556001016119de565b815167ffffffffffffffff811115611a0b57611a0b611637565b611a1f81611a1984546118b5565b846119ab565b602080601f831160018114611a725760008415611a3c5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555611323565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611abf57888601518255948401946001909101908401611aa0565b5085821015611afb57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000611b3a6040830184611531565b949350505050565b600060208284031215611b5457600080fd5b815167ffffffffffffffff811115611b6b57600080fd5b8201601f81018413611b7c57600080fd5b8051611b8a611709826116b5565b818152856020838501011115611b9f57600080fd5b611bb0826020830160208601611505565b95945050505050565b60008251611bcb818460208701611505565b9190910192915050565b604081526000611be86040830185611531565b905073ffffffffffffffffffffffffffffffffffffffff831660208301529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfea164736f6c634300080f000a" var ProxyAdminDeployedBin = "0x60806040526004361061010e5760003560e01c8063860f7cda116100a557806399a88ec411610074578063b794726211610059578063b794726214610329578063f2fde38b14610364578063f3b7dead1461038457600080fd5b806399a88ec4146102e95780639b2ea4bd1461030957600080fd5b8063860f7cda1461026b5780638d52d4a01461028b5780638da5cb5b146102ab5780639623609d146102d657600080fd5b80633ab76e9f116100e15780633ab76e9f146101cc5780636bd9f516146101f9578063715018a6146102365780637eff275e1461024b57600080fd5b80630652b57a1461011357806307c8f7b014610135578063204e1c7a14610155578063238181ae1461019f575b600080fd5b34801561011f57600080fd5b5061013361012e3660046111f9565b6103a4565b005b34801561014157600080fd5b50610133610150366004611216565b6103f3565b34801561016157600080fd5b506101756101703660046111f9565b610445565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101ab57600080fd5b506101bf6101ba3660046111f9565b61066b565b60405161019691906112ae565b3480156101d857600080fd5b506003546101759073ffffffffffffffffffffffffffffffffffffffff1681565b34801561020557600080fd5b506102296102143660046111f9565b60016020526000908152604090205460ff1681565b60405161019691906112f0565b34801561024257600080fd5b50610133610705565b34801561025757600080fd5b50610133610266366004611331565b610719565b34801561027757600080fd5b5061013361028636600461148c565b6108cc565b34801561029757600080fd5b506101336102a63660046114dc565b610903565b3480156102b757600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610175565b6101336102e436600461150e565b610977565b3480156102f557600080fd5b50610133610304366004611331565b610b8e565b34801561031557600080fd5b50610133610324366004611584565b610e1e565b34801561033557600080fd5b5060035474010000000000000000000000000000000000000000900460ff166040519015158152602001610196565b34801561037057600080fd5b5061013361037f3660046111f9565b610eb4565b34801561039057600080fd5b5061017561039f3660046111f9565b610f6b565b6103ac6110e1565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6103fb6110e1565b6003805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604081205460ff1681816002811115610481576104816112c1565b036104fc578273ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f591906115cb565b9392505050565b6001816002811115610510576105106112c1565b03610560578273ffffffffffffffffffffffffffffffffffffffff1663aaf10f426040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b6002816002811115610574576105746112c1565b036105fe5760035473ffffffffffffffffffffffffffffffffffffffff8481166000908152600260205260409081902090517fbf40fac1000000000000000000000000000000000000000000000000000000008152919092169163bf40fac1916105e19190600401611635565b602060405180830381865afa1580156104d1573d6000803e3d6000fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f50726f787941646d696e3a20756e6b6e6f776e2070726f78792074797065000060448201526064015b60405180910390fd5b50919050565b60026020526000908152604090208054610684906115e8565b80601f01602080910402602001604051908101604052809291908181526020018280546106b0906115e8565b80156106fd5780601f106106d2576101008083540402835291602001916106fd565b820191906000526020600020905b8154815290600101906020018083116106e057829003601f168201915b505050505081565b61070d6110e1565b6107176000611162565b565b6107216110e1565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081205460ff169081600281111561075d5761075d6112c1565b036107e9576040517f8f28397000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152841690638f283970906024015b600060405180830381600087803b1580156107cc57600080fd5b505af11580156107e0573d6000803e3d6000fd5b50505050505050565b60018160028111156107fd576107fd6112c1565b03610856576040517f13af403500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906313af4035906024016107b2565b600281600281111561086a5761086a6112c1565b036105fe576003546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301529091169063f2fde38b906024016107b2565b505050565b6108d46110e1565b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090206108c78282611724565b61090b6110e1565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160208190526040909120805483927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091169083600281111561096e5761096e6112c1565b02179055505050565b61097f6110e1565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081205460ff16908160028111156109bb576109bb6112c1565b03610a81576040517f4f1ef28600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851690634f1ef286903490610a16908790879060040161183e565b60006040518083038185885af1158015610a34573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610a7b9190810190611875565b50610b88565b610a8b8484610b8e565b60008473ffffffffffffffffffffffffffffffffffffffff163484604051610ab391906118ec565b60006040518083038185875af1925050503d8060008114610af0576040519150601f19603f3d011682016040523d82523d6000602084013e610af5565b606091505b5050905080610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f50726f787941646d696e3a2063616c6c20746f2070726f78792061667465722060448201527f75706772616465206661696c6564000000000000000000000000000000000000606482015260840161065c565b505b50505050565b610b966110e1565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081205460ff1690816002811115610bd257610bd26112c1565b03610c2b576040517f3659cfe600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152841690633659cfe6906024016107b2565b6001816002811115610c3f57610c3f6112c1565b03610cbe576040517f9b0b0fda0000000000000000000000000000000000000000000000000000000081527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152841690639b0b0fda906044016107b2565b6002816002811115610cd257610cd26112c1565b03610e165773ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604081208054610d07906115e8565b80601f0160208091040260200160405190810160405280929190818152602001828054610d33906115e8565b8015610d805780601f10610d5557610100808354040283529160200191610d80565b820191906000526020600020905b815481529060010190602001808311610d6357829003601f168201915b50506003546040517f9b2ea4bd00000000000000000000000000000000000000000000000000000000815294955073ffffffffffffffffffffffffffffffffffffffff1693639b2ea4bd9350610dde92508591508790600401611908565b600060405180830381600087803b158015610df857600080fd5b505af1158015610e0c573d6000803e3d6000fd5b5050505050505050565b6108c7611940565b610e266110e1565b6003546040517f9b2ea4bd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690639b2ea4bd90610e7e9085908590600401611908565b600060405180830381600087803b158015610e9857600080fd5b505af1158015610eac573d6000803e3d6000fd5b505050505050565b610ebc6110e1565b73ffffffffffffffffffffffffffffffffffffffff8116610f5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161065c565b610f6881611162565b50565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604081205460ff1681816002811115610fa757610fa76112c1565b03610ff7578273ffffffffffffffffffffffffffffffffffffffff1663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b600181600281111561100b5761100b6112c1565b0361105b578273ffffffffffffffffffffffffffffffffffffffff1663893d20e86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b600281600281111561106f5761106f6112c1565b036105fe57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104d1573d6000803e3d6000fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314610717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161065c565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff81168114610f6857600080fd5b60006020828403121561120b57600080fd5b81356104f5816111d7565b60006020828403121561122857600080fd5b813580151581146104f557600080fd5b60005b8381101561125357818101518382015260200161123b565b83811115610b885750506000910152565b6000815180845261127c816020860160208601611238565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006104f56020830184611264565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b602081016003831061132b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6000806040838503121561134457600080fd5b823561134f816111d7565b9150602083013561135f816111d7565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156113e0576113e061136a565b604052919050565b600067ffffffffffffffff8211156114025761140261136a565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600061144161143c846113e8565b611399565b905082815283838301111561145557600080fd5b828260208301376000602084830101529392505050565b600082601f83011261147d57600080fd5b6104f58383356020850161142e565b6000806040838503121561149f57600080fd5b82356114aa816111d7565b9150602083013567ffffffffffffffff8111156114c657600080fd5b6114d28582860161146c565b9150509250929050565b600080604083850312156114ef57600080fd5b82356114fa816111d7565b915060208301356003811061135f57600080fd5b60008060006060848603121561152357600080fd5b833561152e816111d7565b9250602084013561153e816111d7565b9150604084013567ffffffffffffffff81111561155a57600080fd5b8401601f8101861361156b57600080fd5b61157a8682356020840161142e565b9150509250925092565b6000806040838503121561159757600080fd5b823567ffffffffffffffff8111156115ae57600080fd5b6115ba8582860161146c565b925050602083013561135f816111d7565b6000602082840312156115dd57600080fd5b81516104f5816111d7565b600181811c908216806115fc57607f821691505b602082108103610665577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000602080835260008454611649816115e8565b8084870152604060018084166000811461166a57600181146116a2576116d0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838a01528284151560051b8a010195506116d0565b896000528660002060005b858110156116c85781548b82018601529083019088016116ad565b8a0184019650505b509398975050505050505050565b601f8211156108c757600081815260208120601f850160051c810160208610156117055750805b601f850160051c820191505b81811015610eac57828155600101611711565b815167ffffffffffffffff81111561173e5761173e61136a565b6117528161174c84546115e8565b846116de565b602080601f8311600181146117a5576000841561176f5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610eac565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156117f2578886015182559484019460019091019084016117d3565b508582101561182e57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061186d6040830184611264565b949350505050565b60006020828403121561188757600080fd5b815167ffffffffffffffff81111561189e57600080fd5b8201601f810184136118af57600080fd5b80516118bd61143c826113e8565b8181528560208385010111156118d257600080fd5b6118e3826020830160208601611238565b95945050505050565b600082516118fe818460208701611238565b9190910192915050565b60408152600061191b6040830185611264565b905073ffffffffffffffffffffffffffffffffffffffff831660208301529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfea164736f6c634300080f000a"
func init() { func init() {
if err := json.Unmarshal([]byte(ProxyAdminStorageLayoutJSON), ProxyAdminStorageLayout); err != nil { if err := json.Unmarshal([]byte(ProxyAdminStorageLayoutJSON), ProxyAdminStorageLayout); err != nil {
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const SequencerFeeVaultStorageLayoutJSON = "{\"storage\":[{\"astId\":3325,\"contract\":\"contracts/L2/SequencerFeeVault.sol:SequencerFeeVault\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"}}}" const SequencerFeeVaultStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L2/SequencerFeeVault.sol:SequencerFeeVault\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"}}}"
var SequencerFeeVaultStorageLayout = new(solc.StorageLayout) var SequencerFeeVaultStorageLayout = new(solc.StorageLayout)
......
...@@ -30,8 +30,8 @@ var ( ...@@ -30,8 +30,8 @@ var (
// SystemConfigMetaData contains all meta data concerning the SystemConfig contract. // SystemConfigMetaData contains all meta data concerning the SystemConfig contract.
var SystemConfigMetaData = &bind.MetaData{ var SystemConfigMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_overhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_scalar\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"enumSystemConfig.UpdateType\",\"name\":\"updateType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ConfigUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batcherHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_overhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_scalar\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"overhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"}],\"name\":\"setBatcherHash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_overhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_scalar\",\"type\":\"uint256\"}],\"name\":\"setGasConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_overhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_scalar\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"enumSystemConfig.UpdateType\",\"name\":\"updateType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"ConfigUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MINIMUM_GAS_LIMIT\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batcherHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_overhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_scalar\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"overhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"scalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"}],\"name\":\"setBatcherHash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_overhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_scalar\",\"type\":\"uint256\"}],\"name\":\"setGasConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"}],\"name\":\"setGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
Bin: "0x60e06040523480156200001157600080fd5b50604051620010d8380380620010d88339810160408190526200003491620003b6565b6000608081905260a052600160c05262000051848484846200005b565b5050505062000403565b600054610100900460ff16158080156200007c5750600054600160ff909116105b80620000ac57506200009930620001ab60201b620005db1760201c565b158015620000ac575060005460ff166001145b620001155760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801562000139576000805461ff0019166101001790555b62000143620001ba565b6200014e8562000222565b6065849055606683905560678290558015620001a4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6001600160a01b03163b151590565b600054610100900460ff16620002165760405162461bcd60e51b815260206004820152602b6024820152600080516020620010b883398151915260448201526a6e697469616c697a696e6760a81b60648201526084016200010c565b62000220620002a1565b565b6200022c62000308565b6001600160a01b038116620002935760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200010c565b6200029e8162000364565b50565b600054610100900460ff16620002fd5760405162461bcd60e51b815260206004820152602b6024820152600080516020620010b883398151915260448201526a6e697469616c697a696e6760a81b60648201526084016200010c565b620002203362000364565b6033546001600160a01b03163314620002205760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200010c565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060008060808587031215620003cd57600080fd5b84516001600160a01b0381168114620003e557600080fd5b60208601516040870151606090970151919890975090945092505050565b60805160a05160c051610c856200043360003960006101f0015260006101c70152600061019e0152610c856000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c8063935f029e11610081578063f2fde38b1161005b578063f2fde38b14610173578063f45e65d814610186578063ffa1ad741461018f57600080fd5b8063935f029e14610144578063c9b26f6114610157578063e81b2c6d1461016a57600080fd5b80635fe6b4d0116100b25780635fe6b4d0146100ff578063715018a6146101145780638da5cb5b1461011c57600080fd5b80630c18c162146100ce57806354fd4d50146100ea575b600080fd5b6100d760655481565b6040519081526020015b60405180910390f35b6100f2610197565b6040516100e191906109e5565b61011261010d366004610a28565b61023a565b005b6101126103ed565b60335460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e1565b610112610152366004610a61565b610401565b610112610165366004610a83565b61049a565b6100d760675481565b610112610181366004610a9c565b610524565b6100d760665481565b6100d7600081565b60606101c27f00000000000000000000000000000000000000000000000000000000000000006105f7565b6101eb7f00000000000000000000000000000000000000000000000000000000000000006105f7565b6102147f00000000000000000000000000000000000000000000000000000000000000006105f7565b60405160200161022693929190610ab7565b604051602081830303815290604052905090565b600054610100900460ff161580801561025a5750600054600160ff909116105b806102745750303b158015610274575060005460ff166001145b610305576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561036357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61036b610734565b61037485610524565b60658490556066839055606782905580156103e657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6103f56107d3565b6103ff6000610854565b565b6104096107d3565b606582905560668190556040805160208101849052908101829052600090606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529050600160007f1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be8360405161048d91906109e5565b60405180910390a3505050565b6104a26107d3565b6067819055604080516020810183905260009101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905290506000807f1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be8360405161051891906109e5565b60405180910390a35050565b61052c6107d3565b73ffffffffffffffffffffffffffffffffffffffff81166105cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102fc565b6105d881610854565b50565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60608160000361063a57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610664578061064e81610b5c565b915061065d9050600a83610bc3565b915061063e565b60008167ffffffffffffffff81111561067f5761067f610bd7565b6040519080825280601f01601f1916602001820160405280156106a9576020820181803683370190505b5090505b841561072c576106be600183610c06565b91506106cb600a86610c1d565b6106d6906030610c31565b60f81b8183815181106106eb576106eb610c49565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610725600a86610bc3565b94506106ad565b949350505050565b600054610100900460ff166107cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102fc565b6103ff6108cb565b60335473ffffffffffffffffffffffffffffffffffffffff1633146103ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102fc565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102fc565b6103ff33610854565b60005b8381101561098657818101518382015260200161096e565b83811115610995576000848401525b50505050565b600081518084526109b381602086016020860161096b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006109f8602083018461099b565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610a2357600080fd5b919050565b60008060008060808587031215610a3e57600080fd5b610a47856109ff565b966020860135965060408601359560600135945092505050565b60008060408385031215610a7457600080fd5b50508035926020909101359150565b600060208284031215610a9557600080fd5b5035919050565b600060208284031215610aae57600080fd5b6109f8826109ff565b60008451610ac981846020890161096b565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610b05816001850160208a0161096b565b60019201918201528351610b2081600284016020880161096b565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610b8d57610b8d610b2d565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610bd257610bd2610b94565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015610c1857610c18610b2d565b500390565b600082610c2c57610c2c610b94565b500690565b60008219821115610c4457610c44610b2d565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a496e697469616c697a61626c653a20636f6e7472616374206973206e6f742069", Bin: "0x60e06040523480156200001157600080fd5b506040516200139238038062001392833981016040819052620000349162000432565b6000608081905260a052600160c0526200005285858585856200005d565b5050505050620004a5565b600054610100900460ff16158080156200007e5750600054600160ff909116105b80620000ae57506200009b306200022760201b620007a91760201c565b158015620000ae575060005460ff166001145b620001175760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156200013b576000805461ff0019166101001790555b627a12006001600160401b0383161015620001995760405162461bcd60e51b815260206004820152601f60248201527f53797374656d436f6e6669673a20676173206c696d697420746f6f206c6f770060448201526064016200010e565b620001a362000236565b620001ae866200029e565b606585905560668490556067839055606880546001600160401b0319166001600160401b03841617905580156200021f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6001600160a01b03163b151590565b600054610100900460ff16620002925760405162461bcd60e51b815260206004820152602b60248201526000805160206200137283398151915260448201526a6e697469616c697a696e6760a81b60648201526084016200010e565b6200029c6200031d565b565b620002a862000384565b6001600160a01b0381166200030f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200010e565b6200031a81620003e0565b50565b600054610100900460ff16620003795760405162461bcd60e51b815260206004820152602b60248201526000805160206200137283398151915260448201526a6e697469616c697a696e6760a81b60648201526084016200010e565b6200029c33620003e0565b6033546001600160a01b031633146200029c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200010e565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080600080600060a086880312156200044b57600080fd5b85516001600160a01b03811681146200046357600080fd5b60208701516040880151606089015160808a0151939850919650945092506001600160401b03811681146200049757600080fd5b809150509295509295909350565b60805160a05160c051610e9d620004d5600039600061025b01526000610232015260006102090152610e9d6000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063b40a817c1161008c578063f2fde38b11610066578063f2fde38b146101ca578063f45e65d8146101dd578063f68016b7146101e6578063ffa1ad74146101fa57600080fd5b8063b40a817c1461019b578063c9b26f61146101ae578063e81b2c6d146101c157600080fd5b806370bde19c116100c857806370bde19c14610143578063715018a6146101585780638da5cb5b14610160578063935f029e1461018857600080fd5b80630c18c162146100ef57806329477e861461010b57806354fd4d501461012e575b600080fd5b6100f860655481565b6040519081526020015b60405180910390f35b610115627a120081565b60405167ffffffffffffffff9091168152602001610102565b610136610202565b6040516101029190610bb3565b610156610151366004610c0e565b6102a5565b005b610156610504565b60335460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610102565b610156610196366004610c5e565b610518565b6101566101a9366004610c80565b6105b1565b6101566101bc366004610c9b565b6106c2565b6100f860675481565b6101566101d8366004610cb4565b6106f2565b6100f860665481565b6068546101159067ffffffffffffffff1681565b6100f8600081565b606061022d7f00000000000000000000000000000000000000000000000000000000000000006107c5565b6102567f00000000000000000000000000000000000000000000000000000000000000006107c5565b61027f7f00000000000000000000000000000000000000000000000000000000000000006107c5565b60405160200161029193929190610ccf565b604051602081830303815290604052905090565b600054610100900460ff16158080156102c55750600054600160ff909116105b806102df5750303b1580156102df575060005460ff166001145b610370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103ce57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b627a120067ffffffffffffffff83161015610445576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f53797374656d436f6e6669673a20676173206c696d697420746f6f206c6f77006044820152606401610367565b61044d610902565b610456866106f2565b606585905560668490556067839055606880547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff841617905580156104fc57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b61050c6109a1565b6105166000610a22565b565b6105206109a1565b606582905560668190556040805160208101849052908101829052600090606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529050600160007f1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be836040516105a49190610bb3565b60405180910390a3505050565b6105b96109a1565b627a120067ffffffffffffffff82161015610630576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f53797374656d436f6e6669673a20676173206c696d697420746f6f206c6f77006044820152606401610367565b606880547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff831690811790915560408051602080820193909352815180820390930183528101905260025b60007f1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be836040516106b69190610bb3565b60405180910390a35050565b6106ca6109a1565b6067819055604080516020808201849052825180830390910181529082019091526000610685565b6106fa6109a1565b73ffffffffffffffffffffffffffffffffffffffff811661079d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610367565b6107a681610a22565b50565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60608160000361080857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610832578061081c81610d74565b915061082b9050600a83610ddb565b915061080c565b60008167ffffffffffffffff81111561084d5761084d610def565b6040519080825280601f01601f191660200182016040528015610877576020820181803683370190505b5090505b84156108fa5761088c600183610e1e565b9150610899600a86610e35565b6108a4906030610e49565b60f81b8183815181106108b9576108b9610e61565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506108f3600a86610ddb565b945061087b565b949350505050565b600054610100900460ff16610999576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610367565b610516610a99565b60335473ffffffffffffffffffffffffffffffffffffffff163314610516576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610367565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610b30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610367565b61051633610a22565b60005b83811015610b54578181015183820152602001610b3c565b83811115610b63576000848401525b50505050565b60008151808452610b81816020860160208601610b39565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610bc66020830184610b69565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610bf157600080fd5b919050565b803567ffffffffffffffff81168114610bf157600080fd5b600080600080600060a08688031215610c2657600080fd5b610c2f86610bcd565b9450602086013593506040860135925060608601359150610c5260808701610bf6565b90509295509295909350565b60008060408385031215610c7157600080fd5b50508035926020909101359150565b600060208284031215610c9257600080fd5b610bc682610bf6565b600060208284031215610cad57600080fd5b5035919050565b600060208284031215610cc657600080fd5b610bc682610bcd565b60008451610ce1818460208901610b39565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610d1d816001850160208a01610b39565b60019201918201528351610d38816002840160208801610b39565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610da557610da5610d45565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610dea57610dea610dac565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015610e3057610e30610d45565b500390565b600082610e4457610e44610dac565b500690565b60008219821115610e5c57610e5c610d45565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a496e697469616c697a61626c653a20636f6e7472616374206973206e6f742069",
} }
// SystemConfigABI is the input ABI used to generate the binding from. // SystemConfigABI is the input ABI used to generate the binding from.
...@@ -43,7 +43,7 @@ var SystemConfigABI = SystemConfigMetaData.ABI ...@@ -43,7 +43,7 @@ var SystemConfigABI = SystemConfigMetaData.ABI
var SystemConfigBin = SystemConfigMetaData.Bin var SystemConfigBin = SystemConfigMetaData.Bin
// DeploySystemConfig deploys a new Ethereum contract, binding an instance of SystemConfig to it. // DeploySystemConfig deploys a new Ethereum contract, binding an instance of SystemConfig to it.
func DeploySystemConfig(auth *bind.TransactOpts, backend bind.ContractBackend, _owner common.Address, _overhead *big.Int, _scalar *big.Int, _batcherHash [32]byte) (common.Address, *types.Transaction, *SystemConfig, error) { func DeploySystemConfig(auth *bind.TransactOpts, backend bind.ContractBackend, _owner common.Address, _overhead *big.Int, _scalar *big.Int, _batcherHash [32]byte, _gasLimit uint64) (common.Address, *types.Transaction, *SystemConfig, error) {
parsed, err := SystemConfigMetaData.GetAbi() parsed, err := SystemConfigMetaData.GetAbi()
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
...@@ -52,7 +52,7 @@ func DeploySystemConfig(auth *bind.TransactOpts, backend bind.ContractBackend, _ ...@@ -52,7 +52,7 @@ func DeploySystemConfig(auth *bind.TransactOpts, backend bind.ContractBackend, _
return common.Address{}, nil, nil, errors.New("GetABI returned nil") return common.Address{}, nil, nil, errors.New("GetABI returned nil")
} }
address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SystemConfigBin), backend, _owner, _overhead, _scalar, _batcherHash) address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SystemConfigBin), backend, _owner, _overhead, _scalar, _batcherHash, _gasLimit)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
} }
...@@ -201,6 +201,37 @@ func (_SystemConfig *SystemConfigTransactorRaw) Transact(opts *bind.TransactOpts ...@@ -201,6 +201,37 @@ func (_SystemConfig *SystemConfigTransactorRaw) Transact(opts *bind.TransactOpts
return _SystemConfig.Contract.contract.Transact(opts, method, params...) return _SystemConfig.Contract.contract.Transact(opts, method, params...)
} }
// MINIMUMGASLIMIT is a free data retrieval call binding the contract method 0x29477e86.
//
// Solidity: function MINIMUM_GAS_LIMIT() view returns(uint64)
func (_SystemConfig *SystemConfigCaller) MINIMUMGASLIMIT(opts *bind.CallOpts) (uint64, error) {
var out []interface{}
err := _SystemConfig.contract.Call(opts, &out, "MINIMUM_GAS_LIMIT")
if err != nil {
return *new(uint64), err
}
out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64)
return out0, err
}
// MINIMUMGASLIMIT is a free data retrieval call binding the contract method 0x29477e86.
//
// Solidity: function MINIMUM_GAS_LIMIT() view returns(uint64)
func (_SystemConfig *SystemConfigSession) MINIMUMGASLIMIT() (uint64, error) {
return _SystemConfig.Contract.MINIMUMGASLIMIT(&_SystemConfig.CallOpts)
}
// MINIMUMGASLIMIT is a free data retrieval call binding the contract method 0x29477e86.
//
// Solidity: function MINIMUM_GAS_LIMIT() view returns(uint64)
func (_SystemConfig *SystemConfigCallerSession) MINIMUMGASLIMIT() (uint64, error) {
return _SystemConfig.Contract.MINIMUMGASLIMIT(&_SystemConfig.CallOpts)
}
// VERSION is a free data retrieval call binding the contract method 0xffa1ad74. // VERSION is a free data retrieval call binding the contract method 0xffa1ad74.
// //
// Solidity: function VERSION() view returns(uint256) // Solidity: function VERSION() view returns(uint256)
...@@ -263,6 +294,37 @@ func (_SystemConfig *SystemConfigCallerSession) BatcherHash() ([32]byte, error) ...@@ -263,6 +294,37 @@ func (_SystemConfig *SystemConfigCallerSession) BatcherHash() ([32]byte, error)
return _SystemConfig.Contract.BatcherHash(&_SystemConfig.CallOpts) return _SystemConfig.Contract.BatcherHash(&_SystemConfig.CallOpts)
} }
// GasLimit is a free data retrieval call binding the contract method 0xf68016b7.
//
// Solidity: function gasLimit() view returns(uint64)
func (_SystemConfig *SystemConfigCaller) GasLimit(opts *bind.CallOpts) (uint64, error) {
var out []interface{}
err := _SystemConfig.contract.Call(opts, &out, "gasLimit")
if err != nil {
return *new(uint64), err
}
out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64)
return out0, err
}
// GasLimit is a free data retrieval call binding the contract method 0xf68016b7.
//
// Solidity: function gasLimit() view returns(uint64)
func (_SystemConfig *SystemConfigSession) GasLimit() (uint64, error) {
return _SystemConfig.Contract.GasLimit(&_SystemConfig.CallOpts)
}
// GasLimit is a free data retrieval call binding the contract method 0xf68016b7.
//
// Solidity: function gasLimit() view returns(uint64)
func (_SystemConfig *SystemConfigCallerSession) GasLimit() (uint64, error) {
return _SystemConfig.Contract.GasLimit(&_SystemConfig.CallOpts)
}
// Overhead is a free data retrieval call binding the contract method 0x0c18c162. // Overhead is a free data retrieval call binding the contract method 0x0c18c162.
// //
// Solidity: function overhead() view returns(uint256) // Solidity: function overhead() view returns(uint256)
...@@ -387,25 +449,25 @@ func (_SystemConfig *SystemConfigCallerSession) Version() (string, error) { ...@@ -387,25 +449,25 @@ func (_SystemConfig *SystemConfigCallerSession) Version() (string, error) {
return _SystemConfig.Contract.Version(&_SystemConfig.CallOpts) return _SystemConfig.Contract.Version(&_SystemConfig.CallOpts)
} }
// Initialize is a paid mutator transaction binding the contract method 0x5fe6b4d0. // Initialize is a paid mutator transaction binding the contract method 0x70bde19c.
// //
// Solidity: function initialize(address _owner, uint256 _overhead, uint256 _scalar, bytes32 _batcherHash) returns() // Solidity: function initialize(address _owner, uint256 _overhead, uint256 _scalar, bytes32 _batcherHash, uint64 _gasLimit) returns()
func (_SystemConfig *SystemConfigTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _overhead *big.Int, _scalar *big.Int, _batcherHash [32]byte) (*types.Transaction, error) { func (_SystemConfig *SystemConfigTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _overhead *big.Int, _scalar *big.Int, _batcherHash [32]byte, _gasLimit uint64) (*types.Transaction, error) {
return _SystemConfig.contract.Transact(opts, "initialize", _owner, _overhead, _scalar, _batcherHash) return _SystemConfig.contract.Transact(opts, "initialize", _owner, _overhead, _scalar, _batcherHash, _gasLimit)
} }
// Initialize is a paid mutator transaction binding the contract method 0x5fe6b4d0. // Initialize is a paid mutator transaction binding the contract method 0x70bde19c.
// //
// Solidity: function initialize(address _owner, uint256 _overhead, uint256 _scalar, bytes32 _batcherHash) returns() // Solidity: function initialize(address _owner, uint256 _overhead, uint256 _scalar, bytes32 _batcherHash, uint64 _gasLimit) returns()
func (_SystemConfig *SystemConfigSession) Initialize(_owner common.Address, _overhead *big.Int, _scalar *big.Int, _batcherHash [32]byte) (*types.Transaction, error) { func (_SystemConfig *SystemConfigSession) Initialize(_owner common.Address, _overhead *big.Int, _scalar *big.Int, _batcherHash [32]byte, _gasLimit uint64) (*types.Transaction, error) {
return _SystemConfig.Contract.Initialize(&_SystemConfig.TransactOpts, _owner, _overhead, _scalar, _batcherHash) return _SystemConfig.Contract.Initialize(&_SystemConfig.TransactOpts, _owner, _overhead, _scalar, _batcherHash, _gasLimit)
} }
// Initialize is a paid mutator transaction binding the contract method 0x5fe6b4d0. // Initialize is a paid mutator transaction binding the contract method 0x70bde19c.
// //
// Solidity: function initialize(address _owner, uint256 _overhead, uint256 _scalar, bytes32 _batcherHash) returns() // Solidity: function initialize(address _owner, uint256 _overhead, uint256 _scalar, bytes32 _batcherHash, uint64 _gasLimit) returns()
func (_SystemConfig *SystemConfigTransactorSession) Initialize(_owner common.Address, _overhead *big.Int, _scalar *big.Int, _batcherHash [32]byte) (*types.Transaction, error) { func (_SystemConfig *SystemConfigTransactorSession) Initialize(_owner common.Address, _overhead *big.Int, _scalar *big.Int, _batcherHash [32]byte, _gasLimit uint64) (*types.Transaction, error) {
return _SystemConfig.Contract.Initialize(&_SystemConfig.TransactOpts, _owner, _overhead, _scalar, _batcherHash) return _SystemConfig.Contract.Initialize(&_SystemConfig.TransactOpts, _owner, _overhead, _scalar, _batcherHash, _gasLimit)
} }
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
...@@ -471,6 +533,27 @@ func (_SystemConfig *SystemConfigTransactorSession) SetGasConfig(_overhead *big. ...@@ -471,6 +533,27 @@ func (_SystemConfig *SystemConfigTransactorSession) SetGasConfig(_overhead *big.
return _SystemConfig.Contract.SetGasConfig(&_SystemConfig.TransactOpts, _overhead, _scalar) return _SystemConfig.Contract.SetGasConfig(&_SystemConfig.TransactOpts, _overhead, _scalar)
} }
// SetGasLimit is a paid mutator transaction binding the contract method 0xb40a817c.
//
// Solidity: function setGasLimit(uint64 _gasLimit) returns()
func (_SystemConfig *SystemConfigTransactor) SetGasLimit(opts *bind.TransactOpts, _gasLimit uint64) (*types.Transaction, error) {
return _SystemConfig.contract.Transact(opts, "setGasLimit", _gasLimit)
}
// SetGasLimit is a paid mutator transaction binding the contract method 0xb40a817c.
//
// Solidity: function setGasLimit(uint64 _gasLimit) returns()
func (_SystemConfig *SystemConfigSession) SetGasLimit(_gasLimit uint64) (*types.Transaction, error) {
return _SystemConfig.Contract.SetGasLimit(&_SystemConfig.TransactOpts, _gasLimit)
}
// SetGasLimit is a paid mutator transaction binding the contract method 0xb40a817c.
//
// Solidity: function setGasLimit(uint64 _gasLimit) returns()
func (_SystemConfig *SystemConfigTransactorSession) SetGasLimit(_gasLimit uint64) (*types.Transaction, error) {
return _SystemConfig.Contract.SetGasLimit(&_SystemConfig.TransactOpts, _gasLimit)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
// //
// Solidity: function transferOwnership(address newOwner) returns() // Solidity: function transferOwnership(address newOwner) returns()
......
...@@ -9,11 +9,11 @@ import ( ...@@ -9,11 +9,11 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const SystemConfigStorageLayoutJSON = "{\"storage\":[{\"astId\":29204,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":29207,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":29818,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)50_storage\"},{\"astId\":29076,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":29196,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":1891,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"overhead\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_uint256\"},{\"astId\":1893,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"scalar\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_uint256\"},{\"astId\":1895,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"batcherHash\",\"offset\":0,\"slot\":\"103\",\"type\":\"t_bytes32\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)50_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" const SystemConfigStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)1010_storage\"},{\"astId\":1003,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1004,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)1009_storage\"},{\"astId\":1005,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"overhead\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_uint256\"},{\"astId\":1006,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"scalar\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_uint256\"},{\"astId\":1007,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"batcherHash\",\"offset\":0,\"slot\":\"103\",\"type\":\"t_bytes32\"},{\"astId\":1008,\"contract\":\"contracts/L1/SystemConfig.sol:SystemConfig\",\"label\":\"gasLimit\",\"offset\":0,\"slot\":\"104\",\"type\":\"t_uint64\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)1009_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)1010_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var SystemConfigStorageLayout = new(solc.StorageLayout) var SystemConfigStorageLayout = new(solc.StorageLayout)
var SystemConfigDeployedBin = "0x608060405234801561001057600080fd5b50600436106100c95760003560e01c8063935f029e11610081578063f2fde38b1161005b578063f2fde38b14610173578063f45e65d814610186578063ffa1ad741461018f57600080fd5b8063935f029e14610144578063c9b26f6114610157578063e81b2c6d1461016a57600080fd5b80635fe6b4d0116100b25780635fe6b4d0146100ff578063715018a6146101145780638da5cb5b1461011c57600080fd5b80630c18c162146100ce57806354fd4d50146100ea575b600080fd5b6100d760655481565b6040519081526020015b60405180910390f35b6100f2610197565b6040516100e191906109e5565b61011261010d366004610a28565b61023a565b005b6101126103ed565b60335460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100e1565b610112610152366004610a61565b610401565b610112610165366004610a83565b61049a565b6100d760675481565b610112610181366004610a9c565b610524565b6100d760665481565b6100d7600081565b60606101c27f00000000000000000000000000000000000000000000000000000000000000006105f7565b6101eb7f00000000000000000000000000000000000000000000000000000000000000006105f7565b6102147f00000000000000000000000000000000000000000000000000000000000000006105f7565b60405160200161022693929190610ab7565b604051602081830303815290604052905090565b600054610100900460ff161580801561025a5750600054600160ff909116105b806102745750303b158015610274575060005460ff166001145b610305576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561036357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61036b610734565b61037485610524565b60658490556066839055606782905580156103e657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6103f56107d3565b6103ff6000610854565b565b6104096107d3565b606582905560668190556040805160208101849052908101829052600090606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529050600160007f1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be8360405161048d91906109e5565b60405180910390a3505050565b6104a26107d3565b6067819055604080516020810183905260009101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905290506000807f1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be8360405161051891906109e5565b60405180910390a35050565b61052c6107d3565b73ffffffffffffffffffffffffffffffffffffffff81166105cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102fc565b6105d881610854565b50565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60608160000361063a57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610664578061064e81610b5c565b915061065d9050600a83610bc3565b915061063e565b60008167ffffffffffffffff81111561067f5761067f610bd7565b6040519080825280601f01601f1916602001820160405280156106a9576020820181803683370190505b5090505b841561072c576106be600183610c06565b91506106cb600a86610c1d565b6106d6906030610c31565b60f81b8183815181106106eb576106eb610c49565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610725600a86610bc3565b94506106ad565b949350505050565b600054610100900460ff166107cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102fc565b6103ff6108cb565b60335473ffffffffffffffffffffffffffffffffffffffff1633146103ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102fc565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102fc565b6103ff33610854565b60005b8381101561098657818101518382015260200161096e565b83811115610995576000848401525b50505050565b600081518084526109b381602086016020860161096b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006109f8602083018461099b565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610a2357600080fd5b919050565b60008060008060808587031215610a3e57600080fd5b610a47856109ff565b966020860135965060408601359560600135945092505050565b60008060408385031215610a7457600080fd5b50508035926020909101359150565b600060208284031215610a9557600080fd5b5035919050565b600060208284031215610aae57600080fd5b6109f8826109ff565b60008451610ac981846020890161096b565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610b05816001850160208a0161096b565b60019201918201528351610b2081600284016020880161096b565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610b8d57610b8d610b2d565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610bd257610bd2610b94565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015610c1857610c18610b2d565b500390565b600082610c2c57610c2c610b94565b500690565b60008219821115610c4457610c44610b2d565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a" var SystemConfigDeployedBin = "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063b40a817c1161008c578063f2fde38b11610066578063f2fde38b146101ca578063f45e65d8146101dd578063f68016b7146101e6578063ffa1ad74146101fa57600080fd5b8063b40a817c1461019b578063c9b26f61146101ae578063e81b2c6d146101c157600080fd5b806370bde19c116100c857806370bde19c14610143578063715018a6146101585780638da5cb5b14610160578063935f029e1461018857600080fd5b80630c18c162146100ef57806329477e861461010b57806354fd4d501461012e575b600080fd5b6100f860655481565b6040519081526020015b60405180910390f35b610115627a120081565b60405167ffffffffffffffff9091168152602001610102565b610136610202565b6040516101029190610bb3565b610156610151366004610c0e565b6102a5565b005b610156610504565b60335460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610102565b610156610196366004610c5e565b610518565b6101566101a9366004610c80565b6105b1565b6101566101bc366004610c9b565b6106c2565b6100f860675481565b6101566101d8366004610cb4565b6106f2565b6100f860665481565b6068546101159067ffffffffffffffff1681565b6100f8600081565b606061022d7f00000000000000000000000000000000000000000000000000000000000000006107c5565b6102567f00000000000000000000000000000000000000000000000000000000000000006107c5565b61027f7f00000000000000000000000000000000000000000000000000000000000000006107c5565b60405160200161029193929190610ccf565b604051602081830303815290604052905090565b600054610100900460ff16158080156102c55750600054600160ff909116105b806102df5750303b1580156102df575060005460ff166001145b610370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103ce57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b627a120067ffffffffffffffff83161015610445576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f53797374656d436f6e6669673a20676173206c696d697420746f6f206c6f77006044820152606401610367565b61044d610902565b610456866106f2565b606585905560668490556067839055606880547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff841617905580156104fc57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b61050c6109a1565b6105166000610a22565b565b6105206109a1565b606582905560668190556040805160208101849052908101829052600090606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529050600160007f1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be836040516105a49190610bb3565b60405180910390a3505050565b6105b96109a1565b627a120067ffffffffffffffff82161015610630576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f53797374656d436f6e6669673a20676173206c696d697420746f6f206c6f77006044820152606401610367565b606880547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff831690811790915560408051602080820193909352815180820390930183528101905260025b60007f1d2b0bda21d56b8bd12d4f94ebacffdfb35f5e226f84b461103bb8beab6353be836040516106b69190610bb3565b60405180910390a35050565b6106ca6109a1565b6067819055604080516020808201849052825180830390910181529082019091526000610685565b6106fa6109a1565b73ffffffffffffffffffffffffffffffffffffffff811661079d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610367565b6107a681610a22565b50565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60608160000361080857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610832578061081c81610d74565b915061082b9050600a83610ddb565b915061080c565b60008167ffffffffffffffff81111561084d5761084d610def565b6040519080825280601f01601f191660200182016040528015610877576020820181803683370190505b5090505b84156108fa5761088c600183610e1e565b9150610899600a86610e35565b6108a4906030610e49565b60f81b8183815181106108b9576108b9610e61565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506108f3600a86610ddb565b945061087b565b949350505050565b600054610100900460ff16610999576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610367565b610516610a99565b60335473ffffffffffffffffffffffffffffffffffffffff163314610516576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610367565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610b30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610367565b61051633610a22565b60005b83811015610b54578181015183820152602001610b3c565b83811115610b63576000848401525b50505050565b60008151808452610b81816020860160208601610b39565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610bc66020830184610b69565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610bf157600080fd5b919050565b803567ffffffffffffffff81168114610bf157600080fd5b600080600080600060a08688031215610c2657600080fd5b610c2f86610bcd565b9450602086013593506040860135925060608601359150610c5260808701610bf6565b90509295509295909350565b60008060408385031215610c7157600080fd5b50508035926020909101359150565b600060208284031215610c9257600080fd5b610bc682610bf6565b600060208284031215610cad57600080fd5b5035919050565b600060208284031215610cc657600080fd5b610bc682610bcd565b60008451610ce1818460208901610b39565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610d1d816001850160208a01610b39565b60019201918201528351610d38816002840160208801610b39565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610da557610da5610d45565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610dea57610dea610dac565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082821015610e3057610e30610d45565b500390565b600082610e4457610e44610dac565b500690565b60008219821115610e5c57610e5c610d45565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a"
func init() { func init() {
if err := json.Unmarshal([]byte(SystemConfigStorageLayoutJSON), SystemConfigStorageLayout); err != nil { if err := json.Unmarshal([]byte(SystemConfigStorageLayoutJSON), SystemConfigStorageLayout); err != nil {
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const WETH9StorageLayoutJSON = "{\"storage\":[{\"astId\":4,\"contract\":\"contracts/vendor/WETH9.sol:WETH9\",\"label\":\"name\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_string_storage\"},{\"astId\":7,\"contract\":\"contracts/vendor/WETH9.sol:WETH9\",\"label\":\"symbol\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_string_storage\"},{\"astId\":10,\"contract\":\"contracts/vendor/WETH9.sol:WETH9\",\"label\":\"decimals\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint8\"},{\"astId\":42,\"contract\":\"contracts/vendor/WETH9.sol:WETH9\",\"label\":\"balanceOf\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":48,\"contract\":\"contracts/vendor/WETH9.sol:WETH9\",\"label\":\"allowance\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" const WETH9StorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/vendor/WETH9.sol:WETH9\",\"label\":\"name\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_string_storage\"},{\"astId\":1001,\"contract\":\"contracts/vendor/WETH9.sol:WETH9\",\"label\":\"symbol\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_string_storage\"},{\"astId\":1002,\"contract\":\"contracts/vendor/WETH9.sol:WETH9\",\"label\":\"decimals\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint8\"},{\"astId\":1003,\"contract\":\"contracts/vendor/WETH9.sol:WETH9\",\"label\":\"balanceOf\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":1004,\"contract\":\"contracts/vendor/WETH9.sol:WETH9\",\"label\":\"allowance\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var WETH9StorageLayout = new(solc.StorageLayout) var WETH9StorageLayout = new(solc.StorageLayout)
......
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"strings" "strings"
"text/template" "text/template"
"github.com/ethereum-optimism/optimism/op-bindings/ast"
"github.com/ethereum-optimism/optimism/op-bindings/hardhat" "github.com/ethereum-optimism/optimism/op-bindings/hardhat"
) )
...@@ -62,8 +63,9 @@ func main() { ...@@ -62,8 +63,9 @@ func main() {
if err != nil { if err != nil {
log.Fatalf("error reading storage layout %s: %v\n", name, err) log.Fatalf("error reading storage layout %s: %v\n", name, err)
} }
canonicalStorage := ast.CanonicalizeASTIDs(storage)
ser, err := json.Marshal(storage) ser, err := json.Marshal(canonicalStorage)
if err != nil { if err != nil {
log.Fatalf("error marshaling storage: %v\n", err) log.Fatalf("error marshaling storage: %v\n", err)
} }
......
...@@ -3,31 +3,23 @@ module github.com/ethereum-optimism/optimism/op-bindings ...@@ -3,31 +3,23 @@ module github.com/ethereum-optimism/optimism/op-bindings
go 1.18 go 1.18
require ( require (
github.com/ethereum/go-ethereum v1.10.23 github.com/ethereum/go-ethereum v1.10.26
github.com/stretchr/testify v1.7.2 github.com/stretchr/testify v1.7.2
) )
require ( require (
github.com/VictoriaMetrics/fastcache v1.9.0 // indirect github.com/VictoriaMetrics/fastcache v1.9.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect github.com/go-stack/stack v1.8.1 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.3.0 // indirect github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.0 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/tsdb v0.10.0 // indirect github.com/prometheus/tsdb v0.10.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rjeczalik/notify v0.9.2 // indirect github.com/rjeczalik/notify v0.9.2 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
...@@ -35,11 +27,9 @@ require ( ...@@ -35,11 +27,9 @@ require (
github.com/tklauser/numcpus v0.4.0 // indirect github.com/tklauser/numcpus v0.4.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be
// github.com/ethereum-optimism/op-geth v0.0.0-20220909213840-e6575c0168f1
...@@ -3,7 +3,6 @@ github.com/VictoriaMetrics/fastcache v1.9.0 h1:oMwsS6c8abz98B7ytAewQ7M1ZN/Im/iwK ...@@ -3,7 +3,6 @@ github.com/VictoriaMetrics/fastcache v1.9.0 h1:oMwsS6c8abz98B7ytAewQ7M1ZN/Im/iwK
github.com/VictoriaMetrics/fastcache v1.9.0/go.mod h1:otoTS3xu+6IzF/qByjqzjp3rTuzM3Qf0ScU1UTj97iU= github.com/VictoriaMetrics/fastcache v1.9.0/go.mod h1:otoTS3xu+6IzF/qByjqzjp3rTuzM3Qf0ScU1UTj97iU=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
...@@ -11,6 +10,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPx ...@@ -11,6 +10,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPx
github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
...@@ -28,15 +28,12 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1 ...@@ -28,15 +28,12 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw=
github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa h1:jQ6FlSUf8BOttQexgqHjltQhn495S2oL06/UA20co9w= github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be h1:8TdM3M7FjZkrYeGGX9nEVtDDlZ5RiuHtc0mbi5bGKyY=
github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo= github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be/go.mod h1:1g9UmZgEINqvYfXmWOUCRJX9fxegeOHudVkLCRAXO5Y=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0 h1:8HUsc87TaSWLKwrnumgC8/YconD2fJQsRJAsWaPg2ic=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
...@@ -68,19 +65,15 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ ...@@ -68,19 +65,15 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=
github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
...@@ -88,25 +81,20 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ ...@@ -88,25 +81,20 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
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/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
...@@ -157,7 +145,6 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ ...@@ -157,7 +145,6 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
...@@ -185,14 +172,14 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc ...@@ -185,14 +172,14 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 h1:OK7RB6t2WQX54srQQYSXMW8dF5C6/8+oA/s5QBmmto4=
golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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/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.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
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-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
...@@ -216,13 +203,11 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 ...@@ -216,13 +203,11 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
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=
...@@ -2,6 +2,7 @@ package hardhat ...@@ -2,6 +2,7 @@ package hardhat
import ( import (
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"io/fs" "io/fs"
"os" "os"
...@@ -12,6 +13,11 @@ import ( ...@@ -12,6 +13,11 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
var (
ErrCannotFindDeployment = errors.New("cannot find deployment")
ErrCannotFindArtifact = errors.New("cannot find artifact")
)
// `Hardhat` encapsulates all of the functionality required to interact // `Hardhat` encapsulates all of the functionality required to interact
// with hardhat style artifacts. // with hardhat style artifacts.
type Hardhat struct { type Hardhat struct {
...@@ -163,7 +169,7 @@ func (h *Hardhat) GetArtifact(name string) (*Artifact, error) { ...@@ -163,7 +169,7 @@ func (h *Hardhat) GetArtifact(name string) (*Artifact, error) {
return artifact, nil return artifact, nil
} }
} }
return nil, fmt.Errorf("cannot find artifact %s", name) return nil, fmt.Errorf("%w: %s", ErrCannotFindArtifact, name)
} }
for _, artifact := range h.artifacts { for _, artifact := range h.artifacts {
...@@ -172,7 +178,7 @@ func (h *Hardhat) GetArtifact(name string) (*Artifact, error) { ...@@ -172,7 +178,7 @@ func (h *Hardhat) GetArtifact(name string) (*Artifact, error) {
} }
} }
return nil, fmt.Errorf("cannot find artifact %s", name) return nil, fmt.Errorf("%w: %s", ErrCannotFindArtifact, name)
} }
// GetDeployment returns the deployment that corresponds to the contract. // GetDeployment returns the deployment that corresponds to the contract.
...@@ -188,7 +194,7 @@ func (h *Hardhat) GetDeployment(name string) (*Deployment, error) { ...@@ -188,7 +194,7 @@ func (h *Hardhat) GetDeployment(name string) (*Deployment, error) {
} }
} }
return nil, fmt.Errorf("cannot find deployment %s", name) return nil, fmt.Errorf("%w: %s", ErrCannotFindDeployment, name)
} }
// GetBuildInfo returns the build info that corresponds to the contract. // GetBuildInfo returns the build info that corresponds to the contract.
......
...@@ -3,12 +3,12 @@ package predeploys ...@@ -3,12 +3,12 @@ package predeploys
import ( import (
"testing" "testing"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
func TestGethAddresses(t *testing.T) { func TestGethAddresses(t *testing.T) {
// We test if the addresses in geth match those in op-bindings, to avoid an import-cycle: // We test if the addresses in geth match those in op-bindings, to avoid an import-cycle:
// we import geth in the monorepo, and do not want to import op-bindings into geth. // we import geth in the monorepo, and do not want to import op-bindings into geth.
require.Equal(t, L1BlockAddr, core.L1BlockAddr) require.Equal(t, L1BlockAddr, types.L1BlockAddr)
} }
...@@ -143,29 +143,17 @@ func main() { ...@@ -143,29 +143,17 @@ func main() {
return err return err
} }
// Get the addresses from the hardhat deploy artifacts // Read the required deployment addresses from disk if required
l1StandardBridgeProxyDeployment, err := hh.GetDeployment("Proxy__OVM_L1StandardBridge") if err := config.GetDeployedAddresses(hh); err != nil {
if err != nil {
return err
}
l1CrossDomainMessengerProxyDeployment, err := hh.GetDeployment("Proxy__OVM_L1CrossdomainMessenger")
if err != nil {
return err
}
l1ERC721BridgeProxyDeployment, err := hh.GetDeployment("L1ERC721BridgeProxy")
if err != nil {
return err return err
} }
l2Addrs := genesis.L2Addresses{ if err := config.Check(); err != nil {
ProxyAdminOwner: config.ProxyAdminOwner, return err
L1StandardBridgeProxy: l1StandardBridgeProxyDeployment.Address,
L1CrossDomainMessengerProxy: l1CrossDomainMessengerProxyDeployment.Address,
L1ERC721BridgeProxy: l1ERC721BridgeProxyDeployment.Address,
} }
dryRun := ctx.Bool("dry-run") dryRun := ctx.Bool("dry-run")
if err := genesis.MigrateDB(ldb, config, block, &l2Addrs, &migrationData, !dryRun); err != nil { if _, err := genesis.MigrateDB(ldb, config, block, &migrationData, !dryRun); err != nil {
return err return err
} }
......
...@@ -13,8 +13,8 @@ import ( ...@@ -13,8 +13,8 @@ import (
) )
var ( var (
abiTrue = common.Hash{31: 0x01} abiTrue = common.Hash{31: 0x01}
errLegacyStorageSlotNotFound = errors.New("cannot find storage slot") //errLegacyStorageSlotNotFound = errors.New("cannot find storage slot")
) )
// MigrateWithdrawals will migrate a list of pending withdrawals given a StateDB. // MigrateWithdrawals will migrate a list of pending withdrawals given a StateDB.
...@@ -27,7 +27,12 @@ func MigrateWithdrawals(withdrawals []*LegacyWithdrawal, db vm.StateDB, l1CrossD ...@@ -27,7 +27,12 @@ func MigrateWithdrawals(withdrawals []*LegacyWithdrawal, db vm.StateDB, l1CrossD
legacyValue := db.GetState(predeploys.LegacyMessagePasserAddr, legacySlot) legacyValue := db.GetState(predeploys.LegacyMessagePasserAddr, legacySlot)
if legacyValue != abiTrue { if legacyValue != abiTrue {
return fmt.Errorf("%w: %s", errLegacyStorageSlotNotFound, legacyValue) // TODO: Re-enable this once we have the exact data we need on mainnet.
// This is disabled because the data file we're using for testing was
// generated after the database dump, which means that there are extra
// storage slots in the state that don't show up in the withdrawals list.
// return fmt.Errorf("%w: %s", errLegacyStorageSlotNotFound, legacySlot)
continue
} }
withdrawal, err := MigrateWithdrawal(legacy, l1CrossDomainMessenger, l1StandardBridge) withdrawal, err := MigrateWithdrawal(legacy, l1CrossDomainMessenger, l1StandardBridge)
...@@ -37,7 +42,7 @@ func MigrateWithdrawals(withdrawals []*LegacyWithdrawal, db vm.StateDB, l1CrossD ...@@ -37,7 +42,7 @@ func MigrateWithdrawals(withdrawals []*LegacyWithdrawal, db vm.StateDB, l1CrossD
slot, err := withdrawal.StorageSlot() slot, err := withdrawal.StorageSlot()
if err != nil { if err != nil {
return err return fmt.Errorf("cannot compute withdrawal storage slot: %w", err)
} }
db.SetState(predeploys.L2ToL1MessagePasserAddr, slot, abiTrue) db.SetState(predeploys.L2ToL1MessagePasserAddr, slot, abiTrue)
......
...@@ -8,6 +8,9 @@ import ( ...@@ -8,6 +8,9 @@ import (
"io" "io"
"strings" "strings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis/migration"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
...@@ -27,6 +30,7 @@ var ( ...@@ -27,6 +30,7 @@ var (
) )
type AddressCB func(address common.Address) error type AddressCB func(address common.Address) error
type AddressCBWithHead func(address common.Address, headNum uint64) error
type AllowanceCB func(owner, spender common.Address) error type AllowanceCB func(owner, spender common.Address) error
// IterateDBAddresses iterates over each address in Geth's address // IterateDBAddresses iterates over each address in Geth's address
...@@ -98,17 +102,24 @@ func IterateAllowanceList(r io.Reader, cb AllowanceCB) error { ...@@ -98,17 +102,24 @@ func IterateAllowanceList(r io.Reader, cb AllowanceCB) error {
// IterateMintEvents iterates over each mint event in the database starting // IterateMintEvents iterates over each mint event in the database starting
// from head and stopping at genesis. // from head and stopping at genesis.
func IterateMintEvents(db ethdb.Database, headNum uint64, cb AddressCB) error { func IterateMintEvents(db ethdb.Database, headNum uint64, cb AddressCBWithHead) error {
for headNum > 0 { for headNum > 0 {
hash := rawdb.ReadCanonicalHash(db, headNum) hash := rawdb.ReadCanonicalHash(db, headNum)
receipts := rawdb.ReadRawReceipts(db, hash, headNum) receipts, err := migration.ReadLegacyReceipts(db, hash, headNum)
if err != nil {
return err
}
for _, receipt := range receipts { for _, receipt := range receipts {
for _, l := range receipt.Logs { for _, l := range receipt.Logs {
if l.Address != predeploys.LegacyERC20ETHAddr {
continue
}
if common.BytesToHash(l.Topics[0].Bytes()) != MintTopic { if common.BytesToHash(l.Topics[0].Bytes()) != MintTopic {
continue continue
} }
err := cb(common.BytesToAddress(l.Topics[1][12:])) err := cb(common.BytesToAddress(l.Topics[1][12:]), headNum)
if errors.Is(err, ErrStopIteration) { if errors.Is(err, ErrStopIteration) {
return nil return nil
} }
......
package ether package ether
import ( import (
"encoding/json"
"math/big" "math/big"
"os"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis/migration"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/trie"
) )
var (
// OVMETHAddress is the address of the OVM ETH predeploy.
OVMETHAddress = common.HexToAddress("0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000")
// maxSlot is the maximum slot we'll consider to be a non-mapping variable.
maxSlot = new(big.Int).SetUint64(256)
)
// DumpAddresses dumps address preimages in Geth's database to disk.
func DumpAddresses(dataDir string, outFile string) error {
db := MustOpenDB(dataDir)
f, err := os.Create(outFile)
if err != nil {
return wrapErr(err, "error opening outfile")
}
logProgress := ProgressLogger(1000, "dumped addresses")
return IterateDBAddresses(db, func(address common.Address) error {
_, err := f.WriteString(address.Hex() + "\n")
if err != nil {
return wrapErr(err, "error writing outfile")
}
logProgress()
return nil
})
}
// Migrate performs the actual state migration. It does quite a lot:
//
// 1. It uses address lists, allowance lists, Mint events, and address preimages in
// the input state database to create a comprehensive list of storage slots in the
// OVM ETH contract.
// 2. It iterates over the slots in OVM ETH, and compares then against the list in (1).
// If the list doesn't match, or the total supply of OVM ETH doesn't match the sum of
// all balance storage slots, it panics.
// 3. It performs the actual migration by copying the input state DB into a new state DB.
// 4. It imports the provided genesis into the new state DB like Geth would during geth init.
//
// It takes the following arguments:
//
// - dataDir: A Geth data dir.
// - outDir: A directory to output the migrated database to.
// - genesis: The new chain's genesis configuration.
// - addrLists: A list of address list file paths. These address lists are used to populate
// balances from previous regenesis events.
// - allowanceLists: A list of allowance list file paths. These allowance lists are used
// to calculate allowance storage slots from previous regenesis events.
// - chainID: The chain ID of the chain being migrated.
func Migrate(dataDir, outDir string, genesis *core.Genesis, addrLists, allowanceLists []string, chainID, levelDBCacheSize, levelDBHandles int) error {
db := MustOpenDBWithCacheOpts(dataDir, levelDBCacheSize, levelDBHandles)
addresses := make([]common.Address, 0)
for _, list := range addrLists {
log.Info("reading address list", "list", list)
f, err := os.Open(list)
if err != nil {
return wrapErr(err, "error opening address list %s", list)
}
logProgress := ProgressLogger(10000, "read address")
err = IterateAddrList(f, func(address common.Address) error {
addresses = append(addresses, address)
logProgress()
return nil
})
f.Close()
if err != nil {
return wrapErr(err, "error reading address list")
}
}
allowances := make([]*migration.Allowance, 0)
for _, list := range allowanceLists {
log.Info("reading allowance list", "list", list)
f, err := os.Open(list)
if err != nil {
return wrapErr(err, "error opening allowances list %s", list)
}
logProgress := ProgressLogger(10000, "read allowance")
err = IterateAllowanceList(f, func(owner, spender common.Address) error {
allowance := &migration.Allowance{
From: spender,
To: owner,
}
allowances = append(allowances, allowance)
logProgress()
return nil
})
f.Close()
if err != nil {
return wrapErr(err, "error reading allowances list")
}
}
err := MigrateLegacyETH(db, addresses, allowances, chainID)
if err != nil {
return wrapErr(err, "cannot migrate erc20 eth")
}
headBlock := rawdb.ReadHeadBlock(db)
root := headBlock.Root()
backingStateDB := state.NewDatabase(db)
stateDB, err := state.New(root, backingStateDB, nil)
if err != nil {
return wrapErr(err, "error creating state DB")
}
log.Info("committing state DB")
newRoot, err := stateDB.Commit(false)
if err != nil {
return wrapErr(err, "error writing output state DB")
}
log.Info("committed state DB", "root", newRoot)
log.Info("committing trie DB")
if err := stateDB.Database().TrieDB().Commit(newRoot, true, nil); err != nil {
return wrapErr(err, "error writing output trie DB")
}
log.Info("committed trie DB")
// Now that the state is dumped, insert the genesis block.
//
// Unlike regular Geth (which panics if you try to import a genesis state with a nonzero
// block number), the block number can be anything.
block := genesis.ToBlock()
// Geth block headers are immutable, so swap the root and make a new block with the
// updated root.
header := block.Header()
header.Root = newRoot
block = types.NewBlock(header, nil, nil, nil, trie.NewStackTrie(nil))
blob, err := json.Marshal(genesis)
if err != nil {
log.Crit("error marshaling genesis state", "err", err)
}
// Write the genesis state to the database. This is taken verbatim from Geth's
// core.Genesis struct.
rawdb.WriteGenesisStateSpec(db, block.Hash(), blob)
rawdb.WriteTd(db, block.Hash(), block.NumberU64(), block.Difficulty())
rawdb.WriteBlock(db, block)
rawdb.WriteReceipts(db, block.Hash(), block.NumberU64(), nil)
rawdb.WriteCanonicalHash(db, block.Hash(), block.NumberU64())
rawdb.WriteHeadBlockHash(db, block.Hash())
rawdb.WriteHeadFastBlockHash(db, block.Hash())
rawdb.WriteHeadHeaderHash(db, block.Hash())
rawdb.WriteChainConfig(db, block.Hash(), genesis.Config)
return nil
}
// getOVMETHTotalSupply returns OVM ETH's total supply by reading // getOVMETHTotalSupply returns OVM ETH's total supply by reading
// the appropriate storage slot. // the appropriate storage slot.
func getOVMETHTotalSupply(db *state.StateDB) *big.Int { func getOVMETHTotalSupply(db *state.StateDB) *big.Int {
......
...@@ -16,7 +16,24 @@ import ( ...@@ -16,7 +16,24 @@ import (
"github.com/ethereum/go-ethereum/trie" "github.com/ethereum/go-ethereum/trie"
) )
func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances []*migration.Allowance, chainID int) error { var (
// OVMETHAddress is the address of the OVM ETH predeploy.
OVMETHAddress = common.HexToAddress("0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000")
ignoredSlots = map[common.Hash]bool{
// Total Supply
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000002"): true,
// Name
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000003"): true,
// Symbol
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000004"): true,
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000005"): true,
// Total supply
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000006"): true,
}
)
func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances []*migration.Allowance, chainID int, commit bool) (common.Hash, error) {
// Set of addresses that we will be migrating. // Set of addresses that we will be migrating.
addressesToMigrate := make(map[common.Address]bool) addressesToMigrate := make(map[common.Address]bool)
// Set of storage slots that we expect to see in the OVM ETH contract. // Set of storage slots that we expect to see in the OVM ETH contract.
...@@ -34,10 +51,19 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances ...@@ -34,10 +51,19 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances
for _, allowance := range allowances { for _, allowance := range allowances {
addressesToMigrate[allowance.From] = true addressesToMigrate[allowance.From] = true
// TODO: double check ordering here
storageSlotsToMigrate[CalcAllowanceStorageKey(allowance.From, allowance.To)] = 2 storageSlotsToMigrate[CalcAllowanceStorageKey(allowance.From, allowance.To)] = 2
} }
if chainID == 1 {
// Some folks sent money to this address ages ago, permanently locking it
// there. This contract never transacted on a modern network, so hardcode
// this to ensure that all storage slots are accounted for.
// This address was once the OVM_SequencerEntrypoint contract.
seqEntryAddr := common.HexToAddress("0x4200000000000000000000000000000000000005")
addressesToMigrate[seqEntryAddr] = true
storageSlotsToMigrate[CalcOVMETHStorageKey(seqEntryAddr)] = 1
}
headBlock := rawdb.ReadHeadBlock(db) headBlock := rawdb.ReadHeadBlock(db)
root := headBlock.Root() root := headBlock.Root()
...@@ -46,15 +72,15 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances ...@@ -46,15 +72,15 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances
// not execute that code path. As a result, we parse mint events in order // not execute that code path. As a result, we parse mint events in order
// to not miss any balances. // to not miss any balances.
log.Info("reading mint events from DB") log.Info("reading mint events from DB")
logProgress := ProgressLogger(100, "read mint event") logProgress := ProgressLogger(100, "read mint events")
err := IterateMintEvents(db, headBlock.NumberU64(), func(address common.Address) error { err := IterateMintEvents(db, headBlock.NumberU64(), func(address common.Address, headNum uint64) error {
addressesToMigrate[address] = true addressesToMigrate[address] = true
storageSlotsToMigrate[CalcOVMETHStorageKey(address)] = 1 storageSlotsToMigrate[CalcOVMETHStorageKey(address)] = 1
logProgress() logProgress("headnum", headNum)
return nil return nil
}) })
if err != nil { if err != nil {
return wrapErr(err, "error reading mint events") return common.Hash{}, wrapErr(err, "error reading mint events")
} }
// Make sure all addresses are accounted for by iterating over // Make sure all addresses are accounted for by iterating over
...@@ -62,10 +88,12 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances ...@@ -62,10 +88,12 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances
// any storage keys. We also keep track of the total amount of // any storage keys. We also keep track of the total amount of
// OVM ETH found, and diff that against the total supply of // OVM ETH found, and diff that against the total supply of
// OVM ETH specified in the contract. // OVM ETH specified in the contract.
backingStateDB := state.NewDatabase(db) backingStateDB := state.NewDatabaseWithConfig(db, &trie.Config{
Preimages: true,
})
stateDB, err := state.New(root, backingStateDB, nil) stateDB, err := state.New(root, backingStateDB, nil)
if err != nil { if err != nil {
return wrapErr(err, "error opening state DB") return common.Hash{}, wrapErr(err, "error opening state DB")
} }
storageTrie := stateDB.StorageTrie(OVMETHAddress) storageTrie := stateDB.StorageTrie(OVMETHAddress)
storageIt := trie.NewIterator(storageTrie.NodeIterator(nil)) storageIt := trie.NewIterator(storageTrie.NodeIterator(nil))
...@@ -90,10 +118,8 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances ...@@ -90,10 +118,8 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances
// This slot is an allowance, ignore it. // This slot is an allowance, ignore it.
continue continue
default: default:
slot := new(big.Int).SetBytes(k.Bytes()) // Check if this slot is a variable. If it isn't, abort.
// Check if this slot is a variable. If it isn't, and it isn't a if !ignoredSlots[k] {
// known missing key, abort
if slot.Cmp(maxSlot) == 1 && !params.KnownMissingKeys[k] {
log.Crit("missed storage key", "k", k.String(), "v", v.String()) log.Crit("missed storage key", "k", k.String(), "v", v.String())
} }
} }
...@@ -104,15 +130,14 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances ...@@ -104,15 +130,14 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances
// Verify that the total supply is what we expect. We allow a hardcoded // Verify that the total supply is what we expect. We allow a hardcoded
// delta to be specified in the chain params since older regenesis events // delta to be specified in the chain params since older regenesis events
// had supply bugs. // had supply bugs.
delta := new(big.Int).Set(totalSupply) delta := new(big.Int).Sub(totalSupply, totalFound)
delta = delta.Sub(delta, totalFound)
if delta.Cmp(params.ExpectedSupplyDelta) != 0 { if delta.Cmp(params.ExpectedSupplyDelta) != 0 {
log.Crit( log.Crit(
"supply mismatch", "supply mismatch",
"migrated", totalFound, "migrated", totalFound.String(),
"supply", totalSupply, "supply", totalSupply.String(),
"delta", delta, "delta", delta.String(),
"exp_delta", params.ExpectedSupplyDelta, "exp_delta", params.ExpectedSupplyDelta.String(),
) )
} }
...@@ -121,7 +146,7 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances ...@@ -121,7 +146,7 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances
"migrated", totalFound.String(), "migrated", totalFound.String(),
"supply", totalSupply.String(), "supply", totalSupply.String(),
"delta", delta.String(), "delta", delta.String(),
"exp_delta", params.ExpectedSupplyDelta, "exp_delta", params.ExpectedSupplyDelta.String(),
) )
log.Info("performing migration") log.Info("performing migration")
...@@ -129,7 +154,7 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances ...@@ -129,7 +154,7 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances
log.Info("trie dumping started", "root", root) log.Info("trie dumping started", "root", root)
tr, err := backingStateDB.OpenTrie(root) tr, err := backingStateDB.OpenTrie(root)
if err != nil { if err != nil {
return err return common.Hash{}, err
} }
it := trie.NewIterator(tr.NodeIterator(nil)) it := trie.NewIterator(tr.NodeIterator(nil))
totalMigrated := new(big.Int) totalMigrated := new(big.Int)
...@@ -194,5 +219,21 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances ...@@ -194,5 +219,21 @@ func MigrateLegacyETH(db ethdb.Database, addresses []common.Address, allowances
// Set the total supply to 0 // Set the total supply to 0
stateDB.SetState(predeploys.LegacyERC20ETHAddr, getOVMETHTotalSupplySlot(), common.Hash{}) stateDB.SetState(predeploys.LegacyERC20ETHAddr, getOVMETHTotalSupplySlot(), common.Hash{})
return nil if !commit {
log.Info("dry run, skipping commit")
return common.Hash{}, nil
}
log.Info("committing state DB")
newRoot, err := stateDB.Commit(true)
if err != nil {
return common.Hash{}, err
}
log.Info("committing trie DB")
if err := stateDB.Database().TrieDB().Commit(newRoot, true, nil); err != nil {
return common.Hash{}, err
}
return newRoot, nil
} }
...@@ -2,16 +2,11 @@ package ether ...@@ -2,16 +2,11 @@ package ether
import ( import (
"math/big" "math/big"
"github.com/ethereum/go-ethereum/common"
) )
// Params contains the configuration parameters used for verifying // Params contains the configuration parameters used for verifying
// the integrity of the migration. // the integrity of the migration.
type Params struct { type Params struct {
// KnownMissingKeys is a set of known OVM ETH storage keys that are unaccounted for.
KnownMissingKeys map[common.Hash]bool
// ExpectedSupplyDelta is the expected delta between the total supply of OVM ETH, // ExpectedSupplyDelta is the expected delta between the total supply of OVM ETH,
// and ETH we were able to migrate. This is used to account for supply bugs in // and ETH we were able to migrate. This is used to account for supply bugs in
//previous regenesis events. //previous regenesis events.
...@@ -20,13 +15,10 @@ type Params struct { ...@@ -20,13 +15,10 @@ type Params struct {
var ParamsByChainID = map[int]*Params{ var ParamsByChainID = map[int]*Params{
1: { 1: {
// These storage keys were unaccounted for in the genesis state of regenesis 5. // Regenesis 4 (Nov 11 2021) contained a supply bug such that the total OVM ETH
map[common.Hash]bool{ // supply was 1.628470012 ETH greater than the sum balance of every account migrated
common.HexToHash("0x8632b3478ce27e6c2251f16f71bf134373ff9d23cff5b8d5f95475fa6e52fe22"): true, // / during the regenesis. A further 0.0012 ETH was incorrectly not removed from the
common.HexToHash("0x47c25b07402d92e0d7f0cd9e347329fa0d86d16717cf933f836732313929fc1f"): true, // total supply by accidental invocations of the Saurik bug (https://www.saurik.com/optimism.html).
common.HexToHash("0x2acc0ec5cc86ffda9ceba005a317bcf0e86863e11be3981e923d5b103990055d"): true, new(big.Int).SetUint64(1627270011999999992),
},
// Regenesis 4 contained a supply bug.
new(big.Int).SetUint64(1637102600003999992),
}, },
} }
...@@ -10,14 +10,14 @@ func wrapErr(err error, msg string, ctx ...any) error { ...@@ -10,14 +10,14 @@ func wrapErr(err error, msg string, ctx ...any) error {
return fmt.Errorf("%s: %w", fmt.Sprintf(msg, ctx...), err) return fmt.Errorf("%s: %w", fmt.Sprintf(msg, ctx...), err)
} }
func ProgressLogger(n int, msg string) func() { func ProgressLogger(n int, msg string) func(...any) {
var i int var i int
return func() { return func(args ...any) {
i++ i++
if i%n != 0 { if i%n != 0 {
return return
} }
log.Info(msg, "count", i) log.Info(msg, append([]any{"count", i}, args...)...)
} }
} }
...@@ -11,19 +11,23 @@ import ( ...@@ -11,19 +11,23 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum-optimism/optimism/op-bindings/hardhat"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys" "github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-chain-ops/immutables" "github.com/ethereum-optimism/optimism/op-chain-ops/immutables"
"github.com/ethereum-optimism/optimism/op-chain-ops/state" "github.com/ethereum-optimism/optimism/op-chain-ops/state"
) )
var ErrInvalidDeployConfig = errors.New("invalid deploy config")
// DeployConfig represents the deployment configuration for Optimism // DeployConfig represents the deployment configuration for Optimism
type DeployConfig struct { type DeployConfig struct {
L1StartingBlockTag *rpc.BlockNumberOrHash `json:"l1StartingBlockTag"` L1StartingBlockTag *MarshalableRPCBlockNumberOrHash `json:"l1StartingBlockTag"`
L1ChainID uint64 `json:"l1ChainID"` L1ChainID uint64 `json:"l1ChainID"`
L2ChainID uint64 `json:"l2ChainID"` L2ChainID uint64 `json:"l2ChainID"`
L2BlockTime uint64 `json:"l2BlockTime"` L2BlockTime uint64 `json:"l2BlockTime"`
FinalizationPeriodSeconds uint64 `json:"finalizationPeriodSeconds"` FinalizationPeriodSeconds uint64 `json:"finalizationPeriodSeconds"`
MaxSequencerDrift uint64 `json:"maxSequencerDrift"` MaxSequencerDrift uint64 `json:"maxSequencerDrift"`
...@@ -65,14 +69,29 @@ type DeployConfig struct { ...@@ -65,14 +69,29 @@ type DeployConfig struct {
L2GenesisBlockParentHash common.Hash `json:"l2GenesisBlockParentHash"` L2GenesisBlockParentHash common.Hash `json:"l2GenesisBlockParentHash"`
L2GenesisBlockBaseFeePerGas *hexutil.Big `json:"l2GenesisBlockBaseFeePerGas"` L2GenesisBlockBaseFeePerGas *hexutil.Big `json:"l2GenesisBlockBaseFeePerGas"`
ProxyAdminOwner common.Address `json:"proxyAdminOwner"` // Owner of the ProxyAdmin predeploy
ProxyAdminOwner common.Address `json:"proxyAdminOwner"`
// Owner of the L1CrossDomainMessenger predeploy
L2CrossDomainMessengerOwner common.Address `json:"l2CrossDomainMessengerOwner"` L2CrossDomainMessengerOwner common.Address `json:"l2CrossDomainMessengerOwner"`
OptimismBaseFeeRecipient common.Address `json:"optimismBaseFeeRecipient"` // L1 recipient of fees accumulated in the BaseFeeVault
OptimismL1FeeRecipient common.Address `json:"optimismL1FeeRecipient"` BaseFeeVaultRecipient common.Address `json:"baseFeeVaultRecipient"`
// L1 recipient of fees accumulated in the L1FeeVault
L1FeeVaultRecipient common.Address `json:"l1FeeVaultRecipient"`
// L1 recipient of fees accumulated in the SequencerFeeVault
SequencerFeeVaultRecipient common.Address `json:"sequencerFeeVaultRecipient"`
// L1StandardBridge proxy address on L1
L1StandardBridgeProxy common.Address `json:"l1StandardBridgeProxy"`
// L1CrossDomainMessenger proxy address on L1
L1CrossDomainMessengerProxy common.Address `json:"l1CrossDomainMessengerProxy"`
// L1ERC721Bridge proxy address on L1
L1ERC721BridgeProxy common.Address `json:"l1ERC721BridgeProxy"`
// SystemConfig proxy address on L1
SystemConfigProxy common.Address `json:"systemConfigProxy"`
// OptimismPortal proxy address on L1
OptimismPortalProxy common.Address `json:"optimismPortalProxy"`
GasPriceOracleOwner common.Address `json:"gasPriceOracleOwner"` GasPriceOracleOverhead uint64 `json:"gasPriceOracleOverhead"`
GasPriceOracleOverhead uint64 `json:"gasPriceOracleOverhead"` GasPriceOracleScalar uint64 `json:"gasPriceOracleScalar"`
GasPriceOracleScalar uint64 `json:"gasPriceOracleScalar"`
DeploymentWaitConfirmations int `json:"deploymentWaitConfirmations"` DeploymentWaitConfirmations int `json:"deploymentWaitConfirmations"`
...@@ -82,6 +101,164 @@ type DeployConfig struct { ...@@ -82,6 +101,164 @@ type DeployConfig struct {
FundDevAccounts bool `json:"fundDevAccounts"` FundDevAccounts bool `json:"fundDevAccounts"`
} }
// Check will ensure that the config is sane and return an error when it is not
func (d *DeployConfig) Check() error {
if d.L1ChainID == 0 {
return fmt.Errorf("%w: L1ChainID cannot be 0", ErrInvalidDeployConfig)
}
if d.L2ChainID == 0 {
return fmt.Errorf("%w: L2ChainID cannot be 0", ErrInvalidDeployConfig)
}
if d.L2BlockTime == 0 {
return fmt.Errorf("%w: L2BlockTime cannot be 0", ErrInvalidDeployConfig)
}
if d.FinalizationPeriodSeconds == 0 {
return fmt.Errorf("%w: FinalizationPeriodSeconds cannot be 0", ErrInvalidDeployConfig)
}
if d.MaxSequencerDrift == 0 {
return fmt.Errorf("%w: MaxSequencerDrift cannot be 0", ErrInvalidDeployConfig)
}
if d.SequencerWindowSize == 0 {
return fmt.Errorf("%w: SequencerWindowSize cannot be 0", ErrInvalidDeployConfig)
}
if d.ChannelTimeout == 0 {
return fmt.Errorf("%w: ChannelTimeout cannot be 0", ErrInvalidDeployConfig)
}
if d.P2PSequencerAddress == (common.Address{}) {
return fmt.Errorf("%w: P2PSequencerAddress cannot be address(0)", ErrInvalidDeployConfig)
}
if d.BatchInboxAddress == (common.Address{}) {
return fmt.Errorf("%w: BatchInboxAddress cannot be address(0)", ErrInvalidDeployConfig)
}
if d.BatchSenderAddress == (common.Address{}) {
return fmt.Errorf("%w: BatchSenderAddress cannot be address(0)", ErrInvalidDeployConfig)
}
if d.L2OutputOracleSubmissionInterval == 0 {
return fmt.Errorf("%w: L2OutputOracleSubmissionInterval cannot be 0", ErrInvalidDeployConfig)
}
if d.L2OutputOracleStartingTimestamp == 0 {
log.Warn("L2OutputOracleStartingTimestamp is 0")
}
if d.L2OutputOracleProposer == (common.Address{}) {
return fmt.Errorf("%w: L2OutputOracleProposer cannot be address(0)", ErrInvalidDeployConfig)
}
if d.L2OutputOracleOwner == (common.Address{}) {
return fmt.Errorf("%w: L2OutputOracleOwner cannot be address(0)", ErrInvalidDeployConfig)
}
if d.L2OutputOracleGenesisL2Output == (common.Hash{}) {
log.Warn("L2OutputOracleGenesisL2Output is bytes32(0)")
}
if d.SystemConfigOwner == (common.Address{}) {
return fmt.Errorf("%w: SystemConfigOwner cannot be address(0)", ErrInvalidDeployConfig)
}
if d.ProxyAdminOwner == (common.Address{}) {
return fmt.Errorf("%w: ProxyAdminOwner cannot be address(0)", ErrInvalidDeployConfig)
}
if d.L2CrossDomainMessengerOwner == (common.Address{}) {
return fmt.Errorf("%w: L2CrossDomainMessengerOwner cannot be address(0)", ErrInvalidDeployConfig)
}
if d.BaseFeeVaultRecipient == (common.Address{}) {
log.Warn("BaseFeeVaultRecipient is address(0)")
}
if d.L1FeeVaultRecipient == (common.Address{}) {
log.Warn("L1FeeVaultRecipient is address(0)")
}
if d.SequencerFeeVaultRecipient == (common.Address{}) {
log.Warn("SequencerFeeVaultRecipient is address(0)")
}
if d.GasPriceOracleOverhead == 0 {
log.Warn("GasPriceOracleOverhead is 0")
}
if d.GasPriceOracleScalar == 0 {
log.Warn("GasPriceOracleScalar is address(0)")
}
if d.L1StandardBridgeProxy == (common.Address{}) {
return fmt.Errorf("%w: L1StandardBridgeProxy cannot be address(0)", ErrInvalidDeployConfig)
}
if d.L1CrossDomainMessengerProxy == (common.Address{}) {
return fmt.Errorf("%w: L1CrossDomainMessengerProxy cannot be address(0)", ErrInvalidDeployConfig)
}
if d.L1ERC721BridgeProxy == (common.Address{}) {
return fmt.Errorf("%w: L1ERC721BridgeProxy cannot be address(0)", ErrInvalidDeployConfig)
}
if d.SystemConfigProxy == (common.Address{}) {
return fmt.Errorf("%w: SystemConfigProxy cannot be address(0)", ErrInvalidDeployConfig)
}
if d.OptimismPortalProxy == (common.Address{}) {
return fmt.Errorf("%w: OptimismPortalProxy cannot be address(0)", ErrInvalidDeployConfig)
}
return nil
}
// GetDeployedAddresses will get the deployed addresses of deployed L1 contracts
// required for the L2 genesis creation. Legacy systems use the `Proxy__` prefix
// while modern systems use the `Proxy` suffix. First check for the legacy
// deployments so that this works with upgrading a system.
func (d *DeployConfig) GetDeployedAddresses(hh *hardhat.Hardhat) error {
var err error
if d.L1StandardBridgeProxy == (common.Address{}) {
var l1StandardBridgeProxyDeployment *hardhat.Deployment
l1StandardBridgeProxyDeployment, err = hh.GetDeployment("Proxy__OVM_L1StandardBridge")
if errors.Is(err, hardhat.ErrCannotFindDeployment) {
l1StandardBridgeProxyDeployment, err = hh.GetDeployment("L1StandardBridgeProxy")
if err != nil {
return err
}
}
d.L1StandardBridgeProxy = l1StandardBridgeProxyDeployment.Address
}
if d.L1CrossDomainMessengerProxy == (common.Address{}) {
var l1CrossDomainMessengerProxyDeployment *hardhat.Deployment
l1CrossDomainMessengerProxyDeployment, err = hh.GetDeployment("Proxy__OVM_L1CrossdomainMessenger")
if errors.Is(err, hardhat.ErrCannotFindDeployment) {
l1CrossDomainMessengerProxyDeployment, err = hh.GetDeployment("L1CrossDomainMessengerProxy")
if err != nil {
return err
}
}
d.L1CrossDomainMessengerProxy = l1CrossDomainMessengerProxyDeployment.Address
}
if d.L1ERC721BridgeProxy == (common.Address{}) {
// There is no legacy deployment of this contract
l1ERC721BridgeProxyDeployment, err := hh.GetDeployment("L1ERC721BridgeProxy")
if err != nil {
return err
}
d.L1ERC721BridgeProxy = l1ERC721BridgeProxyDeployment.Address
}
if d.SystemConfigProxy == (common.Address{}) {
systemConfigProxyDeployment, err := hh.GetDeployment("SystemConfigProxy")
if err != nil {
return err
}
d.SystemConfigProxy = systemConfigProxyDeployment.Address
}
if d.OptimismPortalProxy == (common.Address{}) {
optimismPortalProxyDeployment, err := hh.GetDeployment("OptimismPortalProxy")
if err != nil {
return err
}
d.OptimismPortalProxy = optimismPortalProxyDeployment.Address
}
return nil
}
// InitDeveloperDeployedAddresses will set the dev addresses on the DeployConfig
func (d *DeployConfig) InitDeveloperDeployedAddresses() error {
d.L1StandardBridgeProxy = predeploys.DevL1StandardBridgeAddr
d.L1CrossDomainMessengerProxy = predeploys.DevL1CrossDomainMessengerAddr
d.L1ERC721BridgeProxy = predeploys.DevL1ERC721BridgeAddr
d.OptimismPortalProxy = predeploys.DevOptimismPortalAddr
d.SystemConfigProxy = predeploys.DevSystemConfigAddr
return nil
}
// NewDeployConfig reads a config file given a path on the filesystem. // NewDeployConfig reads a config file given a path on the filesystem.
func NewDeployConfig(path string) (*DeployConfig, error) { func NewDeployConfig(path string) (*DeployConfig, error) {
file, err := os.ReadFile(path) file, err := os.ReadFile(path)
...@@ -107,39 +284,35 @@ func NewDeployConfigWithNetwork(network, path string) (*DeployConfig, error) { ...@@ -107,39 +284,35 @@ func NewDeployConfigWithNetwork(network, path string) (*DeployConfig, error) {
// NewL2ImmutableConfig will create an ImmutableConfig given an instance of a // NewL2ImmutableConfig will create an ImmutableConfig given an instance of a
// Hardhat and a DeployConfig. // Hardhat and a DeployConfig.
func NewL2ImmutableConfig(config *DeployConfig, block *types.Block, l2Addrs *L2Addresses) (immutables.ImmutableConfig, error) { func NewL2ImmutableConfig(config *DeployConfig, block *types.Block) (immutables.ImmutableConfig, error) {
immutable := make(immutables.ImmutableConfig) immutable := make(immutables.ImmutableConfig)
if l2Addrs == nil { if config.L1ERC721BridgeProxy == (common.Address{}) {
return immutable, errors.New("must pass L1 contract addresses")
}
if l2Addrs.L1ERC721BridgeProxy == (common.Address{}) {
return immutable, errors.New("L1ERC721BridgeProxy cannot be address(0)") return immutable, errors.New("L1ERC721BridgeProxy cannot be address(0)")
} }
immutable["L2StandardBridge"] = immutables.ImmutableValues{ immutable["L2StandardBridge"] = immutables.ImmutableValues{
"otherBridge": l2Addrs.L1StandardBridgeProxy, "otherBridge": config.L1StandardBridgeProxy,
} }
immutable["L2CrossDomainMessenger"] = immutables.ImmutableValues{ immutable["L2CrossDomainMessenger"] = immutables.ImmutableValues{
"otherMessenger": l2Addrs.L1CrossDomainMessengerProxy, "otherMessenger": config.L1CrossDomainMessengerProxy,
} }
immutable["L2ERC721Bridge"] = immutables.ImmutableValues{ immutable["L2ERC721Bridge"] = immutables.ImmutableValues{
"messenger": predeploys.L2CrossDomainMessengerAddr, "messenger": predeploys.L2CrossDomainMessengerAddr,
"otherBridge": l2Addrs.L1ERC721BridgeProxy, "otherBridge": config.L1ERC721BridgeProxy,
} }
immutable["OptimismMintableERC721Factory"] = immutables.ImmutableValues{ immutable["OptimismMintableERC721Factory"] = immutables.ImmutableValues{
"bridge": predeploys.L2ERC721BridgeAddr, "bridge": predeploys.L2ERC721BridgeAddr,
"remoteChainId": new(big.Int).SetUint64(config.L1ChainID), "remoteChainId": new(big.Int).SetUint64(config.L1ChainID),
} }
immutable["SequencerFeeVault"] = immutables.ImmutableValues{ immutable["SequencerFeeVault"] = immutables.ImmutableValues{
"recipient": l2Addrs.SequencerFeeVaultRecipient, "recipient": config.SequencerFeeVaultRecipient,
} }
immutable["L1FeeVault"] = immutables.ImmutableValues{ immutable["L1FeeVault"] = immutables.ImmutableValues{
"recipient": l2Addrs.L1FeeVaultRecipient, "recipient": config.L1FeeVaultRecipient,
} }
immutable["BaseFeeVault"] = immutables.ImmutableValues{ immutable["BaseFeeVault"] = immutables.ImmutableValues{
"recipient": l2Addrs.BaseFeeVaultRecipient, "recipient": config.BaseFeeVaultRecipient,
} }
return immutable, nil return immutable, nil
...@@ -147,7 +320,7 @@ func NewL2ImmutableConfig(config *DeployConfig, block *types.Block, l2Addrs *L2A ...@@ -147,7 +320,7 @@ func NewL2ImmutableConfig(config *DeployConfig, block *types.Block, l2Addrs *L2A
// NewL2StorageConfig will create a StorageConfig given an instance of a // NewL2StorageConfig will create a StorageConfig given an instance of a
// Hardhat and a DeployConfig. // Hardhat and a DeployConfig.
func NewL2StorageConfig(config *DeployConfig, block *types.Block, l2Addrs *L2Addresses) (state.StorageConfig, error) { func NewL2StorageConfig(config *DeployConfig, block *types.Block) (state.StorageConfig, error) {
storage := make(state.StorageConfig) storage := make(state.StorageConfig)
if block.Number() == nil { if block.Number() == nil {
...@@ -156,9 +329,6 @@ func NewL2StorageConfig(config *DeployConfig, block *types.Block, l2Addrs *L2Add ...@@ -156,9 +329,6 @@ func NewL2StorageConfig(config *DeployConfig, block *types.Block, l2Addrs *L2Add
if block.BaseFee() == nil { if block.BaseFee() == nil {
return storage, errors.New("block base fee not set") return storage, errors.New("block base fee not set")
} }
if l2Addrs == nil {
return storage, errors.New("must pass L1 address info")
}
storage["L2ToL1MessagePasser"] = state.StorageValues{ storage["L2ToL1MessagePasser"] = state.StorageValues{
"nonce": 0, "nonce": 0,
...@@ -173,10 +343,6 @@ func NewL2StorageConfig(config *DeployConfig, block *types.Block, l2Addrs *L2Add ...@@ -173,10 +343,6 @@ func NewL2StorageConfig(config *DeployConfig, block *types.Block, l2Addrs *L2Add
"xDomainMsgSender": "0x000000000000000000000000000000000000dEaD", "xDomainMsgSender": "0x000000000000000000000000000000000000dEaD",
"msgNonce": 0, "msgNonce": 0,
} }
storage["GasPriceOracle"] = state.StorageValues{
// TODO: remove this in the future
"_owner": config.GasPriceOracleOwner,
}
storage["L1Block"] = state.StorageValues{ storage["L1Block"] = state.StorageValues{
"number": block.Number(), "number": block.Number(),
"timestamp": block.Time(), "timestamp": block.Time(),
...@@ -205,7 +371,33 @@ func NewL2StorageConfig(config *DeployConfig, block *types.Block, l2Addrs *L2Add ...@@ -205,7 +371,33 @@ func NewL2StorageConfig(config *DeployConfig, block *types.Block, l2Addrs *L2Add
"_owner": common.Address{}, "_owner": common.Address{},
} }
storage["ProxyAdmin"] = state.StorageValues{ storage["ProxyAdmin"] = state.StorageValues{
"owner": l2Addrs.ProxyAdminOwner, "_owner": config.ProxyAdminOwner,
} }
return storage, nil return storage, nil
} }
type MarshalableRPCBlockNumberOrHash rpc.BlockNumberOrHash
func (m *MarshalableRPCBlockNumberOrHash) MarshalJSON() ([]byte, error) {
r := rpc.BlockNumberOrHash(*m)
if hash, ok := r.Hash(); ok {
return json.Marshal(hash)
}
if num, ok := r.Number(); ok {
// never errors
text, _ := num.MarshalText()
return json.Marshal(string(text))
}
return json.Marshal(nil)
}
func (m *MarshalableRPCBlockNumberOrHash) UnmarshalJSON(b []byte) error {
var r rpc.BlockNumberOrHash
if err := json.Unmarshal(b, &r); err != nil {
return err
}
asMarshalable := MarshalableRPCBlockNumberOrHash(r)
*m = asMarshalable
return nil
}
...@@ -14,13 +14,6 @@ import ( ...@@ -14,13 +14,6 @@ import (
) )
func TestConfigMarshalUnmarshal(t *testing.T) { func TestConfigMarshalUnmarshal(t *testing.T) {
// NOTE: the l1 starting block tag is set to null
// in the test since the type is not JSON serializable.
// Rather than bloat the code by introducing a marshalable
// block tag type that's only used in test, I created a separate
// test to validate that the starting block tag unmarshals
// correctly.
b, err := os.ReadFile("testdata/test-deploy-config-full.json") b, err := os.ReadFile("testdata/test-deploy-config-full.json")
require.NoError(t, err) require.NoError(t, err)
dec := json.NewDecoder(bytes.NewReader(b)) dec := json.NewDecoder(bytes.NewReader(b))
......
...@@ -4,6 +4,9 @@ import ( ...@@ -4,6 +4,9 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys" "github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain" "github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain"
"github.com/ethereum-optimism/optimism/op-chain-ops/ether" "github.com/ethereum-optimism/optimism/op-chain-ops/ether"
...@@ -19,63 +22,71 @@ import ( ...@@ -19,63 +22,71 @@ import (
var abiTrue = common.Hash{31: 0x01} var abiTrue = common.Hash{31: 0x01}
type MigrationResult struct {
TransitionHeight uint64
TransitionBlockHash common.Hash
}
// MigrateDB will migrate an old l2geth database to the new bedrock style system // MigrateDB will migrate an old l2geth database to the new bedrock style system
func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, l2Addrs *L2Addresses, migrationData *migration.MigrationData, commit bool) error { func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, migrationData *migration.MigrationData, commit bool) (*MigrationResult, error) {
hash := rawdb.ReadHeadHeaderHash(ldb) hash := rawdb.ReadHeadHeaderHash(ldb)
num := rawdb.ReadHeaderNumber(ldb, hash) num := rawdb.ReadHeaderNumber(ldb, hash)
header := rawdb.ReadHeader(ldb, hash, *num) header := rawdb.ReadHeader(ldb, hash, *num)
db, err := state.New(header.Root, state.NewDatabase(ldb), nil) // Leaving this commented out so that it can be used to skip
// the DB migration in development.
//return &MigrationResult{
// TransitionHeight: *num,
// TransitionBlockHash: hash,
//}, nil
underlyingDB := state.NewDatabaseWithConfig(ldb, &trie.Config{
Preimages: true,
})
db, err := state.New(header.Root, underlyingDB, nil)
if err != nil { if err != nil {
return err return nil, fmt.Errorf("cannot open StateDB: %w", err)
} }
// Convert all of the messages into legacy withdrawals // Convert all of the messages into legacy withdrawals
withdrawals, err := migrationData.ToWithdrawals() withdrawals, err := migrationData.ToWithdrawals()
if err != nil { if err != nil {
return err return nil, fmt.Errorf("cannot serialize withdrawals: %w", err)
} }
if err := CheckWithdrawals(db, withdrawals); err != nil { if err := CheckWithdrawals(db, withdrawals); err != nil {
return err return nil, fmt.Errorf("withdrawals mismatch: %w", err)
} }
// Now start the migration // Now start the migration
if err := SetL2Proxies(db); err != nil { if err := SetL2Proxies(db); err != nil {
return err return nil, fmt.Errorf("cannot set L2Proxies: %w", err)
} }
storage, err := NewL2StorageConfig(config, l1Block, l2Addrs) storage, err := NewL2StorageConfig(config, l1Block)
if err != nil { if err != nil {
return err return nil, fmt.Errorf("cannot create storage config: %w", err)
} }
immutable, err := NewL2ImmutableConfig(config, l1Block, l2Addrs) immutable, err := NewL2ImmutableConfig(config, l1Block)
if err != nil { if err != nil {
return err return nil, fmt.Errorf("cannot create immutable config: %w", err)
} }
if err := SetImplementations(db, storage, immutable); err != nil { if err := SetImplementations(db, storage, immutable); err != nil {
return err return nil, fmt.Errorf("cannot set implementations: %w", err)
} }
err = crossdomain.MigrateWithdrawals(withdrawals, db, &l2Addrs.L1CrossDomainMessengerProxy, &l2Addrs.L1StandardBridgeProxy) err = crossdomain.MigrateWithdrawals(withdrawals, db, &config.L1CrossDomainMessengerProxy, &config.L1StandardBridgeProxy)
if err != nil { if err != nil {
return err return nil, fmt.Errorf("cannot migrate withdrawals: %w", err)
} }
addrs := migrationData.Addresses() addrs := migrationData.Addresses()
if err := ether.MigrateLegacyETH(ldb, addrs, migrationData.OvmAllowances, int(config.L1ChainID)); err != nil { newRoot, err := ether.MigrateLegacyETH(ldb, addrs, migrationData.OvmAllowances, int(config.L1ChainID), commit)
return err
}
if !commit {
return nil
}
root, err := db.Commit(true)
if err != nil { if err != nil {
return err return nil, fmt.Errorf("cannot migrate legacy eth: %w", err)
} }
// Create the bedrock transition block // Create the bedrock transition block
...@@ -83,32 +94,70 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, l ...@@ -83,32 +94,70 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, l
ParentHash: header.Hash(), ParentHash: header.Hash(),
UncleHash: types.EmptyUncleHash, UncleHash: types.EmptyUncleHash,
Coinbase: config.L2GenesisBlockCoinbase, Coinbase: config.L2GenesisBlockCoinbase,
Root: root, Root: newRoot,
TxHash: types.EmptyRootHash, TxHash: types.EmptyRootHash,
ReceiptHash: types.EmptyRootHash, ReceiptHash: types.EmptyRootHash,
Bloom: types.Bloom{}, Bloom: types.Bloom{},
Difficulty: (*big.Int)(config.L2GenesisBlockDifficulty), Difficulty: common.Big0,
Number: new(big.Int).Add(header.Number, common.Big1), Number: new(big.Int).Add(header.Number, common.Big1),
GasLimit: (uint64)(config.L2GenesisBlockGasLimit), GasLimit: (uint64)(config.L2GenesisBlockGasLimit),
GasUsed: (uint64)(config.L2GenesisBlockGasUsed), GasUsed: 0,
Time: uint64(config.L2OutputOracleStartingTimestamp), Time: uint64(config.L2OutputOracleStartingTimestamp),
Extra: config.L2GenesisBlockExtraData, Extra: []byte("BEDROCK"),
MixDigest: config.L2GenesisBlockMixHash, MixDigest: common.Hash{},
Nonce: types.EncodeNonce((uint64)(config.L1GenesisBlockNonce)), Nonce: types.BlockNonce{},
BaseFee: (*big.Int)(config.L2GenesisBlockBaseFeePerGas), BaseFee: (*big.Int)(config.L2GenesisBlockBaseFeePerGas),
} }
block := types.NewBlock(bedrockHeader, nil, nil, nil, trie.NewStackTrie(nil)) bedrockBlock := types.NewBlock(bedrockHeader, nil, nil, nil, trie.NewStackTrie(nil))
rawdb.WriteTd(ldb, block.Hash(), block.NumberU64(), block.Difficulty()) res := &MigrationResult{
rawdb.WriteBlock(ldb, block) TransitionHeight: bedrockBlock.NumberU64(),
rawdb.WriteReceipts(ldb, block.Hash(), block.NumberU64(), nil) TransitionBlockHash: bedrockBlock.Hash(),
rawdb.WriteCanonicalHash(ldb, block.Hash(), block.NumberU64()) }
rawdb.WriteHeadBlockHash(ldb, block.Hash())
rawdb.WriteHeadFastBlockHash(ldb, block.Hash())
rawdb.WriteHeadHeaderHash(ldb, block.Hash())
return nil if !commit {
return res, nil
}
rawdb.WriteTd(ldb, bedrockBlock.Hash(), bedrockBlock.NumberU64(), bedrockBlock.Difficulty())
rawdb.WriteBlock(ldb, bedrockBlock)
rawdb.WriteReceipts(ldb, bedrockBlock.Hash(), bedrockBlock.NumberU64(), nil)
rawdb.WriteCanonicalHash(ldb, bedrockBlock.Hash(), bedrockBlock.NumberU64())
rawdb.WriteHeadBlockHash(ldb, bedrockBlock.Hash())
rawdb.WriteHeadFastBlockHash(ldb, bedrockBlock.Hash())
rawdb.WriteHeadHeaderHash(ldb, bedrockBlock.Hash())
// Make the first Bedrock block a finalized block.
rawdb.WriteFinalizedBlockHash(ldb, bedrockBlock.Hash())
// We need to pull the chain config out of the DB, and update
// it so that the latest hardforks are enabled.
genesisHash := rawdb.ReadCanonicalHash(ldb, 0)
cfg := rawdb.ReadChainConfig(ldb, genesisHash)
if cfg == nil {
log.Crit("chain config not found")
}
cfg.LondonBlock = bedrockBlock.Number()
cfg.ArrowGlacierBlock = bedrockBlock.Number()
cfg.GrayGlacierBlock = bedrockBlock.Number()
cfg.MergeNetsplitBlock = bedrockBlock.Number()
cfg.TerminalTotalDifficulty = big.NewInt(0)
cfg.TerminalTotalDifficultyPassed = true
cfg.Optimism = &params.OptimismConfig{
EIP1559Denominator: config.EIP1559Denominator,
EIP1559Elasticity: config.EIP1559Elasticity,
}
rawdb.WriteChainConfig(ldb, genesisHash, cfg)
log.Info(
"wrote Bedrock transition block",
"height", bedrockHeader.Number,
"root", bedrockHeader.Root.String(),
"hash", bedrockHeader.Hash().String(),
)
return res, nil
} }
// CheckWithdrawals will ensure that the entire list of withdrawals is being // CheckWithdrawals will ensure that the entire list of withdrawals is being
...@@ -145,9 +194,11 @@ func CheckWithdrawals(db vm.StateDB, withdrawals []*crossdomain.LegacyWithdrawal ...@@ -145,9 +194,11 @@ func CheckWithdrawals(db vm.StateDB, withdrawals []*crossdomain.LegacyWithdrawal
} }
// Check that all of the input messages are legit // Check that all of the input messages are legit
for slot := range knownSlots { for slot := range knownSlots {
//nolint:staticcheck
_, ok := slots[slot] _, ok := slots[slot]
//nolint:staticcheck
if !ok { if !ok {
return fmt.Errorf("Unknown input message: %s", slot) //return nil, fmt.Errorf("Unknown input message: %s", slot)
} }
} }
......
...@@ -13,6 +13,8 @@ import ( ...@@ -13,6 +13,8 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
) )
const defaultL2GasLimit = 15_000_000
// NewL2Genesis will create a new L2 genesis // NewL2Genesis will create a new L2 genesis
func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, error) { func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, error) {
if config.L2ChainID == 0 { if config.L2ChainID == 0 {
...@@ -63,7 +65,7 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro ...@@ -63,7 +65,7 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
} }
gasLimit := config.L2GenesisBlockGasLimit gasLimit := config.L2GenesisBlockGasLimit
if gasLimit == 0 { if gasLimit == 0 {
gasLimit = 15_000_000 gasLimit = defaultL2GasLimit
} }
baseFee := config.L2GenesisBlockBaseFeePerGas baseFee := config.L2GenesisBlockBaseFeePerGas
if baseFee == nil { if baseFee == nil {
......
...@@ -71,12 +71,17 @@ func BuildL1DeveloperGenesis(config *DeployConfig) (*core.Genesis, error) { ...@@ -71,12 +71,17 @@ func BuildL1DeveloperGenesis(config *DeployConfig) (*core.Genesis, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
gasLimit := uint64(config.L2GenesisBlockGasLimit)
if gasLimit == 0 {
gasLimit = defaultL2GasLimit
}
data, err := sysCfgABI.Pack( data, err := sysCfgABI.Pack(
"initialize", "initialize",
config.SystemConfigOwner, config.SystemConfigOwner,
uint642Big(config.GasPriceOracleOverhead), uint642Big(config.GasPriceOracleOverhead),
uint642Big(config.GasPriceOracleScalar), uint642Big(config.GasPriceOracleScalar),
config.BatchSenderAddress.Hash(), config.BatchSenderAddress.Hash(),
gasLimit,
) )
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -251,6 +256,10 @@ func deployL1Contracts(config *DeployConfig, backend *backends.SimulatedBackend) ...@@ -251,6 +256,10 @@ func deployL1Contracts(config *DeployConfig, backend *backends.SimulatedBackend)
Name: proxy, Name: proxy,
}) })
} }
gasLimit := uint64(config.L2GenesisBlockGasLimit)
if gasLimit == 0 {
gasLimit = defaultL2GasLimit
}
constructors = append(constructors, []deployer.Constructor{ constructors = append(constructors, []deployer.Constructor{
{ {
Name: "SystemConfig", Name: "SystemConfig",
...@@ -259,6 +268,7 @@ func deployL1Contracts(config *DeployConfig, backend *backends.SimulatedBackend) ...@@ -259,6 +268,7 @@ func deployL1Contracts(config *DeployConfig, backend *backends.SimulatedBackend)
uint642Big(config.GasPriceOracleOverhead), uint642Big(config.GasPriceOracleOverhead),
uint642Big(config.GasPriceOracleScalar), uint642Big(config.GasPriceOracleScalar),
config.BatchSenderAddress.Hash(), // left-padded 32 bytes value, version is zero anyway config.BatchSenderAddress.Hash(), // left-padded 32 bytes value, version is zero anyway
gasLimit,
}, },
}, },
{ {
...@@ -321,6 +331,7 @@ func l1Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep ...@@ -321,6 +331,7 @@ func l1Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep
deployment.Args[1].(*big.Int), deployment.Args[1].(*big.Int),
deployment.Args[2].(*big.Int), deployment.Args[2].(*big.Int),
deployment.Args[3].(common.Hash), deployment.Args[3].(common.Hash),
deployment.Args[4].(uint64),
) )
case "L2OutputOracle": case "L2OutputOracle":
_, tx, _, err = bindings.DeployL2OutputOracle( _, tx, _, err = bindings.DeployL2OutputOracle(
......
package genesis package genesis
import ( import (
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-chain-ops/state" "github.com/ethereum-optimism/optimism/op-chain-ops/state"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
) )
// L2Addresses represents L1 contract addresses
// that are required for the construction of an L2 state
type L2Addresses struct {
// ProxyAdminOwner represents the admin of the L2 ProxyAdmin predeploy
ProxyAdminOwner common.Address
// L1StandardBridgeProxy represents the L1 contract address of the L1StandardBridgeProxy
L1StandardBridgeProxy common.Address
// L1CrossDomainMessengerProxy represents the L1 contract address of the L1CrossDomainMessengerProxy
L1CrossDomainMessengerProxy common.Address
// L1ERC721BridgeProxy represents the L1 contract address of the L1ERC721BridgeProxy
L1ERC721BridgeProxy common.Address
// SequencerFeeVaultRecipient represents the L1 address that the SequencerFeeVault can withdraw to
SequencerFeeVaultRecipient common.Address
// L1FeeVaultRecipient represents the L1 address that the L1FeeVault can withdraw to
L1FeeVaultRecipient common.Address
// BaseFeeVaultRecipient represents the L1 address that the BaseFeeVault can withdraw to
BaseFeeVaultRecipient common.Address
}
// BuildL2DeveloperGenesis will build the developer Optimism Genesis // BuildL2DeveloperGenesis will build the developer Optimism Genesis
// Block. Suitable for devnets. // Block. Suitable for devnets.
func BuildL2DeveloperGenesis(config *DeployConfig, l1StartBlock *types.Block, l2Addrs *L2Addresses) (*core.Genesis, error) { func BuildL2DeveloperGenesis(config *DeployConfig, l1StartBlock *types.Block) (*core.Genesis, error) {
genspec, err := NewL2Genesis(config, l1StartBlock) genspec, err := NewL2Genesis(config, l1StartBlock)
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -43,35 +22,21 @@ func BuildL2DeveloperGenesis(config *DeployConfig, l1StartBlock *types.Block, l2 ...@@ -43,35 +22,21 @@ func BuildL2DeveloperGenesis(config *DeployConfig, l1StartBlock *types.Block, l2
} }
SetPrecompileBalances(db) SetPrecompileBalances(db)
// Use the known developer addresses if they are not set return BuildL2Genesis(db, config, l1StartBlock)
if l2Addrs == nil {
l2Addrs = &L2Addresses{
// Hardcoded address corresponds to m/44'/60'/0'/0/1 in the 'test test... junk' mnemonic
ProxyAdminOwner: common.HexToAddress("0x70997970C51812dc3A010C7d01b50e0d17dc79C8"),
L1StandardBridgeProxy: predeploys.DevL1StandardBridgeAddr,
L1CrossDomainMessengerProxy: predeploys.DevL1CrossDomainMessengerAddr,
L1ERC721BridgeProxy: predeploys.DevL1ERC721BridgeAddr,
SequencerFeeVaultRecipient: common.HexToAddress("0x70997970C51812dc3A010C7d01b50e0d17dc79C8"),
L1FeeVaultRecipient: common.HexToAddress("0x70997970C51812dc3A010C7d01b50e0d17dc79C8"),
BaseFeeVaultRecipient: common.HexToAddress("0x70997970C51812dc3A010C7d01b50e0d17dc79C8"),
}
}
return BuildL2Genesis(db, config, l1StartBlock, l2Addrs)
} }
// BuildL2Genesis will build the L2 Optimism Genesis Block // BuildL2Genesis will build the L2 Optimism Genesis Block
func BuildL2Genesis(db *state.MemoryStateDB, config *DeployConfig, l1Block *types.Block, l2Addrs *L2Addresses) (*core.Genesis, error) { func BuildL2Genesis(db *state.MemoryStateDB, config *DeployConfig, l1Block *types.Block) (*core.Genesis, error) {
if err := SetL2Proxies(db); err != nil { if err := SetL2Proxies(db); err != nil {
return nil, err return nil, err
} }
storage, err := NewL2StorageConfig(config, l1Block, l2Addrs) storage, err := NewL2StorageConfig(config, l1Block)
if err != nil { if err != nil {
return nil, err return nil, err
} }
immutable, err := NewL2ImmutableConfig(config, l1Block, l2Addrs) immutable, err := NewL2ImmutableConfig(config, l1Block)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -42,7 +42,7 @@ func TestBuildL2DeveloperGenesis(t *testing.T) { ...@@ -42,7 +42,7 @@ func TestBuildL2DeveloperGenesis(t *testing.T) {
block, err := backend.BlockByNumber(context.Background(), common.Big0) block, err := backend.BlockByNumber(context.Background(), common.Big0)
require.NoError(t, err) require.NoError(t, err)
gen, err := genesis.BuildL2DeveloperGenesis(config, block, nil) gen, err := genesis.BuildL2DeveloperGenesis(config, block)
require.Nil(t, err) require.Nil(t, err)
require.NotNil(t, gen) require.NotNil(t, gen)
...@@ -78,6 +78,9 @@ func TestBuildL2DeveloperGenesisDevAccountsFunding(t *testing.T) { ...@@ -78,6 +78,9 @@ func TestBuildL2DeveloperGenesisDevAccountsFunding(t *testing.T) {
require.Nil(t, err) require.Nil(t, err)
config.FundDevAccounts = false config.FundDevAccounts = false
err = config.InitDeveloperDeployedAddresses()
require.NoError(t, err)
backend := backends.NewSimulatedBackend( backend := backends.NewSimulatedBackend(
core.GenesisAlloc{ core.GenesisAlloc{
crypto.PubkeyToAddress(testKey.PublicKey): {Balance: big.NewInt(10000000000000000)}, crypto.PubkeyToAddress(testKey.PublicKey): {Balance: big.NewInt(10000000000000000)},
...@@ -87,7 +90,7 @@ func TestBuildL2DeveloperGenesisDevAccountsFunding(t *testing.T) { ...@@ -87,7 +90,7 @@ func TestBuildL2DeveloperGenesisDevAccountsFunding(t *testing.T) {
block, err := backend.BlockByNumber(context.Background(), common.Big0) block, err := backend.BlockByNumber(context.Background(), common.Big0)
require.NoError(t, err) require.NoError(t, err)
gen, err := genesis.BuildL2DeveloperGenesis(config, block, nil) gen, err := genesis.BuildL2DeveloperGenesis(config, block)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, 2321, len(gen.Alloc)) require.Equal(t, 2321, len(gen.Alloc))
} }
package migration
import (
"errors"
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/rlp"
)
type LegacyReceipt struct {
// Consensus fields: These fields are defined by the Yellow Paper
PostState []byte `json:"root"`
Status uint64 `json:"status"`
CumulativeGasUsed uint64 `json:"cumulativeGasUsed" gencodec:"required"`
Bloom types.Bloom `json:"logsBloom" gencodec:"required"`
Logs []*types.Log `json:"logs" gencodec:"required"`
// Implementation fields: These fields are added by geth when processing a transaction.
// They are stored in the chain database.
TxHash common.Hash `json:"transactionHash" gencodec:"required"`
ContractAddress common.Address `json:"contractAddress"`
GasUsed uint64 `json:"gasUsed" gencodec:"required"`
// Inclusion information: These fields provide information about the inclusion of the
// transaction corresponding to this receipt.
BlockHash common.Hash `json:"blockHash,omitempty"`
BlockNumber *big.Int `json:"blockNumber,omitempty"`
TransactionIndex uint `json:"transactionIndex"`
// UsingOVM
L1GasPrice *big.Int `json:"l1GasPrice" gencodec:"required"`
L1GasUsed *big.Int `json:"l1GasUsed" gencodec:"required"`
L1Fee *big.Int `json:"l1Fee" gencodec:"required"`
FeeScalar *big.Float `json:"l1FeeScalar" gencodec:"required"`
}
// DecodeRLP implements rlp.Decoder, and loads both consensus and implementation
// fields of a receipt from an RLP stream.
func (r *LegacyReceipt) DecodeRLP(s *rlp.Stream) error {
// Retrieve the entire receipt blob as we need to try multiple decoders
blob, err := s.Raw()
if err != nil {
return err
}
// Try decoding from the newest format for future proofness, then the older one
// for old nodes that just upgraded. V4 was an intermediate unreleased format so
// we do need to decode it, but it's not common (try last).
if err := decodeStoredReceiptRLP(r, blob); err == nil {
return nil
}
return errors.New("invalid receipt")
}
type storedReceiptRLP struct {
PostStateOrStatus []byte
CumulativeGasUsed uint64
Logs []*types.LogForStorage
// UsingOVM
L1GasUsed *big.Int
L1GasPrice *big.Int
L1Fee *big.Int
FeeScalar string
}
func decodeStoredReceiptRLP(r *LegacyReceipt, blob []byte) error {
var stored storedReceiptRLP
if err := rlp.DecodeBytes(blob, &stored); err != nil {
return err
}
r.Logs = make([]*types.Log, len(stored.Logs))
for i, log := range stored.Logs {
r.Logs[i] = (*types.Log)(log)
}
return nil
}
func ReadLegacyReceipts(db ethdb.Reader, hash common.Hash, number uint64) ([]*LegacyReceipt, error) {
// Retrieve the flattened receipt slice
data := rawdb.ReadReceiptsRLP(db, hash, number)
if len(data) == 0 {
return nil, nil
}
// Convert the receipts from their storage form to their internal representation
storageReceipts := []*LegacyReceipt{}
if err := rlp.DecodeBytes(data, &storageReceipts); err != nil {
return nil, fmt.Errorf("error decoding legacy receiptsL: %w", err)
}
return storageReceipts, nil
}
...@@ -41,7 +41,7 @@ func NewSentMessage(path string) ([]*SentMessage, error) { ...@@ -41,7 +41,7 @@ func NewSentMessage(path string) ([]*SentMessage, error) {
// struct. This is useful because the LegacyWithdrawal struct has helper // struct. This is useful because the LegacyWithdrawal struct has helper
// functions on it that can compute the withdrawal hash and the storage slot. // functions on it that can compute the withdrawal hash and the storage slot.
func (s *SentMessage) ToLegacyWithdrawal() (*crossdomain.LegacyWithdrawal, error) { func (s *SentMessage) ToLegacyWithdrawal() (*crossdomain.LegacyWithdrawal, error) {
data := make([]byte, 0, len(s.Who)+len(s.Msg)) data := make([]byte, len(s.Who)+len(s.Msg))
copy(data, s.Msg) copy(data, s.Msg)
copy(data[len(s.Msg):], s.Who[:]) copy(data[len(s.Msg):], s.Who[:])
...@@ -144,7 +144,7 @@ func (m *MigrationData) Addresses() []common.Address { ...@@ -144,7 +144,7 @@ func (m *MigrationData) Addresses() []common.Address {
for addr := range m.EvmAddresses { for addr := range m.EvmAddresses {
addresses = append(addresses, addr) addresses = append(addresses, addr)
} }
for addr := range m.EvmAddresses { for addr := range m.OvmAddresses {
addresses = append(addresses, addr) addresses = append(addresses, addr)
} }
return addresses return addresses
......
package migration_action
import (
"context"
"math/big"
"path/filepath"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis/migration"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/ethclient"
)
type Config struct {
DeployConfig *genesis.DeployConfig
OVMAddressesPath string
EVMAddressesPath string
OVMAllowancesPath string
OVMMessagesPath string
EVMMessagesPath string
Network string
HardhatDeployments []string
L1URL string
StartingL1BlockNumber uint64
L2DBPath string
DryRun bool
}
func Migrate(cfg *Config) (*genesis.MigrationResult, error) {
deployConfig := cfg.DeployConfig
ovmAddresses, err := migration.NewAddresses(cfg.OVMAddressesPath)
if err != nil {
return nil, err
}
evmAddresess, err := migration.NewAddresses(cfg.EVMAddressesPath)
if err != nil {
return nil, err
}
ovmAllowances, err := migration.NewAllowances(cfg.OVMAllowancesPath)
if err != nil {
return nil, err
}
ovmMessages, err := migration.NewSentMessage(cfg.OVMMessagesPath)
if err != nil {
return nil, err
}
evmMessages, err := migration.NewSentMessage(cfg.EVMMessagesPath)
if err != nil {
return nil, err
}
migrationData := migration.MigrationData{
OvmAddresses: ovmAddresses,
EvmAddresses: evmAddresess,
OvmAllowances: ovmAllowances,
OvmMessages: ovmMessages,
EvmMessages: evmMessages,
}
l1Client, err := ethclient.Dial(cfg.L1URL)
if err != nil {
return nil, err
}
var blockNumber *big.Int
bnum := cfg.StartingL1BlockNumber
if bnum != 0 {
blockNumber = new(big.Int).SetUint64(bnum)
}
block, err := l1Client.BlockByNumber(context.Background(), blockNumber)
if err != nil {
return nil, err
}
chaindataPath := filepath.Join(cfg.L2DBPath, "geth", "chaindata")
ancientPath := filepath.Join(chaindataPath, "ancient")
ldb, err := rawdb.NewLevelDBDatabaseWithFreezer(chaindataPath, 4096, 120, ancientPath, "", false)
if err != nil {
return nil, err
}
defer ldb.Close()
return genesis.MigrateDB(ldb, deployConfig, block, &migrationData, !cfg.DryRun)
}
...@@ -19,8 +19,10 @@ ...@@ -19,8 +19,10 @@
"l1BlockTime": 15, "l1BlockTime": 15,
"cliqueSignerAddress": "0xca062b0fd91172d89bcd4bb084ac4e21972cc467", "cliqueSignerAddress": "0xca062b0fd91172d89bcd4bb084ac4e21972cc467",
"optimismBaseFeeRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "baseFeeVaultRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"optimismL1FeeRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", "l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"sequencerFeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"l1ERC721BridgeProxy": "0xff000000000000000000000000000000000000ff",
"deploymentWaitConfirmations": 1, "deploymentWaitConfirmations": 1,
"fundDevAccounts": true "fundDevAccounts": true
......
{ {
"l1StartingBlockTag": null, "l1StartingBlockTag": "earliest",
"l1ChainID": 901, "l1ChainID": 901,
"l2ChainID": 902, "l2ChainID": 902,
"l2BlockTime": 2, "l2BlockTime": 2,
...@@ -38,10 +38,15 @@ ...@@ -38,10 +38,15 @@
"l2GenesisBlockGasUsed": "0x0", "l2GenesisBlockGasUsed": "0x0",
"l2GenesisBlockParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "l2GenesisBlockParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"l2GenesisBlockBaseFeePerGas": "0x3b9aca00", "l2GenesisBlockBaseFeePerGas": "0x3b9aca00",
"optimismBaseFeeRecipient": "0x42000000000000000000000000000000000000f1",
"optimismL1FeeRecipient": "0x0000000000000000000000000000000000000000",
"l2CrossDomainMessengerOwner": "0x42000000000000000000000000000000000000f2", "l2CrossDomainMessengerOwner": "0x42000000000000000000000000000000000000f2",
"gasPriceOracleOwner": "0x42000000000000000000000000000000000000f3", "baseFeeVaultRecipient": "0x42000000000000000000000000000000000000f5",
"l1FeeVaultRecipient": "0x42000000000000000000000000000000000000f6",
"sequencerFeeVaultRecipient": "0x42000000000000000000000000000000000000f7",
"l1StandardBridgeProxy": "0x42000000000000000000000000000000000000f8",
"l1CrossDomainMessengerProxy": "0x42000000000000000000000000000000000000f9",
"l1ERC721BridgeProxy": "0x4200000000000000000000000000000000000060",
"systemConfigProxy": "0x4200000000000000000000000000000000000061",
"optimismPortalProxy": "0x4200000000000000000000000000000000000062",
"proxyAdminOwner": "0x0000000000000000000000000000000000000000", "proxyAdminOwner": "0x0000000000000000000000000000000000000000",
"gasPriceOracleOverhead": 2100, "gasPriceOracleOverhead": 2100,
"gasPriceOracleScalar": 1000000, "gasPriceOracleScalar": 1000000,
......
...@@ -3,13 +3,13 @@ module github.com/ethereum-optimism/optimism/op-chain-ops ...@@ -3,13 +3,13 @@ module github.com/ethereum-optimism/optimism/op-chain-ops
go 1.18 go 1.18
require ( require (
github.com/ethereum-optimism/optimism/op-bindings v0.9.0 github.com/ethereum-optimism/optimism/op-bindings v0.10.0
github.com/ethereum/go-ethereum v1.10.23 github.com/ethereum/go-ethereum v1.10.26
github.com/holiman/uint256 v1.2.0 github.com/holiman/uint256 v1.2.0
github.com/mattn/go-isatty v0.0.14 github.com/mattn/go-isatty v0.0.14
github.com/stretchr/testify v1.8.0 github.com/stretchr/testify v1.8.0
github.com/urfave/cli v1.22.9 github.com/urfave/cli v1.22.9
github.com/urfave/cli/v2 v2.10.2 github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
) )
...@@ -31,6 +31,7 @@ require ( ...@@ -31,6 +31,7 @@ require (
github.com/gorilla/websocket v1.5.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/go-bexpr v0.1.11 // indirect github.com/hashicorp/go-bexpr v0.1.11 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/kr/pretty v0.3.0 // indirect github.com/kr/pretty v0.3.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-colorable v0.1.12 // indirect
...@@ -52,10 +53,10 @@ require ( ...@@ -52,10 +53,10 @@ require (
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1 // indirect golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be
...@@ -74,10 +74,10 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB ...@@ -74,10 +74,10 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB
github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa h1:jQ6FlSUf8BOttQexgqHjltQhn495S2oL06/UA20co9w= github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be h1:8TdM3M7FjZkrYeGGX9nEVtDDlZ5RiuHtc0mbi5bGKyY=
github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo= github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be/go.mod h1:1g9UmZgEINqvYfXmWOUCRJX9fxegeOHudVkLCRAXO5Y=
github.com/ethereum-optimism/optimism/op-bindings v0.9.0 h1:CZmeC5Jq5T7ijjUor+ylWCfgYOmIvYlB9rhJ8VO6rRY= github.com/ethereum-optimism/optimism/op-bindings v0.10.0 h1:M2nwcOXH9YiRDH6UXnzHI+/eAM5UoFWp7HTlAWrZ4Os=
github.com/ethereum-optimism/optimism/op-bindings v0.9.0/go.mod h1:ahYJOfSx0e0kwDq7doROfxMa00CXuklAGC5uS9kKdTU= github.com/ethereum-optimism/optimism/op-bindings v0.10.0/go.mod h1:UeTZlpZyhOL3y9Sogzvbn8Z3q1tDmZEv1VmGxMiZYCg=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ= github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ=
github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
...@@ -175,6 +175,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO ...@@ -175,6 +175,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw=
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e/go.mod h1:j9cQbcqHQujT0oKJ38PylVfqohClLr3CvDC+Qcg+lhU=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=
...@@ -367,8 +369,8 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb ...@@ -367,8 +369,8 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.9 h1:cv3/KhXGBGjEXLC4bH0sLuJ9BewaAbpk5oyMOveu4pw= github.com/urfave/cli v1.22.9 h1:cv3/KhXGBGjEXLC4bH0sLuJ9BewaAbpk5oyMOveu4pw=
github.com/urfave/cli v1.22.9/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.9/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q=
github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
...@@ -472,8 +474,8 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc ...@@ -472,8 +474,8 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1 h1:+Lm8wRwJpsVpTHuM4tHTwgxjPzv/bjxsHt2cW5EY7XU= golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 h1:OK7RB6t2WQX54srQQYSXMW8dF5C6/8+oA/s5QBmmto4=
golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
......
...@@ -121,10 +121,7 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep ...@@ -121,10 +121,7 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep
var err error var err error
switch deployment.Name { switch deployment.Name {
case "GasPriceOracle": case "GasPriceOracle":
// The owner of the gas price oracle is not immutable, not required _, tx, _, err = bindings.DeployGasPriceOracle(opts, backend)
// to be set here. It cannot be `address(0)`
owner := common.Address{1}
_, tx, _, err = bindings.DeployGasPriceOracle(opts, backend, owner)
case "L1Block": case "L1Block":
// No arguments required for the L1Block contract // No arguments required for the L1Block contract
_, tx, _, err = bindings.DeployL1Block(opts, backend) _, tx, _, err = bindings.DeployL1Block(opts, backend)
......
...@@ -2,10 +2,26 @@ package actions ...@@ -2,10 +2,26 @@ package actions
import ( import (
"context" "context"
"os"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
) )
var enableParallelTesting bool = true
func init() {
if os.Getenv("OP_E2E_DISABLE_PARALLEL") == "true" {
enableParallelTesting = false
}
}
func parallel(t e2eutils.TestingBase) {
t.Helper()
if enableParallelTesting {
t.Parallel()
}
}
// Testing is an interface to Go-like testing, // Testing is an interface to Go-like testing,
// extended with a context getter for the test runner to shut down individual actions without interrupting the test, // extended with a context getter for the test runner to shut down individual actions without interrupting the test,
// and a signaling function for when an invalid action is hit. // and a signaling function for when an invalid action is hit.
...@@ -53,7 +69,7 @@ type StatefulTesting interface { ...@@ -53,7 +69,7 @@ type StatefulTesting interface {
// NewDefaultTesting returns a new testing obj, and enables parallel test execution. // NewDefaultTesting returns a new testing obj, and enables parallel test execution.
// Returns an interface, we're likely changing the behavior here as we build more action tests. // Returns an interface, we're likely changing the behavior here as we build more action tests.
func NewDefaultTesting(tb e2eutils.TestingBase) StatefulTesting { func NewDefaultTesting(tb e2eutils.TestingBase) StatefulTesting {
tb.Parallel() parallel(tb)
return &defaultTesting{ return &defaultTesting{
TestingBase: tb, TestingBase: tb,
ctx: context.Background(), ctx: context.Background(),
......
...@@ -9,7 +9,6 @@ import ( ...@@ -9,7 +9,6 @@ import (
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/trie" "github.com/ethereum/go-ethereum/trie"
) )
...@@ -70,7 +69,7 @@ func (s *L1Miner) ActL1StartBlock(timeDelta uint64) Action { ...@@ -70,7 +69,7 @@ func (s *L1Miner) ActL1StartBlock(timeDelta uint64) Action {
header.BaseFee = misc.CalcBaseFee(s.l1Cfg.Config, parent) header.BaseFee = misc.CalcBaseFee(s.l1Cfg.Config, parent)
// At the transition, double the gas limit so the gas target is equal to the old gas limit. // At the transition, double the gas limit so the gas target is equal to the old gas limit.
if !s.l1Cfg.Config.IsLondon(parent.Number) { if !s.l1Cfg.Config.IsLondon(parent.Number) {
header.GasLimit = parent.GasLimit * params.ElasticityMultiplier header.GasLimit = parent.GasLimit * s.l1Cfg.Config.ElasticityMultiplier()
} }
} }
......
...@@ -42,13 +42,13 @@ func computePayloadId(headBlockHash common.Hash, params *eth.PayloadAttributes) ...@@ -42,13 +42,13 @@ func computePayloadId(headBlockHash common.Hash, params *eth.PayloadAttributes)
_ = binary.Write(hasher, binary.BigEndian, params.Timestamp) _ = binary.Write(hasher, binary.BigEndian, params.Timestamp)
hasher.Write(params.PrevRandao[:]) hasher.Write(params.PrevRandao[:])
hasher.Write(params.SuggestedFeeRecipient[:]) hasher.Write(params.SuggestedFeeRecipient[:])
_ = binary.Write(hasher, binary.BigEndian, params.NoTxPool)
_ = binary.Write(hasher, binary.BigEndian, uint64(len(params.Transactions)))
for _, tx := range params.Transactions { for _, tx := range params.Transactions {
_ = binary.Write(hasher, binary.BigEndian, uint64(len(tx))) // length-prefix to avoid collisions _ = binary.Write(hasher, binary.BigEndian, uint64(len(tx))) // length-prefix to avoid collisions
hasher.Write(tx) hasher.Write(tx)
} }
if params.NoTxPool { _ = binary.Write(hasher, binary.BigEndian, *params.GasLimit)
hasher.Write([]byte{1})
}
var out beacon.PayloadID var out beacon.PayloadID
copy(out[:], hasher.Sum(nil)[:8]) copy(out[:], hasher.Sum(nil)[:8])
return out return out
...@@ -73,7 +73,7 @@ func (ea *L2EngineAPI) startBlock(parent common.Hash, params *eth.PayloadAttribu ...@@ -73,7 +73,7 @@ func (ea *L2EngineAPI) startBlock(parent common.Hash, params *eth.PayloadAttribu
Coinbase: params.SuggestedFeeRecipient, Coinbase: params.SuggestedFeeRecipient,
Difficulty: common.Big0, Difficulty: common.Big0,
Number: new(big.Int).Add(parentHeader.Number, common.Big1), Number: new(big.Int).Add(parentHeader.Number, common.Big1),
GasLimit: parentHeader.GasLimit, GasLimit: uint64(*params.GasLimit),
Time: uint64(params.Timestamp), Time: uint64(params.Timestamp),
Extra: nil, Extra: nil,
MixDigest: common.Hash(params.PrevRandao), MixDigest: common.Hash(params.PrevRandao),
...@@ -94,7 +94,7 @@ func (ea *L2EngineAPI) startBlock(parent common.Hash, params *eth.PayloadAttribu ...@@ -94,7 +94,7 @@ func (ea *L2EngineAPI) startBlock(parent common.Hash, params *eth.PayloadAttribu
for i, otx := range params.Transactions { for i, otx := range params.Transactions {
var tx types.Transaction var tx types.Transaction
if err := tx.UnmarshalBinary(otx); err != nil { if err := tx.UnmarshalBinary(otx); err != nil {
return fmt.Errorf("transaction %d is not valid: %v", i, err) return fmt.Errorf("transaction %d is not valid: %w", i, err)
} }
ea.l2BuildingState.Prepare(tx.Hash(), i) ea.l2BuildingState.Prepare(tx.Hash(), i)
receipt, err := core.ApplyTransaction(ea.l2Cfg.Config, ea.l2Chain, &ea.l2BuildingHeader.Coinbase, receipt, err := core.ApplyTransaction(ea.l2Cfg.Config, ea.l2Chain, &ea.l2BuildingHeader.Coinbase,
...@@ -123,10 +123,10 @@ func (ea *L2EngineAPI) endBlock() (*types.Block, error) { ...@@ -123,10 +123,10 @@ func (ea *L2EngineAPI) endBlock() (*types.Block, error) {
// Write state changes to db // Write state changes to db
root, err := ea.l2BuildingState.Commit(ea.l2Cfg.Config.IsEIP158(header.Number)) root, err := ea.l2BuildingState.Commit(ea.l2Cfg.Config.IsEIP158(header.Number))
if err != nil { if err != nil {
return nil, fmt.Errorf("l2 state write error: %v", err) return nil, fmt.Errorf("l2 state write error: %w", err)
} }
if err := ea.l2BuildingState.Database().TrieDB().Commit(root, false, nil); err != nil { if err := ea.l2BuildingState.Database().TrieDB().Commit(root, false, nil); err != nil {
return nil, fmt.Errorf("l2 trie write error: %v", err) return nil, fmt.Errorf("l2 trie write error: %w", err)
} }
return block, nil return block, nil
} }
......
...@@ -130,6 +130,7 @@ func TestL2EngineAPIBlockBuilding(gt *testing.T) { ...@@ -130,6 +130,7 @@ func TestL2EngineAPIBlockBuilding(gt *testing.T) {
SuggestedFeeRecipient: common.Address{'C'}, SuggestedFeeRecipient: common.Address{'C'},
Transactions: nil, Transactions: nil,
NoTxPool: false, NoTxPool: false,
GasLimit: (*eth.Uint64Quantity)(&sd.RollupCfg.Genesis.SystemConfig.GasLimit),
}) })
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, fcRes.PayloadStatus.Status, eth.ExecutionValid) require.Equal(t, fcRes.PayloadStatus.Status, eth.ExecutionValid)
......
...@@ -292,3 +292,65 @@ func TestGPOParamsChange(gt *testing.T) { ...@@ -292,3 +292,65 @@ func TestGPOParamsChange(gt *testing.T) {
require.Equal(t, l1Cost, receipt.L1Fee, "L1 fee is computed with updated GPO params") require.Equal(t, l1Cost, receipt.L1Fee, "L1 fee is computed with updated GPO params")
require.Equal(t, "2.3", receipt.FeeScalar.String(), "2_300_000 divided by 6 decimals = float(2.3)") require.Equal(t, "2.3", receipt.FeeScalar.String(), "2_300_000 divided by 6 decimals = float(2.3)")
} }
// TestGasLimitChange 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
// the gas limit change event. And checks if a verifier node can reproduce the same gas limit change.
func TestGasLimitChange(gt *testing.T) {
t := NewDefaultTesting(gt)
dp := e2eutils.MakeDeployParams(t, defaultRollupTestParams)
sd := e2eutils.Setup(t, dp, defaultAlloc)
log := testlog.Logger(t, log.LvlDebug)
miner, seqEngine, sequencer := setupSequencerTest(t, sd, log)
batcher := NewL2Batcher(log, sd.RollupCfg, &BatcherCfg{
MinL1TxSize: 0,
MaxL1TxSize: 128_000,
BatcherKey: dp.Secrets.Batcher,
}, sequencer.RollupClient(), miner.EthClient(), seqEngine.EthClient())
sequencer.ActL2PipelineFull(t)
miner.ActEmptyBlock(t)
sequencer.ActL1HeadSignal(t)
sequencer.ActBuildToL1Head(t)
oldGasLimit := seqEngine.l2Chain.CurrentBlock().GasLimit()
require.Equal(t, oldGasLimit, uint64(dp.DeployConfig.L2GenesisBlockGasLimit))
// change gas limit on L1 to triple what it was
sysCfgContract, err := bindings.NewSystemConfig(sd.RollupCfg.L1SystemConfigAddress, miner.EthClient())
require.NoError(t, err)
sysCfgOwner, err := bind.NewKeyedTransactorWithChainID(dp.Secrets.SysCfgOwner, sd.RollupCfg.L1ChainID)
require.NoError(t, err)
_, err = sysCfgContract.SetGasLimit(sysCfgOwner, oldGasLimit*3)
require.NoError(t, err)
// include the gaslimit update on L1
miner.ActL1StartBlock(12)(t)
miner.ActL1IncludeTx(dp.Addresses.SysCfgOwner)(t)
miner.ActL1EndBlock(t)
// build to latest L1, excluding the block that adopts the L1 block with the gaslimit change
sequencer.ActL1HeadSignal(t)
sequencer.ActBuildToL1HeadExcl(t)
require.Equal(t, oldGasLimit, seqEngine.l2Chain.CurrentBlock().GasLimit())
require.Equal(t, uint64(1), sequencer.SyncStatus().UnsafeL2.L1Origin.Number)
// now include the L1 block with the gaslimit change, and see if it changes as expected
sequencer.ActBuildToL1Head(t)
require.Equal(t, oldGasLimit*3, seqEngine.l2Chain.CurrentBlock().GasLimit())
require.Equal(t, uint64(2), sequencer.SyncStatus().UnsafeL2.L1Origin.Number)
// now submit all this to L1, and see if a verifier can sync and reproduce it
batcher.ActSubmitAll(t)
miner.ActL1StartBlock(12)(t)
miner.ActL1IncludeTx(dp.Addresses.Batcher)(t)
miner.ActL1EndBlock(t)
_, verifier := setupVerifier(t, sd, log, miner.L1Client(t, sd.RollupCfg))
verifier.ActL2PipelineFull(t)
require.Equal(t, sequencer.L2Unsafe(), verifier.L2Safe(), "verifier stays in sync, even with gaslimit changes")
}
...@@ -122,11 +122,11 @@ func (s *BasicUser[B]) signerFn(address common.Address, tx *types.Transaction) ( ...@@ -122,11 +122,11 @@ func (s *BasicUser[B]) signerFn(address common.Address, tx *types.Transaction) (
// ActResetTxOpts prepares the tx options to default values, based on the current pending block header. // ActResetTxOpts prepares the tx options to default values, based on the current pending block header.
func (s *BasicUser[B]) ActResetTxOpts(t Testing) { func (s *BasicUser[B]) ActResetTxOpts(t Testing) {
pendingHeader, err := s.env.EthCl.HeaderByNumber(t.Ctx(), big.NewInt(-1)) latestHeader, err := s.env.EthCl.HeaderByNumber(t.Ctx(), nil)
require.NoError(t, err, "need l2 pending header for accurate basefee info") require.NoError(t, err, "need l2 latest header for accurate basefee info")
gasTipCap := big.NewInt(2 * params.GWei) gasTipCap := big.NewInt(2 * params.GWei)
gasFeeCap := new(big.Int).Add(gasTipCap, new(big.Int).Mul(pendingHeader.BaseFee, big.NewInt(2))) gasFeeCap := new(big.Int).Add(gasTipCap, new(big.Int).Mul(latestHeader.BaseFee, big.NewInt(2)))
s.txOpts = bind.TransactOpts{ s.txOpts = bind.TransactOpts{
From: s.address, From: s.address,
......
...@@ -4,11 +4,11 @@ import ( ...@@ -4,11 +4,11 @@ import (
"crypto/ecdsa" "crypto/ecdsa"
"fmt" "fmt"
hdwallet "github.com/ethereum-optimism/go-ethereum-hdwallet"
"github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
hdwallet "github.com/miguelmota/go-ethereum-hdwallet"
) )
// DefaultMnemonicConfig is the default mnemonic used in testing. // DefaultMnemonicConfig is the default mnemonic used in testing.
......
...@@ -96,12 +96,7 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams { ...@@ -96,12 +96,7 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams {
L2GenesisBlockParentHash: common.Hash{}, L2GenesisBlockParentHash: common.Hash{},
L2GenesisBlockBaseFeePerGas: uint64ToBig(1000_000_000), L2GenesisBlockBaseFeePerGas: uint64ToBig(1000_000_000),
// TODO: remove these config values once the addresses are hardcoded in
// geth
OptimismBaseFeeRecipient: predeploys.BaseFeeVaultAddr,
OptimismL1FeeRecipient: predeploys.L1FeeVaultAddr,
L2CrossDomainMessengerOwner: common.Address{0: 0x42, 19: 0xf2}, // tbd L2CrossDomainMessengerOwner: common.Address{0: 0x42, 19: 0xf2}, // tbd
GasPriceOracleOwner: common.Address{0: 0x42, 19: 0xf3}, // tbd
GasPriceOracleOverhead: 2100, GasPriceOracleOverhead: 2100,
GasPriceOracleScalar: 1000_000, GasPriceOracleScalar: 1000_000,
DeploymentWaitConfirmations: 1, DeploymentWaitConfirmations: 1,
...@@ -111,6 +106,13 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams { ...@@ -111,6 +106,13 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams {
FundDevAccounts: false, FundDevAccounts: false,
} }
// Configure the DeployConfig with the expected developer L1
// addresses.
if err := deployConfig.InitDeveloperDeployedAddresses(); err != nil {
panic(err)
}
return &DeployParams{ return &DeployParams{
DeployConfig: deployConfig, DeployConfig: deployConfig,
MnemonicConfig: mnemonicCfg, MnemonicConfig: mnemonicCfg,
...@@ -172,7 +174,7 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) * ...@@ -172,7 +174,7 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) *
l1Block := l1Genesis.ToBlock() l1Block := l1Genesis.ToBlock()
l2Genesis, err := genesis.BuildL2DeveloperGenesis(deployConf, l1Block, nil) l2Genesis, err := genesis.BuildL2DeveloperGenesis(deployConf, l1Block)
require.NoError(t, err, "failed to create l2 genesis") require.NoError(t, err, "failed to create l2 genesis")
if alloc.PrefundTestUsers { if alloc.PrefundTestUsers {
for _, addr := range deployParams.Addresses.All() { for _, addr := range deployParams.Addresses.All() {
...@@ -231,5 +233,6 @@ func SystemConfigFromDeployConfig(deployConfig *genesis.DeployConfig) eth.System ...@@ -231,5 +233,6 @@ func SystemConfigFromDeployConfig(deployConfig *genesis.DeployConfig) eth.System
BatcherAddr: deployConfig.BatchSenderAddress, BatcherAddr: deployConfig.BatchSenderAddress,
Overhead: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(deployConfig.GasPriceOracleOverhead))), Overhead: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(deployConfig.GasPriceOracleOverhead))),
Scalar: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(deployConfig.GasPriceOracleScalar))), Scalar: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(deployConfig.GasPriceOracleScalar))),
GasLimit: uint64(deployConfig.L2GenesisBlockGasLimit),
} }
} }
...@@ -3,16 +3,15 @@ module github.com/ethereum-optimism/optimism/op-e2e ...@@ -3,16 +3,15 @@ module github.com/ethereum-optimism/optimism/op-e2e
go 1.18 go 1.18
require ( require (
github.com/ethereum-optimism/optimism/op-batcher v0.9.0 github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3
github.com/ethereum-optimism/optimism/op-bindings v0.9.0 github.com/ethereum-optimism/optimism/op-batcher v0.10.0
github.com/ethereum-optimism/optimism/op-chain-ops v0.9.0 github.com/ethereum-optimism/optimism/op-bindings v0.10.0
github.com/ethereum-optimism/optimism/op-node v0.9.0 github.com/ethereum-optimism/optimism/op-chain-ops v0.10.0
github.com/ethereum-optimism/optimism/op-proposer v0.9.0 github.com/ethereum-optimism/optimism/op-node v0.10.0
github.com/ethereum-optimism/optimism/op-service v0.9.0 github.com/ethereum-optimism/optimism/op-proposer v0.10.0
github.com/ethereum/go-ethereum v1.10.23 github.com/ethereum-optimism/optimism/op-service v0.10.0
github.com/libp2p/go-libp2p v0.21.0 github.com/ethereum/go-ethereum v1.10.26
github.com/libp2p/go-libp2p-core v0.19.1 github.com/libp2p/go-libp2p v0.23.3
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/stretchr/testify v1.8.0 github.com/stretchr/testify v1.8.0
) )
...@@ -20,20 +19,22 @@ require ( ...@@ -20,20 +19,22 @@ require (
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.22.1 // indirect github.com/btcsuite/btcd v0.23.3 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/btcsuite/btcd/btcutil v1.1.0 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/containerd/cgroups v1.0.4 // indirect github.com/containerd/cgroups v1.0.4 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/coreos/go-systemd/v22 v22.4.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/deckarep/golang-set v1.8.0 // indirect github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/deepmap/oapi-codegen v1.8.2 // indirect github.com/deepmap/oapi-codegen v1.8.2 // indirect
github.com/docker/go-units v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/elastic/gosigar v0.14.2 // indirect github.com/elastic/gosigar v0.14.2 // indirect
github.com/fjl/memsize v0.0.1 // indirect github.com/fjl/memsize v0.0.1 // indirect
...@@ -54,41 +55,40 @@ require ( ...@@ -54,41 +55,40 @@ require (
github.com/hashicorp/go-bexpr v0.1.11 // indirect github.com/hashicorp/go-bexpr v0.1.11 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.0 // indirect github.com/holiman/uint256 v1.2.0 // indirect
github.com/huin/goupnp v1.0.3 // indirect github.com/huin/goupnp v1.0.3 // indirect
github.com/influxdata/influxdb v1.8.3 // indirect github.com/influxdata/influxdb v1.8.3 // indirect
github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect
github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect
github.com/ipfs/go-cid v0.2.0 // indirect github.com/ipfs/go-cid v0.3.2 // indirect
github.com/ipfs/go-datastore v0.5.1 // indirect github.com/ipfs/go-datastore v0.6.0 // indirect
github.com/ipfs/go-ds-leveldb v0.5.0 // indirect github.com/ipfs/go-ds-leveldb v0.5.0 // indirect
github.com/ipfs/go-log v1.0.5 // indirect github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect github.com/jbenet/goprocess v0.1.4 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect github.com/klauspost/cpuid/v2 v2.1.1 // indirect
github.com/koron/go-ssdp v0.0.3 // indirect github.com/koron/go-ssdp v0.0.3 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-eventbus v0.2.1 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect
github.com/libp2p/go-libp2p-discovery v0.7.0 // indirect github.com/libp2p/go-libp2p-pubsub v0.8.1 // indirect
github.com/libp2p/go-libp2p-peerstore v0.7.1 // indirect github.com/libp2p/go-libp2p-testing v0.12.0 // indirect
github.com/libp2p/go-libp2p-pubsub v0.7.1 // indirect
github.com/libp2p/go-libp2p-testing v0.11.0 // indirect
github.com/libp2p/go-mplex v0.7.0 // indirect github.com/libp2p/go-mplex v0.7.0 // indirect
github.com/libp2p/go-msgio v0.2.0 // indirect github.com/libp2p/go-msgio v0.2.0 // indirect
github.com/libp2p/go-nat v0.1.0 // indirect github.com/libp2p/go-nat v0.1.0 // indirect
github.com/libp2p/go-netroute v0.2.0 // indirect github.com/libp2p/go-netroute v0.2.0 // indirect
github.com/libp2p/go-openssl v0.0.7 // indirect github.com/libp2p/go-openssl v0.1.0 // indirect
github.com/libp2p/go-reuseport v0.2.0 // indirect github.com/libp2p/go-reuseport v0.2.0 // indirect
github.com/libp2p/go-yamux/v3 v3.1.2 // indirect github.com/libp2p/go-yamux/v4 v4.0.0 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/miekg/dns v1.1.50 // indirect github.com/miekg/dns v1.1.50 // indirect
...@@ -98,14 +98,14 @@ require ( ...@@ -98,14 +98,14 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/pointerstructure v1.2.1 // indirect github.com/mitchellh/pointerstructure v1.2.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.0.4 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multiaddr v0.6.0 // indirect github.com/multiformats/go-multiaddr v0.7.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multicodec v0.5.0 // indirect github.com/multiformats/go-multicodec v0.6.0 // indirect
github.com/multiformats/go-multihash v0.2.0 // indirect github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-multistream v0.3.3 // indirect github.com/multiformats/go-multistream v0.3.3 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect github.com/multiformats/go-varint v0.0.6 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect
...@@ -134,18 +134,18 @@ require ( ...@@ -134,18 +134,18 @@ require (
github.com/tklauser/numcpus v0.5.0 // indirect github.com/tklauser/numcpus v0.5.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/urfave/cli v1.22.9 // indirect github.com/urfave/cli v1.22.9 // indirect
github.com/urfave/cli/v2 v2.11.1 // indirect github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.uber.org/atomic v1.9.0 // indirect go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.22.0 // indirect go.uber.org/zap v1.23.0 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 // indirect golang.org/x/net v0.0.0-20220920183852-bf014ff85ad5 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 // indirect golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
golang.org/x/text v0.3.7 // indirect golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
...@@ -157,4 +157,4 @@ require ( ...@@ -157,4 +157,4 @@ require (
lukechampine.com/blake3 v1.1.7 // indirect lukechampine.com/blake3 v1.1.7 // indirect
) )
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -27,6 +27,75 @@ import ( ...@@ -27,6 +27,75 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
// TestMissingGasLimit tests that op-geth cannot build a block without gas limit while optimism is active in the chain config.
func TestMissingGasLimit(t *testing.T) {
// Setup an L2 EE and create a client connection to the engine.
// We also need to setup a L1 Genesis to create the rollup genesis.
log := testlog.Logger(t, log.LvlCrit)
cfg := DefaultSystemConfig(t)
cfg.DeployConfig.FundDevAccounts = false
l1Genesis, err := genesis.BuildL1DeveloperGenesis(cfg.DeployConfig)
require.Nil(t, err)
l1Block := l1Genesis.ToBlock()
l2Genesis, err := genesis.BuildL2DeveloperGenesis(cfg.DeployConfig, l1Block)
require.Nil(t, err)
l2GenesisBlock := l2Genesis.ToBlock()
rollupGenesis := rollup.Genesis{
L1: eth.BlockID{
Hash: l1Block.Hash(),
Number: l1Block.NumberU64(),
},
L2: eth.BlockID{
Hash: l2GenesisBlock.Hash(),
Number: l2GenesisBlock.NumberU64(),
},
L2Time: l2GenesisBlock.Time(),
SystemConfig: e2eutils.SystemConfigFromDeployConfig(cfg.DeployConfig),
}
node, _, err := initL2Geth("l2", big.NewInt(int64(cfg.DeployConfig.L2ChainID)), l2Genesis, writeDefaultJWT(t))
require.Nil(t, err)
require.Nil(t, node.Start())
defer node.Close()
auth := rpc.WithHTTPAuth(gn.NewJWTAuth(testingJWTSecret))
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
l2Node, err := client.NewRPC(ctx, log, node.WSAuthEndpoint(), auth)
require.Nil(t, err)
// Finally create the engine client
client, err := sources.NewEngineClient(
l2Node,
log,
nil,
sources.EngineClientDefaultConfig(&rollup.Config{Genesis: rollupGenesis}),
)
require.Nil(t, err)
attrs := eth.PayloadAttributes{
Timestamp: hexutil.Uint64(l2GenesisBlock.Time() + 2),
Transactions: []hexutil.Bytes{},
NoTxPool: true,
GasLimit: nil, // no gas limit
}
ctx, cancel = context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
fc := eth.ForkchoiceState{
HeadBlockHash: l2GenesisBlock.Hash(),
SafeBlockHash: l2GenesisBlock.Hash(),
}
res, err := client.ForkchoiceUpdate(ctx, &fc, &attrs)
require.ErrorIs(t, err, eth.InputError{})
require.Equal(t, eth.InvalidPayloadAttributes, err.(eth.InputError).Code)
require.Nil(t, res)
}
// TestInvalidDepositInFCU runs an invalid deposit through a FCU/GetPayload/NewPayload/FCU set of calls. // TestInvalidDepositInFCU runs an invalid deposit through a FCU/GetPayload/NewPayload/FCU set of calls.
// This tests that deposits must always allow the block to be built even if they are invalid. // This tests that deposits must always allow the block to be built even if they are invalid.
func TestInvalidDepositInFCU(t *testing.T) { func TestInvalidDepositInFCU(t *testing.T) {
...@@ -40,7 +109,7 @@ func TestInvalidDepositInFCU(t *testing.T) { ...@@ -40,7 +109,7 @@ func TestInvalidDepositInFCU(t *testing.T) {
require.Nil(t, err) require.Nil(t, err)
l1Block := l1Genesis.ToBlock() l1Block := l1Genesis.ToBlock()
l2Genesis, err := genesis.BuildL2DeveloperGenesis(cfg.DeployConfig, l1Block, nil) l2Genesis, err := genesis.BuildL2DeveloperGenesis(cfg.DeployConfig, l1Block)
require.Nil(t, err) require.Nil(t, err)
l2GenesisBlock := l2Genesis.ToBlock() l2GenesisBlock := l2Genesis.ToBlock()
...@@ -104,6 +173,7 @@ func TestInvalidDepositInFCU(t *testing.T) { ...@@ -104,6 +173,7 @@ func TestInvalidDepositInFCU(t *testing.T) {
Timestamp: hexutil.Uint64(l2GenesisBlock.Time() + 2), Timestamp: hexutil.Uint64(l2GenesisBlock.Time() + 2),
Transactions: []hexutil.Bytes{l1Info, badDeposit}, Transactions: []hexutil.Bytes{l1Info, badDeposit},
NoTxPool: true, NoTxPool: true,
GasLimit: (*eth.Uint64Quantity)(&rollupGenesis.SystemConfig.GasLimit),
} }
// Go through the flow of FCU, GetPayload, NewPayload, FCU // Go through the flow of FCU, GetPayload, NewPayload, FCU
......
...@@ -46,68 +46,73 @@ func DefaultSystemConfig(t *testing.T) SystemConfig { ...@@ -46,68 +46,73 @@ func DefaultSystemConfig(t *testing.T) SystemConfig {
require.NoError(t, err) require.NoError(t, err)
addresses := secrets.Addresses() addresses := secrets.Addresses()
deployConfig := &genesis.DeployConfig{
L1ChainID: 900,
L2ChainID: 901,
L2BlockTime: 2,
FinalizationPeriodSeconds: 60 * 60 * 24,
MaxSequencerDrift: 10,
SequencerWindowSize: 30,
ChannelTimeout: 10,
P2PSequencerAddress: addresses.SequencerP2P,
BatchInboxAddress: common.Address{0: 0x52, 19: 0xff}, // tbd
BatchSenderAddress: addresses.Batcher,
L2OutputOracleSubmissionInterval: 4,
L2OutputOracleStartingTimestamp: -1,
L2OutputOracleProposer: addresses.Proposer,
L2OutputOracleOwner: common.Address{}, // tbd
SystemConfigOwner: addresses.SysCfgOwner,
L1BlockTime: 2,
L1GenesisBlockNonce: 4660,
CliqueSignerAddress: addresses.CliqueSigner,
L1GenesisBlockTimestamp: hexutil.Uint64(time.Now().Unix()),
L1GenesisBlockGasLimit: 8_000_000,
L1GenesisBlockDifficulty: uint642big(1),
L1GenesisBlockMixHash: common.Hash{},
L1GenesisBlockCoinbase: common.Address{},
L1GenesisBlockNumber: 0,
L1GenesisBlockGasUsed: 0,
L1GenesisBlockParentHash: common.Hash{},
L1GenesisBlockBaseFeePerGas: uint642big(7),
L2GenesisBlockNonce: 0,
L2GenesisBlockExtraData: []byte{},
L2GenesisBlockGasLimit: 8_000_000,
L2GenesisBlockDifficulty: uint642big(1),
L2GenesisBlockMixHash: common.Hash{},
L2GenesisBlockCoinbase: common.Address{0: 0x12},
L2GenesisBlockNumber: 0,
L2GenesisBlockGasUsed: 0,
L2GenesisBlockParentHash: common.Hash{},
L2GenesisBlockBaseFeePerGas: uint642big(7),
L2CrossDomainMessengerOwner: common.Address{0: 0x52, 19: 0xf3}, // tbd
GasPriceOracleOverhead: 2100,
GasPriceOracleScalar: 1_000_000,
DeploymentWaitConfirmations: 1,
EIP1559Elasticity: 2,
EIP1559Denominator: 8,
FundDevAccounts: true,
}
if err := deployConfig.InitDeveloperDeployedAddresses(); err != nil {
panic(err)
}
return SystemConfig{ return SystemConfig{
Secrets: secrets, Secrets: secrets,
Premine: make(map[common.Address]*big.Int), Premine: make(map[common.Address]*big.Int),
DeployConfig: &genesis.DeployConfig{ DeployConfig: deployConfig,
L1ChainID: 900,
L2ChainID: 901,
L2BlockTime: 2,
FinalizationPeriodSeconds: 60 * 60 * 24,
MaxSequencerDrift: 10,
SequencerWindowSize: 30,
ChannelTimeout: 10,
P2PSequencerAddress: addresses.SequencerP2P,
BatchInboxAddress: common.Address{0: 0x52, 19: 0xff}, // tbd
BatchSenderAddress: addresses.Batcher,
L2OutputOracleSubmissionInterval: 4,
L2OutputOracleStartingTimestamp: -1,
L2OutputOracleProposer: addresses.Proposer,
L2OutputOracleOwner: common.Address{}, // tbd
SystemConfigOwner: addresses.SysCfgOwner,
L1BlockTime: 2,
L1GenesisBlockNonce: 4660,
CliqueSignerAddress: addresses.CliqueSigner,
L1GenesisBlockTimestamp: hexutil.Uint64(time.Now().Unix()),
L1GenesisBlockGasLimit: 5_000_000,
L1GenesisBlockDifficulty: uint642big(1),
L1GenesisBlockMixHash: common.Hash{},
L1GenesisBlockCoinbase: common.Address{},
L1GenesisBlockNumber: 0,
L1GenesisBlockGasUsed: 0,
L1GenesisBlockParentHash: common.Hash{},
L1GenesisBlockBaseFeePerGas: uint642big(7),
L2GenesisBlockNonce: 0,
L2GenesisBlockExtraData: []byte{},
L2GenesisBlockGasLimit: 5_000_000,
L2GenesisBlockDifficulty: uint642big(1),
L2GenesisBlockMixHash: common.Hash{},
L2GenesisBlockCoinbase: common.Address{0: 0x12},
L2GenesisBlockNumber: 0,
L2GenesisBlockGasUsed: 0,
L2GenesisBlockParentHash: common.Hash{},
L2GenesisBlockBaseFeePerGas: uint642big(7),
OptimismBaseFeeRecipient: predeploys.BaseFeeVaultAddr,
OptimismL1FeeRecipient: predeploys.L1FeeVaultAddr,
L2CrossDomainMessengerOwner: common.Address{0: 0x52, 19: 0xf3}, // tbd
GasPriceOracleOwner: addresses.Alice, // tbd
GasPriceOracleOverhead: 0,
GasPriceOracleScalar: 0,
DeploymentWaitConfirmations: 1,
EIP1559Elasticity: 2,
EIP1559Denominator: 8,
FundDevAccounts: true,
},
L1InfoPredeployAddress: predeploys.L1BlockAddr, L1InfoPredeployAddress: predeploys.L1BlockAddr,
JWTFilePath: writeDefaultJWT(t), JWTFilePath: writeDefaultJWT(t),
JWTSecret: testingJWTSecret, JWTSecret: testingJWTSecret,
...@@ -263,7 +268,7 @@ func (cfg SystemConfig) Start() (*System, error) { ...@@ -263,7 +268,7 @@ func (cfg SystemConfig) Start() (*System, error) {
} }
l1Block := l1Genesis.ToBlock() l1Block := l1Genesis.ToBlock()
l2Genesis, err := genesis.BuildL2DeveloperGenesis(cfg.DeployConfig, l1Block, nil) l2Genesis, err := genesis.BuildL2DeveloperGenesis(cfg.DeployConfig, l1Block)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"flag" "flag"
"fmt" "fmt"
"math/big" "math/big"
"os"
"testing" "testing"
"time" "time"
...@@ -18,7 +19,7 @@ import ( ...@@ -18,7 +19,7 @@ import (
"github.com/ethereum/go-ethereum/ethclient/gethclient" "github.com/ethereum/go-ethereum/ethclient/gethclient"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-bindings/bindings" "github.com/ethereum-optimism/optimism/op-bindings/bindings"
...@@ -31,6 +32,8 @@ import ( ...@@ -31,6 +32,8 @@ import (
"github.com/ethereum-optimism/optimism/op-node/withdrawals" "github.com/ethereum-optimism/optimism/op-node/withdrawals"
) )
var enableParallelTesting bool = true
// Init testing to enable test flags // Init testing to enable test flags
var _ = func() bool { var _ = func() bool {
testing.Init() testing.Init()
...@@ -42,10 +45,20 @@ var verboseGethNodes bool ...@@ -42,10 +45,20 @@ var verboseGethNodes bool
func init() { func init() {
flag.BoolVar(&verboseGethNodes, "gethlogs", true, "Enable logs on geth nodes") flag.BoolVar(&verboseGethNodes, "gethlogs", true, "Enable logs on geth nodes")
flag.Parse() flag.Parse()
if os.Getenv("OP_E2E_DISABLE_PARALLEL") == "true" {
enableParallelTesting = false
}
}
func parallel(t *testing.T) {
t.Helper()
if enableParallelTesting {
t.Parallel()
}
} }
func TestL2OutputSubmitter(t *testing.T) { func TestL2OutputSubmitter(t *testing.T) {
t.Parallel() parallel(t)
if !verboseGethNodes { if !verboseGethNodes {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
...@@ -119,7 +132,7 @@ func TestL2OutputSubmitter(t *testing.T) { ...@@ -119,7 +132,7 @@ func TestL2OutputSubmitter(t *testing.T) {
// TestSystemE2E sets up a L1 Geth node, a rollup node, and a L2 geth node and then confirms that L1 deposits are reflected on L2. // TestSystemE2E sets up a L1 Geth node, a rollup node, and a L2 geth node and then confirms that L1 deposits are reflected on L2.
// All nodes are run in process (but are the full nodes, not mocked or stubbed). // All nodes are run in process (but are the full nodes, not mocked or stubbed).
func TestSystemE2E(t *testing.T) { func TestSystemE2E(t *testing.T) {
t.Parallel() parallel(t)
if !verboseGethNodes { if !verboseGethNodes {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
...@@ -227,14 +240,14 @@ func TestSystemE2E(t *testing.T) { ...@@ -227,14 +240,14 @@ func TestSystemE2E(t *testing.T) {
// TestConfirmationDepth runs the rollup with both sequencer and verifier not immediately processing the tip of the chain. // TestConfirmationDepth runs the rollup with both sequencer and verifier not immediately processing the tip of the chain.
func TestConfirmationDepth(t *testing.T) { func TestConfirmationDepth(t *testing.T) {
t.Parallel() parallel(t)
if !verboseGethNodes { if !verboseGethNodes {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
cfg := DefaultSystemConfig(t) cfg := DefaultSystemConfig(t)
cfg.DeployConfig.SequencerWindowSize = 4 cfg.DeployConfig.SequencerWindowSize = 4
cfg.DeployConfig.MaxSequencerDrift = 3 * cfg.DeployConfig.L1BlockTime cfg.DeployConfig.MaxSequencerDrift = 10 * cfg.DeployConfig.L1BlockTime
seqConfDepth := uint64(2) seqConfDepth := uint64(2)
verConfDepth := uint64(5) verConfDepth := uint64(5)
cfg.Nodes["sequencer"].Driver.SequencerConfDepth = seqConfDepth cfg.Nodes["sequencer"].Driver.SequencerConfDepth = seqConfDepth
...@@ -275,7 +288,7 @@ func TestConfirmationDepth(t *testing.T) { ...@@ -275,7 +288,7 @@ func TestConfirmationDepth(t *testing.T) {
// TestFinalize tests if L2 finalizes after sufficient time after L1 finalizes // TestFinalize tests if L2 finalizes after sufficient time after L1 finalizes
func TestFinalize(t *testing.T) { func TestFinalize(t *testing.T) {
t.Parallel() parallel(t)
if !verboseGethNodes { if !verboseGethNodes {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
...@@ -303,7 +316,7 @@ func TestFinalize(t *testing.T) { ...@@ -303,7 +316,7 @@ func TestFinalize(t *testing.T) {
} }
func TestMintOnRevertedDeposit(t *testing.T) { func TestMintOnRevertedDeposit(t *testing.T) {
t.Parallel() parallel(t)
if !verboseGethNodes { if !verboseGethNodes {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
...@@ -350,7 +363,7 @@ func TestMintOnRevertedDeposit(t *testing.T) { ...@@ -350,7 +363,7 @@ func TestMintOnRevertedDeposit(t *testing.T) {
reconstructedDep, err := derive.UnmarshalDepositLogEvent(receipt.Logs[0]) reconstructedDep, err := derive.UnmarshalDepositLogEvent(receipt.Logs[0])
require.NoError(t, err, "Could not reconstruct L2 Deposit") require.NoError(t, err, "Could not reconstruct L2 Deposit")
tx = types.NewTx(reconstructedDep) tx = types.NewTx(reconstructedDep)
receipt, err = waitForTransaction(tx.Hash(), l2Verif, 3*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second) receipt, err = waitForTransaction(tx.Hash(), l2Verif, 10*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, receipt.Status, types.ReceiptStatusFailed) require.Equal(t, receipt.Status, types.ReceiptStatusFailed)
...@@ -377,7 +390,7 @@ func TestMintOnRevertedDeposit(t *testing.T) { ...@@ -377,7 +390,7 @@ func TestMintOnRevertedDeposit(t *testing.T) {
} }
func TestMissingBatchE2E(t *testing.T) { func TestMissingBatchE2E(t *testing.T) {
t.Parallel() parallel(t)
if !verboseGethNodes { if !verboseGethNodes {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
...@@ -500,7 +513,7 @@ func L1InfoFromState(ctx context.Context, contract *bindings.L1Block, l2Number * ...@@ -500,7 +513,7 @@ func L1InfoFromState(ctx context.Context, contract *bindings.L1Block, l2Number *
// TestSystemMockP2P sets up a L1 Geth node, a rollup node, and a L2 geth node and then confirms that // TestSystemMockP2P sets up a L1 Geth node, a rollup node, and a L2 geth node and then confirms that
// the nodes can sync L2 blocks before they are confirmed on L1. // the nodes can sync L2 blocks before they are confirmed on L1.
func TestSystemMockP2P(t *testing.T) { func TestSystemMockP2P(t *testing.T) {
t.Parallel() parallel(t)
if !verboseGethNodes { if !verboseGethNodes {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
...@@ -569,7 +582,7 @@ func TestSystemMockP2P(t *testing.T) { ...@@ -569,7 +582,7 @@ func TestSystemMockP2P(t *testing.T) {
} }
func TestL1InfoContract(t *testing.T) { func TestL1InfoContract(t *testing.T) {
t.Parallel() parallel(t)
if !verboseGethNodes { if !verboseGethNodes {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
...@@ -665,6 +678,7 @@ func TestL1InfoContract(t *testing.T) { ...@@ -665,6 +678,7 @@ func TestL1InfoContract(t *testing.T) {
} }
// calcGasFees determines the actual cost of the transaction given a specific basefee // calcGasFees determines the actual cost of the transaction given a specific basefee
// This does not include the L1 data fee charged from L2 transactions.
func calcGasFees(gasUsed uint64, gasTipCap *big.Int, gasFeeCap *big.Int, baseFee *big.Int) *big.Int { func calcGasFees(gasUsed uint64, gasTipCap *big.Int, gasFeeCap *big.Int, baseFee *big.Int) *big.Int {
x := new(big.Int).Add(gasTipCap, baseFee) x := new(big.Int).Add(gasTipCap, baseFee)
// If tip + basefee > gas fee cap, clamp it to the gas fee cap // If tip + basefee > gas fee cap, clamp it to the gas fee cap
...@@ -696,7 +710,7 @@ func calcL1GasUsed(data []byte, overhead *big.Int) *big.Int { ...@@ -696,7 +710,7 @@ func calcL1GasUsed(data []byte, overhead *big.Int) *big.Int {
// balance changes on L1 and L2 and has to include gas fees in the balance checks. // balance changes on L1 and L2 and has to include gas fees in the balance checks.
// It does not check that the withdrawal can be executed prior to the end of the finality period. // It does not check that the withdrawal can be executed prior to the end of the finality period.
func TestWithdrawals(t *testing.T) { func TestWithdrawals(t *testing.T) {
t.Parallel() parallel(t)
if !verboseGethNodes { if !verboseGethNodes {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
...@@ -747,7 +761,7 @@ func TestWithdrawals(t *testing.T) { ...@@ -747,7 +761,7 @@ func TestWithdrawals(t *testing.T) {
reconstructedDep, err := derive.UnmarshalDepositLogEvent(receipt.Logs[0]) reconstructedDep, err := derive.UnmarshalDepositLogEvent(receipt.Logs[0])
require.NoError(t, err, "Could not reconstruct L2 Deposit") require.NoError(t, err, "Could not reconstruct L2 Deposit")
tx = types.NewTx(reconstructedDep) tx = types.NewTx(reconstructedDep)
receipt, err = waitForTransaction(tx.Hash(), l2Verif, 3*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second) receipt, err = waitForTransaction(tx.Hash(), l2Verif, 10*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, receipt.Status, types.ReceiptStatusSuccessful) require.Equal(t, receipt.Status, types.ReceiptStatusSuccessful)
...@@ -793,6 +807,7 @@ func TestWithdrawals(t *testing.T) { ...@@ -793,6 +807,7 @@ func TestWithdrawals(t *testing.T) {
// Take fee into account // Take fee into account
diff = new(big.Int).Sub(startBalance, endBalance) diff = new(big.Int).Sub(startBalance, endBalance)
fees := calcGasFees(receipt.GasUsed, tx.GasTipCap(), tx.GasFeeCap(), header.BaseFee) fees := calcGasFees(receipt.GasUsed, tx.GasTipCap(), tx.GasFeeCap(), header.BaseFee)
fees = fees.Add(fees, receipt.L1Fee)
diff = diff.Sub(diff, fees) diff = diff.Sub(diff, fees)
require.Equal(t, withdrawAmount, diff) require.Equal(t, withdrawAmount, diff)
...@@ -868,7 +883,7 @@ func TestWithdrawals(t *testing.T) { ...@@ -868,7 +883,7 @@ func TestWithdrawals(t *testing.T) {
// TestFees checks that L1/L2 fees are handled. // TestFees checks that L1/L2 fees are handled.
func TestFees(t *testing.T) { func TestFees(t *testing.T) {
t.Parallel() parallel(t)
if !verboseGethNodes { if !verboseGethNodes {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
...@@ -908,13 +923,13 @@ func TestFees(t *testing.T) { ...@@ -908,13 +923,13 @@ func TestFees(t *testing.T) {
// BaseFee Recipient // BaseFee Recipient
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
defer cancel() defer cancel()
baseFeeRecipientStartBalance, err := l2Seq.BalanceAt(ctx, cfg.DeployConfig.OptimismBaseFeeRecipient, nil) baseFeeRecipientStartBalance, err := l2Seq.BalanceAt(ctx, predeploys.BaseFeeVaultAddr, nil)
require.Nil(t, err) require.Nil(t, err)
// L1Fee Recipient // L1Fee Recipient
ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second) ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second)
defer cancel() defer cancel()
l1FeeRecipientStartBalance, err := l2Seq.BalanceAt(ctx, cfg.DeployConfig.OptimismL1FeeRecipient, nil) l1FeeRecipientStartBalance, err := l2Seq.BalanceAt(ctx, predeploys.L1FeeVaultAddr, nil)
require.Nil(t, err) require.Nil(t, err)
// Simple transfer from signer to random account // Simple transfer from signer to random account
...@@ -970,7 +985,7 @@ func TestFees(t *testing.T) { ...@@ -970,7 +985,7 @@ func TestFees(t *testing.T) {
ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second) ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second)
defer cancel() defer cancel()
baseFeeRecipientEndBalance, err := l2Seq.BalanceAt(ctx, cfg.DeployConfig.OptimismBaseFeeRecipient, header.Number) baseFeeRecipientEndBalance, err := l2Seq.BalanceAt(ctx, predeploys.BaseFeeVaultAddr, header.Number)
require.Nil(t, err) require.Nil(t, err)
l1Header, err := sys.Clients["l1"].HeaderByNumber(ctx, nil) l1Header, err := sys.Clients["l1"].HeaderByNumber(ctx, nil)
...@@ -978,7 +993,7 @@ func TestFees(t *testing.T) { ...@@ -978,7 +993,7 @@ func TestFees(t *testing.T) {
ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second) ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second)
defer cancel() defer cancel()
l1FeeRecipientEndBalance, err := l2Seq.BalanceAt(ctx, cfg.DeployConfig.OptimismL1FeeRecipient, header.Number) l1FeeRecipientEndBalance, err := l2Seq.BalanceAt(ctx, predeploys.L1FeeVaultAddr, header.Number)
require.Nil(t, err) require.Nil(t, err)
// Diff fee recipient + coinbase balances // Diff fee recipient + coinbase balances
......
...@@ -3,9 +3,10 @@ package op_e2e ...@@ -3,9 +3,10 @@ package op_e2e
import ( import (
"context" "context"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/node" "github.com/ethereum-optimism/optimism/op-node/node"
"github.com/libp2p/go-libp2p-core/peer"
) )
type FnTracer struct { type FnTracer struct {
......
...@@ -7,6 +7,7 @@ COPY ./op-node/docker.go.work /app/go.work ...@@ -7,6 +7,7 @@ COPY ./op-node/docker.go.work /app/go.work
COPY ./op-bindings /app/op-bindings COPY ./op-bindings /app/op-bindings
COPY ./op-node /app/op-node COPY ./op-node /app/op-node
COPY ./op-chain-ops /app/op-chain-ops COPY ./op-chain-ops /app/op-chain-ops
COPY ./op-service /app/op-service
WORKDIR /app/op-node WORKDIR /app/op-node
......
...@@ -17,7 +17,6 @@ import ( ...@@ -17,7 +17,6 @@ import (
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum-optimism/optimism/op-bindings/hardhat" "github.com/ethereum-optimism/optimism/op-bindings/hardhat"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
...@@ -52,18 +51,30 @@ var Subcommands = cli.Commands{ ...@@ -52,18 +51,30 @@ var Subcommands = cli.Commands{
return err return err
} }
// Add the developer L1 addresses to the config
if err := config.InitDeveloperDeployedAddresses(); err != nil {
return err
}
if err := config.Check(); err != nil {
return err
}
l1Genesis, err := genesis.BuildL1DeveloperGenesis(config) l1Genesis, err := genesis.BuildL1DeveloperGenesis(config)
if err != nil { if err != nil {
return err return err
} }
l1StartBlock := l1Genesis.ToBlock() l1StartBlock := l1Genesis.ToBlock()
l2Genesis, err := genesis.BuildL2DeveloperGenesis(config, l1StartBlock, nil) l2Genesis, err := genesis.BuildL2DeveloperGenesis(config, l1StartBlock)
if err != nil { if err != nil {
return err return err
} }
rollupConfig := makeRollupConfig(config, l1StartBlock, l2Genesis, predeploys.DevOptimismPortalAddr, predeploys.DevSystemConfigAddr) rollupConfig, err := makeRollupConfig(config, l1StartBlock, l2Genesis)
if err != nil {
return err
}
if err := writeGenesisFile(ctx.String("outfile.l1"), l1Genesis); err != nil { if err := writeGenesisFile(ctx.String("outfile.l1"), l1Genesis); err != nil {
return err return err
...@@ -109,6 +120,9 @@ var Subcommands = cli.Commands{ ...@@ -109,6 +120,9 @@ var Subcommands = cli.Commands{
if config.L1StartingBlockTag == nil { if config.L1StartingBlockTag == nil {
return errors.New("must specify a starting block tag in genesis") return errors.New("must specify a starting block tag in genesis")
} }
if config.L2GenesisBlockGasLimit == 0 { // TODO: this is a hotfix, need to set default values in more clean way + sanity check the config
config.L2GenesisBlockGasLimit = 15_000_000
}
client, err := ethclient.Dial(ctx.String("l1-rpc")) client, err := ethclient.Dial(ctx.String("l1-rpc"))
if err != nil { if err != nil {
...@@ -131,39 +145,27 @@ var Subcommands = cli.Commands{ ...@@ -131,39 +145,27 @@ var Subcommands = cli.Commands{
return err return err
} }
l1SBP, err := hh.GetDeployment("L1StandardBridgeProxy") // Read the appropriate deployment addresses from disk
if err != nil { if err := config.GetDeployedAddresses(hh); err != nil {
return err return err
} }
l1XDMP, err := hh.GetDeployment("L1CrossDomainMessengerProxy") // Sanity check the config
if err != nil { if err := config.Check(); err != nil {
return err return err
} }
portalProxy, err := hh.GetDeployment("OptimismPortalProxy") // Build the developer L2 genesis block
l2Genesis, err := genesis.BuildL2DeveloperGenesis(config, l1StartBlock)
if err != nil { if err != nil {
return err return fmt.Errorf("error creating l2 developer genesis: %w", err)
}
sysCfgProxy, err := hh.GetDeployment("SystemConfigProxy")
if err != nil {
return err
} }
l1ERC721BP, err := hh.GetDeployment("L1ERC721BridgeProxy")
rollupConfig, err := makeRollupConfig(config, l1StartBlock, l2Genesis)
if err != nil { if err != nil {
return err return err
} }
if err := rollupConfig.Check(); err != nil {
l2Addrs := &genesis.L2Addresses{ return fmt.Errorf("generated rollup config does not pass validation: %w", err)
ProxyAdminOwner: config.ProxyAdminOwner,
L1StandardBridgeProxy: l1SBP.Address,
L1CrossDomainMessengerProxy: l1XDMP.Address,
L1ERC721BridgeProxy: l1ERC721BP.Address,
} }
l2Genesis, err := genesis.BuildL2DeveloperGenesis(config, l1StartBlock, l2Addrs)
if err != nil {
return fmt.Errorf("error creating l2 developer genesis: %w", err)
}
rollupConfig := makeRollupConfig(config, l1StartBlock, l2Genesis, portalProxy.Address, sysCfgProxy.Address)
if err := writeGenesisFile(ctx.String("outfile.l2"), l2Genesis); err != nil { if err := writeGenesisFile(ctx.String("outfile.l2"), l2Genesis); err != nil {
return err return err
...@@ -173,13 +175,14 @@ var Subcommands = cli.Commands{ ...@@ -173,13 +175,14 @@ var Subcommands = cli.Commands{
}, },
} }
func makeRollupConfig( func makeRollupConfig(config *genesis.DeployConfig, l1StartBlock *types.Block, l2Genesis *core.Genesis) (*rollup.Config, error) {
config *genesis.DeployConfig, if config.OptimismPortalProxy == (common.Address{}) {
l1StartBlock *types.Block, return nil, errors.New("OptimismPortalProxy cannot be address(0)")
l2Genesis *core.Genesis, }
portalAddr common.Address, if config.SystemConfigProxy == (common.Address{}) {
sysConfigAddr common.Address, return nil, errors.New("SystemConfigProxy cannot be address(0)")
) *rollup.Config { }
return &rollup.Config{ return &rollup.Config{
Genesis: rollup.Genesis{ Genesis: rollup.Genesis{
L1: eth.BlockID{ L1: eth.BlockID{
...@@ -195,6 +198,7 @@ func makeRollupConfig( ...@@ -195,6 +198,7 @@ func makeRollupConfig(
BatcherAddr: config.BatchSenderAddress, BatcherAddr: config.BatchSenderAddress,
Overhead: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(config.GasPriceOracleOverhead))), Overhead: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(config.GasPriceOracleOverhead))),
Scalar: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(config.GasPriceOracleScalar))), Scalar: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(config.GasPriceOracleScalar))),
GasLimit: uint64(config.L2GenesisBlockGasLimit),
}, },
}, },
BlockTime: config.L2BlockTime, BlockTime: config.L2BlockTime,
...@@ -205,9 +209,9 @@ func makeRollupConfig( ...@@ -205,9 +209,9 @@ func makeRollupConfig(
L2ChainID: new(big.Int).SetUint64(config.L2ChainID), L2ChainID: new(big.Int).SetUint64(config.L2ChainID),
P2PSequencerAddress: config.P2PSequencerAddress, P2PSequencerAddress: config.P2PSequencerAddress,
BatchInboxAddress: config.BatchInboxAddress, BatchInboxAddress: config.BatchInboxAddress,
DepositContractAddress: portalAddr, DepositContractAddress: config.OptimismPortalProxy,
L1SystemConfigAddress: sysConfigAddr, L1SystemConfigAddress: config.SystemConfigProxy,
} }, nil
} }
func writeGenesisFile(outfile string, input interface{}) error { func writeGenesisFile(outfile string, input interface{}) error {
......
...@@ -8,8 +8,8 @@ import ( ...@@ -8,8 +8,8 @@ import (
"os" "os"
"strings" "strings"
"github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p/core/peer"
"github.com/urfave/cli" "github.com/urfave/cli"
) )
......
...@@ -5,8 +5,8 @@ import ( ...@@ -5,8 +5,8 @@ import (
"encoding/hex" "encoding/hex"
"testing" "testing"
"github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
......
...@@ -3,5 +3,6 @@ go 1.18 ...@@ -3,5 +3,6 @@ go 1.18
use ( use (
./op-bindings ./op-bindings
./op-node ./op-node
./op-chain-ops ./op-chain-ops
./op-service
) )
...@@ -46,7 +46,7 @@ func (res *AccountResult) Verify(stateRoot common.Hash) error { ...@@ -46,7 +46,7 @@ func (res *AccountResult) Verify(stateRoot common.Hash) error {
trieDB := trie.NewDatabase(db) trieDB := trie.NewDatabase(db)
// wrap our DB of trie nodes with a Trie interface, and anchor it at the trusted state root // wrap our DB of trie nodes with a Trie interface, and anchor it at the trusted state root
proofTrie, err := trie.New(stateRoot, stateRoot, trieDB) proofTrie, err := trie.New(trie.StateTrieID(stateRoot), trieDB)
if err != nil { if err != nil {
return fmt.Errorf("failed to load db wrapper around kv store") return fmt.Errorf("failed to load db wrapper around kv store")
} }
......
...@@ -234,6 +234,8 @@ type PayloadAttributes struct { ...@@ -234,6 +234,8 @@ type PayloadAttributes struct {
Transactions []Data `json:"transactions,omitempty"` Transactions []Data `json:"transactions,omitempty"`
// NoTxPool to disable adding any transactions from the transaction-pool. // NoTxPool to disable adding any transactions from the transaction-pool.
NoTxPool bool `json:"noTxPool,omitempty"` NoTxPool bool `json:"noTxPool,omitempty"`
// GasLimit override
GasLimit *Uint64Quantity `json:"gasLimit,omitempty"`
} }
type ExecutePayloadStatus string type ExecutePayloadStatus string
...@@ -325,5 +327,7 @@ type SystemConfig struct { ...@@ -325,5 +327,7 @@ type SystemConfig struct {
Overhead Bytes32 `json:"overhead"` Overhead Bytes32 `json:"overhead"`
// Scalar identifies the L1 fee scalar, and is passed through opaquely to op-geth. // Scalar identifies the L1 fee scalar, and is passed through opaquely to op-geth.
Scalar Bytes32 `json:"scalar"` Scalar Bytes32 `json:"scalar"`
// GasLimit identifies the L2 block gas limit
GasLimit uint64 `json:"gasLimit"`
// More fields can be added for future SystemConfig versions. // More fields can be added for future SystemConfig versions.
} }
...@@ -3,25 +3,24 @@ module github.com/ethereum-optimism/optimism/op-node ...@@ -3,25 +3,24 @@ module github.com/ethereum-optimism/optimism/op-node
go 1.18 go 1.18
require ( require (
github.com/btcsuite/btcd/btcec/v2 v2.2.0 github.com/btcsuite/btcd v0.23.3
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
github.com/ethereum-optimism/optimism/op-bindings v0.9.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0
github.com/ethereum-optimism/optimism/op-chain-ops v0.9.0 github.com/ethereum-optimism/optimism/op-bindings v0.10.0
github.com/ethereum-optimism/optimism/op-service v0.9.0 github.com/ethereum-optimism/optimism/op-chain-ops v0.10.0
github.com/ethereum/go-ethereum v1.10.23 github.com/ethereum-optimism/optimism/op-service v0.10.0
github.com/ethereum/go-ethereum v1.10.26
github.com/golang/snappy v0.0.4 github.com/golang/snappy v0.0.4
github.com/google/go-cmp v0.5.8 github.com/google/go-cmp v0.5.8
github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/holiman/uint256 v1.2.0 github.com/holiman/uint256 v1.2.0
github.com/ipfs/go-datastore v0.5.1 github.com/ipfs/go-datastore v0.6.0
github.com/ipfs/go-ds-leveldb v0.5.0 github.com/ipfs/go-ds-leveldb v0.5.0
github.com/libp2p/go-libp2p v0.21.0 github.com/libp2p/go-libp2p v0.23.3
github.com/libp2p/go-libp2p-core v0.19.1 github.com/libp2p/go-libp2p-pubsub v0.8.1
github.com/libp2p/go-libp2p-peerstore v0.7.1 github.com/libp2p/go-libp2p-testing v0.12.0
github.com/libp2p/go-libp2p-pubsub v0.7.1 github.com/multiformats/go-multiaddr v0.7.0
github.com/libp2p/go-libp2p-testing v0.11.0
github.com/multiformats/go-multiaddr v0.6.0
github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/prometheus/client_golang v1.13.0 github.com/prometheus/client_golang v1.13.0
github.com/stretchr/testify v1.8.0 github.com/stretchr/testify v1.8.0
...@@ -34,15 +33,18 @@ require ( ...@@ -34,15 +33,18 @@ require (
github.com/allegro/bigcache v1.2.1 // indirect github.com/allegro/bigcache v1.2.1 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/btcsuite/btcd/btcutil v1.1.0 // indirect
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cheekybits/genny v1.0.0 // indirect
github.com/containerd/cgroups v1.0.4 // indirect github.com/containerd/cgroups v1.0.4 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/coreos/go-systemd/v22 v22.4.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/deckarep/golang-set v1.8.0 // indirect github.com/deckarep/golang-set v1.8.0 // indirect
github.com/docker/go-units v0.4.0 // indirect github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/elastic/gosigar v0.14.2 // indirect github.com/elastic/gosigar v0.14.2 // indirect
github.com/fjl/memsize v0.0.1 // indirect github.com/fjl/memsize v0.0.1 // indirect
...@@ -56,47 +58,44 @@ require ( ...@@ -56,47 +58,44 @@ require (
github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gopacket v1.1.19 // indirect github.com/google/gopacket v1.1.19 // indirect
github.com/google/uuid v1.3.0 // indirect github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-bexpr v0.1.11 // indirect github.com/hashicorp/go-bexpr v0.1.11 // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/huin/goupnp v1.0.3 // indirect github.com/huin/goupnp v1.0.3 // indirect
github.com/ipfs/go-cid v0.2.0 // indirect github.com/ipfs/go-cid v0.3.2 // indirect
github.com/ipfs/go-log v1.0.5 // indirect github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect github.com/jbenet/goprocess v0.1.4 // indirect
github.com/klauspost/compress v1.15.1 // indirect github.com/klauspost/compress v1.15.10 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect github.com/klauspost/cpuid/v2 v2.1.1 // indirect
github.com/koron/go-ssdp v0.0.3 // indirect github.com/koron/go-ssdp v0.0.3 // indirect
github.com/kr/text v0.2.0 // indirect github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-eventbus v0.2.1 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect
github.com/libp2p/go-libp2p-blankhost v0.4.0 // indirect
github.com/libp2p/go-libp2p-discovery v0.7.0 // indirect
github.com/libp2p/go-libp2p-swarm v0.11.0 // indirect
github.com/libp2p/go-mplex v0.7.0 // indirect github.com/libp2p/go-mplex v0.7.0 // indirect
github.com/libp2p/go-msgio v0.2.0 // indirect github.com/libp2p/go-msgio v0.2.0 // indirect
github.com/libp2p/go-nat v0.1.0 // indirect github.com/libp2p/go-nat v0.1.0 // indirect
github.com/libp2p/go-netroute v0.2.0 // indirect github.com/libp2p/go-netroute v0.2.0 // indirect
github.com/libp2p/go-openssl v0.0.7 // indirect github.com/libp2p/go-openssl v0.1.0 // indirect
github.com/libp2p/go-reuseport v0.2.0 // indirect github.com/libp2p/go-reuseport v0.2.0 // indirect
github.com/libp2p/go-yamux/v3 v3.1.2 // indirect github.com/libp2p/go-yamux/v4 v4.0.0 // indirect
github.com/lucas-clemente/quic-go v0.28.0 // indirect github.com/lucas-clemente/quic-go v0.29.1 // indirect
github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect
github.com/marten-seemann/qtls-go1-17 v0.1.2 // indirect
github.com/marten-seemann/qtls-go1-18 v0.1.2 // indirect github.com/marten-seemann/qtls-go1-18 v0.1.2 // indirect
github.com/marten-seemann/qtls-go1-19 v0.1.0-beta.1 // indirect github.com/marten-seemann/qtls-go1-19 v0.1.0 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/miekg/dns v1.1.50 // indirect github.com/miekg/dns v1.1.50 // indirect
...@@ -106,12 +105,12 @@ require ( ...@@ -106,12 +105,12 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/pointerstructure v1.2.1 // indirect github.com/mitchellh/pointerstructure v1.2.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.0.4 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multicodec v0.5.0 // indirect github.com/multiformats/go-multicodec v0.6.0 // indirect
github.com/multiformats/go-multihash v0.2.0 // indirect github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-multistream v0.3.3 // indirect github.com/multiformats/go-multistream v0.3.3 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect github.com/multiformats/go-varint v0.0.6 // indirect
github.com/nxadm/tail v1.4.8 // indirect github.com/nxadm/tail v1.4.8 // indirect
...@@ -133,24 +132,24 @@ require ( ...@@ -133,24 +132,24 @@ require (
github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/status-im/keycard-go v0.0.0-20211109104530-b0e0482ba91d // indirect
github.com/stretchr/objx v0.4.0 // indirect github.com/stretchr/objx v0.4.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect github.com/tklauser/numcpus v0.5.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/urfave/cli/v2 v2.11.1 // indirect github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.uber.org/atomic v1.9.0 // indirect go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.22.0 // indirect go.uber.org/zap v1.23.0 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 // indirect golang.org/x/net v0.0.0-20220920183852-bf014ff85ad5 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 // indirect golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
golang.org/x/tools v0.1.12 // indirect golang.org/x/tools v0.1.12 // indirect
google.golang.org/protobuf v1.28.1 // indirect google.golang.org/protobuf v1.28.1 // indirect
...@@ -160,4 +159,4 @@ require ( ...@@ -160,4 +159,4 @@ require (
lukechampine.com/blake3 v1.1.7 // indirect lukechampine.com/blake3 v1.1.7 // indirect
) )
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -10,17 +10,18 @@ import ( ...@@ -10,17 +10,18 @@ import (
"strconv" "strconv"
"time" "time"
libp2pmetrics "github.com/libp2p/go-libp2p-core/metrics"
pb "github.com/libp2p/go-libp2p-pubsub/pb" pb "github.com/libp2p/go-libp2p-pubsub/pb"
libp2pmetrics "github.com/libp2p/go-libp2p/core/metrics"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors" "github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum-optimism/optimism/op-node/eth"
) )
const ( const (
......
...@@ -3,7 +3,7 @@ package node ...@@ -3,7 +3,7 @@ package node
import ( import (
"context" "context"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p/core/peer"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
) )
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
"time" "time"
"github.com/hashicorp/go-multierror" "github.com/hashicorp/go-multierror"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p/core/peer"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
......
...@@ -14,13 +14,13 @@ import ( ...@@ -14,13 +14,13 @@ import (
ds "github.com/ipfs/go-datastore" ds "github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/sync" "github.com/ipfs/go-datastore/sync"
leveldb "github.com/ipfs/go-ds-leveldb" leveldb "github.com/ipfs/go-ds-leveldb"
core "github.com/libp2p/go-libp2p-core"
"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/peer"
lconf "github.com/libp2p/go-libp2p/config" lconf "github.com/libp2p/go-libp2p/config"
core "github.com/libp2p/go-libp2p/core"
"github.com/libp2p/go-libp2p/core/connmgr"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/p2p/muxer/mplex" "github.com/libp2p/go-libp2p/p2p/muxer/mplex"
"github.com/libp2p/go-libp2p/p2p/muxer/yamux" "github.com/libp2p/go-libp2p/p2p/muxer/yamux"
"github.com/libp2p/go-libp2p/p2p/net/conngater" "github.com/libp2p/go-libp2p/p2p/net/conngater"
...@@ -30,11 +30,12 @@ import ( ...@@ -30,11 +30,12 @@ import (
"github.com/multiformats/go-multiaddr" "github.com/multiformats/go-multiaddr"
"github.com/urfave/cli" "github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-node/flags"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum-optimism/optimism/op-node/flags"
"github.com/ethereum-optimism/optimism/op-node/rollup"
) )
// SetupP2P provides a host and discovery service for usage in the rollup node. // SetupP2P provides a host and discovery service for usage in the rollup node.
......
...@@ -11,22 +11,32 @@ import ( ...@@ -11,22 +11,32 @@ import (
"net" "net"
"time" "time"
"github.com/btcsuite/btcd/btcec/v2"
decredSecp "github.com/decred/dcrd/dcrec/secp256k1/v4" decredSecp "github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p/core/peer"
"github.com/multiformats/go-multiaddr" "github.com/multiformats/go-multiaddr"
"github.com/ethereum-optimism/optimism/op-node/rollup"
gcrypto "github.com/ethereum/go-ethereum/crypto" gcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/enr" "github.com/ethereum/go-ethereum/p2p/enr"
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
"github.com/btcsuite/btcd/blockchain"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/ethereum-optimism/optimism/op-node/rollup"
) )
// force to use the new chainhash module, and not the legacy chainhash package btcd module
const _ = chainhash.HashSize
// force to use the btcd module, while the keycard dependency in geth still depends on it,
// for go mod tidy to not clean up our explicit usage of v0.23.3, which resolves conflicts with the chainhash module
const _ = blockchain.CoinbaseWitnessDataLen
const ( const (
discoverIntervalFast = time.Second * 5 discoverIntervalFast = time.Second * 5
discoverIntervalSlow = time.Second * 20 discoverIntervalSlow = time.Second * 20
...@@ -111,7 +121,7 @@ func (v Secp256k1) ENRKey() string { return "secp256k1" } ...@@ -111,7 +121,7 @@ func (v Secp256k1) ENRKey() string { return "secp256k1" }
// EncodeRLP implements rlp.Encoder. // EncodeRLP implements rlp.Encoder.
func (v Secp256k1) EncodeRLP(w io.Writer) error { func (v Secp256k1) EncodeRLP(w io.Writer) error {
return rlp.Encode(w, (*btcec.PublicKey)(&v).SerializeCompressed()) return rlp.Encode(w, (*decredSecp.PublicKey)(&v).SerializeCompressed())
} }
// DecodeRLP implements rlp.Decoder. // DecodeRLP implements rlp.Decoder.
...@@ -120,7 +130,7 @@ func (v *Secp256k1) DecodeRLP(s *rlp.Stream) error { ...@@ -120,7 +130,7 @@ func (v *Secp256k1) DecodeRLP(s *rlp.Stream) error {
if err != nil { if err != nil {
return err return err
} }
pk, err := btcec.ParsePubKey(buf) pk, err := decredSecp.ParsePubKey(buf)
if err != nil { if err != nil {
return err return err
} }
......
...@@ -11,32 +11,31 @@ import ( ...@@ -11,32 +11,31 @@ import (
"github.com/golang/snappy" "github.com/golang/snappy"
lru "github.com/hashicorp/golang-lru" lru "github.com/hashicorp/golang-lru"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub "github.com/libp2p/go-libp2p-pubsub"
pb "github.com/libp2p/go-libp2p-pubsub/pb" pb "github.com/libp2p/go-libp2p-pubsub/pb"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
)
func init() {
// TODO: a PR is open to make this configurable upstream as option instead of having to override a global
// https://github.com/libp2p/go-libp2p-pubsub/pull/484
pubsub.TimeCacheDuration = 80 * pubsub.GossipSubHeartbeatInterval
}
const maxGossipSize = 1 << 20 "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
)
// minGossipSize is used to make sure that there is at least some data const (
// to validate the signature against. // maxGossipSize limits the total size of gossip RPC containers as well as decompressed individual messages.
const minGossipSize = 66 maxGossipSize = 10 * (1 << 20)
const maxOutboundQueue = 256 // minGossipSize is used to make sure that there is at least some data to validate the signature against.
const maxValidateQueue = 256 minGossipSize = 66
const globalValidateThrottle = 512 maxOutboundQueue = 256
maxValidateQueue = 256
globalValidateThrottle = 512
gossipHeartbeat = 500 * time.Millisecond
// seenMessagesTTL limits the duration that message IDs are remembered for gossip deduplication purposes
seenMessagesTTL = 80 * gossipHeartbeat
)
// Message domains, the msg id function uncompresses to keep data monomorphic, // Message domains, the msg id function uncompresses to keep data monomorphic,
// but invalid compressed data will need a unique different id. // but invalid compressed data will need a unique different id.
...@@ -44,8 +43,6 @@ const globalValidateThrottle = 512 ...@@ -44,8 +43,6 @@ const globalValidateThrottle = 512
var MessageDomainInvalidSnappy = [4]byte{0, 0, 0, 0} var MessageDomainInvalidSnappy = [4]byte{0, 0, 0, 0}
var MessageDomainValidSnappy = [4]byte{1, 0, 0, 0} var MessageDomainValidSnappy = [4]byte{1, 0, 0, 0}
const MaxGossipSize = 1 << 20
type GossipMetricer interface { type GossipMetricer interface {
RecordGossipEvent(evType int32) RecordGossipEvent(evType int32)
} }
...@@ -62,7 +59,7 @@ func BuildSubscriptionFilter(cfg *rollup.Config) pubsub.SubscriptionFilter { ...@@ -62,7 +59,7 @@ func BuildSubscriptionFilter(cfg *rollup.Config) pubsub.SubscriptionFilter {
var msgBufPool = sync.Pool{New: func() any { var msgBufPool = sync.Pool{New: func() any {
// note: the topic validator concurrency is limited, so pool won't blow up, even with large pre-allocation. // note: the topic validator concurrency is limited, so pool won't blow up, even with large pre-allocation.
x := make([]byte, 0, MaxGossipSize) x := make([]byte, 0, maxGossipSize)
return &x return &x
}} }}
...@@ -76,7 +73,7 @@ func BuildMsgIdFn(cfg *rollup.Config) pubsub.MsgIdFunction { ...@@ -76,7 +73,7 @@ func BuildMsgIdFn(cfg *rollup.Config) pubsub.MsgIdFunction {
// The validator can throw away the message later when recognized as invalid, // The validator can throw away the message later when recognized as invalid,
// and the unique hash helps detect duplicates. // and the unique hash helps detect duplicates.
dLen, err := snappy.DecodedLen(pmsg.Data) dLen, err := snappy.DecodedLen(pmsg.Data)
if err == nil && dLen <= MaxGossipSize { if err == nil && dLen <= maxGossipSize {
res := msgBufPool.Get().(*[]byte) res := msgBufPool.Get().(*[]byte)
defer msgBufPool.Put(res) defer msgBufPool.Put(res)
if data, err = snappy.Decode((*res)[:0], pmsg.Data); err == nil { if data, err = snappy.Decode((*res)[:0], pmsg.Data); err == nil {
...@@ -107,14 +104,14 @@ func BuildMsgIdFn(cfg *rollup.Config) pubsub.MsgIdFunction { ...@@ -107,14 +104,14 @@ func BuildMsgIdFn(cfg *rollup.Config) pubsub.MsgIdFunction {
func BuildGlobalGossipParams(cfg *rollup.Config) pubsub.GossipSubParams { func BuildGlobalGossipParams(cfg *rollup.Config) pubsub.GossipSubParams {
params := pubsub.DefaultGossipSubParams() params := pubsub.DefaultGossipSubParams()
params.D = 8 // topic stable mesh target count params.D = 8 // topic stable mesh target count
params.Dlo = 6 // topic stable mesh low watermark params.Dlo = 6 // topic stable mesh low watermark
params.Dhi = 12 // topic stable mesh high watermark params.Dhi = 12 // topic stable mesh high watermark
params.Dlazy = 6 // gossip target params.Dlazy = 6 // gossip target
params.HeartbeatInterval = 500 * time.Millisecond // interval of heartbeat params.HeartbeatInterval = gossipHeartbeat // interval of heartbeat
params.FanoutTTL = 24 * time.Second // ttl for fanout maps for topics we are not subscribed to but have published to params.FanoutTTL = 24 * time.Second // ttl for fanout maps for topics we are not subscribed to but have published to
params.HistoryLength = 12 // number of windows to retain full messages in cache for IWANT responses params.HistoryLength = 12 // number of windows to retain full messages in cache for IWANT responses
params.HistoryGossip = 3 // number of windows to gossip about params.HistoryGossip = 3 // number of windows to gossip about
return params return params
} }
...@@ -133,6 +130,7 @@ func NewGossipSub(p2pCtx context.Context, h host.Host, cfg *rollup.Config, m Gos ...@@ -133,6 +130,7 @@ func NewGossipSub(p2pCtx context.Context, h host.Host, cfg *rollup.Config, m Gos
pubsub.WithValidateQueueSize(maxValidateQueue), pubsub.WithValidateQueueSize(maxValidateQueue),
pubsub.WithPeerOutboundQueueSize(maxOutboundQueue), pubsub.WithPeerOutboundQueueSize(maxOutboundQueue),
pubsub.WithValidateThrottle(globalValidateThrottle), pubsub.WithValidateThrottle(globalValidateThrottle),
pubsub.WithSeenMessagesTTL(seenMessagesTTL),
pubsub.WithPeerExchange(false), pubsub.WithPeerExchange(false),
pubsub.WithBlacklist(denyList), pubsub.WithBlacklist(denyList),
pubsub.WithGossipSubParams(BuildGlobalGossipParams(cfg)), pubsub.WithGossipSubParams(BuildGlobalGossipParams(cfg)),
......
...@@ -6,13 +6,13 @@ import ( ...@@ -6,13 +6,13 @@ import (
"net" "net"
"time" "time"
"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-peerstore/pstoreds"
lconf "github.com/libp2p/go-libp2p/config" lconf "github.com/libp2p/go-libp2p/config"
"github.com/libp2p/go-libp2p/core/connmgr"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/peer"
basichost "github.com/libp2p/go-libp2p/p2p/host/basic" basichost "github.com/libp2p/go-libp2p/p2p/host/basic"
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoreds"
"github.com/libp2p/go-libp2p/p2p/transport/tcp" "github.com/libp2p/go-libp2p/p2p/transport/tcp"
ma "github.com/multiformats/go-multiaddr" ma "github.com/multiformats/go-multiaddr"
madns "github.com/multiformats/go-multiaddr-dns" madns "github.com/multiformats/go-multiaddr-dns"
......
...@@ -10,22 +10,23 @@ import ( ...@@ -10,22 +10,23 @@ import (
ds "github.com/ipfs/go-datastore" ds "github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/sync" "github.com/ipfs/go-datastore/sync"
"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
lconf "github.com/libp2p/go-libp2p/config" lconf "github.com/libp2p/go-libp2p/config"
"github.com/libp2p/go-libp2p/core/connmgr"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/p2p/muxer/yamux" "github.com/libp2p/go-libp2p/p2p/muxer/yamux"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
tswarm "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" tswarm "github.com/libp2p/go-libp2p/p2p/net/swarm/testing"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
) )
func TestingConfig(t *testing.T) *Config { func TestingConfig(t *testing.T) *Config {
......
...@@ -6,19 +6,21 @@ import ( ...@@ -6,19 +6,21 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/hashicorp/go-multierror" "github.com/hashicorp/go-multierror"
"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/host"
p2pmetrics "github.com/libp2p/go-libp2p-core/metrics"
pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/core/connmgr"
"github.com/libp2p/go-libp2p/core/host"
p2pmetrics "github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/p2p/protocol/identify" "github.com/libp2p/go-libp2p/p2p/protocol/identify"
ma "github.com/multiformats/go-multiaddr" ma "github.com/multiformats/go-multiaddr"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum-optimism/optimism/op-node/rollup"
) )
type NodeP2P struct { type NodeP2P struct {
......
package p2p package p2p
import ( import (
"github.com/ethereum-optimism/optimism/op-node/metrics" "github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p-core/network"
ma "github.com/multiformats/go-multiaddr" ma "github.com/multiformats/go-multiaddr"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
......
...@@ -4,14 +4,15 @@ import ( ...@@ -4,14 +4,15 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p-core/metrics" "github.com/libp2p/go-libp2p/core/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/enr" "github.com/ethereum/go-ethereum/p2p/enr"
"github.com/ethereum-optimism/optimism/op-node/rollup"
) )
// Prepared provides a p2p host and discv5 service that is already set up. // Prepared provides a p2p host and discv5 service that is already set up.
......
...@@ -5,8 +5,8 @@ import ( ...@@ -5,8 +5,8 @@ import (
"net" "net"
"time" "time"
"github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p/core/peer"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
) )
......
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"context" "context"
"net" "net"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p/core/peer"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
......
...@@ -8,20 +8,21 @@ import ( ...@@ -8,20 +8,21 @@ import (
"time" "time"
decredSecp "github.com/decred/dcrd/dcrec/secp256k1/v4" decredSecp "github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/peerstore"
pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p-testing/netutil" "github.com/libp2p/go-libp2p-testing/netutil"
"github.com/libp2p/go-libp2p/core/connmgr"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/peerstore"
"github.com/ethereum-optimism/optimism/op-node/metrics"
gcrypto "github.com/ethereum/go-ethereum/crypto" gcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum-optimism/optimism/op-node/metrics"
) )
// TODO: dynamic peering // TODO: dynamic peering
......
...@@ -93,5 +93,6 @@ func PreparePayloadAttributes(ctx context.Context, cfg *rollup.Config, dl L1Rece ...@@ -93,5 +93,6 @@ func PreparePayloadAttributes(ctx context.Context, cfg *rollup.Config, dl L1Rece
SuggestedFeeRecipient: predeploys.SequencerFeeVaultAddr, SuggestedFeeRecipient: predeploys.SequencerFeeVaultAddr,
Transactions: txs, Transactions: txs,
NoTxPool: true, NoTxPool: true,
GasLimit: (*eth.Uint64Quantity)(&sysConfig.GasLimit),
}, nil }, nil
} }
...@@ -53,11 +53,13 @@ func TestAttributesQueue(t *testing.T) { ...@@ -53,11 +53,13 @@ func TestAttributesQueue(t *testing.T) {
BatcherAddr: common.Address{42}, BatcherAddr: common.Address{42},
Overhead: [32]byte{}, Overhead: [32]byte{},
Scalar: [32]byte{}, Scalar: [32]byte{},
GasLimit: 1234,
} }
expectedL1Cfg := eth.SystemConfig{ expectedL1Cfg := eth.SystemConfig{
BatcherAddr: common.Address{42}, BatcherAddr: common.Address{42},
Overhead: [32]byte{}, Overhead: [32]byte{},
Scalar: [32]byte{}, Scalar: [32]byte{},
GasLimit: 1234,
} }
l2Fetcher := &testutils.MockL2Client{} l2Fetcher := &testutils.MockL2Client{}
...@@ -71,6 +73,7 @@ func TestAttributesQueue(t *testing.T) { ...@@ -71,6 +73,7 @@ func TestAttributesQueue(t *testing.T) {
SuggestedFeeRecipient: predeploys.SequencerFeeVaultAddr, SuggestedFeeRecipient: predeploys.SequencerFeeVaultAddr,
Transactions: []eth.Data{l1InfoTx, eth.Data("foobar"), eth.Data("example")}, Transactions: []eth.Data{l1InfoTx, eth.Data("foobar"), eth.Data("example")},
NoTxPool: true, NoTxPool: true,
GasLimit: (*eth.Uint64Quantity)(&expectedL1Cfg.GasLimit),
} }
aq := NewAttributesQueue(testlog.Logger(t, log.LvlError), cfg, l1Fetcher, l2Fetcher, nil) aq := NewAttributesQueue(testlog.Logger(t, log.LvlError), cfg, l1Fetcher, l2Fetcher, nil)
......
...@@ -4,8 +4,9 @@ import ( ...@@ -4,8 +4,9 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum-optimism/optimism/op-node/eth"
) )
// AttributesMatchBlock checks if the L2 attributes pre-inputs match the output // AttributesMatchBlock checks if the L2 attributes pre-inputs match the output
...@@ -28,5 +29,11 @@ func AttributesMatchBlock(attrs *eth.PayloadAttributes, parentHash common.Hash, ...@@ -28,5 +29,11 @@ func AttributesMatchBlock(attrs *eth.PayloadAttributes, parentHash common.Hash,
return fmt.Errorf("transaction %d does not match. expected: %v. got: %v", i, expect, otx) return fmt.Errorf("transaction %d does not match. expected: %v. got: %v", i, expect, otx)
} }
} }
if attrs.GasLimit == nil {
return fmt.Errorf("expected gaslimit in attributes to not be nil, expected %d", block.GasLimit)
}
if *attrs.GasLimit != block.GasLimit {
return fmt.Errorf("gas limit does not match. expected %d. got: %d", *attrs.GasLimit, block.GasLimit)
}
return nil return nil
} }
...@@ -511,7 +511,7 @@ func (eq *EngineQueue) Reset(ctx context.Context, _ eth.L1BlockRef, _ eth.System ...@@ -511,7 +511,7 @@ func (eq *EngineQueue) Reset(ctx context.Context, _ eth.L1BlockRef, _ eth.System
} }
l1Cfg, err := eq.engine.SystemConfigByL2Hash(ctx, pipelineL2.Hash) l1Cfg, err := eq.engine.SystemConfigByL2Hash(ctx, pipelineL2.Hash)
if err != nil { if err != nil {
return NewTemporaryError(fmt.Errorf("failed to fetch L1 config of L2 block %s: %v", pipelineL2.ID(), err)) return NewTemporaryError(fmt.Errorf("failed to fetch L1 config of L2 block %s: %w", pipelineL2.ID(), err))
} }
eq.log.Debug("Reset engine queue", "safeHead", safe, "unsafe", unsafe, "safe_timestamp", safe.Time, "unsafe_timestamp", unsafe.Time, "l1Origin", l1Origin) eq.log.Debug("Reset engine queue", "safeHead", safe, "unsafe", unsafe, "safe_timestamp", safe.Time, "unsafe_timestamp", unsafe.Time, "l1Origin", l1Origin)
eq.unsafeHead = unsafe eq.unsafeHead = unsafe
......
...@@ -233,6 +233,7 @@ func TestEngineQueue_Finalize(t *testing.T) { ...@@ -233,6 +233,7 @@ func TestEngineQueue_Finalize(t *testing.T) {
BatcherAddr: common.Address{42}, BatcherAddr: common.Address{42},
Overhead: [32]byte{123}, Overhead: [32]byte{123},
Scalar: [32]byte{42}, Scalar: [32]byte{42},
GasLimit: 20_000_000,
}, nil) }, nil)
prev := &fakeAttributesQueue{} prev := &fakeAttributesQueue{}
......
...@@ -28,6 +28,7 @@ func randomL1Cfg(rng *rand.Rand, l1Info eth.BlockInfo) eth.SystemConfig { ...@@ -28,6 +28,7 @@ func randomL1Cfg(rng *rand.Rand, l1Info eth.BlockInfo) eth.SystemConfig {
BatcherAddr: testutils.RandomAddress(rng), BatcherAddr: testutils.RandomAddress(rng),
Overhead: [32]byte{}, Overhead: [32]byte{},
Scalar: [32]byte{}, Scalar: [32]byte{},
GasLimit: 1234567,
} }
} }
......
...@@ -73,11 +73,11 @@ func (l1t *L1Traversal) AdvanceL1Block(ctx context.Context) error { ...@@ -73,11 +73,11 @@ func (l1t *L1Traversal) AdvanceL1Block(ctx context.Context) error {
// Parse L1 receipts of the given block and update the L1 system configuration // Parse L1 receipts of the given block and update the L1 system configuration
_, receipts, err := l1t.l1Blocks.FetchReceipts(ctx, nextL1Origin.Hash) _, receipts, err := l1t.l1Blocks.FetchReceipts(ctx, nextL1Origin.Hash)
if err != nil { if err != nil {
return NewTemporaryError(fmt.Errorf("failed to fetch receipts of L1 block %s for L1 sysCfg update: %v", origin, err)) return NewTemporaryError(fmt.Errorf("failed to fetch receipts of L1 block %s for L1 sysCfg update: %w", origin, err))
} }
if err := UpdateSystemConfigWithL1Receipts(&l1t.sysCfg, receipts, l1t.cfg); err != nil { if err := UpdateSystemConfigWithL1Receipts(&l1t.sysCfg, receipts, l1t.cfg); err != nil {
// the sysCfg changes should always be formatted correctly. // the sysCfg changes should always be formatted correctly.
return NewCriticalError(fmt.Errorf("failed to update L1 sysCfg with receipts from block %s: %v", origin, err)) return NewCriticalError(fmt.Errorf("failed to update L1 sysCfg with receipts from block %s: %w", origin, err))
} }
l1t.block = nextL1Origin l1t.block = nextL1Origin
......
...@@ -74,6 +74,7 @@ func PayloadToSystemConfig(payload *eth.ExecutionPayload, cfg *rollup.Config) (e ...@@ -74,6 +74,7 @@ func PayloadToSystemConfig(payload *eth.ExecutionPayload, cfg *rollup.Config) (e
BatcherAddr: info.BatcherAddr, BatcherAddr: info.BatcherAddr,
Overhead: info.L1FeeOverhead, Overhead: info.L1FeeOverhead,
Scalar: info.L1FeeScalar, Scalar: info.L1FeeScalar,
GasLimit: uint64(payload.GasLimit),
}, err }, err
} }
} }
...@@ -2,6 +2,7 @@ package derive ...@@ -2,6 +2,7 @@ package derive
import ( import (
"bytes" "bytes"
"encoding/binary"
"fmt" "fmt"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
...@@ -16,6 +17,7 @@ import ( ...@@ -16,6 +17,7 @@ import (
var ( var (
SystemConfigUpdateBatcher = common.Hash{31: 0} SystemConfigUpdateBatcher = common.Hash{31: 0}
SystemConfigUpdateGasConfig = common.Hash{31: 1} SystemConfigUpdateGasConfig = common.Hash{31: 1}
SystemConfigUpdateGasLimit = common.Hash{31: 2}
) )
var ( var (
...@@ -96,6 +98,21 @@ func ProcessSystemConfigUpdateLogEvent(destSysCfg *eth.SystemConfig, ev *types.L ...@@ -96,6 +98,21 @@ func ProcessSystemConfigUpdateLogEvent(destSysCfg *eth.SystemConfig, ev *types.L
copy(destSysCfg.Overhead[:], ev.Data[64:96]) copy(destSysCfg.Overhead[:], ev.Data[64:96])
copy(destSysCfg.Scalar[:], ev.Data[96:128]) copy(destSysCfg.Scalar[:], ev.Data[96:128])
return nil return nil
case SystemConfigUpdateGasLimit:
if len(ev.Data) != 32*3 {
return fmt.Errorf("expected 32*3 bytes in gas limit update, but got %d bytes", len(ev.Data))
}
if x := common.BytesToHash(ev.Data[:32]); x != (common.Hash{31: 32}) {
return fmt.Errorf("expected offset to point to length location, but got %s", x)
}
if x := common.BytesToHash(ev.Data[32:64]); x != (common.Hash{31: 32}) {
return fmt.Errorf("expected length of 1 bytes32, but got %s", x)
}
if !bytes.Equal(ev.Data[64:64+24], make([]byte, 24)) {
return fmt.Errorf("expected zero padding for gaslimit, but got %x", ev.Data)
}
destSysCfg.GasLimit = binary.BigEndian.Uint64(ev.Data[64+24:])
return nil
default: default:
return fmt.Errorf("unrecognized L1 sysCfg update type: %s", updateType) return fmt.Errorf("unrecognized L1 sysCfg update type: %s", updateType)
} }
......
...@@ -47,7 +47,18 @@ func (los *L1OriginSelector) FindL1Origin(ctx context.Context, l1Head eth.L1Bloc ...@@ -47,7 +47,18 @@ func (los *L1OriginSelector) FindL1Origin(ctx context.Context, l1Head eth.L1Bloc
return eth.L1BlockRef{}, err return eth.L1BlockRef{}, err
} }
if currentOrigin.Number+1+los.sequencingConfDepth > l1Head.Number { // If we are past the sequencer depth, we may want to advance the origin, but need to still
// check the time of the next origin.
pastSeqDrift := l2Head.Time+los.cfg.BlockTime > currentOrigin.Time+los.cfg.MaxSequencerDrift
if pastSeqDrift {
log.Info("Next L2 block time is past the sequencer drift + current origin time",
"current", currentOrigin, "current_time", currentOrigin.Time,
"l1_head", l1Head, "l1_head_time", l1Head.Time,
"l2_head", l2Head, "l2_head_time", l2Head.Time,
"depth", los.sequencingConfDepth)
}
if !pastSeqDrift && currentOrigin.Number+1+los.sequencingConfDepth > l1Head.Number {
// TODO: we can decide to ignore confirmation depth if we would be forced // TODO: we can decide to ignore confirmation depth if we would be forced
// to make an empty block (only deposits) by staying on the current origin. // to make an empty block (only deposits) by staying on the current origin.
log.Info("sequencing with old origin to preserve conf depth", log.Info("sequencing with old origin to preserve conf depth",
...@@ -62,6 +73,8 @@ func (los *L1OriginSelector) FindL1Origin(ctx context.Context, l1Head eth.L1Bloc ...@@ -62,6 +73,8 @@ func (los *L1OriginSelector) FindL1Origin(ctx context.Context, l1Head eth.L1Bloc
// the current origin block. // the current origin block.
nextOrigin, err := los.l1.L1BlockRefByNumber(ctx, currentOrigin.Number+1) nextOrigin, err := los.l1.L1BlockRefByNumber(ctx, currentOrigin.Number+1)
if err != nil { if err != nil {
// TODO: this could result in a bad origin being selected if we are past the seq
// drift & should instead advance to the next origin.
log.Error("Failed to get next origin. Falling back to current origin", "err", err) log.Error("Failed to get next origin. Falling back to current origin", "err", err)
return currentOrigin, nil return currentOrigin, nil
} }
......
...@@ -133,3 +133,86 @@ func TestOriginSelectorRespectsConfDepth(t *testing.T) { ...@@ -133,3 +133,86 @@ func TestOriginSelectorRespectsConfDepth(t *testing.T) {
require.Nil(t, err) require.Nil(t, err)
require.Equal(t, a, next) require.Equal(t, a, next)
} }
// TestOriginSelectorRespectsMaxSeqDrift ensures that the origin selector
// will advance if the time delta between the current L1 origin and the next
// L2 block is greater than the sequencer drift. This needs to occur even
// if conf depth needs to be ignored
//
// There are 2 L1 blocks at time 20 & 25. The L2 Head is at time 27.
// The next L2 time is 29. The sequencer drift is 8 so the L2 head is
// valid with origin `a`, but the next L2 block is not valid with origin `b.`
// This is because 29 (next L2 time) > 20 (origin) + 8 (seq drift) => invalid block.
// Even though the LOS would normally refuse to advance because block `b` does not
// have enough confirmations, it should in this instance.
func TestOriginSelectorRespectsMaxSeqDrift(t *testing.T) {
log := testlog.Logger(t, log.LvlCrit)
cfg := &rollup.Config{
MaxSequencerDrift: 8,
BlockTime: 2,
}
l1 := &testutils.MockL1Source{}
a := eth.L1BlockRef{
Hash: common.Hash{'a'},
Number: 10,
Time: 20,
}
b := eth.L1BlockRef{
Hash: common.Hash{'b'},
Number: 11,
Time: 25,
ParentHash: a.Hash,
}
l2Head := eth.L2BlockRef{
L1Origin: a.ID(),
Time: 27,
}
l1.ExpectL1BlockRefByHash(a.Hash, a, nil)
l1.ExpectL1BlockRefByNumber(b.Number, b, nil)
s := NewL1OriginSelector(log, cfg, l1, 10)
next, err := s.FindL1Origin(context.Background(), b, l2Head)
require.Nil(t, err)
require.Equal(t, b, next)
}
// TestOriginSelectorSeqDriftRespectsNextOriginTime
//
// There are 2 L1 blocks at time 20 & 100. The L2 Head is at time 27.
// The next L2 time is 29. Even though the next L2 time is past the seq
// drift, the origin should remain on block `a` because the next origin's
// time is greater than the next L2 time.
func TestOriginSelectorSeqDriftRespectsNextOriginTime(t *testing.T) {
log := testlog.Logger(t, log.LvlCrit)
cfg := &rollup.Config{
MaxSequencerDrift: 8,
BlockTime: 2,
}
l1 := &testutils.MockL1Source{}
a := eth.L1BlockRef{
Hash: common.Hash{'a'},
Number: 10,
Time: 20,
}
b := eth.L1BlockRef{
Hash: common.Hash{'b'},
Number: 11,
Time: 100,
ParentHash: a.Hash,
}
l2Head := eth.L2BlockRef{
L1Origin: a.ID(),
Time: 27,
}
l1.ExpectL1BlockRefByHash(a.Hash, a, nil)
l1.ExpectL1BlockRefByNumber(b.Number, b, nil)
s := NewL1OriginSelector(log, cfg, l1, 10)
next, err := s.FindL1Origin(context.Background(), b, l2Head)
require.Nil(t, err)
require.Equal(t, a, next)
}
...@@ -100,6 +100,14 @@ func (d *Sequencer) CreateNewBlock(ctx context.Context, l2Head eth.L2BlockRef, l ...@@ -100,6 +100,14 @@ func (d *Sequencer) CreateNewBlock(ctx context.Context, l2Head eth.L2BlockRef, l
if err := d.StartBuildingBlock(ctx, l2Head, l2SafeHead, l2Finalized, l1Origin); err != nil { if err := d.StartBuildingBlock(ctx, l2Head, l2SafeHead, l2Finalized, l1Origin); err != nil {
return l2Head, nil, err return l2Head, nil, err
} }
payloadTime := time.Unix(int64(l2Head.Time+d.config.BlockTime), 0)
remaining := -time.Until(payloadTime)
// TODO: allowing to breathe when remaining time is in the negative is very generous,
// we can reduce this if the block building timing gets better with PR 3818
d.log.Debug("using remaining time for better block production", "remaining_time", remaining)
time.Sleep(500 * time.Millisecond)
payload, err := d.CompleteBuildingBlock(ctx) payload, err := d.CompleteBuildingBlock(ctx)
if err != nil { if err != nil {
return l2Head, nil, err return l2Head, nil, err
......
...@@ -279,8 +279,9 @@ func (s *Driver) eventLoop() { ...@@ -279,8 +279,9 @@ func (s *Driver) eventLoop() {
// requesting a new block ASAP instead of waiting for the next tick. // requesting a new block ASAP instead of waiting for the next tick.
// We don't request a block if the confirmation depth is not met. // We don't request a block if the confirmation depth is not met.
l2Head := s.derivation.UnsafeL2Head() l2Head := s.derivation.UnsafeL2Head()
if l1Head.Number > l2Head.L1Origin.Number+s.driverConfig.SequencerConfDepth { if wallClock := uint64(time.Now().Unix()); l2Head.Time+s.config.BlockTime <= wallClock {
s.log.Trace("Building another L2 block asap to catch up with L1 head", "l2_unsafe", l2Head, "l2_unsafe_l1_origin", l2Head.L1Origin, "l1_head", l1Head) s.log.Trace("Building another L2 block asap to catch up with wallclock",
"l2_unsafe", l2Head, "l2_unsafe_time", l2Head.Time, "wallclock", wallClock)
// But not too quickly to minimize busy-waiting for new blocks // But not too quickly to minimize busy-waiting for new blocks
time.AfterFunc(time.Millisecond*10, reqL2BlockCreation) time.AfterFunc(time.Millisecond*10, reqL2BlockCreation)
} }
......
...@@ -81,6 +81,18 @@ func (cfg *Config) Check() error { ...@@ -81,6 +81,18 @@ func (cfg *Config) Check() error {
if cfg.Genesis.L2Time == 0 { if cfg.Genesis.L2Time == 0 {
return errors.New("missing L2 genesis time") return errors.New("missing L2 genesis time")
} }
if cfg.Genesis.SystemConfig.BatcherAddr == (common.Address{}) {
return errors.New("missing genesis system config batcher address")
}
if cfg.Genesis.SystemConfig.Overhead == (eth.Bytes32{}) {
return errors.New("missing genesis system config overhead")
}
if cfg.Genesis.SystemConfig.Scalar == (eth.Bytes32{}) {
return errors.New("missing genesis system config scalar")
}
if cfg.Genesis.SystemConfig.GasLimit == 0 {
return errors.New("missing genesis system config gas limit")
}
if cfg.P2PSequencerAddress == (common.Address{}) { if cfg.P2PSequencerAddress == (common.Address{}) {
return errors.New("missing p2p sequencer address") return errors.New("missing p2p sequencer address")
} }
......
...@@ -32,6 +32,7 @@ func randConfig() *Config { ...@@ -32,6 +32,7 @@ func randConfig() *Config {
BatcherAddr: randAddr(), BatcherAddr: randAddr(),
Overhead: randHash(), Overhead: randHash(),
Scalar: randHash(), Scalar: randHash(),
GasLimit: 1234567,
}, },
}, },
BlockTime: 2, BlockTime: 2,
......
...@@ -30,6 +30,9 @@ func makeReceiptsFn(block eth.BlockID, receiptHash common.Hash) func(txHashes [] ...@@ -30,6 +30,9 @@ func makeReceiptsFn(block eth.BlockID, receiptHash common.Hash) func(txHashes []
if r.TransactionIndex != uint(i) { if r.TransactionIndex != uint(i) {
return nil, fmt.Errorf("receipt %d has unexpected tx index %d", i, r.TransactionIndex) return nil, fmt.Errorf("receipt %d has unexpected tx index %d", i, r.TransactionIndex)
} }
if r.BlockNumber == nil {
return nil, fmt.Errorf("receipt %d has unexpected nil block number, expected %d", i, block.Number)
}
if r.BlockNumber.Uint64() != block.Number { if r.BlockNumber.Uint64() != block.Number {
return nil, fmt.Errorf("receipt %d has unexpected block number %d, expected %d", i, r.BlockNumber, block.Number) return nil, fmt.Errorf("receipt %d has unexpected block number %d, expected %d", i, r.BlockNumber, block.Number)
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
package testlog package testlog
import ( import (
"os"
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
...@@ -26,6 +27,14 @@ import ( ...@@ -26,6 +27,14 @@ import (
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
var useColorInTestLog bool = true
func init() {
if os.Getenv("OP_TESTLOG_DISABLE_COLOR") == "true" {
useColorInTestLog = false
}
}
// Testing interface to log to. Some functions are marked as Helper function to log the call site accurately. // Testing interface to log to. Some functions are marked as Helper function to log the call site accurately.
// Standard Go testing.TB implements this, as well as Hive and other Go-like test frameworks. // Standard Go testing.TB implements this, as well as Hive and other Go-like test frameworks.
type Testing interface { type Testing interface {
...@@ -75,7 +84,7 @@ func Logger(t Testing, level log.Lvl) log.Logger { ...@@ -75,7 +84,7 @@ func Logger(t Testing, level log.Lvl) log.Logger {
t: t, t: t,
l: log.New(), l: log.New(),
mu: new(sync.Mutex), mu: new(sync.Mutex),
h: &bufHandler{fmt: log.TerminalFormat(true)}, h: &bufHandler{fmt: log.TerminalFormat(useColorInTestLog)},
} }
l.l.SetHandler(log.LvlFilterHandler(level, l.h)) l.l.SetHandler(log.LvlFilterHandler(level, l.h))
return l return l
...@@ -146,9 +155,10 @@ func (l *logger) flush() { ...@@ -146,9 +155,10 @@ func (l *logger) flush() {
l.t.Helper() l.t.Helper()
// 2 frame skip for flush() + public logger fn // 2 frame skip for flush() + public logger fn
decorationLen := estimateInfoLen(2) decorationLen := estimateInfoLen(2)
padding := 20 padding := 0
if decorationLen <= 25 { padLength := 30
padding = 25 - decorationLen if decorationLen <= padLength {
padding = padLength - decorationLen
} }
for _, r := range l.h.buf { for _, r := range l.h.buf {
l.t.Logf("%*s%s", padding, "", l.h.fmt.Format(r)) l.t.Logf("%*s%s", padding, "", l.h.fmt.Format(r))
......
...@@ -3,11 +3,11 @@ module github.com/ethereum-optimism/optimism/op-proposer ...@@ -3,11 +3,11 @@ module github.com/ethereum-optimism/optimism/op-proposer
go 1.18 go 1.18
require ( require (
github.com/ethereum-optimism/optimism/op-bindings v0.9.0 github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3
github.com/ethereum-optimism/optimism/op-node v0.9.0 github.com/ethereum-optimism/optimism/op-bindings v0.10.0
github.com/ethereum-optimism/optimism/op-service v0.9.0 github.com/ethereum-optimism/optimism/op-node v0.10.0
github.com/ethereum/go-ethereum v1.10.23 github.com/ethereum-optimism/optimism/op-service v0.10.0
github.com/miguelmota/go-ethereum-hdwallet v0.1.1 github.com/ethereum/go-ethereum v1.10.26
github.com/stretchr/testify v1.8.0 github.com/stretchr/testify v1.8.0
github.com/urfave/cli v1.22.9 github.com/urfave/cli v1.22.9
) )
...@@ -16,15 +16,15 @@ require ( ...@@ -16,15 +16,15 @@ require (
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.22.1 // indirect github.com/btcsuite/btcd v0.23.3 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/btcsuite/btcd/btcutil v1.1.0 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/fjl/memsize v0.0.1 // indirect github.com/fjl/memsize v0.0.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect github.com/go-stack/stack v1.8.1 // indirect
...@@ -38,31 +38,33 @@ require ( ...@@ -38,31 +38,33 @@ require (
github.com/hashicorp/go-bexpr v0.1.11 // indirect github.com/hashicorp/go-bexpr v0.1.11 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.0 // indirect github.com/holiman/uint256 v1.2.0 // indirect
github.com/huin/goupnp v1.0.3 // indirect github.com/huin/goupnp v1.0.3 // indirect
github.com/ipfs/go-cid v0.2.0 // indirect github.com/ipfs/go-cid v0.3.2 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect github.com/klauspost/cpuid/v2 v2.1.1 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p-core v0.19.1 // indirect github.com/libp2p/go-libp2p v0.23.3 // indirect
github.com/libp2p/go-libp2p-pubsub v0.7.1 // indirect github.com/libp2p/go-libp2p-pubsub v0.8.1 // indirect
github.com/libp2p/go-openssl v0.0.7 // indirect github.com/libp2p/go-openssl v0.1.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/pointerstructure v1.2.1 // indirect github.com/mitchellh/pointerstructure v1.2.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.0.4 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multiaddr v0.6.0 // indirect github.com/multiformats/go-multiaddr v0.7.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multicodec v0.5.0 // indirect github.com/multiformats/go-multicodec v0.6.0 // indirect
github.com/multiformats/go-multihash v0.2.0 // indirect github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect github.com/multiformats/go-varint v0.0.6 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
...@@ -83,12 +85,12 @@ require ( ...@@ -83,12 +85,12 @@ require (
github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect github.com/tklauser/numcpus v0.5.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/urfave/cli/v2 v2.11.1 // indirect github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 // indirect golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
google.golang.org/protobuf v1.28.1 // indirect google.golang.org/protobuf v1.28.1 // indirect
...@@ -97,4 +99,4 @@ require ( ...@@ -97,4 +99,4 @@ require (
lukechampine.com/blake3 v1.1.7 // indirect lukechampine.com/blake3 v1.1.7 // indirect
) )
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -12,13 +12,13 @@ import ( ...@@ -12,13 +12,13 @@ import (
"syscall" "syscall"
"time" "time"
hdwallet "github.com/ethereum-optimism/go-ethereum-hdwallet"
"github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
hdwallet "github.com/miguelmota/go-ethereum-hdwallet"
"github.com/urfave/cli" "github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-node/client" "github.com/ethereum-optimism/optimism/op-node/client"
......
...@@ -3,7 +3,7 @@ module github.com/ethereum-optimism/optimism/op-service ...@@ -3,7 +3,7 @@ module github.com/ethereum-optimism/optimism/op-service
go 1.18 go 1.18
require ( require (
github.com/ethereum/go-ethereum v1.10.23 github.com/ethereum/go-ethereum v1.10.26
github.com/prometheus/client_golang v1.13.0 github.com/prometheus/client_golang v1.13.0
github.com/stretchr/testify v1.8.0 github.com/stretchr/testify v1.8.0
github.com/urfave/cli v1.22.9 github.com/urfave/cli v1.22.9
...@@ -53,16 +53,16 @@ require ( ...@@ -53,16 +53,16 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.4.0 // indirect github.com/tklauser/numcpus v0.4.0 // indirect
github.com/urfave/cli/v2 v2.10.2 // indirect github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1 // indirect golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect
google.golang.org/protobuf v1.28.1 // indirect google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be
...@@ -109,8 +109,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF ...@@ -109,8 +109,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa h1:jQ6FlSUf8BOttQexgqHjltQhn495S2oL06/UA20co9w= github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be h1:8TdM3M7FjZkrYeGGX9nEVtDDlZ5RiuHtc0mbi5bGKyY=
github.com/ethereum-optimism/op-geth v0.0.0-20221104021113-befc264446fa/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo= github.com/ethereum-optimism/op-geth v0.0.0-20221104231810-30db39cae2be/go.mod h1:1g9UmZgEINqvYfXmWOUCRJX9fxegeOHudVkLCRAXO5Y=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ= github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ=
github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
...@@ -244,6 +244,7 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO ...@@ -244,6 +244,7 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
...@@ -466,8 +467,8 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb ...@@ -466,8 +467,8 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.9 h1:cv3/KhXGBGjEXLC4bH0sLuJ9BewaAbpk5oyMOveu4pw= github.com/urfave/cli v1.22.9 h1:cv3/KhXGBGjEXLC4bH0sLuJ9BewaAbpk5oyMOveu4pw=
github.com/urfave/cli v1.22.9/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.9/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q=
github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
...@@ -652,8 +653,8 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc ...@@ -652,8 +653,8 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1 h1:+Lm8wRwJpsVpTHuM4tHTwgxjPzv/bjxsHt2cW5EY7XU= golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 h1:OK7RB6t2WQX54srQQYSXMW8dF5C6/8+oA/s5QBmmto4=
golang.org/x/sys v0.0.0-20220701225701-179beb0bd1a1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
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=
......
FROM ethereumoptimism/op-geth:latest FROM ethereumoptimism/op-geth:optimism-history
RUN apk add --no-cache jq RUN apk add --no-cache jq
......
...@@ -20,6 +20,7 @@ services: ...@@ -20,6 +20,7 @@ services:
volumes: volumes:
- "l1_data:/db" - "l1_data:/db"
- "${PWD}/../.devnet/genesis-l1.json:/genesis.json" - "${PWD}/../.devnet/genesis-l1.json:/genesis.json"
- "${PWD}/test-jwt-secret.txt:/config/test-jwt-secret.txt"
l2: l2:
build: build:
...@@ -46,7 +47,7 @@ services: ...@@ -46,7 +47,7 @@ services:
command: > command: >
op-node op-node
--l1=ws://l1:8546 --l1=ws://l1:8546
--l2=ws://l2:8546 --l2=http://l2:8551
--l2.jwt-secret=/config/test-jwt-secret.txt --l2.jwt-secret=/config/test-jwt-secret.txt
--sequencer.enabled --sequencer.enabled
--sequencer.l1-confs=0 --sequencer.l1-confs=0
......
...@@ -60,5 +60,9 @@ exec geth \ ...@@ -60,5 +60,9 @@ exec geth \
--miner.etherbase=$BLOCK_SIGNER_ADDRESS \ --miner.etherbase=$BLOCK_SIGNER_ADDRESS \
--password="$GETH_DATA_DIR"/password \ --password="$GETH_DATA_DIR"/password \
--allow-insecure-unlock \ --allow-insecure-unlock \
--authrpc.addr="0.0.0.0" \
--authrpc.port="8551" \
--authrpc.vhosts="*" \
--authrpc.jwtsecret=/config/jwt-secret.txt \
--gcmode=archive \ --gcmode=archive \
"$@" "$@"
#!/usr/bin/env bash
set -euo pipefail
DOCKER_REPO=$1
GIT_TAG=$2
GIT_SHA=$3
IMAGE_NAME=$(echo "$GIT_TAG" | grep -Eow '^op-[a-z0-9\-]*' || true)
if [ -z "$IMAGE_NAME" ]; then
echo "image name could not be parsed from git tag '$GIT_TAG'"
exit 1
fi
IMAGE_TAG=$(echo "$GIT_TAG" | grep -Eow 'v.*' || true)
if [ -z "$IMAGE_TAG" ]; then
echo "image tag could not be parsed from git tag '$GIT_TAG'"
exit 1
fi
SOURCE_IMAGE_TAG="$DOCKER_REPO/$IMAGE_NAME:$GIT_SHA"
TARGET_IMAGE_TAG="$DOCKER_REPO/$IMAGE_NAME:$IMAGE_TAG"
TARGET_IMAGE_TAG_LATEST="$DOCKER_REPO/$IMAGE_NAME:latest"
echo "Checking if docker images exist for '$IMAGE_NAME'"
echo ""
tags=$(gcloud container images list-tags "$DOCKER_REPO/$IMAGE_NAME" --limit 1 --format json)
if [ "$tags" = "[]" ]; then
echo "No existing docker images were found for '$IMAGE_NAME'. The code tagged with '$GIT_TAG' may not have an associated dockerfile or docker build job."
echo "If this service has a dockerfile, add a docker-publish job for it in the circleci config."
echo ""
echo "Exiting"
exit 0
fi
echo "Tagging $SOURCE_IMAGE_TAG with '$IMAGE_TAG'"
gcloud container images add-tag -q "$SOURCE_IMAGE_TAG" "$TARGET_IMAGE_TAG"
echo "Tagging $SOURCE_IMAGE_TAG with 'latest'"
gcloud container images add-tag -q "$SOURCE_IMAGE_TAG" "$TARGET_IMAGE_TAG_LATEST"
...@@ -7,7 +7,7 @@ import subprocess ...@@ -7,7 +7,7 @@ import subprocess
import os import os
GETH_VERSION='v1.10.23' GETH_VERSION='v1.10.26'
def main(): def main():
...@@ -58,4 +58,4 @@ def update_mod(project): ...@@ -58,4 +58,4 @@ def update_mod(project):
if __name__ == '__main__': if __name__ == '__main__':
main() main()
\ No newline at end of file
...@@ -26,14 +26,13 @@ Encoding_Test:test_encodeDepositTransaction_differential(address,address,uint256 ...@@ -26,14 +26,13 @@ Encoding_Test:test_encodeDepositTransaction_differential(address,address,uint256
Encoding_Test:test_nonceVersioning(uint240,uint16) (runs: 256, μ: 652, ~: 652) Encoding_Test:test_nonceVersioning(uint240,uint16) (runs: 256, μ: 652, ~: 652)
FeeVault_Test:test_constructor() (gas: 10748) FeeVault_Test:test_constructor() (gas: 10748)
FeeVault_Test:test_minWithdrawalAmount() (gas: 10711) FeeVault_Test:test_minWithdrawalAmount() (gas: 10711)
GasPriceOracle_Test:test_baseFee() (gas: 8391) GasPriceOracle_Test:test_baseFee() (gas: 8304)
GasPriceOracle_Test:test_gasPrice() (gas: 8382) GasPriceOracle_Test:test_gasPrice() (gas: 8315)
GasPriceOracle_Test:test_l1BaseFee() (gas: 10591) GasPriceOracle_Test:test_l1BaseFee() (gas: 10635)
GasPriceOracle_Test:test_overhead() (gas: 10614) GasPriceOracle_Test:test_overhead() (gas: 10591)
GasPriceOracle_Test:test_owner() (gas: 9718)
GasPriceOracle_Test:test_scalar() (gas: 10633) GasPriceOracle_Test:test_scalar() (gas: 10633)
GasPriceOracle_Test:test_setGasPriceReverts() (gas: 11652) GasPriceOracle_Test:test_setGasPriceReverts() (gas: 5911)
GasPriceOracle_Test:test_setL1BaseFeeReverts() (gas: 11695) GasPriceOracle_Test:test_setL1BaseFeeReverts() (gas: 5954)
Hashing_Test:test_hashCrossDomainMessage_differential(uint256,address,address,uint256,uint256,bytes) (runs: 256, μ: 23905, ~: 23788) Hashing_Test:test_hashCrossDomainMessage_differential(uint256,address,address,uint256,uint256,bytes) (runs: 256, μ: 23905, ~: 23788)
Hashing_Test:test_hashDepositSource() (gas: 628) Hashing_Test:test_hashDepositSource() (gas: 628)
Hashing_Test:test_hashDepositTransaction_differential(address,address,uint256,uint256,uint64,bytes,uint256) (runs: 256, μ: 66710, ~: 66432) Hashing_Test:test_hashDepositTransaction_differential(address,address,uint256,uint256,uint64,bytes,uint256) (runs: 256, μ: 66710, ~: 66432)
...@@ -193,29 +192,29 @@ Proxy_Test:test_payableUpgradeToAndCall() (gas: 53865) ...@@ -193,29 +192,29 @@ Proxy_Test:test_payableUpgradeToAndCall() (gas: 53865)
Proxy_Test:test_revertUpgradeToAndCall() (gas: 104727) Proxy_Test:test_revertUpgradeToAndCall() (gas: 104727)
Proxy_Test:test_upgradeToAndCall() (gas: 125305) Proxy_Test:test_upgradeToAndCall() (gas: 125305)
Proxy_Test:test_zeroAddressCaller() (gas: 14825) Proxy_Test:test_zeroAddressCaller() (gas: 14825)
ProxyAdmin_Test:test_chugsplashChangeProxyAdmin() (gas: 35642) ProxyAdmin_Test:test_chugsplashChangeProxyAdmin() (gas: 35644)
ProxyAdmin_Test:test_chugsplashGetProxyAdmin() (gas: 15683) ProxyAdmin_Test:test_chugsplashGetProxyAdmin() (gas: 15683)
ProxyAdmin_Test:test_chugsplashGetProxyImplementation() (gas: 51149) ProxyAdmin_Test:test_chugsplashGetProxyImplementation() (gas: 51152)
ProxyAdmin_Test:test_chugsplashUpgrade() (gas: 48960) ProxyAdmin_Test:test_chugsplashUpgrade() (gas: 48985)
ProxyAdmin_Test:test_chugsplashUpgradeAndCall() (gas: 82330) ProxyAdmin_Test:test_chugsplashUpgradeAndCall() (gas: 82312)
ProxyAdmin_Test:test_delegateResolvedChangeProxyAdmin() (gas: 34006) ProxyAdmin_Test:test_delegateResolvedChangeProxyAdmin() (gas: 34008)
ProxyAdmin_Test:test_delegateResolvedGetProxyAdmin() (gas: 17699) ProxyAdmin_Test:test_delegateResolvedGetProxyAdmin() (gas: 17699)
ProxyAdmin_Test:test_delegateResolvedGetProxyImplementation() (gas: 62115) ProxyAdmin_Test:test_delegateResolvedGetProxyImplementation() (gas: 62118)
ProxyAdmin_Test:test_delegateResolvedUpgrade() (gas: 58520) ProxyAdmin_Test:test_delegateResolvedUpgrade() (gas: 58545)
ProxyAdmin_Test:test_delegateResolvedUpgradeAndCall() (gas: 97989) ProxyAdmin_Test:test_delegateResolvedUpgradeAndCall() (gas: 98015)
ProxyAdmin_Test:test_erc1967ChangeProxyAdmin() (gas: 33870) ProxyAdmin_Test:test_erc1967ChangeProxyAdmin() (gas: 33872)
ProxyAdmin_Test:test_erc1967GetProxyAdmin() (gas: 15669) ProxyAdmin_Test:test_erc1967GetProxyAdmin() (gas: 15669)
ProxyAdmin_Test:test_erc1967GetProxyImplementation() (gas: 52093) ProxyAdmin_Test:test_erc1967GetProxyImplementation() (gas: 52096)
ProxyAdmin_Test:test_erc1967Upgrade() (gas: 50030) ProxyAdmin_Test:test_erc1967Upgrade() (gas: 50055)
ProxyAdmin_Test:test_erc1967UpgradeAndCall() (gas: 79013) ProxyAdmin_Test:test_erc1967UpgradeAndCall() (gas: 79015)
ProxyAdmin_Test:test_isUpgrading() (gas: 19575) ProxyAdmin_Test:test_isUpgrading() (gas: 19555)
ProxyAdmin_Test:test_onlyOwner() (gas: 22715) ProxyAdmin_Test:test_onlyOwner() (gas: 22801)
ProxyAdmin_Test:test_onlyOwnerSetAddressManager() (gas: 10600) ProxyAdmin_Test:test_onlyOwnerSetAddressManager() (gas: 10632)
ProxyAdmin_Test:test_onlyOwnerSetImplementationName() (gas: 11113) ProxyAdmin_Test:test_onlyOwnerSetImplementationName() (gas: 11134)
ProxyAdmin_Test:test_onlyOwnerSetProxyType() (gas: 10751) ProxyAdmin_Test:test_onlyOwnerSetProxyType() (gas: 10772)
ProxyAdmin_Test:test_owner() (gas: 9818) ProxyAdmin_Test:test_owner() (gas: 9812)
ProxyAdmin_Test:test_proxyType() (gas: 20622) ProxyAdmin_Test:test_proxyType() (gas: 20556)
ProxyAdmin_Test:test_setImplementationName() (gas: 38968) ProxyAdmin_Test:test_setImplementationName() (gas: 39059)
RLPReader_Test:test_readBytes_bytestring00() (gas: 1855) RLPReader_Test:test_readBytes_bytestring00() (gas: 1855)
RLPReader_Test:test_readBytes_bytestring01() (gas: 1901) RLPReader_Test:test_readBytes_bytestring01() (gas: 1901)
RLPReader_Test:test_readBytes_bytestring7f() (gas: 1900) RLPReader_Test:test_readBytes_bytestring7f() (gas: 1900)
......
...@@ -8,3 +8,5 @@ broadcast ...@@ -8,3 +8,5 @@ broadcast
genesis.json genesis.json
src/contract-artifacts.ts src/contract-artifacts.ts
tmp-artifacts tmp-artifacts
deployments/mainnet-forked
deploy-config/mainnet-forked.json
...@@ -126,6 +126,8 @@ ...@@ -126,6 +126,8 @@
| scalar | uint256 | 102 | 0 | 32 | contracts/L1/SystemConfig.sol:SystemConfig | | scalar | uint256 | 102 | 0 | 32 | contracts/L1/SystemConfig.sol:SystemConfig |
|---------------+-------------+------+--------+-------+--------------------------------------------| |---------------+-------------+------+--------+-------+--------------------------------------------|
| batcherHash | bytes32 | 103 | 0 | 32 | contracts/L1/SystemConfig.sol:SystemConfig | | batcherHash | bytes32 | 103 | 0 | 32 | contracts/L1/SystemConfig.sol:SystemConfig |
|---------------+-------------+------+--------+-------+--------------------------------------------|
| gasLimit | uint64 | 104 | 0 | 8 | contracts/L1/SystemConfig.sol:SystemConfig |
+---------------+-------------+------+--------+-------+--------------------------------------------+ +---------------+-------------+------+--------+-------+--------------------------------------------+
======================= =======================
...@@ -147,7 +149,7 @@ ...@@ -147,7 +149,7 @@
+---------------+---------+------+--------+-------+------------------------------------------------+ +---------------+---------+------+--------+-------+------------------------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract | | Name | Type | Slot | Offset | Bytes | Contract |
+==================================================================================================+ +==================================================================================================+
| _owner | address | 0 | 0 | 20 | contracts/L2/GasPriceOracle.sol:GasPriceOracle | | spacer_0_0_20 | address | 0 | 0 | 20 | contracts/L2/GasPriceOracle.sol:GasPriceOracle |
|---------------+---------+------+--------+-------+------------------------------------------------| |---------------+---------+------+--------+-------+------------------------------------------------|
| spacer_1_0_32 | uint256 | 1 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle | | spacer_1_0_32 | uint256 | 1 | 0 | 32 | contracts/L2/GasPriceOracle.sol:GasPriceOracle |
|---------------+---------+------+--------+-------+------------------------------------------------| |---------------+---------+------+--------+-------+------------------------------------------------|
...@@ -318,7 +320,7 @@ ...@@ -318,7 +320,7 @@
+--------------------+-----------------------------------------------+------+--------+-------+-----------------------------------------------+ +--------------------+-----------------------------------------------+------+--------+-------+-----------------------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract | | Name | Type | Slot | Offset | Bytes | Contract |
+============================================================================================================================================+ +============================================================================================================================================+
| owner | address | 0 | 0 | 20 | contracts/universal/ProxyAdmin.sol:ProxyAdmin | | _owner | address | 0 | 0 | 20 | contracts/universal/ProxyAdmin.sol:ProxyAdmin |
|--------------------+-----------------------------------------------+------+--------+-------+-----------------------------------------------| |--------------------+-----------------------------------------------+------+--------+-------+-----------------------------------------------|
| proxyType | mapping(address => enum ProxyAdmin.ProxyType) | 1 | 0 | 32 | contracts/universal/ProxyAdmin.sol:ProxyAdmin | | proxyType | mapping(address => enum ProxyAdmin.ProxyType) | 1 | 0 | 32 | contracts/universal/ProxyAdmin.sol:ProxyAdmin |
|--------------------+-----------------------------------------------+------+--------+-------+-----------------------------------------------| |--------------------+-----------------------------------------------+------+--------+-------+-----------------------------------------------|
......
...@@ -30,10 +30,6 @@ contract L1ERC721Bridge is ERC721Bridge, Semver { ...@@ -30,10 +30,6 @@ contract L1ERC721Bridge is ERC721Bridge, Semver {
ERC721Bridge(_messenger, _otherBridge) ERC721Bridge(_messenger, _otherBridge)
{} {}
/*************************
* Cross-chain Functions *
*************************/
/** /**
* @notice Completes an ERC721 bridge from the other domain and sends the ERC721 token to the * @notice Completes an ERC721 bridge from the other domain and sends the ERC721 token to the
* recipient on this domain. * recipient on this domain.
......
...@@ -29,6 +29,16 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -29,6 +29,16 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
*/ */
address internal constant DEFAULT_L2_SENDER = 0x000000000000000000000000000000000000dEaD; address internal constant DEFAULT_L2_SENDER = 0x000000000000000000000000000000000000dEaD;
/**
* @notice The L2 gas limit set when eth is deposited using the receive() function.
*/
uint64 internal constant RECEIVE_DEFAULT_GAS_LIMIT = 100_000;
/**
* @notice Additional gas reserved for clean up after finalizing a transaction withdrawal.
*/
uint256 internal constant FINALIZE_GAS_BUFFER = 20_000;
/** /**
* @notice Minimum time (in seconds) that must elapse before a withdrawal can be finalized. * @notice Minimum time (in seconds) that must elapse before a withdrawal can be finalized.
*/ */
...@@ -46,16 +56,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -46,16 +56,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
*/ */
address public l2Sender; address public l2Sender;
/**
* @notice The L2 gas limit set when eth is deposited using the receive() function.
*/
uint64 internal constant RECEIVE_DEFAULT_GAS_LIMIT = 100_000;
/**
* @notice Additional gas reserved for clean up after finalizing a transaction withdrawal.
*/
uint256 internal constant FINALIZE_GAS_BUFFER = 20_000;
/** /**
* @notice A list of withdrawal hashes which have been successfully finalized. * @notice A list of withdrawal hashes which have been successfully finalized.
*/ */
......
...@@ -8,47 +8,116 @@ import { Semver } from "../universal/Semver.sol"; ...@@ -8,47 +8,116 @@ import { Semver } from "../universal/Semver.sol";
/** /**
* @title SystemConfig * @title SystemConfig
* @notice This contract is used to update L2 configuration via L1 * @notice The SystemConfig contract is used to manage configuration of an Optimism network. All
* configuration is stored on L1 and picked up by L2 as part of the derviation of the L2
* chain.
*/ */
contract SystemConfig is OwnableUpgradeable, Semver { contract SystemConfig is OwnableUpgradeable, Semver {
/**
* @notice Enum representing different types of updates.
*
* @custom:value BATCHER Represents an update to the batcher hash.
* @custom:value GAS_CONFIG Represents an update to txn fee config on L2.
* @custom:value GAS_LIMIT Represents an update to gas limit on L2.
*/
enum UpdateType {
BATCHER,
GAS_CONFIG,
GAS_LIMIT
}
/**
* @notice Version identifier, used for upgrades.
*/
uint256 public constant VERSION = 0; uint256 public constant VERSION = 0;
/**
* @notice Minimum gas limit. This should not be lower than the maximum deposit
* gas resource limit in the ResourceMetering contract used by OptimismPortal,
* to ensure the L2 block always has sufficient gas to process deposits.
*/
uint64 public constant MINIMUM_GAS_LIMIT = 8_000_000;
/**
* @notice Fixed L2 gas overhead.
*/
uint256 public overhead; uint256 public overhead;
/**
* @notice Dynamic L2 gas overhead.
*/
uint256 public scalar; uint256 public scalar;
/**
* @notice Identifier for the batcher. For version 1 of this configuration, this is represented
* as an address left-padded with zeros to 32 bytes.
*/
bytes32 public batcherHash; bytes32 public batcherHash;
event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data); /**
* @notice L2 gas limit.
*/
uint64 public gasLimit;
enum UpdateType { /**
BATCHER, * @notice Emitted when configuration is updated
GAS_CONFIG *
} * @param version SystemConfig version.
* @param updateType Type of update.
* @param data Encoded update data.
*/
event ConfigUpdate(uint256 indexed version, UpdateType indexed updateType, bytes data);
/**
* @custom:semver 0.0.1
*
* @param _owner Initial owner of the contract.
* @param _overhead Initial overhead value.
* @param _scalar Initial scalar value.
* @param _batcherHash Initial batcher hash.
* @param _gasLimit Initial gas limit.
*/
constructor( constructor(
address _owner, address _owner,
uint256 _overhead, uint256 _overhead,
uint256 _scalar, uint256 _scalar,
bytes32 _batcherHash bytes32 _batcherHash,
uint64 _gasLimit
) Semver(0, 0, 1) { ) Semver(0, 0, 1) {
initialize(_owner, _overhead, _scalar, _batcherHash); initialize(_owner, _overhead, _scalar, _batcherHash, _gasLimit);
} }
/** /**
* @notice Initializer; * @notice Initializer.
*
* @param _owner Initial owner of the contract.
* @param _overhead Initial overhead value.
* @param _scalar Initial scalar value.
* @param _batcherHash Initial batcher hash.
* @param _gasLimit Initial gas limit.
*/ */
function initialize( function initialize(
address _owner, address _owner,
uint256 _overhead, uint256 _overhead,
uint256 _scalar, uint256 _scalar,
bytes32 _batcherHash bytes32 _batcherHash,
uint64 _gasLimit
) public initializer { ) public initializer {
require(_gasLimit >= MINIMUM_GAS_LIMIT, "SystemConfig: gas limit too low");
__Ownable_init(); __Ownable_init();
transferOwnership(_owner); transferOwnership(_owner);
overhead = _overhead; overhead = _overhead;
scalar = _scalar; scalar = _scalar;
batcherHash = _batcherHash; batcherHash = _batcherHash;
gasLimit = _gasLimit;
} }
/**
* @notice Updates the batcher hash.
*
* @param _batcherHash New batcher hash.
*/
// solhint-disable-next-line ordering
function setBatcherHash(bytes32 _batcherHash) external onlyOwner { function setBatcherHash(bytes32 _batcherHash) external onlyOwner {
batcherHash = _batcherHash; batcherHash = _batcherHash;
...@@ -56,6 +125,12 @@ contract SystemConfig is OwnableUpgradeable, Semver { ...@@ -56,6 +125,12 @@ contract SystemConfig is OwnableUpgradeable, Semver {
emit ConfigUpdate(VERSION, UpdateType.BATCHER, data); emit ConfigUpdate(VERSION, UpdateType.BATCHER, data);
} }
/**
* @notice Updates gas config.
*
* @param _overhead New overhead value.
* @param _scalar New scalar value.
*/
function setGasConfig(uint256 _overhead, uint256 _scalar) external onlyOwner { function setGasConfig(uint256 _overhead, uint256 _scalar) external onlyOwner {
overhead = _overhead; overhead = _overhead;
scalar = _scalar; scalar = _scalar;
...@@ -63,4 +138,17 @@ contract SystemConfig is OwnableUpgradeable, Semver { ...@@ -63,4 +138,17 @@ contract SystemConfig is OwnableUpgradeable, Semver {
bytes memory data = abi.encode(_overhead, _scalar); bytes memory data = abi.encode(_overhead, _scalar);
emit ConfigUpdate(VERSION, UpdateType.GAS_CONFIG, data); emit ConfigUpdate(VERSION, UpdateType.GAS_CONFIG, data);
} }
/**
* @notice Updates the L2 gas limit.
*
* @param _gasLimit New gas limit.
*/
function setGasLimit(uint64 _gasLimit) external onlyOwner {
require(_gasLimit >= MINIMUM_GAS_LIMIT, "SystemConfig: gas limit too low");
gasLimit = _gasLimit;
bytes memory data = abi.encode(_gasLimit);
emit ConfigUpdate(VERSION, UpdateType.GAS_LIMIT, data);
}
} }
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
pragma solidity 0.8.15; pragma solidity 0.8.15;
import { Semver } from "../universal/Semver.sol"; import { Semver } from "../universal/Semver.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Predeploys } from "../libraries/Predeploys.sol"; import { Predeploys } from "../libraries/Predeploys.sol";
import { L1Block } from "../L2/L1Block.sol"; import { L1Block } from "../L2/L1Block.sol";
...@@ -16,7 +15,14 @@ import { L1Block } from "../L2/L1Block.sol"; ...@@ -16,7 +15,14 @@ import { L1Block } from "../L2/L1Block.sol";
* contract exposes an API that is useful for knowing how large the L1 portion of their * contract exposes an API that is useful for knowing how large the L1 portion of their
* transaction fee will be. * transaction fee will be.
*/ */
contract GasPriceOracle is Ownable, Semver { contract GasPriceOracle is Semver {
/**
* @custom:legacy
* @custom:spacer _owner
* @notice Spacer for backwards compatibility.
*/
address private spacer_0_0_20;
/** /**
* @custom:legacy * @custom:legacy
* @custom:spacer gasPrice * @custom:spacer gasPrice
...@@ -67,12 +73,8 @@ contract GasPriceOracle is Ownable, Semver { ...@@ -67,12 +73,8 @@ contract GasPriceOracle is Ownable, Semver {
/** /**
* @custom:semver 0.0.1 * @custom:semver 0.0.1
*
* @param _owner Address that will initially own this contract.
*/ */
constructor(address _owner) Ownable() Semver(0, 0, 1) { constructor() Semver(0, 0, 1) {}
transferOwnership(_owner);
}
/** /**
* @notice Computes the L1 portion of the fee based on the size of the rlp encoded input * @notice Computes the L1 portion of the fee based on the size of the rlp encoded input
......
...@@ -4,7 +4,7 @@ pragma solidity 0.8.15; ...@@ -4,7 +4,7 @@ pragma solidity 0.8.15;
import { ERC721Bridge } from "../universal/ERC721Bridge.sol"; import { ERC721Bridge } from "../universal/ERC721Bridge.sol";
import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import { L1ERC721Bridge } from "../L1/L1ERC721Bridge.sol"; import { L1ERC721Bridge } from "../L1/L1ERC721Bridge.sol";
import { IOptimismMintableERC721 } from "../universal/IOptimismMintableERC721.sol"; import { IOptimismMintableERC721 } from "../universal/SupportedInterfaces.sol";
import { Semver } from "../universal/Semver.sol"; import { Semver } from "../universal/Semver.sol";
/** /**
......
...@@ -7,11 +7,11 @@ import { OptimismPortal } from "../L1/OptimismPortal.sol"; ...@@ -7,11 +7,11 @@ import { OptimismPortal } from "../L1/OptimismPortal.sol";
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol"; import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { L1StandardBridge } from "../L1/L1StandardBridge.sol"; import { L1StandardBridge } from "../L1/L1StandardBridge.sol";
import { L1ERC721Bridge } from "../L1/L1ERC721Bridge.sol"; import { L1ERC721Bridge } from "../L1/L1ERC721Bridge.sol";
import { SystemConfig } from "../L1/SystemConfig.sol";
import { OptimismMintableERC20Factory } from "../universal/OptimismMintableERC20Factory.sol"; import { OptimismMintableERC20Factory } from "../universal/OptimismMintableERC20Factory.sol";
import { AddressManager } from "../legacy/AddressManager.sol"; import { AddressManager } from "../legacy/AddressManager.sol";
import { PortalSender } from "./PortalSender.sol"; import { PortalSender } from "./PortalSender.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { SystemConfig } from "./DeployConfig.sol";
/** /**
* @title BaseSystemDictator * @title BaseSystemDictator
...@@ -38,6 +38,7 @@ contract BaseSystemDictator is Ownable { ...@@ -38,6 +38,7 @@ contract BaseSystemDictator is Ownable {
address l1StandardBridgeProxy; address l1StandardBridgeProxy;
address optimismMintableERC20FactoryProxy; address optimismMintableERC20FactoryProxy;
address l1ERC721BridgeProxy; address l1ERC721BridgeProxy;
address systemConfigProxy;
} }
/** /**
...@@ -51,6 +52,7 @@ contract BaseSystemDictator is Ownable { ...@@ -51,6 +52,7 @@ contract BaseSystemDictator is Ownable {
OptimismMintableERC20Factory optimismMintableERC20FactoryImpl; OptimismMintableERC20Factory optimismMintableERC20FactoryImpl;
L1ERC721Bridge l1ERC721BridgeImpl; L1ERC721Bridge l1ERC721BridgeImpl;
PortalSender portalSenderImpl; PortalSender portalSenderImpl;
SystemConfig systemConfigImpl;
} }
/** /**
...@@ -62,20 +64,32 @@ contract BaseSystemDictator is Ownable { ...@@ -62,20 +64,32 @@ contract BaseSystemDictator is Ownable {
address l2OutputOracleOwner; address l2OutputOracleOwner;
} }
/**
* @notice Values for the system config contract.
*/
struct SystemConfigConfig {
address owner;
uint256 overhead;
uint256 scalar;
bytes32 batcherHash;
uint64 gasLimit;
}
/** /**
* @notice Combined system configuration. * @notice Combined system configuration.
*/ */
struct SystemConfig { struct DeployConfig {
GlobalConfig globalConfig; GlobalConfig globalConfig;
ProxyAddressConfig proxyAddressConfig; ProxyAddressConfig proxyAddressConfig;
ImplementationAddressConfig implementationAddressConfig; ImplementationAddressConfig implementationAddressConfig;
L2OutputOracleConfig l2OutputOracleConfig; L2OutputOracleConfig l2OutputOracleConfig;
SystemConfigConfig systemConfigConfig;
} }
/** /**
* @notice System configuration. * @notice System configuration.
*/ */
SystemConfig public config; DeployConfig public config;
/** /**
* @notice Current step; * @notice Current step;
...@@ -96,7 +110,7 @@ contract BaseSystemDictator is Ownable { ...@@ -96,7 +110,7 @@ contract BaseSystemDictator is Ownable {
/** /**
* @param _config System configuration. * @param _config System configuration.
*/ */
constructor(SystemConfig memory _config) Ownable() { constructor(DeployConfig memory _config) Ownable() {
config = _config; config = _config;
_transferOwnership(config.globalConfig.controller); _transferOwnership(config.globalConfig.controller);
} }
......
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import { ProxyAdmin } from "../universal/ProxyAdmin.sol";
import { L2OutputOracle } from "../L1/L2OutputOracle.sol";
import { OptimismPortal } from "../L1/OptimismPortal.sol";
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { L1StandardBridge } from "../L1/L1StandardBridge.sol";
import { L1ERC721Bridge } from "../L1/L1ERC721Bridge.sol";
import { OptimismMintableERC20Factory } from "../universal/OptimismMintableERC20Factory.sol";
import { AddressManager } from "../legacy/AddressManager.sol";
import { PortalSender } from "./PortalSender.sol";
struct GlobalConfig {
AddressManager addressManager;
ProxyAdmin proxyAdmin;
address controller;
address finalOwner;
}
struct ProxyAddressConfig {
address l2OutputOracleProxy;
address optimismPortalProxy;
address l1CrossDomainMessengerProxy;
address l1StandardBridgeProxy;
address optimismMintableERC20FactoryProxy;
address l1ERC721BridgeProxy;
}
struct ImplementationAddressConfig {
L2OutputOracle l2OutputOracleImpl;
OptimismPortal optimismPortalImpl;
L1CrossDomainMessenger l1CrossDomainMessengerImpl;
L1StandardBridge l1StandardBridgeImpl;
OptimismMintableERC20Factory optimismMintableERC20FactoryImpl;
L1ERC721Bridge l1ERC721BridgeImpl;
PortalSender portalSenderImpl;
}
struct L2OutputOracleConfig {
bytes32 l2OutputOracleGenesisL2Output;
address l2OutputOracleProposer;
address l2OutputOracleOwner;
}
struct SystemConfig {
GlobalConfig globalConfig;
ProxyAddressConfig proxyAddressConfig;
ImplementationAddressConfig implementationAddressConfig;
L2OutputOracleConfig l2OutputOracleConfig;
}
...@@ -3,8 +3,8 @@ pragma solidity 0.8.15; ...@@ -3,8 +3,8 @@ pragma solidity 0.8.15;
import { L2OutputOracle } from "../L1/L2OutputOracle.sol"; import { L2OutputOracle } from "../L1/L2OutputOracle.sol";
import { OptimismPortal } from "../L1/OptimismPortal.sol"; import { OptimismPortal } from "../L1/OptimismPortal.sol";
import { SystemConfig } from "../L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol"; import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { SystemConfig } from "./DeployConfig.sol";
import { BaseSystemDictator } from "./BaseSystemDictator.sol"; import { BaseSystemDictator } from "./BaseSystemDictator.sol";
/** /**
...@@ -17,7 +17,7 @@ contract FreshSystemDictator is BaseSystemDictator { ...@@ -17,7 +17,7 @@ contract FreshSystemDictator is BaseSystemDictator {
/** /**
* @param _config System configuration. * @param _config System configuration.
*/ */
constructor(SystemConfig memory _config) BaseSystemDictator(_config) {} constructor(DeployConfig memory _config) BaseSystemDictator(_config) {}
/** /**
* @notice Upgrades and initializes proxy contracts. * @notice Upgrades and initializes proxy contracts.
...@@ -68,6 +68,22 @@ contract FreshSystemDictator is BaseSystemDictator { ...@@ -68,6 +68,22 @@ contract FreshSystemDictator is BaseSystemDictator {
payable(config.proxyAddressConfig.l1ERC721BridgeProxy), payable(config.proxyAddressConfig.l1ERC721BridgeProxy),
address(config.implementationAddressConfig.l1ERC721BridgeImpl) address(config.implementationAddressConfig.l1ERC721BridgeImpl)
); );
// Upgrade and initialize the SystemConfig.
config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.systemConfigProxy),
address(config.implementationAddressConfig.systemConfigImpl),
abi.encodeCall(
SystemConfig.initialize,
(
config.systemConfigConfig.owner,
config.systemConfigConfig.overhead,
config.systemConfigConfig.scalar,
config.systemConfigConfig.batcherHash,
config.systemConfigConfig.gasLimit
)
)
);
} }
/** /**
...@@ -75,6 +91,6 @@ contract FreshSystemDictator is BaseSystemDictator { ...@@ -75,6 +91,6 @@ contract FreshSystemDictator is BaseSystemDictator {
*/ */
function step2() external onlyOwner step(2) { function step2() external onlyOwner step(2) {
// Transfer ownership of the ProxyAdmin to the final owner. // Transfer ownership of the ProxyAdmin to the final owner.
config.globalConfig.proxyAdmin.setOwner(config.globalConfig.finalOwner); config.globalConfig.proxyAdmin.transferOwnership(config.globalConfig.finalOwner);
} }
} }
...@@ -7,7 +7,7 @@ import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol"; ...@@ -7,7 +7,7 @@ import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { L1ChugSplashProxy } from "../legacy/L1ChugSplashProxy.sol"; import { L1ChugSplashProxy } from "../legacy/L1ChugSplashProxy.sol";
import { ProxyAdmin } from "../universal/ProxyAdmin.sol"; import { ProxyAdmin } from "../universal/ProxyAdmin.sol";
import { PortalSender } from "./PortalSender.sol"; import { PortalSender } from "./PortalSender.sol";
import { SystemConfig } from "./DeployConfig.sol"; import { SystemConfig } from "../L1/SystemConfig.sol";
import { BaseSystemDictator } from "./BaseSystemDictator.sol"; import { BaseSystemDictator } from "./BaseSystemDictator.sol";
/** /**
...@@ -20,7 +20,7 @@ contract MigrationSystemDictator is BaseSystemDictator { ...@@ -20,7 +20,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
/** /**
* @param _config System configuration. * @param _config System configuration.
*/ */
constructor(SystemConfig memory _config) BaseSystemDictator(_config) {} constructor(DeployConfig memory _config) BaseSystemDictator(_config) {}
/** /**
* @notice Configures the ProxyAdmin contract. * @notice Configures the ProxyAdmin contract.
...@@ -154,6 +154,22 @@ contract MigrationSystemDictator is BaseSystemDictator { ...@@ -154,6 +154,22 @@ contract MigrationSystemDictator is BaseSystemDictator {
payable(config.proxyAddressConfig.l1ERC721BridgeProxy), payable(config.proxyAddressConfig.l1ERC721BridgeProxy),
address(config.implementationAddressConfig.l1ERC721BridgeImpl) address(config.implementationAddressConfig.l1ERC721BridgeImpl)
); );
// Upgrade and initialize the SystemConfig.
config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.systemConfigProxy),
address(config.implementationAddressConfig.systemConfigImpl),
abi.encodeCall(
SystemConfig.initialize,
(
config.systemConfigConfig.owner,
config.systemConfigConfig.overhead,
config.systemConfigConfig.scalar,
config.systemConfigConfig.batcherHash,
config.systemConfigConfig.gasLimit
)
)
);
} }
/** /**
...@@ -173,6 +189,6 @@ contract MigrationSystemDictator is BaseSystemDictator { ...@@ -173,6 +189,6 @@ contract MigrationSystemDictator is BaseSystemDictator {
.transferOwnership(config.globalConfig.finalOwner); .transferOwnership(config.globalConfig.finalOwner);
// Transfer ownership of the ProxyAdmin to the final owner. // Transfer ownership of the ProxyAdmin to the final owner.
config.globalConfig.proxyAdmin.setOwner(config.globalConfig.finalOwner); config.globalConfig.proxyAdmin.transferOwnership(config.globalConfig.finalOwner);
} }
} }
...@@ -35,7 +35,7 @@ contract GasPriceOracle_Test is CommonTest { ...@@ -35,7 +35,7 @@ contract GasPriceOracle_Test is CommonTest {
// We are not setting the gas oracle at its predeploy // We are not setting the gas oracle at its predeploy
// address for simplicity purposes. Nothing in this test // address for simplicity purposes. Nothing in this test
// requires it to be at a particular address // requires it to be at a particular address
gasOracle = new GasPriceOracle(alice); gasOracle = new GasPriceOracle();
vm.prank(depositor); vm.prank(depositor);
l1Block.setL1BlockValues({ l1Block.setL1BlockValues({
...@@ -50,11 +50,6 @@ contract GasPriceOracle_Test is CommonTest { ...@@ -50,11 +50,6 @@ contract GasPriceOracle_Test is CommonTest {
}); });
} }
function test_owner() external {
// alice is passed into the constructor of the gasOracle
assertEq(gasOracle.owner(), alice);
}
function test_l1BaseFee() external { function test_l1BaseFee() external {
assertEq(gasOracle.l1BaseFee(), basefee); assertEq(gasOracle.l1BaseFee(), basefee);
} }
...@@ -80,7 +75,6 @@ contract GasPriceOracle_Test is CommonTest { ...@@ -80,7 +75,6 @@ contract GasPriceOracle_Test is CommonTest {
} }
function test_setGasPriceReverts() external { function test_setGasPriceReverts() external {
vm.prank(gasOracle.owner());
(bool success, bytes memory returndata) = address(gasOracle).call( (bool success, bytes memory returndata) = address(gasOracle).call(
abi.encodeWithSignature("setGasPrice(uint256)", 1) abi.encodeWithSignature("setGasPrice(uint256)", 1)
); );
...@@ -90,7 +84,6 @@ contract GasPriceOracle_Test is CommonTest { ...@@ -90,7 +84,6 @@ contract GasPriceOracle_Test is CommonTest {
} }
function test_setL1BaseFeeReverts() external { function test_setL1BaseFeeReverts() external {
vm.prank(gasOracle.owner());
(bool success, bytes memory returndata) = address(gasOracle).call( (bool success, bytes memory returndata) = address(gasOracle).call(
abi.encodeWithSignature("setL1BaseFee(uint256)", 1) abi.encodeWithSignature("setL1BaseFee(uint256)", 1)
); );
......
...@@ -66,17 +66,17 @@ contract ProxyAdmin_Test is Test { ...@@ -66,17 +66,17 @@ contract ProxyAdmin_Test is Test {
} }
function test_onlyOwnerSetAddressManager() external { function test_onlyOwnerSetAddressManager() external {
vm.expectRevert("UNAUTHORIZED"); vm.expectRevert("Ownable: caller is not the owner");
admin.setAddressManager(AddressManager((address(0)))); admin.setAddressManager(AddressManager((address(0))));
} }
function test_onlyOwnerSetImplementationName() external { function test_onlyOwnerSetImplementationName() external {
vm.expectRevert("UNAUTHORIZED"); vm.expectRevert("Ownable: caller is not the owner");
admin.setImplementationName(address(0), "foo"); admin.setImplementationName(address(0), "foo");
} }
function test_onlyOwnerSetProxyType() external { function test_onlyOwnerSetProxyType() external {
vm.expectRevert("UNAUTHORIZED"); vm.expectRevert("Ownable: caller is not the owner");
admin.setProxyType(address(0), ProxyAdmin.ProxyType.CHUGSPLASH); admin.setProxyType(address(0), ProxyAdmin.ProxyType.CHUGSPLASH);
} }
...@@ -236,13 +236,13 @@ contract ProxyAdmin_Test is Test { ...@@ -236,13 +236,13 @@ contract ProxyAdmin_Test is Test {
} }
function test_onlyOwner() external { function test_onlyOwner() external {
vm.expectRevert("UNAUTHORIZED"); vm.expectRevert("Ownable: caller is not the owner");
admin.changeProxyAdmin(payable(proxy), address(0)); admin.changeProxyAdmin(payable(proxy), address(0));
vm.expectRevert("UNAUTHORIZED"); vm.expectRevert("Ownable: caller is not the owner");
admin.upgrade(payable(proxy), address(implementation)); admin.upgrade(payable(proxy), address(implementation));
vm.expectRevert("UNAUTHORIZED"); vm.expectRevert("Ownable: caller is not the owner");
admin.upgradeAndCall(payable(proxy), address(implementation), hex""); admin.upgradeAndCall(payable(proxy), address(implementation), hex"");
} }
......
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {
IERC721Enumerable
} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
/**
* @title IOptimismMintableERC721
* @notice Interface for contracts that are compatible with the OptimismMintableERC721 standard.
* Tokens that follow this standard can be easily transferred across the ERC721 bridge.
*/
interface IOptimismMintableERC721 is IERC721Enumerable {
/**
* @notice Emitted when a token is minted.
*
* @param account Address of the account the token was minted to.
* @param tokenId Token ID of the minted token.
*/
event Mint(address indexed account, uint256 tokenId);
/**
* @notice Emitted when a token is burned.
*
* @param account Address of the account the token was burned from.
* @param tokenId Token ID of the burned token.
*/
event Burn(address indexed account, uint256 tokenId);
/**
* @notice Mints some token ID for a user, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* @param _to Address of the user to mint the token for.
* @param _tokenId Token ID to mint.
*/
function safeMint(address _to, uint256 _tokenId) external;
/**
* @notice Burns a token ID from a user.
*
* @param _from Address of the user to burn the token from.
* @param _tokenId Token ID to burn.
*/
function burn(address _from, uint256 _tokenId) external;
/**
* @notice Chain ID of the chain where the remote token is deployed.
*/
function REMOTE_CHAIN_ID() external view returns (uint256);
/**
* @notice Address of the token on the remote domain.
*/
function REMOTE_TOKEN() external view returns (address);
/**
* @notice Address of the ERC721 bridge on this network.
*/
function BRIDGE() external view returns (address);
/**
* @notice Chain ID of the chain where the remote token is deployed.
*/
function remoteChainId() external view returns (uint256);
/**
* @notice Address of the token on the remote domain.
*/
function remoteToken() external view returns (address);
/**
* @notice Address of the ERC721 bridge on this network.
*/
function bridge() external view returns (address);
}
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { IOptimismMintableERC721 } from "./IOptimismMintableERC721.sol"; import { IOptimismMintableERC721 } from "./SupportedInterfaces.sol";
/** /**
* @title OptimismMintableERC721 * @title OptimismMintableERC721
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity 0.8.15;
import { Owned } from "@rari-capital/solmate/src/auth/Owned.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Proxy } from "./Proxy.sol"; import { Proxy } from "./Proxy.sol";
import { AddressManager } from "../legacy/AddressManager.sol"; import { AddressManager } from "../legacy/AddressManager.sol";
import { L1ChugSplashProxy } from "../legacy/L1ChugSplashProxy.sol"; import { L1ChugSplashProxy } from "../legacy/L1ChugSplashProxy.sol";
...@@ -32,7 +32,7 @@ interface IStaticL1ChugSplashProxy { ...@@ -32,7 +32,7 @@ interface IStaticL1ChugSplashProxy {
* based on the OpenZeppelin implementation. It has backwards compatibility logic to work * based on the OpenZeppelin implementation. It has backwards compatibility logic to work
* with the various types of proxies that have been deployed by Optimism in the past. * with the various types of proxies that have been deployed by Optimism in the past.
*/ */
contract ProxyAdmin is Owned { contract ProxyAdmin is Ownable {
/** /**
* @notice The proxy types that the ProxyAdmin can manage. * @notice The proxy types that the ProxyAdmin can manage.
* *
...@@ -76,7 +76,9 @@ contract ProxyAdmin is Owned { ...@@ -76,7 +76,9 @@ contract ProxyAdmin is Owned {
/** /**
* @param _owner Address of the initial owner of this contract. * @param _owner Address of the initial owner of this contract.
*/ */
constructor(address _owner) Owned(_owner) {} constructor(address _owner) Ownable() {
_transferOwnership(_owner);
}
/** /**
* @notice Sets the proxy type for a given address. Only required for non-standard (legacy) * @notice Sets the proxy type for a given address. Only required for non-standard (legacy)
......
...@@ -3,6 +3,9 @@ pragma solidity ^0.8.0; ...@@ -3,6 +3,9 @@ pragma solidity ^0.8.0;
// Import this here to make it available just by importing this file // Import this here to make it available just by importing this file
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {
IERC721Enumerable
} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
/** /**
* @title IOptimismMintableERC20 * @title IOptimismMintableERC20
...@@ -33,3 +36,73 @@ interface ILegacyMintableERC20 { ...@@ -33,3 +36,73 @@ interface ILegacyMintableERC20 {
function burn(address _from, uint256 _amount) external; function burn(address _from, uint256 _amount) external;
} }
/**
* @title IOptimismMintableERC721
* @notice Interface for contracts that are compatible with the OptimismMintableERC721 standard.
* Tokens that follow this standard can be easily transferred across the ERC721 bridge.
*/
interface IOptimismMintableERC721 is IERC721Enumerable {
/**
* @notice Emitted when a token is minted.
*
* @param account Address of the account the token was minted to.
* @param tokenId Token ID of the minted token.
*/
event Mint(address indexed account, uint256 tokenId);
/**
* @notice Emitted when a token is burned.
*
* @param account Address of the account the token was burned from.
* @param tokenId Token ID of the burned token.
*/
event Burn(address indexed account, uint256 tokenId);
/**
* @notice Mints some token ID for a user, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* @param _to Address of the user to mint the token for.
* @param _tokenId Token ID to mint.
*/
function safeMint(address _to, uint256 _tokenId) external;
/**
* @notice Burns a token ID from a user.
*
* @param _from Address of the user to burn the token from.
* @param _tokenId Token ID to burn.
*/
function burn(address _from, uint256 _tokenId) external;
/**
* @notice Chain ID of the chain where the remote token is deployed.
*/
function REMOTE_CHAIN_ID() external view returns (uint256);
/**
* @notice Address of the token on the remote domain.
*/
function REMOTE_TOKEN() external view returns (address);
/**
* @notice Address of the ERC721 bridge on this network.
*/
function BRIDGE() external view returns (address);
/**
* @notice Chain ID of the chain where the remote token is deployed.
*/
function remoteChainId() external view returns (uint256);
/**
* @notice Address of the token on the remote domain.
*/
function remoteToken() external view returns (address);
/**
* @notice Address of the ERC721 bridge on this network.
*/
function bridge() external view returns (address);
}
...@@ -17,15 +17,24 @@ ...@@ -17,15 +17,24 @@
"l2OutputOracleProposer": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", "l2OutputOracleProposer": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"l2OutputOracleOwner": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65", "l2OutputOracleOwner": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65",
"l2GenesisBlockCoinbase": "0x42000000000000000000000000000000000000f0", "l2GenesisBlockCoinbase": "0x42000000000000000000000000000000000000f0",
"l2GenesisBlockGasLimit": "0xE4E1C0",
"l1BlockTime": 15, "l1BlockTime": 15,
"cliqueSignerAddress": "0xca062b0fd91172d89bcd4bb084ac4e21972cc467", "cliqueSignerAddress": "0xca062b0fd91172d89bcd4bb084ac4e21972cc467",
"optimismBaseFeeRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "baseFeeVaultRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"optimismL1FeeRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", "l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a",
"proxyAdminOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"l2CrossDomainMessengerOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"finalizationPeriodSeconds": 2, "finalizationPeriodSeconds": 2,
"deploymentWaitConfirmations": 1, "deploymentWaitConfirmations": 1,
"fundDevAccounts": true "fundDevAccounts": true,
"gasPriceOracleOverhead": 2100,
"gasPriceOracleScalar": 1000000,
"eip1559Denominator": 8,
"eip1559Elasticity": 2
} }
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
"l2OutputOracleProposer": "0x6c23a0dcdfc44b7a57bed148de598895e398d984", "l2OutputOracleProposer": "0x6c23a0dcdfc44b7a57bed148de598895e398d984",
"l2OutputOracleOwner": "0x6925b8704ff96dee942623d6fb5e946ef5884b63", "l2OutputOracleOwner": "0x6925b8704ff96dee942623d6fb5e946ef5884b63",
"optimismBaseFeeRecipient": "0xf116a24056b647e3211d095c667e951536cdebaa", "baseFeeVaultRecipient": "0xf116a24056b647e3211d095c667e951536cdebaa",
"optimismL1FeeRecipient": "0xc731837b696ca3d9720d23336925368ceaa58f83", "l1FeeVaultRecipient": "0xc731837b696ca3d9720d23336925368ceaa58f83",
"sequencerFeeVaultRecipient": "0xf116a24056b647e3211d095c667e951536cdebaa",
"deploymentWaitConfirmations": 1 "deploymentWaitConfirmations": 1
} }
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
"l2OutputOracleOwner": "0x6925B8704Ff96DEe942623d6FB5e946EF5884b63", "l2OutputOracleOwner": "0x6925B8704Ff96DEe942623d6FB5e946EF5884b63",
"l2OutputOracleGenesisL2Output": "0x1111111111111111111111111111111111111111111111111111111111111111", "l2OutputOracleGenesisL2Output": "0x1111111111111111111111111111111111111111111111111111111111111111",
"baseFeeVaultRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a",
"finalizationPeriodSeconds": 2, "finalizationPeriodSeconds": 2,
"numDeployConfirmations": 1 "numDeployConfirmations": 1
......
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
"l1BlockTime": 15, "l1BlockTime": 15,
"cliqueSignerAddress": "0xca062b0fd91172d89bcd4bb084ac4e21972cc467", "cliqueSignerAddress": "0xca062b0fd91172d89bcd4bb084ac4e21972cc467",
"optimismBaseFeeRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "baseFeeVaultRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"optimismL1FeeRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", "l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"sequencerFeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"finalizationPeriodSeconds": 2, "finalizationPeriodSeconds": 2,
......
import { DeployFunction } from 'hardhat-deploy/dist/types'
import {
assertContractVariable,
deployAndVerifyAndThen,
getDeploymentAddress,
} from '../src/deploy-utils'
const deployFn: DeployFunction = async (hre) => {
const proxyAdmin = await getDeploymentAddress(hre, 'ProxyAdmin')
await deployAndVerifyAndThen({
hre,
name: 'SystemConfigProxy',
contract: 'Proxy',
args: [proxyAdmin],
postDeployAction: async (contract) => {
await assertContractVariable(contract, 'admin', proxyAdmin)
},
})
}
deployFn.tags = ['SystemConfigProxy', 'fresh', 'migration']
export default deployFn
import { ethers } from 'ethers'
import { DeployFunction } from 'hardhat-deploy/dist/types'
import '@eth-optimism/hardhat-deploy-config'
import 'hardhat-deploy'
import {
getDeploymentAddress,
deployAndVerifyAndThen,
} from '../src/deploy-utils'
const deployFn: DeployFunction = async (hre) => {
const { deployer } = await hre.getNamedAccounts()
await deployAndVerifyAndThen({
hre,
name: 'FreshSystemDictator',
args: [
{
globalConfig: {
proxyAdmin: await getDeploymentAddress(hre, 'ProxyAdmin'),
controller: deployer,
finalOwner: hre.deployConfig.finalSystemOwner,
addressManager: ethers.constants.AddressZero,
},
proxyAddressConfig: {
l2OutputOracleProxy: await getDeploymentAddress(
hre,
'L2OutputOracleProxy'
),
optimismPortalProxy: await getDeploymentAddress(
hre,
'OptimismPortalProxy'
),
l1CrossDomainMessengerProxy: await getDeploymentAddress(
hre,
'L1CrossDomainMessengerProxy'
),
l1StandardBridgeProxy: await getDeploymentAddress(
hre,
'L1StandardBridgeProxy'
),
optimismMintableERC20FactoryProxy: await getDeploymentAddress(
hre,
'OptimismMintableERC20FactoryProxy'
),
l1ERC721BridgeProxy: await getDeploymentAddress(
hre,
'L1ERC721BridgeProxy'
),
},
implementationAddressConfig: {
l2OutputOracleImpl: await getDeploymentAddress(hre, 'L2OutputOracle'),
optimismPortalImpl: await getDeploymentAddress(hre, 'OptimismPortal'),
l1CrossDomainMessengerImpl: await getDeploymentAddress(
hre,
'L1CrossDomainMessenger'
),
l1StandardBridgeImpl: await getDeploymentAddress(
hre,
'L1StandardBridge'
),
optimismMintableERC20FactoryImpl: await getDeploymentAddress(
hre,
'OptimismMintableERC20Factory'
),
l1ERC721BridgeImpl: await getDeploymentAddress(hre, 'L1ERC721Bridge'),
portalSenderImpl: await getDeploymentAddress(hre, 'PortalSender'),
},
l2OutputOracleConfig: {
l2OutputOracleGenesisL2Output:
hre.deployConfig.l2OutputOracleGenesisL2Output,
l2OutputOracleProposer: hre.deployConfig.l2OutputOracleProposer,
l2OutputOracleOwner: hre.deployConfig.l2OutputOracleOwner,
},
},
],
postDeployAction: async () => {
// TODO: Assert all the config was set correctly.
},
})
}
deployFn.tags = ['FreshSystemDictator', 'fresh']
export default deployFn
import { DeployFunction } from 'hardhat-deploy/dist/types'
import '@eth-optimism/hardhat-deploy-config'
import {
assertContractVariable,
deployAndVerifyAndThen,
} from '../src/deploy-utils'
const deployFn: DeployFunction = async (hre) => {
const batcherHash = hre.ethers.utils.hexZeroPad(
hre.deployConfig.batchSenderAddress,
32
)
await deployAndVerifyAndThen({
hre,
name: 'SystemConfig',
args: [
hre.deployConfig.systemConfigOwner,
hre.deployConfig.gasPriceOracleOverhead,
hre.deployConfig.gasPriceOracleScalar,
batcherHash,
hre.deployConfig.l2GenesisBlockGasLimit,
],
postDeployAction: async (contract) => {
await assertContractVariable(
contract,
'owner',
hre.deployConfig.systemConfigOwner
)
await assertContractVariable(
contract,
'overhead',
hre.deployConfig.gasPriceOracleOverhead
)
await assertContractVariable(
contract,
'scalar',
hre.deployConfig.gasPriceOracleScalar
)
await assertContractVariable(
contract,
'batcherHash',
batcherHash.toLowerCase()
)
},
})
}
deployFn.tags = ['SystemConfigImpl', 'fresh', 'migration']
export default deployFn
import { DeployFunction } from 'hardhat-deploy/dist/types'
import '@eth-optimism/hardhat-deploy-config'
import 'hardhat-deploy'
import {
deployAndVerifyAndThen,
assertDictatorConfig,
makeDictatorConfig,
} from '../src/deploy-utils'
const deployFn: DeployFunction = async (hre) => {
const { deployer } = await hre.getNamedAccounts()
const config = await makeDictatorConfig(
hre,
deployer,
hre.deployConfig.finalSystemOwner,
true
)
await deployAndVerifyAndThen({
hre,
name: 'FreshSystemDictator',
args: [config],
postDeployAction: async (contract) => {
await assertDictatorConfig(contract, config)
},
})
}
deployFn.tags = ['FreshSystemDictator', 'fresh']
export default deployFn
...@@ -26,7 +26,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -26,7 +26,7 @@ const deployFn: DeployFunction = async (hre) => {
if ((await ProxyAdmin.owner()) !== FreshSystemDictator.address) { if ((await ProxyAdmin.owner()) !== FreshSystemDictator.address) {
console.log(`Transferring proxy admin ownership to the FreshSystemDictator`) console.log(`Transferring proxy admin ownership to the FreshSystemDictator`)
await ProxyAdmin.setOwner(FreshSystemDictator.address) await ProxyAdmin.transferOwnership(FreshSystemDictator.address)
} else { } else {
console.log(`Proxy admin already owned by the FreshSystemDictator`) console.log(`Proxy admin already owned by the FreshSystemDictator`)
} }
......
...@@ -4,8 +4,9 @@ import '@eth-optimism/hardhat-deploy-config' ...@@ -4,8 +4,9 @@ import '@eth-optimism/hardhat-deploy-config'
import 'hardhat-deploy' import 'hardhat-deploy'
import { import {
getDeploymentAddress,
deployAndVerifyAndThen, deployAndVerifyAndThen,
assertDictatorConfig,
makeDictatorConfig,
} from '../src/deploy-utils' } from '../src/deploy-utils'
const deployFn: DeployFunction = async (hre) => { const deployFn: DeployFunction = async (hre) => {
...@@ -45,71 +46,13 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -45,71 +46,13 @@ const deployFn: DeployFunction = async (hre) => {
} }
} }
const config = await makeDictatorConfig(hre, controller, finalOwner, false)
await deployAndVerifyAndThen({ await deployAndVerifyAndThen({
hre, hre,
name: 'MigrationSystemDictator', name: 'MigrationSystemDictator',
args: [ args: [config],
{ postDeployAction: async (contract) => {
globalConfig: { await assertDictatorConfig(contract, config)
proxyAdmin: await getDeploymentAddress(hre, 'ProxyAdmin'),
controller,
finalOwner,
addressManager: await getDeploymentAddress(hre, 'Lib_AddressManager'),
},
proxyAddressConfig: {
l2OutputOracleProxy: await getDeploymentAddress(
hre,
'L2OutputOracleProxy'
),
optimismPortalProxy: await getDeploymentAddress(
hre,
'OptimismPortalProxy'
),
l1CrossDomainMessengerProxy: await getDeploymentAddress(
hre,
'Proxy__OVM_L1CrossDomainMessenger'
),
l1StandardBridgeProxy: await getDeploymentAddress(
hre,
'Proxy__OVM_L1StandardBridge'
),
optimismMintableERC20FactoryProxy: await getDeploymentAddress(
hre,
'OptimismMintableERC20FactoryProxy'
),
l1ERC721BridgeProxy: await getDeploymentAddress(
hre,
'L1ERC721BridgeProxy'
),
},
implementationAddressConfig: {
l2OutputOracleImpl: await getDeploymentAddress(hre, 'L2OutputOracle'),
optimismPortalImpl: await getDeploymentAddress(hre, 'OptimismPortal'),
l1CrossDomainMessengerImpl: await getDeploymentAddress(
hre,
'L1CrossDomainMessenger'
),
l1StandardBridgeImpl: await getDeploymentAddress(
hre,
'L1StandardBridge'
),
optimismMintableERC20FactoryImpl: await getDeploymentAddress(
hre,
'OptimismMintableERC20Factory'
),
l1ERC721BridgeImpl: await getDeploymentAddress(hre, 'L1ERC721Bridge'),
portalSenderImpl: await getDeploymentAddress(hre, 'PortalSender'),
},
l2OutputOracleConfig: {
l2OutputOracleGenesisL2Output:
hre.deployConfig.l2OutputOracleGenesisL2Output,
l2OutputOracleProposer: hre.deployConfig.l2OutputOracleProposer,
l2OutputOracleOwner: hre.deployConfig.l2OutputOracleOwner,
},
},
],
postDeployAction: async () => {
// TODO: Assert all the config was set correctly.
}, },
}) })
} }
......
...@@ -45,7 +45,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -45,7 +45,7 @@ const deployFn: DeployFunction = async (hre) => {
console.log( console.log(
`Transferring proxy admin ownership to the MigrationSystemDictator` `Transferring proxy admin ownership to the MigrationSystemDictator`
) )
await ProxyAdmin.setOwner(MigrationSystemDictator.address) await ProxyAdmin.transferOwnership(MigrationSystemDictator.address)
} else { } else {
console.log(`Proxy admin already owned by the MigrationSystemDictator`) console.log(`Proxy admin already owned by the MigrationSystemDictator`)
} }
...@@ -116,7 +116,13 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -116,7 +116,13 @@ const deployFn: DeployFunction = async (hre) => {
hre, hre,
'Proxy__OVM_L1StandardBridge' 'Proxy__OVM_L1StandardBridge'
) )
if ((await L1StandardBridge.owner()) !== MigrationSystemDictator.address) { const getOwnerOpts = {
from: ethers.constants.AddressZero,
}
if (
(await L1StandardBridge.callStatic.getOwner(getOwnerOpts)) !==
MigrationSystemDictator.address
) {
if (isLiveDeployer) { if (isLiveDeployer) {
console.log( console.log(
`Transferring ownership of L1StandardBridge to the MigrationSystemDictator...` `Transferring ownership of L1StandardBridge to the MigrationSystemDictator...`
...@@ -135,7 +141,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -135,7 +141,7 @@ const deployFn: DeployFunction = async (hre) => {
) )
} }
await awaitCondition(async () => { await awaitCondition(async () => {
const owner = await L1StandardBridge.callStatic.getOwner() const owner = await L1StandardBridge.callStatic.getOwner(getOwnerOpts)
return owner === MigrationSystemDictator.address return owner === MigrationSystemDictator.address
}) })
} else { } else {
...@@ -152,7 +158,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -152,7 +158,7 @@ const deployFn: DeployFunction = async (hre) => {
await awaitCondition(async () => { await awaitCondition(async () => {
const step = await MigrationSystemDictator.currentStep() const step = await MigrationSystemDictator.currentStep()
return step.toNumber() === i + 1 return Number(step) === i + 1
}) })
} }
} }
......
...@@ -317,10 +317,6 @@ const config: HardhatUserConfig = { ...@@ -317,10 +317,6 @@ const config: HardhatUserConfig = {
type: 'address', type: 'address',
default: ethers.constants.AddressZero, default: ethers.constants.AddressZero,
}, },
gasPriceOracleOwner: {
type: 'address',
default: ethers.constants.AddressZero,
},
gasPriceOracleOverhead: { gasPriceOracleOverhead: {
type: 'number', type: 'number',
default: 2100, default: 2100,
...@@ -356,7 +352,7 @@ const config: HardhatUserConfig = { ...@@ -356,7 +352,7 @@ const config: HardhatUserConfig = {
solidity: { solidity: {
compilers: [ compilers: [
{ {
version: '0.8.10', version: '0.8.15',
settings: { settings: {
optimizer: { enabled: true, runs: 10_000 }, optimizer: { enabled: true, runs: 10_000 },
}, },
......
{ {
"GasPriceOracle": { "GasPriceOracle": {
"spacer_0_0_20": {
"slot": 0,
"offset": 0,
"length": 20
},
"spacer_1_0_32": { "spacer_1_0_32": {
"slot": 1, "slot": 1,
"offset": 0, "offset": 0,
......
...@@ -6,6 +6,44 @@ import { Signer } from '@ethersproject/abstract-signer' ...@@ -6,6 +6,44 @@ import { Signer } from '@ethersproject/abstract-signer'
import { sleep, awaitCondition, getChainId } from '@eth-optimism/core-utils' import { sleep, awaitCondition, getChainId } from '@eth-optimism/core-utils'
import { HttpNetworkConfig } from 'hardhat/types' import { HttpNetworkConfig } from 'hardhat/types'
export interface DictatorConfig {
globalConfig: {
proxyAdmin: string
controller: string
finalOwner: string
addressManager: string
}
proxyAddressConfig: {
l2OutputOracleProxy: string
optimismPortalProxy: string
l1CrossDomainMessengerProxy: string
l1StandardBridgeProxy: string
optimismMintableERC20FactoryProxy: string
l1ERC721BridgeProxy: string
}
implementationAddressConfig: {
l2OutputOracleImpl: string
optimismPortalImpl: string
l1CrossDomainMessengerImpl: string
l1StandardBridgeImpl: string
optimismMintableERC20FactoryImpl: string
l1ERC721BridgeImpl: string
portalSenderImpl: string
}
l2OutputOracleConfig: {
l2OutputOracleGenesisL2Output: string
l2OutputOracleProposer: string
l2OutputOracleOwner: string
}
systemConfigConfig: {
owner: string
overhead: number
scalar: number
batcherHash: string
gasLimit: number
}
}
export const deployAndVerifyAndThen = async ({ export const deployAndVerifyAndThen = async ({
hre, hre,
name, name,
...@@ -280,6 +318,14 @@ export const assertContractVariable = async ( ...@@ -280,6 +318,14 @@ export const assertContractVariable = async (
from: ethers.constants.AddressZero, from: ethers.constants.AddressZero,
}) })
if (ethers.utils.isAddress(expected)) {
assert(
actual.toLowerCase() === expected.toLowerCase(),
`[FATAL] ${variable} is ${actual} but should be ${expected}`
)
return
}
assert( assert(
actual === expected || (actual.eq && actual.eq(expected)), actual === expected || (actual.eq && actual.eq(expected)),
`[FATAL] ${variable} is ${actual} but should be ${expected}` `[FATAL] ${variable} is ${actual} but should be ${expected}`
...@@ -294,5 +340,99 @@ export const getDeploymentAddress = async ( ...@@ -294,5 +340,99 @@ export const getDeploymentAddress = async (
return deployment.address return deployment.address
} }
export const makeDictatorConfig = async (
hre: any,
controller: string,
finalOwner: string,
fresh: boolean
): Promise<DictatorConfig> => {
return {
globalConfig: {
proxyAdmin: await getDeploymentAddress(hre, 'ProxyAdmin'),
controller,
finalOwner,
addressManager: fresh
? ethers.constants.AddressZero
: await getDeploymentAddress(hre, 'Lib_AddressManager'),
},
proxyAddressConfig: {
l2OutputOracleProxy: await getDeploymentAddress(
hre,
'L2OutputOracleProxy'
),
optimismPortalProxy: await getDeploymentAddress(
hre,
'OptimismPortalProxy'
),
l1CrossDomainMessengerProxy: await getDeploymentAddress(
hre,
fresh
? 'L1CrossDomainMessengerProxy'
: 'Proxy__OVM_L1CrossDomainMessenger'
),
l1StandardBridgeProxy: await getDeploymentAddress(
hre,
fresh ? 'L1StandardBridgeProxy' : 'Proxy__OVM_L1StandardBridge'
),
optimismMintableERC20FactoryProxy: await getDeploymentAddress(
hre,
'OptimismMintableERC20FactoryProxy'
),
l1ERC721BridgeProxy: await getDeploymentAddress(
hre,
'L1ERC721BridgeProxy'
),
},
implementationAddressConfig: {
l2OutputOracleImpl: await getDeploymentAddress(hre, 'L2OutputOracle'),
optimismPortalImpl: await getDeploymentAddress(hre, 'OptimismPortal'),
l1CrossDomainMessengerImpl: await getDeploymentAddress(
hre,
'L1CrossDomainMessenger'
),
l1StandardBridgeImpl: await getDeploymentAddress(hre, 'L1StandardBridge'),
optimismMintableERC20FactoryImpl: await getDeploymentAddress(
hre,
'OptimismMintableERC20Factory'
),
l1ERC721BridgeImpl: await getDeploymentAddress(hre, 'L1ERC721Bridge'),
portalSenderImpl: await getDeploymentAddress(hre, 'PortalSender'),
},
l2OutputOracleConfig: {
l2OutputOracleGenesisL2Output:
hre.deployConfig.l2OutputOracleGenesisL2Output,
l2OutputOracleProposer: hre.deployConfig.l2OutputOracleProposer,
l2OutputOracleOwner: hre.deployConfig.l2OutputOracleOwner,
},
systemConfigConfig: {
owner: hre.deployConfig.systemConfigOwner,
overhead: hre.deployConfig.gasPriceOracleOverhead,
scalar: hre.deployConfig.gasPriceOracleDecimals,
batcherHash: hre.ethers.utils.hexZeroPad(
hre.deployConfig.batchSenderAddress,
32
),
gasLimit: hre.deployConfig.l2GenesisBlockGasLimit,
},
}
}
export const assertDictatorConfig = async (
dictator: Contract,
config: DictatorConfig
) => {
const dictatorConfig = await dictator.config()
for (const [outerConfigKey, outerConfigValue] of Object.entries(config)) {
for (const [innerConfigKey, innerConfigValue] of Object.entries(
outerConfigValue
)) {
assert(
dictatorConfig[outerConfigKey][innerConfigKey] === innerConfigValue,
`incorrect config for ${outerConfigKey}.${innerConfigKey}`
)
}
}
}
// Large balance to fund accounts with. // Large balance to fund accounts with.
export const BIG_BALANCE = ethers.BigNumber.from(`0xFFFFFFFFFFFFFFFFFFFF`) export const BIG_BALANCE = ethers.BigNumber.from(`0xFFFFFFFFFFFFFFFFFFFF`)
...@@ -52,7 +52,7 @@ const config: HardhatUserConfig = { ...@@ -52,7 +52,7 @@ const config: HardhatUserConfig = {
}, },
}, },
companionNetworks: { companionNetworks: {
l1: 'ethereum', l1: 'mainnet',
}, },
}, },
'optimism-kovan': { 'optimism-kovan': {
...@@ -81,7 +81,7 @@ const config: HardhatUserConfig = { ...@@ -81,7 +81,7 @@ const config: HardhatUserConfig = {
l1: 'goerli', l1: 'goerli',
}, },
}, },
ethereum: { mainnet: {
chainId: 1, chainId: 1,
url: `https://mainnet.infura.io/v3/${getenv('INFURA_PROJECT_ID')}`, url: `https://mainnet.infura.io/v3/${getenv('INFURA_PROJECT_ID')}`,
accounts, accounts,
...@@ -164,7 +164,7 @@ const config: HardhatUserConfig = { ...@@ -164,7 +164,7 @@ const config: HardhatUserConfig = {
deployments: { deployments: {
goerli: ['../contracts/deployments/goerli'], goerli: ['../contracts/deployments/goerli'],
kovan: ['../contracts/deployments/kovan'], kovan: ['../contracts/deployments/kovan'],
ethereum: ['../contracts/deployments/mainnet'], mainnet: ['../contracts/deployments/mainnet'],
}, },
}, },
deployConfigSpec: configSpec, deployConfigSpec: configSpec,
......
...@@ -8,6 +8,8 @@ import { Provider } from '@ethersproject/abstract-provider' ...@@ -8,6 +8,8 @@ import { Provider } from '@ethersproject/abstract-provider'
import { ethers } from 'ethers' import { ethers } from 'ethers'
import * as DrippieArtifact from '@eth-optimism/contracts-periphery/artifacts/contracts/universal/drippie/Drippie.sol/Drippie.json' import * as DrippieArtifact from '@eth-optimism/contracts-periphery/artifacts/contracts/universal/drippie/Drippie.sol/Drippie.json'
import { version } from '../package.json'
type DrippieMonOptions = { type DrippieMonOptions = {
rpc: Provider rpc: Provider
drippieAddress: string drippieAddress: string
...@@ -30,8 +32,7 @@ export class DrippieMonService extends BaseServiceV2< ...@@ -30,8 +32,7 @@ export class DrippieMonService extends BaseServiceV2<
> { > {
constructor(options?: Partial<DrippieMonOptions>) { constructor(options?: Partial<DrippieMonOptions>) {
super({ super({
// eslint-disable-next-line @typescript-eslint/no-var-requires version,
version: require('../package.json').version,
name: 'drippie-mon', name: 'drippie-mon',
loop: true, loop: true,
loopIntervalMs: 60_000, loopIntervalMs: 60_000,
......
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"rootDir": "./src",
"outDir": "./dist" "outDir": "./dist"
}, },
"include": [ "include": [
"package.json",
"src/**/*" "src/**/*"
] ]
} }
...@@ -10,6 +10,7 @@ import { Provider } from '@ethersproject/abstract-provider' ...@@ -10,6 +10,7 @@ import { Provider } from '@ethersproject/abstract-provider'
import { Contract, ethers, Transaction } from 'ethers' import { Contract, ethers, Transaction } from 'ethers'
import dateformat from 'dateformat' import dateformat from 'dateformat'
import { version } from '../package.json'
import { import {
findFirstUnfinalizedStateBatchIndex, findFirstUnfinalizedStateBatchIndex,
findEventForStateBatch, findEventForStateBatch,
...@@ -38,8 +39,7 @@ type State = { ...@@ -38,8 +39,7 @@ type State = {
export class FaultDetector extends BaseServiceV2<Options, Metrics, State> { export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
constructor(options?: Partial<Options>) { constructor(options?: Partial<Options>) {
super({ super({
// eslint-disable-next-line @typescript-eslint/no-var-requires version,
version: require('../package.json').version,
name: 'fault-detector', name: 'fault-detector',
loop: true, loop: true,
loopIntervalMs: 1000, loopIntervalMs: 1000,
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"outDir": "./dist" "outDir": "./dist"
}, },
"include": [ "include": [
"package.json",
"src/**/*" "src/**/*"
] ]
} }
# @eth-optimism/integration-tests-bedrock
## 0.5.12
### Patch Changes
- 7215f4ce: Bump ethers to 5.7.0 globally
- 206f6033: Fix outdated references to 'withdrawal contract'
## 0.5.11
### Patch Changes
- 29ff7462: Revert es target back to 2017
## 0.5.10
### Patch Changes
- ef7758a9: Bump integration test dependencies to latest for changesets
- d18ae135: Updates all ethers versions in response to BN.js bug
pragma solidity ^0.8.10;
contract Counter {
uint256 public value = 0;
constructor() {}
function getValue() public view returns (uint256) {
return value;
}
function incValue() public {
value++;
}
}
\ No newline at end of file
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
contract ERC20 {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; //fancy name: eg OVM Coin
uint8 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg OVM
uint256 public totalSupply;
constructor(
uint256 _initialAmount,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol
) public {
balances[msg.sender] = _initialAmount; // Give the creator all initial tokens
totalSupply = _initialAmount; // Update total supply
name = _tokenName; // Set the name for display purposes
decimals = _decimalUnits; // Amount of decimals for display purposes
symbol = _tokenSymbol; // Set the symbol for display purposes
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value, "insufficient balance");
balances[msg.sender] -= _value;
balances[_to] += _value;
emit Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
uint256 allowance = allowed[_from][msg.sender];
require(balances[_from] >= _value && allowance >= _value, "bad allowance");
balances[_to] += _value;
balances[_from] -= _value;
if (allowance < MAX_UINT256) {
allowed[_from][msg.sender] -= _value;
}
emit Transfer(_from, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function destroy() public {
selfdestruct(payable(msg.sender));
}
}
pragma solidity 0.8.10;
interface DepositFeed {
function depositTransaction(
address _to,
uint256 _value,
uint64 _gasLimit,
bool _isCreation,
bytes memory _data
) external payable;
}
contract MultiDepositor {
DepositFeed df = DepositFeed(0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001);
constructor(address _df) {
df = DepositFeed(_df);
}
function deposit(address to) external payable {
for (uint i = 0; i < 3; i++) {
df.depositTransaction{value : 1000000000}(
to,
1000,
3000000,
false,
""
);
}
}
}
\ No newline at end of file
pragma solidity 0.8.10;
contract Reverter {
string constant public revertMessage = "This is a simple reversion.";
function doRevert() public pure {
revert(revertMessage);
}
}
\ No newline at end of file
[profile.default]
src = 'contracts'
out = 'forge-artifacts'
optimizer = true
optimizer_runs = 999999
extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout']
bytecode_hash = "none"
{
"private": true,
"name": "@eth-optimism/integration-tests-bedrock",
"version": "0.5.12",
"description": "[Optimism] Bedrock Integration tests",
"scripts": {
"lint": "yarn lint:fix && yarn lint:check",
"lint:fix": "yarn lint:check --fix",
"lint:check": "eslint . --max-warnings=0",
"build:contracts": "forge build",
"test": "echo 'no unit tests'",
"test:actor": "IS_LIVE_NETWORK=true ts-node actor-tests/lib/runner.ts",
"test:integration:live": "NO_NETWORK=true IS_LIVE_NETWORK=true hardhat --network optimism test",
"clean": "rimraf cache artifacts foundry-artifacts"
},
"keywords": [
"optimism",
"ethereum",
"integration",
"tests"
],
"homepage": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/integration-tests-bedrock#readme",
"license": "MIT",
"author": "Optimism PBC",
"repository": {
"type": "git",
"url": "https://github.com/ethereum-optimism/optimism.git"
},
"devDependencies": {
"@eth-optimism/contracts": "0.5.38",
"@eth-optimism/core-utils": "0.11.0",
"@eth-optimism/sdk": "1.6.10",
"@ethersproject/abstract-provider": "^5.7.0",
"chai-as-promised": "^7.1.1",
"chai": "^4.3.4",
"dotenv": "^10.0.0",
"envalid": "^7.1.0",
"ethereum-waffle": "^3.3.0",
"ethers": "^5.7.0",
"rimraf": "^3.0.2",
"ts-node": "^10.7.0"
},
"dependencies": {
"rlp": "^3.0.0",
"winston": "^3.7.2"
}
}
// Named 000 in order to run first since the output submitter
// can fall behind.
/* Imports: External */
import {
BigNumber,
constants,
Contract,
ContractReceipt,
utils,
Wallet,
} from 'ethers'
import { awaitCondition } from '@eth-optimism/core-utils'
import * as rlp from 'rlp'
import { Block } from '@ethersproject/abstract-provider'
import winston from 'winston'
import { predeploys } from '@eth-optimism/contracts'
import env from './shared/env'
import { expect } from './shared/setup'
import l2ToL1MessagePasserArtifact from '../../contracts-bedrock/artifacts/contracts/L2/L2ToL1MessagePasser.sol/L2ToL1MessagePasser.json'
import l2OOracleArtifact from '../../contracts-bedrock/artifacts/contracts/L1/L2OutputOracle.sol/L2OutputOracle.json'
/**
* Calculates the target output timestamp to make the withdrawal proof against. ie. the first
* output with a timestamp greater than the burn block timestamp.
*
* @param {Contract} oracle Address of the L2 Output Oracle.
* @param {number} withdrawalTimestamp L2 timestamp of the block the withdrawal was made in.
*/
const getTargetOutput = async (
oracle: Contract,
withdrawalTimestamp: number
) => {
const submissionInterval = (await oracle.SUBMISSION_INTERVAL()).toNumber()
const startingTimestamp = (await oracle.STARTING_TIMESTAMP()).toNumber()
const nextTimestamp = (await oracle.nextTimestamp()).toNumber()
let targetOutputTimestamp
if (withdrawalTimestamp < nextTimestamp) {
// Just use the next timestamp
targetOutputTimestamp = nextTimestamp
} else {
// Calculate the first timestamp greater than the burnBlock which will be appended.
targetOutputTimestamp =
Math.ceil(
(withdrawalTimestamp - startingTimestamp) / submissionInterval
) *
submissionInterval +
startingTimestamp
}
return targetOutputTimestamp
}
describe('Withdrawals', () => {
let logger: winston.Logger
let portal: Contract
let withdrawer: Contract
let recipient: Wallet
before(async () => {
logger = env.logger
portal = env.optimismPortal
withdrawer = new Contract(
predeploys.OVM_L2ToL1MessagePasser,
l2ToL1MessagePasserArtifact.abi
)
})
describe('simple withdrawals', () => {
let nonce: BigNumber
let burnBlock: Block
let withdrawalHash: string
const value = utils.parseEther('1')
const gasLimit = 3000000
before(async function () {
this.timeout(60_000)
recipient = Wallet.createRandom().connect(env.l2Provider)
withdrawer = withdrawer.connect(recipient)
logger.info('Generated new wallet', {
recipient: recipient.address,
})
logger.info('Depositing to new address on L2')
let tx = await portal
.connect(env.l1Wallet)
.depositTransaction(
recipient.address,
utils.parseEther('1.337'),
gasLimit,
false,
[],
{
value: utils.parseEther('1.337'),
}
)
await tx.wait()
await awaitCondition(async () => {
const bal = await recipient.getBalance()
return bal.eq(tx.value)
})
logger.info('Transferring funds on L1')
tx = await env.l1Wallet.sendTransaction({
to: recipient.address,
value,
})
await tx.wait()
})
it('should create a withdrawal on L2', async () => {
nonce = await withdrawer.nonce()
const tx = await withdrawer.initiateWithdrawal(
recipient.address,
gasLimit,
[],
{
value,
}
)
const receipt: ContractReceipt = await tx.wait()
expect(receipt.events!.length).to.eq(1)
expect(receipt.events![0].args).to.deep.eq([
nonce,
recipient.address,
recipient.address,
value,
BigNumber.from(gasLimit),
'0x',
])
burnBlock = await env.l2Provider.getBlock(receipt.blockHash)
withdrawalHash = utils.keccak256(
utils.defaultAbiCoder.encode(
['uint256', 'address', 'address', 'uint256', 'uint256', 'bytes'],
[
utils.hexZeroPad(nonce.toHexString(), 32),
recipient.address,
recipient.address,
value,
gasLimit,
'0x',
]
)
)
const included = await withdrawer.sentMessages(withdrawalHash)
expect(included).to.be.true
})
// TODO(tynes): refactor this test. the awaitCondition hangs
// forever in its current state
it.skip('should verify the withdrawal on L1', async function () {
recipient = recipient.connect(env.l1Provider)
portal = portal.connect(recipient)
const oracle = new Contract(
await portal.L2_ORACLE(),
l2OOracleArtifact.abi
).connect(recipient)
const targetOutputTimestamp = await getTargetOutput(
oracle,
burnBlock.timestamp
)
// Set the timeout based on the diff between latest output and target output timestamp.
let latestBlockTimestamp = (
await oracle.latestBlockTimestamp()
).toNumber()
let difference = targetOutputTimestamp - latestBlockTimestamp
this.timeout(difference * 5000)
let output: string
await awaitCondition(
async () => {
const proposal = await oracle.getL2Output(targetOutputTimestamp)
output = proposal.outputRoot
latestBlockTimestamp = (
await oracle.latestBlockTimestamp()
).toNumber()
if (targetOutputTimestamp - latestBlockTimestamp < difference) {
// Only log when a new output has been appended
difference = targetOutputTimestamp - latestBlockTimestamp
logger.info('Waiting for output submission', {
targetTimestamp: targetOutputTimestamp,
latestOracleTS: latestBlockTimestamp,
difference,
output,
})
}
return output !== constants.HashZero
},
2000,
2 * difference
)
// suppress compilation errors since Typescript cannot detect
// that awaitCondition above will throw if it times out.
output = output!
const blocksSinceBurn = Math.floor(
(targetOutputTimestamp - burnBlock.timestamp) / 2
)
const targetBlockNum = burnBlock.number + blocksSinceBurn + 1
const targetBlockNumHex = utils.hexValue(targetBlockNum)
const storageSlot = '00'.repeat(31) + '01' // i.e the second variable declared in the contract
const proof = await env.l2Provider.send('eth_getProof', [
predeploys.OVM_L2ToL1MessagePasser,
[utils.keccak256(withdrawalHash + storageSlot)],
targetBlockNumHex,
])
const { stateRoot: targetStateRoot, hash: targetHash } =
await env.l2Provider.send('eth_getBlockByNumber', [
targetBlockNumHex,
false,
])
const finalizationPeriod = (await portal.FINALIZATION_PERIOD()).toNumber()
logger.info('Waiting finalization period', {
seconds: finalizationPeriod,
})
await new Promise((resolve) =>
setTimeout(resolve, finalizationPeriod * 1000)
)
logger.info('Finalizing withdrawal')
const initialBal = await recipient.getBalance()
const tx = await portal.finalizeWithdrawalTransaction(
nonce,
recipient.address,
recipient.address,
value,
gasLimit,
'0x',
targetOutputTimestamp,
{
version: constants.HashZero,
stateRoot: targetStateRoot,
messagePasserStorageRoot: proof.storageHash,
latestBlockhash: targetHash,
},
rlp.encode(proof.storageProof[0].proof),
{
gasLimit,
}
)
await tx.wait()
const finalBal = await recipient.getBalance()
expect(finalBal.gte(initialBal)).to.be.true
}).timeout(180_000)
})
})
/* Imports: External */
import { Contract, ContractFactory, utils, Wallet } from 'ethers'
import { awaitCondition } from '@eth-optimism/core-utils'
/* Imports: Internal */
import { defaultTransactionFactory } from './shared/utils'
import env from './shared/env'
import counterArtifact from '../forge-artifacts/Counter.sol/Counter.json'
import multiDepositorArtifact from '../forge-artifacts/MultiDepositor.sol/MultiDepositor.json'
describe('Deposits', () => {
let portal: Contract
before(() => {
portal = env.optimismPortal.connect(env.l1Wallet)
})
it('should deposit value', async () => {
const recipWallet = Wallet.createRandom().connect(env.l2Provider)
const tx = defaultTransactionFactory()
tx.value = utils.parseEther('1.337')
tx.to = recipWallet.address
const result = await portal.depositTransaction(
tx.to,
tx.value,
'3000000',
false,
[],
{
value: tx.value,
}
)
await result.wait()
await awaitCondition(async () => {
const bal = await recipWallet.getBalance()
return bal.eq(tx.value)
})
})
it('should support multiple deposits in a single tx', async () => {
const recipWallet = Wallet.createRandom().connect(env.l2Provider)
const value = utils.parseEther('0.1')
const factory = new ContractFactory(
multiDepositorArtifact.abi,
multiDepositorArtifact.bytecode.object
).connect(env.l1Wallet)
const contract = await factory.deploy(portal.address)
await contract.deployed()
const tx = await contract.deposit(recipWallet.address, {
value,
})
await tx.wait()
await awaitCondition(async () => {
const bal = await recipWallet.getBalance()
return bal.eq('3000')
})
}).timeout(60_000)
it.skip('should deposit a contract creation', async () => {
const value = utils.parseEther('0.1')
const factory = new ContractFactory(
counterArtifact.abi,
counterArtifact.bytecode.object
)
const tx = await factory.getDeployTransaction()
const result = await portal.depositTransaction(
`0x${'0'.repeat(40)}`,
'0',
'3000000',
true,
tx.data,
{
value,
}
)
await result.wait()
const l2Nonce = await env.l2Wallet.getTransactionCount()
const addr = utils.getContractAddress({
from: env.l2Wallet.address,
nonce: l2Nonce,
})
await awaitCondition(async () => {
const code = await env.l2Provider.getCode(addr)
return code === counterArtifact.bytecode.object
})
})
})
/* Imports: External */
import { ContractFactory, Wallet } from 'ethers'
/* Imports: Internal */
import { expect } from './shared/setup'
import { defaultTransactionFactory } from './shared/utils'
import env from './shared/env'
import counterArtifact from '../artifacts/Counter.sol/Counter.json'
describe('RPCs', () => {
let wallet: Wallet
before(async () => {
wallet = env.l2Wallet
})
it('eth_chainId', async () => {
const network = await env.l2Provider.getNetwork()
expect(network.chainId).to.equal(901)
})
describe('eth_sendRawTransaction', () => {
it('should correctly process a funds transfer', async () => {
const altWallet = await Wallet.createRandom().connect(env.l2Provider)
const tx = defaultTransactionFactory()
tx.to = altWallet.address
const nonce = await wallet.getTransactionCount()
const result = await wallet.sendTransaction(tx)
expect(result.from).to.equal(wallet.address)
expect(result.nonce).to.equal(nonce)
expect(result.gasLimit.toNumber()).to.equal(tx.gasLimit)
expect(result.data).to.equal(tx.data)
expect(await altWallet.getBalance()).to.equal(tx.value)
})
it('should correctly process a contract creation', async () => {
const factory = new ContractFactory(
counterArtifact.abi,
counterArtifact.bytecode.object
).connect(wallet)
const counter = await factory.deploy({
gasLimit: 1_000_000,
})
await counter.deployed()
expect(await env.l2Provider.getCode(counter.address)).not.to.equal('0x')
})
})
})
/* Imports: External */
import { Wallet, providers, Contract } from 'ethers'
import { bool, cleanEnv, num, str } from 'envalid'
import dotenv from 'dotenv'
import winston from 'winston'
const { combine, timestamp, printf, colorize, align } = winston.format
/* Imports: Internal */
import portalArtifact from '../../../contracts-bedrock/artifacts/contracts/L1/OptimismPortal.sol/OptimismPortal.json'
dotenv.config()
const procEnv = cleanEnv(process.env, {
L1_URL: str({ default: 'http://localhost:8545' }),
L1_POLLING_INTERVAL: num({ default: 10 }),
L2_URL: str({ default: 'http://localhost:9545' }),
L2_POLLING_INTERVAL: num({ default: 1 }),
OPTIMISM_PORTAL_ADDRESS: str(),
PRIVATE_KEY: str({
default: 'ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',
}),
MOCHA_TIMEOUT: num({
default: 120_000,
}),
MOCHA_BAIL: bool({
default: false,
}),
LOG_LEVEL: str({
default: 'info',
}),
})
/// Helper class for instantiating a test environment with a funded account
export class OptimismEnv {
// The wallets
l1Wallet: Wallet
l2Wallet: Wallet
// The providers
l1Provider: providers.JsonRpcProvider
l2Provider: providers.JsonRpcProvider
// Contracts
optimismPortal: Contract
logger: winston.Logger
constructor() {
const l1Provider = new providers.JsonRpcProvider(procEnv.L1_URL)
l1Provider.pollingInterval = procEnv.L1_POLLING_INTERVAL
const l2Provider = new providers.JsonRpcProvider(procEnv.L2_URL)
l2Provider.pollingInterval = procEnv.L2_POLLING_INTERVAL
const l1Wallet = new Wallet(procEnv.PRIVATE_KEY, l1Provider)
const l2Wallet = new Wallet(procEnv.PRIVATE_KEY, l2Provider)
if (!procEnv.OPTIMISM_PORTAL_ADDRESS) {
throw new Error('Must define an OptimismPortal address.')
}
this.l1Wallet = l1Wallet
this.l2Wallet = l2Wallet
this.l1Provider = l1Provider
this.l2Provider = l2Provider
this.optimismPortal = new Contract(
procEnv.OPTIMISM_PORTAL_ADDRESS,
portalArtifact.abi
)
this.logger = winston.createLogger({
level: process.env.LOG_LEVEL || 'info',
format: combine(
{
transform: (info) => {
// @ts-ignore
const args = info[Symbol.for('splat')]
const meta = args ? args[0] : null
const suffix = meta ? ` ${keyify(meta)}` : ''
info.message = `${info.message}${suffix}`
return info
},
},
colorize({ all: true }),
timestamp({
format: 'YYYY-MM-DD hh:mm:ss.SSS A',
}),
align(),
printf((info) => `[${info.timestamp}] ${info.level}: ${info.message}`)
),
transports: [
new winston.transports.Stream({
stream: process.stderr,
}),
],
})
}
}
const keyify = (kv: object): string => {
const out = []
for (const [k, v] of Object.entries(kv)) {
out.push(`${k}=${v}`)
}
return out.join(' ')
}
const env = new OptimismEnv()
export default env
/* External Imports */
import chai = require('chai')
import chaiAsPromised from 'chai-as-promised'
import { solidity } from 'ethereum-waffle'
chai.use(solidity)
chai.use(chaiAsPromised)
const expect = chai.expect
export { expect }
import { BigNumber } from 'ethers'
export const defaultTransactionFactory = () => {
return {
to: '0x' + '1234'.repeat(10),
gasLimit: 8_000_000,
data: '0x',
value: BigNumber.from(0),
}
}
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist"
},
"include": [
"src/**/*",
"./test",
"./artifacts/**/*.json",
"./tasks/**/*.ts",
"./package.json"
]
}
...@@ -10,6 +10,8 @@ import { ...@@ -10,6 +10,8 @@ import {
import { CrossChainMessenger, MessageStatus } from '@eth-optimism/sdk' import { CrossChainMessenger, MessageStatus } from '@eth-optimism/sdk'
import { Provider } from '@ethersproject/abstract-provider' import { Provider } from '@ethersproject/abstract-provider'
import { version } from '../package.json'
type MessageRelayerOptions = { type MessageRelayerOptions = {
l1RpcProvider: Provider l1RpcProvider: Provider
l2RpcProvider: Provider l2RpcProvider: Provider
...@@ -37,8 +39,7 @@ export class MessageRelayerService extends BaseServiceV2< ...@@ -37,8 +39,7 @@ export class MessageRelayerService extends BaseServiceV2<
> { > {
constructor(options?: Partial<MessageRelayerOptions>) { constructor(options?: Partial<MessageRelayerOptions>) {
super({ super({
// eslint-disable-next-line @typescript-eslint/no-var-requires version,
version: require('../package.json').version,
name: 'message-relayer', name: 'message-relayer',
options, options,
optionsSpec: { optionsSpec: {
......
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"rootDir": "./src",
"outDir": "./dist" "outDir": "./dist"
}, },
"include": [ "include": [
"package.json",
"src/**/*" "src/**/*"
] ]
} }
...@@ -7,6 +7,8 @@ import { ...@@ -7,6 +7,8 @@ import {
} from '@eth-optimism/common-ts' } from '@eth-optimism/common-ts'
import { sleep } from '@eth-optimism/core-utils' import { sleep } from '@eth-optimism/core-utils'
import { version } from '../package.json'
type HealthcheckOptions = { type HealthcheckOptions = {
referenceRpcProvider: Provider referenceRpcProvider: Provider
targetRpcProvider: Provider targetRpcProvider: Provider
...@@ -32,8 +34,7 @@ export class HealthcheckService extends BaseServiceV2< ...@@ -32,8 +34,7 @@ export class HealthcheckService extends BaseServiceV2<
> { > {
constructor(options?: Partial<HealthcheckOptions>) { constructor(options?: Partial<HealthcheckOptions>) {
super({ super({
// eslint-disable-next-line @typescript-eslint/no-var-requires version,
version: require('../package.json').version,
name: 'healthcheck', name: 'healthcheck',
loopIntervalMs: 5000, loopIntervalMs: 5000,
options, options,
......
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"rootDir": "./src",
"outDir": "./dist" "outDir": "./dist"
}, },
"include": [ "include": [
"package.json",
"src/**/*" "src/**/*"
] ]
} }
...@@ -729,6 +729,7 @@ After deriving the transaction list, the rollup node constructs a [`PayloadAttri ...@@ -729,6 +729,7 @@ After deriving the transaction list, the rollup node constructs a [`PayloadAttri
- `transactions` is the array of the derived transactions: deposited transactions and sequenced transactions, all - `transactions` is the array of the derived transactions: deposited transactions and sequenced transactions, all
encoded with [EIP-2718]. encoded with [EIP-2718].
- `noTxPool` is set to `true`, to use the exact above `transactions` list when constructing the block. - `noTxPool` is set to `true`, to use the exact above `transactions` list when constructing the block.
- `gasLimit` is set to the current `gasLimit` value in the [system configuration][g-system-config] of this payload.
[expanded-payload]: exec-engine.md#extended-payloadattributesv1 [expanded-payload]: exec-engine.md#extended-payloadattributesv1
......
...@@ -68,8 +68,7 @@ to [`engine_forkchoiceUpdatedV1`][engine_forkchoiceUpdatedV1]: the extended `Pay ...@@ -68,8 +68,7 @@ to [`engine_forkchoiceUpdatedV1`][engine_forkchoiceUpdatedV1]: the extended `Pay
#### Extended PayloadAttributesV1 #### Extended PayloadAttributesV1
[`PayloadAttributesV1`][PayloadAttributesV1] is extended with a `transactions` field, equivalent to [`PayloadAttributesV1`][PayloadAttributesV1] is extended to:
the `transactions` field in [`ExecutionPayloadV1`][ExecutionPayloadV1]:
```js ```js
PayloadAttributesV1: { PayloadAttributesV1: {
...@@ -78,6 +77,7 @@ PayloadAttributesV1: { ...@@ -78,6 +77,7 @@ PayloadAttributesV1: {
suggestedFeeRecipient: DATA (20 bytes) suggestedFeeRecipient: DATA (20 bytes)
transactions: array of DATA transactions: array of DATA
noTxPool: bool noTxPool: bool
gasLimit: QUANTITY or null
} }
``` ```
...@@ -87,6 +87,7 @@ to a JSON array. ...@@ -87,6 +87,7 @@ to a JSON array.
Each item of the `transactions` array is a byte list encoding a transaction: `TransactionType || Each item of the `transactions` array is a byte list encoding a transaction: `TransactionType ||
TransactionPayload` or `LegacyTransaction`, as defined in [EIP-2718][eip-2718]. TransactionPayload` or `LegacyTransaction`, as defined in [EIP-2718][eip-2718].
This is equivalent to the `transactions` field in [`ExecutionPayloadV1`][ExecutionPayloadV1]
The `transactions` field is optional: The `transactions` field is optional:
...@@ -106,6 +107,10 @@ if there is an error processing the transactions. It must return `STATUS_VALID` ...@@ -106,6 +107,10 @@ if there is an error processing the transactions. It must return `STATUS_VALID`
be executed without error. **Note**: The state transition rules have been modified such that deposits will never fail be executed without error. **Note**: The state transition rules have been modified such that deposits will never fail
so if `engine_forkchoiceUpdatedV1` returns `STATUS_INVALID` it is because a batched transaction is invalid. so if `engine_forkchoiceUpdatedV1` returns `STATUS_INVALID` it is because a batched transaction is invalid.
The `gasLimit` is optional w.r.t. compatibility with L1, but required when used as rollup.
This field overrides the gas limit used during block-building.
If not specified as rollup, a `STATUS_INVALID` is returned.
[rollup-driver]: rollup-node.md [rollup-driver]: rollup-node.md
### `engine_newPayloadV1` ### `engine_newPayloadV1`
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
- [System config contents (version 0)](#system-config-contents-version-0) - [System config contents (version 0)](#system-config-contents-version-0)
- [`batcherHash` (`bytes32`)](#batcherhash-bytes32) - [`batcherHash` (`bytes32`)](#batcherhash-bytes32)
- [`l1FeeOverhead` and `l1FeeScalar` (`uint256,uint256`)](#l1feeoverhead-and-l1feescalar-uint256uint256) - [`l1FeeOverhead` and `l1FeeScalar` (`uint256,uint256`)](#l1feeoverhead-and-l1feescalar-uint256uint256)
- [`gasLimit` (`uint64`)](#gaslimit-uint64)
- [Writing the system config](#writing-the-system-config) - [Writing the system config](#writing-the-system-config)
- [Reading the system config](#reading-the-system-config) - [Reading the system config](#reading-the-system-config)
...@@ -34,6 +35,12 @@ to enable more extensive redundancy and/or rotation configurations. ...@@ -34,6 +35,12 @@ to enable more extensive redundancy and/or rotation configurations.
The L1 fee parameters, also known as Gas Price Oracle (GPO) parameters, The L1 fee parameters, also known as Gas Price Oracle (GPO) parameters,
are updated in conjunction and apply new L1 costs to the L2 transactions. are updated in conjunction and apply new L1 costs to the L2 transactions.
### `gasLimit` (`uint64`)
The gas limit of the L2 blocks is configured through the system config.
Changes to the L2 gas limit are fully applied in the first L2 block with the L1 origin that introduced the change,
as opposed to the 1/1024 adjustments towards a target as seen in limit updates of L1 blocks.
## Writing the system config ## Writing the system config
The `SystemConfig` contract applies authentication to all writing contract functions, The `SystemConfig` contract applies authentication to all writing contract functions,
...@@ -50,6 +57,7 @@ A rollup node initializes its derivation process by finding a starting point bas ...@@ -50,6 +57,7 @@ A rollup node initializes its derivation process by finding a starting point bas
- When started from an existing L2 chain, a previously included L1 block is determined as derivation starting point, - When started from an existing L2 chain, a previously included L1 block is determined as derivation starting point,
and the system config can thus be retrieved from the last L2 block that referenced the L1 block as L1 origin: and the system config can thus be retrieved from the last L2 block that referenced the L1 block as L1 origin:
- `batcherHash`, `l1FeeOverhead` and `l1FeeScalar` are retrieved from the L1 block info transaction. - `batcherHash`, `l1FeeOverhead` and `l1FeeScalar` are retrieved from the L1 block info transaction.
- `gasLimit` is retrieved from the L2 block header.
- other future variables may also be retrieved from other contents of the L2 block, such as the header. - other future variables may also be retrieved from other contents of the L2 block, such as the header.
After preparing the initial system configuration for the given L1 starting input, After preparing the initial system configuration for the given L1 starting input,
...@@ -65,6 +73,7 @@ The contained log events are filtered and processed as follows: ...@@ -65,6 +73,7 @@ The contained log events are filtered and processed as follows:
and encodes the configuration update. In version `0` the following types are supported: and encodes the configuration update. In version `0` the following types are supported:
- type `0`: `batcherHash` overwrite, as `bytes32` payload. - type `0`: `batcherHash` overwrite, as `bytes32` payload.
- type `1`: `l1FeeOverhead` and `l1FeeScalar` overwrite, as two packed `uint256` entries. - type `1`: `l1FeeOverhead` and `l1FeeScalar` overwrite, as two packed `uint256` entries.
- type `2`: `gasLimit` overwrite, as `uint64` payload.
Note that individual derivation stages may be processing different L1 blocks, Note that individual derivation stages may be processing different L1 blocks,
and should thus maintain individual system configuration copies, and should thus maintain individual system configuration copies,
......
aiohttp==3.8.3
aiosignal==1.2.0
async-timeout==4.0.2
attrs==22.1.0
base58==2.1.1
bitarray==2.6.0
certifi==2022.9.24
charset-normalizer==2.1.1
click==8.1.3
cytoolz==0.12.0
docker==6.0.0
eth-abi==2.2.0
eth-account==0.5.9
eth-hash==0.5.0
eth-keyfile==0.5.1
eth-keys==0.3.4
eth-rlp==0.2.1
eth-typing==2.3.0
eth-utils==1.9.5
frozenlist==1.3.1
hexbytes==0.3.0
idna==3.4
ipfshttpclient==0.8.0a2
jsonschema==4.16.0
lru-dict==1.1.8
multiaddr==0.0.9
multidict==6.0.2
netaddr==0.8.0
packaging==21.3
parsimonious==0.8.1
protobuf==3.19.5
pycryptodome==3.15.0
pyparsing==3.0.9
pyrsistent==0.18.1
requests==2.28.1
rlp==2.0.1
six==1.16.0
toolz==0.12.0
tqdm==4.64.1
urllib3==1.26.12
varint==1.0.2
web3==5.31.1
websocket-client==1.4.1
websockets==9.1
yarl==1.8.1
from distutils.core import setup
from setuptools import find_packages
setup(
name='testmig',
version='1.0',
description='Bedrock migration tester tool',
install_requires=[
'click==8.1.3',
'docker==6.0.0',
'web3==5.31.1',
'requests==2.28.1',
'tqdm==4.64.1'
],
packages=find_packages(include=['testmig', 'testmig.*']),
entry_points={
'console_scripts': ['testmig=testmig.cli:group']
}
)
import logging
import os
import shutil
import time
from pathlib import Path
import click
import docker
import docker.errors
from web3 import Web3
from testmig.contracts import SLOTS_TO_MODIFY
from testmig.util import download_with_progress, run_command
import testmig.log_setup
URL_PREFIX = 'https://storage.googleapis.com/optimism/snapshots/mainnet/2022-10-24-1'
default_monorepo_dir = os.path.abspath(os.path.join(os.getcwd(), '..'))
log = logging.getLogger()
@click.group()
def group():
pass
@group.command()
@click.option('--monorepo-dir', required=True, type=click.Path(exists=True), default=default_monorepo_dir)
@click.option('--snapshot-cache-dir', required=True, default='/tmp/testmig-snapshots')
@click.option('--work-dir', required=True, default='/tmp/testmig-workdir')
@click.option('--l1-url', required=True, default=os.getenv('TESTMIG_L1_URL'))
@click.option('--reset-work-dir', required=True, default=False)
def run_forked(monorepo_dir, snapshot_cache_dir, work_dir, l1_url, reset_work_dir):
if not os.path.isdir(snapshot_cache_dir):
os.makedirs(snapshot_cache_dir)
if reset_work_dir:
shutil.rmtree(work_dir)
os.makedirs(work_dir, exist_ok=True)
historical_mainnet_path = os.path.join(monorepo_dir, 'packages', 'contracts-bedrock', 'deployments', 'mainnet')
if os.path.isdir(historical_mainnet_path):
log.info('Removing historical mainnet deployment')
print(historical_mainnet_path)
shutil.rmtree(historical_mainnet_path)
for archive in ('dtl', 'geth'):
fp = os.path.join(snapshot_cache_dir, f'{archive}.tar.gz')
if os.path.isfile(fp):
log.info(f'{archive} archive already exists, not downloading')
else:
log.info(f'Downloading {archive} archive')
with open(fp, 'wb+') as f:
download_with_progress(f'{URL_PREFIX}/{archive}.tar.gz', f)
outpath = os.path.join(work_dir, archive)
donefile = os.path.join(outpath, 'DONE')
if os.path.isfile(donefile):
log.info(f'{archive} is already extracted')
else:
log.info(f'Extracting {archive} archive')
os.makedirs(outpath)
run_command(['tar', '-xzvf', fp, '--strip-components=6', '-C', outpath])
Path(donefile).touch()
client = docker.from_env()
try:
container = client.containers.get('testmig-l1')
container.stop()
container.remove()
log.info('Stopped and removed old containers')
except docker.errors.NotFound:
pass
log.info('Starting forked L1')
container = client.containers.run('ethereumoptimism/hardhat-node:latest', detach=True, environment={
'FORK_STARTING_BLOCK': '15822707',
'FORK_URL': l1_url,
'FORK_CHAIN_ID': '1'
}, name='testmig-l1', ports={'8545/tcp': ('127.0.0.1', 8545)})
w3 = None
for i in range(0, 10):
try:
w3 = Web3(Web3.HTTPProvider('http://127.0.0.1:8545'))
w3.eth.get_balance('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266')
except Exception as e:
log.info('Polling for L1 to come up')
w3 = None
time.sleep(1)
if w3 is None:
raise Exception('Could not connect to Web3.')
log.info('L1 is ready')
for slot in SLOTS_TO_MODIFY:
log.info(f'Setting storage slot on {slot[0]}')
w3.provider.make_request('hardhat_setStorageAt', slot)
log.info('Mining a block for good measure')
w3.provider.make_request('evm_mine', [])
log.info('Running L1 migration')
run_command([
'yarn',
'hardhat',
'--network',
'mainnet-forked',
'deploy',
'--tags',
'migration'
], env={
'CHAIN_ID': '1',
'L1_RPC': 'http://127.0.0.1:8545',
'PRIVATE_KEY_DEPLOYER': 'ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',
}, cwd=os.path.join(monorepo_dir, 'packages', 'contracts-bedrock'))
log.info('Cleaning up')
container.stop()
container.remove()
if __name__ == '__main__':
group()
ADDRESSES = {
'Lib_AddressManager': '0xdE1FCfB0851916CA5101820A69b13a4E276bd81F',
'Proxy__OVM_L1StandardBridge': '0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1',
'Proxy__OVM_L1CrossDomainMessenger': '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1',
}
DEPLOYER_ADDR = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
DEPLOYER_ADDR_PADDED = '0x000000000000000000000000f39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
SLOTS_TO_MODIFY = (
# _owner slot
(ADDRESSES['Lib_AddressManager'], '0x0', DEPLOYER_ADDR_PADDED),
# proxy owner slot
(ADDRESSES['Proxy__OVM_L1StandardBridge'], '0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103',
DEPLOYER_ADDR_PADDED),
# owner slot on the underlying implementation
(ADDRESSES['Proxy__OVM_L1CrossDomainMessenger'], '0x33', DEPLOYER_ADDR_PADDED)
)
import os
from logging.config import dictConfig
log_level = os.getenv('LOG_LEVEL')
log_config = {
'version': 1,
'loggers': {
'': {
'handlers': ['console'],
'level': log_level if log_level is not None else 'INFO'
},
},
'handlers': {
'console': {
'formatter': 'stderr',
'class': 'logging.StreamHandler',
'stream': 'ext://sys.stdout'
}
},
'formatters': {
'stderr': {
'format': '[%(levelname)s|%(asctime)s] %(message)s',
'datefmt': '%m-%d-%Y %I:%M:%S'
}
},
}
dictConfig(log_config)
import os
import socket
import subprocess
import time
import requests
from tqdm import tqdm
def download_with_progress(url, f):
res = requests.get(url, stream=True, allow_redirects=True)
total_len = res.headers.get('content-length')
if total_len is None:
raise Exception('no total length, bailing out')
total_len = int(total_len)
with tqdm(total=total_len, unit='b', unit_scale=True) as pbar:
for data in res.iter_content(chunk_size=4096):
f.write(data)
pbar.update(len(data))
def run_command(args, check=True, shell=False, cwd=None, env=None):
env = env if env else {}
return subprocess.run(
args,
check=check,
shell=shell,
env={
**os.environ,
**env
},
cwd=cwd
)
def wait_up(port, retries=10, wait_secs=1):
for i in range(0, retries):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect(('127.0.0.1', int(port)))
s.shutdown(2)
return True
except Exception:
time.sleep(wait_secs)
raise Exception(f'Timed out waiting for port {port}.')
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