Skip to content
Closed
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
209 changes: 209 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
version: 2.1

# Runs this fork's validation workflows through pinned act because GitHub Actions is disabled.
# Pull requests and branch pushes run the PR checks; merge queues add stage.yml. Event metadata is
# generated once per CircleCI revision and shared by all shards.
#
# The read-only GitHub token is exposed to PR code, so its CircleCI context must remain
# restricted to trusted contributors. Keep CircleCI auto-cancellation enabled.
#
# The act binary, checksum, and runner image are pinned. Compiler caches are no-ops because
# act's local cache is not reusable across these machines; Pages plumbing is skipped after the
# validation build. Lint and unit jobs are distributed; other workflows run up to four jobs.
#
# Excluded: pr-title.yml, label-pr.yml, and the privileged cyclops-audit.yml integration.

jobs:
prepare-act-event:
machine:
image: ubuntu-2404:2025.09.1
resource_class: medium
steps:
- checkout
- run:
name: Snapshot GitHub event
command: |
mkdir -p /tmp/act-event
if ! .circleci/prepare-act-event.sh; then
echo "GitHub event preparation failed; act shards will report the failure" |
tee /tmp/act-event/failed
fi
- persist_to_workspace:
root: /tmp/act-event
paths:
- .

act:
parameters:
wf:
type: string
job:
type: string
default: ""
concurrent_jobs:
type: integer
default: 4
machine:
image: ubuntu-2404:2025.09.1
resource_class: xlarge
steps:
- checkout
- attach_workspace:
at: /tmp/act-event
- run:
name: Check event snapshot
command: |
if [ -f /tmp/act-event/failed ]; then
cat /tmp/act-event/failed >&2
exit 1
fi
- run:
name: Install pinned act
command: |
set -euo pipefail
readonly ACT_VERSION="0.2.89-action-cache-fix.1"
readonly ACT_RELEASE="v0.2.89-action-cache-fix.4"
readonly ACT_BINARY="act_Linux_x86_64"
readonly ACT_SHA256="28bfcf1502f59a834b14f2fb23c39e5b253c2234d875592b5aa0a175f9674dce"
curl --fail --silent --show-error --location \
"https://github.com/ethereum-optimism/act/releases/download/${ACT_RELEASE}/${ACT_BINARY}" \
--output "/tmp/${ACT_BINARY}"
echo "${ACT_SHA256} /tmp/${ACT_BINARY}" | sha256sum --check
sudo install -m 0755 "/tmp/${ACT_BINARY}" /usr/local/bin/act
test "$(act --version)" = "act version ${ACT_VERSION}"
- run:
name: Stub unsupported non-check actions
command: |
mkdir -p /tmp/noop-action
printf '%s\n' \
'name: noop' \
'description: disabled service plumbing under act' \
'inputs:' \
' cache-on-failure: {required: false}' \
' cache-targets: {required: false}' \
'runs:' \
' using: composite' \
' steps:' \
' - run: echo "Service plumbing disabled under act"' \
' shell: bash' \
> /tmp/noop-action/action.yml
- run:
name: Run << parameters.wf >> via act
no_output_timeout: 45m
command: |
set -euo pipefail
event_path=/tmp/act-event/github-event.json
event_name="$(jq -er 'if .pull_request then "pull_request" elif .merge_group then "merge_group" elif .ref and .after then "push" else error("unsupported event") end' "$event_path")"
base_ref="$(jq -r '(.pull_request.base.ref // .merge_group.base_ref // "") | sub("^refs/heads/"; "")' "$event_path")"
target_job="<< parameters.job >>"
# Validate documentation without entering Pages deployment on branch pushes.
if [ "<< parameters.wf >>" = "book.yml" ]; then
target_job=build
fi
act_job=()
if [ -n "$target_job" ]; then
case "$target_job" in
crate-checks-*)
partition="${target_job#crate-checks-}"
if [[ ! "$partition" =~ ^[1-9][0-9]*$ ]]; then
echo "invalid crate-checks partition: $partition" >&2
exit 1
fi
act_job=(-j crate-checks --matrix "partition:${partition}")
;;
*)
act_job=(-j "$target_job")
;;
esac
fi

act_env=(--env "RUSTC_WRAPPER=" --env "GITHUB_BASE_REF=${base_ref}")
if [ "<< parameters.wf >>" = "unit.yml" ] && [ "$target_job" = "state" ]; then
# EF tests use Rayon internally, so unrestricted nextest processes multiply
# runnable threads and starve valid_blocks past its upstream timeout.
act_env+=(--env "NEXTEST_TEST_THREADS=2")
fi
if [ "$event_name" != "pull_request" ]; then
act_env+=(
--env "GITHUB_REF=refs/heads/${CIRCLE_BRANCH}"
--env "GITHUB_SHA=${CIRCLE_SHA1}"
)
fi

