Skip to content

Commit 5d309e6

Browse files
maint: Move Go packages into root of repo, adopt go.work (ethereum-optimism#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>
1 parent 412688d commit 5d309e6

File tree

325 files changed

+282
-6333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

325 files changed

+282
-6333
lines changed

.circleci/config.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ jobs:
199199
- run:
200200
name: Lint
201201
command: golangci-lint run -E goimports -E sqlclosecheck -E bodyclose -E asciicheck ./...
202-
working_directory: go/bss-core
202+
working_directory: bss-core
203203
- run:
204204
name: Test
205205
command: |
206206
mkdir -p /test-results
207207
gotestsum --junitfile /test-results/tests.xml
208-
working_directory: go/bss-core
208+
working_directory: bss-core
209209
- store_test_results:
210210
path: /test-results
211211

@@ -313,26 +313,26 @@ workflows:
313313
- go-lint-test-build:
314314
name: batch-submitter-tests
315315
binary_name: batch-submitter
316-
working_directory: go/batch-submitter
316+
working_directory: batch-submitter
317317
- go-lint-test-build:
318318
name: proxyd-tests
319319
binary_name: proxyd
320-
working_directory: go/proxyd
320+
working_directory: proxyd
321321
- go-lint-test-build:
322322
name: teleportr-tests
323323
binary_name: teleportr
324-
working_directory: go/teleportr
324+
working_directory: teleportr
325325
- go-lint-test-build:
326326
name: gas-oracle-tests
327327
binary_name: gas-oracle
328-
working_directory: go/gas-oracle
328+
working_directory: gas-oracle
329329
- go-lint-test-build:
330330
name: indexer-tests
331331
binary_name: indexer
332-
working_directory: go/indexer
332+
working_directory: indexer
333333
- go-lint-test:
334334
name: bss-core-tests
335-
working_directory: go/bss-core
335+
working_directory: bss-core
336336
- contracts-tests:
337337
requires:
338338
- yarn-monorepo
@@ -379,14 +379,14 @@ workflows:
379379
- yarn-monorepo
380380
- docker-publish:
381381
name: l2geth-release
382-
docker_file: ops/docker/Dockerfile.geth
382+
docker_file: l2geth/Dockerfile
383383
docker_tags: ethereumoptimism/l2geth:nightly
384384
docker_context: .
385385
context:
386386
- optimism
387387
- docker-publish:
388388
name: gas-oracle-release
389-
docker_file: ops/docker/Dockerfile.gas-oracle
389+
docker_file: gas-oracle/Dockerfile
390390
docker_tags: ethereumoptimism/gas-oracle:nightly
391391
docker_context: .
392392
context:
@@ -414,21 +414,21 @@ workflows:
414414
- optimism
415415
- docker-publish:
416416
name: proxyd-release
417-
docker_file: go/proxyd/Dockerfile
417+
docker_file: proxyd/Dockerfile
418418
docker_tags: ethereumoptimism/proxyd:nightly
419419
docker_context: .
420420
context:
421421
- optimism
422422
- docker-publish:
423423
name: l2geth-exporter-release
424-
docker_file: ops/docker/Dockerfile.l2geth-exporter
424+
docker_file: l2geth-exporter/Dockerfile
425425
docker_tags: ethereumoptimism/l2geth-exporter:nightly
426426
docker_context: .
427427
context:
428428
- optimism
429429
- docker-publish:
430430
name: op-exporter-release
431-
docker_file: ops/docker/Dockerfile.op-exporter
431+
docker_file: op-exporter/Dockerfile
432432
docker_tags: ethereumoptimism/op-exporter:nightly
433433
docker_context: .
434434
context:
@@ -467,21 +467,21 @@ workflows:
467467
- optimism
468468
- docker-publish:
469469
name: batch-submitter-service-release
470-
docker_file: ops/docker/Dockerfile.batch-submitter-service
470+
docker_file: ops/docker/Dockerfile
471471
docker_tags: ethereumoptimism/batch-submitter-service:nightly
472472
docker_context: .
473473
context:
474474
- optimism
475475
- docker-publish:
476476
name: indexer-release
477-
docker_file: ops/docker/Dockerfile.indexer
477+
docker_file: indexer/Dockerfile
478478
docker_tags: ethereumoptimism/indexer:nightly
479479
docker_context: .
480480
context:
481481
- optimism
482482
- docker-publish:
483483
name: teleportr-release
484-
docker_file: ops/docker/Dockerfile.teleportr
484+
docker_file: teleportr/Dockerfile
485485
docker_tags: ethereumoptimism/teleportr:nightly
486486
docker_context: .
487487
context:

.github/workflows/publish-canary.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
uses: docker/build-push-action@v2
114114
with:
115115
context: .
116-
file: ./ops/docker/Dockerfile.geth
116+
file: ./l2geth/Dockerfile
117117
push: true
118118
tags: ethereumoptimism/l2geth:${{ needs.canary-publish.outputs.canary-docker-tag }}
119119

@@ -139,7 +139,7 @@ jobs:
139139
uses: docker/build-push-action@v2
140140
with:
141141
context: .
142-
file: ./ops/docker/Dockerfile.gas-oracle
142+
file: ./gas-oracle/Dockerfile
143143
push: true
144144
tags: ethereumoptimism/gas-oracle:${{ needs.canary-publish.outputs.canary-docker-tag }}
145145

@@ -326,14 +326,14 @@ jobs:
326326
id: build_args
327327
run: |
328328
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
329-
echo ::set-output name=GITVERSION::$(jq -r .version ./go/proxyd/package.json)
329+
echo ::set-output name=GITVERSION::$(jq -r .version ./proxyd/package.json)
330330
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
331331
332332
- name: Build and push
333333
uses: docker/build-push-action@v2
334334
with:
335335
context: .
336-
file: ./go/proxyd/Dockerfile
336+
file: ./proxyd/Dockerfile
337337
push: true
338338
tags: ethereumoptimism/proxyd:${{ needs.canary-publish.outputs.proxyd }}
339339
build-args: |
@@ -363,14 +363,14 @@ jobs:
363363
id: build_args
364364
run: |
365365
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
366-
echo ::set-output name=GITVERSION::$(jq -r .version ./go/op-exporter/package.json)
366+
echo ::set-output name=GITVERSION::$(jq -r .version ./op-exporter/package.json)
367367
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
368368
369369
- name: Build and push
370370
uses: docker/build-push-action@v2
371371
with:
372372
context: .
373-
file: ./ops/docker/Dockerfile.op-exporter
373+
file: ./op-exporter/Dockerfile=
374374
push: true
375375
tags: ethereumoptimism/op-exporter:${{ needs.canary-publish.outputs.op-exporter }}
376376
build-args: |
@@ -400,14 +400,14 @@ jobs:
400400
id: build_args
401401
run: |
402402
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
403-
echo ::set-output name=GITVERSION::$(jq -r .version ./go/l2geth-exporter/package.json)
403+
echo ::set-output name=GITVERSION::$(jq -r .version ./l2geth-exporter/package.json)
404404
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
405405
406406
- name: Build and push
407407
uses: docker/build-push-action@v2
408408
with:
409409
context: .
410-
file: ./ops/docker/Dockerfile.l2geth-exporter
410+
file: ./l2geth-exporter/Dockerfile
411411
push: true
412412
tags: ethereumoptimism/l2geth-exporter:${{ needs.canary-publish.outputs.l2geth-exporter }}
413413
build-args: |
@@ -437,7 +437,7 @@ jobs:
437437
uses: docker/build-push-action@v2
438438
with:
439439
context: .
440-
file: ./ops/docker/Dockerfile.batch-submitter-service
440+
file: ./batch-submitter/Dockerfile
441441
push: true
442442
tags: ethereumoptimism/batch-submitter-service:${{ needs.canary-publish.outputs.batch-submitter-service }}
443443

@@ -463,14 +463,14 @@ jobs:
463463
id: build_args
464464
run: |
465465
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
466-
echo ::set-output name=GITVERSION::$(jq -r .version ./go/indexer/package.json)
466+
echo ::set-output name=GITVERSION::$(jq -r .version ./indexer/package.json)
467467
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
468468
469469
- name: Build and push
470470
uses: docker/build-push-action@v2
471471
with:
472472
context: .
473-
file: ./ops/docker/Dockerfile.indexer
473+
file: ./indexer/Dockerfile
474474
push: true
475475
tags: ethereumoptimism/indexer:${{ needs.canary-publish.outputs.indexer }}
476476
build-args: |
@@ -500,14 +500,14 @@ jobs:
500500
id: build_args
501501
run: |
502502
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
503-
echo ::set-output name=GITVERSION::$(jq -r .version ./go/teleportr/package.json)
503+
echo ::set-output name=GITVERSION::$(jq -r .version ./teleportr/package.json)
504504
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
505505
506506
- name: Build and push
507507
uses: docker/build-push-action@v2
508508
with:
509509
context: .
510-
file: ./ops/docker/Dockerfile.teleportr
510+
file: ./teleportr/Dockerfile
511511
push: true
512512
tags: ethereumoptimism/teleportr:${{ needs.canary-publish.outputs.teleportr }}
513513
build-args: |

.github/workflows/release.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
uses: docker/build-push-action@v2
9494
with:
9595
context: .
96-
file: ./ops/docker/Dockerfile.geth
96+
file: ./ops/docker/Dockerfile
9797
push: true
9898
tags: ethereumoptimism/l2geth:${{ needs.release.outputs.l2geth }},ethereumoptimism/l2geth:latest
9999

@@ -119,7 +119,7 @@ jobs:
119119
uses: docker/build-push-action@v2
120120
with:
121121
context: .
122-
file: ./ops/docker/Dockerfile.gas-oracle
122+
file: ./gas-oracle/Dockerfile
123123
push: true
124124
tags: ethereumoptimism/gas-oracle:${{ needs.release.outputs.gas-oracle }},ethereumoptimism/gas-oracle:latest
125125

@@ -223,14 +223,14 @@ jobs:
223223
id: build_args
224224
run: |
225225
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
226-
echo ::set-output name=GITVERSION::$(jq -r .version ./go/proxyd/package.json)
226+
echo ::set-output name=GITVERSION::$(jq -r .version ./proxyd/package.json)
227227
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
228228
229229
- name: Build and push
230230
uses: docker/build-push-action@v2
231231
with:
232232
context: .
233-
file: ./go/proxyd/Dockerfile
233+
file: ./proxyd/Dockerfile
234234
push: true
235235
tags: ethereumoptimism/proxyd:${{ needs.release.outputs.proxyd }},ethereumoptimism/proxyd:latest
236236
build-args: |
@@ -260,14 +260,14 @@ jobs:
260260
id: build_args
261261
run: |
262262
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
263-
echo ::set-output name=GITVERSION::$(jq -r .version ./go/l2geth-exporter/package.json)
263+
echo ::set-output name=GITVERSION::$(jq -r .version ./l2geth-exporter/package.json)
264264
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
265265
266266
- name: Build and push
267267
uses: docker/build-push-action@v2
268268
with:
269269
context: .
270-
file: ./ops/docker/Dockerfile.l2geth-exporter
270+
file: ./l2geth-exporter/Dockerfile
271271
push: true
272272
tags: ethereumoptimism/l2geth-exporter:${{ needs.release.outputs.l2geth-exporter }},ethereumoptimism/l2geth-exporter:latest
273273
build-args: |
@@ -297,14 +297,14 @@ jobs:
297297
id: build_args
298298
run: |
299299
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
300-
echo ::set-output name=GITVERSION::$(jq -r .version ./go/op-exporter/package.json)
300+
echo ::set-output name=GITVERSION::$(jq -r .version ./op-exporter/package.json)
301301
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
302302
303303
- name: Build and push
304304
uses: docker/build-push-action@v2
305305
with:
306306
context: .
307-
file: ./ops/docker/Dockerfile.op-exporter
307+
file: ./op-exporter/Dockerfile
308308
push: true
309309
tags: ethereumoptimism/op-exporter:${{ needs.release.outputs.op-exporter }},ethereumoptimism/op-exporter:latest
310310
build-args: |
@@ -469,7 +469,7 @@ jobs:
469469
uses: docker/build-push-action@v2
470470
with:
471471
context: .
472-
file: ./ops/docker/Dockerfile.batch-submitter-service
472+
file: ./batch-submitter/Dockerfile
473473
push: true
474474
tags: ethereumoptimism/batch-submitter-service:${{ needs.release.outputs.batch-submitter-service }},ethereumoptimism/batch-submitter-service:latest
475475

@@ -495,14 +495,14 @@ jobs:
495495
id: build_args
496496
run: |
497497
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
498-
echo ::set-output name=GITVERSION::$(jq -r .version ./go/indexer/package.json)
498+
echo ::set-output name=GITVERSION::$(jq -r .version ./indexer/package.json)
499499
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
500500
501501
- name: Publish Indexer
502502
uses: docker/build-push-action@v2
503503
with:
504504
context: .
505-
file: ./ops/docker/Dockerfile.indexer
505+
file: ./indexer/Dockerfile
506506
push: true
507507
tags: ethereumoptimism/indexer:${{ needs.release.outputs.indexer }},ethereumoptimism/indexer:latest
508508
build-args: |
@@ -532,14 +532,14 @@ jobs:
532532
id: build_args
533533
run: |
534534
echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)"
535-
echo ::set-output name=GITVERSION::$(jq -r .version ./go/teleportr/package.json)
535+
echo ::set-output name=GITVERSION::$(jq -r .version ./teleportr/package.json)
536536
echo ::set-output name=GITCOMMIT::"$GITHUB_SHA"
537537
538538
- name: Publish Teleportr
539539
uses: docker/build-push-action@v2
540540
with:
541541
context: .
542-
file: ./ops/docker/Dockerfile.teleportr
542+
file: ./teleportr/Dockerfile
543543
push: true
544544
tags: ethereumoptimism/teleportr:${{ needs.release.outputs.teleportr }},ethereumoptimism/teleportr:latest
545545
build-args: |

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ root
3838
│ ├── <a href="./packages/message-relayer">message-relayer</a>: Tool for automatically relaying L1<>L2 messages in development
3939
│ └── <a href="./packages/replica-healthcheck">replica-healthcheck</a>: Service for monitoring the health of a replica node
4040
├── <a href="./go">go</a>
41-
│ ├── <a href="./go/batch-submitter">batch-submitter</a>: Service for submitting batches of transactions and results to L1
42-
│ ├── <a href="./go/bss-core">bss-core</a>: Core batch-submitter logic and utilities
43-
│ ├── <a href="./go/gas-oracle">gas-oracle</a>: Service for updating L1 gas prices on L2
44-
│ └── <a href="./go/proxyd">proxyd</a>: Configurable RPC request router and proxy
41+
│ ├── <a href="./batch-submitter">batch-submitter</a>: Service for submitting batches of transactions and results to L1
42+
│ ├── <a href="./bss-core">bss-core</a>: Core batch-submitter logic and utilities
43+
│ ├── <a href="./gas-oracle">gas-oracle</a>: Service for updating L1 gas prices on L2
44+
│ └── <a href="./proxyd">proxyd</a>: Configurable RPC request router and proxy
4545
├── <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>
4646
├── <a href="./integration-tests">integration-tests</a>: Various integration tests for the Optimism network
4747
└── <a href="./ops">ops</a>: Tools for running Optimism nodes and networks
File renamed without changes.
File renamed without changes.

