Skip to content

Commit b375022

Browse files
authored
Merge branch 'master' into feature/manifest_file_for_tests_vectors
2 parents ff4d8ba + 92dda6f commit b375022

File tree

72 files changed

+1744
-3452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1744
-3452
lines changed

.codespell-whitelist

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/run-tests.yml renamed to .github/workflows/checks.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run tests
1+
name: Checks
22

33
defaults:
44
run:
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
python-version-file: "pyproject.toml"
2525
- name: Install uv ${{ vars.UV_VERSION }}
26-
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
26+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
2727
with:
2828
enable-cache: true
2929
version: ${{ vars.UV_VERSION }}
@@ -66,7 +66,7 @@ jobs:
6666
with:
6767
python-version-file: "pyproject.toml"
6868
- name: Install uv ${{ vars.UV_VERSION }}
69-
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
69+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
7070
with:
7171
enable-cache: true
7272
version: ${{ vars.UV_VERSION }}
@@ -76,7 +76,7 @@ jobs:
7676
if: always()
7777
run: cp -r ./tests/core/pyspec/test-reports ./tests/core/pyspec/test-results-framework-${{ github.run_number }}
7878
- name: Upload framework test results
79-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
79+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
8080
if: always()
8181
with:
8282
name: test-results-framework-${{ github.run_number }}
@@ -106,7 +106,7 @@ jobs:
106106
with:
107107
python-version-file: "pyproject.toml"
108108
- name: Install uv ${{ vars.UV_VERSION }}
109-
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
109+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
110110
with:
111111
enable-cache: true
112112
version: ${{ vars.UV_VERSION }}
@@ -116,7 +116,7 @@ jobs:
116116
if: always()
117117
run: cp -r ./tests/core/pyspec/test-reports ./tests/core/pyspec/test-results-minimal-${{ matrix.fork }}-${{ github.run_number }}
118118
- name: Upload ${{ matrix.fork }} test results
119-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
119+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
120120
if: always()
121121
with:
122122
name: test-results-minimal-${{ matrix.fork }}-${{ github.run_number }}

.github/workflows/generate_vectors.yml renamed to .github/workflows/nightly-reftests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Generate reference tests
1+
name: Nightly Reference Tests
22

33
defaults:
44
run:
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
python-version-file: "consensus-specs/pyproject.toml"
3838
- name: Install uv ${{ vars.UV_VERSION }}
39-
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
39+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
4040
with:
4141
enable-cache: true
4242
version: ${{ vars.UV_VERSION }}
@@ -54,22 +54,22 @@ jobs:
5454
tar -czvf minimal.tar.gz tests/minimal
5555
tar -czvf mainnet.tar.gz tests/mainnet
5656
- name: Upload general.tar.gz
57-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
57+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
5858
with:
5959
name: General Test Configuration
6060
path: consensus-spec-tests/general.tar.gz
6161
- name: Upload minimal.tar.gz
62-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
62+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
6363
with:
6464
name: Minimal Test Configuration
6565
path: consensus-spec-tests/minimal.tar.gz
6666
- name: Upload mainnet.tar.gz
67-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
67+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
6868
with:
6969
name: Mainnet Test Configuration
7070
path: consensus-spec-tests/mainnet.tar.gz
7171
- name: Upload consensustestgen
72-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
72+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
7373
with:
7474
name: consensustestgen.log
7575
path: consensustestgen.log

.github/workflows/nightly-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Nightly mainnet tests
1+
name: Nightly Mainnet Tests
22

33
defaults:
44
run:
@@ -42,7 +42,7 @@ jobs:
4242
with:
4343
python-version-file: "pyproject.toml"
4444
- name: Install uv ${{ vars.UV_VERSION }}
45-
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
45+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
4646
with:
4747
enable-cache: true
4848
version: ${{ vars.UV_VERSION }}
@@ -52,7 +52,7 @@ jobs:
5252
if: always()
5353
run: cp -r ./tests/core/pyspec/test-reports ./tests/core/pyspec/test-results-mainnet-${{ matrix.fork }}-${{ github.run_number }}
5454
- name: Upload ${{ matrix.fork }} test results
55-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
55+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
5656
if: always()
5757
with:
5858
name: test-results-mainnet-${{ matrix.fork }}-${{ github.run_number }}

.github/workflows/release.yml

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
python-version-file: "consensus-specs/pyproject.toml"
2929

3030
- name: Install uv ${{ vars.UV_VERSION }}
31-
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
31+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
3232
with:
3333
enable-cache: true
3434
version: ${{ vars.UV_VERSION }}
@@ -43,27 +43,23 @@ jobs:
4343
exit 1
4444
fi
4545
46-
# Add support for large files
47-
- name: Install Git LFS
46+
# Ensure framework tests pass
47+
- name: Run tests for framework
4848
run: |
49-
sudo apt-get update
50-
sudo apt-get install -y git-lfs
51-
git lfs install
49+
cd consensus-specs
50+
make test component=fw
5251
53-
# Clone the repo with our PAT and delete old files
54-
- name: Clone spec tests repo
52+
# Ensure minimal tests pass
53+
- name: Run tests for minimal
5554
run: |
56-
rm -rf consensus-spec-tests
57-
git clone https://x-access-token:${{ secrets.CONSENSUS_SPEC_TESTS_PAT }}@github.com/ethereum/consensus-spec-tests.git --branch=master --single-branch --depth=1 --no-tags
58-
cd consensus-spec-tests
59-
rm -rf configs presets tests
55+
cd consensus-specs
56+
make test component=pyspec preset=minimal
6057
61-
# Write presets/configs to the spec tests repo
62-
- name: Copy presets/configs
58+
# Ensure mainnet tests pass
59+
- name: Run tests for mainnet
6360
run: |
6461
cd consensus-specs
65-
cp -r presets/ ../consensus-spec-tests/presets
66-
cp -r configs/ ../consensus-spec-tests/configs
62+
make test component=pyspec preset=mainnet
6763
6864
# Write reference tests to the spec tests repo
6965
- name: Generate reference tests
@@ -79,21 +75,6 @@ jobs:
7975
tar -czvf minimal.tar.gz tests/minimal
8076
tar -czvf mainnet.tar.gz tests/mainnet
8177
82-
# Commit the tests to the spec tests repo
83-
# Cloned with PAT, so don't need to specify it here
84-
- name: Push spec tests
85-
run: |
86-
cd consensus-spec-tests
87-
git config user.name "github-actions"
88-
git config user.email "[email protected]"
89-
git add -A
90-
if ! git diff --cached --quiet; then
91-
git commit -m "release ${{ github.ref_name }} tests"
92-
git push origin HEAD:refs/heads/master
93-
else
94-
echo "No changes to commit"
95-
fi
96-
9778
# Publish the specs release. We use release-drafter to
9879
# organize PRs into the appropriate section based on PR labels
9980
- name: Publish specs release
@@ -106,23 +87,14 @@ jobs:
10687
env:
10788
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10889

