Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
e02310c0
Unverified
Commit
e02310c0
authored
Oct 17, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ops: golang ci improvements
parent
7591f192
Changes
36
Show whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
588 additions
and
396 deletions
+588
-396
config.yml
.circleci/config.yml
+333
-124
Makefile
Makefile
+19
-1
__init__.py
bedrock-devnet/devnet/__init__.py
+3
-1
Makefile
cannon/Makefile
+2
-5
Makefile
endpoint-monitor/Makefile
+2
-2
Dockerfile
op-batcher/Dockerfile
+5
-28
Dockerfile.dockerignore
op-batcher/Dockerfile.dockerignore
+2
-0
Makefile
op-batcher/Makefile
+2
-6
Makefile
op-bindings/Makefile
+0
-3
Makefile
op-bootnode/Makefile
+3
-7
Makefile
op-chain-ops/Makefile
+0
-3
Dockerfile
op-challenger/Dockerfile
+6
-45
Dockerfile.dockerignore
op-challenger/Dockerfile.dockerignore
+2
-0
Makefile
op-challenger/Makefile
+2
-5
Makefile
op-e2e/Makefile
+0
-4
Dockerfile
op-heartbeat/Dockerfile
+4
-17
Dockerfile.dockerignore
op-heartbeat/Dockerfile.dockerignore
+2
-0
Makefile
op-heartbeat/Makefile
+2
-5
Dockerfile
op-node/Dockerfile
+4
-26
Dockerfile.dockerignore
op-node/Dockerfile.dockerignore
+2
-0
Makefile
op-node/Makefile
+2
-5
filepoller_test.go
op-preimage/filepoller_test.go
+6
-6
Dockerfile
op-program/Dockerfile
+4
-28
Dockerfile.dockerignore
op-program/Dockerfile.dockerignore
+2
-0
Makefile
op-program/Makefile
+2
-5
Dockerfile
op-proposer/Dockerfile
+4
-26
Dockerfile.dockerignore
op-proposer/Dockerfile.dockerignore
+2
-0
Makefile
op-proposer/Makefile
+2
-5
Makefile
op-service/Makefile
+0
-3
Dockerfile
op-wheel/Dockerfile
+4
-17
Dockerfile.dockerignore
op-wheel/Dockerfile.dockerignore
+2
-0
Makefile
op-wheel/Makefile
+2
-6
docker-compose.yml
ops-bedrock/docker-compose.yml
+35
-13
Dockerfile
ops/docker/op-stack-go/Dockerfile
+84
-0
Dockerfile.dockerignore
ops/docker/op-stack-go/Dockerfile.dockerignore
+19
-0
geth-version-checker.sh
ops/scripts/geth-version-checker.sh
+23
-0
No files found.
.circleci/config.yml
View file @
e02310c0
...
@@ -168,13 +168,42 @@ jobs:
...
@@ -168,13 +168,42 @@ jobs:
description
:
Docker repo
description
:
Docker repo
type
:
string
type
:
string
default
:
"
oplabs-tools-artifacts/images"
default
:
"
oplabs-tools-artifacts/images"
build_args
:
description
:
Docker build args
type
:
string
default
:
"
"
load_base_image
:
description
:
Load docker image as base
type
:
string
default
:
"
"
save_image_tag
:
description
:
Save docker image as
type
:
string
default
:
"
"
machine
:
machine
:
image
:
ubuntu-2204:2022.07.1
image
:
ubuntu-2204:2022.07.1
resource_class
:
medium
resource_class
:
medium
docker_layer_caching
:
true
steps
:
steps
:
-
checkout
-
checkout
-
restore_cache
:
name
:
Restore docker build cache
key
:
docker-build-cache
-
attach_workspace
:
at
:
/tmp/docker_images
-
run
:
-
run
:
command
:
mkdir -p /tmp/docker_images
command
:
mkdir -p /tmp/docker_images
-
when
:
condition
:
"
<<parameters.load_base_image>>"
steps
:
-
run
:
name
:
Load OP-Stack Go base image
command
:
|
docker load < "/tmp/docker_images/<<parameters.load_base_image>>.tar"
-
run
:
name
:
build args
command
:
|
echo "build args: <<parameters.build_args>>"
-
run
:
-
run
:
name
:
Build
name
:
Build
command
:
|
command
:
|
...
@@ -185,20 +214,30 @@ jobs:
...
@@ -185,20 +214,30 @@ jobs:
fi
fi
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
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_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|")
IMAGE_BASE_PREFIX="<<parameters.registry>>/<<parameters.repo>>"
IMAGE_BASE="$IMAGE_BASE_PREFIX/<<parameters.docker_name>>"
docker build --progress plain \
docker build --progress plain \
<<parameters.build_args>> \
$(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
$(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
-f <<parameters.docker_file>> \
-f <<parameters.docker_file>> \
<<parameters.docker_context>>
<<parameters.docker_context>>
-
when
:
condition
:
"
<<parameters.save_image_tag>>"
steps
:
-
run
:
-
run
:
name
:
Save
name
:
Save
command
:
|
command
:
|
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
IMAGE_NAME="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>:<<parameters.save_image_tag>>"
DOCKER_LABELS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g")
docker save -o /tmp/docker_images/<<parameters.docker_name>>.tar $IMAGE_NAME
echo -ne $DOCKER_LABELS | tr ' ' '\n' | xargs -I {} docker save -o /tmp/docker_images/<<parameters.docker_name>>_{}.tar $IMAGE_BASE:{}
-
persist_to_workspace
:
-
persist_to_workspace
:
root
:
/tmp/docker_images
root
:
/tmp/docker_images
paths
:
# only write the one file, to avoid concurrent workspace-file additions
-
"
<<parameters.docker_name>>.tar"
-
save_cache
:
name
:
Save docker build cache
key
:
docker-build-cache
paths
:
paths
:
-
"
.
"
-
"
/tmp/docker-build-cache
"
docker-publish
:
docker-publish
:
environment
:
environment
:
...
@@ -417,8 +456,8 @@ jobs:
...
@@ -417,8 +456,8 @@ jobs:
git diff --exit-code ./invariant-docs/*.md || echo "export INVARIANT_DOCS_STATUS=1" >> "$BASH_ENV"
git diff --exit-code ./invariant-docs/*.md || echo "export INVARIANT_DOCS_STATUS=1" >> "$BASH_ENV"
working_directory
:
packages/contracts-bedrock
working_directory
:
packages/contracts-bedrock
-
run
:
-
run
:
name
:
check deploy configs
|| echo "export DEPLOY_CONFIGS_STATUS=1" >> "$BASH_ENV"
name
:
check deploy configs
command
:
pnpm validate-deploy-configs
command
:
pnpm validate-deploy-configs
|| echo "export DEPLOY_CONFIGS_STATUS=1" >> "$BASH_ENV"
working_directory
:
packages/contracts-bedrock
working_directory
:
packages/contracts-bedrock
-
run
:
-
run
:
name
:
check statuses
name
:
check statuses
...
@@ -675,53 +714,34 @@ jobs:
...
@@ -675,53 +714,34 @@ jobs:
event
:
fail
event
:
fail
template
:
basic_fail_1
template
:
basic_fail_1
fuzz-op-node
:
fuzz-golang
:
docker
:
parameters
:
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
package_name
:
steps
:
description
:
Go package name
-
checkout
type
:
string
-
check-changed
:
on_changes
:
patterns
:
op-node
description
:
changed pattern to fire fuzzer on
-
run
:
type
:
string
name
:
Fuzz
command
:
make fuzz
working_directory
:
op-node
fuzz-op-service
:
docker
:
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
steps
:
-
checkout
-
check-changed
:
patterns
:
op-service
-
run
:
name
:
Fuzz
command
:
make fuzz
working_directory
:
op-service
fuzz-op-chain-ops
:
docker
:
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
steps
:
-
checkout
-
check-changed
:
patterns
:
op-chain-ops,op-bindings
-
run
:
name
:
Fuzz
command
:
make fuzz
working_directory
:
op-chain-ops
fuzz-cannon
:
docker
:
docker
:
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
steps
:
steps
:
-
checkout
-
checkout
-
check-changed
:
-
check-changed
:
patterns
:
cannon,packages/contracts-bedrock/src/cannon
patterns
:
"
<<parameters.package_name>>"
-
restore_cache
:
name
:
Restore Go modules cache
key
:
gomod-{{ checksum "go.sum" }}
-
restore_cache
:
name
:
Restore Go build cache
key
:
golang-build-cache
-
run
:
-
run
:
name
:
Fuzz
name
:
Fuzz
command
:
make fuzz
command
:
make fuzz
working_directory
:
cannon
working_directory
:
"
<<parameters.package_name>>"
-
save_cache
:
key
:
golang-build-cache
paths
:
-
"
/root/.cache/go-build"
depcheck
:
depcheck
:
docker
:
docker
:
...
@@ -748,19 +768,42 @@ jobs:
...
@@ -748,19 +768,42 @@ jobs:
command
:
npx depcheck
command
:
npx depcheck
working_directory
:
packages/sdk
working_directory
:
packages/sdk
l1-geth-version-check
:
docker
:
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
steps
:
-
checkout
-
run
:
name
:
"
Check
L1
geth
version"
command
:
./ops/scripts/geth-version-checker.sh || (echo "geth version is wrong, update ci-builder";
false
)
go-lint
:
go-lint
:
parameters
:
module
:
description
:
Go Module Name
type
:
string
docker
:
docker
:
-
image
:
cimg/go:1.21
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
steps
:
steps
:
-
checkout
-
checkout
-
restore_cache
:
name
:
Restore Go modules cache
key
:
gomod-{{ checksum "go.sum" }}
-
restore_cache
:
key
:
golang-build-cache
-
restore_cache
:
key
:
golang-lint-cache
-
run
:
-
run
:
name
:
run lint
name
:
run Go linter
command
:
make lint
command
:
|
working_directory
:
<<parameters.module>>
# Identify how many cores it defaults to
golangci-lint --help | grep concurrency
make lint-go
working_directory
:
.
-
save_cache
:
key
:
golang-build-cache
paths
:
-
"
/root/.cache/go-build"
-
save_cache
:
key
:
golang-lint-cache
paths
:
-
"
/root/.cache/golangci-lint"
go-test
:
go-test
:
parameters
:
parameters
:
...
@@ -772,6 +815,13 @@ jobs:
...
@@ -772,6 +815,13 @@ jobs:
resource_class
:
xlarge
resource_class
:
xlarge
steps
:
steps
:
-
checkout
-
checkout
-
restore_cache
:
name
:
Restore Go modules cache
key
:
gomod-{{ checksum "go.sum" }}
-
restore_cache
:
keys
:
-
golang-build-cache-<<parameters.module>>
-
golang-build-cache-
-
run
:
-
run
:
name
:
prep results dir
name
:
prep results dir
command
:
mkdir -p /tmp/test-results
command
:
mkdir -p /tmp/test-results
...
@@ -781,6 +831,10 @@ jobs:
...
@@ -781,6 +831,10 @@ jobs:
gotestsum --format=standard-verbose --junitfile=/tmp/test-results/<<parameters.module>>.xml \
gotestsum --format=standard-verbose --junitfile=/tmp/test-results/<<parameters.module>>.xml \
-- -parallel=8 -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out ./...
-- -parallel=8 -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out ./...
working_directory
:
<<parameters.module>>
working_directory
:
<<parameters.module>>
-
save_cache
:
key
:
golang-build-cache-<<parameters.module>>
paths
:
-
"
/root/.cache/go-build"
-
run
:
-
run
:
name
:
upload coverage
name
:
upload coverage
command
:
codecov --verbose --clean --flags bedrock-go-tests
command
:
codecov --verbose --clean --flags bedrock-go-tests
...
@@ -805,12 +859,16 @@ jobs:
...
@@ -805,12 +859,16 @@ jobs:
-
run
:
-
run
:
name
:
prep results dir
name
:
prep results dir
command
:
mkdir -p /tmp/test-results
command
:
mkdir -p /tmp/test-results
-
attach_workspace
:
at
:
/tmp/workspace
-
run
:
-
run
:
name
:
install geth
name
:
Load devnet-allocs
command
:
make install-geth
command
:
|
-
run
:
mkdir -p .devnet
name
:
git submodules
cp /tmp/workspace/.devnet/allocs-l1.json .devnet/allocs-l1.json
command
:
git submodule update --init --recursive
cp /tmp/workspace/.devnet/addresses.json .devnet/addresses.json
cp /tmp/workspace/packages/contracts-bedrock/deploy-config/devnetL1.json packages/contracts-bedrock/deploy-config/devnetL1.json
cp -r /tmp/workspace/packages/contracts-bedrock/deployments/devnetL1 packages/contracts-bedrock/deployments/devnetL1
-
run
:
-
run
:
name
:
print go's available MIPS targets
name
:
print go's available MIPS targets
command
:
go tool dist list | grep mips
command
:
go tool dist list | grep mips
...
@@ -880,9 +938,6 @@ jobs:
...
@@ -880,9 +938,6 @@ jobs:
name
:
Lint
name
:
Lint
command
:
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 4m -e "errors.As" -e "errors.Is" ./...
command
:
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 4m -e "errors.As" -e "errors.Is" ./...
working_directory
:
indexer
working_directory
:
indexer
-
run
:
name
:
install geth
command
:
make install-geth
-
run
:
-
run
:
name
:
git submodules
name
:
git submodules
command
:
git submodule update --init --recursive
command
:
git submodule update --init --recursive
...
@@ -917,6 +972,60 @@ jobs:
...
@@ -917,6 +972,60 @@ jobs:
command
:
npm run generate && git diff --exit-code
command
:
npm run generate && git diff --exit-code
working_directory
:
indexer/api-ts
working_directory
:
indexer/api-ts
cannon-prestate
:
docker
:
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
steps
:
-
checkout
-
restore_cache
:
name
:
Restore Go modules cache
key
:
gomod-{{ checksum "go.sum" }}
-
restore_cache
:
key
:
golang-build-cache
-
restore_cache
:
key
:
cannon-prestate-{{ checksum "./cannon/bin/cannon" }}-{{ checksum "op-program/bin/op-program-client.elf" }}
name
:
Load cannon prestate cache
-
run
:
name
:
generate cannon prestate
command
:
make cannon-prestate
-
save_cache
:
key
:
cannon-prestate-{{ checksum "./cannon/bin/cannon" }}-{{ checksum "op-program/bin/op-program-client.elf" }}
name
:
Save Cannon prestate to cache
paths
:
-
"
op-program/bin/prestate.json"
-
"
op-program/bin/meta.json"
-
"
op-program/bin/prestate-proof.json"
-
persist_to_workspace
:
root
:
.
paths
:
-
"
op-program/bin/prestate.json"
-
"
op-program/bin/meta.json"
-
"
op-program/bin/prestate-proof.json"
devnet-allocs
:
docker
:
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
steps
:
-
checkout
-
restore_cache
:
name
:
Restore Go modules cache
key
:
gomod-{{ checksum "go.sum" }}
-
restore_cache
:
key
:
golang-build-cache
-
run
:
name
:
git submodules
command
:
git submodule update --init --recursive
-
run
:
name
:
generate devnet allocs
command
:
make devnet-allocs
-
persist_to_workspace
:
root
:
.
paths
:
-
"
.devnet/allocs-l1.json"
-
"
.devnet/addresses.json"
-
"
packages/contracts-bedrock/deploy-config/devnetL1.json"
-
"
packages/contracts-bedrock/deployments/devnetL1"
devnet
:
devnet
:
machine
:
machine
:
image
:
ubuntu-2204:2022.10.2
image
:
ubuntu-2204:2022.10.2
...
@@ -968,9 +1077,37 @@ jobs:
...
@@ -968,9 +1077,37 @@ jobs:
name
:
Install and build
name
:
Install and build
command
:
|
command
:
|
pnpm install --frozen-lockfile --prefer-offline && pnpm build
pnpm install --frozen-lockfile --prefer-offline && pnpm build
-
attach_workspace
:
at
:
/tmp/workspace
-
run
:
-
run
:
name
:
generate cannon prestate
name
:
Load cannon pre-state
command
:
make cannon-prestate
command
:
|
mkdir -p op-program/bin
cp /tmp/workspace/op-program/bin/prestate.json op-program/bin/prestate.json
cp /tmp/workspace/op-program/bin/meta.json op-program/bin/meta.json
cp /tmp/workspace/op-program/bin/prestate-proof.json op-program/bin/prestate-proof.json
-
run
:
name
:
Load devnet-allocs
command
:
|
mkdir -p .devnet
cp /tmp/workspace/.devnet/allocs-l1.json .devnet/allocs-l1.json
cp /tmp/workspace/.devnet/addresses.json .devnet/addresses.json
cp /tmp/workspace/packages/contracts-bedrock/deploy-config/devnetL1.json packages/contracts-bedrock/deploy-config/devnetL1.json
cp -r /tmp/workspace/packages/contracts-bedrock/deployments/devnetL1 packages/contracts-bedrock/deployments/devnetL1
-
run
:
name
:
Load and tag docker images
command
:
|
IMAGE_BASE_PREFIX="us-docker.pkg.dev/oplabs-tools-artifacts/images"
# Load from previous docker-build job
docker load < "/tmp/workspace/op_stack_go.tar"
docker load < "/tmp/workspace/op-node.tar"
docker load < "/tmp/workspace/op-proposer.tar"
docker load < "/tmp/workspace/op-batcher.tar"
# rename to the tags that the docker-compose of the devnet expects
docker tag "$IMAGE_BASE_PREFIX/op_stack_go:<<pipeline.git.revision>>" "$IMAGE_BASE_PREFIX/op_stack_go:devnet"
docker tag "$IMAGE_BASE_PREFIX/op-node:<<pipeline.git.revision>>" "$IMAGE_BASE_PREFIX/op-node:devnet"
docker tag "$IMAGE_BASE_PREFIX/op-proposer:<<pipeline.git.revision>>" "$IMAGE_BASE_PREFIX/op-proposer:devnet"
docker tag "$IMAGE_BASE_PREFIX/op-batcher:<<pipeline.git.revision>>" "$IMAGE_BASE_PREFIX/op-batcher:devnet"
-
run
:
-
run
:
name
:
Bring up the stack
name
:
Bring up the stack
command
:
make devnet-up
command
:
make devnet-up
...
@@ -1054,18 +1191,50 @@ jobs:
...
@@ -1054,18 +1191,50 @@ jobs:
name
:
"
Semgrep
scan"
name
:
"
Semgrep
scan"
command
:
semgrep ci
command
:
semgrep ci
go-mod-download
:
docker
:
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
parameters
:
file
:
default
:
go.sum
description
:
The file name of checksum for restore_cache and save_cache.
type
:
string
key
:
default
:
gomod
description
:
The key of restore_cache and save_cache.
type
:
string
steps
:
-
checkout
-
restore_cache
:
key
:
<< parameters.key >>-{{ checksum "<< parameters.file >>" }}
name
:
Restore Go modules cache
-
run
:
name
:
Sanity check go mod cache path
command
:
test "$(go env GOMODCACHE)" == "/go/pkg/mod"
# yes, it's an odd path
-
run
:
command
:
go mod download
name
:
Download Go module dependencies
-
save_cache
:
key
:
<< parameters.key >>-{{ checksum "<< parameters.file >>" }}
name
:
Save Go modules cache
paths
:
-
"
/go/pkg/mod"
go-mod-tidy
:
go-mod-tidy
:
docker
:
docker
:
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
steps
:
steps
:
-
checkout
-
checkout
-
restore_cache
:
name
:
Restore Go modules cache
key
:
gomod-{{ checksum "go.sum" }}
-
run
:
-
run
:
name
:
"
Go
mod
tidy"
name
:
"
Go
mod
tidy"
command
:
make mod-tidy && git diff --exit-code
command
:
make mod-tidy && git diff --exit-code
bedrock-go-tests
:
bedrock-go-tests
:
# just a helper, that depends on all the actual test jobs
docker
:
docker
:
-
image
:
cimg/go:1.21
-
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest
resource_class
:
medium
resource_class
:
medium
steps
:
steps
:
-
run
:
echo Done
-
run
:
echo Done
...
@@ -1167,110 +1336,111 @@ workflows:
...
@@ -1167,110 +1336,111 @@ workflows:
-
depcheck
:
-
depcheck
:
requires
:
requires
:
-
pnpm-monorepo
-
pnpm-monorepo
-
devnet
-
go-lint-test-build
:
-
go-lint-test-build
:
name
:
proxyd-tests
name
:
proxyd-tests
binary_name
:
proxyd
binary_name
:
proxyd
working_directory
:
proxyd
working_directory
:
proxyd
-
indexer-tests
-
indexer-tests
-
go-lint-test-build
:
-
l1-geth-version-check
name
:
op-heartbeat-tests
binary_name
:
op-heartbeat
working_directory
:
op-heartbeat
-
semgrep-scan
-
semgrep-scan
-
go-mod-tidy
-
go-mod-download
-
fuzz-op-node
-
go-mod-tidy
:
-
fuzz-op-service
requires
:
[
"
go-mod-download"
]
-
fuzz-op-chain-ops
-
devnet-allocs
:
# devnet-allocs uses op-node genesis sub-command
-
fuzz-cannon
requires
:
-
"
go-mod-tidy"
-
l1-geth-version-check
-
bedrock-markdown
-
bedrock-markdown
-
go-lint
:
-
go-lint
:
# we combine most of the go-lint work for two reasons: (1) warm up the Go build cache, (2) reduce sum of lint time
name
:
op-batcher-lint
name
:
op-stack-go-lint
module
:
op-batcher
requires
:
[
"
go-mod-tidy"
]
-
go-lint
:
-
fuzz-golang
:
name
:
op-bootnode-lint
name
:
op-node-fuzz
module
:
op-bootnode
package_name
:
op-node
-
go-lint
:
on_changes
:
op-node
name
:
op-bindings-lint
requires
:
[
"
op-stack-go-lint"
]
module
:
op-bindings
-
fuzz-golang
:
-
go-lint
:
name
:
op-service-fuzz
name
:
op-chain-ops-lint
package_name
:
op-service
module
:
op-chain-ops
on_changes
:
op-service
-
go-lint
:
requires
:
[
"
op-stack-go-lint"
]
name
:
op-e2e-lint
-
fuzz-golang
:
module
:
op-e2e
name
:
op-chain-ops-fuzz
-
go-lint
:
package_name
:
op-chain-ops
name
:
op-node-lint
on_changes
:
op-chain-ops,op-bindings
module
:
op-node
requires
:
[
"
op-stack-go-lint"
]
-
go-lint
:
-
fuzz-golang
:
name
:
op-proposer-lint
name
:
cannon-fuzz
module
:
op-proposer
package_name
:
cannon
-
go-lint
:
on_changes
:
cannon,packages/contracts-bedrock/src/cannon
name
:
op-challenger-lint
requires
:
[
"
op-stack-go-lint"
]
module
:
op-challenger
-
go-test
:
-
go-lint
:
name
:
op-heartbeat-tests
name
:
op-program-lint
module
:
op-heartbeat
module
:
op-program
requires
:
[
"
op-stack-go-lint"
]
-
go-lint
:
name
:
op-service-lint
module
:
op-service
-
go-lint
:
name
:
op-wheel-lint
module
:
op-wheel
-
go-test
:
-
go-test
:
name
:
op-batcher-tests
name
:
op-batcher-tests
module
:
op-batcher
module
:
op-batcher
requires
:
[
"
op-stack-go-lint"
]
-
go-test
:
-
go-test
:
name
:
op-bindings-tests
name
:
op-bindings-tests
module
:
op-bindings
module
:
op-bindings
requires
:
[
"
op-stack-go-lint"
]
-
go-test
:
-
go-test
:
name
:
op-chain-ops-tests
name
:
op-chain-ops-tests
module
:
op-chain-ops
module
:
op-chain-ops
requires
:
[
"
op-stack-go-lint"
]
-
go-test
:
-
go-test
:
name
:
op-node-tests
name
:
op-node-tests
module
:
op-node
module
:
op-node
# TODO: override resource class
requires
:
[
"
op-stack-go-lint"
]
-
go-test
:
-
go-test
:
name
:
op-proposer-tests
name
:
op-proposer-tests
module
:
op-proposer
module
:
op-proposer
requires
:
[
"
op-stack-go-lint"
]
-
go-test
:
-
go-test
:
name
:
op-challenger-tests
name
:
op-challenger-tests
module
:
op-challenger
module
:
op-challenger
requires
:
[
"
op-stack-go-lint"
]
-
go-test
:
-
go-test
:
name
:
op-program-tests
name
:
op-program-tests
module
:
op-program
module
:
op-program
requires
:
[
"
op-stack-go-lint"
]
-
go-test
:
-
go-test
:
name
:
op-service-tests
name
:
op-service-tests
module
:
op-service
module
:
op-service
requires
:
[
"
op-stack-go-lint"
]
-
go-e2e-test
:
-
go-e2e-test
:
name
:
op-e2e-WS-tests
name
:
op-e2e-WS-tests
module
:
op-e2e
module
:
op-e2e
target
:
test-ws
target
:
test-ws
requires
:
-
op-stack-go-lint
-
devnet-allocs
-
go-e2e-test
:
-
go-e2e-test
:
name
:
op-e2e-HTTP-tests
name
:
op-e2e-HTTP-tests
module
:
op-e2e
module
:
op-e2e
target
:
test-http
target
:
test-http
requires
:
-
op-stack-go-lint
-
devnet-allocs
-
go-e2e-test
:
-
go-e2e-test
:
name
:
op-e2e-ext-geth-tests
name
:
op-e2e-ext-geth-tests
module
:
op-e2e
module
:
op-e2e
target
:
test-external-geth
target
:
test-external-geth
requires
:
-
op-stack-go-lint
-
devnet-allocs
-
l1-geth-version-check
-
bedrock-go-tests
:
-
bedrock-go-tests
:
requires
:
requires
:
-
go-mod-download
-
go-mod-tidy
-
go-mod-tidy
-
cannon-build-test-vectors
-
cannon-build-test-vectors
-
cannon-go-lint-and-test
-
cannon-go-lint-and-test
-
check-generated-mocks-op-node
-
check-generated-mocks-op-node
-
check-generated-mocks-op-service
-
check-generated-mocks-op-service
-
op-batcher-lint
-
op-stack-go-lint
-
op-bootnode-lint
-
op-bindings-lint
-
op-chain-ops-lint
-
op-e2e-lint
-
op-node-lint
-
op-proposer-lint
-
op-challenger-lint
-
op-program-lint
-
op-service-lint
-
op-batcher-tests
-
op-batcher-tests
-
op-bindings-tests
-
op-bindings-tests
-
op-chain-ops-tests
-
op-chain-ops-tests
...
@@ -1283,42 +1453,81 @@ workflows:
...
@@ -1283,42 +1453,81 @@ workflows:
-
op-e2e-WS-tests
-
op-e2e-WS-tests
-
op-e2e-HTTP-tests
-
op-e2e-HTTP-tests
-
op-e2e-ext-geth-tests
-
op-e2e-ext-geth-tests
-
docker-build
:
name
:
op-stack-go-docker-build
docker_file
:
ops/docker/op-stack-go/Dockerfile
docker_name
:
op_stack_go
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context
:
.
build_args
:
"
--build-arg
GIT_COMMIT=$(git
rev-parse
HEAD)
--build-arg
GIT_DATE=$(git
show
-s
--format='%ct')"
save_image_tag
:
<<pipeline.git.revision>>
# other images builds below depend on this image, so we save it to the workspace
-
docker-build
:
-
docker-build
:
name
:
op-node-docker-build
name
:
op-node-docker-build
docker_file
:
op-node/Dockerfile
docker_file
:
op-node/Dockerfile
docker_name
:
op-node
docker_name
:
op-node
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
load_base_image
:
"
op_stack_go"
docker_context
:
.
docker_context
:
.
requires
:
[
'
op-stack-go-docker-build'
]
build_args
:
--build-arg OP_STACK_GO_BUILDER="$IMAGE_BASE_PREFIX/op_stack_go:<<pipeline.git.revision>>"
save_image_tag
:
<<pipeline.git.revision>>
# for devnet later
-
docker-build
:
-
docker-build
:
name
:
op-batcher-docker-build
name
:
op-batcher-docker-build
docker_file
:
op-batcher/Dockerfile
docker_file
:
op-batcher/Dockerfile
docker_name
:
op-batcher
docker_name
:
op-batcher
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
load_base_image
:
"
op_stack_go"
docker_context
:
.
docker_context
:
.
requires
:
[
'
op-stack-go-docker-build'
]
build_args
:
--build-arg OP_STACK_GO_BUILDER="$IMAGE_BASE_PREFIX/op_stack_go:<<pipeline.git.revision>>"
save_image_tag
:
<<pipeline.git.revision>>
# for devnet later
-
docker-build
:
-
docker-build
:
name
:
op-program-docker-build
name
:
op-program-docker-build
docker_file
:
op-program/Dockerfile
docker_file
:
op-program/Dockerfile
docker_name
:
op-program
docker_name
:
op-program
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
load_base_image
:
"
op_stack_go"
docker_context
:
.
docker_context
:
.
requires
:
[
'
op-stack-go-docker-build'
]
build_args
:
--build-arg OP_STACK_GO_BUILDER="$IMAGE_BASE_PREFIX/op_stack_go:<<pipeline.git.revision>>"
-
docker-build
:
-
docker-build
:
name
:
op-proposer-docker-build
name
:
op-proposer-docker-build
docker_file
:
op-proposer/Dockerfile
docker_file
:
op-proposer/Dockerfile
docker_name
:
op-proposer
docker_name
:
op-proposer
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
load_base_image
:
"
op_stack_go"
docker_context
:
.
docker_context
:
.
requires
:
[
'
op-stack-go-docker-build'
]
build_args
:
--build-arg OP_STACK_GO_BUILDER="$IMAGE_BASE_PREFIX/op_stack_go:<<pipeline.git.revision>>"
save_image_tag
:
<<pipeline.git.revision>>
# for devnet later
-
docker-build
:
-
docker-build
:
name
:
op-challenger-docker-build
name
:
op-challenger-docker-build
docker_file
:
op-challenger/Dockerfile
docker_file
:
op-challenger/Dockerfile
docker_name
:
op-challenger
docker_name
:
op-challenger
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
load_base_image
:
"
op_stack_go"
docker_context
:
.
docker_context
:
.
requires
:
[
'
op-stack-go-docker-build'
]
build_args
:
--build-arg OP_STACK_GO_BUILDER="$IMAGE_BASE_PREFIX/op_stack_go:<<pipeline.git.revision>>"
-
docker-build
:
-
docker-build
:
name
:
op-heartbeat-docker-build
name
:
op-heartbeat-docker-build
docker_file
:
op-heartbeat/Dockerfile
docker_file
:
op-heartbeat/Dockerfile
docker_name
:
op-heartbeat
docker_name
:
op-heartbeat
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
load_base_image
:
"
op_stack_go"
docker_context
:
.
docker_context
:
.
requires
:
[
'
op-stack-go-docker-build'
]
build_args
:
--build-arg OP_STACK_GO_BUILDER="$IMAGE_BASE_PREFIX/op_stack_go:<<pipeline.git.revision>>"
-
cannon-prestate
:
requires
:
[
"
op-stack-go-lint"
]
-
devnet
:
requires
:
-
op-node-docker-build
-
op-batcher-docker-build
-
op-proposer-docker-build
-
l1-geth-version-check
-
devnet-allocs
-
cannon-prestate
-
docker-build
:
-
docker-build
:
name
:
indexer-docker-build
name
:
indexer-docker-build
docker_file
:
indexer/Dockerfile
docker_file
:
indexer/Dockerfile
...
...
Makefile
View file @
e02310c0
COMPOSEFLAGS
=
-d
COMPOSEFLAGS
=
-d
ITESTS_L2_HOST
=
http://localhost:9545
ITESTS_L2_HOST
=
http://localhost:9545
BEDROCK_TAGS_REMOTE
?=
origin
BEDROCK_TAGS_REMOTE
?=
origin
OP_STACK_GO_BUILDER
?=
us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:latest
build
:
build-go build-ts
build
:
build-go build-ts
.PHONY
:
build
.PHONY
:
build
...
@@ -8,6 +9,10 @@ build: build-go build-ts
...
@@ -8,6 +9,10 @@ build: build-go build-ts
build-go
:
submodules op-node op-proposer op-batcher
build-go
:
submodules op-node op-proposer op-batcher
.PHONY
:
build-go
.PHONY
:
build-go
lint-go
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
.PHONY
:
lint-go
build-ts
:
submodules
build-ts
:
submodules
if
[
-n
"
$$
NVM_DIR"
]
;
then
\
if
[
-n
"
$$
NVM_DIR"
]
;
then
\
.
$$
NVM_DIR/nvm.sh
&&
nvm use
;
\
.
$$
NVM_DIR/nvm.sh
&&
nvm use
;
\
...
@@ -19,6 +24,13 @@ build-ts: submodules
...
@@ -19,6 +24,13 @@ build-ts: submodules
ci-builder
:
ci-builder
:
docker build
-t
ci-builder
-f
ops/docker/ci-builder/Dockerfile .
docker build
-t
ci-builder
-f
ops/docker/ci-builder/Dockerfile .
golang-docker
:
DOCKER_BUILDKIT
=
1 docker build
-t
op-stack-go
\
--build-arg
GIT_COMMIT
=
$$
(
git rev-parse HEAD
)
\
--build-arg
GIT_DATE
=
$$
(
git show
-s
--format
=
'%ct'
)
\
-f
ops/docker/op-stack-go/Dockerfile .
.PHONY
:
golang-docker
submodules
:
submodules
:
# CI will checkout submodules on its own
(
and fails on these commands
)
# CI will checkout submodules on its own
(
and fails on these commands
)
if
[
-z
"
$$
GITHUB_ENV"
]
;
then
\
if
[
-z
"
$$
GITHUB_ENV"
]
;
then
\
...
@@ -163,4 +175,10 @@ bedrock-markdown-links:
...
@@ -163,4 +175,10 @@ bedrock-markdown-links:
--exclude-mail
/input/README.md
"/input/specs/**/*.md"
--exclude-mail
/input/README.md
"/input/specs/**/*.md"
install-geth
:
install-geth
:
go
install
github.com/ethereum/go-ethereum/cmd/geth@
$(
shell
cat
.gethrc
)
./ops/scripts/geth-version-checker.sh
&&
\
(
echo
"Geth versions match, not installing geth..."
;
true
)
||
\
(
echo
"Versions do not match, installing geth!"
;
\
go
install
-v
github.com/ethereum/go-ethereum/cmd/geth@
$(
shell
cat
.gethrc
)
;
\
echo
"Installed geth!"
;
true
)
.PHONY
:
install-geth
bedrock-devnet/devnet/__init__.py
View file @
e02310c0
...
@@ -96,7 +96,9 @@ def main():
...
@@ -96,7 +96,9 @@ def main():
log
.
info
(
'Building docker images'
)
log
.
info
(
'Building docker images'
)
run_command
([
'docker'
,
'compose'
,
'build'
,
'--progress'
,
'plain'
],
cwd
=
paths
.
ops_bedrock_dir
,
env
=
{
run_command
([
'docker'
,
'compose'
,
'build'
,
'--progress'
,
'plain'
],
cwd
=
paths
.
ops_bedrock_dir
,
env
=
{
'PWD'
:
paths
.
ops_bedrock_dir
'PWD'
:
paths
.
ops_bedrock_dir
,
'DOCKER_BUILDKIT'
:
'1'
,
# (should be available by default in later versions, but explicitly enable it anyway)
'COMPOSE_DOCKER_CLI_BUILD'
:
'1'
# use the docker cache
})
})
log
.
info
(
'Devnet starting'
)
log
.
info
(
'Devnet starting'
)
...
...
cannon/Makefile
View file @
e02310c0
GITCOMMIT
:
=
$(
shell
git rev-parse HEAD
)
GITCOMMIT
?
=
$(
shell
git rev-parse HEAD
)
GITDATE
:
=
$(
shell
git show
-s
--format
=
'%ct'
)
GITDATE
?
=
$(
shell
git show
-s
--format
=
'%ct'
)
VERSION
:=
v0.0.0
VERSION
:=
v0.0.0
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
...
@@ -20,9 +20,6 @@ elf:
...
@@ -20,9 +20,6 @@ elf:
test
:
elf
test
:
elf
go
test
-v
./...
go
test
-v
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
fuzz
:
fuzz
:
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
=
FuzzStateSyscallBrk ./mipsevm
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
=
FuzzStateSyscallBrk ./mipsevm
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
=
FuzzStateSyscallClone ./mipsevm
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
=
FuzzStateSyscallClone ./mipsevm
...
...
endpoint-monitor/Makefile
View file @
e02310c0
GITCOMMIT
:
=
$(
shell
git rev-parse HEAD
)
GITCOMMIT
?
=
$(
shell
git rev-parse HEAD
)
GITDATE
:
=
$(
shell
git show
-s
--format
=
'%ct'
)
GITDATE
?
=
$(
shell
git show
-s
--format
=
'%ct'
)
VERSION
:=
v0.0.0
VERSION
:=
v0.0.0
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
...
...
op-batcher/Dockerfile
View file @
e02310c0
FROM
--platform=$BUILDPLATFORM golang:1.21.1-alpine3.18 as builder
ARG
OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:latest
FROM
$OP_STACK_GO_BUILDER as builder
ARG
VERSION=v0.0.0
# See "make golang-docker" and /ops/docker/op-stack-go
RUN
apk add
--no-cache
make gcc musl-dev linux-headers git jq bash
COPY
./go.mod /app/go.mod
COPY
./go.sum /app/go.sum
WORKDIR
/app
RUN
go mod download
# build op-batcher with the shared go.mod & go.sum files
COPY
./op-batcher /app/op-batcher
COPY
./op-bindings /app/op-bindings
COPY
./op-node /app/op-node
COPY
./op-service /app/op-service
COPY
./.git /app/.git
WORKDIR
/app/op-batcher
ARG
TARGETOS TARGETARCH
RUN
make op-batcher
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.18
FROM
alpine:3.18
COPY
--from=builder /
app/op-batcher/bin/op-batcher /usr/local/bin
COPY
--from=builder /
usr/local/bin/op-batcher /usr/local/bin/op-batcher
ENTRYPOINT
["op-batcher"]
CMD
["op-batcher"]
op-batcher/Dockerfile.dockerignore
0 → 100644
View file @
e02310c0
# ignore everything but the dockerfile, the op-stack-go base image performs the build
*
op-batcher/Makefile
View file @
e02310c0
GITCOMMIT
:
=
$(
shell
git rev-parse HEAD
)
GITCOMMIT
?
=
$(
shell
git rev-parse HEAD
)
GITDATE
:
=
$(
shell
git show
-s
--format
=
'%ct'
)
GITDATE
?
=
$(
shell
git show
-s
--format
=
'%ct'
)
VERSION
:=
v0.0.0
VERSION
:=
v0.0.0
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
...
@@ -16,9 +16,6 @@ clean:
...
@@ -16,9 +16,6 @@ clean:
test
:
test
:
go
test
-v
./...
go
test
-v
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
fuzz
:
fuzz
:
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
FuzzChannelConfig_CheckTimeout ./batcher
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
FuzzChannelConfig_CheckTimeout ./batcher
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
FuzzDurationZero ./batcher
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
FuzzDurationZero ./batcher
...
@@ -33,5 +30,4 @@ fuzz:
...
@@ -33,5 +30,4 @@ fuzz:
op-batcher
\
op-batcher
\
clean
\
clean
\
test
\
test
\
lint
\
fuzz
fuzz
op-bindings/Makefile
View file @
e02310c0
...
@@ -26,9 +26,6 @@ bindings-build:
...
@@ -26,9 +26,6 @@ bindings-build:
-package
$(pkg)
\
-package
$(pkg)
\
-monorepo-base
$
(
monorepo-base
)
-monorepo-base
$
(
monorepo-base
)
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
mkdir
:
mkdir
:
mkdir
-p
$(pkg)
mkdir
-p
$(pkg)
...
...
op-bootnode/Makefile
View file @
e02310c0
GITCOMMIT
:
=
$(
shell
git rev-parse HEAD
)
GITCOMMIT
?
=
$(
shell
git rev-parse HEAD
)
GITDATE
:
=
$(
shell
git show
-s
--format
=
'%ct'
)
GITDATE
?
=
$(
shell
git show
-s
--format
=
'%ct'
)
VERSION
:=
v0.0.0
VERSION
:=
v0.0.0
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
...
@@ -16,11 +16,7 @@ clean:
...
@@ -16,11 +16,7 @@ clean:
test
:
test
:
go
test
-v
./...
go
test
-v
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
.PHONY
:
\
.PHONY
:
\
op-bootnode
\
op-bootnode
\
clean
\
clean
\
test
\
test
lint
op-chain-ops/Makefile
View file @
e02310c0
...
@@ -6,9 +6,6 @@ check-l2:
...
@@ -6,9 +6,6 @@ check-l2:
test
:
test
:
go
test
./...
go
test
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
fuzz
:
fuzz
:
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
=
FuzzEncodeDecodeWithdrawal ./crossdomain
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
=
FuzzEncodeDecodeWithdrawal ./crossdomain
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
=
FuzzEncodeDecodeLegacyWithdrawal ./crossdomain
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
=
FuzzEncodeDecodeLegacyWithdrawal ./crossdomain
...
...
op-challenger/Dockerfile
View file @
e02310c0
FROM
--platform=$BUILDPLATFORM golang:1.21.1-alpine3.18 as builder
ARG
OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:latest
FROM
$OP_STACK_GO_BUILDER as builder
ARG
VERSION=v0.0.0
# See "make golang-docker" and /ops/docker/op-stack-go
RUN
apk add
--no-cache
make gcc musl-dev linux-headers git jq bash
COPY
./go.mod /app/go.mod
COPY
./go.sum /app/go.sum
WORKDIR
/app
RUN
go mod download
# build op-challenger with the shared go.mod & go.sum files
COPY
./op-challenger /app/op-challenger
COPY
./op-program /app/op-program
COPY
./op-preimage /app/op-preimage
COPY
./op-bindings /app/op-bindings
COPY
./op-node /app/op-node
COPY
./op-service /app/op-service
COPY
./.git /app/.git
# Copy cannon and its dependencies
COPY
./cannon /app/cannon
COPY
./op-preimage /app/op-preimage
COPY
./op-chain-ops /app/op-chain-ops
WORKDIR
/app/op-program
ARG
TARGETOS TARGETARCH
RUN
make op-program-host
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
WORKDIR
/app/cannon
ARG
TARGETOS TARGETARCH
RUN
make cannon
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
WORKDIR
/app/op-challenger
RUN
make op-challenger
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.18
FROM
alpine:3.18
# Make the bundled op-program the default cannon server
# Make the bundled op-program the default cannon server
COPY
--from=builder /
app/op-program/bin/op-program /usr/local/bin
COPY
--from=builder /
usr/local/bin/op-program /usr/local/bin/op-program
ENV
OP_CHALLENGER_CANNON_SERVER /usr/local/bin/op-program
ENV
OP_CHALLENGER_CANNON_SERVER /usr/local/bin/op-program
# Make the bundled cannon the default cannon executable
# Make the bundled cannon the default cannon executable
COPY
--from=builder /
app/cannon/bin/cannon /usr/local/bi
n
COPY
--from=builder /
usr/local/bin/cannon /usr/local/bin/canno
n
ENV
OP_CHALLENGER_CANNON_BIN /usr/local/bin/cannon
ENV
OP_CHALLENGER_CANNON_BIN /usr/local/bin/cannon
COPY
--from=builder /
app/op-challenger/bin/op-challenger /usr/local/bin
COPY
--from=builder /
usr/local/bin/op-challenger /usr/local/bin/op-challenger
CMD
["op-challenger"]
CMD
["op-challenger"]
op-challenger/Dockerfile.dockerignore
0 → 100644
View file @
e02310c0
# ignore everything but the dockerfile, the op-stack-go base image performs the build
*
op-challenger/Makefile
View file @
e02310c0
GITCOMMIT
:
=
$(
shell
git rev-parse HEAD
)
GITCOMMIT
?
=
$(
shell
git rev-parse HEAD
)
GITDATE
:
=
$(
shell
git show
-s
--format
=
'%ct'
)
GITDATE
?
=
$(
shell
git show
-s
--format
=
'%ct'
)
VERSION
:=
v0.0.0
VERSION
:=
v0.0.0
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
...
@@ -16,9 +16,6 @@ clean:
...
@@ -16,9 +16,6 @@ clean:
test
:
test
:
go
test
-v
./...
go
test
-v
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
visualize
:
visualize
:
./scripts/visualize.sh
./scripts/visualize.sh
...
...
op-e2e/Makefile
View file @
e02310c0
...
@@ -51,7 +51,3 @@ clean:
...
@@ -51,7 +51,3 @@ clean:
rm
-r
../.devnet
rm
-r
../.devnet
rm
-r
../op-program/bin
rm
-r
../op-program/bin
.PHONY
:
clean
.PHONY
:
clean
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
.PHONY
:
lint
op-heartbeat/Dockerfile
View file @
e02310c0
FROM
golang:1.21.1-alpine3.18 as builder
ARG
OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:latest
FROM
$OP_STACK_GO_BUILDER as builder
RUN
apk add
--no-cache
make gcc musl-dev linux-headers git jq bash
# See "make golang-docker" and /ops/docker/op-stack-go
# build op-heartbeat with local monorepo go modules
COPY
./op-heartbeat /app/op-heartbeat
COPY
./op-node /app/op-node
COPY
./op-service /app/op-service
COPY
./go.mod /app/go.mod
COPY
./go.sum /app/go.sum
COPY
./.git /app/.git
WORKDIR
/app/op-heartbeat
RUN
make op-heartbeat
FROM
alpine:3.18
FROM
alpine:3.18
COPY
--from=builder /
app/op-heartbeat/bin/op-heartbeat /usr/local/bin
COPY
--from=builder /
usr/local/bin/op-heartbeat /usr/local/bin/op-heartbeat
CMD
["op-heartbeat"]
CMD
["op-heartbeat"]
op-heartbeat/Dockerfile.dockerignore
0 → 100644
View file @
e02310c0
# ignore everything but the dockerfile, the op-stack-go base image performs the build
*
op-heartbeat/Makefile
View file @
e02310c0
GITCOMMIT
:
=
$(
shell
git rev-parse HEAD
)
GITCOMMIT
?
=
$(
shell
git rev-parse HEAD
)
GITDATE
:
=
$(
shell
git show
-s
--format
=
'%ct'
)
GITDATE
?
=
$(
shell
git show
-s
--format
=
'%ct'
)
VERSION
:=
v0.0.0
VERSION
:=
v0.0.0
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
...
@@ -16,9 +16,6 @@ clean:
...
@@ -16,9 +16,6 @@ clean:
test
:
test
:
go
test
-v
./...
go
test
-v
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
.PHONY
:
\
.PHONY
:
\
clean
\
clean
\
op-heartbeat
\
op-heartbeat
\
...
...
op-node/Dockerfile
View file @
e02310c0
FROM
--platform=$BUILDPLATFORM golang:1.21.1-alpine3.18 as builder
ARG
OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:latest
FROM
$OP_STACK_GO_BUILDER as builder
ARG
VERSION=v0.0.0
# See "make golang-docker" and /ops/docker/op-stack-go
RUN
apk add
--no-cache
make gcc musl-dev linux-headers git jq bash
COPY
./go.mod /app/go.mod
COPY
./go.sum /app/go.sum
WORKDIR
/app
RUN
go mod download
# build op-node with the shared go.mod & go.sum files
COPY
./op-node /app/op-node
COPY
./op-chain-ops /app/op-chain-ops
COPY
./op-service /app/op-service
COPY
./op-bindings /app/op-bindings
COPY
./.git /app/.git
WORKDIR
/app/op-node
ARG
TARGETOS TARGETARCH
RUN
make op-node
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.18
FROM
alpine:3.18
COPY
--from=builder /
app/op-node/bin/op-node /usr/local/bin
COPY
--from=builder /
usr/local/bin/op-node /usr/local/bin/op-node
CMD
["op-node"]
CMD
["op-node"]
op-node/Dockerfile.dockerignore
0 → 100644
View file @
e02310c0
# ignore everything but the dockerfile, the op-stack-go base image performs the build
*
op-node/Makefile
View file @
e02310c0
GITCOMMIT
:
=
$(
shell
git rev-parse HEAD
)
GITCOMMIT
?
=
$(
shell
git rev-parse HEAD
)
GITDATE
:
=
$(
shell
git show
-s
--format
=
'%ct'
)
GITDATE
?
=
$(
shell
git show
-s
--format
=
'%ct'
)
VERSION
:=
v0.0.0
VERSION
:=
v0.0.0
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
...
@@ -17,9 +17,6 @@ clean:
...
@@ -17,9 +17,6 @@ clean:
test
:
test
:
go
test
-v
./...
go
test
-v
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
fuzz
:
fuzz
:
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
FuzzL1InfoRoundTrip ./rollup/derive
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
FuzzL1InfoRoundTrip ./rollup/derive
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
FuzzL1InfoAgainstContract ./rollup/derive
go
test
-run
NOTAREALTEST
-v
-fuzztime
10s
-fuzz
FuzzL1InfoAgainstContract ./rollup/derive
...
...
op-preimage/filepoller_test.go
View file @
e02310c0
...
@@ -15,9 +15,9 @@ func TestFilePoller_Read(t *testing.T) {
...
@@ -15,9 +15,9 @@ func TestFilePoller_Read(t *testing.T) {
chanAPoller
:=
NewFilePoller
(
ctx
,
chanA
,
time
.
Millisecond
*
100
)
chanAPoller
:=
NewFilePoller
(
ctx
,
chanA
,
time
.
Millisecond
*
100
)
go
func
()
{
go
func
()
{
chanB
.
Write
([]
byte
(
"hello"
))
_
,
_
=
chanB
.
Write
([]
byte
(
"hello"
))
time
.
Sleep
(
time
.
Second
*
1
)
time
.
Sleep
(
time
.
Second
*
1
)
chanB
.
Write
([]
byte
(
"world"
))
_
,
_
=
chanB
.
Write
([]
byte
(
"world"
))
}()
}()
var
buf
[
10
]
byte
var
buf
[
10
]
byte
n
,
err
:=
chanAPoller
.
Read
(
buf
[
:
])
n
,
err
:=
chanAPoller
.
Read
(
buf
[
:
])
...
@@ -34,9 +34,9 @@ func TestFilePoller_Write(t *testing.T) {
...
@@ -34,9 +34,9 @@ func TestFilePoller_Write(t *testing.T) {
bufch
:=
make
(
chan
[]
byte
,
1
)
bufch
:=
make
(
chan
[]
byte
,
1
)
go
func
()
{
go
func
()
{
var
buf
[
10
]
byte
var
buf
[
10
]
byte
chanB
.
Read
(
buf
[
:
5
])
_
,
_
=
chanB
.
Read
(
buf
[
:
5
])
time
.
Sleep
(
time
.
Second
*
1
)
time
.
Sleep
(
time
.
Second
*
1
)
chanB
.
Read
(
buf
[
5
:
])
_
,
_
=
chanB
.
Read
(
buf
[
5
:
])
bufch
<-
buf
[
:
]
bufch
<-
buf
[
:
]
close
(
bufch
)
close
(
bufch
)
}()
}()
...
@@ -59,7 +59,7 @@ func TestFilePoller_ReadCancel(t *testing.T) {
...
@@ -59,7 +59,7 @@ func TestFilePoller_ReadCancel(t *testing.T) {
chanAPoller
:=
NewFilePoller
(
ctx
,
chanA
,
time
.
Millisecond
*
100
)
chanAPoller
:=
NewFilePoller
(
ctx
,
chanA
,
time
.
Millisecond
*
100
)
go
func
()
{
go
func
()
{
chanB
.
Write
([]
byte
(
"hello"
))
_
,
_
=
chanB
.
Write
([]
byte
(
"hello"
))
cancel
()
cancel
()
}()
}()
var
buf
[
10
]
byte
var
buf
[
10
]
byte
...
@@ -76,7 +76,7 @@ func TestFilePoller_WriteCancel(t *testing.T) {
...
@@ -76,7 +76,7 @@ func TestFilePoller_WriteCancel(t *testing.T) {
go
func
()
{
go
func
()
{
var
buf
[
5
]
byte
var
buf
[
5
]
byte
chanB
.
Read
(
buf
[
:
])
_
,
_
=
chanB
.
Read
(
buf
[
:
])
cancel
()
cancel
()
}()
}()
// use a large buffer to overflow the kernel buffer provided to pipe(2) so the write actually blocks
// use a large buffer to overflow the kernel buffer provided to pipe(2) so the write actually blocks
...
...
op-program/Dockerfile
View file @
e02310c0
FROM
--platform=$BUILDPLATFORM golang:1.21.1-alpine3.18 as builder
ARG
OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:latest
FROM
$OP_STACK_GO_BUILDER as builder
ARG
VERSION=v0.0.0
# See "make golang-docker" and /ops/docker/op-stack-go
RUN
apk add
--no-cache
make gcc musl-dev linux-headers git jq bash
COPY
./go.mod /app/go.mod
COPY
./go.sum /app/go.sum
WORKDIR
/app
RUN
go mod download
# build op-program with the shared go.mod & go.sum files
COPY
./op-program /app/op-program
COPY
./op-preimage /app/op-preimage
COPY
./op-node /app/op-node
COPY
./op-chain-ops /app/op-chain-ops
COPY
./op-service /app/op-service
COPY
./op-bindings /app/op-bindings
COPY
./.git /app/.git
WORKDIR
/app/op-program
ARG
TARGETOS TARGETARCH
RUN
make op-program
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.18
FROM
alpine:3.18
COPY
--from=builder /
app/op-program/bin/op-program /usr/local/bin
COPY
--from=builder /
usr/local/bin/op-program /usr/local/bin/op-program
CMD
["op-program"]
CMD
["op-program"]
op-program/Dockerfile.dockerignore
0 → 100644
View file @
e02310c0
# ignore everything but the dockerfile, the op-stack-go base image performs the build
*
op-program/Makefile
View file @
e02310c0
GITCOMMIT
:
=
$(
shell
git rev-parse HEAD
)
GITCOMMIT
?
=
$(
shell
git rev-parse HEAD
)
GITDATE
:
=
$(
shell
git show
-s
--format
=
'%ct'
)
GITDATE
?
=
$(
shell
git show
-s
--format
=
'%ct'
)
VERSION
:=
v0.0.0
VERSION
:=
v0.0.0
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
...
@@ -30,9 +30,6 @@ clean:
...
@@ -30,9 +30,6 @@ clean:
test
:
test
:
go
test
-v
./...
go
test
-v
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
verify-goerli
:
op-program-host op-program-client
verify-goerli
:
op-program-host op-program-client
env
GO111MODULE
=
on go run ./verify/cmd/goerli.go
$$
L1URL
$$
L2URL
env
GO111MODULE
=
on go run ./verify/cmd/goerli.go
$$
L1URL
$$
L2URL
...
...
op-proposer/Dockerfile
View file @
e02310c0
FROM
--platform=$BUILDPLATFORM golang:1.21.1-alpine3.18 as builder
ARG
OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:latest
FROM
$OP_STACK_GO_BUILDER as builder
ARG
VERSION=v0.0.0
# See "make golang-docker" and /ops/docker/op-stack-go
RUN
apk add
--no-cache
make gcc musl-dev linux-headers git jq bash
COPY
./go.mod /app/go.mod
COPY
./go.sum /app/go.sum
WORKDIR
/app
RUN
go mod download
# build op-proposer with the shared go.mod & go.sum files
COPY
./op-proposer /app/op-proposer
COPY
./op-bindings /app/op-bindings
COPY
./op-node /app/op-node
COPY
./op-service /app/op-service
COPY
./.git /app/.git
WORKDIR
/app/op-proposer
ARG
TARGETOS TARGETARCH
RUN
make op-proposer
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.18
FROM
alpine:3.18
COPY
--from=builder /
app/op-proposer/bin/op-proposer /usr/local/bin
COPY
--from=builder /
usr/local/bin/op-proposer /usr/local/bin/op-proposer
CMD
["op-proposer"]
CMD
["op-proposer"]
op-proposer/Dockerfile.dockerignore
0 → 100644
View file @
e02310c0
# ignore everything but the dockerfile, the op-stack-go base image performs the build
*
op-proposer/Makefile
View file @
e02310c0
GITCOMMIT
:
=
$(
shell
git rev-parse HEAD
)
GITCOMMIT
?
=
$(
shell
git rev-parse HEAD
)
GITDATE
:
=
$(
shell
git show
-s
--format
=
'%ct'
)
GITDATE
?
=
$(
shell
git show
-s
--format
=
'%ct'
)
VERSION
:=
v0.0.0
VERSION
:=
v0.0.0
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
...
@@ -16,9 +16,6 @@ clean:
...
@@ -16,9 +16,6 @@ clean:
test
:
test
:
go
test
-v
./...
go
test
-v
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
.PHONY
:
\
.PHONY
:
\
clean
\
clean
\
op-proposer
\
op-proposer
\
...
...
op-service/Makefile
View file @
e02310c0
test
:
test
:
go
test
-v
./...
go
test
-v
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
generate-mocks
:
generate-mocks
:
go generate ./...
go generate ./...
...
...
op-wheel/Dockerfile
View file @
e02310c0
FROM
golang:1.21.1-alpine3.18 as builder
ARG
OP_STACK_GO_BUILDER=us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:latest
FROM
$OP_STACK_GO_BUILDER as builder
RUN
apk add
--no-cache
make gcc musl-dev linux-headers
# See "make golang-docker" and /ops/docker/op-stack-go
COPY
./op-wheel /app/op-wheel
COPY
./op-node /app/op-node
COPY
./op-chain-ops /app/op-chain-ops
COPY
./op-service /app/op-service
COPY
./op-bindings /app/op-bindings
COPY
./go.mod /app/go.mod
COPY
./go.sum /app/go.sum
WORKDIR
/app/op-wheel
RUN
go build
-o
op-wheel ./cmd/main.go
FROM
alpine:3.18
FROM
alpine:3.18
COPY
--from=builder /app/op-wheel/op-wheel /usr/local/bin
COPY
--from=builder /app/op-wheel/
bin/
op-wheel /usr/local/bin
CMD
["op-wheel"]
CMD
["op-wheel"]
op-wheel/Dockerfile.dockerignore
0 → 100644
View file @
e02310c0
# ignore everything but the dockerfile, the op-stack-go base image performs the build
*
op-wheel/Makefile
View file @
e02310c0
GITCOMMIT
?=
$(
shell
git rev-parse HEAD
)
GITCOMMIT
:=
$(
shell
git rev-parse HEAD
)
GITDATE
?=
$(
shell
git show
-s
--format
=
'%ct'
)
GITDATE
:=
$(
shell
git show
-s
--format
=
'%ct'
)
VERSION
:=
v0.0.0
VERSION
:=
v0.0.0
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
LDFLAGSSTRING
+=
-X
main.GitCommit
=
$(GITCOMMIT)
...
@@ -10,6 +9,3 @@ LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
...
@@ -10,6 +9,3 @@ LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
op-wheel
:
op-wheel
:
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-wheel ./cmd
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-wheel ./cmd
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
ops-bedrock/docker-compose.yml
View file @
e02310c0
...
@@ -11,6 +11,16 @@ volumes:
...
@@ -11,6 +11,16 @@ volumes:
services
:
services
:
op_stack_go_builder
:
# Not an actual service, but builds the prerequisite go images
build
:
context
:
../
dockerfile
:
ops/docker/op-stack-go/Dockerfile
args
:
GIT_COMMIT
:
"
dev"
GIT_DATE
:
"
0"
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:devnet
entrypoint
:
[
"
echo"
,
"
build
complete"
]
l1
:
l1
:
build
:
build
:
context
:
.
context
:
.
...
@@ -42,11 +52,15 @@ services:
...
@@ -42,11 +52,15 @@ services:
op-node
:
op-node
:
depends_on
:
depends_on
:
-
op_stack_go_builder
-
l1
-
l1
-
l2
-
l2
build
:
build
:
context
:
../
context
:
../
dockerfile
:
./op-node/Dockerfile
dockerfile
:
./op-node/Dockerfile
args
:
OP_STACK_GO_BUILDER
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:devnet
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:devnet
command
:
>
command
:
>
op-node
op-node
--l1=ws://l1:8546
--l1=ws://l1:8546
...
@@ -85,12 +99,16 @@ services:
...
@@ -85,12 +99,16 @@ services:
op-proposer
:
op-proposer
:
depends_on
:
depends_on
:
-
op_stack_go_builder
-
l1
-
l1
-
l2
-
l2
-
op-node
-
op-node
build
:
build
:
context
:
../
context
:
../
dockerfile
:
./op-proposer/Dockerfile
dockerfile
:
./op-proposer/Dockerfile
args
:
OP_STACK_GO_BUILDER
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:devnet
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/op-proposer:devnet
ports
:
ports
:
-
"
6062:6060"
-
"
6062:6060"
-
"
7302:7300"
-
"
7302:7300"
...
@@ -110,12 +128,16 @@ services:
...
@@ -110,12 +128,16 @@ services:
op-batcher
:
op-batcher
:
depends_on
:
depends_on
:
-
op_stack_go_builder
-
l1
-
l1
-
l2
-
l2
-
op-node
-
op-node
build
:
build
:
context
:
../
context
:
../
dockerfile
:
./op-batcher/Dockerfile
dockerfile
:
./op-batcher/Dockerfile
args
:
OP_STACK_GO_BUILDER
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/op_stack_go:devnet
image
:
us-docker.pkg.dev/oplabs-tools-artifacts/images/op-batcher:devnet
ports
:
ports
:
-
"
6061:6060"
-
"
6061:6060"
-
"
7301:7300"
-
"
7301:7300"
...
@@ -145,16 +167,16 @@ services:
...
@@ -145,16 +167,16 @@ services:
security_opt
:
security_opt
:
-
"
no-new-privileges:true"
-
"
no-new-privileges:true"
stateviz
:
#
stateviz:
build
:
#
build:
context
:
../
#
context: ../
dockerfile
:
./ops-bedrock/Dockerfile.stateviz
#
dockerfile: ./ops-bedrock/Dockerfile.stateviz
command
:
#
command:
-
stateviz
#
- stateviz
-
-addr=0.0.0.0:8080
#
- -addr=0.0.0.0:8080
-
-snapshot=/op_log/snapshot.log
#
- -snapshot=/op_log/snapshot.log
-
-refresh=10s
#
- -refresh=10s
ports
:
#
ports:
-
"
9090:8080"
#
- "9090:8080"
volumes
:
#
volumes:
-
op_log:/op_log:ro
#
- op_log:/op_log:ro
ops/docker/op-stack-go/Dockerfile
0 → 100644
View file @
e02310c0
FROM
--platform=$BUILDPLATFORM golang:1.21.3-alpine3.18 as builder
RUN
apk add
--no-cache
make gcc musl-dev linux-headers git jq bash
# We copy the go.mod/sum first, so the `go mod download` does not have to re-run if dependencies do not change.
COPY
./go.mod /app/go.mod
COPY
./go.sum /app/go.sum
WORKDIR
/app
RUN
echo
"go mod cache:
$(
go
env
GOMODCACHE
)
"
RUN
echo
"go build cache:
$(
go
env
GOCACHE
)
"
RUN
--mount
=
type
=
cache,target
=
/go/pkg/mod
--mount
=
type
=
cache,target
=
/root/.cache/go-build go mod download
# NOTE: the Dockerfile.dockerignore file effectively describes all dependencies
COPY
. /app
# We avoid copying the full .git dir into the build for just some metadata.
# Instead, specify:
# --build-arg GIT_COMMIT=$(git rev-parse HEAD)
# --build-arg GIT_DATE=$(git show -s --format='%ct')
ARG
GIT_COMMIT
ARG
GIT_DATE
ARG
CANNON_VERSION=v0.0.0
ARG
OP_PROGRAM_VERSION=v0.0.0
ARG
OP_HEARTBEAT_VERSION=v0.0.0
ARG
OP_WHEEL_VERSION=v0.0.0
ARG
OP_NODE_VERSION=v0.0.0
ARG
OP_CHALLENGER_VERSION=v0.0.0
ARG
OP_BATCHER_VERSION=v0.0.0
ARG
OP_PROPOSER_VERSION=v0.0.0
# separate docker-builds:
# - op-exporter
# - op-ufm
# - proxyd
# - any JS/TS/smart-contract builds
ARG
TARGETOS TARGETARCH
# Build the Go services, utilizing caches and share the many common packages.
# The "id" defaults to the value of "target", the cache will thus be reused during this build.
# "sharing" defaults to "shared", the cache will thus be available to other concurrent docker builds.
RUN
--mount
=
type
=
cache,target
=
/root/.cache/go-build
cd
cannon
&&
make cannon
\
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
GITCOMMIT
=
$GIT_COMMIT
GITDATE
=
$GIT_DATE
VERSION
=
"
$CANNON_VERSION
"
# note: we only build the host, that's all the user needs. No Go MIPS cross-build in docker
RUN
--mount
=
type
=
cache,target
=
/root/.cache/go-build
cd
op-program
&&
make op-program-host
\
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
GITCOMMIT
=
$GIT_COMMIT
GITDATE
=
$GIT_DATE
VERSION
=
"
$OP_PROGRAM_VERSION
"
RUN
--mount
=
type
=
cache,target
=
/root/.cache/go-build
cd
op-heartbeat
&&
make op-heartbeat
\
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
GITCOMMIT
=
$GIT_COMMIT
GITDATE
=
$GIT_DATE
VERSION
=
"
$OP_HEARTBEAT_VERSION
"
RUN
--mount
=
type
=
cache,target
=
/root/.cache/go-build
cd
op-wheel
&&
make op-wheel
\
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
GITCOMMIT
=
$GIT_COMMIT
GITDATE
=
$GIT_DATE
VERSION
=
"
$OP_WHEEL_VERSION
"
RUN
--mount
=
type
=
cache,target
=
/root/.cache/go-build
cd
op-node
&&
make op-node
\
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
GITCOMMIT
=
$GIT_COMMIT
GITDATE
=
$GIT_DATE
VERSION
=
"
$OP_NODE_VERSION
"
RUN
--mount
=
type
=
cache,target
=
/root/.cache/go-build
cd
op-challenger
&&
make op-challenger
\
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
GITCOMMIT
=
$GIT_COMMIT
GITDATE
=
$GIT_DATE
VERSION
=
"
$OP_CHALLENGER_VERSION
"
RUN
--mount
=
type
=
cache,target
=
/root/.cache/go-build
cd
op-batcher
&&
make op-batcher
\
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
GITCOMMIT
=
$GIT_COMMIT
GITDATE
=
$GIT_DATE
VERSION
=
"
$OP_BATCHER_VERSION
"
RUN
--mount
=
type
=
cache,target
=
/root/.cache/go-build
cd
op-proposer
&&
make op-proposer
\
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
GITCOMMIT
=
$GIT_COMMIT
GITDATE
=
$GIT_DATE
VERSION
=
"
$OP_PROPOSER_VERSION
"
FROM
alpine:3.18
COPY
--from=builder /app/cannon/bin/cannon /usr/local/bin/
COPY
--from=builder /app/op-program/bin/op-program /usr/local/bin/
COPY
--from=builder /app/op-heartbeat/bin/op-heartbeat /usr/local/bin/
COPY
--from=builder /app/op-wheel/bin/op-wheel /usr/local/bin/
COPY
--from=builder /app/op-node/bin/op-node /usr/local/bin/
COPY
--from=builder /app/op-challenger/bin/op-challenger /usr/local/bin/
COPY
--from=builder /app/op-batcher/bin/op-batcher /usr/local/bin/
COPY
--from=builder /app/op-proposer/bin/op-proposer /usr/local/bin/
ops/docker/op-stack-go/Dockerfile.dockerignore
0 → 100644
View file @
e02310c0
# All the files we depend on. We are using a negative pattern to not include anything by accident.
# node_modules, packages (contains git submodules and node modules etc.), devnet dirs etc. all add up a lot.
*
!/cannon
!/op-batcher
!/op-bindings
!/op-bootnode
!/op-chain-ops
!/op-challenger
!/op-heartbeat
!/op-node
!/op-preimage
!/op-program
!/op-proposer
!/op-service
!/op-wheel
!/go.mod
!/go.sum
ops/scripts/geth-version-checker.sh
0 → 100755
View file @
e02310c0
#!/bin/bash
# Extract the version from the geth command output
GETH_VERSION
=
"v
$(
geth version |
grep
'^Version:'
|
awk
'{print $2}'
)
"
# Read the version from the .gethrc file
GETHRC_VERSION
=
$(
cat
.gethrc
)
# Check if GETHRC_VERSION contains a '-'. If not, append '-stable'.
if
[[
$GETHRC_VERSION
!=
*
-
*
]]
;
then
GETHRC_VERSION
=
"
${
GETHRC_VERSION
}
-stable"
fi
# Compare the versions
if
[[
"
$GETH_VERSION
"
==
"
$GETHRC_VERSION
"
]]
;
then
echo
"Geth version
$GETH_VERSION
is correct!"
exit
0
else
echo
"Geth version does not match!"
echo
"geth version:
$GETH_VERSION
"
echo
".gethrc version:
$GETHRC_VERSION
"
exit
1
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment