Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/continue/kona.yml
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ jobs:
command: |
CANNON_TAG="$(cat .config/cannon_tag)"
cd docker/fpvm-prestates
just "<<parameters.kind>>" "<<parameters.version>>" "<< pipeline.git.branch >>" "$CANNON_TAG"
just "<<parameters.kind>>" "<<parameters.version>>" "$CANNON_TAG"
- run:
name: Upload prestates to GCS
command: |
Expand Down
9 changes: 4 additions & 5 deletions .circleci/continue/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,6 @@ jobs:
fi

# Let them cook!
KONA_VERSION=$(jq -r .version kona/version.json) \
docker buildx bake \
--progress plain \
--builder=buildx-build \
Expand Down Expand Up @@ -2494,20 +2493,20 @@ jobs:
enable-mise-cache: true
- restore_cache:
name: Restore kona cache
key: kona-prestate-{{ checksum "./kona/justfile" }}-{{ checksum "./kona/version.json" }}
key: kona-prestate-{{ checksum "./kona/justfile" }}-{{ checksum "./kona/.config/cannon_tag" }}
- run:
name: Build kona prestates
command: just build-prestates
working_directory: kona
- save_cache:
key: kona-prestate-{{ checksum "./kona/justfile" }}-{{ checksum "./kona/version.json" }}
key: kona-prestate-{{ checksum "./kona/justfile" }}-{{ checksum "./kona/.config/cannon_tag" }}
name: Save Kona to cache
paths:
- "kona/prestates/"
- "kona/prestate-artifacts-*/"
- persist_to_workspace:
root: .
paths:
- "kona/prestates/*"
- "kona/prestate-artifacts-*/*"


# Aggregator job - allows downstream jobs to depend on a single job instead of listing all build jobs.
Expand Down
13 changes: 1 addition & 12 deletions .github/actions/docker-build-prep/action.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: 'Docker Build Prep'
description: 'Prepare environment for docker builds (checkout, kona version, git versions)'
description: 'Prepare environment for docker builds (checkout, git versions)'

outputs:
versions:
description: 'JSON object mapping image names to their GIT_VERSION'
value: ${{ steps.compute_versions.outputs.versions }}
kona_version:
description: 'KONA_VERSION from kona/version.json'
value: ${{ steps.kona.outputs.version }}
date:
description: 'Current date in YYYYMMDD format'
value: ${{ steps.date.outputs.date }}
Expand All @@ -22,14 +19,6 @@ runs:
DATE=$(date +%Y%m%d)
echo "date=$DATE" >> $GITHUB_OUTPUT

- name: Read KONA_VERSION from kona/version.json
id: kona
shell: bash
run: |
KONA_VERSION=$(jq -r .version kona/version.json)
echo "version=$KONA_VERSION" >> $GITHUB_OUTPUT
echo "KONA_VERSION: $KONA_VERSION"

