From 1060f3b4363b5ad57ec68f170e03a76abead0c5a Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Wed, 11 Mar 2026 02:44:44 +0000 Subject: [PATCH 01/14] docs(op-e2e): update README to use just instead of make Co-Authored-By: Claude Opus 4.6 --- justfiles/deprecated.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/justfiles/deprecated.mk b/justfiles/deprecated.mk index 9ac15aa6c1b17..03ee92cf068da 100644 --- a/justfiles/deprecated.mk +++ b/justfiles/deprecated.mk @@ -16,9 +16,9 @@ define make-deprecated-target $1: @echo @printf %s\\n '$(call banner-style,Deprecated make call: make $1 $(JUSTFLAGS))' - @printf %s\\n '$(call banner-style,Consider using just instead: just $1)' + @printf %s\\n '$(call banner-style,Consider using just instead: just $(JUSTFLAGS) $1)' @echo - env $(JUSTFLAGS) just $1 + just $(JUSTFLAGS) $1 endef $(foreach element,$(DEPRECATED_TARGETS),$(eval $(call make-deprecated-target,$(element)))) From 174a7045c7666da432d333f7fe228048ce7ad30c Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Thu, 12 Mar 2026 19:10:45 +0000 Subject: [PATCH 02/14] fix(justfiles): pass Make variable overrides as env vars in deprecated shim The deprecated.mk shim was changed to pass JUSTFLAGS as just CLI variable overrides (`just VAR=val target`), but just rejects overrides for variables not declared in the justfile. This broke CI jobs where Make variable assignments propagate through sub-makes (e.g. GO_TEST_FLAGS, GUEST_PROGRAM). Revert to passing them as environment variables via `env`, which is how the shim originally worked in the cannon migration PR. Fixes: go-tests-short, sanitize-op-program CI failures Co-Authored-By: Claude Opus 4.6 --- justfiles/deprecated.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/justfiles/deprecated.mk b/justfiles/deprecated.mk index 03ee92cf068da..9ac15aa6c1b17 100644 --- a/justfiles/deprecated.mk +++ b/justfiles/deprecated.mk @@ -16,9 +16,9 @@ define make-deprecated-target $1: @echo @printf %s\\n '$(call banner-style,Deprecated make call: make $1 $(JUSTFLAGS))' - @printf %s\\n '$(call banner-style,Consider using just instead: just $(JUSTFLAGS) $1)' + @printf %s\\n '$(call banner-style,Consider using just instead: just $1)' @echo - just $(JUSTFLAGS) $1 + env $(JUSTFLAGS) just $1 endef $(foreach element,$(DEPRECATED_TARGETS),$(eval $(call make-deprecated-target,$(element)))) From 6c1c5d97d2d0eecd8f3b5b6e479cfbf04e35a96d Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Wed, 11 Mar 2026 00:06:04 +0000 Subject: [PATCH 03/14] ci: re-trigger cannon-prestate build Co-Authored-By: Claude Opus 4.6 From c0900d121d699b49097c9b67752f307802e05de5 Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Tue, 10 Mar 2026 22:59:14 +0000 Subject: [PATCH 04/14] chore: migrate root Makefile to justfile Migrate root build targets from Make to Just. The Makefile now delegates to just with a deprecation warning, preserving backwards compatibility for existing make invocations. Co-Authored-By: Claude Opus 4.6 --- Makefile | 378 +------------------------------------------------------ justfile | 347 ++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 341 insertions(+), 384 deletions(-) diff --git a/Makefile b/Makefile index ea34470a152e5..e71824901670b 100644 --- a/Makefile +++ b/Makefile @@ -1,377 +1,3 @@ -# provide JUSTFLAGS for just-backed targets -include ./justfiles/flags.mk +DEPRECATED_TARGETS := help build build-go build-contracts build-customlint lint-go lint-go-fix check-op-geth-version golang-docker docker-builder-clean docker-builder compute-git-versions cross-op-node contracts-bedrock-docker submodules op-node generate-mocks-op-node generate-mocks-op-service op-batcher op-proposer op-challenger op-dispute-mon op-supernode op-interop-filter op-program cannon reproducible-prestate-op-program reproducible-prestate-kona reproducible-prestate cannon-prestates mod-tidy clean nuke test-unit semgrep-ci op-program-client op-program-host make-pre-test go-tests go-tests-short go-tests-short-ci go-tests-ci go-tests-ci-kona-action go-tests-fraud-proofs-ci test update-op-geth -BEDROCK_TAGS_REMOTE?=origin -OP_STACK_GO_BUILDER?=us-docker.pkg.dev/oplabs-tools-artifacts/images/op-stack-go:latest - -# Requires at least Python v3.9; specify a minor version below if needed -PYTHON?=python3 - -help: ## Prints this help message - @grep -h -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' - -build: build-go build-contracts ## Builds Go components and contracts-bedrock -.PHONY: build - -build-go: submodules op-node op-proposer op-batcher op-challenger op-dispute-mon op-program cannon ## Builds main Go components -.PHONY: build-go - -build-contracts: - (cd packages/contracts-bedrock && just build) -.PHONY: build-contracts - -build-customlint: - make -C linter build -.PHONY: build-customlint - -lint-go: build-customlint ## Lints Go code with specific linters - ./linter/bin/op-golangci-lint run ./... - go mod tidy -diff -.PHONY: lint-go - -lint-go-fix: build-customlint ## Lints Go code with specific linters and fixes reported issues - ./linter/bin/op-golangci-lint run ./... --fix -.PHONY: lint-go-fix - -check-op-geth-version: ## Checks that op-geth version in go.mod is valid - go run ./ops/scripts/check-op-geth-version -.PHONY: check-op-geth-version - -golang-docker: ## Builds Docker images for Go components using buildx - # We don't use a buildx builder here, and just load directly into regular docker, for convenience. - GIT_COMMIT=$$(git rev-parse HEAD) \ - GIT_DATE=$$(git show -s --format='%ct') \ - IMAGE_TAGS=$$(git rev-parse HEAD),latest \ - docker buildx bake \ - --progress plain \ - --load \ - -f docker-bake.hcl \ - op-node op-batcher op-proposer op-challenger op-dispute-mon op-supervisor -.PHONY: golang-docker - -docker-builder-clean: ## Removes the Docker buildx builder - docker buildx rm buildx-build -.PHONY: docker-builder-clean - -docker-builder: ## Creates a Docker buildx builder - docker buildx create \ - --driver=docker-container --name=buildx-build --bootstrap --use -.PHONY: docker-builder - -compute-git-versions: ## Computes GIT_VERSION for all images and outputs JSON - @GIT_COMMIT=$$(git rev-parse HEAD) ./ops/scripts/compute-git-versions.sh -.PHONY: compute-git-versions - -# add --print to dry-run -cross-op-node: ## Builds cross-platform Docker image for op-node - # We don't use a buildx builder here, and just load directly into regular docker, for convenience. - GIT_COMMIT=$$(git rev-parse HEAD) \ - GIT_DATE=$$(git show -s --format='%ct') \ - IMAGE_TAGS=$$(git rev-parse HEAD),latest \ - PLATFORMS="linux/arm64" \ - GIT_VERSION=$(shell tags=$$(git tag --points-at $(GITCOMMIT) | grep '^op-node/' | sed 's/op-node\///' | sort -V); \ - preferred_tag=$$(echo "$$tags" | grep -v -- '-rc' | tail -n 1); \ - if [ -z "$$preferred_tag" ]; then \ - if [ -z "$$tags" ]; then \ - echo "untagged"; \ - else \ - echo "$$tags" | tail -n 1; \ - fi \ - else \ - echo $$preferred_tag; \ - fi) \ - docker buildx bake \ - --progress plain \ - --builder=buildx-build \ - --load \ - --no-cache \ - -f docker-bake.hcl \ - op-node -.PHONY: cross-op-node - -contracts-bedrock-docker: ## Builds Docker image for Bedrock contracts - IMAGE_TAGS=$$(git rev-parse HEAD),latest \ - docker buildx bake \ - --progress plain \ - --load \ - -f docker-bake.hcl \ - contracts-bedrock -.PHONY: contracts-bedrock-docker - -submodules: ## Updates git submodules - git submodule update --init --recursive -.PHONY: submodules - - -op-node: ## Builds op-node binary - just $(JUSTFLAGS) ./op-node/op-node -.PHONY: op-node - -generate-mocks-op-node: ## Generates mocks for op-node - make -C ./op-node generate-mocks -.PHONY: generate-mocks-op-node - -generate-mocks-op-service: ## Generates mocks for op-service - make -C ./op-service generate-mocks -.PHONY: generate-mocks-op-service - -op-batcher: ## Builds op-batcher binary - just $(JUSTFLAGS) ./op-batcher/op-batcher -.PHONY: op-batcher - -op-proposer: ## Builds op-proposer binary - just $(JUSTFLAGS) ./op-proposer/op-proposer -.PHONY: op-proposer - -op-challenger: ## Builds op-challenger binary - make -C ./op-challenger op-challenger -.PHONY: op-challenger - -op-dispute-mon: ## Builds op-dispute-mon binary - make -C ./op-dispute-mon op-dispute-mon -.PHONY: op-dispute-mon - -op-supernode: ## Builds op-supernode binary - just $(JUSTFLAGS) ./op-supernode/op-supernode -.PHONY: op-supernode - -op-interop-filter: ## Builds op-interop-filter binary - just $(JUSTFLAGS) ./op-interop-filter/op-interop-filter -.PHONY: op-interop-filter - -op-program: ## Builds op-program binary - make -C ./op-program op-program -.PHONY: op-program - -cannon: ## Builds cannon binary - make -C ./cannon cannon -.PHONY: cannon - -reproducible-prestate-op-program: - make -C ./op-program build-reproducible-prestate -.PHONY: reproducible-prestate-op-program - -reproducible-prestate-kona: - cd rust && just build-kona-reproducible-prestate -.PHONY: reproducible-prestate-kona - -reproducible-prestate: reproducible-prestate-op-program reproducible-prestate-kona ## Builds reproducible prestates for op-program and kona - # Output the prestate hashes after all the builds complete so they are easy to find at the end of the build logs. - make -C ./op-program output-prestate-hash - cd rust && just output-kona-prestate-hash -.PHONY: reproducible-prestate - -cannon-prestates: cannon op-program - go run ./op-program/builder/main.go build-all-prestates -.PHONY: cannon-prestates - -mod-tidy: ## Cleans up unused dependencies in Go modules - # Below GOPRIVATE line allows mod-tidy to be run immediately after - # releasing new versions. This bypasses the Go modules proxy, which - # can take a while to index new versions. - # - # See https://proxy.golang.org/ for more info. - export GOPRIVATE="github.com/ethereum-optimism" && go mod tidy -.PHONY: mod-tidy - -clean: ## Removes all generated files under bin/ - rm -rf ./bin - cd packages/contracts-bedrock/ && forge clean -.PHONY: clean - -nuke: clean ## Completely clean the project directory - git clean -Xdf -.PHONY: nuke - -test-unit: ## Runs unit tests for individual components - make -C ./op-node test - make -C ./op-proposer test - make -C ./op-batcher test - make -C ./op-e2e test - (cd packages/contracts-bedrock && just test) -.PHONY: test-unit - -# Remove the baseline-commit to generate a base reading & show all issues -semgrep: ## Runs Semgrep checks - $(eval DEV_REF := $(shell git rev-parse develop)) - SEMGREP_REPO_NAME=ethereum-optimism/optimism semgrep ci --baseline-commit=$(DEV_REF) -.PHONY: semgrep - -op-program-client: ## Builds op-program-client binary - make -C ./op-program op-program-client -.PHONY: op-program-client - -op-program-host: ## Builds op-program-host binary - make -C ./op-program op-program-host -.PHONY: op-program-host - -make-pre-test: ## Makes pre-test setup - make -C ./op-e2e pre-test -.PHONY: make-pre-test - -# Common prerequisites and package list for Go tests -TEST_DEPS := op-program-client op-program-host cannon build-contracts cannon-prestates make-pre-test - -# Excludes: op-validator, op-deployer/pkg/{validation,deployer/{bootstrap,manage,opcm,pipeline,upgrade}} (need RPC) -TEST_PKGS := \ - ./op-alt-da/... \ - ./op-batcher/... \ - ./op-chain-ops/... \ - ./op-node/... \ - ./op-proposer/... \ - ./op-challenger/... \ - ./op-faucet/... \ - ./op-dispute-mon/... \ - ./op-conductor/... \ - ./op-program/... \ - ./op-service/... \ - ./op-supervisor/... \ - ./op-test-sequencer/... \ - ./op-fetcher/... \ - ./op-e2e/system/... \ - ./op-e2e/e2eutils/... \ - ./op-e2e/opgeth/... \ - ./op-e2e/interop/... \ - ./op-e2e/actions/altda \ - ./op-e2e/actions/batcher \ - ./op-e2e/actions/derivation \ - ./op-e2e/actions/helpers \ - ./op-e2e/actions/interop \ - ./op-e2e/actions/proofs \ - ./op-e2e/actions/proposer \ - ./op-e2e/actions/safedb \ - ./op-e2e/actions/sequencer \ - ./op-e2e/actions/sync \ - ./op-e2e/actions/upgrades \ - ./packages/contracts-bedrock/scripts/checks/... \ - ./op-dripper/... \ - ./op-devstack/... \ - ./op-deployer/pkg/deployer/artifacts/... \ - ./op-deployer/pkg/deployer/broadcaster/... \ - ./op-deployer/pkg/deployer/clean/... \ - ./op-deployer/pkg/deployer/integration_test/ \ - ./op-deployer/pkg/deployer/integration_test/cli/... \ - ./op-deployer/pkg/deployer/standard/... \ - ./op-deployer/pkg/deployer/state/... \ - ./op-deployer/pkg/deployer/verify/... \ - ./op-sync-tester/... \ - ./op-supernode/... - -FRAUD_PROOF_TEST_PKGS := \ - ./op-e2e/faultproofs/... - -# Includes: op-validator, op-deployer/pkg/{bootstrap,manage,opcm,pipeline,upgrade} (need RPC) -RPC_TEST_PKGS := \ - ./op-validator/pkg/validations/... \ - ./op-deployer/pkg/deployer/bootstrap/... \ - ./op-deployer/pkg/deployer/manage/... \ - ./op-deployer/pkg/deployer/opcm/... \ - ./op-deployer/pkg/deployer/pipeline/... \ - ./op-deployer/pkg/deployer/upgrade/... - -# All test packages used by CI (combination of all package groups) -ALL_TEST_PACKAGES := $(TEST_PKGS) $(RPC_TEST_PKGS) $(FRAUD_PROOF_TEST_PKGS) - -# Common test environment variables -# For setting PARALLEL, nproc is for linux, sysctl for Mac and then fallback to 4 if neither is available -define DEFAULT_TEST_ENV_VARS -export ENABLE_KURTOSIS=true && \ -export OP_E2E_CANNON_ENABLED="false" && \ -export OP_E2E_USE_HTTP=true && \ -export ENABLE_ANVIL=true && \ -export PARALLEL=$$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) -endef - -# Additional CI-specific environment variables -define CI_ENV_VARS -export OP_TESTLOG_FILE_LOGGER_OUTDIR=$$(realpath ./tmp/testlogs) && \ -export SEPOLIA_RPC_URL="https://ci-sepolia-l1-archive.optimism.io" && \ -export MAINNET_RPC_URL="https://ci-mainnet-l1-archive.optimism.io" && \ -export NAT_INTEROP_LOADTEST_TARGET=10 && \ -export NAT_INTEROP_LOADTEST_TIMEOUT=30s -endef - -# Test timeout (can be overridden via environment) -TEST_TIMEOUT ?= 10m - -go-tests: $(TEST_DEPS) ## Runs comprehensive Go tests across all packages (cached for fast repeated runs) - $(DEFAULT_TEST_ENV_VARS) && \ - go test -parallel=$$PARALLEL -timeout=$(TEST_TIMEOUT) $(TEST_PKGS) -.PHONY: go-tests - -go-tests-short: $(TEST_DEPS) ## Runs comprehensive Go tests with -short flag - $(DEFAULT_TEST_ENV_VARS) && \ - go test -short -parallel=$$PARALLEL -timeout=$(TEST_TIMEOUT) $(TEST_PKGS) -.PHONY: go-tests-short - -# Internal target for running Go tests with gotestsum for CI -# Usage: make _go-tests-ci-internal GO_TEST_FLAGS="-short" -_go-tests-ci-internal: - $(MAKE) -C cannon cannon elf # Required for cannon/provider_test TestLastStepCacheAccuracy - @echo "Setting up test directories..." - mkdir -p ./tmp/test-results ./tmp/testlogs - @echo "Running Go tests with gotestsum..." - $(DEFAULT_TEST_ENV_VARS) && \ - $(CI_ENV_VARS) && \ - if [ -n "$$CIRCLE_NODE_TOTAL" ] && [ "$$CIRCLE_NODE_TOTAL" -gt 1 ]; then \ - export NODE_INDEX=$${CIRCLE_NODE_INDEX:-0} && \ - export NODE_TOTAL=$${CIRCLE_NODE_TOTAL:-1} && \ - export PARALLEL_PACKAGES=$$(echo "$(ALL_TEST_PACKAGES)" | tr ' ' '\n' | awk -v idx=$$NODE_INDEX -v total=$$NODE_TOTAL 'NR % total == idx' | tr '\n' ' ') && \ - if [ -n "$$PARALLEL_PACKAGES" ]; then \ - echo "Node $$NODE_INDEX/$$NODE_TOTAL running packages: $$PARALLEL_PACKAGES"; \ - gotestsum --format=testname \ - --junitfile=./tmp/test-results/results-$$NODE_INDEX.xml \ - --jsonfile=./tmp/testlogs/log-$$NODE_INDEX.json \ - --rerun-fails=3 \ - --rerun-fails-max-failures=50 \ - --packages="$$PARALLEL_PACKAGES" \ - -- -parallel=$$PARALLEL -coverprofile=coverage-$$NODE_INDEX.out $(GO_TEST_FLAGS) -timeout=$(TEST_TIMEOUT) -tags="ci"; \ - else \ - echo "ERROR: Node $$NODE_INDEX/$$NODE_TOTAL has no packages to run! Perhaps parallelism is set too high? (ALL_TEST_PACKAGES has $$(echo '$(ALL_TEST_PACKAGES)' | wc -w) packages)"; \ - exit 1; \ - fi; \ - else \ - gotestsum --format=testname \ - --junitfile=./tmp/test-results/results.xml \ - --jsonfile=./tmp/testlogs/log.json \ - --rerun-fails=3 \ - --rerun-fails-max-failures=50 \ - --packages="$(ALL_TEST_PACKAGES)" \ - -- -parallel=$$PARALLEL -coverprofile=coverage.out $(GO_TEST_FLAGS) -timeout=$(TEST_TIMEOUT) -tags="ci"; \ - fi -.PHONY: _go-tests-ci-internal - -go-tests-short-ci: ## Runs short Go tests with gotestsum for CI (assumes deps built by CI) - $(MAKE) _go-tests-ci-internal GO_TEST_FLAGS="-short" -.PHONY: go-tests-short-ci - -go-tests-ci: ## Runs comprehensive Go tests with gotestsum for CI (assumes deps built by CI) - $(MAKE) _go-tests-ci-internal GO_TEST_FLAGS="" -.PHONY: go-tests-ci - -go-tests-ci-kona-action: ## Runs action tests for kona with gotestsum for CI (assumes deps built by CI) - $(MAKE) _go-tests-ci-internal GO_TEST_FLAGS="-count=1 -timeout 60m -run Test_ProgramAction" -.PHONY: go-tests-ci-kona-action - -go-tests-fraud-proofs-ci: ## Runs fraud proofs Go tests with gotestsum for CI (assumes deps built by CI) - @echo "Setting up test directories..." - mkdir -p ./tmp/test-results ./tmp/testlogs - @echo "Running Go tests with gotestsum..." - $(DEFAULT_TEST_ENV_VARS) && \ - $(CI_ENV_VARS) && \ - export OP_E2E_CANNON_ENABLED="true" && \ - gotestsum --format=testname \ - --junitfile=./tmp/test-results/results.xml \ - --jsonfile=./tmp/testlogs/log.json \ - --rerun-fails=3 \ - --rerun-fails-max-failures=50 \ - --packages="$(FRAUD_PROOF_TEST_PKGS)" \ - -- -parallel=$$PARALLEL -coverprofile=coverage.out -timeout=$(TEST_TIMEOUT) -.PHONY: go-tests-fraud-proofs-ci - -test: go-tests ## Runs comprehensive Go tests (alias for go-tests) -.PHONY: test - -update-op-geth: ## Updates the Geth version used in the project - ./ops/scripts/update-op-geth.py -.PHONY: update-op-geth +include ./justfiles/deprecated.mk diff --git a/justfile b/justfile index d5ed8c55affa0..e75f90acdb7ff 100644 --- a/justfile +++ b/justfile @@ -1,3 +1,338 @@ +import 'justfiles/git.just' + +BEDROCK_TAGS_REMOTE := env('BEDROCK_TAGS_REMOTE', 'origin') +OP_STACK_GO_BUILDER := env('OP_STACK_GO_BUILDER', 'us-docker.pkg.dev/oplabs-tools-artifacts/images/op-stack-go:latest') +PYTHON := env('PYTHON', 'python3') + +TEST_TIMEOUT := env('TEST_TIMEOUT', '10m') + +TEST_PKGS := "./op-alt-da/... ./op-batcher/... ./op-chain-ops/... ./op-node/... ./op-proposer/... ./op-challenger/... ./op-faucet/... ./op-dispute-mon/... ./op-conductor/... ./op-program/... ./op-service/... ./op-supervisor/... ./op-test-sequencer/... ./op-fetcher/... ./op-e2e/system/... ./op-e2e/e2eutils/... ./op-e2e/opgeth/... ./op-e2e/interop/... ./op-e2e/actions/altda ./op-e2e/actions/batcher ./op-e2e/actions/derivation ./op-e2e/actions/helpers ./op-e2e/actions/interop ./op-e2e/actions/proofs ./op-e2e/actions/proposer ./op-e2e/actions/safedb ./op-e2e/actions/sequencer ./op-e2e/actions/sync ./op-e2e/actions/upgrades ./packages/contracts-bedrock/scripts/checks/... ./op-dripper/... ./devnet-sdk/... ./kurtosis-devnet/... ./op-devstack/... ./op-deployer/pkg/deployer/artifacts/... ./op-deployer/pkg/deployer/broadcaster/... ./op-deployer/pkg/deployer/clean/... ./op-deployer/pkg/deployer/integration_test/ ./op-deployer/pkg/deployer/integration_test/cli/... ./op-deployer/pkg/deployer/standard/... ./op-deployer/pkg/deployer/state/... ./op-deployer/pkg/deployer/verify/... ./op-sync-tester/... ./op-supernode/..." + +FRAUD_PROOF_TEST_PKGS := "./op-e2e/faultproofs/..." + +RPC_TEST_PKGS := "./op-validator/pkg/validations/... ./op-deployer/pkg/deployer/bootstrap/... ./op-deployer/pkg/deployer/manage/... ./op-deployer/pkg/deployer/opcm/... ./op-deployer/pkg/deployer/pipeline/... ./op-deployer/pkg/deployer/upgrade/..." + +ALL_TEST_PACKAGES := TEST_PKGS + " " + RPC_TEST_PKGS + " " + FRAUD_PROOF_TEST_PKGS + +# Lists all available targets. +help: + @just --list + +# Builds Go components and contracts-bedrock. +build: build-go build-contracts + +# Builds main Go components. +build-go: submodules op-node op-proposer op-batcher op-challenger op-dispute-mon op-program cannon + +# Builds contracts-bedrock. +build-contracts: + cd packages/contracts-bedrock && just build + +# Builds the custom linter. +build-customlint: + make -C linter build + +# Lints Go code with specific linters. +lint-go: build-customlint + ./linter/bin/op-golangci-lint run ./... + go mod tidy -diff + +# Lints Go code with specific linters and fixes reported issues. +lint-go-fix: build-customlint + ./linter/bin/op-golangci-lint run ./... --fix + +# Checks that op-geth version in go.mod is valid. +check-op-geth-version: + go run ./ops/scripts/check-op-geth-version + +# Builds Docker images for Go components using buildx. +[script('bash')] +golang-docker: + set -euo pipefail + GIT_COMMIT=$(git rev-parse HEAD) \ + GIT_DATE=$(git show -s --format='%ct') \ + IMAGE_TAGS=$(git rev-parse HEAD),latest \ + docker buildx bake \ + --progress plain \ + --load \ + -f docker-bake.hcl \ + op-node op-batcher op-proposer op-challenger op-dispute-mon op-supervisor + +# Removes the Docker buildx builder. +docker-builder-clean: + docker buildx rm buildx-build + +# Creates a Docker buildx builder. +docker-builder: + docker buildx create \ + --driver=docker-container --name=buildx-build --bootstrap --use + +# Computes GIT_VERSION for all images and outputs JSON. +[script('bash')] +compute-git-versions: + GIT_COMMIT=$(git rev-parse HEAD) ./ops/scripts/compute-git-versions.sh + +# Builds cross-platform Docker image for op-node. +[script('bash')] +cross-op-node: + set -euo pipefail + GITCOMMIT=$(git rev-parse HEAD) + tags=$(git tag --points-at "$GITCOMMIT" | grep '^op-node/' | sed 's/op-node\///' | sort -V) + preferred_tag=$(echo "$tags" | grep -v -- '-rc' | tail -n 1) + if [ -z "$preferred_tag" ]; then + if [ -z "$tags" ]; then + GIT_VERSION="untagged" + else + GIT_VERSION=$(echo "$tags" | tail -n 1) + fi + else + GIT_VERSION="$preferred_tag" + fi + GIT_COMMIT="$GITCOMMIT" \ + GIT_DATE=$(git show -s --format='%ct') \ + IMAGE_TAGS=$(git rev-parse HEAD),latest \ + PLATFORMS="linux/arm64" \ + GIT_VERSION="$GIT_VERSION" \ + docker buildx bake \ + --progress plain \ + --builder=buildx-build \ + --load \ + --no-cache \ + -f docker-bake.hcl \ + op-node + +# Builds Docker image for Bedrock contracts. +[script('bash')] +contracts-bedrock-docker: + set -euo pipefail + IMAGE_TAGS=$(git rev-parse HEAD),latest \ + docker buildx bake \ + --progress plain \ + --load \ + -f docker-bake.hcl \ + contracts-bedrock + +# Updates git submodules. +submodules: + git submodule update --init --recursive + +# Builds op-node binary. +op-node: + just ./op-node/op-node + +# Generates mocks for op-node. +generate-mocks-op-node: + make -C ./op-node generate-mocks + +# Generates mocks for op-service. +generate-mocks-op-service: + make -C ./op-service generate-mocks + +# Builds op-batcher binary. +op-batcher: + just ./op-batcher/op-batcher + +# Builds op-proposer binary. +op-proposer: + just ./op-proposer/op-proposer + +# Builds op-challenger binary. +op-challenger: + make -C ./op-challenger op-challenger + +# Builds op-dispute-mon binary. +op-dispute-mon: + make -C ./op-dispute-mon op-dispute-mon + +# Builds op-supernode binary. +op-supernode: + just ./op-supernode/op-supernode + +# Builds op-interop-filter binary. +op-interop-filter: + just ./op-interop-filter/op-interop-filter + +# Builds op-program binary. +op-program: + make -C ./op-program op-program + +# Builds cannon binary. +cannon: + make -C ./cannon cannon + +# Builds reproducible prestate for op-program. +reproducible-prestate-op-program: + make -C ./op-program build-reproducible-prestate + +# Builds reproducible prestate for kona. +reproducible-prestate-kona: + cd rust && just build-kona-reproducible-prestate + +# Builds reproducible prestates for op-program and kona. +reproducible-prestate: reproducible-prestate-op-program reproducible-prestate-kona + make -C ./op-program output-prestate-hash + cd rust && just output-kona-prestate-hash + +# Builds cannon prestates. +cannon-prestates: cannon op-program + go run ./op-program/builder/main.go build-all-prestates + +# Cleans up unused dependencies in Go modules. +mod-tidy: + GOPRIVATE="github.com/ethereum-optimism" go mod tidy + +# Removes all generated files under bin/. +clean: + rm -rf ./bin + cd packages/contracts-bedrock/ && forge clean + +# Completely clean the project directory. +nuke: clean + git clean -Xdf + +# Runs unit tests for individual components. +test-unit: + make -C ./op-node test + make -C ./op-proposer test + make -C ./op-batcher test + make -C ./op-e2e test + cd packages/contracts-bedrock && just test + +# Runs semgrep on the entire monorepo. +semgrep: + semgrep scan --config .semgrep/rules/ --error . + +# Runs semgrep CI checks against develop baseline. +[script('bash')] +semgrep-ci: + set -euo pipefail + DEV_REF=$(git rev-parse develop) + SEMGREP_REPO_NAME=ethereum-optimism/optimism semgrep ci --baseline-commit="$DEV_REF" + +# Builds op-program-client binary. +op-program-client: + make -C ./op-program op-program-client + +# Builds op-program-host binary. +op-program-host: + make -C ./op-program op-program-host + +# Makes pre-test setup. +make-pre-test: + make -C ./op-e2e pre-test + +# Runs comprehensive Go tests across all packages. +[script('bash')] +go-tests: op-program-client op-program-host cannon build-contracts cannon-prestates make-pre-test + set -euo pipefail + export ENABLE_KURTOSIS=true + export OP_E2E_CANNON_ENABLED="false" + export OP_E2E_USE_HTTP=true + export ENABLE_ANVIL=true + export PARALLEL=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) + go test -parallel="$PARALLEL" -timeout={{TEST_TIMEOUT}} {{TEST_PKGS}} + +# Runs comprehensive Go tests with -short flag. +[script('bash')] +go-tests-short: op-program-client op-program-host cannon build-contracts cannon-prestates make-pre-test + set -euo pipefail + export ENABLE_KURTOSIS=true + export OP_E2E_CANNON_ENABLED="false" + export OP_E2E_USE_HTTP=true + export ENABLE_ANVIL=true + export PARALLEL=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) + go test -short -parallel="$PARALLEL" -timeout={{TEST_TIMEOUT}} {{TEST_PKGS}} + +# Internal: runs Go tests with gotestsum for CI. +[script('bash')] +_go-tests-ci-internal go_test_flags="": + set -euo pipefail + make -C cannon cannon elf + echo "Setting up test directories..." + mkdir -p ./tmp/test-results ./tmp/testlogs + echo "Running Go tests with gotestsum..." + export ENABLE_KURTOSIS=true + export OP_E2E_CANNON_ENABLED="false" + export OP_E2E_USE_HTTP=true + export ENABLE_ANVIL=true + export PARALLEL=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) + export OP_TESTLOG_FILE_LOGGER_OUTDIR=$(realpath ./tmp/testlogs) + export SEPOLIA_RPC_URL="https://ci-sepolia-l1-archive.optimism.io" + export MAINNET_RPC_URL="https://ci-mainnet-l1-archive.optimism.io" + export NAT_INTEROP_LOADTEST_TARGET=10 + export NAT_INTEROP_LOADTEST_TIMEOUT=30s + ALL_PACKAGES="{{ALL_TEST_PACKAGES}}" + if [ -n "${CIRCLE_NODE_TOTAL:-}" ] && [ "$CIRCLE_NODE_TOTAL" -gt 1 ]; then + NODE_INDEX=${CIRCLE_NODE_INDEX:-0} + NODE_TOTAL=${CIRCLE_NODE_TOTAL:-1} + PARALLEL_PACKAGES=$(echo "$ALL_PACKAGES" | tr ' ' '\n' | awk -v idx="$NODE_INDEX" -v total="$NODE_TOTAL" 'NR % total == idx' | tr '\n' ' ') + if [ -n "$PARALLEL_PACKAGES" ]; then + echo "Node $NODE_INDEX/$NODE_TOTAL running packages: $PARALLEL_PACKAGES" + gotestsum --format=testname \ + --junitfile=./tmp/test-results/results-"$NODE_INDEX".xml \ + --jsonfile=./tmp/testlogs/log-"$NODE_INDEX".json \ + --rerun-fails=3 \ + --rerun-fails-max-failures=50 \ + --packages="$PARALLEL_PACKAGES" \ + -- -parallel="$PARALLEL" -coverprofile=coverage-"$NODE_INDEX".out {{go_test_flags}} -timeout={{TEST_TIMEOUT}} -tags="ci" + else + echo "ERROR: Node $NODE_INDEX/$NODE_TOTAL has no packages to run! Perhaps parallelism is set too high? (ALL_TEST_PACKAGES has $(echo "$ALL_PACKAGES" | wc -w) packages)" + exit 1 + fi + else + gotestsum --format=testname \ + --junitfile=./tmp/test-results/results.xml \ + --jsonfile=./tmp/testlogs/log.json \ + --rerun-fails=3 \ + --rerun-fails-max-failures=50 \ + --packages="$ALL_PACKAGES" \ + -- -parallel="$PARALLEL" -coverprofile=coverage.out {{go_test_flags}} -timeout={{TEST_TIMEOUT}} -tags="ci" + fi + +# Runs short Go tests with gotestsum for CI. +go-tests-short-ci: + just _go-tests-ci-internal "-short" + +# Runs comprehensive Go tests with gotestsum for CI. +go-tests-ci: + just _go-tests-ci-internal "" + +# Runs action tests for kona with gotestsum for CI. +go-tests-ci-kona-action: + just _go-tests-ci-internal "-count=1 -timeout 60m -run Test_ProgramAction" + +# Runs fraud proofs Go tests with gotestsum for CI. +[script('bash')] +go-tests-fraud-proofs-ci: + set -euo pipefail + echo "Setting up test directories..." + mkdir -p ./tmp/test-results ./tmp/testlogs + echo "Running Go tests with gotestsum..." + export ENABLE_KURTOSIS=true + export OP_E2E_CANNON_ENABLED="true" + export OP_E2E_USE_HTTP=true + export ENABLE_ANVIL=true + export PARALLEL=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) + export OP_TESTLOG_FILE_LOGGER_OUTDIR=$(realpath ./tmp/testlogs) + export SEPOLIA_RPC_URL="https://ci-sepolia-l1-archive.optimism.io" + export MAINNET_RPC_URL="https://ci-mainnet-l1-archive.optimism.io" + export NAT_INTEROP_LOADTEST_TARGET=10 + export NAT_INTEROP_LOADTEST_TIMEOUT=30s + gotestsum --format=testname \ + --junitfile=./tmp/test-results/results.xml \ + --jsonfile=./tmp/testlogs/log.json \ + --rerun-fails=3 \ + --rerun-fails-max-failures=50 \ + --packages="{{FRAUD_PROOF_TEST_PKGS}}" \ + -- -parallel="$PARALLEL" -coverprofile=coverage.out -timeout={{TEST_TIMEOUT}} + +# Runs comprehensive Go tests (alias for go-tests). +test: go-tests + +# Updates the Geth version used in the project. +update-op-geth: + ./ops/scripts/update-op-geth.py + # Build all Rust binaries (release) for sysgo tests. build-rust-release: cd rust && cargo build --release --bin kona-node @@ -12,10 +347,6 @@ check-nut-locks: todo-checker: ./ops/scripts/todo-checker.sh -# Runs semgrep on the entire monorepo. -semgrep: - semgrep scan --config .semgrep/rules/ --error . - # Runs semgrep tests. semgrep-test: semgrep scan --test --config .semgrep/rules/ .semgrep/tests/ @@ -37,11 +368,11 @@ latest-versions: ./ops/scripts/latest-versions.sh # Usage: -# just update-op-geth 2f0528b -# just update-op-geth v1.101602.4 -# just update-op-geth optimism +# just update-op-geth-ref 2f0528b +# just update-op-geth-ref v1.101602.4 +# just update-op-geth-ref optimism [script('bash')] -update-op-geth ref: +update-op-geth-ref ref: set -euo pipefail ref="{{ref}}" if [ -z "$ref" ]; then echo "error: provide a hash/tag/branch"; exit 1; fi From 968c58e1eaf98c9fdd4276b94224641f7b6547e2 Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Wed, 11 Mar 2026 02:44:39 +0000 Subject: [PATCH 05/14] docs: update CONTRIBUTING.md to use just instead of make Co-Authored-By: Claude Opus 4.6 --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e851085a56e44..5ecd50abecf22 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,7 +108,7 @@ You must install all of the required [Software Dependencies](#software-dependenc Optimism Monorepo. Once you've done so, run the following command to build: ```bash -make build +just build ``` Packages built on one branch may not be compatible with packages on a different branch. From 3b4662f7574761470305bc5c1638861ac5a60881 Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Thu, 12 Mar 2026 22:49:47 +0000 Subject: [PATCH 06/14] fix: convert make -C calls to just and restore GOPRIVATE comment All subdirectories now have justfiles with deprecated Make shims, so convert remaining make -C calls to cd && just. Also restores the explanatory comment on mod-tidy's GOPRIVATE usage. Co-Authored-By: Claude Opus 4.6 --- justfile | 36 +++++++++++++++++++----------------- op-e2e/justfile | 2 +- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/justfile b/justfile index e75f90acdb7ff..cb1b85dafed8d 100644 --- a/justfile +++ b/justfile @@ -30,7 +30,7 @@ build-contracts: # Builds the custom linter. build-customlint: - make -C linter build + cd linter && just build # Lints Go code with specific linters. lint-go: build-customlint @@ -122,11 +122,11 @@ op-node: # Generates mocks for op-node. generate-mocks-op-node: - make -C ./op-node generate-mocks + cd op-node && just generate-mocks # Generates mocks for op-service. generate-mocks-op-service: - make -C ./op-service generate-mocks + cd op-service && just generate-mocks # Builds op-batcher binary. op-batcher: @@ -138,11 +138,11 @@ op-proposer: # Builds op-challenger binary. op-challenger: - make -C ./op-challenger op-challenger + cd op-challenger && just op-challenger # Builds op-dispute-mon binary. op-dispute-mon: - make -C ./op-dispute-mon op-dispute-mon + cd op-dispute-mon && just op-dispute-mon # Builds op-supernode binary. op-supernode: @@ -154,15 +154,15 @@ op-interop-filter: # Builds op-program binary. op-program: - make -C ./op-program op-program + cd op-program && just op-program # Builds cannon binary. cannon: - make -C ./cannon cannon + cd cannon && just cannon # Builds reproducible prestate for op-program. reproducible-prestate-op-program: - make -C ./op-program build-reproducible-prestate + cd op-program && just build-reproducible-prestate # Builds reproducible prestate for kona. reproducible-prestate-kona: @@ -170,7 +170,7 @@ reproducible-prestate-kona: # Builds reproducible prestates for op-program and kona. reproducible-prestate: reproducible-prestate-op-program reproducible-prestate-kona - make -C ./op-program output-prestate-hash + cd op-program && just output-prestate-hash cd rust && just output-kona-prestate-hash # Builds cannon prestates. @@ -178,6 +178,8 @@ cannon-prestates: cannon op-program go run ./op-program/builder/main.go build-all-prestates # Cleans up unused dependencies in Go modules. +# Bypasses the Go module proxy for freshly released versions. +# See https://proxy.golang.org/ for more info. mod-tidy: GOPRIVATE="github.com/ethereum-optimism" go mod tidy @@ -192,10 +194,10 @@ nuke: clean # Runs unit tests for individual components. test-unit: - make -C ./op-node test - make -C ./op-proposer test - make -C ./op-batcher test - make -C ./op-e2e test + cd op-node && just test + cd op-proposer && just test + cd op-batcher && just test + cd op-e2e && just test cd packages/contracts-bedrock && just test # Runs semgrep on the entire monorepo. @@ -211,15 +213,15 @@ semgrep-ci: # Builds op-program-client binary. op-program-client: - make -C ./op-program op-program-client + cd op-program && just op-program-client # Builds op-program-host binary. op-program-host: - make -C ./op-program op-program-host + cd op-program && just op-program-host # Makes pre-test setup. make-pre-test: - make -C ./op-e2e pre-test + cd op-e2e && just pre-test # Runs comprehensive Go tests across all packages. [script('bash')] @@ -247,7 +249,7 @@ go-tests-short: op-program-client op-program-host cannon build-contracts cannon- [script('bash')] _go-tests-ci-internal go_test_flags="": set -euo pipefail - make -C cannon cannon elf + cd cannon && just cannon elf echo "Setting up test directories..." mkdir -p ./tmp/test-results ./tmp/testlogs echo "Running Go tests with gotestsum..." diff --git a/op-e2e/justfile b/op-e2e/justfile index 72002fe4b54b6..2fe97ed1098e4 100644 --- a/op-e2e/justfile +++ b/op-e2e/justfile @@ -49,7 +49,7 @@ test-fault-proofs: pre-test # Build cannon prestates cannon-prestates: - make -C .. cannon-prestates + cd .. && just cannon-prestates # Pre-test setup pre-test: pre-test-cannon From a604077d46146a4062bd3e5a628acc249b5f96f5 Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Thu, 12 Mar 2026 23:22:11 +0000 Subject: [PATCH 07/14] fix: run reproducible-prestate builds in parallel just doesn't parallelize dependencies like make -j does. Use background processes with wait to run op-program and kona prestate builds concurrently. Co-Authored-By: Claude Opus 4.6 --- justfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index cb1b85dafed8d..4f07ddd297e0e 100644 --- a/justfile +++ b/justfile @@ -168,8 +168,15 @@ reproducible-prestate-op-program: reproducible-prestate-kona: cd rust && just build-kona-reproducible-prestate -# Builds reproducible prestates for op-program and kona. -reproducible-prestate: reproducible-prestate-op-program reproducible-prestate-kona +# Builds reproducible prestates for op-program and kona in parallel. +[script('bash')] +reproducible-prestate: + set -euo pipefail + (cd op-program && just build-reproducible-prestate) & + pid1=$! + (cd rust && just build-kona-reproducible-prestate) & + pid2=$! + wait "$pid1" "$pid2" cd op-program && just output-prestate-hash cd rust && just output-kona-prestate-hash From fe32fdba8cf9cf34d7a1ebd4d31662a05857014e Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Thu, 12 Mar 2026 23:26:17 +0000 Subject: [PATCH 08/14] fix: use subshell for cd in _go-tests-ci-internal The cd into cannon/ was changing the CWD for the rest of the script, causing gotestsum to run from cannon/ instead of the repo root. The original Makefile used $(MAKE) -C which spawns a subprocess. Use a subshell to match that behavior. Co-Authored-By: Claude Opus 4.6 --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index 4f07ddd297e0e..b2829db0c3a5a 100644 --- a/justfile +++ b/justfile @@ -256,7 +256,7 @@ go-tests-short: op-program-client op-program-host cannon build-contracts cannon- [script('bash')] _go-tests-ci-internal go_test_flags="": set -euo pipefail - cd cannon && just cannon elf + (cd cannon && just cannon elf) echo "Setting up test directories..." mkdir -p ./tmp/test-results ./tmp/testlogs echo "Running Go tests with gotestsum..." From f9af61b6214be0db268c53e3356c7999db97f0b3 Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Fri, 13 Mar 2026 00:08:12 +0000 Subject: [PATCH 09/14] fix: use subshells for sequential cd in reproducible-prestate The bare `cd op-program` on line 180 changed cwd persistently, so the following `cd rust` tried to resolve `op-program/rust/` which doesn't exist. Wrap both in subshells to preserve the original working directory. Co-Authored-By: Claude Opus 4.6 --- justfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index b2829db0c3a5a..760f7baad142e 100644 --- a/justfile +++ b/justfile @@ -177,8 +177,8 @@ reproducible-prestate: (cd rust && just build-kona-reproducible-prestate) & pid2=$! wait "$pid1" "$pid2" - cd op-program && just output-prestate-hash - cd rust && just output-kona-prestate-hash + (cd op-program && just output-prestate-hash) + (cd rust && just output-kona-prestate-hash) # Builds cannon prestates. cannon-prestates: cannon op-program From 8ce13630c2fe06e947449803a687db50bcad9674 Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Fri, 13 Mar 2026 00:32:10 +0000 Subject: [PATCH 10/14] fix: remove devnet-sdk and kurtosis-devnet from TEST_PKGS These directories were removed in #19506 but the justfile still referenced them, causing go-tests-short-ci to fail with "lstat ./devnet-sdk/: no such file or directory". Co-Authored-By: Claude Opus 4.6 --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index 760f7baad142e..8dab027f3226c 100644 --- a/justfile +++ b/justfile @@ -6,7 +6,7 @@ PYTHON := env('PYTHON', 'python3') TEST_TIMEOUT := env('TEST_TIMEOUT', '10m') -TEST_PKGS := "./op-alt-da/... ./op-batcher/... ./op-chain-ops/... ./op-node/... ./op-proposer/... ./op-challenger/... ./op-faucet/... ./op-dispute-mon/... ./op-conductor/... ./op-program/... ./op-service/... ./op-supervisor/... ./op-test-sequencer/... ./op-fetcher/... ./op-e2e/system/... ./op-e2e/e2eutils/... ./op-e2e/opgeth/... ./op-e2e/interop/... ./op-e2e/actions/altda ./op-e2e/actions/batcher ./op-e2e/actions/derivation ./op-e2e/actions/helpers ./op-e2e/actions/interop ./op-e2e/actions/proofs ./op-e2e/actions/proposer ./op-e2e/actions/safedb ./op-e2e/actions/sequencer ./op-e2e/actions/sync ./op-e2e/actions/upgrades ./packages/contracts-bedrock/scripts/checks/... ./op-dripper/... ./devnet-sdk/... ./kurtosis-devnet/... ./op-devstack/... ./op-deployer/pkg/deployer/artifacts/... ./op-deployer/pkg/deployer/broadcaster/... ./op-deployer/pkg/deployer/clean/... ./op-deployer/pkg/deployer/integration_test/ ./op-deployer/pkg/deployer/integration_test/cli/... ./op-deployer/pkg/deployer/standard/... ./op-deployer/pkg/deployer/state/... ./op-deployer/pkg/deployer/verify/... ./op-sync-tester/... ./op-supernode/..." +TEST_PKGS := "./op-alt-da/... ./op-batcher/... ./op-chain-ops/... ./op-node/... ./op-proposer/... ./op-challenger/... ./op-faucet/... ./op-dispute-mon/... ./op-conductor/... ./op-program/... ./op-service/... ./op-supervisor/... ./op-test-sequencer/... ./op-fetcher/... ./op-e2e/system/... ./op-e2e/e2eutils/... ./op-e2e/opgeth/... ./op-e2e/interop/... ./op-e2e/actions/altda ./op-e2e/actions/batcher ./op-e2e/actions/derivation ./op-e2e/actions/helpers ./op-e2e/actions/interop ./op-e2e/actions/proofs ./op-e2e/actions/proposer ./op-e2e/actions/safedb ./op-e2e/actions/sequencer ./op-e2e/actions/sync ./op-e2e/actions/upgrades ./packages/contracts-bedrock/scripts/checks/... ./op-dripper/... ./op-devstack/... ./op-deployer/pkg/deployer/artifacts/... ./op-deployer/pkg/deployer/broadcaster/... ./op-deployer/pkg/deployer/clean/... ./op-deployer/pkg/deployer/integration_test/ ./op-deployer/pkg/deployer/integration_test/cli/... ./op-deployer/pkg/deployer/standard/... ./op-deployer/pkg/deployer/state/... ./op-deployer/pkg/deployer/verify/... ./op-sync-tester/... ./op-supernode/..." FRAUD_PROOF_TEST_PKGS := "./op-e2e/faultproofs/..." From dc806302c51c3ab458dedc336a77f63faf2d273d Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Wed, 11 Mar 2026 03:51:07 +0000 Subject: [PATCH 11/14] ci: update CircleCI config to use just instead of make Migrates all CircleCI make invocations to just for targets that have been migrated to justfiles. Remaining make calls are for packages not yet migrated (op-challenger, op-node, op-service, op-chain-ops fuzz targets) and cannon/testdata which has its own Makefile. Co-Authored-By: Claude Opus 4.6 --- .circleci/continue/main.yml | 44 ++++++++++++++++++---------------- .circleci/continue/rust-ci.yml | 2 +- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.circleci/continue/main.yml b/.circleci/continue/main.yml index aabb4c2a505ee..ba57aed438e3c 100644 --- a/.circleci/continue/main.yml +++ b/.circleci/continue/main.yml @@ -941,7 +941,7 @@ jobs: - run: name: Cannon Go lint command: | - make lint + just lint working_directory: cannon - run: name: Cannon Go 64-bit tests @@ -1804,7 +1804,7 @@ jobs: - run: name: run Go linter command: | - make lint-go + just lint-go - save_cache: key: golangci-v1-{{ checksum ".golangci.yaml" }} paths: @@ -1822,7 +1822,7 @@ jobs: namespace: sysgo-go-binaries - run: name: Build Go binaries for sysgo - command: make cannon op-program + command: just cannon op-program - go-save-cache: namespace: sysgo-go-binaries - persist_to_workspace: @@ -1843,7 +1843,7 @@ jobs: - run: name: check op-geth version command: | - make check-op-geth-version + just check-op-geth-version check-nut-locks: docker: @@ -1902,7 +1902,7 @@ jobs: - restore_cache: key: go-tests-v2-{{ checksum "go.mod" }} - run: - name: Run Go tests via Makefile + name: Run Go tests no_output_timeout: <> command: | <> @@ -1910,7 +1910,7 @@ jobs: # set to less than number CPUs (xlarge Docker is 16 CPU) so there's some buffer for things # like Geth export PARALLEL=12 - make <> + just <> - save_cache: key: go-tests-v2-{{ checksum "go.mod" }} paths: @@ -1977,22 +1977,22 @@ jobs: at: . - run: name: build op-program-client - command: make op-program-client + command: just op-program-client working_directory: op-program - run: name: build op-program-host - command: make op-program-host + command: just op-program-host working_directory: op-program - run: name: build cannon - command: make cannon + command: just cannon - run: name: run tests no_output_timeout: <> command: | <> export TEST_TIMEOUT=<> - make go-tests-fraud-proofs-ci + just go-tests-fraud-proofs-ci - codecov/upload: disable_search: true files: ./coverage.out @@ -2365,13 +2365,13 @@ jobs: sudo apt-get install -y binutils-mips-linux-gnu - run: name: Build cannon - command: make cannon + command: just cannon - run: name: Build op-program - command: make op-program + command: just op-program - run: name: Sanitize op-program client - command: make sanitize-program GUEST_PROGRAM=../op-program/bin/op-program-client64.elf + command: GUEST_PROGRAM=../op-program/bin/op-program-client64.elf just sanitize-program working_directory: cannon cannon-prestate: @@ -2383,7 +2383,7 @@ jobs: enable-mise-cache: true - run: name: Build prestates - command: make -j reproducible-prestate + command: just reproducible-prestate - persist_to_workspace: root: . paths: @@ -2485,7 +2485,8 @@ jobs: enable-mise-cache: true - run: name: Verify reproducibility - command: make -C op-program verify-reproducibility + command: just verify-reproducibility + working_directory: op-program - store_artifacts: path: ./op-program/temp/logs when: always @@ -2502,10 +2503,11 @@ jobs: - setup_remote_docker - run: name: Build cannon - command: make cannon + command: just cannon - run: name: Verify the Cannon STF - command: make -C ./cannon cannon-stf-verify + command: just cannon-stf-verify + working_directory: cannon - notify-failures-on-develop: mentions: "@proofs-team" @@ -2572,7 +2574,7 @@ jobs: - run: name: Run Analyzer command: | - make run-vm-compat + just run-vm-compat working_directory: op-program - store_artifacts: path: op-program/bin/vm-compat-output/vm-compat-findings.json @@ -2590,7 +2592,7 @@ jobs: - run: name: Verify Compatibility command: | - make verify-compat + just verify-compat working_directory: op-program check-generated-mocks-op-node: @@ -2605,7 +2607,7 @@ jobs: patterns: op-node - run: name: check-generated-mocks - command: make generate-mocks-op-node && git diff --exit-code + command: just generate-mocks-op-node && git diff --exit-code check-generated-mocks-op-service: docker: @@ -2619,7 +2621,7 @@ jobs: patterns: op-service - run: name: check-generated-mocks - command: make generate-mocks-op-service && git diff --exit-code + command: just generate-mocks-op-service && git diff --exit-code op-deployer-forge-version: docker: diff --git a/.circleci/continue/rust-ci.yml b/.circleci/continue/rust-ci.yml index 2db59a0c8b7d7..6e75f363d7425 100644 --- a/.circleci/continue/rust-ci.yml +++ b/.circleci/continue/rust-ci.yml @@ -858,7 +858,7 @@ jobs: - run: name: Build cannon command: | - cd cannon && make + cd cannon && just cannon sudo mv ./bin/cannon /usr/local/bin/ - run: name: Set run environment From a96d474f3732966acc13a87e7cca6a637fe79782 Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Wed, 11 Mar 2026 03:54:11 +0000 Subject: [PATCH 12/14] chore(cannon): migrate testdata Makefiles to justfiles Migrates cannon/testdata/, cannon/testdata/go-1-24/, and cannon/testdata/go-1-25/ Makefiles to justfiles. The Make pattern rules for building ELF binaries from go.mod directories are replaced with shell loops that discover and build all directories dynamically. Also updates cannon/justfile to call just instead of make -C for testdata targets, and updates the CI config accordingly. Co-Authored-By: Claude Opus 4.6 --- .circleci/continue/main.yml | 2 +- cannon/justfile | 4 ++-- cannon/testdata/Makefile | 18 ++---------------- cannon/testdata/go-1-24/Makefile | 29 ++--------------------------- cannon/testdata/go-1-24/justfile | 28 ++++++++++++++++++++++++++++ cannon/testdata/go-1-25/Makefile | 29 ++--------------------------- cannon/testdata/go-1-25/justfile | 28 ++++++++++++++++++++++++++++ cannon/testdata/justfile | 15 +++++++++++++++ 8 files changed, 80 insertions(+), 73 deletions(-) create mode 100644 cannon/testdata/go-1-24/justfile create mode 100644 cannon/testdata/go-1-25/justfile create mode 100644 cannon/testdata/justfile diff --git a/.circleci/continue/main.yml b/.circleci/continue/main.yml index ba57aed438e3c..c017c74032784 100644 --- a/.circleci/continue/main.yml +++ b/.circleci/continue/main.yml @@ -936,7 +936,7 @@ jobs: mkdir -p ./tmp/testlogs - run: name: build Cannon example binaries - command: make elf # only compile ELF binaries with Go, we do not have MIPS GCC for creating the debug-dumps. + command: just elf # only compile ELF binaries with Go, we do not have MIPS GCC for creating the debug-dumps. working_directory: cannon/testdata - run: name: Cannon Go lint diff --git a/cannon/justfile b/cannon/justfile index 82d52c460e961..bf3345601b789 100644 --- a/cannon/justfile +++ b/cannon/justfile @@ -33,11 +33,11 @@ clean: # Build ELF test binaries elf: - make -C ./testdata elf + just ./testdata/elf # Build ELF test binaries for current Go version elf-go-current: - make -C ./testdata/go-1-24 elf + just ./testdata/go-1-24/elf # Check guest program for unsupported MIPS instructions sanitize-program: diff --git a/cannon/testdata/Makefile b/cannon/testdata/Makefile index a74e1aeae46e6..6b18e6cc787c1 100644 --- a/cannon/testdata/Makefile +++ b/cannon/testdata/Makefile @@ -1,17 +1,3 @@ -all: elf +DEPRECATED_TARGETS := elf go1-24 go1-25 clean -go1-24: - make -C ./go-1-24 elf -.PHONY: go1-24 - -go1-25: - make -C ./go-1-25 elf -.PHONY: go1-25 - -.PHONY: elf -elf: go1-24 go1-25 - -.PHONY: clean -clean: - make -C ./go-1-24 clean - make -C ./go-1-25 clean +include ../../justfiles/deprecated.mk diff --git a/cannon/testdata/go-1-24/Makefile b/cannon/testdata/go-1-24/Makefile index f4a7a51bf81bd..cd4c47589bd43 100644 --- a/cannon/testdata/go-1-24/Makefile +++ b/cannon/testdata/go-1-24/Makefile @@ -1,28 +1,3 @@ -all: elf +DEPRECATED_TARGETS := elf elf64 dump clean -.PHONY: elf64 -elf64: $(patsubst %/go.mod,bin/%.64.elf,$(wildcard */go.mod)) - -.PHONY: elf -elf: elf64 - -.PHONY: dump -dump: $(patsubst %/go.mod,bin/%.dump,$(wildcard */go.mod)) - -.PHONY: clean -clean: - @[ -d bin ] && find bin -maxdepth 1 -type f -delete - -bin: - mkdir bin - -# take any directory with a go mod, and build an ELF -# verify output with: readelf -h bin/.elf -# result is mips64, big endian, R3000 -bin/%.64.elf: bin - cd $(@:bin/%.64.elf=%) && GOOS=linux GOARCH=mips64 GOMIPS64=softfloat go build -o ../$@ . - -# take any ELF and dump it -# TODO: currently have the little-endian toolchain, but should use the big-endian one. The -EB compat flag works though. -bin/%.dump: bin - mipsel-linux-gnu-objdump -D --disassembler-options=no-aliases --wide --source -m mips:3000 -EB $(@:%.dump=%.elf) > $@ +include ../../../justfiles/deprecated.mk diff --git a/cannon/testdata/go-1-24/justfile b/cannon/testdata/go-1-24/justfile new file mode 100644 index 0000000000000..ee1b28a0742e0 --- /dev/null +++ b/cannon/testdata/go-1-24/justfile @@ -0,0 +1,28 @@ +# Build all 64-bit ELF test binaries +elf64: elf + +# Build all 64-bit ELF test binaries +[script('bash')] +elf: + set -euo pipefail + mkdir -p bin + for mod in */go.mod; do + name=$(dirname "$mod") + echo "Building bin/${name}.64.elf" + (cd "$name" && GOOS=linux GOARCH=mips64 GOMIPS64=softfloat go build -o "../bin/${name}.64.elf" .) + done + +# Dump all ELF binaries +[script('bash')] +dump: + set -euo pipefail + mkdir -p bin + for elf in bin/*.64.elf; do + dump="${elf%.elf}.dump" + echo "Dumping $elf -> $dump" + mipsel-linux-gnu-objdump -D --disassembler-options=no-aliases --wide --source -m mips:3000 -EB "$elf" > "$dump" + done + +# Clean build artifacts +clean: + @[ -d bin ] && find bin -maxdepth 1 -type f -delete || true diff --git a/cannon/testdata/go-1-25/Makefile b/cannon/testdata/go-1-25/Makefile index f4a7a51bf81bd..cd4c47589bd43 100644 --- a/cannon/testdata/go-1-25/Makefile +++ b/cannon/testdata/go-1-25/Makefile @@ -1,28 +1,3 @@ -all: elf +DEPRECATED_TARGETS := elf elf64 dump clean -.PHONY: elf64 -elf64: $(patsubst %/go.mod,bin/%.64.elf,$(wildcard */go.mod)) - -.PHONY: elf -elf: elf64 - -.PHONY: dump -dump: $(patsubst %/go.mod,bin/%.dump,$(wildcard */go.mod)) - -.PHONY: clean -clean: - @[ -d bin ] && find bin -maxdepth 1 -type f -delete - -bin: - mkdir bin - -# take any directory with a go mod, and build an ELF -# verify output with: readelf -h bin/.elf -# result is mips64, big endian, R3000 -bin/%.64.elf: bin - cd $(@:bin/%.64.elf=%) && GOOS=linux GOARCH=mips64 GOMIPS64=softfloat go build -o ../$@ . - -# take any ELF and dump it -# TODO: currently have the little-endian toolchain, but should use the big-endian one. The -EB compat flag works though. -bin/%.dump: bin - mipsel-linux-gnu-objdump -D --disassembler-options=no-aliases --wide --source -m mips:3000 -EB $(@:%.dump=%.elf) > $@ +include ../../../justfiles/deprecated.mk diff --git a/cannon/testdata/go-1-25/justfile b/cannon/testdata/go-1-25/justfile new file mode 100644 index 0000000000000..ee1b28a0742e0 --- /dev/null +++ b/cannon/testdata/go-1-25/justfile @@ -0,0 +1,28 @@ +# Build all 64-bit ELF test binaries +elf64: elf + +# Build all 64-bit ELF test binaries +[script('bash')] +elf: + set -euo pipefail + mkdir -p bin + for mod in */go.mod; do + name=$(dirname "$mod") + echo "Building bin/${name}.64.elf" + (cd "$name" && GOOS=linux GOARCH=mips64 GOMIPS64=softfloat go build -o "../bin/${name}.64.elf" .) + done + +# Dump all ELF binaries +[script('bash')] +dump: + set -euo pipefail + mkdir -p bin + for elf in bin/*.64.elf; do + dump="${elf%.elf}.dump" + echo "Dumping $elf -> $dump" + mipsel-linux-gnu-objdump -D --disassembler-options=no-aliases --wide --source -m mips:3000 -EB "$elf" > "$dump" + done + +# Clean build artifacts +clean: + @[ -d bin ] && find bin -maxdepth 1 -type f -delete || true diff --git a/cannon/testdata/justfile b/cannon/testdata/justfile new file mode 100644 index 0000000000000..8eda529505286 --- /dev/null +++ b/cannon/testdata/justfile @@ -0,0 +1,15 @@ +# Build all ELF test binaries +elf: go1-24 go1-25 + +# Build go-1-24 ELF binaries +go1-24: + just ./go-1-24/elf + +# Build go-1-25 ELF binaries +go1-25: + just ./go-1-25/elf + +# Clean all build artifacts +clean: + just ./go-1-24/clean + just ./go-1-25/clean From 0bf31fa8de4e9a5cb419b566e961a3fdd415c2fe Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Thu, 12 Mar 2026 22:07:21 +0000 Subject: [PATCH 13/14] fix(cannon): manual shim for diff-cannon positional arg The generic deprecated.mk shim converts make variables to env vars, but diff-cannon VM: is a positional parameter in just. Write a manual shim that passes VM correctly. Also add deprecation warning to the diff-%-cannon pattern target. Co-Authored-By: Claude Opus 4.6 --- cannon/Makefile | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/cannon/Makefile b/cannon/Makefile index fc3fda4061e99..b944ef3a69e0d 100644 --- a/cannon/Makefile +++ b/cannon/Makefile @@ -1,9 +1,27 @@ -DEPRECATED_TARGETS := cannon cannon64-impl cannon-embeds clean elf elf-go-current sanitize-program contract test diff-cannon cannon-stf-verify fuzz lint +DEPRECATED_TARGETS := cannon cannon64-impl cannon-embeds clean elf elf-go-current sanitize-program contract test cannon-stf-verify fuzz lint include ../justfiles/deprecated.mk +# diff-cannon needs a manual shim because VM is a positional arg in just, +# not an env var. The generic shim would produce `just VM=X diff-cannon` +# but just needs `just diff-cannon X`. +.PHONY: diff-cannon +diff-cannon: +ifndef VM + $(error VM is required: make diff-cannon VM=multithreaded64-5) +endif + @echo + @printf '%s\n' 'Deprecated make call: make diff-cannon VM=$(VM)' + @printf '%s\n' 'Consider using just instead: just diff-cannon $(VM)' + @echo + just diff-cannon $(VM) + # Pattern target for backwards compatibility with make diff--cannon invocations. # Translates make diff--cannon to just diff-cannon . .PHONY: diff-%-cannon diff-%-cannon: - env $(JUSTFLAGS) just diff-cannon $* + @echo + @printf '%s\n' 'Deprecated make call: make diff-$*-cannon' + @printf '%s\n' 'Consider using just instead: just diff-cannon $*' + @echo + just diff-cannon $* From 8e9e604be9da5477fb22e9b870bf1f10173298cd Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Thu, 12 Mar 2026 23:32:47 +0000 Subject: [PATCH 14/14] fix: restore dump discovery from go.mod and TODO comment Match the original Makefile behavior by iterating */go.mod directories instead of bin/*.64.elf to avoid dumping stale ELFs. Restore the TODO about the little-endian vs big-endian toolchain. Co-Authored-By: Claude Opus 4.6 --- cannon/testdata/go-1-24/justfile | 7 +++++-- cannon/testdata/go-1-25/justfile | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cannon/testdata/go-1-24/justfile b/cannon/testdata/go-1-24/justfile index ee1b28a0742e0..d606bdc635364 100644 --- a/cannon/testdata/go-1-24/justfile +++ b/cannon/testdata/go-1-24/justfile @@ -13,12 +13,15 @@ elf: done # Dump all ELF binaries +# TODO: currently have the little-endian toolchain, but should use the big-endian one. The -EB compat flag works though. [script('bash')] dump: set -euo pipefail mkdir -p bin - for elf in bin/*.64.elf; do - dump="${elf%.elf}.dump" + for mod in */go.mod; do + name=$(dirname "$mod") + elf="bin/${name}.64.elf" + dump="bin/${name}.64.dump" echo "Dumping $elf -> $dump" mipsel-linux-gnu-objdump -D --disassembler-options=no-aliases --wide --source -m mips:3000 -EB "$elf" > "$dump" done diff --git a/cannon/testdata/go-1-25/justfile b/cannon/testdata/go-1-25/justfile index ee1b28a0742e0..d606bdc635364 100644 --- a/cannon/testdata/go-1-25/justfile +++ b/cannon/testdata/go-1-25/justfile @@ -13,12 +13,15 @@ elf: done # Dump all ELF binaries +# TODO: currently have the little-endian toolchain, but should use the big-endian one. The -EB compat flag works though. [script('bash')] dump: set -euo pipefail mkdir -p bin - for elf in bin/*.64.elf; do - dump="${elf%.elf}.dump" + for mod in */go.mod; do + name=$(dirname "$mod") + elf="bin/${name}.64.elf" + dump="bin/${name}.64.dump" echo "Dumping $elf -> $dump" mipsel-linux-gnu-objdump -D --disassembler-options=no-aliases --wide --source -m mips:3000 -EB "$elf" > "$dump" done