Skip to content

Commit b5c3b61

Browse files
Merge pull request #4298 from ethereum/dev
Release v1.5.0
2 parents d8cfdf2 + 8410e4f commit b5c3b61

File tree

95 files changed

+1998
-3280
lines changed

Some content is hidden

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

95 files changed

+1998
-3280
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1414
- name: Build docs
1515
run: make _copy_docs
16-
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
16+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1717
with:
1818
python-version: 3.x
1919
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3

.github/workflows/generate_vectors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
path: 'consensus-specs'
2828
ref: ${{ inputs.ref || 'dev' }}
2929
- name: Setup Python
30-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
30+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3131
with:
3232
python-version: '3.12.4'
3333
cache: ''

.github/workflows/nightly-tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Nightly mainnet tests
2+
3+
defaults:
4+
run:
5+
shell: zsh {0}
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
ref:
11+
description: The branch, tag or SHA to checkout and build from
12+
default: dev
13+
type: string
14+
required: true
15+
schedule:
16+
# Every day at 00:00 UTC
17+
- cron: '0 0 * * *'
18+
19+
jobs:
20+
tests:
21+
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
fork:
26+
- phase0
27+
- altair
28+
- bellatrix
29+
- capella
30+
- deneb
31+
- electra
32+
- fulu
33+
- eip7441
34+
- eip7732
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
- name: Setup Python
39+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
40+
with:
41+
python-version: '3.12'
42+
- name: test-${{ matrix.fork }}
43+
run: make test preset=mainnet fork=${{ matrix.fork }}

.github/workflows/run-tests.yml

Lines changed: 34 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,32 @@
1-
name: Run spec tests and linter
1+
name: Run tests
22

33
defaults:
44
run:
55
shell: zsh {0}
66

7-
env:
8-
TEST_PRESET_TYPE: "minimal"
9-
107
on:
118
push:
12-
branches:
13-
- dev
14-
- master
9+
branches: [dev, master]
1510
pull_request:
16-
workflow_dispatch:
17-
inputs:
18-
test_preset_type:
19-
default: minimal
20-
description: Type of test to run, either mainnet or minimal
21-
type: string
22-
required: true
23-
schedule:
24-
- cron: '0 0 * * *'
2511

2612
jobs:
2713
lint:
28-
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
14+
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
2915
steps:
3016
- name: Checkout repository
3117
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32-
- name: Setup Python
33-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
18+
- name: Setup python
19+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3420
with:
35-
python-version: '3.12.4'
36-
cache: ''
21+
python-version: '3.12'
22+
cache: 'pip'
3723
- name: Run linter for pyspec
3824
run: |
3925
make lint
4026
git diff --exit-code
4127
4228
whitespace:
43-
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
29+
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
4430
steps:
4531
- name: Checkout repository
4632
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -51,56 +37,43 @@ jobs:
5137
exit 1
5238
fi
5339
54-
pyspec-tests:
40+
tests:
41+
needs: [lint, whitespace]
5542
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
56-
needs: [lint]
5743
strategy:
5844
matrix:
59-
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "electra", "fulu", "eip7441", "eip7732"]
45+
fork:
46+
- phase0
47+
- altair
48+
- bellatrix
49+
- capella
50+
- deneb
51+
- electra
52+
- fulu
53+
- eip7441
54+
- eip7732
6055
steps:
6156
- name: Checkout repository
6257
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
63-
- name: Setup Rust for dependencies
64-
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
65-
- name: Setup Python
66-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
58+
- name: Setup python
59+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
6760
with:
68-
python-version: '3.12.4'
69-
cache: ''
70-
- name: set preset
71-
if: github.event.inputs.test_preset_type != ''
72-
run: |
73-
echo "spec_test_preset_type=${{ github.event.inputs.test_preset_type || env.TEST_PRESET_TYPE }}" >> $GITHUB_ENV
74-
- name: set preset
75-
if: ${{ (github.event_name == 'push' && github.ref_name != 'master') || github.event_name == 'pull_request' }}
76-
run: |
77-
echo "spec_test_preset_type=${{ env.TEST_PRESET_TYPE }}" >> $GITHUB_ENV
78-
- name: set preset
79-
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
80-
run: |
81-
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
82-
- name: set preset
83-
if: github.event.schedule=='0 0 * * *'
84-
run: |
85-
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
86-
- name: test-${{ matrix.version }}
87-
run: make test fork=${{ matrix.version }} preset=${{ env.spec_test_preset_type }}
88-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
89-
if: always()
90-
with:
91-
name: test-reports-${{ matrix.version }}
92-
path: tests/core/pyspec/test-reports
61+
python-version: '3.12'
62+
cache: 'pip'
63+
- name: Run pyspec tests for ${{ matrix.fork }}
64+
run: make test preset=minimal fork=${{ matrix.fork }}
9365

94-
gen-modcheck:
95-
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
96-
steps:
66+
modcheck:
67+
needs: [lint, whitespace]
68+
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
69+
steps:
9770
- name: Checkout repository
9871
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
99-
- name: Setup Python
100-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
72+
- name: Setup python
73+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
10174
with:
102-
python-version: '3.12.4'
103-
cache: ''
75+
python-version: '3.12'
76+
cache: 'pip'
10477
- name: Run generators with --modcheck
10578
run: make gen_all modcheck=true 2>&1 | tee consensustestgen.log
10679
- name: Check for errors

