Skip to content

Commit 54e3e5c

Browse files
committed
Merge commit 'v1.5.0-alpha.5' into eip-7495
2 parents 268166b + 01aab85 commit 54e3e5c

Some content is hidden

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

53 files changed

+2746
-334
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ tests/core/pyspec/eth2spec/electra/
2525
tests/core/pyspec/eth2spec/whisk/
2626
tests/core/pyspec/eth2spec/eip7594/
2727
tests/core/pyspec/eth2spec/eip6800/
28+
tests/core/pyspec/eth2spec/eip7732/
2829

2930
# coverage reports
3031
.htmlcov

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ SOLIDITY_FILE_NAME = deposit_contract.json
1414
DEPOSIT_CONTRACT_TESTER_DIR = ${SOLIDITY_DEPOSIT_CONTRACT_DIR}/web3_tester
1515
CONFIGS_DIR = ./configs
1616
TEST_PRESET_TYPE ?= minimal
17-
NUMBER_OF_CORES=16
1817
# Collect a list of generator names
1918
GENERATORS = $(sort $(dir $(wildcard $(GENERATOR_DIR)/*/.)))
2019
# Map this list of generator paths to "gen_{generator name}" entries
@@ -35,7 +34,7 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \
3534
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \
3635
$(wildcard $(SSZ_DIR)/*.md)
3736

38-
ALL_EXECUTABLE_SPEC_NAMES = phase0 altair bellatrix capella deneb electra whisk eip6800
37+
ALL_EXECUTABLE_SPEC_NAMES = phase0 altair bellatrix capella deneb electra whisk eip6800 eip7732
3938
# The parameters for commands. Use `foreach` to avoid listing specs again.
4039
COVERAGE_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), --cov=eth2spec.$S.$(TEST_PRESET_TYPE))
4140
PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), ./eth2spec/$S)
@@ -118,7 +117,7 @@ install_test: preinstallation
118117
# Testing against `minimal` or `mainnet` config by default
119118
test: pyspec
120119
. venv/bin/activate; cd $(PY_SPEC_DIR); \
121-
python3 -m pytest -n 4 --disable-bls $(COVERAGE_SCOPE) --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec
120+
python3 -m pytest -n auto --disable-bls $(COVERAGE_SCOPE) --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec
122121

123122
# Testing against `minimal` or `mainnet` config by default
124123
find_test: pyspec
@@ -129,10 +128,10 @@ citest: pyspec
129128
mkdir -p $(TEST_REPORT_DIR);
130129
ifdef fork
131130
. venv/bin/activate; cd $(PY_SPEC_DIR); \
132-
python3 -m pytest -n $(NUMBER_OF_CORES) --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --fork=$(fork) --junitxml=test-reports/test_results.xml eth2spec
131+
python3 -m pytest -n auto --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --fork=$(fork) --junitxml=test-reports/test_results.xml eth2spec
133132
else
134133
. venv/bin/activate; cd $(PY_SPEC_DIR); \
135-
python3 -m pytest -n $(NUMBER_OF_CORES) --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --junitxml=test-reports/test_results.xml eth2spec
134+
python3 -m pytest -n auto --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --junitxml=test-reports/test_results.xml eth2spec
136135
endif
137136

138137

configs/mainnet.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ EIP7594_FORK_EPOCH: 18446744073709551615
5959
# WHISK
6060
WHISK_FORK_VERSION: 0x08000000 # temporary stub
6161
WHISK_FORK_EPOCH: 18446744073709551615
62+
# EIP7732
63+
EIP7732_FORK_VERSION: 0x09000000 # temporary stub
64+
EIP7732_FORK_EPOCH: 18446744073709551615
6265

6366
# Time parameters
6467
# ---------------------------------------------------------------
@@ -158,12 +161,10 @@ WHISK_PROPOSER_SELECTION_GAP: 2
158161

159162
# EIP7594
160163
NUMBER_OF_COLUMNS: 128
161-
MAX_CELLS_IN_EXTENDED_MATRIX: 768
162-
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
164+
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
163165
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
164166
SAMPLES_PER_SLOT: 8
165-
CUSTODY_REQUIREMENT: 1
166-
TARGET_NUMBER_OF_PEERS: 70
167+
CUSTODY_REQUIREMENT: 4
167168

168169
# [New in Electra:EIP7251]
169170
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)

configs/minimal.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ EIP7594_FORK_EPOCH: 18446744073709551615
5858
# WHISK
5959
WHISK_FORK_VERSION: 0x08000001
6060
WHISK_FORK_EPOCH: 18446744073709551615
61+
# EIP7732
62+
EIP7732_FORK_VERSION: 0x09000001
63+
EIP7732_FORK_EPOCH: 18446744073709551615
6164

6265
# Time parameters
6366
# ---------------------------------------------------------------
@@ -157,12 +160,10 @@ WHISK_PROPOSER_SELECTION_GAP: 1
157160

158161
# EIP7594
159162
NUMBER_OF_COLUMNS: 128
160-
MAX_CELLS_IN_EXTENDED_MATRIX: 768
161-
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
163+
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
162164
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
163165
SAMPLES_PER_SLOT: 8
164-
CUSTODY_REQUIREMENT: 1
165-
TARGET_NUMBER_OF_PEERS: 70
166+
CUSTODY_REQUIREMENT: 4
166167

167168
# [New in Electra:EIP7251]
168169
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 # 2**6 * 10**9 (= 64,000,000,000)

docker/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ This dockerfile sets up the dependencies required to run consensus-spec tests. T
66

77
Handy commands:
88
- `docker run -it $IMAGE_NAME /bin/sh` will give you a shell inside the docker container to manually run any tests
9-
- `docker run $IMAGE_NAME make citest` will run the make citest command inside the docker container
9+
- `docker run $IMAGE_NAME make citest` will run the make citest command inside the docker container
1010

1111
Ideally manual running of docker containers is for advanced users, we recommend the script based approach described below for most users.
1212

13-
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), number of cores, 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.
13+
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 --n 16` will run the mainnet preset tests with 16 threads
16+
- `./build_run_test.sh --p mainnet` will run the mainnet preset tests
1717
- `./build_run_test.sh --a` will run all the tests across all the forks
18-
- `./build_run_test.sh --f deneb --n 16` will only run deneb tests on 16 threads
18+
- `./build_run_test.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.

fork_choice/safe-block.md

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

88
- [Introduction](#introduction)
99
- [`get_safe_beacon_block_root`](#get_safe_beacon_block_root)
10-
- [`get_safe_execution_payload_hash`](#get_safe_execution_payload_hash)
10+
- [`get_safe_execution_block_hash`](#get_safe_execution_block_hash)
1111

1212
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1313
<!-- /TOC -->
@@ -31,10 +31,10 @@ def get_safe_beacon_block_root(store: Store) -> Root:
3131
*Note*: Currently safe block algorithm simply returns `store.justified_checkpoint.root`
3232
and is meant to be improved in the future.
3333

34-
## `get_safe_execution_payload_hash`
34+
## `get_safe_execution_block_hash`
3535

3636
```python
37-
def get_safe_execution_payload_hash(store: Store) -> Hash32:
37+
def get_safe_execution_block_hash(store: Store) -> Hash32:
3838
safe_block_root = get_safe_beacon_block_root(store)
3939
safe_block = store.blocks[safe_block_root]
4040

presets/mainnet/eip-7732.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Mainnet preset - EIP7732
2+
3+
# Execution
4+
# ---------------------------------------------------------------
5+
# 2**9 (= 512)
6+
PTC_SIZE: 512
7+
# 2**2 (= 4)
8+
MAX_PAYLOAD_ATTESTATIONS: 4
9+
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH_EIP7732: 13

presets/minimal/eip-7732.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Minimal preset - EIP7732
2+
3+
# Execution
4+
# ---------------------------------------------------------------
5+
# 2**1(= 2)
6+
PTC_SIZE: 2
7+
# 2**2 (= 4)
8+
MAX_PAYLOAD_ATTESTATIONS: 4
9+
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH_EIP7732: 13

pysetup/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
EIP7594 = 'eip7594'
99
EIP6800 = 'eip6800'
1010
WHISK = 'whisk'
11+
EIP7732 = 'eip7732'
1112

1213

1314
# The helper functions that are used when defining constants

pysetup/helpers.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,22 @@ def format_constant(name: str, vardef: VariableDefinition) -> str:
124124
# Keep engine from the most recent fork
125125
execution_engine_cls = reduce(lambda txt, builder: builder.execution_engine_cls() or txt, builders, "")
126126

127+
# Remove deprecated constants
128+
deprecate_constants = reduce(lambda obj, builder: obj.union(builder.deprecate_constants()), builders, set())
129+
# constant_vars = {k: v for k, v in spec_object.constant_vars.items() if k not in deprecate_constants}
130+
filtered_ssz_dep_constants = {k: v for k, v in hardcoded_ssz_dep_constants.items() if k not in deprecate_constants}
131+
# Remove deprecated presets
132+
deprecate_presets = reduce(lambda obj, builder: obj.union(builder.deprecate_presets()), builders, set())
133+
# preset_vars = {k: v for k, v in spec_object.constant_vars.items() if k not in deprecate_constants}
134+
filtered_hardcoded_func_dep_presets = {k: v for k, v in hardcoded_func_dep_presets.items() if k not in deprecate_presets}
135+
127136
constant_vars_spec = '# Constant vars\n' + '\n'.join(format_constant(k, v) for k, v in spec_object.constant_vars.items())
128137
preset_vars_spec = '# Preset vars\n' + '\n'.join(format_constant(k, v) for k, v in spec_object.preset_vars.items())
129138
ordered_class_objects_spec = '\n\n\n'.join(ordered_class_objects.values())
130139
ssz_dep_constants = '\n'.join(map(lambda x: '%s = %s' % (x, hardcoded_ssz_dep_constants[x]), hardcoded_ssz_dep_constants))
131-
ssz_dep_constants_verification = '\n'.join(map(lambda x: 'assert %s == %s' % (x, spec_object.ssz_dep_constants[x]), hardcoded_ssz_dep_constants))
140+
ssz_dep_constants_verification = '\n'.join(map(lambda x: 'assert %s == %s' % (x, spec_object.ssz_dep_constants[x]), filtered_ssz_dep_constants))
132141
custom_type_dep_constants = '\n'.join(map(lambda x: '%s = %s' % (x, hardcoded_custom_type_dep_constants[x]), hardcoded_custom_type_dep_constants))
133-
func_dep_presets_verification = '\n'.join(map(lambda x: 'assert %s == %s # noqa: E501' % (x, spec_object.func_dep_presets[x]), hardcoded_func_dep_presets))
142+
func_dep_presets_verification = '\n'.join(map(lambda x: 'assert %s == %s # noqa: E501' % (x, spec_object.func_dep_presets[x]), filtered_hardcoded_func_dep_presets))
134143
spec_strs = [
135144
imports,
136145
preparations,

0 commit comments

Comments
 (0)