Skip to content

Commit 5065c7b

Browse files
authored
Merge branch 'ChainSafe:unstable' into unstable
2 parents 326c495 + 116358e commit 5065c7b

349 files changed

Lines changed: 23899 additions & 3149 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Check Spec References
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches: [unstable, stable]
10+
pull_request:
11+
workflow_dispatch:
12+
13+
jobs:
14+
check-specrefs:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Check version consistency
22+
run: |
23+
SPEC_TEST_VERSION=$(grep 'specVersion:' packages/beacon-node/test/spec/specTestVersioning.ts | head -1 | sed 's/.*specVersion: "\(.*\)".*/\1/')
24+
ETHSPECIFY_VERSION=$(grep '^version:' specrefs/.ethspecify.yml | sed 's/version: //')
25+
if [ "$SPEC_TEST_VERSION" != "$ETHSPECIFY_VERSION" ]; then
26+
echo "Version mismatch between specTestVersioning.ts and ethspecify"
27+
echo " packages/beacon-node/test/spec/specTestVersioning.ts: $SPEC_TEST_VERSION"
28+
echo " specrefs/.ethspecify.yml: $ETHSPECIFY_VERSION"
29+
exit 1
30+
else
31+
echo "Versions match: $SPEC_TEST_VERSION"
32+
fi
33+
34+
- name: Install ethspecify
35+
run: python3 -mpip install ethspecify
36+
37+
- name: Update spec references
38+
run: ethspecify process --path=specrefs
39+
40+
- name: Check for differences
41+
run: |
42+
if ! git diff --exit-code -- specrefs >/dev/null; then
43+
echo "Spec references are out-of-date!"
44+
echo ""
45+
git --no-pager diff -- specrefs
46+
exit 1
47+
else
48+
echo "Spec references are up-to-date!"
49+
fi
50+
51+
- name: Check spec references
52+
run: ethspecify check --path=specrefs

