Skip to content

Commit

Permalink
maint: Move Go packages into root of repo, adopt go.work (ethereum-op…
Browse files Browse the repository at this point in the history
…timism#2524)

- Adopts Go workspaces for future compatibility with the Bedrock move into the monorepo
- Moves Go packages to the root of the repo in order to fix import paths
- Rewrites existing Go import paths
- Removes Stackman, since it's not needed anymore

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mslipper and mergify[bot] authored May 4, 2022
1 parent 412688d commit 5d309e6
Show file tree
Hide file tree
Showing 325 changed files with 282 additions and 6,333 deletions.
32 changes: 16 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ jobs:
- run:
name: Lint
command: golangci-lint run -E goimports -E sqlclosecheck -E bodyclose -E asciicheck ./...
working_directory: go/bss-core
working_directory: bss-core
- run:
name: Test
command: |
mkdir -p /test-results
gotestsum --junitfile /test-results/tests.xml
working_directory: go/bss-core
working_directory: bss-core
- store_test_results:
path: /test-results

Expand Down Expand Up @@ -313,26 +313,26 @@ workflows:
- go-lint-test-build:
name: batch-submitter-tests
binary_name: batch-submitter
working_directory: go/batch-submitter
working_directory: batch-submitter
- go-lint-test-build:
name: proxyd-tests
binary_name: proxyd
working_directory: go/proxyd
working_directory: proxyd
- go-lint-test-build:
name: teleportr-tests
binary_name: teleportr
working_directory: go/teleportr
working_directory: teleportr
- go-lint-test-build:
name: gas-oracle-tests
binary_name: gas-oracle
working_directory: go/gas-oracle
working_directory: gas-oracle
- go-lint-test-build:
name: indexer-tests
binary_name: indexer
working_directory: go/indexer
working_directory: indexer
- go-lint-test:
name: bss-core-tests
working_directory: go/bss-core
working_directory: bss-core
- contracts-tests:
requires:
- yarn-monorepo
Expand Down Expand Up @@ -379,14 +379,14 @@ workflows:
- yarn-monorepo
- docker-publish:
name: l2geth-release
docker_file: ops/docker/Dockerfile.geth
docker_file: l2geth/Dockerfile
docker_tags: ethereumoptimism/l2geth:nightly
docker_context: .
context:
- optimism
- docker-publish:
name: gas-oracle-release
docker_file: ops/docker/Dockerfile.gas-oracle
docker_file: gas-oracle/Dockerfile
docker_tags: ethereumoptimism/gas-oracle:nightly
docker_context: .
context:
Expand Down Expand Up @@ -414,21 +414,21 @@ workflows:
- optimism
- docker-publish:
name: proxyd-release
docker_file: go/proxyd/Dockerfile
docker_file: proxyd/Dockerfile
docker_tags: ethereumoptimism/proxyd:nightly
docker_context: .
context:
- optimism
- docker-publish:
name: l2geth-exporter-release
docker_file: ops/docker/Dockerfile.l2geth-exporter
docker_file: l2geth-exporter/Dockerfile
docker_tags: ethereumoptimism/l2geth-exporter:nightly
docker_context: .
context:
- optimism
- docker-publish:
name: op-exporter-release
docker_file: ops/docker/Dockerfile.op-exporter
docker_file: op-exporter/Dockerfile
docker_tags: ethereumoptimism/op-exporter:nightly
docker_context: .
context:
Expand Down Expand Up @@ -467,21 +467,21 @@ workflows:
- optimism
- docker-publish:
name: batch-submitter-service-release
docker_file: ops/docker/Dockerfile.batch-submitter-service
docker_file: ops/docker/Dockerfile
docker_tags: ethereumoptimism/batch-submitter-service:nightly
docker_context: .
context:
- optimism
- docker-publish:
name: indexer-release
docker_file: ops/docker/Dockerfile.indexer
docker_file: indexer/Dockerfile
docker_tags: ethereumoptimism/indexer:nightly
docker_context: .
context:
- optimism
- docker-publish:
name: teleportr-release
docker_file: ops/docker/Dockerfile.teleportr
docker_file: teleportr/Dockerfile
docker_tags: ethereumoptimism/teleportr:nightly
docker_context: .
context:
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.geth
file: ./l2geth/Dockerfile
push: true
tags: ethereumoptimism/l2geth:${{ needs.canary-publish.outputs.canary-docker-tag }}

Expand All @@ -139,7 +139,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.gas-oracle
file: ./gas-oracle/Dockerfile
push: true
tags: ethereumoptimism/gas-oracle:${{ needs.canary-publish.outputs.canary-docker-tag }}

Expand Down Expand Up @@ -326,14 +326,14 @@ jobs:
id: build_args
run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/proxyd/package.json)
echo ::set-output name=GITVERSION::$(jq -r .version ./proxyd/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./go/proxyd/Dockerfile
file: ./proxyd/Dockerfile
push: true
tags: ethereumoptimism/proxyd:${{ needs.canary-publish.outputs.proxyd }}
build-args: |
Expand Down Expand Up @@ -363,14 +363,14 @@ jobs:
id: build_args
run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/op-exporter/package.json)
echo ::set-output name=GITVERSION::$(jq -r .version ./op-exporter/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.op-exporter
file: ./op-exporter/Dockerfile=
push: true
tags: ethereumoptimism/op-exporter:${{ needs.canary-publish.outputs.op-exporter }}
build-args: |
Expand Down Expand Up @@ -400,14 +400,14 @@ jobs:
id: build_args
run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/l2geth-exporter/package.json)
echo ::set-output name=GITVERSION::$(jq -r .version ./l2geth-exporter/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.l2geth-exporter
file: ./l2geth-exporter/Dockerfile
push: true
tags: ethereumoptimism/l2geth-exporter:${{ needs.canary-publish.outputs.l2geth-exporter }}
build-args: |
Expand Down Expand Up @@ -437,7 +437,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.batch-submitter-service
file: ./batch-submitter/Dockerfile
push: true
tags: ethereumoptimism/batch-submitter-service:${{ needs.canary-publish.outputs.batch-submitter-service }}

Expand All @@ -463,14 +463,14 @@ jobs:
id: build_args
run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/indexer/package.json)
echo ::set-output name=GITVERSION::$(jq -r .version ./indexer/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.indexer
file: ./indexer/Dockerfile
push: true
tags: ethereumoptimism/indexer:${{ needs.canary-publish.outputs.indexer }}
build-args: |
Expand Down Expand Up @@ -500,14 +500,14 @@ jobs:
id: build_args
run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/teleportr/package.json)
echo ::set-output name=GITVERSION::$(jq -r .version ./teleportr/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.teleportr
file: ./teleportr/Dockerfile
push: true
tags: ethereumoptimism/teleportr:${{ needs.canary-publish.outputs.teleportr }}
build-args: |
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.geth
file: ./ops/docker/Dockerfile
push: true
tags: ethereumoptimism/l2geth:${{ needs.release.outputs.l2geth }},ethereumoptimism/l2geth:latest

Expand All @@ -119,7 +119,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.gas-oracle
file: ./gas-oracle/Dockerfile
push: true
tags: ethereumoptimism/gas-oracle:${{ needs.release.outputs.gas-oracle }},ethereumoptimism/gas-oracle:latest

Expand Down Expand Up @@ -223,14 +223,14 @@ jobs:
id: build_args
run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/proxyd/package.json)
echo ::set-output name=GITVERSION::$(jq -r .version ./proxyd/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./go/proxyd/Dockerfile
file: ./proxyd/Dockerfile
push: true
tags: ethereumoptimism/proxyd:${{ needs.release.outputs.proxyd }},ethereumoptimism/proxyd:latest
build-args: |
Expand Down Expand Up @@ -260,14 +260,14 @@ jobs:
id: build_args
run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/l2geth-exporter/package.json)
echo ::set-output name=GITVERSION::$(jq -r .version ./l2geth-exporter/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.l2geth-exporter
file: ./l2geth-exporter/Dockerfile
push: true
tags: ethereumoptimism/l2geth-exporter:${{ needs.release.outputs.l2geth-exporter }},ethereumoptimism/l2geth-exporter:latest
build-args: |
Expand Down Expand Up @@ -297,14 +297,14 @@ jobs:
id: build_args
run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/op-exporter/package.json)
echo ::set-output name=GITVERSION::$(jq -r .version ./op-exporter/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.op-exporter
file: ./op-exporter/Dockerfile
push: true
tags: ethereumoptimism/op-exporter:${{ needs.release.outputs.op-exporter }},ethereumoptimism/op-exporter:latest
build-args: |
Expand Down Expand Up @@ -469,7 +469,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.batch-submitter-service
file: ./batch-submitter/Dockerfile
push: true
tags: ethereumoptimism/batch-submitter-service:${{ needs.release.outputs.batch-submitter-service }},ethereumoptimism/batch-submitter-service:latest

Expand All @@ -495,14 +495,14 @@ jobs:
id: build_args
run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/indexer/package.json)
echo ::set-output name=GITVERSION::$(jq -r .version ./indexer/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Publish Indexer
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.indexer
file: ./indexer/Dockerfile
push: true
tags: ethereumoptimism/indexer:${{ needs.release.outputs.indexer }},ethereumoptimism/indexer:latest
build-args: |
Expand Down Expand Up @@ -532,14 +532,14 @@ jobs:
id: build_args
run: |
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
echo ::set-output name=GITVERSION::$(jq -r .version ./go/teleportr/package.json)
echo ::set-output name=GITVERSION::$(jq -r .version ./teleportr/package.json)
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
- name: Publish Teleportr
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.teleportr
file: ./teleportr/Dockerfile
push: true
tags: ethereumoptimism/teleportr:${{ needs.release.outputs.teleportr }},ethereumoptimism/teleportr:latest
build-args: |
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ root
│ ├── <a href="./packages/message-relayer">message-relayer</a>: Tool for automatically relaying L1<>L2 messages in development
│ └── <a href="./packages/replica-healthcheck">replica-healthcheck</a>: Service for monitoring the health of a replica node
├── <a href="./go">go</a>
│ ├── <a href="./go/batch-submitter">batch-submitter</a>: Service for submitting batches of transactions and results to L1
│ ├── <a href="./go/bss-core">bss-core</a>: Core batch-submitter logic and utilities
│ ├── <a href="./go/gas-oracle">gas-oracle</a>: Service for updating L1 gas prices on L2
│ └── <a href="./go/proxyd">proxyd</a>: Configurable RPC request router and proxy
│ ├── <a href="./batch-submitter">batch-submitter</a>: Service for submitting batches of transactions and results to L1
│ ├── <a href="./bss-core">bss-core</a>: Core batch-submitter logic and utilities
│ ├── <a href="./gas-oracle">gas-oracle</a>: Service for updating L1 gas prices on L2
│ └── <a href="./proxyd">proxyd</a>: Configurable RPC request router and proxy
├── <a href="./l2geth">l2geth</a>: Optimism client software, a fork of <a href="https://github.com/ethereum/go-ethereum/tree/v1.9.10">geth v1.9.10</a>
├── <a href="./integration-tests">integration-tests</a>: Various integration tests for the Optimism network
└── <a href="./ops">ops</a>: Tools for running Optimism nodes and networks
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ FROM golang:1.18.0-alpine3.15 as builder

RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash

COPY ./l2geth /l2geth
COPY ./go/bss-core /go/bss-core
COPY ./go/batch-submitter/go.mod ./go/batch-submitter/go.sum /go/batch-submitter/
COPY ./batch-submitter /go/batch-submitter
COPY ./bss-core /go/bss-core
COPY ./l2geth /go/l2geth
COPY ./batch-submitter/docker.go.work /go/go.work

WORKDIR /go/batch-submitter
RUN go mod graph | grep -v l2geth | grep -v bss-core | awk '{if ($1 !~ "@") print $2}' | xargs -n 1 go get
COPY ./go/batch-submitter/ ./
RUN make

FROM alpine:3.15
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"os"
"time"

"github.com/ethereum-optimism/optimism/go/batch-submitter/drivers/proposer"
"github.com/ethereum-optimism/optimism/go/batch-submitter/drivers/sequencer"
bsscore "github.com/ethereum-optimism/optimism/go/bss-core"
"github.com/ethereum-optimism/optimism/go/bss-core/dial"
"github.com/ethereum-optimism/optimism/go/bss-core/metrics"
"github.com/ethereum-optimism/optimism/go/bss-core/txmgr"
"github.com/ethereum-optimism/optimism/batch-submitter/drivers/proposer"
"github.com/ethereum-optimism/optimism/batch-submitter/drivers/sequencer"
bsscore "github.com/ethereum-optimism/optimism/bss-core"
"github.com/ethereum-optimism/optimism/bss-core/dial"
"github.com/ethereum-optimism/optimism/bss-core/metrics"
"github.com/ethereum-optimism/optimism/bss-core/txmgr"
"github.com/ethereum/go-ethereum/log"
"github.com/getsentry/sentry-go"
"github.com/urfave/cli"
Expand Down
Loading

0 comments on commit 5d309e6

Please sign in to comment.