Skip to content

Commit e14deee

Browse files
authored
Merge pull request #4316 from ethereum/dev
Release v1.6.0-alpha.0
2 parents b5c3b61 + 3b7421f commit e14deee

File tree

344 files changed

+7718
-6636
lines changed

Some content is hidden

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

344 files changed

+7718
-6636
lines changed

.github/workflows/generate_vectors.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,15 @@ jobs:
3434
- name: Generate tests
3535
run: |
3636
cd consensus-specs
37-
make -j$(nproc) gen_all 2>&1 | tee ../consensustestgen.log
37+
make reftests verbose=true 2>&1 | tee ../consensustestgen.log
3838
cp -r presets/ ../consensus-spec-tests/presets
3939
cp -r configs/ ../consensus-spec-tests/configs
40-
find . -type d -empty -delete
4140
- name: Check for errors
4241
run: |
4342
if grep -q "\[ERROR\]" consensustestgen.log; then
4443
echo "There is an error in the log"
4544
exit 1
4645
fi
47-
if find . -type f -name "INCOMPLETE" | grep -q "INCOMPLETE"; then
48-
echo "There is an INCOMPLETE file"
49-
exit 1
50-
fi
5146
- name: Archive configurations
5247
run: |
5348
cd consensus-spec-tests

.github/workflows/nightly-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
- deneb
3131
- electra
3232
- fulu
33-
- eip7441
3433
- eip7732
34+
- eip7805
3535
steps:
3636
- name: Checkout repository
3737
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/run-tests.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jobs:
5050
- deneb
5151
- electra
5252
- fulu
53-
- eip7441
5453
- eip7732
54+
- eip7805
5555
steps:
5656
- name: Checkout repository
5757
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -62,23 +62,3 @@ jobs:
6262
cache: 'pip'
6363
- name: Run pyspec tests for ${{ matrix.fork }}
6464
run: make test preset=minimal fork=${{ matrix.fork }}
65-
66-
modcheck:
67-
needs: [lint, whitespace]
68-
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
69-
steps:
70-
- name: Checkout repository
71-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
72-
- name: Setup python
73-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
74-
with:
75-
python-version: '3.12'
76-
cache: 'pip'
77-
- name: Run generators with --modcheck
78-
run: make gen_all modcheck=true 2>&1 | tee consensustestgen.log
79-
- name: Check for errors
80-
run: |
81-
if grep -q "\[ERROR\]" consensustestgen.log; then
82-
echo "There is an error in the log"
83-
exit 1
84-
fi

Makefile

Lines changed: 42 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@ ALL_EXECUTABLE_SPEC_NAMES = \
1313
eip6800 \
1414
eip7441 \
1515
eip7732 \
16-
eip7805
16+
eip7805
1717

1818
# A list of fake targets.
1919
.PHONY: \
2020
clean \
2121
coverage \
22-
detect_errors \
23-
gen_all \
24-
gen_list \
2522
help \
2623
kzg_setups \
2724
lint \
2825
pyspec \
26+
reftests \
2927
serve_docs \
3028
test
3129

@@ -38,17 +36,14 @@ NORM = $(shell tput sgr0)
3836

3937
# Print target descriptions.
4038
help:
41-
@echo "make $(BOLD)clean$(NORM) -- delete all untracked files"
42-
@echo "make $(BOLD)coverage$(NORM) -- run pyspec tests with coverage"
43-
@echo "make $(BOLD)detect_errors$(NORM) -- detect generator errors"
44-
@echo "make $(BOLD)gen_<gen>$(NORM) -- run a single generator"
45-
@echo "make $(BOLD)gen_all$(NORM) -- run all generators"
46-
@echo "make $(BOLD)gen_list$(NORM) -- list all generator targets"
47-
@echo "make $(BOLD)kzg_setups$(NORM) -- generate trusted setups"
48-
@echo "make $(BOLD)lint$(NORM) -- run the linters"
49-
@echo "make $(BOLD)pyspec$(NORM) -- generate python specifications"
50-
@echo "make $(BOLD)serve_docs$(NORM) -- start a local docs web server"
51-
@echo "make $(BOLD)test$(NORM) -- run pyspec tests"
39+
@echo "make $(BOLD)clean$(NORM) -- delete all untracked files"
40+
@echo "make $(BOLD)coverage$(NORM) -- run pyspec tests with coverage"
41+
@echo "make $(BOLD)kzg_setups$(NORM) -- generate trusted setups"
42+
@echo "make $(BOLD)lint$(NORM) -- run the linters"
43+
@echo "make $(BOLD)pyspec$(NORM) -- build python specifications"
44+
@echo "make $(BOLD)reftests$(NORM) -- generate reference tests"
45+
@echo "make $(BOLD)serve_docs$(NORM) -- start a local docs web server"
46+
@echo "make $(BOLD)test$(NORM) -- run pyspec tests"
5247

