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.4.0-beta.6 #3578

Merged
merged 128 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
7c023cc
Fork choice changes to enable confirmation rule execution via beacon …
saltiniroberto Jun 15, 2023
9119684
Merge branch 'ethereum:dev' into fork-choice-changes-for-confirmaton-…
saltiniroberto Jun 17, 2023
ca1e816
Try fix tests
saltiniroberto Jun 17, 2023
5e3c010
Review change
saltiniroberto Jun 18, 2023
4ce2b02
Add whisk tests
dapplion Jun 8, 2023
829a59b
Run on any push
dapplion Jun 20, 2023
91ff707
Fix test lint issues
dapplion Jun 22, 2023
7f9a026
Update specs with state.whisk_trackers
dapplion Jun 22, 2023
cf975c6
FIx tests with rebase
dapplion Jun 22, 2023
c2314dc
Cache initial trackers
dapplion Jun 22, 2023
d6dcce0
Add test_config_invariants
dapplion Jun 22, 2023
758022d
Remove whisk from ALL_PHASES
dapplion Jul 4, 2023
2ef22cb
Apply modularized setup changes
dapplion Jul 5, 2023
8c65b21
Upgrade wheel pip setuptools with `make install_test`
hwwhww Jul 6, 2023
71c25f8
Merge branch 'dev' into pr3442
hwwhww Jul 14, 2023
5c194bb
kick the CI cache
hwwhww Jul 14, 2023
752f2a0
update test checks
adiasg Jul 19, 2023
6223491
Fix with_all_phases_from
dapplion Jul 20, 2023
c0c453d
Bump curdleproofs to use py_arkworks_bls12381
dapplion Jul 20, 2023
211376e
Update curdleproofs usage
dapplion Jul 24, 2023
ee32adb
add test step
adiasg Jul 24, 2023
956b33c
Update tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_reorg.py
adiasg Jul 24, 2023
1bfc155
update test steps & check
adiasg Jul 24, 2023
237098b
apply @mkalinin review & make asserts verbose
adiasg Jul 25, 2023
972d699
Remove commented out lines
saltiniroberto Jul 26, 2023
a4f9ed9
Make linter happy
saltiniroberto Jul 26, 2023
5d6ce53
Merge pull request #8 from saltiniroberto/fork-choice-changes-for-con…
saltiniroberto Jul 26, 2023
ccd8026
wip
hwwhww Jul 27, 2023
07ab004
Bump curdleproofs to fix upstream types
dapplion Jul 28, 2023
db502dd
force install correct version of curdleproofs
dapplion Aug 17, 2023
a74b4fc
Use published curdleproofs version
dapplion Aug 18, 2023
4eca8e4
Add CRS files
dapplion Sep 12, 2023
fe95d7c
ssz: `byte` type and canonical JSON mapping
arnetheduck Aug 25, 2022
f2ad012
spelling bee and lint torture
arnetheduck Sep 19, 2023
de30a92
update CRS
dapplion Oct 10, 2023
5bab432
clean-up todo
dapplion Oct 10, 2023
d74932b
Merge branch 'dev' into pr3442
hwwhww Oct 16, 2023
f14900f
reference vars from config
dapplion Oct 16, 2023
66082e3
revert ParticipationFlags back to `uint8`
arnetheduck Oct 17, 2023
89c986e
Rename `_INDEX` generalized index constants to `_GINDEX`
etan-status Nov 1, 2023
e30e8af
Use fork choice to determine `finalized_checkpoint` in gossip validation
etan-status Nov 6, 2023
d9e53cb
Merge branch 'dev' into lc-gindexname
etan-status Nov 6, 2023
04f5ec5
remove obsolete comment
arnetheduck Nov 9, 2023
dd65aa0
Gossip additional `LightClientFinalityUpdate` on new supermajority
etan-status Nov 15, 2023
321870c
Align gossip validation for aggregates with single attestations
etan-status Nov 20, 2023
94ecce7
Add polynomial commitments for sampling
dankrad Dec 4, 2023
42d91d5
fix tests for mainnet preset
dapplion Dec 7, 2023
bf09b9a
Merge pull request #3442 from dapplion/whisk-tests
hwwhww Dec 8, 2023
0d4007a
Apply suggestions from code review
hwwhww Dec 12, 2023
f0af688
Minor fixes
hwwhww Dec 12, 2023
b89434f
Extract the hardcoded spec names into a `specs.py` file
hwwhww Dec 14, 2023
d399cde
Fix linter config
hwwhww Dec 14, 2023
6727944
Fix import
hwwhww Dec 14, 2023
f0c9002
update new-feature doc
hwwhww Dec 14, 2023
1d7c3d4
Use md_doc_paths.py `is_post_fork` in pyspec itself; clean up `create…
hwwhww Dec 14, 2023
eb16a77
Refactor `do_fork` with terrifying eval() and `PREVIOUS_FORK_OF`
hwwhww Dec 14, 2023
c194592
update doc
hwwhww Dec 14, 2023
b123f9f
update doc
hwwhww Dec 15, 2023
9fbf751
Add assertion to ensure eval usage is fine
hwwhww Dec 21, 2023
62d1a8f
Add public method markers
dankrad Dec 4, 2023
246477a
SAMPLE -> CELL and cleanups
dankrad Dec 23, 2023
3169f92
More sample -> cell renaming
dankrad Dec 23, 2023
d36fc4f
Zero polynomial -> vanishing polynomial
dankrad Dec 23, 2023
9ec5dde
Remove polynomial_coeff_to_eval
dankrad Dec 23, 2023
316ea98
Use types for representing LC Merkle branches
etan-status Dec 27, 2023
5717a81
Capella addition
etan-status Dec 27, 2023
3e5427e
Align formatting
etan-status Dec 27, 2023
cf55918
Avoid Mypy error during lint
etan-status Dec 27, 2023
fca5e3b
Use proper types when dealing with LC Merkle proofs
etan-status Dec 27, 2023
877817c
Merge pull request #3562 from ethereum/refactor-context
hwwhww Dec 27, 2023
e525946
WIP: Update dockerisation (#3477)
parithosh Jan 4, 2024
c58c4a7
Merge branch 'dev' into polynomial-commitments-sampling
hwwhww Jan 5, 2024
75b1bf5
Add `KZG_SETUP_G1_MONOMIAL` to trusted setup files
hwwhww Jan 5, 2024
5854c7e
Fix some lint errors
hwwhww Jan 5, 2024
7f8858b
Add `PeerDAS` feature
hwwhww Jan 5, 2024
03583b1
Fix fft helper and add basic test
hwwhww Jan 5, 2024
119e00b
Add PeerDAS testing CI job
hwwhww Jan 5, 2024
8fa4ed5
Add `verify_cell_proof_batch` test
hwwhww Jan 5, 2024
9a07270
Rename `recover_cells` to `recover_polynomial` and fix function signa…
hwwhww Jan 8, 2024
db89e29
Clean up Deneb specs. Add some type casting for using fft function
hwwhww Jan 8, 2024
09c2519
Skip pylint check in CI
hwwhww Jan 8, 2024
be8b30a
Merge branch 'dev' into fork-choice-changes-for-confirmaton-rule
hwwhww Jan 8, 2024
05c2ce1
Merge branch 'dev' into lc-branchtypes
etan-status Jan 9, 2024
02d47f1
ensure `floorlog2` is available for use in `Custom types` section
etan-status Jan 9, 2024
c41c128
Use `Custom types` section instead of `Helper types` for consistency
etan-status Jan 9, 2024
a58c868
Randomize the test_recover_polynomial()
asn-d6 Jan 9, 2024
5a551a0
Work on hww's round-trip FFT test
asn-d6 Jan 9, 2024
9134cd1
Fix linter
asn-d6 Jan 9, 2024
9ebf456
Move `Vector` support from main section parser to types section parser
etan-status Jan 9, 2024
7e10d8a
Set `--bls-type` default value to `fastest` (#3567)
hwwhww Jan 9, 2024
69d043b
Extract LC migration test helpers to `light_client.py` module
etan-status Jan 9, 2024
0e15532
Add guard when `fill_prev_epoch` is `True` in epoch `0`
etan-status Jan 9, 2024
6c6ed3e
Extract sync committee period <-> slot helpers to common LC test module
etan-status Jan 9, 2024
240a127
Consider fork transitions when using `get_sync_aggregate` helper func
etan-status Jan 9, 2024
b952203
removing dockerfile ci test
parithosh Jan 10, 2024
5d17550
update docker readme
parithosh Jan 10, 2024
8256e3d
Update docker/README.md
hwwhww Jan 10, 2024
3749caa
Merge pull request #3573 from parithosh/remove-docker-test
hwwhww Jan 10, 2024
0dcb3be
Merge pull request #3569 from etan-status/lc-migrationhelpers
hwwhww Jan 10, 2024
e42974e
Merge pull request #3571 from etan-status/lc-periodhelpers
hwwhww Jan 10, 2024
d21d99f
Add constant for multi cell verification challenge
dankrad Jan 10, 2024
fddbd6b
Remove constants in favour of using compute_roots_of_unity
dankrad Jan 11, 2024
9f533cf
Merge pull request #3506 from status-im/canonical-json-byte
djrtwo Jan 11, 2024
b55ab46
Correct type info for verify_kzg_proof_multi_impl
dankrad Jan 11, 2024
c2522ac
Correct type definition for PolynomialCoeff
dankrad Jan 11, 2024
7ec0a25
Doctoc
dankrad Jan 11, 2024
9a851d9
Linter
dankrad Jan 11, 2024
4cc1e14
Forgot factor of 2 for roots_of_unity_extended
dankrad Jan 12, 2024
b7d9ea9
Rename `peerdas` to `eip7594`
hwwhww Jan 13, 2024
1509b22
Merge pull request #3557 from ethereum/polynomial-commitments-sampling
hwwhww Jan 15, 2024
868a600
Merge pull request #3537 from etan-status/lc-gindexname
hwwhww Jan 15, 2024
b594347
Merge pull request #3549 from etan-status/lc-finsend
hwwhww Jan 15, 2024
0b5bb1a
Merge branch 'dev' into pr3563
hwwhww Jan 15, 2024
82143e1
Also bump `EXECUTION_PAYLOAD_GINDEX`
etan-status Jan 15, 2024
07710e6
Merge branch 'dev' into lc-transitionacrossforks
etan-status Jan 15, 2024
90d48e5
Merge pull request #3563 from etan-status/lc-branchtypes
hwwhww Jan 15, 2024
85bd77b
Merge pull request #3572 from etan-status/lc-transitionacrossforks
hwwhww Jan 15, 2024
9b04d10
Merge pull request #3570 from etan-status/ts-attprevepoch
hwwhww Jan 15, 2024
9a54a32
Merge pull request #3431 from saltiniroberto/fork-choice-changes-for-…
djrtwo Jan 16, 2024
8983893
Merge pull request #3552 from etan-status/gv-alignaggregate
djrtwo Jan 16, 2024
a35d783
Merge pull request #3543 from etan-status/gv-finstore
djrtwo Jan 16, 2024
6367d06
Update VERSION.txt
djrtwo Jan 16, 2024
39d2284
Updates presets to use correct trusted setup from final ceremony output
CarlBeek Jan 16, 2024
26cc618
Merge pull request #3583 from ethereum/use_correct_trusted_setup
hwwhww Jan 17, 2024
f6d214d
Merge pull request #3582 from ethereum/bump-version
hwwhww Jan 17, 2024
4fe36de
Add transition test case of non-empty pre-state `historical_roots`
hwwhww Jan 17, 2024
c9c43e8
Apply suggestions from code review
hwwhww Jan 18, 2024
3727a75
Merge pull request #3585 from ethereum/historical-roots-fork-transition
hwwhww Jan 18, 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
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,32 @@ jobs:
command: make citest fork=eip7002
- store_test_results:
path: tests/core/pyspec/test-reports
test-whisk:
docker:
- image: circleci/python:3.9
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
- store_test_results:
path: tests/core/pyspec/test-reports
test-eip7594:
docker:
- image: circleci/python:3.9
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
- store_test_results:
path: tests/core/pyspec/test-reports
table_of_contents:
docker:
- image: circleci/node:10.16.3
Expand Down Expand Up @@ -307,6 +333,12 @@ workflows:
- test-eip7002:
requires:
- install_pyspec_test
- test-whisk:
requires:
- install_pyspec_test
- test-eip7594:
requires:
- install_pyspec_test
- table_of_contents
- codespell
- lint:
Expand Down
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/venv
**/.venv
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
needs: [preclear,lint,codespell,table_of_contents]
strategy:
matrix:
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "eip6110", "eip7002"]
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "eip6110", "eip7002", "whisk", "eip7594"]
steps:
- name: Checkout this repo
uses: actions/[email protected]
Expand Down Expand Up @@ -111,4 +111,4 @@ jobs:
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
ls -la ./
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ tests/core/pyspec/eth2spec/deneb/
tests/core/pyspec/eth2spec/eip6110/
tests/core/pyspec/eth2spec/eip7002/
tests/core/pyspec/eth2spec/whisk/
tests/core/pyspec/eth2spec/eip7594/

# coverage reports
.htmlcov
Expand All @@ -46,3 +47,6 @@ docs/ssz
docs/fork_choice
docs/README.md
site

# docker test results
testResults
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ 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 @@ -34,11 +35,11 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \
$(wildcard $(SSZ_DIR)/*.md)

ALL_EXECUTABLE_SPECS = phase0 altair bellatrix capella deneb eip6110 whisk
ALL_EXECUTABLE_SPEC_NAMES = phase0 altair bellatrix capella deneb eip6110 eip7002 whisk
# The parameters for commands. Use `foreach` to avoid listing specs again.
COVERAGE_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), --cov=eth2spec.$S.$(TEST_PRESET_TYPE))
PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), ./eth2spec/$S)
MYPY_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), -p eth2spec.$S)
COVERAGE_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), --cov=eth2spec.$S.$(TEST_PRESET_TYPE))
PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), ./eth2spec/$S)
MYPY_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), -p eth2spec.$S)

COV_HTML_OUT=.htmlcov
COV_HTML_OUT_DIR=$(PY_SPEC_DIR)/$(COV_HTML_OUT)
Expand Down Expand Up @@ -74,7 +75,7 @@ partial_clean:
rm -rf $(TEST_REPORT_DIR)
rm -rf eth2spec.egg-info dist build
rm -rf build;
@for spec_name in $(ALL_EXECUTABLE_SPECS) ; do \
@for spec_name in $(ALL_EXECUTABLE_SPEC_NAMES) ; do \
echo $$spec_name; \
rm -rf $(ETH2SPEC_MODULE_DIR)/$$spec_name; \
done
Expand Down Expand Up @@ -128,10 +129,10 @@ citest: pyspec
mkdir -p $(TEST_REPORT_DIR);
ifdef fork
. venv/bin/activate; cd $(PY_SPEC_DIR); \
python3 -m pytest -n 16 --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --fork=$(fork) --junitxml=test-reports/test_results.xml eth2spec
python3 -m pytest -n $(NUMBER_OF_CORES) --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 16 --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --junitxml=test-reports/test_results.xml eth2spec
python3 -m pytest -n $(NUMBER_OF_CORES) --bls-type=fastest --preset=$(TEST_PRESET_TYPE) --junitxml=test-reports/test_results.xml eth2spec
endif


Expand Down
4 changes: 4 additions & 0 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,7 @@ BLOB_SIDECAR_SUBNET_COUNT: 6
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256
# `Epoch(2)`
WHISK_PROPOSER_SELECTION_GAP: 2

# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615
4 changes: 4 additions & 0 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,7 @@ BLOB_SIDECAR_SUBNET_COUNT: 6
# Whisk
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4
WHISK_PROPOSER_SELECTION_GAP: 1

# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615
22 changes: 22 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Rename the build stage from 'base' to 'builder' for clarification and code readability
FROM python:3.11.0-slim-bullseye as builder

ENV DEBIAN_FRONTEND=noninteractive \
WORKDIR=/consensus-specs \
PIP_UPGRADE_CMD="python -m pip install --upgrade pip" \
INSTALL_CMD="apt install -y git build-essential"

RUN mkdir ${WORKDIR}
WORKDIR ${WORKDIR}

# Chain the commands together
RUN apt update && ${INSTALL_CMD} && ${PIP_UPGRADE_CMD} && rm -rf /var/lib/apt/lists/*

# Copy the current directory contents into the builder
COPY . .

# Inline installation commands
RUN make install_test && \
make preinstallation && \
make pyspec

20 changes: 20 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Docker related information

This dockerfile sets up the dependencies required to run consensus-spec tests. The docker image can be locally built with:
- `docker build ./ -t $IMAGE_NAME -f ./docker/Dockerfile`


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

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.

E.g:
- `./build_run_test.sh --p mainnet --n 16` will run the mainnet preset tests with 16 threads
- `./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

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.
67 changes: 6 additions & 61 deletions docs/docs/new-feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
- [4. Add `fork.md`](#4-add-forkmd)
- [5. Make it executable](#5-make-it-executable)
- [B: Make it executable for pytest and test generator](#b-make-it-executable-for-pytest-and-test-generator)
- [1. Add `light-client/*` docs if you updated the content of `BeaconBlock`](#1-add-light-client-docs-if-you-updated-the-content-of-beaconblock)
- [1. [Optional] Add `light-client/*` docs if you updated the content of `BeaconBlock`](#1-optional-add-light-client-docs-if-you-updated-the-content-of-beaconblock)
- [2. Add the mainnet and minimal presets and update the configs](#2-add-the-mainnet-and-minimal-presets-and-update-the-configs)
- [3. Update `context.py`](#3-update-contextpy)
- [4. Update `constants.py`](#4-update-constantspy)
- [5. Update `genesis.py`:](#5-update-genesispy)
- [6. To add fork transition tests, update fork_transition.py](#6-to-add-fork-transition-tests-update-fork_transitionpy)
- [7. Update CI configurations](#7-update-ci-configurations)
- [6. Update CI configurations](#6-update-ci-configurations)
- [Others](#others)
- [Bonus](#bonus)
- [Need help?](#need-help)
Expand Down Expand Up @@ -58,6 +57,8 @@ You can refer to the previous fork's `fork.md` file.
- Update [`pysetup/constants.py`](https://github.com/ethereum/consensus-specs/blob/dev/constants.py) with the new feature name as Pyspec `constants.py` defined.
- Update [`pysetup/spec_builders/__init__.py`](https://github.com/ethereum/consensus-specs/blob/dev/pysetup/spec_builders/__init__.py). Implement a new `<FEATURE_NAME>SpecBuilder` in `pysetup/spec_builders/<FEATURE_NAME>.py` with the new feature name. e.g., `EIP9999SpecBuilder`. Append it to the `spec_builders` list.
- Update [`pysetup/md_doc_paths.py`](https://github.com/ethereum/consensus-specs/blob/dev/pysetup/md_doc_paths.py): add the path of the new markdown files in `get_md_doc_paths` function if needed.
- Update `PREVIOUS_FORK_OF` setting in both [`test/helpers/constants.py`](https://github.com/ethereum/consensus-specs/blob/dev/constants.py) and [`pysetup/md_doc_paths.py`](https://github.com/ethereum/consensus-specs/blob/dev/pysetup/md_doc_paths.py).
- NOTE: since these two modules (the pyspec itself and the spec builder tool) must be separate, the fork sequence setting has to be defined again.

## B: Make it executable for pytest and test generator

Expand All @@ -70,24 +71,7 @@ You can refer to the previous fork's `fork.md` file.
- Update configs: `configs/mainnet.yaml` and `configs/minimal.yaml`

### 3. Update [`context.py`](https://github.com/ethereum/consensus-specs/blob/dev/tests/core/pyspec/eth2spec/test/context.py)
- Update `spec_targets` by adding `<NEW_FEATURE>`

```python
from eth2spec.eip9999 import mainnet as spec_eip9999_mainnet, minimal as spec_eip9999_minimal

...

spec_targets: Dict[PresetBaseName, Dict[SpecForkName, Spec]] = {
MINIMAL: {
...
EIP9999: spec_eip9999_minimal,
},
MAINNET: {
...
EIP9999: spec_eip9999_mainnet
},
}
```
- [Optional] Add `with_<new-feature-name>_and_later` decorator for writing pytest cases. e.g., `with_capella_and_later`.

### 4. Update [`constants.py`](https://github.com/ethereum/consensus-specs/blob/dev/tests/core/pyspec/eth2spec/test/helpers/constants.py)
- Add `<NEW_FEATURE>` to `ALL_PHASES` and `TESTGEN_FORKS`
Expand All @@ -96,20 +80,6 @@ spec_targets: Dict[PresetBaseName, Dict[SpecForkName, Spec]] = {

We use `create_genesis_state` to create the default `state` in tests.

- Update `create_genesis_state` by adding `fork_version` setting:

```python
def create_genesis_state(spec, validator_balances, activation_threshold):
...
if spec.fork == ALTAIR:
current_version = spec.config.ALTAIR_FORK_VERSION
...
elif spec.fork == EIP9999:
# Add the previous fork version of given fork
previous_version = spec.config.<PREVIOUS_FORK_VERSION>
current_version = spec.config.EIP9999_FORK_VERSION
```

- If the given feature changes `BeaconState` fields, you have to set the initial values by adding:

```python
Expand All @@ -123,32 +93,7 @@ def create_genesis_state(spec, validator_balances, activation_threshold):

- If the given feature changes `ExecutionPayload` fields, you have to set the initial values by updating `get_sample_genesis_execution_payload_header` helper.

### 6. To add fork transition tests, update [fork_transition.py](https://github.com/ethereum/consensus-specs/blob/dev/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py)

```python
def do_fork(state, spec, post_spec, fork_epoch, with_block=True, sync_aggregate=None, operation_dict=None):
...

if post_spec.fork == ALTAIR:
state = post_spec.upgrade_to_altair(state)
...
elif post_spec.fork == EIP9999:
state = post_spec.upgrade_to_eip9999(state)

...

if post_spec.fork == ALTAIR:
assert state.fork.previous_version == post_spec.config.GENESIS_FORK_VERSION
assert state.fork.current_version == post_spec.config.ALTAIR_FORK_VERSION
...
elif post_spec.fork == EIP9999:
assert state.fork.previous_version == post_spec.config.<PREVIOUS_FORK_VERSION>
assert state.fork.current_version == post_spec.config.EIP9999_FORK_VERSION

...
```

### 7. Update CI configurations
### 6. Update CI configurations
- Update [GitHub Actions config](https://github.com/ethereum/consensus-specs/blob/dev/.github/workflows/run-tests.yml)
- Update `pyspec-tests.strategy.matrix.version` list by adding new feature to it
- Update [CircleCI config](https://github.com/ethereum/consensus-specs/blob/dev/.circleci/config.yml)
Expand Down
6 changes: 6 additions & 0 deletions presets/mainnet/eip7594.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Mainnet preset - EIP7594

# Misc
# ---------------------------------------------------------------
# `uint64(2**6)` (= 64)
FIELD_ELEMENTS_PER_CELL: 64
Loading