‎.github/workflows/docker.yml‎

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Build and publish Docker images
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
tag:
7+
description: "Docker image tag"
8+
required: true
9+
type: string
10+
extra-tags:
11+
description: "Extra tags to apply (comma-separated, e.g. 'latest,rc')"
12+
required: false
13+
type: string
14+
ref:
15+
description: "Git ref to checkout (defaults to triggering ref)"
16+
required: false
17+
type: string
18+
19+
jobs:
20+
docker:
21+
name: Build Docker (${{ matrix.arch }})
22+
runs-on: ${{ matrix.runner }}
23+
strategy:
24+
fail-fast: true
25+
matrix:
26+
include:
27+
- arch: amd64
28+
runner: buildjet-4vcpu-ubuntu-2204
29+
- arch: arm64
30+
runner: buildjet-4vcpu-ubuntu-2204-arm
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
ref: ${{ inputs.ref || github.sha }}
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
- name: Login to Docker Hub
38+
uses: docker/login-action@v3
39+
with:
40+
username: ${{ secrets.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
- name: Build and push lodestar
43+
run: >
44+
docker buildx build . --push
45+
--tag chainsafe/lodestar:${{ inputs.tag }}-${{ matrix.arch }}
46+
--platform linux/${{ matrix.arch }}
47+
--build-arg COMMIT=$(git rev-parse HEAD)
48+
49+
- name: Sanity check lodestar (${{ matrix.arch }})
50+
run: |
51+
docker run -d --name lodestar-sanity-${{ matrix.arch }} -p 9596:9596 chainsafe/lodestar:${{ inputs.tag }}-${{ matrix.arch }} dev --rest.address 0.0.0.0
52+
sleep 30
53+
curl -f http://127.0.0.1:9596/eth/v1/node/version || (docker logs lodestar-sanity-${{ matrix.arch }} && exit 1)
54+
docker stop lodestar-sanity-${{ matrix.arch }}
55+
56+
- name: Build and push custom Grafana
57+
run: >
58+
docker buildx build ./docker/grafana/ --push
59+
--file ./docker/grafana/Dockerfile
60+
--build-context dashboards=./dashboards
61+
--tag chainsafe/lodestar-grafana:${{ inputs.tag }}-${{ matrix.arch }}
62+
--platform linux/${{ matrix.arch }}
63+
64+
- name: Build and push custom Prometheus
65+
run: >
66+
docker buildx build ./docker/prometheus/ --push
67+
--file ./docker/prometheus/Dockerfile
68+
--tag chainsafe/lodestar-prometheus:${{ inputs.tag }}-${{ matrix.arch }}
69+
--platform linux/${{ matrix.arch }}
70+
71+
docker-manifest:
72+
name: Create Docker manifest
73+
runs-on: ubuntu-latest
74+
needs: docker
75+
steps:
76+
- name: Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v3
78+
- name: Login to Docker Hub
79+
uses: docker/login-action@v3
80+
with:
81+
username: ${{ secrets.DOCKERHUB_USERNAME }}
82+
password: ${{ secrets.DOCKERHUB_TOKEN }}
83+
84+
- name: Create and push lodestar manifest
85+
run: |
86+
EXTRA_TAGS=""
87+
if [ -n "${{ inputs.extra-tags }}" ]; then
88+
for t in $(echo "${{ inputs.extra-tags }}" | tr ',' ' '); do
89+
EXTRA_TAGS="$EXTRA_TAGS -t chainsafe/lodestar:$t"
90+
done
91+
fi
92+
docker buildx imagetools create -t chainsafe/lodestar:${{ inputs.tag }} $EXTRA_TAGS \
93+
chainsafe/lodestar:${{ inputs.tag }}-amd64 \
94+
chainsafe/lodestar:${{ inputs.tag }}-arm64
95+
96+
- name: Create and push grafana manifest
97+
run: |
98+
docker buildx imagetools create -t chainsafe/lodestar-grafana:${{ inputs.tag }} \
99+
chainsafe/lodestar-grafana:${{ inputs.tag }}-amd64 \
100+
chainsafe/lodestar-grafana:${{ inputs.tag }}-arm64
101+
102+
- name: Create and push prometheus manifest
103+
run: |
104+
docker buildx imagetools create -t chainsafe/lodestar-prometheus:${{ inputs.tag }} \
105+
chainsafe/lodestar-prometheus:${{ inputs.tag }}-amd64 \
106+
chainsafe/lodestar-prometheus:${{ inputs.tag }}-arm64
107+
108+
- name: Verify lodestar manifest
109+
run: |
110+
docker pull chainsafe/lodestar:${{ inputs.tag }}
111+
docker image history chainsafe/lodestar:${{ inputs.tag }}
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: Backfill versioned docs
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
count:
7+
description: "Number of recent stable releases to backfill"
8+
required: false
9+
default: "10"
10+
type: string
11+
dry_run:
12+
description: "Dry run (list versions to backfill without building)"
13+
required: false
14+
default: false
15+
type: boolean
16+
17+
permissions:
18+
contents: write
19+
20+
jobs:
21+
backfill:
22+
name: Backfill versioned docs
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
ref: unstable
28+
fetch-depth: 0
29+
fetch-tags: true
30+
31+
- name: Determine versions to backfill
32+
id: versions
33+
run: |
34+
COUNT=${{ github.event.inputs.count || '10' }}
35+
36+
# Get the last N stable release tags (exclude rc pre-releases)
37+
STABLE_TAGS=$(git tag -l 'v*' --sort=-v:refname | grep -vF -- '-rc.' | head -n "$COUNT")
38+
echo "Found stable tags:"
39+
echo "$STABLE_TAGS"
40+
41+
# Fetch existing versions from docs-versions branch
42+
EXISTING=""
43+
git fetch origin docs-versions 2>/dev/null || true
44+
if git rev-parse origin/docs-versions >/dev/null 2>&1; then
45+
git worktree add /tmp/docs-versions origin/docs-versions
46+
if [ -f /tmp/docs-versions/versions.json ]; then
47+
EXISTING=$(cat /tmp/docs-versions/versions.json | jq -r '.[]')
48+
echo "Existing versions: $EXISTING"
49+
fi
50+
git worktree remove /tmp/docs-versions
51+
fi
52+
53+
# Find missing versions
54+
MISSING=""
55+
for TAG in $STABLE_TAGS; do
56+
VERSION="${TAG#v}"
57+
if echo "$EXISTING" | grep -qx "$VERSION"; then
58+
echo "✓ $VERSION already exists"
59+
else
60+
echo "✗ $VERSION missing — will backfill"
61+
MISSING="$MISSING $TAG"
62+
fi
63+
done
64+
65+
MISSING=$(echo "$MISSING" | xargs)
66+
echo "missing=$MISSING" >> $GITHUB_OUTPUT
67+
68+
if [ -z "$MISSING" ]; then
69+
echo "All $COUNT recent stable versions are already cached!"
70+
else
71+
echo "Versions to backfill: $MISSING"
72+
fi
73+
74+
- name: Install pnpm
75+
if: steps.versions.outputs.missing != '' && github.event.inputs.dry_run != 'true'
76+
uses: pnpm/action-setup@v4
77+
78+
- uses: actions/setup-node@v6
79+
if: steps.versions.outputs.missing != '' && github.event.inputs.dry_run != 'true'
80+
with:
81+
node-version: 24
82+
check-latest: true
83+
cache: pnpm
84+
85+
- name: Backfill missing versions
86+
if: steps.versions.outputs.missing != '' && github.event.inputs.dry_run != 'true'
87+
run: |
88+
MISSING="${{ steps.versions.outputs.missing }}"
89+
90+
# Fetch existing versioned docs
91+
git fetch origin docs-versions 2>/dev/null || true
92+
VERSIONED_DIR=$(mktemp -d)
93+
94+
if git rev-parse origin/docs-versions >/dev/null 2>&1; then
95+
git worktree add /tmp/docs-versions origin/docs-versions
96+
cp -r /tmp/docs-versions/versioned_docs "$VERSIONED_DIR/" 2>/dev/null || true
97+
cp -r /tmp/docs-versions/versioned_sidebars "$VERSIONED_DIR/" 2>/dev/null || true
98+
cp /tmp/docs-versions/versions.json "$VERSIONED_DIR/" 2>/dev/null || true
99+
git worktree remove /tmp/docs-versions
100+
fi
101+
102+
# Process each missing version (oldest first for correct ordering)
103+
REVERSED=$(echo "$MISSING" | tr ' ' '\n' | tac | tr '\n' ' ')
104+
105+
for TAG in $REVERSED; do
106+
VERSION="${TAG#v}"
107+
echo ""
108+
echo "========================================="
109+
echo "Backfilling $VERSION (from tag $TAG)"
110+
echo "========================================="
111+
112+
# Checkout the tag
113+
git checkout "$TAG"
114+
115+
# Install and build at that tag
116+
pnpm install --frozen-lockfile
117+
pnpm build
118+
119+
# Generate docs
120+
pnpm docs:build
121+
122+
# Restore existing versioned content into docs/
123+
cp -r "$VERSIONED_DIR/versioned_docs" docs/ 2>/dev/null || true
124+
cp -r "$VERSIONED_DIR/versioned_sidebars" docs/ 2>/dev/null || true
125+
cp "$VERSIONED_DIR/versions.json" docs/ 2>/dev/null || true
126+
127+
# Install docs deps and create version snapshot
128+
cd docs
129+
pnpm install
130+
npx docusaurus docs:version "$VERSION"
131+
cd ..
132+
133+
# Save updated versioned content
134+
cp -r docs/versioned_docs "$VERSIONED_DIR/" 2>/dev/null || true
135+
cp -r docs/versioned_sidebars "$VERSIONED_DIR/" 2>/dev/null || true
136+
cp docs/versions.json "$VERSIONED_DIR/" 2>/dev/null || true
137+
138+
echo "✓ $VERSION backfilled"
139+
done
140+
141+
echo ""
142+
echo "Final versions.json:"
143+
cat "$VERSIONED_DIR/versions.json"
144+
145+
# Save for push step
146+
echo "VERSIONED_DIR=$VERSIONED_DIR" >> $GITHUB_ENV
147+
148+
- name: Push backfilled docs to docs-versions branch
149+
if: steps.versions.outputs.missing != '' && github.event.inputs.dry_run != 'true'
150+
run: |
151+
WORK=$(mktemp -d)
152+
git config user.name "github-actions[bot]"
153+
git config user.email "github-actions[bot]@users.noreply.github.com"
154+
155+
if git ls-remote --heads origin docs-versions | grep -q docs-versions; then
156+
git clone --branch docs-versions --single-branch --depth 1 \
157+
"https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" "$WORK"
158+
else
159+
git init "$WORK"
160+
cd "$WORK"
161+
git remote add origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git"
162+
git checkout --orphan docs-versions
163+
cd -
164+
fi
165+
166+
cd "$WORK"
167+
rm -rf versioned_docs versioned_sidebars versions.json
168+
cp -r "$VERSIONED_DIR/versioned_docs" . 2>/dev/null || true
169+
cp -r "$VERSIONED_DIR/versioned_sidebars" . 2>/dev/null || true
170+
cp "$VERSIONED_DIR/versions.json" . 2>/dev/null || true
171+
172+
git config user.name "github-actions[bot]"
173+
git config user.email "github-actions[bot]@users.noreply.github.com"
174+
git add versioned_docs versioned_sidebars versions.json
175+
git commit -m "docs: backfill versioned docs for ${{ steps.versions.outputs.missing }}" || echo "Nothing to commit"
176+
git push origin docs-versions

0 commit comments

Comments
 (0)