Skip to content

Commit c746890

Browse files
committed
Merge branch 'dev' into bf-emptytxspec
2 parents e1eaa7f + d14fb52 commit c746890

File tree

70 files changed

+600
-519
lines changed

Some content is hidden

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

70 files changed

+600
-519
lines changed

.circleci/config.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ commands:
3535
description: "Restore the cache with pyspec keys"
3636
steps:
3737
- restore_cached_venv:
38-
venv_name: v24-pyspec
38+
venv_name: v25-pyspec
3939
reqs_checksum: cache-{{ checksum "setup.py" }}-{{ checksum "requirements_preinstallation.txt" }}
4040
save_pyspec_cached_venv:
4141
description: Save a venv into a cache with pyspec keys"
4242
steps:
4343
- save_cached_venv:
44-
venv_name: v24-pyspec
44+
venv_name: v25-pyspec
4545
reqs_checksum: cache-{{ checksum "setup.py" }}-{{ checksum "requirements_preinstallation.txt" }}
4646
venv_path: ./venv
4747
restore_deposit_contract_tester_cached_venv:
@@ -60,7 +60,7 @@ commands:
6060
jobs:
6161
checkout_specs:
6262
docker:
63-
- image: circleci/python:3.9
63+
- image: cimg/python:3.12.4
6464
working_directory: ~/specs-repo
6565
steps:
6666
# Restore git repo at point close to target branch/revision, to speed up checkout
@@ -80,7 +80,7 @@ jobs:
8080
- ~/specs-repo
8181
install_pyspec_test:
8282
docker:
83-
- image: circleci/python:3.9
83+
- image: cimg/python:3.12.4
8484
working_directory: ~/specs-repo
8585
steps:
8686
- restore_cache:
@@ -92,7 +92,7 @@ jobs:
9292
- save_pyspec_cached_venv
9393
test-phase0:
9494
docker:
95-
- image: circleci/python:3.9
95+
- image: cimg/python:3.12.4
9696
working_directory: ~/specs-repo
9797
steps:
9898
- restore_cache:
@@ -105,7 +105,7 @@ jobs:
105105
path: tests/core/pyspec/test-reports
106106
test-altair:
107107
docker:
108-
- image: circleci/python:3.9
108+
- image: cimg/python:3.12.4
109109
working_directory: ~/specs-repo
110110
steps:
111111
- restore_cache:
@@ -118,7 +118,7 @@ jobs:
118118
path: tests/core/pyspec/test-reports
119119
test-bellatrix:
120120
docker:
121-
- image: circleci/python:3.9
121+
- image: cimg/python:3.12.4
122122
working_directory: ~/specs-repo
123123
steps:
124124
- restore_cache:
@@ -131,7 +131,7 @@ jobs:
131131
path: tests/core/pyspec/test-reports
132132
test-capella:
133133
docker:
134-
- image: circleci/python:3.9
134+
- image: cimg/python:3.12.4
135135
working_directory: ~/specs-repo
136136
steps:
137137
- restore_cache:
@@ -144,7 +144,7 @@ jobs:
144144
path: tests/core/pyspec/test-reports
145145
test-deneb:
146146
docker:
147-
- image: circleci/python:3.9
147+
- image: cimg/python:3.12.4
148148
working_directory: ~/specs-repo
149149
steps:
150150
- restore_cache:
@@ -157,7 +157,7 @@ jobs:
157157
path: tests/core/pyspec/test-reports
158158
test-electra:
159159
docker:
160-
- image: circleci/python:3.9
160+
- image: cimg/python:3.12.4
161161
working_directory: ~/specs-repo
162162
steps:
163163
- restore_cache:
@@ -170,7 +170,7 @@ jobs:
170170
path: tests/core/pyspec/test-reports
171171
test-whisk:
172172
docker:
173-
- image: circleci/python:3.9
173+
- image: cimg/python:3.12.4
174174
working_directory: ~/specs-repo
175175
steps:
176176
- restore_cache:
@@ -183,7 +183,7 @@ jobs:
183183
path: tests/core/pyspec/test-reports
184184
test-eip7594:
185185
docker:
186-
- image: circleci/python:3.9
186+
- image: cimg/python:3.12.4
187187
working_directory: ~/specs-repo
188188
steps:
189189
- restore_cache:
@@ -205,7 +205,7 @@ jobs:
205205
command: sudo npm install -g [email protected] && make check_toc
206206
codespell:
207207
docker:
208-
- image: circleci/python:3.9
208+
- image: cimg/python:3.12.4
209209
working_directory: ~/specs-repo
210210
steps:
211211
- checkout
@@ -214,7 +214,7 @@ jobs:
214214
command: pip install 'codespell<3.0.0,>=2.0.0' --user && make codespell
215215
lint:
216216
docker:
217-
- image: circleci/python:3.9
217+
- image: cimg/python:3.12.4
218218
working_directory: ~/specs-repo
219219
steps:
220220
- restore_cache:
@@ -270,7 +270,7 @@ jobs:
270270
- /nix
271271
install_deposit_contract_web3_tester:
272272
docker:
273-
- image: circleci/python:3.9
273+
- image: cimg/python:3.12.4
274274
working_directory: ~/specs-repo
275275
steps:
276276
- restore_cache:
@@ -282,7 +282,7 @@ jobs:
282282
- save_deposit_contract_tester_cached_venv
283283
test_deposit_contract_web3_tests:
284284
docker:
285-
- image: circleci/python:3.9
285+
- image: cimg/python:3.12.4
286286
working_directory: ~/specs-repo
287287
steps:
288288
- restore_cache:

.github/workflows/generate_vectors.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ on:
1212
default: dev
1313
type: string
1414
required: true
15+
schedule:
16+
- cron: '0 2 * * *'
1517

1618
jobs:
1719
generate-tests:
18-
runs-on: [self-hosted-ghr-custom, size-chungus-x64, profile-consensusSpecs]
20+
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
1921
steps:
2022
- name: Checkout repository
2123
uses: actions/checkout@v4
2224
with:
2325
repository: 'ethereum/consensus-specs'
2426
path: 'consensus-specs'
25-
ref: ${{ inputs.source_ref }}
27+
ref: ${{ inputs.ref || 'dev' }}
2628
- name: Checkout consensus-spec-tests repository
2729
uses: actions/checkout@v4
2830
with:
@@ -32,7 +34,7 @@ jobs:
3234
- name: Setup Python
3335
uses: actions/setup-python@v5
3436
with:
35-
python-version: '3.10'
37+
python-version: '3.12.4'
3638
cache: ''
3739
- name: Clean up Spec Repository
3840
run: |

.github/workflows/run-tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Setup Python
4646
uses: actions/setup-python@v5
4747
with:
48-
python-version: '3.10'
48+
python-version: '3.12.4'
4949
cache: ''
5050
- name: Check codespell
5151
run: make codespell
@@ -55,10 +55,12 @@ jobs:
5555
steps:
5656
- name: Checkout repository
5757
uses: actions/checkout@v4
58+
- name: Setup Rust for dependencies
59+
uses: actions-rust-lang/setup-rust-toolchain@v1
5860
- name: Setup Python
5961
uses: actions/setup-python@v5
6062
with:
61-
python-version: '3.10'
63+
python-version: '3.12.4'
6264
cache: ''
6365
- name: Install pyspec requirements
6466
run: make install_test
@@ -76,10 +78,12 @@ jobs:
7678
steps:
7779
- name: Checkout repository
7880
uses: actions/checkout@v4
81+
- name: Setup Rust for dependencies
82+
uses: actions-rust-lang/setup-rust-toolchain@v1
7983
- name: Setup Python
8084
uses: actions/setup-python@v5
8185
with:
82-
python-version: '3.10'
86+
python-version: '3.12.4'
8387
cache: ''
8488
- name: set TEST_PRESET_TYPE
8589
if: github.event.inputs.test_preset_type != ''

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ dist_check:
9696
dist_upload:
9797
python3 -m twine upload dist/*
9898

99+
build_wheel: install_test pyspec
100+
. venv/bin/activate && \
101+
python3 -m build --no-isolation --outdir ./dist ./
99102

100103
# "make generate_tests" to run all generators
101104
generate_tests: $(GENERATOR_TARGETS)
@@ -195,7 +198,8 @@ define run_generator
195198
cd $(GENERATOR_DIR)/$(1); \
196199
if ! test -d venv; then python3 -m venv venv; fi; \
197200
. venv/bin/activate; \
198-
pip3 install -r requirements.txt; \
201+
pip3 install ../../../dist/eth2spec-*.whl; \
202+
pip3 install 'eth2spec[generator]'; \
199203
python3 main.py -o $(CURRENT_DIR)/$(TEST_VECTOR_DIR); \
200204
echo "generator $(1) finished"
201205
endef
@@ -217,7 +221,7 @@ gen_kzg_setups:
217221

218222
# For any generator, build it using the run_generator function.
219223
# (creation of output dir is a dependency)
220-
gen_%: $(TEST_VECTOR_DIR)
224+
gen_%: build_wheel $(TEST_VECTOR_DIR)
221225
$(call run_generator,$*)
222226

223227
detect_generator_incomplete: $(TEST_VECTOR_DIR)

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,19 @@ Documentation on the different components used during spec writing can be found
7373
## Consensus spec tests
7474

7575
Conformance tests built from the executable python spec are available in the [Ethereum Proof-of-Stake Consensus Spec Tests](https://github.com/ethereum/consensus-spec-tests) repo. Compressed tarballs are available in [releases](https://github.com/ethereum/consensus-spec-tests/releases).
76+
77+
78+
## Installation and Usage
79+
The consensus-specs repo can be used by running the tests locally or inside a docker container.
80+
81+
To run the tests locally:
82+
- Clone the repository with `git clone https://github.com/ethereum/consensus-specs.git`
83+
- Switch to the directory `cd consensus-specs`
84+
- Install the dependencies with: `make install_test && make preinstallation && make pyspec`
85+
- Run the tests with `make citest`
86+
87+
To run the tests inside a docker container:
88+
- Switch to the directory with `cd scripts`
89+
- Run the script `./build_run_docker_tests.sh`
90+
- Find the results in a folder called `./testResults`
91+
- Find more ways to customize the script with `./build_run_docker_tests.sh --h`

configs/mainnet.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ WHISK_PROPOSER_SELECTION_GAP: 2
161161

162162
# EIP7594
163163
NUMBER_OF_COLUMNS: 128
164-
MAX_CELLS_IN_EXTENDED_MATRIX: 768
165164
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
166165
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
167166
SAMPLES_PER_SLOT: 8
@@ -170,3 +169,6 @@ CUSTODY_REQUIREMENT: 4
170169
# [New in Electra:EIP7251]
171170
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)
172171
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 # 2**8 * 10**9 (= 256,000,000,000)
172+
173+
# EIP7732
174+
MAX_REQUEST_PAYLOADS: 128

configs/minimal.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ WHISK_PROPOSER_SELECTION_GAP: 1
160160

161161
# EIP7594
162162
NUMBER_OF_COLUMNS: 128
163-
MAX_CELLS_IN_EXTENDED_MATRIX: 768
164163
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
165164
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
166165
SAMPLES_PER_SLOT: 8
@@ -169,3 +168,6 @@ CUSTODY_REQUIREMENT: 4
169168
# [New in Electra:EIP7251]
170169
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 # 2**6 * 10**9 (= 64,000,000,000)
171170
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)
171+
172+
# EIP7732
173+
MAX_REQUEST_PAYLOADS: 128

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Rename the build stage from 'base' to 'builder' for clarification and code readability
2-
FROM python:3.11.0-slim-bullseye as builder
2+
FROM python:3.12.4-slim-bullseye as builder
33

44
ENV DEBIAN_FRONTEND=noninteractive \
55
WORKDIR=/consensus-specs \

docker/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Ideally manual running of docker containers is for advanced users, we recommend
1313
The `scripts/build_run_docker_tests.sh` script will cover most usecases. The script allows the user to configure the fork(altair/bellatrix/capella..), `$IMAGE_NAME` (specifies the container to use), preset type (mainnet/minimal), and test all forks flags. Ideally, this is the main way that users interact with the spec tests instead of running it locally with varying versions of dependencies.
1414

1515
E.g:
16-
- `./build_run_test.sh --p mainnet` will run the mainnet preset tests
17-
- `./build_run_test.sh --a` will run all the tests across all the forks
18-
- `./build_run_test.sh --f deneb` will only run deneb tests
16+
- `./build_run_docker_tests.sh --p mainnet` will run the mainnet preset tests
17+
- `./build_run_docker_tests.sh --a` will run all the tests across all the forks
18+
- `./build_run_docker_tests.sh --f deneb` will only run deneb tests
1919

2020
Results are always placed in a folder called `./testResults`. The results are `.xml` files and contain the fork they represent and the date/time they were run at.

pysetup/spec_builders/eip7594.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def hardcoded_custom_type_dep_constants(cls, spec_object) -> str:
2727
'FIELD_ELEMENTS_PER_CELL': spec_object.preset_vars['FIELD_ELEMENTS_PER_CELL'].value,
2828
'FIELD_ELEMENTS_PER_EXT_BLOB': spec_object.preset_vars['FIELD_ELEMENTS_PER_EXT_BLOB'].value,
2929
'NUMBER_OF_COLUMNS': spec_object.config_vars['NUMBER_OF_COLUMNS'].value,
30-
'MAX_CELLS_IN_EXTENDED_MATRIX': spec_object.config_vars['MAX_CELLS_IN_EXTENDED_MATRIX'].value,
3130
}
3231

3332
@classmethod

0 commit comments

Comments
 (0)