ops/docker/Dockerfile.batch-submitter-service renamed to batch-submitter/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ FROM golang:1.18.0-alpine3.15 as builder
22

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

5-
COPY ./l2geth /l2geth
6-
COPY ./go/bss-core /go/bss-core
7-
COPY ./go/batch-submitter/go.mod ./go/batch-submitter/go.sum /go/batch-submitter/
5+
COPY ./batch-submitter /go/batch-submitter
6+
COPY ./bss-core /go/bss-core
7+
COPY ./l2geth /go/l2geth
8+
COPY ./batch-submitter/docker.go.work /go/go.work
9+
810
WORKDIR /go/batch-submitter
9-
RUN go mod graph | grep -v l2geth | grep -v bss-core | awk '{if ($1 !~ "@") print $2}' | xargs -n 1 go get
10-
COPY ./go/batch-submitter/ ./
1111
RUN make
1212

1313
FROM alpine:3.15
File renamed without changes.

go/batch-submitter/batch_submitter.go renamed to batch-submitter/batch_submitter.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import (
55
"os"
66
"time"
77

8-
"github.com/ethereum-optimism/optimism/go/batch-submitter/drivers/proposer"
9-
"github.com/ethereum-optimism/optimism/go/batch-submitter/drivers/sequencer"
10-
bsscore "github.com/ethereum-optimism/optimism/go/bss-core"
11-
"github.com/ethereum-optimism/optimism/go/bss-core/dial"
12-
"github.com/ethereum-optimism/optimism/go/bss-core/metrics"
13-
"github.com/ethereum-optimism/optimism/go/bss-core/txmgr"
8+
"github.com/ethereum-optimism/optimism/batch-submitter/drivers/proposer"
9+
"github.com/ethereum-optimism/optimism/batch-submitter/drivers/sequencer"
10+
bsscore "github.com/ethereum-optimism/optimism/bss-core"
11+
"github.com/ethereum-optimism/optimism/bss-core/dial"
12+
"github.com/ethereum-optimism/optimism/bss-core/metrics"
13+
"github.com/ethereum-optimism/optimism/bss-core/txmgr"
1414
"github.com/ethereum/go-ethereum/log"
1515
"github.com/getsentry/sentry-go"
1616
"github.com/urfave/cli"

0 commit comments

Comments
 (0)