Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.5.0-alpha.4 #3853

Merged
merged 163 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
7f699bf
Rename `get_safe_execution_payload_hash` -> `*_block_hash`
etan-status Feb 8, 2024
94535a6
Add Electra merkle proof test vectors
hwwhww May 13, 2024
01a2c7b
Add `test_fork_has_compounding_withdrawal_credential` test case
hwwhww May 13, 2024
8b26470
Add `test_fork_pre_activation` test case
hwwhww May 13, 2024
b848ca6
improved sampling description
cskiraly May 28, 2024
8d33278
clarify the use of LossyDAS
cskiraly May 28, 2024
7b4d23c
fix toc
hwwhww May 28, 2024
4e1d566
improve candidate peer text
cskiraly May 29, 2024
a04cd87
fix the (source-view) formatting of the table
cskiraly May 29, 2024
5f3beca
remove LossyDAS naming from spec
cskiraly May 29, 2024
436e58e
add get_extended_sample_count helper function
cskiraly May 29, 2024
4c57399
self-contained get_extended_sample_count
cskiraly Jun 4, 2024
2ab4f1e
get_extended_sample_count: use SAMPLES_PER_SLOT constant
cskiraly Jun 10, 2024
6711acf
clarifying reconstruction and cross-seeding
cskiraly Jun 11, 2024
cf46b07
Bump remerkleable to `v0.1.28`
etan-status Jun 16, 2024
6e2b370
Merge pull request #3807 from etan-status/bd-remerkleable
hwwhww Jun 18, 2024
fb02045
Add `get_extended_sample_count` unit tests
hwwhww Jun 18, 2024
29d3a24
Merge pull request #3763 from ethereum/electra-merkle-proof-tests
hwwhww Jun 19, 2024
2c384da
Fix typing issue when `10e10` is interpreted as float
etan-status Jun 21, 2024
2035a9f
Update light client specifications for Electra
etan-status Jun 21, 2024
ea04148
Lint
etan-status Jun 21, 2024
67a053d
Refer to Altair gindices as that's where they were introduced
etan-status Jun 21, 2024
835576a
Enable light client data test generation for Electra
etan-status Jun 21, 2024
f30a3a3
Update `test_incorrect_not_enough_consolidation_churn_available` and …
hwwhww Jun 24, 2024
fed320c
Merge pull request #3810 from etan-status/bf-payloadinit
hwwhww Jun 24, 2024
beedf85
Revert division change and add comments
hwwhww Jun 25, 2024
1f87bbe
Merge branch 'dev' into pr3782
hwwhww Jun 25, 2024
4539265
moving part of text in custody section
cskiraly Jun 25, 2024
ee97738
Add `test_get_extended_sample_count__table_in_spec` to verify the tab…
hwwhww Jun 25, 2024
ded072a
Make MAX_BLOBS_PER_BLOCK a config parameter
dapplion Jun 25, 2024
25b810f
lint
dapplion Jun 26, 2024
9280cc7
Update doctoc
dapplion Jun 26, 2024
29f3948
Merge pull request #3814 from ethereum/update-consolidation-tests
hwwhww Jun 26, 2024
17dfb9a
fix get_extended_sample_count proc signature
cskiraly Jun 27, 2024
78b583d
clarify use of get_extended_sample_count
cskiraly Jun 27, 2024
1ad381d
adding get_extended_sample_count docsstring
cskiraly Jun 27, 2024
258c2c9
Merge pull request #3794 from cskiraly/peer-das-reconstruction
hwwhww Jun 27, 2024
0a49572
Merge pull request #3782 from cskiraly/peer-das-sampling
hwwhww Jun 27, 2024
a3a6c91
Remove proof parameter from `recover_cells_and_kzg_proofs` (#3819)
kevaundray Jun 27, 2024
f25aac6
Add MetadataV3 with custody_subnet_count
dapplion Jun 28, 2024
83da380
EIP7594: Do universal verification in verify_cell_kzg_proof_batch() (…
b-wagn Jun 28, 2024
0e03d8c
Fix beacon-chain.md section header issues
jtraglia Jun 28, 2024
090d349
Merge pull request #3764 from ethereum/electra-fork-tests
ralexstokes Jul 1, 2024
0532952
Merge pull request #3822 from jtraglia/section-header-nits
ralexstokes Jul 1, 2024
77c371b
Replace "updated" with "modified" in Electra spec (#3823)
jtraglia Jul 1, 2024
7b72cbd
Fix link to Deneb spec
jtraglia Jul 1, 2024
b4f44ca
Fix EL block hash computation for Deneb
etan-status Jul 2, 2024
81f3ea8
Merge pull request #3826 from jtraglia/fix-deneb-link
hwwhww Jul 2, 2024
a63bad0
Fix Deneb `test_process_execution_payload`
etan-status Jul 2, 2024
c078a97
Remove verify_cell_kzg_proof (non-batch)
jtraglia Jul 2, 2024
1189d52
Remove VALID_INDIVIDUAL_RANDOM_CELL_BYTES import
jtraglia Jul 2, 2024
0daa2ac
Remove verify_kzg_proof_multi_impl too
jtraglia Jul 2, 2024
9be0529
Merge pull request #3829 from etan-status/df-elhash
hwwhww Jul 5, 2024
228752c
In batch cell verification, check if there are zero cells
jtraglia Jul 5, 2024
b9e7b03
Update algorithm & remove check
jtraglia Jul 8, 2024
104fbc7
beacon chain changes
potuz Jun 24, 2024
673c75c
Forkchoice changes
potuz Jun 25, 2024
971c57c
Honest validator guide
potuz Jun 25, 2024
614e14e
Honest Builder Guide
potuz Jun 25, 2024
cd7dbef
P2P changes
potuz Jun 25, 2024
6d6ef7b
Fork logic
potuz Jun 25, 2024
0d082fd
Add comment about attestations and sync committee duties
potuz Jun 28, 2024
6e02cb4
Fix epbs consensus spec to be executable (#10)
terencechain Jun 28, 2024
a01f124
modify INTEVALS_PER_SLOT
potuz Jun 28, 2024
b7b1de9
Verify withdrawals only when present
potuz Jun 30, 2024
51e47ff
small typo fixes (#12)
gorondan Jul 1, 2024
25a0fdc
doctoc
potuz Jul 1, 2024
ed7f17e
Add gas_limit to the execution payload header
potuz Jul 1, 2024
95dd081
codespell
potuz Jul 2, 2024
752a804
use boolean instead of bool in forkchoice
potuz Jul 2, 2024
4997588
add fake value to KZG indices
potuz Jul 2, 2024
ad8d71d
Fix python execution 1
potuz Jul 2, 2024
2a43ce5
doctoc
potuz Jul 2, 2024
4500eab
Fix python execution 2
potuz Jul 2, 2024
d7a199f
Fix python execution 3
potuz Jul 3, 2024
5013e57
Fix epbs pre fork (#13)
terencechain Jul 3, 2024
181ce5e
add type annotation
potuz Jul 3, 2024
a11ffb5
use definitive EIP number
potuz Jul 3, 2024
b230a42
Add deprecation helpers in spec builder
hwwhww Jul 3, 2024
b2d6e68
Fix and add `EIP7732_FORK_EPOCH` and `EIP7594_FORK_VERSION`
hwwhww Jul 3, 2024
1127640
Add `eip7732` to .gitignore
hwwhww Jul 3, 2024
603cf53
add fork fixes
potuz Jul 3, 2024
e9a8dda
Fix python execution 4
potuz Jul 3, 2024
e3cd216
Fix python execution 5
potuz Jul 3, 2024
dba3cda
Fix python execution 6
potuz Jul 3, 2024
53aaf26
Fix python execution 7
potuz Jul 3, 2024
3d48e72
Deal with attestations from previous forks
potuz Jul 3, 2024
a5d2161
add CI workflow
potuz Jul 3, 2024
614284c
Fix p2p to use eip7732 (#14)
terencechain Jul 3, 2024
eb3382f
Disable eip7732 tests like whisk-style
hwwhww Jul 4, 2024
2af6e7d
Minor refactoring
hwwhww Jul 4, 2024
bb7ce4f
minor fixes
potuz Jul 5, 2024
e93f923
fix typo last_withdrawals_root
potuz Jul 5, 2024
9181e29
modify get_blob_sidecars to take the commitments
potuz Jul 5, 2024
17b7905
modify get_blob_sidecars to use nested proof
potuz Jul 8, 2024
19c6f84
linter
potuz Jul 8, 2024
b556420
linter 2
potuz Jul 8, 2024
0e94fc9
Rename changed preset
potuz Jul 8, 2024
93aa7d6
Fix linter error
hwwhww Jul 8, 2024
9274a66
fix Merkle proof generator
potuz Jul 8, 2024
f97f0b4
use List with limit to hash withdrawals
potuz Jul 8, 2024
1642610
Merge pull request #3835 from jtraglia/early-exit-zero-cells
asn-d6 Jul 8, 2024
1dbb68d
Update get_data_column_sidecars to take cells/proofs
jtraglia Jul 8, 2024
8da90b2
Fix linter issues
jtraglia Jul 8, 2024
b7149ef
Update beacon-chain.md
ralexstokes Jul 8, 2024
5cce790
Merge pull request #3837 from ethereum/ralexstokes-patch-2
hwwhww Jul 9, 2024
c402414
Merge branch 'dev' into remove-verify-cell-kzg-proof
jtraglia Jul 9, 2024
096e564
Verify kzg-commitments length with the payload
potuz Jul 9, 2024
63433ec
Use separate constant names for post-Electra gindices
etan-status Jul 9, 2024
a86eeb3
Freeze Altair constants at Deneb
etan-status Jul 9, 2024
82fe862
Fix lint
etan-status Jul 9, 2024
088f771
fix spec error in get_generalized_index function
kocubinski Jul 9, 2024
9a9fa96
In batch cell verification, take commitment for each cell (#3834)
jtraglia Jul 10, 2024
dc5f74d
Merge pull request #3830 from jtraglia/remove-verify-cell-kzg-proof
asn-d6 Jul 10, 2024
db71770
Move to peerdas eip
dapplion Jul 11, 2024
e2c06c3
Fix link
etan-status Jul 15, 2024
9db6d3f
Remove unnecessary cast
etan-status Jul 15, 2024
3529b46
Fix block_header.state_root and forkchoice filtering
potuz Jul 15, 2024
252b852
Rename column_index to cell_index in KZG spec (#3841)
jtraglia Jul 15, 2024
4b43b96
doctoc
potuz Jul 15, 2024
5961e26
Remove unnecessary comment
jtraglia Jul 15, 2024
5bb25c8
remove spurious config prefix
potuz Jul 15, 2024
b4432fb
Merge pull request #3817 from dapplion/max-blobs-config
hwwhww Jul 16, 2024
bb8f3ca
Merge pull request #3836 from jtraglia/columns-cells-and-proofs
asn-d6 Jul 16, 2024
6d146e2
For pytest, replace NUMBER_OF_CORES with auto
jtraglia Jul 16, 2024
460d46d
Merge branch 'dev' into lc-electra
etan-status Jul 17, 2024
2331291
Replace `recover_data` with `recover_polynomialcoeff` (#3820)
kevaundray Jul 17, 2024
f3dcc59
Update description for test format
jtraglia Jul 18, 2024
a42d670
Merge pull request #3811 from etan-status/lc-electra
hwwhww Jul 19, 2024
80092b1
remove beacon_attestation_subnet from global topics
0xTylerHolmes Jul 19, 2024
8c9514e
Restore proposer_boost timeliness calculation
potuz Jul 22, 2024
b7461ac
Remove block_timeliness from the store
potuz Jul 23, 2024
d0fad1f
Advance best child with empty until it is higher than every children
potuz Jul 23, 2024
0c9ca6d
solve ties by block slot first
potuz Jul 23, 2024
b082140
Revert "Remove block_timeliness from the store"
potuz Jul 24, 2024
2218c94
Merge pull request #3849 from 0xTylerHolmes/electra-p2p-topics
hwwhww Jul 25, 2024
2d59c55
Fix indentation for kzg_7594 tests
jtraglia Jul 25, 2024
e9be4e2
Merge pull request #3855 from jtraglia/kzg-7594-tests-indentation
hwwhww Jul 25, 2024
e8fcebc
Merge pull request #3846 from jtraglia/replace-ncores-with-auto
hwwhww Jul 27, 2024
85a42cd
improve comments in recovery
b-wagn Jul 31, 2024
225c486
some punctuation
b-wagn Jul 31, 2024
31c23f8
Remove compute_cells test format
agnxsh Jul 31, 2024
9c39645
Merge pull request #3858 from b-wagn/documentation-reconstruct
asn-d6 Aug 1, 2024
b394b27
Merge pull request #3848 from ethereum/jtraglia-eip7594-format-fix
hwwhww Aug 2, 2024
ef3c9dc
Remove dead link to no longer existing public method.
b-wagn Aug 2, 2024
10becc5
Merge pull request #3595 from etan-status/bf-safehash
mkalinin Aug 2, 2024
92aeafe
Merge pull request #3863 from b-wagn/patch-3
asn-d6 Aug 2, 2024
7ab2bbe
Make process_withdrawals slightly cleaner (equivalent functionality) …
vbuterin Aug 2, 2024
74124f5
Typo in validator.md
potuz Aug 2, 2024
1a086f6
Merge pull request #3838 from kocubinski/dev
hwwhww Aug 3, 2024
b5cea48
bump to 1.5.0-alpha.4
hwwhww Aug 3, 2024
9515f3e
Merge pull request #3865 from ethereum/bump-version
hwwhww Aug 6, 2024
572ca9e
Merge pull request #3821 from dapplion/csc
hwwhww Aug 6, 2024
fcca2b5
Fix off-by-one in process_pending_consolidations
mkalinin Aug 6, 2024
b665698
Fix off-by-one in process_pending_balance_deposits
mkalinin Aug 6, 2024
8f8ab03
Merge pull request #3828 from potuz/epbs_cl_repo
hwwhww Aug 6, 2024
7c10922
p2p: clean up payload_attestation_message conditions
terencechain Aug 3, 2024
5e06787
Apply suggestions by @fradamt
mkalinin Aug 7, 2024
024ee04
Fix lint
mkalinin Aug 7, 2024
5409396
Fix nits in eip7594 p2p-interface spec
jtraglia Aug 8, 2024
674d924
Merge pull request #3869 from terencechain/p2p-payload-att1
hwwhww Aug 8, 2024
bd396a6
Merge pull request #3873 from jtraglia/nits-in-7594-p2p-interface
hwwhww Aug 8, 2024
f4e3908
Merge pull request #3868 from mkalinin/fix-consolidation
hwwhww Aug 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tests/core/pyspec/eth2spec/electra/
tests/core/pyspec/eth2spec/whisk/
tests/core/pyspec/eth2spec/eip7594/
tests/core/pyspec/eth2spec/eip6800/
tests/core/pyspec/eth2spec/eip7732/

# coverage reports
.htmlcov
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SOLIDITY_FILE_NAME = deposit_contract.json
DEPOSIT_CONTRACT_TESTER_DIR = ${SOLIDITY_DEPOSIT_CONTRACT_DIR}/web3_tester
CONFIGS_DIR = ./configs
TEST_PRESET_TYPE ?= minimal
NUMBER_OF_CORES=16
# Collect a list of generator names
GENERATORS = $(sort $(dir $(wildcard $(GENERATOR_DIR)/*/.)))
# Map this list of generator paths to "gen_{generator name}" entries
Expand All @@ -35,7 +34,7 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \
$(wildcard $(SSZ_DIR)/*.md)

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

# Testing against `minimal` or `mainnet` config by default
find_test: pyspec
Expand All @@ -129,10 +128,10 @@ citest: pyspec
mkdir -p $(TEST_REPORT_DIR);
ifdef fork
. venv/bin/activate; cd $(PY_SPEC_DIR); \
python3 -m pytest -n $(NUMBER_OF_CORES) --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --fork=$(fork) --junitxml=test-reports/test_results.xml eth2spec
python3 -m pytest -n auto --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --fork=$(fork) --junitxml=test-reports/test_results.xml eth2spec
else
. venv/bin/activate; cd $(PY_SPEC_DIR); \
python3 -m pytest -n $(NUMBER_OF_CORES) --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --junitxml=test-reports/test_results.xml eth2spec
python3 -m pytest -n auto --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --junitxml=test-reports/test_results.xml eth2spec
endif


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Features are researched and developed in parallel, and then consolidated into se
### In-development Specifications
| Code Name or Topic | Specs | Notes |
| - | - | - |
| Electra | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/electra/beacon-chain.md)</li><li>[EIP-6110 fork](specs/electra/fork.md)</li></ul><li>Additions</li><ul><li>[Honest validator guide changes](specs/electra/validator.md)</li></ul></ul> |
| Electra | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/electra/beacon-chain.md)</li><li>[EIP-6110 fork](specs/electra/fork.md)</li></ul><li>Additions</li><ul><li>[Light client sync protocol changes](specs/electra/light-client/sync-protocol.md) ([fork](specs/electra/light-client/fork.md), [full node](specs/electra/light-client/full-node.md), [networking](specs/electra/light-client/p2p-interface.md))</li></ul><ul><li>[Honest validator guide changes](specs/electra/validator.md)</li></ul></ul> |
| Sharding (outdated) | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/_features/sharding/beacon-chain.md)</li></ul><li>Additions</li><ul><li>[P2P networking](specs/_features/sharding/p2p-interface.md)</li></ul></ul> |
| Custody Game (outdated) | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/_features/custody_game/beacon-chain.md)</li></ul><li>Additions</li><ul><li>[Honest validator guide changes](specs/_features/custody_game/validator.md)</li></ul></ul> | Dependent on sharding |
| Data Availability Sampling (outdated) | <ul><li>Core</li><ul><li>[Core types and functions](specs/_features/das/das-core.md)</li><li>[Fork choice changes](specs/_features/das/fork-choice.md)</li></ul><li>Additions</li><ul><li>[P2P Networking](specs/_features/das/p2p-interface.md)</li><li>[Sampling process](specs/_features/das/sampling.md)</li></ul></ul> | <ul><li> Dependent on sharding</li><li>[Technical explainer](https://hackmd.io/@HWeNw8hNRimMm2m2GH56Cw/B1YJPGkpD)</li></ul> |
Expand Down
5 changes: 5 additions & 0 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ EIP7594_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x08000000 # temporary stub
WHISK_FORK_EPOCH: 18446744073709551615
# EIP7732
EIP7732_FORK_VERSION: 0x09000000 # temporary stub
EIP7732_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
Expand Down Expand Up @@ -147,6 +150,8 @@ MAX_REQUEST_BLOB_SIDECARS: 768
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
# `6`
BLOB_SIDECAR_SUBNET_COUNT: 6
## `uint64(6)`
MAX_BLOBS_PER_BLOCK: 6

# Whisk
# `Epoch(2**8)`
Expand Down
5 changes: 5 additions & 0 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ EIP7594_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x08000001
WHISK_FORK_EPOCH: 18446744073709551615
# EIP7732
EIP7732_FORK_VERSION: 0x09000001
EIP7732_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
Expand Down Expand Up @@ -148,6 +151,8 @@ MAX_REQUEST_BLOB_SIDECARS: 768
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
# `6`
BLOB_SIDECAR_SUBNET_COUNT: 6
## `uint64(6)`
MAX_BLOBS_PER_BLOCK: 6

# Whisk
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4
Expand Down
8 changes: 4 additions & 4 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ This dockerfile sets up the dependencies required to run consensus-spec tests. T

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

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

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.
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.

E.g:
- `./build_run_test.sh --p mainnet --n 16` will run the mainnet preset tests with 16 threads
- `./build_run_test.sh --p mainnet` will run the mainnet preset tests
- `./build_run_test.sh --a` will run all the tests across all the forks
- `./build_run_test.sh --f deneb --n 16` will only run deneb tests on 16 threads
- `./build_run_test.sh --f deneb` will only run deneb tests

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.
6 changes: 3 additions & 3 deletions fork_choice/safe-block.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

- [Introduction](#introduction)
- [`get_safe_beacon_block_root`](#get_safe_beacon_block_root)
- [`get_safe_execution_payload_hash`](#get_safe_execution_payload_hash)
- [`get_safe_execution_block_hash`](#get_safe_execution_block_hash)

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

## `get_safe_execution_payload_hash`
## `get_safe_execution_block_hash`

```python
def get_safe_execution_payload_hash(store: Store) -> Hash32:
def get_safe_execution_block_hash(store: Store) -> Hash32:
safe_block_root = get_safe_beacon_block_root(store)
safe_block = store.blocks[safe_block_root]

Expand Down
2 changes: 0 additions & 2 deletions presets/mainnet/deneb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
FIELD_ELEMENTS_PER_BLOB: 4096
# `uint64(2**12)` (= 4096)
MAX_BLOB_COMMITMENTS_PER_BLOCK: 4096
# `uint64(6)`
MAX_BLOBS_PER_BLOCK: 6
# `floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 12 = 17
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 17
9 changes: 9 additions & 0 deletions presets/mainnet/eip-7732.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Mainnet preset - EIP7732

# Execution
# ---------------------------------------------------------------
# 2**9 (= 512)
PTC_SIZE: 512
# 2**2 (= 4)
MAX_PAYLOAD_ATTESTATIONS: 4
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH_EIP7732: 13
2 changes: 0 additions & 2 deletions presets/minimal/deneb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
FIELD_ELEMENTS_PER_BLOB: 4096
# [customized]
MAX_BLOB_COMMITMENTS_PER_BLOCK: 16
# `uint64(6)`
MAX_BLOBS_PER_BLOCK: 6
# [customized] `floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 4 = 9
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 9
9 changes: 9 additions & 0 deletions presets/minimal/eip-7732.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Minimal preset - EIP7732

# Execution
# ---------------------------------------------------------------
# 2**1(= 2)
PTC_SIZE: 2
# 2**2 (= 4)
MAX_PAYLOAD_ATTESTATIONS: 4
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH_EIP7732: 13
1 change: 1 addition & 0 deletions pysetup/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
EIP7594 = 'eip7594'
EIP6800 = 'eip6800'
WHISK = 'whisk'
EIP7732 = 'eip7732'


# The helper functions that are used when defining constants
Expand Down
13 changes: 11 additions & 2 deletions pysetup/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,22 @@ def format_constant(name: str, vardef: VariableDefinition) -> str:
# Keep engine from the most recent fork
execution_engine_cls = reduce(lambda txt, builder: builder.execution_engine_cls() or txt, builders, "")

# Remove deprecated constants
deprecate_constants = reduce(lambda obj, builder: obj.union(builder.deprecate_constants()), builders, set())
# constant_vars = {k: v for k, v in spec_object.constant_vars.items() if k not in deprecate_constants}
filtered_ssz_dep_constants = {k: v for k, v in hardcoded_ssz_dep_constants.items() if k not in deprecate_constants}
# Remove deprecated presets
deprecate_presets = reduce(lambda obj, builder: obj.union(builder.deprecate_presets()), builders, set())
# preset_vars = {k: v for k, v in spec_object.constant_vars.items() if k not in deprecate_constants}
filtered_hardcoded_func_dep_presets = {k: v for k, v in hardcoded_func_dep_presets.items() if k not in deprecate_presets}

constant_vars_spec = '# Constant vars\n' + '\n'.join(format_constant(k, v) for k, v in spec_object.constant_vars.items())
preset_vars_spec = '# Preset vars\n' + '\n'.join(format_constant(k, v) for k, v in spec_object.preset_vars.items())
ordered_class_objects_spec = '\n\n\n'.join(ordered_class_objects.values())
ssz_dep_constants = '\n'.join(map(lambda x: '%s = %s' % (x, hardcoded_ssz_dep_constants[x]), hardcoded_ssz_dep_constants))
ssz_dep_constants_verification = '\n'.join(map(lambda x: 'assert %s == %s' % (x, spec_object.ssz_dep_constants[x]), hardcoded_ssz_dep_constants))
ssz_dep_constants_verification = '\n'.join(map(lambda x: 'assert %s == %s' % (x, spec_object.ssz_dep_constants[x]), filtered_ssz_dep_constants))
custom_type_dep_constants = '\n'.join(map(lambda x: '%s = %s' % (x, hardcoded_custom_type_dep_constants[x]), hardcoded_custom_type_dep_constants))
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))
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))
spec_strs = [
imports,
preparations,
Expand Down
2 changes: 2 additions & 0 deletions pysetup/md_doc_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
WHISK,
EIP7594,
EIP6800,
EIP7732,
)


Expand All @@ -23,6 +24,7 @@
WHISK: CAPELLA,
EIP7594: DENEB,
EIP6800: DENEB,
EIP7732: ELECTRA,
}

ALL_FORKS = list(PREVIOUS_FORK_OF.keys())
Expand Down
3 changes: 2 additions & 1 deletion pysetup/spec_builders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
from .whisk import WhiskSpecBuilder
from .eip7594 import EIP7594SpecBuilder
from .eip6800 import EIP6800SpecBuilder
from .eip7732 import EIP7732SpecBuilder


spec_builders = {
builder.fork: builder
for builder in (
Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder,
ElectraSpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder, EIP6800SpecBuilder,
ElectraSpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder, EIP6800SpecBuilder, EIP7732SpecBuilder,
)
}
2 changes: 1 addition & 1 deletion pysetup/spec_builders/altair.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_generalized_index(ssz_class: Any, *path: PyUnion[int, SSZVariableName])


def compute_merkle_proof(object: SSZObject,
index: GeneralizedIndex) -> Sequence[Bytes32]:
index: GeneralizedIndex) -> list[Bytes32]:
return build_proof(object.get_backing(), index)'''


Expand Down
10 changes: 9 additions & 1 deletion pysetup/spec_builders/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
from typing import Sequence, Dict
from typing import Sequence, Dict, Set
from pathlib import Path

class BaseSpecBuilder(ABC):
Expand Down Expand Up @@ -54,3 +54,11 @@ def hardcoded_func_dep_presets(cls, spec_object) -> Dict[str, str]:
@classmethod
def implement_optimizations(cls, functions: Dict[str, str]) -> Dict[str, str]:
return functions

@classmethod
def deprecate_constants(cls) -> Set[str]:
return set()

@classmethod
def deprecate_presets(cls) -> Set[str]:
return set()
2 changes: 1 addition & 1 deletion pysetup/spec_builders/deneb.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def hardcoded_custom_type_dep_constants(cls, spec_object) -> Dict[str, str]:
return {
'BYTES_PER_FIELD_ELEMENT': spec_object.constant_vars['BYTES_PER_FIELD_ELEMENT'].value,
'FIELD_ELEMENTS_PER_BLOB': spec_object.preset_vars['FIELD_ELEMENTS_PER_BLOB'].value,
'MAX_BLOBS_PER_BLOCK': spec_object.preset_vars['MAX_BLOBS_PER_BLOCK'].value,
'MAX_BLOBS_PER_BLOCK': spec_object.config_vars['MAX_BLOBS_PER_BLOCK'].value,
'MAX_BLOB_COMMITMENTS_PER_BLOCK': spec_object.preset_vars['MAX_BLOB_COMMITMENTS_PER_BLOCK'].value,
}

Expand Down
45 changes: 45 additions & 0 deletions pysetup/spec_builders/eip7732.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from typing import Dict, Set

from .base import BaseSpecBuilder
from ..constants import EIP7732


class EIP7732SpecBuilder(BaseSpecBuilder):
fork: str = EIP7732

@classmethod
def imports(cls, preset_name: str):
return f'''
from eth2spec.electra import {preset_name} as electra
'''

@classmethod
def sundry_functions(cls) -> str:
return '''
def concat_generalized_indices(*indices: GeneralizedIndex) -> GeneralizedIndex:
o = GeneralizedIndex(1)
for i in indices:
o = GeneralizedIndex(o * bit_floor(i) + (i - bit_floor(i)))
return o'''


@classmethod
def hardcoded_custom_type_dep_constants(cls, spec_object) -> Dict[str, str]:
return {
'PTC_SIZE': spec_object.preset_vars['PTC_SIZE'].value,
'MAX_PAYLOAD_ATTESTATIONS': spec_object.preset_vars['MAX_PAYLOAD_ATTESTATIONS'].value,
'KZG_COMMITMENT_INCLUSION_PROOF_DEPTH_EIP7732':
spec_object.preset_vars['KZG_COMMITMENT_INCLUSION_PROOF_DEPTH_EIP7732'].value,
}

@classmethod
def deprecate_constants(cls) -> Set[str]:
return set([
'EXECUTION_PAYLOAD_GINDEX',
])

@classmethod
def deprecate_presets(cls) -> Set[str]:
return set([
'KZG_COMMITMENT_INCLUSION_PROOF_DEPTH',
])
8 changes: 3 additions & 5 deletions pysetup/spec_builders/electra.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ def imports(cls, preset_name: str):
from eth2spec.deneb import {preset_name} as deneb
'''

## TODO: deal with changed gindices

@classmethod
def hardcoded_ssz_dep_constants(cls) -> Dict[str, str]:
return {
'FINALIZED_ROOT_GINDEX': 'GeneralizedIndex(169)',
'CURRENT_SYNC_COMMITTEE_GINDEX': 'GeneralizedIndex(86)',
'NEXT_SYNC_COMMITTEE_GINDEX': 'GeneralizedIndex(87)',
'FINALIZED_ROOT_GINDEX_ELECTRA': 'GeneralizedIndex(169)',
'CURRENT_SYNC_COMMITTEE_GINDEX_ELECTRA': 'GeneralizedIndex(86)',
'NEXT_SYNC_COMMITTEE_GINDEX_ELECTRA': 'GeneralizedIndex(87)',
}
10 changes: 3 additions & 7 deletions scripts/build_run_docker_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,22 @@
ALL_EXECUTABLE_SPECS=("phase0" "altair" "bellatrix" "capella" "deneb" "electra" "whisk")
TEST_PRESET_TYPE=minimal
FORK_TO_TEST=phase0
NUMBER_OF_CORES=4
WORKDIR="//consensus-specs//tests//core//pyspec"
ETH2SPEC_FOLDER_NAME="eth2spec"
CONTAINER_NAME="consensus-specs-tests"
DATE=$(date +"%Y%m%d-%H-%M")
# Default flag values
version=$(git log --pretty=format:'%h' -n 1)
IMAGE_NAME="consensus-specs:$version"
number_of_core=4

# displays the available options
display_help() {
echo "Run 'consensus-specs' tests from a container instance."
echo "Be sure to launch Docker before running this script."
echo
echo "Syntax: build_run_test.sh [--v TAG | --n NUMBER_OF_CORE | --f FORK_TO_TEST | --p PRESET_TYPE | --a | --h HELP]"
echo "Syntax: build_run_test.sh [--v TAG | --f FORK_TO_TEST | --p PRESET_TYPE | --a | --h HELP]"
echo " --f <fork> Specify the fork to test"
echo " --i <image_name> Specify the docker image to use"
echo " --n <number> Specify the number of cores"
echo " --p <type> Specify the test preset type"
echo " --a Test all forks"
echo " --h Display this help and exit"
Expand Down Expand Up @@ -63,7 +60,6 @@ while [[ "$#" -gt 0 ]]; do
case $1 in
--f) FORK_TO_TEST="$2"; shift ;;
--v) IMAGE_NAME="$2"; shift ;;
--n) NUMBER_OF_CORES="$2"; shift ;;
--p) TEST_PRESET_TYPE="$2"; shift ;;
--a) FORK_TO_TEST="all" ;;
--h) display_help; exit 0 ;;
Expand All @@ -90,12 +86,12 @@ fi
if [ "$FORK_TO_TEST" == "all" ]; then
for fork in "${ALL_EXECUTABLE_SPECS[@]}"; do
docker run --name $CONTAINER_NAME $IMAGE_NAME \
make citest fork=$fork TEST_PRESET_TYPE=$TEST_PRESET_TYPE NUMBER_OF_CORES=$NUMBER_OF_CORES
make citest fork=$fork TEST_PRESET_TYPE=$TEST_PRESET_TYPE
copy_test_results $fork
done
else
docker run --name $CONTAINER_NAME $IMAGE_NAME \
make citest fork=$FORK_TO_TEST TEST_PRESET_TYPE=$TEST_PRESET_TYPE NUMBER_OF_CORES=$NUMBER_OF_CORES
make citest fork=$FORK_TO_TEST TEST_PRESET_TYPE=$TEST_PRESET_TYPE
copy_test_results $FORK_TO_TEST
fi

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def run(self):
"pycryptodome==3.15.0",
"py_ecc==6.0.0",
"milagro_bls_binding==1.9.0",
"remerkleable==0.1.27",
"remerkleable==0.1.28",
"trie==2.0.2",
RUAMEL_YAML_VERSION,
"lru-dict==1.2.0",
Expand Down
Loading