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
243 changes: 243 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
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:
# Replaces lint.yml's `deny` job, which calls tempoxyz/ci's reusable deny.yml. That workflow starts
# with tempoxyz's secure-runner, which needs a GitHub OIDC token that act never receives, so the
# check itself runs natively here. Its policy comes from deny.toml in this repo.
#
# When re-applying this CI patch onto a new reth release, diff lint.yml's `deny:` job and the
# tempoxyz/ci deny.yml it calls against this job (toolchain, cargo-deny version, `check`
# arguments, deny flags), and update both pins here.
cargo-deny:
docker:
- image: rust:1.95-bookworm@sha256:6258907abe69656e41cd992e0b705cdcfabcbbe3db374f92ed2d47121282d4a1
resource_class: medium
steps:
- checkout
- run:
name: Install pinned cargo-deny
command: |
set -euo pipefail
readonly DENY_VERSION="0.20.2"
readonly DENY_SHA256="9f12ed4c49936e09b48bf862b595cde2fe64fcbd9d74dfacac6131ca824c8d5f"
readonly DENY_ARCHIVE="cargo-deny-${DENY_VERSION}-x86_64-unknown-linux-musl.tar.gz"
curl --fail --silent --show-error --location \
"https://github.com/EmbarkStudios/cargo-deny/releases/download/${DENY_VERSION}/${DENY_ARCHIVE}" \
--output "/tmp/${DENY_ARCHIVE}"
echo "${DENY_SHA256} /tmp/${DENY_ARCHIVE}" | sha256sum --check
tar -xzf "/tmp/${DENY_ARCHIVE}" -C /usr/local/bin --strip-components=1 \
"cargo-deny-${DENY_VERSION}-x86_64-unknown-linux-musl/cargo-deny"
test "$(cargo-deny --version)" = "cargo-deny ${DENY_VERSION}"
- run:
name: cargo deny check
command: cargo deny --log-level warn --all-features check all

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-bin: {required: false}' \
' cache-on-failure: {required: false}' \
' cache-targets: {required: false}' \
' prefix-key: {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@fc920bf0ec8de6ee65d409111f7ec508035751ba=/tmp/noop-action" \
--local-repository "Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6=/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
- cargo-deny:
name: lint-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 @@ -110,7 +110,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
Loading