- name: Compute GIT_VERSION for all images
id: compute_versions
shell: bash
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/branches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
contents: read
outputs:
versions: ${{ steps.prep.outputs.versions }}
kona_version: ${{ steps.prep.outputs.kona_version }}
date: ${{ steps.prep.outputs.date }}
steps:
- name: Harden the runner
Expand Down Expand Up @@ -73,7 +72,6 @@ jobs:
registry: us-docker.pkg.dev/oplabs-tools-artifacts/images
env: |
GIT_VERSION=${{ fromJson(needs.prep.outputs.versions)[matrix.image_name] }}
KONA_VERSION=${{ needs.prep.outputs.kona_version }}
set: |
*.args.GIT_COMMIT=${{ github.sha }}
*.args.GIT_DATE=${{ needs.prep.outputs.date }}
Expand Down Expand Up @@ -115,7 +113,6 @@ jobs:
registry: ttl.sh/${{ github.sha }}
env: |
GIT_VERSION=${{ fromJson(needs.prep.outputs.versions)[matrix.image_name] }}
KONA_VERSION=${{ needs.prep.outputs.kona_version }}
set: |
*.args.GIT_COMMIT=${{ github.sha }}
*.args.GIT_DATE=${{ needs.prep.outputs.date }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
image_name: ${{ steps.parse-tag.outputs.image_name }}
version: ${{ steps.parse-tag.outputs.version }}
versions: ${{ steps.prep.outputs.versions }}
kona_version: ${{ steps.prep.outputs.kona_version }}
steps:
- name: Harden the runner
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2
Expand Down Expand Up @@ -43,7 +42,6 @@ jobs:
registry: us-docker.pkg.dev/oplabs-tools-artifacts/images
env: |
GIT_VERSION=${{ fromJson(needs.prep.outputs.versions)[needs.prep.outputs.image_name] }}
KONA_VERSION=${{ needs.prep.outputs.kona_version }}
set: |
*.args.GIT_COMMIT=${{ github.sha }}
*.args.GIT_DATE=${{ github.event.head_commit.timestamp }}
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ golang-docker: ## Builds Docker images for Go components using buildx
GIT_COMMIT=$$(git rev-parse HEAD) \
GIT_DATE=$$(git show -s --format='%ct') \
IMAGE_TAGS=$$(git rev-parse HEAD),latest \
KONA_VERSION=$$(jq -r .version kona/version.json) \
docker buildx bake \
--progress plain \
--load \
Expand Down Expand Up @@ -148,8 +147,11 @@ cannon: ## Builds cannon binary
make -C ./cannon cannon
.PHONY: cannon

reproducible-prestate: ## Builds reproducible-prestate binary
make -C ./op-program reproducible-prestate
reproducible-prestate: ## Builds reproducible prestates for op-program and kona
make -C ./op-program build-reproducible-prestate
cd kona && just build-reproducible-prestate
make -C ./op-program output-prestate-hash
cd kona && just output-prestate-hash
.PHONY: reproducible-prestate

cannon-prestates: cannon op-program
Expand Down
5 changes: 0 additions & 5 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ variable "REPOSITORY" {
default = "oplabs-tools-artifacts/images"
}

variable "KONA_VERSION" {
default = "none"
}

variable "GIT_COMMIT" {
default = "dev"
}
Expand Down Expand Up @@ -148,7 +144,6 @@ 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
36 changes: 2 additions & 34 deletions kona/docker/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ target "generic" {
// Proof Images //
////////////////////////////////////////////////////////////////

variable "ASTERISC_TAG" {
// The tag of `asterisc` to use in the `kona-asterisc-prestate` target.
//
// You can override this if you'd like to use a different tag to generate the prestate.
// https://github.com/ethereum-optimism/asterisc/releases
default = "v1.3.0"
description = "The tag of asterisc to use in the kona-asterisc-prestate target."
}

variable "CANNON_TAG" {
// The tag of `cannon` to use in the `kona-cannon-prestate` target.
//
Expand All @@ -98,7 +89,7 @@ variable "CANNON_TAG" {
}

variable "CLIENT_BIN" {
// The `kona-client` binary to use in the `kona-{asterisc/cannon}-prestate` targets.
// The `kona-client` binary to use in the `kona-cannon-prestate` target.
//
// You can override this if you'd like to use a different `kona-client` binary to generate
// the prestate.
Expand All @@ -107,7 +98,7 @@ variable "CLIENT_BIN" {
// - `kona` (single-chain)
// - `kona-int` (interop)
default = "kona"
description = "The kona-client binary to use in the proof prestate targets. Valid options: kona, kona-int"
description = "The kona-client binary to use in the proof prestate target. Valid options: kona, kona-int"
}

variable "KONA_CUSTOM_CONFIGS" {
Expand All @@ -123,14 +114,6 @@ variable "CUSTOM_CONFIGS_CONTEXT" {
}


target "asterisc-builder" {
description = "Rust build environment for bare-metal RISC-V 64-bit IMA (Asterisc FPVM ISA)"
inherits = ["docker-metadata-action"]
context = "docker/asterisc"
dockerfile = "asterisc.dockerfile"
platforms = split(",", PLATFORMS)
}

target "cannon-builder" {
description = "Rust build environment for bare-metal MIPS64r1 (Cannon FPVM ISA)"
inherits = ["docker-metadata-action"]
Expand All @@ -143,20 +126,6 @@ target "cannon-builder" {
platforms = split(",", PLATFORMS)
}

target "kona-asterisc-prestate" {
description = "Prestate builder for kona-client with Asterisc FPVM"
inherits = ["docker-metadata-action"]
context = "."
dockerfile = "docker/fpvm-prestates/asterisc-repro.dockerfile"
args = {
CLIENT_BIN = "${CLIENT_BIN}"
CLIENT_TAG = "${GIT_REF_NAME}"
ASTERISC_TAG = "${ASTERISC_TAG}"
}
# Only build on linux/amd64 for reproducibility.
platforms = ["linux/amd64"]
}

target "kona-cannon-prestate" {
description = "Prestate builder for kona-client with Cannon FPVM"
inherits = ["docker-metadata-action"]
Expand All @@ -167,7 +136,6 @@ target "kona-cannon-prestate" {
}
args = {
CLIENT_BIN = "${CLIENT_BIN}"
CLIENT_TAG = "${GIT_REF_NAME}"
CANNON_TAG = "${CANNON_TAG}"
KONA_CUSTOM_CONFIGS = "${KONA_CUSTOM_CONFIGS}"
}
Expand Down
107 changes: 0 additions & 107 deletions kona/docker/fpvm-prestates/asterisc-repro.dockerfile

This file was deleted.

13 changes: 4 additions & 9 deletions kona/docker/fpvm-prestates/cannon-repro.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,25 @@ RUN git clone https://github.com/ethereum-optimism/optimism && \
cp bin/cannon /cannon-bin

################################################################
# Build kona-client @ `CLIENT_TAG` #
# Build kona-client from local source #
################################################################

FROM ghcr.io/op-rs/kona/cannon-builder:0.3.0 AS client-build
SHELL ["/bin/bash", "-c"]

ARG CLIENT_BIN
ARG CLIENT_TAG
ARG KONA_CUSTOM_CONFIGS

COPY --from=custom_configs / /usr/local/kona-custom-configs

# Install deps
RUN apt-get update && apt-get install -y --no-install-recommends git

# Clone kona at the specified tag
RUN git clone https://github.com/op-rs/kona
# Copy kona source from build context
COPY . /kona

ENV KONA_CUSTOM_CONFIGS=$KONA_CUSTOM_CONFIGS
ENV KONA_CUSTOM_CONFIGS_DIR=/usr/local/kona-custom-configs

# Build kona-client on the selected tag
# Build kona-client
RUN cd kona && \
git checkout $CLIENT_TAG && \
cargo build -Zbuild-std=core,alloc -p kona-client --bin $CLIENT_BIN --locked --profile release-client-lto && \
mv ./target/mips64-unknown-none/release-client-lto/$CLIENT_BIN /kona-client-elf

Expand Down
Loading