Makefile

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ pyspec: $(VENV) setup.py pyproject.toml
8989
TEST_REPORT_DIR = $(PYSPEC_DIR)/test-reports
9090

9191
# Run pyspec tests.
92-
# Note: for debugging output to show, print to stderr.
9392
#
9493
# To run a specific test, append k=<test>, eg:
9594
# make test k=test_verify_kzg_proof
@@ -102,13 +101,16 @@ TEST_REPORT_DIR = $(PYSPEC_DIR)/test-reports
102101
# To run tests with a specific bls library, append bls=<bls>, eg:
103102
# make test bls=arkworks
104103
test: MAYBE_TEST := $(if $(k),-k=$(k))
104+
# Disable parallelism which running a specific test.
105+
# Parallelism makes debugging difficult (print doesn't work).
106+
test: MAYBE_PARALLEL := $(if $(k),,-n auto)
105107
test: MAYBE_FORK := $(if $(fork),--fork=$(fork))
106108
test: PRESET := --preset=$(if $(preset),$(preset),minimal)
107109
test: BLS := --bls-type=$(if $(bls),$(bls),fastest)
108110
test: pyspec
109111
@mkdir -p $(TEST_REPORT_DIR)
110112
@$(PYTHON_VENV) -m pytest \
111-
-n auto \
113+
$(MAYBE_PARALLEL) \
112114
--capture=no \
113115
$(MAYBE_TEST) \
114116
$(MAYBE_FORK) \
@@ -178,7 +180,8 @@ PYLINT_CONFIG = $(CURDIR)/pylint.ini
178180

179181
PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), $(PYSPEC_DIR)/eth2spec/$S)
180182
MYPY_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), -p eth2spec.$S)
181-
MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \
183+
MARKDOWN_FILES = $(CURDIR)/README.md \
184+
$(wildcard $(SPEC_DIR)/*/*.md) \
182185
$(wildcard $(SPEC_DIR)/*/*/*.md) \
183186
$(wildcard $(SPEC_DIR)/_features/*/*.md) \
184187
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \
@@ -202,6 +205,7 @@ SCRIPTS_DIR = $(CURDIR)/scripts
202205
GENERATOR_ERROR_LOG_FILE = $(TEST_VECTOR_DIR)/testgen_error_log.txt
203206
GENERATORS = $(sort $(dir $(wildcard $(GENERATOR_DIR)/*/.)))
204207
GENERATOR_TARGETS = $(patsubst $(GENERATOR_DIR)/%/, gen_%, $(GENERATORS))
208+
COMMA:= ,
205209

206210
# List available generators.
207211
gen_list:
@@ -211,14 +215,34 @@ gen_list:
211215

212216
# Run one generator.
213217
# This will forcibly rebuild pyspec just in case.
218+
# To print more details, append verbose=true, eg:
219+
# make gen_bls verbose=true
214220
# To check modules for a generator, append modcheck=true, eg:
215221
# make gen_genesis modcheck=true
222+
# To run the generator for a specific test, append k=<test>, eg:
223+
# make gen_operations k=invalid_committee_index
224+
# To run the generator for a specific fork, append fork=<fork>, eg:
225+
# make gen_operations fork=fulu
226+
# To run the generator for a specific preset, append preset=<preset>, eg:
227+
# make gen_operations preset=mainnet
228+
# To run the generator for a list of tests, forks, and/or presets, append them as comma-separated lists, eg:
229+
# make gen_operations k=invalid_committee_index,invalid_too_many_committee_bits
230+
# Or all at the same time, eg:
231+
# make gen_operations preset=mainnet fork=fulu k=invalid_committee_index
232+
gen_%: MAYBE_VERBOSE := $(if $(filter true,$(verbose)),--verbose)
216233
gen_%: MAYBE_MODCHECK := $(if $(filter true,$(modcheck)),--modcheck)
234+
gen_%: MAYBE_TESTS := $(if $(k),--case-list $(subst ${COMMA}, ,$(k)))
235+
gen_%: MAYBE_FORKS := $(if $(fork),--fork-list $(subst ${COMMA}, ,$(fork)))
236+
gen_%: MAYBE_PRESETS := $(if $(preset),--preset-list $(subst ${COMMA}, ,$(preset)))
217237
gen_%: pyspec
218238
@mkdir -p $(TEST_VECTOR_DIR)
219239
@$(PYTHON_VENV) $(GENERATOR_DIR)/$*/main.py \
220240
--output $(TEST_VECTOR_DIR) \
221-
$(MAYBE_MODCHECK)
241+
$(MAYBE_VERBOSE) \
242+
$(MAYBE_MODCHECK) \
243+
$(MAYBE_TESTS) \
244+
$(MAYBE_FORKS) \
245+
$(MAYBE_PRESETS)
222246

223247
# Run all generators then check for errors.
224248
gen_all: $(GENERATOR_TARGETS)

0 commit comments

Comments
 (0)