Skip to content
Open
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
59 changes: 29 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,45 +47,44 @@ jobs:
steps:
- uses: actions/checkout@v6

# Read the pinned leanSpec commit from the Makefile (single source of truth)
- name: Get leanSpec pinned commit
id: lean-spec
run: echo "commit=$(sed -n 's/^LEAN_SPEC_COMMIT_HASH:= *//p' Makefile)" >> $GITHUB_OUTPUT
- name: Get leanSpec fixtures release info
id: fixtures-release
run: |
api_url="https://api.github.com/repos/leanEthereum/leanSpec/releases/latest"
json=$(curl -sL "$api_url")
fixtures_url=$(echo "$json" | python3 -c "import sys,json; j=json.load(sys.stdin); print(next(a.get('browser_download_url') for a in j.get('assets',[]) if a.get('name')=='fixtures-prod-scheme.tar.gz'))")
sha_url=$(echo "$json" | python3 -c "import sys,json; j=json.load(sys.stdin); print(next(a.get('browser_download_url') for a in j.get('assets',[]) if a.get('name')=='fixtures-prod-scheme.tar.gz.sha256'))")
sha=$(curl -sL "$sha_url" | cut -d' ' -f1)
echo "url=$fixtures_url" >> $GITHUB_OUTPUT
echo "sha_url=$sha_url" >> $GITHUB_OUTPUT
echo "sha=$sha" >> $GITHUB_OUTPUT

- name: Restore test fixtures cache
id: cache-fixtures
uses: actions/cache/restore@v5
with:
path: leanSpec/fixtures
key: leanspec-fixtures-${{ steps.lean-spec.outputs.commit }}

# All fixture generation steps are skipped when the cache hits
- name: Checkout leanSpec at pinned commit
if: steps.cache-fixtures.outputs.cache-hit != 'true'
uses: actions/checkout@v6
with:
repository: leanEthereum/leanSpec
ref: ${{ steps.lean-spec.outputs.commit }}
path: leanSpec
key: leanspec-fixtures-${{ steps.fixtures-release.outputs.sha }}

- name: Install uv and Python 3.14
- name: Download leanSpec fixtures release
if: steps.cache-fixtures.outputs.cache-hit != 'true'
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "leanSpec/pyproject.toml"
python-version: "3.14"

- name: Sync leanSpec dependencies
if: steps.cache-fixtures.outputs.cache-hit != 'true'
working-directory: leanSpec
run: uv sync --no-progress

- name: Get production keys URL hash
if: steps.cache-fixtures.outputs.cache-hit != 'true'
id: prod-keys-url
working-directory: leanSpec
run: |
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
fixtures_url="${{ steps.fixtures-release.outputs.url }}"
sha_url="${{ steps.fixtures-release.outputs.sha_url }}"
echo "Downloading fixtures from $fixtures_url"
curl -L -f -o "$tmpdir/fixtures-prod-scheme.tar.gz" "$fixtures_url"
curl -L -f -o "$tmpdir/fixtures-prod-scheme.tar.gz.sha256" "$sha_url"
expected=$(cut -d' ' -f1 "$tmpdir/fixtures-prod-scheme.tar.gz.sha256")
actual=$(sha256sum "$tmpdir/fixtures-prod-scheme.tar.gz" | awk '{print $1}')
if [ "$expected" != "$actual" ]; then
echo "SHA256 mismatch: expected $expected, got $actual"
exit 1
fi
rm -rf leanSpec/fixtures
mkdir -p leanSpec/fixtures
tar -xzf "$tmpdir/fixtures-prod-scheme.tar.gz" -C leanSpec/fixtures --strip-components=1
URL=$(uv run python -c "from consensus_testing.keys import KEY_DOWNLOAD_URLS; print(KEY_DOWNLOAD_URLS['prod'])")
HASH=$(echo -n "$URL" | sha256sum | awk '{print $1}')
echo "hash=$HASH" >> $GITHUB_OUTPUT
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Not to be confused with Ethereum consensus clients AKA Beacon Chain clients AKA