109-
# Finally, publish the spec tests release
110-
# Requires a personal access token (PAT) with contents:read-write
111-
- name: Publish spec tests release
90+
# Upload spec test tarballs to the specs release
91+
- name: Upload spec test tarballs
11292
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
11393
with:
11494
tag_name: ${{ github.ref_name }}
115-
name: "Spec tests for ${{ github.ref_name }}"
116-
body: |
117-
Spec tests for `${{ github.ref_name }}`.
118-
119-
Detailed changelog can be found in [`${{ github.ref_name }}` specs release](https://github.com/ethereum/consensus-specs/releases/tag/${{ github.ref_name }}).
120-
prerelease: ${{ contains(github.ref_name, '-') }}
121-
draft: false
122-
repository: ethereum/consensus-spec-tests
12395
files: |
12496
consensus-spec-tests/general.tar.gz
12597
consensus-spec-tests/minimal.tar.gz
12698
consensus-spec-tests/mainnet.tar.gz
12799
env:
128-
GITHUB_TOKEN: ${{ secrets.CONSENSUS_SPEC_TESTS_PAT }}
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Close stale issues and PRs
1+
name: Close Stale Issues and PRs
22

33
on:
44
schedule:

.github/workflows/docs.yml renamed to .github/workflows/website.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish docs
1+
name: Update Website
22

33
on:
44
push:
@@ -21,7 +21,7 @@ jobs:
2121
python-version-file: "pyproject.toml"
2222

2323
- name: Install uv ${{ vars.UV_VERSION }}
24-
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
24+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
2525
with:
2626
enable-cache: true
2727
version: ${{ vars.UV_VERSION }}

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ build/
1111
output/
1212
dist/
1313

14-
consensus-spec-tests/
15-
1614
.pytest_cache
1715
.mypy_cache
1816

@@ -25,10 +23,7 @@ tests/core/pyspec/eth2spec/deneb/
2523
tests/core/pyspec/eth2spec/electra/
2624
tests/core/pyspec/eth2spec/fulu/
2725
tests/core/pyspec/eth2spec/gloas/
28-
tests/core/pyspec/eth2spec/eip6800/
29-
tests/core/pyspec/eth2spec/eip7441/
30-
tests/core/pyspec/eth2spec/eip7805/
31-
tests/core/pyspec/eth2spec/eip7928/
26+
tests/core/pyspec/eth2spec/eip*/
3227

3328
# coverage reports
3429
.htmlcov

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ VENV = .venv
193193
# Use editable installs for all non-generation targets, but use non-editable
194194
# installs for generators. More details: ethereum/consensus-specs#4633.
195195
UV_RUN = uv run
196-
UV_RUN_NE = uv run --no-editable
196+
UV_RUN_NE = uv run --no-editable --reinstall-package=eth2spec
197197

198198
# Sync dependencies using uv.
199199
_sync: MAYBE_VERBOSE := $(if $(filter true,$(verbose)),--verbose)
@@ -225,7 +225,7 @@ TEST_REPORT_DIR = $(PYSPEC_DIR)/test-reports
225225

226226
# Run pyspec tests.
227227
test: MAYBE_TEST := $(if $(k),-k=$(k))
228-
# Disable parallelism which running a specific test.
228+
# Disable parallelism when running a specific test.
229229
# Parallelism makes debugging difficult (print doesn't work).
230230
test: MAYBE_PARALLEL := $(if $(k),,-n auto)
231231
test: MAYBE_FORK := $(if $(fork),--fork=$(fork))
@@ -313,7 +313,7 @@ MYPY_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), -p $(MYPY_PACKAGE_BASE).
313313
lint: _pyspec
314314
@uv --quiet lock --check
315315
@$(UV_RUN) mdformat --number --wrap=80 $(MARKDOWN_FILES)
316-
@$(UV_RUN) codespell . --skip "./.git,$(VENV),$(PYSPEC_DIR)/.mypy_cache" -I .codespell-whitelist
316+
@$(UV_RUN) codespell
317317
@$(UV_RUN) ruff check --fix --quiet $(CURDIR)/tests $(CURDIR)/pysetup $(CURDIR)/setup.py
318318
@$(UV_RUN) ruff format --quiet $(CURDIR)/tests $(CURDIR)/pysetup $(CURDIR)/setup.py
319319
@$(UV_RUN) mypy $(MYPY_SCOPE)

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Ethereum Proof-of-Stake Consensus Specifications
22

33
[![Join the chat at https://discord.gg/qGpsxSA](https://img.shields.io/badge/chat-on%20discord-blue.svg)](https://discord.gg/qGpsxSA)
4-
[![testgen](https://github.com/ethereum/consensus-specs/actions/workflows/generate_vectors.yml/badge.svg?branch=dev&event=schedule)](https://github.com/ethereum/consensus-specs/actions/workflows/generate_vectors.yml)
4+
[![nightly-tests](https://github.com/ethereum/consensus-specs/actions/workflows/nightly-tests.yml/badge.svg?branch=master&event=schedule)](https://github.com/ethereum/consensus-specs/actions/workflows/nightly-tests.yml)
5+
[![nightly-reftests](https://github.com/ethereum/consensus-specs/actions/workflows/nightly-reftests.yml/badge.svg?branch=master&event=schedule)](https://github.com/ethereum/consensus-specs/actions/workflows/nightly-reftests.yml)
56

67
This repository hosts the current Ethereum
78
[proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/)
@@ -52,12 +53,10 @@ functionality can be found in the following repositories:
5253

5354
### Reference tests
5455

55-
Reference tests built from the executable Python spec are available in the
56-
[Ethereum Proof-of-Stake Consensus Spec Tests](https://github.com/ethereum/consensus-spec-tests)
57-
repository. Compressed tarballs are available for each release
58-
[here](https://github.com/ethereum/consensus-spec-tests/releases). Nightly
59-
reference tests are available
60-
[here](https://github.com/ethereum/consensus-specs/actions/workflows/generate_vectors.yml).
56+
Reference tests built from the executable Python specifications are available in
57+
the release assets for each release in this repository. There are also *nightly*
58+
reference tests which are built from the latest version of the specifications
59+
[here](https://github.com/ethereum/consensus-specs/actions/workflows/nightly-reftests.yml).
6160

6261
## Contributors
6362

0 commit comments

Comments
 (0)