Skip to content

Commit

Permalink
Merge pull request #4036 from ethereum/dev
Browse files Browse the repository at this point in the history
Release v1.5.0-alpha.10
  • Loading branch information
jtraglia authored Dec 14, 2024
2 parents e262b34 + 001caab commit 7deecbb
Show file tree
Hide file tree
Showing 126 changed files with 1,900 additions and 1,966 deletions.
78 changes: 29 additions & 49 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ commands:
description: "Restore the cache with pyspec keys"
steps:
- restore_cached_venv:
venv_name: v25-pyspec
venv_name: v30-pyspec
reqs_checksum: cache-{{ checksum "setup.py" }}-{{ checksum "requirements_preinstallation.txt" }}
save_pyspec_cached_venv:
description: Save a venv into a cache with pyspec keys"
steps:
- save_cached_venv:
venv_name: v25-pyspec
venv_name: v30-pyspec
reqs_checksum: cache-{{ checksum "setup.py" }}-{{ checksum "requirements_preinstallation.txt" }}
venv_path: ./venv
jobs:
checkout_specs:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
# Restore git repo at point close to target branch/revision, to speed up checkout
Expand All @@ -67,152 +67,134 @@ jobs:
- ~/specs-repo
install_pyspec_test:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Install pyspec requirements
command: make install_test
command: make eth2spec
- save_pyspec_cached_venv
test-phase0:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=phase0
command: make test fork=phase0
- store_test_results:
path: tests/core/pyspec/test-reports
test-altair:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=altair
command: make test fork=altair
- store_test_results:
path: tests/core/pyspec/test-reports
test-bellatrix:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=bellatrix
command: make test fork=bellatrix
- store_test_results:
path: tests/core/pyspec/test-reports
test-capella:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=capella
command: make test fork=capella
- store_test_results:
path: tests/core/pyspec/test-reports
test-deneb:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=deneb
command: make test fork=deneb
- store_test_results:
path: tests/core/pyspec/test-reports
test-electra:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=electra
command: make test fork=electra
- store_test_results:
path: tests/core/pyspec/test-reports
test-whisk:
test-fulu:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=whisk
command: make test fork=fulu
- store_test_results:
path: tests/core/pyspec/test-reports
test-eip7594:
test-whisk:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=eip7594
command: make test fork=whisk
- store_test_results:
path: tests/core/pyspec/test-reports
table_of_contents:
docker:
- image: circleci/node:10.16.3
working_directory: ~/specs-repo
steps:
- checkout
- run:
name: Check table of contents
command: sudo npm install -g [email protected] && make check_toc
codespell:
docker:
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- checkout
- run:
name: Check codespell
command: pip install 'codespell<3.0.0,>=2.0.0' --user && make codespell
lint:
docker:
- image: cimg/python:3.12.4
- image: cimg/python:3.12-node
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v3-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_pyspec_cached_venv
- run:
name: Install doctoc
command: sudo npm install -g [email protected]
- run:
name: Run linter for pyspec
command: make lint
- run:
name: Run linter for test generators
command: make lint_generators
workflows:
version: 2.1
test_spec:
Expand All @@ -239,14 +221,12 @@ workflows:
- test-electra:
requires:
- install_pyspec_test
- test-whisk:
- test-fulu:
requires:
- install_pyspec_test
- test-eip7594:
- test-whisk:
requires:
- install_pyspec_test
- table_of_contents
- codespell
- lint:
requires:
- install_pyspec_test
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish docs
on:
push:
branches:
- master
- master
permissions:
contents: write
jobs:
Expand All @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build docs
run: make copy_docs
run: make _copy_docs
- uses: actions/setup-python@v4
with:
python-version: 3.x
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/generate_vectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,10 @@ jobs:
with:
python-version: '3.12.4'
cache: ''
- name: Clean up Spec Repository
run: |
cd consensus-specs
make clean
- name: Install dependencies and generate pyspec
run: |
cd consensus-specs
make install_test
make -B pyspec
- name: Generate tests
run: |
cd consensus-specs
make -j 16 generate_tests 2>&1 | tee ../consensustestgen.log
make -j 16 gen_all 2>&1 | tee ../consensustestgen.log
cp -r presets/ ../consensus-spec-tests/presets
cp -r configs/ ../consensus-spec-tests/configs
find . -type d -empty -delete
Expand Down
69 changes: 29 additions & 40 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,57 +24,44 @@ on:
- cron: '0 0 * * *'