5348
###############################################################################
5449
# Virtual Environment
@@ -64,7 +59,7 @@ MDFORMAT_VENV = $(VENV)/bin/mdformat
6459
$(VENV):
6560
@echo "Creating virtual environment"
6661
@python3 -m venv $(VENV)
67-
@$(PIP_VENV) install --quiet uv==0.5.24
62+
@$(PIP_VENV) install --quiet --upgrade uv
6863

6964
###############################################################################
7065
# Specification
@@ -189,82 +184,58 @@ MARKDOWN_FILES = $(CURDIR)/README.md \
189184

190185
# Check for mistakes.
191186
lint: pyspec
192-
@$(MDFORMAT_VENV) --number $(MARKDOWN_FILES)
187+
@$(MDFORMAT_VENV) --number --wrap=80 $(MARKDOWN_FILES)
193188
@$(CODESPELL_VENV) . --skip "./.git,$(VENV),$(PYSPEC_DIR)/.mypy_cache" -I .codespell-whitelist
194-
@$(PYTHON_VENV) -m black $(CURDIR)/tests
189+
@$(PYTHON_VENV) -m isort --quiet $(CURDIR)/tests
190+
@$(PYTHON_VENV) -m black --quiet $(CURDIR)/tests
195191
@$(PYTHON_VENV) -m pylint --rcfile $(PYLINT_CONFIG) $(PYLINT_SCOPE)
196192
@$(PYTHON_VENV) -m mypy --config-file $(MYPY_CONFIG) $(MYPY_SCOPE)
197193

198194
###############################################################################
199195
# Generators
200196
###############################################################################
201197