**Main branch:** `main`
**Rust version:** 1.92.0 (edition 2024)
**Test fixtures commit:** Check `LEAN_SPEC_COMMIT_HASH` in Makefile
**Test fixtures release:** Download latest production fixtures from leanSpec releases

## Codebase Structure (10 crates)

Expand Down Expand Up @@ -81,7 +81,7 @@ make test # All tests + forkchoice spec tests
### Common Operations
```bash
.claude/skills/test-pr-devnet/scripts/test-branch.sh # Test branch in multi-client devnet
rm -rf leanSpec && make leanSpec/fixtures # Regenerate test fixtures (requires uv)
rm -rf leanSpec && make leanSpec/fixtures # Download latest released test fixtures
make docker-build # Build Docker image (DOCKER_TAG=local)
make run-devnet # Run local devnet with lean-quickstart
```
Expand Down
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,28 @@ docker-build: ## 🐳 Build the Docker image
-t ghcr.io/lambdaclass/ethlambda:$(DOCKER_TAG) .
@echo

LEAN_SPEC_FIXTURES_URL ?= https://github.com/leanEthereum/leanSpec/releases/latest/download/fixtures-prod-scheme.tar.gz
LEAN_SPEC_FIXTURES_SHA_URL ?= $(LEAN_SPEC_FIXTURES_URL).sha256
# 2026-05-17
LEAN_SPEC_COMMIT_HASH:=f12000bd68a9640cffdfbd9a07503c9112d32bee

leanSpec:
git clone https://github.com/leanEthereum/leanSpec.git --single-branch
Comment on lines 32 to 33
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 leanSpec target is now dead code

leanSpec/fixtures was updated to no longer depend on the leanSpec prerequisite, so the leanSpec clone target is never invoked by any downstream rule. The git checkout line was also dropped in this PR, leaving the target in a half-refactored state (it clones but doesn't pin a revision). If nothing depends on it, consider removing it to avoid confusion.

Prompt To Fix With AI
This is a comment left during a code review.
Path: Makefile
Line: 30-31

Comment:
**`leanSpec` target is now dead code**

`leanSpec/fixtures` was updated to no longer depend on the `leanSpec` prerequisite, so the `leanSpec` clone target is never invoked by any downstream rule. The `git checkout` line was also dropped in this PR, leaving the target in a half-refactored state (it clones but doesn't pin a revision). If nothing depends on it, consider removing it to avoid confusion.

How can I resolve this? If you propose a fix, please make it concise.

cd leanSpec && git checkout $(LEAN_SPEC_COMMIT_HASH)

leanSpec/fixtures:
tmpdir=$$(mktemp -d); \
trap 'rm -rf "$$tmpdir"' EXIT; \
curl -L -f -o "$$tmpdir/fixtures-prod-scheme.tar.gz" "$(LEAN_SPEC_FIXTURES_URL)"; \
curl -L -f -o "$$tmpdir/fixtures-prod-scheme.tar.gz.sha256" "$(LEAN_SPEC_FIXTURES_SHA_URL)"; \
expected=$$(cut -d' ' -f1 "$$tmpdir/fixtures-prod-scheme.tar.gz.sha256"); \
actual=$$(sha256sum "$$tmpdir/fixtures-prod-scheme.tar.gz" | awk '{print $$1}'); \
if [ "$$expected" != "$$actual" ]; then \
echo "SHA256 mismatch: expected $$expected, got $$actual" >&2; \
exit 1; \
fi; \
rm -rf leanSpec/fixtures; \
mkdir -p leanSpec/fixtures; \
tar -xzf "$$tmpdir/fixtures-prod-scheme.tar.gz" -C leanSpec/fixtures --strip-components=1
# Pre-download the prod keys ourselves before `fill`. The pinned leanSpec
# commit predates leanSpec PR #745, whose `download_keys` reads the still-open
# (unflushed) download tempfile, intermittently truncating the gzip tail and
Expand Down