act "$event_name" -W ".github/workflows/<< parameters.wf >>" \
"${act_job[@]}" \
--eventpath "$event_path" \
-P "ubuntu-latest=catthehacker/ubuntu@sha256:b839c14c4410998529ec18f951262bdf87a2b23bc1467304d07b491b9455e074" \
--concurrent-jobs << parameters.concurrent_jobs >> \
"${act_env[@]}" \
-s GITHUB_TOKEN="${MISE_GITHUB_TOKEN:?missing restricted read-only GitHub token}" \
--local-repository "mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696=/tmp/noop-action" \
--local-repository "Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4=/tmp/noop-action" \
--local-repository "actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d=/tmp/noop-action" \
--local-repository "actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9=/tmp/noop-action"

workflows:
reth-act:
jobs:
- prepare-act-event:
context:
- circleci-repo-readonly-authenticated-github-token
- act:
context:
- circleci-repo-readonly-authenticated-github-token
name: "act-<< matrix.wf >>"
requires:
- prepare-act-event
matrix:
parameters:
wf:
- book.yml
- compact.yml
- e2e.yml
- grafana.yml
- integration.yml
- lint-actions.yml
- stage.yml
- act:
wf: lint.yml
concurrent_jobs: 1
context:
- circleci-repo-readonly-authenticated-github-token
name: "act-lint-<< matrix.job >>"
requires:
- prepare-act-event
matrix:
parameters:
job:
- clippy-binaries
- clippy
- wasm
- riscv
- crate-checks-1
- crate-checks-2
- crate-checks-3
- msrv
- docs
- fmt
- udeps
- book
- typos
- check-toml
- grafana
- no-test-deps
- feature-propagation
- deny
- act:
wf: unit.yml
concurrent_jobs: 1
context:
- circleci-repo-readonly-authenticated-github-token
name: "act-unit-<< matrix.job >>"
requires:
- prepare-act-event
matrix:
parameters:
job:
- test
- state
- doc
102 changes: 102 additions & 0 deletions .circleci/prepare-act-event.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/usr/bin/env bash
set -euo pipefail

readonly OUTPUT_DIR="${ACT_EVENT_OUTPUT_DIR:-/tmp/act-event}"
readonly EVENT_PATH="${OUTPUT_DIR}/github-event.json"

mkdir -p "$OUTPUT_DIR"
rm -f "$EVENT_PATH"

: "${CIRCLE_SHA1:?missing CircleCI revision}"
: "${CIRCLE_PROJECT_USERNAME:?missing CircleCI project owner}"
: "${CIRCLE_PROJECT_REPONAME:?missing CircleCI project repository}"

repository="${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"

if [[ "${CIRCLE_BRANCH:-}" == gh-readonly-queue/* ]]; then
event_name="merge_group"
elif [[ -n "${CIRCLE_PULL_REQUEST:-}" ]]; then
event_name="pull_request"
else
event_name="push"
fi

case "$event_name" in
pull_request)
: "${CIRCLE_PULL_REQUEST:?pull-request trigger must provide CIRCLE_PULL_REQUEST}"
pr_number="${CIRCLE_PULL_REQUEST##*/}"
if [[ ! "$pr_number" =~ ^[1-9][0-9]*$ ]]; then
echo "invalid pull-request URL: ${CIRCLE_PULL_REQUEST}" >&2
exit 1
fi

pull_request_path="${OUTPUT_DIR}/pull-request.json"
curl --fail --silent --show-error --location \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${MISE_GITHUB_TOKEN:?missing restricted read-only GitHub token}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${repository}/pulls/${pr_number}" > "$pull_request_path"

event_head_sha="$(jq -er '.head.sha' "$pull_request_path")"
if [[ "$event_head_sha" != "$CIRCLE_SHA1" ]]; then
echo "PR head does not match CircleCI revision: ${CIRCLE_SHA1} != ${event_head_sha}" >&2
exit 1
fi

jq '{
action: "synchronize",
number: .number,
pull_request: .,
repository: .base.repo,
sender: .user
}' "$pull_request_path" > "$EVENT_PATH"
base_ref="$(jq -er '.base.ref | select(length > 0)' "$pull_request_path")"
head_ref="$(jq -er '.head.ref | select(length > 0)' "$pull_request_path")"
echo "act event: pull_request #${pr_number}, ${head_ref} -> ${base_ref}"
;;
push)
: "${CIRCLE_BRANCH:?push trigger must provide CIRCLE_BRANCH}"
jq -n \
--arg ref "refs/heads/${CIRCLE_BRANCH}" \
--arg after "$CIRCLE_SHA1" \
'{ref: $ref, after: $after}' > "$EVENT_PATH"
echo "act event: push ${CIRCLE_BRANCH} at ${CIRCLE_SHA1}"
;;
merge_group)
: "${CIRCLE_BRANCH:?merge-queue trigger must provide CIRCLE_BRANCH}"
if [[ ! "$CIRCLE_BRANCH" =~ ^gh-readonly-queue/(.+)/pr-([1-9][0-9]*)-[^/]+$ ]]; then
echo "merge_group requires a gh-readonly-queue/<base>/pr-<number>-<suffix> branch, got: ${CIRCLE_BRANCH}" >&2
exit 1
fi
base_ref="${BASH_REMATCH[1]}"