202-
TEST_VECTOR_DIR = $(CURDIR)/../consensus-spec-tests/tests
203-
GENERATOR_DIR = $(CURDIR)/tests/generators
204-
SCRIPTS_DIR = $(CURDIR)/scripts
205-
GENERATOR_ERROR_LOG_FILE = $(TEST_VECTOR_DIR)/testgen_error_log.txt
206-
GENERATORS = $(sort $(dir $(wildcard $(GENERATOR_DIR)/*/.)))
207-
GENERATOR_TARGETS = $(patsubst $(GENERATOR_DIR)/%/, gen_%, $(GENERATORS))
208198
COMMA:= ,
199+
TEST_VECTOR_DIR = $(CURDIR)/../consensus-spec-tests/tests
209200

210-
# List available generators.
211-
gen_list:
212-
@for target in $(shell echo $(GENERATOR_TARGETS) | tr ' ' '\n' | sort -n); do \
213-
echo $$target; \
214-
done
215-
216-
# Run one generator.
201+
# Generate reference tests.
217202
# This will forcibly rebuild pyspec just in case.
218-
# To print more details, append verbose=true, eg:
219-
# make gen_bls verbose=true
220-
# To check modules for a generator, append modcheck=true, eg:
221-
# 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
203+
# To generate reference tests for a single runner, append runner=<runner>, eg:
204+
# make reftests runner=bls
205+
# To generate reference tests with more details, append verbose=true, eg:
206+
# make reftests runner=bls verbose=true
207+
# To generate reference tests with fewer threads, append threads=N, eg:
208+
# make reftests runner=bls threads=1
209+
# To generate reference tests for a specific test, append k=<test>, eg:
210+
# make reftests runner=operations k=invalid_committee_index
211+
# To generate reference tests for a specific fork, append fork=<fork>, eg:
212+
# make reftests runner=operations fork=fulu
213+
# To generate reference tests for a specific preset, append preset=<preset>, eg:
214+
# make reftests runner=operations preset=mainnet
215+
# To generate reference tests for a list of tests, forks, and/or presets, append them as comma-separated lists, eg:
216+
# make reftests runner=operations k=invalid_committee_index,invalid_too_many_committee_bits
230217
# 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)
233-
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)))
237-
gen_%: pyspec
238-
@mkdir -p $(TEST_VECTOR_DIR)
239-
@$(PYTHON_VENV) $(GENERATOR_DIR)/$*/main.py \
218+
# make reftests runner=operations preset=mainnet fork=fulu k=invalid_committee_index
219+
reftests: MAYBE_VERBOSE := $(if $(filter true,$(verbose)),--verbose)
220+
reftests: MAYBE_THREADS := $(if $(threads),--threads=$(threads))
221+
reftests: MAYBE_RUNNERS := $(if $(runner),--runners $(subst ${COMMA}, ,$(runner)))
222+
reftests: MAYBE_TESTS := $(if $(k),--cases $(subst ${COMMA}, ,$(k)))
223+
reftests: MAYBE_FORKS := $(if $(fork),--forks $(subst ${COMMA}, ,$(fork)))
224+
reftests: MAYBE_PRESETS := $(if $(preset),--presets $(subst ${COMMA}, ,$(preset)))
225+
reftests: pyspec
226+
@$(PYTHON_VENV) -m tests.generators.main \
240227
--output $(TEST_VECTOR_DIR) \
241228
$(MAYBE_VERBOSE) \
242-
$(MAYBE_MODCHECK) \
229+
$(MAYBE_THREADS) \
230+
$(MAYBE_RUNNERS) \
243231
$(MAYBE_TESTS) \
244232
$(MAYBE_FORKS) \
245233
$(MAYBE_PRESETS)
246234

247-
# Run all generators then check for errors.
248-
gen_all: $(GENERATOR_TARGETS)
249-
@$(MAKE) detect_errors
250-
251-
# Detect errors in generators.
252-
detect_errors: $(TEST_VECTOR_DIR)
253-
@incomplete_files=$$(find $(TEST_VECTOR_DIR) -name "INCOMPLETE"); \
254-
if [ -n "$$incomplete_files" ]; then \
255-
echo "[ERROR] incomplete detected"; \
256-
exit 1; \
257-
fi
258-
@if [ -f $(GENERATOR_ERROR_LOG_FILE) ]; then \
259-
echo "[ERROR] $(GENERATOR_ERROR_LOG_FILE) file exists"; \
260-
exit 1; \
261-
fi
262-
@echo "[PASSED] no errors detected"
263-
264235
# Generate KZG trusted setups for testing.
265236
kzg_setups: pyspec
266237
@for preset in minimal mainnet; do \
267-
$(PYTHON_VENV) $(SCRIPTS_DIR)/gen_kzg_trusted_setups.py \
238+
$(PYTHON_VENV) $(CURDIR)/scripts/gen_kzg_trusted_setups.py \
268239
--secret=1337 \
269240
--g1-length=4096 \
270241
--g2-length=65 \

README.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
[![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)
55

66
This repository hosts the current Ethereum
7-
[proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) specifications.
8-
Discussions about design rationale and proposed changes can be brought up and discussed as issues.
9-
Solidified, agreed-upon changes to the specifications can be made through pull requests.
7+
[proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/)
8+
specifications. Discussions about design rationale and proposed changes can be
9+
brought up and discussed as issues. Solidified, agreed-upon changes to the
10+
specifications can be made through pull requests.
1011

1112
## Specifications
1213

13-
Core specifications for Ethereum proof-of-stake clients can be found in [specs](specs). These are
14-
divided into features. Features are researched and developed in parallel, and then consolidated into
15-
sequential upgrades when ready.
14+
Core specifications for Ethereum proof-of-stake clients can be found in
15+
[specs](specs). These are divided into features. Features are researched and
16+
developed in parallel, and then consolidated into sequential upgrades when
17+
ready.
1618

1719
### Stable Specifications
1820

@@ -39,8 +41,8 @@ sequential upgrades when ready.
3941

4042
### External specifications
4143

42-
Additional specifications and standards outside of requisite client functionality can be found in
43-
the following repositories:
44+
Additional specifications and standards outside of requisite client
45+
functionality can be found in the following repositories:
4446

4547
- [Beacon APIs](https://github.com/ethereum/beacon-apis)
4648
- [Engine APIs](https://github.com/ethereum/execution-apis/tree/main/src/engine)
@@ -49,11 +51,11 @@ the following repositories:
4951

5052
### Reference tests
5153

52-
Reference tests built from the executable Python spec are available in the [Ethereum Proof-of-Stake
53-
Consensus Spec Tests](https://github.com/ethereum/consensus-spec-tests) repository. Compressed
54-
tarballs are available for each release
55-
[here](https://github.com/ethereum/consensus-spec-tests/releases). Nightly reference tests are
56-
available
54+
Reference tests built from the executable Python spec are available in the
55+
[Ethereum Proof-of-Stake Consensus Spec Tests](https://github.com/ethereum/consensus-spec-tests)
56+
repository. Compressed tarballs are available for each release
57+
[here](https://github.com/ethereum/consensus-spec-tests/releases). Nightly
58+
reference tests are available
5759
[here](https://github.com/ethereum/consensus-specs/actions/workflows/generate_vectors.yml).
5860

5961
## Contributors
@@ -80,12 +82,16 @@ make help
8082

8183
### Design goals
8284

83-
The following are the broad design goals for the Ethereum proof-of-stake consensus specifications:
85+
The following are the broad design goals for the Ethereum proof-of-stake
86+
consensus specifications:
8487

8588
- Minimize complexity, even at the cost of some losses in efficiency.
86-
- Remain live through major network partitions and when very large portions of nodes go offline.
87-
- Select components that are quantum secure or easily swappable for quantum-secure alternatives.
88-
- Utilize crypto and design techniques that allow for a large participation of validators.
89+
- Remain live through major network partitions and when very large portions of
90+
nodes go offline.
91+
- Select components that are quantum secure or easily swappable for
92+
quantum-secure alternatives.
93+
- Utilize crypto and design techniques that allow for a large participation of
94+
validators.
8995
- Minimize hardware requirements such that a consumer laptop can participate.
9096

9197
### Useful resources

configs/mainnet.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ SAMPLES_PER_SLOT: 8
172172
CUSTODY_REQUIREMENT: 4
173173
VALIDATOR_CUSTODY_REQUIREMENT: 8
174174
BALANCE_PER_ADDITIONAL_CUSTODY_GROUP: 32000000000
175-
MAX_BLOBS_PER_BLOCK_FULU: 12
176175
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: 4096
177176

178177
# EIP7441
@@ -191,3 +190,14 @@ VIEW_FREEZE_DEADLINE: 9
191190
MAX_REQUEST_INCLUSION_LIST: 16
192191
# 2**13 (= 8192)
193192
MAX_BYTES_PER_INCLUSION_LIST: 8192
193+
194+
# Blob Scheduling
195+
# ---------------------------------------------------------------
196+
197+
BLOB_SCHEDULE:
198+
# Deneb
199+
- EPOCH: 269568
200+
MAX_BLOBS_PER_BLOCK: 6
201+
# Electra
202+
- EPOCH: 364032
203+
MAX_BLOBS_PER_BLOCK: 9

configs/minimal.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ SAMPLES_PER_SLOT: 8
169169
CUSTODY_REQUIREMENT: 4
170170
VALIDATOR_CUSTODY_REQUIREMENT: 8
171171
BALANCE_PER_ADDITIONAL_CUSTODY_GROUP: 32000000000
172-
MAX_BLOBS_PER_BLOCK_FULU: 12
173172
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: 4096
174173

175174
# EIP7441
@@ -188,3 +187,14 @@ VIEW_FREEZE_DEADLINE: 3
188187
MAX_REQUEST_INCLUSION_LIST: 16
189188
# 2**13 (= 8192)
190189
MAX_BYTES_PER_INCLUSION_LIST: 8192
190+
191+
# Blob Scheduling
192+
# ---------------------------------------------------------------
193+
194+
BLOB_SCHEDULE:
195+
# Deneb
196+
- EPOCH: 18446744073709551615
197+
MAX_BLOBS_PER_BLOCK: 6
198+
# Electra
199+
- EPOCH: 18446744073709551615
200+
MAX_BLOBS_PER_BLOCK: 9

docs/docs/release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ cp -r presets ../consensus-spec-tests
125125
cp -r configs ../consensus-spec-tests
126126
```
127127

128-
Next, use `make gen_all` to generate all the reference tests. The following command will run all
128+
Next, use `make reftests` to generate all the reference tests. The following command will run all
129129
generators in parallel for maximum speed. The console output is saved to a file so we can check for
130130
errors afterwards.
131131

@@ -143,7 +143,7 @@ errors afterwards.
143143
> to do this. Note that the "Bundle Reference Tests" section can be skipped if this route is taken.
144144
145145
```bash
146-
make --jobs gen_all 2>&1 | tee ../consensustestgen.log
146+
make reftests verbose=true 2>&1 | tee ../consensustestgen.log
147147
```
148148

149149
Next, check for errors by searching for "ERROR" in test logfile.

presets/mainnet/fulu.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4
77

88
# Blob
99
# ---------------------------------------------------------------
10-
# 2**6` (= 64)
10+
# 2**6 (= 64)
1111
FIELD_ELEMENTS_PER_CELL: 64
12-
# 2**0 * FIELD_ELEMENTS_PER_BLOB (= 8,192)
12+
# 2**1 * FIELD_ELEMENTS_PER_BLOB (= 8,192)
1313
FIELD_ELEMENTS_PER_EXT_BLOB: 8192

presets/minimal/fulu.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4
77

88
# Blob
99
# ---------------------------------------------------------------
10-
# 2**6` (= 64)
10+
# 2**6 (= 64)
1111
FIELD_ELEMENTS_PER_CELL: 64
12-
# 2**0 * FIELD_ELEMENTS_PER_BLOB (= 8,192)
12+
# 2**1 * FIELD_ELEMENTS_PER_BLOB (= 8,192)
1313
FIELD_ELEMENTS_PER_EXT_BLOB: 8192

0 commit comments

Comments
 (0)