jobs:
table_of_contents:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
lint:
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: ''
- name: Check table of contents
run: npm install -g [email protected] && make check_toc

codespell:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
cache: ''
- name: Check codespell
run: make codespell
- name: Install doctoc
run: npm install -g [email protected]
- name: Run linter for pyspec
run: make lint

lint:
whitespace:
runs-on: [self-hosted-ghr-custom, size-l-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust for dependencies
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.4'
cache: ''
- name: Install pyspec requirements
run: make install_test
- name: Run linter for pyspec
run: make lint
- name: Run linter for test generators
run: make lint_generators
- name: Check for trailing whitespace
run: |
if git grep -n '[[:blank:]]$'; then
echo "Trailing whitespace found. Please fix it."
exit 1
fi
pyspec-tests:
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
needs: [lint,codespell,table_of_contents]
needs: [lint]
strategy:
matrix:
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "electra", "whisk", "eip7594"]
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "electra", "fulu", "whisk"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -85,26 +72,24 @@ jobs:
with:
python-version: '3.12.4'
cache: ''
- name: set TEST_PRESET_TYPE
- name: set preset
if: github.event.inputs.test_preset_type != ''
run: |
echo "spec_test_preset_type=${{ github.event.inputs.test_preset_type || env.TEST_PRESET_TYPE }}" >> $GITHUB_ENV
- name: set TEST_PRESET_TYPE
- name: set preset
if: ${{ (github.event_name == 'push' && github.ref_name != 'master') || github.event_name == 'pull_request' }}
run: |
echo "spec_test_preset_type=${{ env.TEST_PRESET_TYPE}}" >> $GITHUB_ENV
- name: set TEST_PRESET_TYPE
echo "spec_test_preset_type=${{ env.TEST_PRESET_TYPE }}" >> $GITHUB_ENV
- name: set preset
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
run: |
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
- name: set TEST_PRESET_TYPE
- name: set preset
if: github.event.schedule=='0 0 * * *'
run: |
echo "spec_test_preset_type=mainnet" >> $GITHUB_ENV
- name: Install pyspec requirements
run: make install_test
- name: test-${{ matrix.version }}
run: make citest fork=${{ matrix.version }} TEST_PRESET_TYPE=${{env.spec_test_preset_type}}
run: make test fork=${{ matrix.version }} preset=${{ env.spec_test_preset_type }}
- uses: actions/upload-artifact@v4
if: always()
with:
Expand All @@ -121,7 +106,11 @@ jobs:
with:
python-version: '3.12.4'
cache: ''
- name: Install pyspec requirements
run: make install_test
- name: Run generators with --modcheck
run: make generate_tests modcheck=true
run: make gen_all modcheck=true 2>&1 | tee consensustestgen.log
- name: Check for errors
run: |
if grep -q "\[ERROR\]" consensustestgen.log; then
echo "There is an error in the log"
exit 1
fi
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ venv
.venv
/.pytest_cache
*.swp
.eth2spec

build/
output/
Expand All @@ -22,8 +23,8 @@ tests/core/pyspec/eth2spec/bellatrix/
tests/core/pyspec/eth2spec/capella/
tests/core/pyspec/eth2spec/deneb/
tests/core/pyspec/eth2spec/electra/
tests/core/pyspec/eth2spec/fulu/
tests/core/pyspec/eth2spec/whisk/
tests/core/pyspec/eth2spec/eip7594/
tests/core/pyspec/eth2spec/eip6800/
tests/core/pyspec/eth2spec/eip7732/

Expand Down
Loading

0 comments on commit 7deecbb

Please sign in to comment.