if ! base_sha="$(git rev-parse "${CIRCLE_SHA1}^1" 2>/dev/null)"; then
git fetch --no-tags --depth=2 origin "$CIRCLE_SHA1"
base_sha="$(git rev-parse "${CIRCLE_SHA1}^1")"
fi

jq -n \
--arg head_sha "$CIRCLE_SHA1" \
--arg head_ref "refs/heads/${CIRCLE_BRANCH}" \
--arg base_sha "$base_sha" \
--arg base_ref "refs/heads/${base_ref}" \
--arg repository "$repository" \
--arg repository_name "$CIRCLE_PROJECT_REPONAME" \
--arg repository_owner "$CIRCLE_PROJECT_USERNAME" \
'{
action: "checks_requested",
merge_group: {
head_sha: $head_sha,
head_ref: $head_ref,
base_sha: $base_sha,
base_ref: $base_ref
},
repository: {
full_name: $repository,
name: $repository_name,
owner: {login: $repository_owner}
}
}' > "$EVENT_PATH"
echo "act event: merge_group ${CIRCLE_BRANCH} -> ${base_ref} at ${base_sha}"
;;
esac
2 changes: 1 addition & 1 deletion .github/scripts/check_rv32imac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ trap 'rm -rf -- "$tmpdir"' EXIT INT TERM

for crate in "${crates_to_check[@]}"; do
outfile="$tmpdir/$crate.log"
if cargo +stable build -p "$crate" --target riscv32imac-unknown-none-elf --no-default-features --color never >"$outfile" 2>&1; then
if cargo build -p "$crate" --target riscv32imac-unknown-none-elf --no-default-features --color never >"$outfile" 2>&1; then
echo "✅ $crate"
else
echo "❌ $crate"
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/check_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ for crate in "${crates[@]}"; do
fi

outfile="$tmpdir/$crate.log"
if cargo +stable build -p "$crate" --target wasm32-wasip1 --no-default-features --color never >"$outfile" 2>&1; then
if cargo build -p "$crate" --target wasm32-wasip1 --no-default-features --color never >"$outfile" 2>&1; then
echo "✅ $crate"
else
echo "❌ $crate"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:

- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2026-07-14

- name: Build docs
run: cd docs/vocs && bash scripts/build-cargo-docs.sh
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/compact.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensures that `Compact` codec changes are backwards compatible.
#
# 1) checkout `main`
# 1) checkout the PR base, or the selected release for maintenance-branch pushes
# 2) randomly generate and serialize to disk many different type vectors with `Compact` (eg. Header, Transaction, etc)
# 3) checkout `pr`
# 4) deserialize previously generated test vectors
Expand Down Expand Up @@ -35,16 +35,20 @@ jobs:
- uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1
- run: .github/scripts/install_llvm.sh ubuntu
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.97.0"
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
cache-on-failure: true
- name: Checkout base
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.base_ref || 'main' }}
# Use v2.5.2's commit: the fork carries its history but does not mirror upstream tags.
# The maintenance branch must decode its release's data, not unreleased main formats.
ref: ${{ github.base_ref || (github.ref == 'refs/heads/optimism' && '5a6940e351fed80458fe6c9da8581cbe4b8bd036' || 'main') }}
persist-credentials: false
# On `main` branch, generates test vectors and serializes them to disk using `Compact`.
# On the comparison base, generate test vectors and serialize them to disk using `Compact`.
- name: Generate compact vectors
run: |
${{ matrix.bin }} -- test-vectors compact --write
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
- uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1
- run: .github/scripts/install_llvm.sh ubuntu
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.97.0"
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- uses: taiki-e/install-action@41049aa56687c35e0afa74eed4f09cec4f9afabf # v2.85.2
with:
Expand Down Expand Up @@ -70,6 +72,8 @@ jobs:
- uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1
- run: .github/scripts/install_llvm.sh ubuntu
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.97.0"
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- uses: taiki-e/install-action@41049aa56687c35e0afa74eed4f09cec4f9afabf # v2.85.2
with:
Expand Down
Loading