Skip to content

Commit

Permalink
chore(ops): Support kona + asterisc in the op-challenger (ethereum-op…
Browse files Browse the repository at this point in the history
…timism#13198)

* chore(ops): add support for the op-challenger to run kona + asterisc

* fix: update docker bake

* fixes
  • Loading branch information
refcell authored Dec 4, 2024
1 parent 4ce84f1 commit c36de04
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
7 changes: 6 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ variable "REPOSITORY" {
default = "oplabs-tools-artifacts/images"
}

variable "KONA_VERSION" {
default = "kona-client-v0.1.0-beta.4"
}

variable "GIT_COMMIT" {
default = "dev"
}
Expand Down Expand Up @@ -119,6 +123,7 @@ target "op-challenger" {
GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}"
OP_CHALLENGER_VERSION = "${OP_CHALLENGER_VERSION}"
KONA_VERSION="${KONA_VERSION}"
}
target = "op-challenger-target"
platforms = split(",", PLATFORMS)
Expand Down Expand Up @@ -207,7 +212,7 @@ target "proofs-tools" {
context = "."
args = {
CHALLENGER_VERSION="b46bffed42db3442d7484f089278d59f51503049"
KONA_VERSION="kona-client-v0.1.0-beta.4"
KONA_VERSION="${KONA_VERSION}"
}
target="proofs-tools"
platforms = split(",", PLATFORMS)
Expand Down
22 changes: 19 additions & 3 deletions ops/docker/op-stack-go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
# It will default to the target platform.
ARG TARGET_BASE_IMAGE=alpine:3.20

# The ubuntu target base image is used for the op-challenger build with kona and asterisc.
ARG UBUNTU_TARGET_BASE_IMAGE=ubuntu:22.04

# The version of kona to use.
# The only build that uses this is `op-challenger-target`.
ARG KONA_VERSION=none

# We may be cross-building for another platform. Specify which platform we need as builder.
FROM --platform=$BUILDPLATFORM golang:1.22.7-alpine3.20 AS builder

Expand Down Expand Up @@ -136,14 +143,23 @@ FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-node-target
COPY --from=op-node-builder /app/op-node/bin/op-node /usr/local/bin/
CMD ["op-node"]

FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-challenger-target
# Make the kona docker image published by upstream available as a source to copy kona and asterisc from.
FROM --platform=$BUILDPLATFORM ghcr.io/anton-rs/kona/kona-fpp-asterisc:$KONA_VERSION AS kona

# Also produce an op-challenger loaded with kona and asterisc using ubuntu
FROM --platform=$TARGETPLATFORM $UBUNTU_TARGET_BASE_IMAGE AS op-challenger-target
RUN apt-get update && apt-get install -y --no-install-recommends musl openssl ca-certificates
COPY --from=op-challenger-builder /app/op-challenger/bin/op-challenger /usr/local/bin/
# Make the bundled op-program the default cannon server
# Copy in op-program and cannon
COPY --from=op-program-builder /app/op-program/bin/op-program /usr/local/bin/
ENV OP_CHALLENGER_CANNON_SERVER /usr/local/bin/op-program
# Make the bundled cannon the default cannon executable
COPY --from=cannon-builder /app/cannon/bin/cannon /usr/local/bin/
ENV OP_CHALLENGER_CANNON_BIN /usr/local/bin/cannon
# Copy in kona and asterisc
COPY --from=kona /kona-host /usr/local/bin/
ENV OP_CHALLENGER_ASTERISC_KONA_SERVER=/usr/local/bin/kona-host
COPY --from=kona /asterisc /usr/local/bin/
ENV OP_CHALLENGER_ASTERISC_BIN=/usr/local/bin/asterisc
CMD ["op-challenger"]

FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-dispute-mon-target
Expand Down

0 comments on commit c36de04

Please sign in to comment.