Skip to content

Commit

Permalink
Merge branch 'dev' into sz-stablecontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
etan-status committed Sep 21, 2024
2 parents 0adb7ae + d14fb52 commit 714add6
Show file tree
Hide file tree
Showing 137 changed files with 4,755 additions and 1,482 deletions.
32 changes: 16 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ commands:
description: "Restore the cache with pyspec keys"
steps:
- restore_cached_venv:
venv_name: v24-pyspec
venv_name: v25-pyspec
reqs_checksum: cache-{{ checksum "setup.py" }}-{{ checksum "requirements_preinstallation.txt" }}
save_pyspec_cached_venv:
description: Save a venv into a cache with pyspec keys"
steps:
- save_cached_venv:
venv_name: v24-pyspec
venv_name: v25-pyspec
reqs_checksum: cache-{{ checksum "setup.py" }}-{{ checksum "requirements_preinstallation.txt" }}
venv_path: ./venv
restore_deposit_contract_tester_cached_venv:
Expand All @@ -60,7 +60,7 @@ commands:
jobs:
checkout_specs:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
# Restore git repo at point close to target branch/revision, to speed up checkout
Expand All @@ -80,7 +80,7 @@ jobs:
- ~/specs-repo
install_pyspec_test:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand All @@ -92,7 +92,7 @@ jobs:
- save_pyspec_cached_venv
test-phase0:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand All @@ -105,7 +105,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-altair:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand All @@ -118,7 +118,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-bellatrix:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand All @@ -131,7 +131,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-capella:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand All @@ -144,7 +144,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-deneb:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand All @@ -157,7 +157,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-electra:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand All @@ -170,7 +170,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-whisk:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand All @@ -183,7 +183,7 @@ jobs:
path: tests/core/pyspec/test-reports
test-eip7594:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand All @@ -205,7 +205,7 @@ jobs:
command: sudo npm install -g doctoc@2.2.0 && make check_toc
codespell:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- checkout
Expand All @@ -214,7 +214,7 @@ jobs:
command: pip install 'codespell<3.0.0,>=2.0.0' --user && make codespell
lint:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand Down Expand Up @@ -270,7 +270,7 @@ jobs:
- /nix
install_deposit_contract_web3_tester:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand All @@ -282,7 +282,7 @@ jobs:
- save_deposit_contract_tester_cached_venv
test_deposit_contract_web3_tests:
docker:
- image: circleci/python:3.9
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
steps:
- restore_cache:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/generate_vectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ on:
default: dev
type: string
required: true
schedule:
- cron: '0 2 * * *'

jobs:
generate-tests:
runs-on: [self-hosted-ghr-custom, size-chungus-x64, profile-consensusSpecs]
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: 'ethereum/consensus-specs'
path: 'consensus-specs'
ref: ${{ inputs.source_ref }}
ref: ${{ inputs.ref || 'dev' }}
- name: Checkout consensus-spec-tests repository
uses: actions/checkout@v4
with:
Expand All @@ -32,7 +34,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12.4'
cache: ''
- name: Clean up Spec Repository
run: |
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12.4'
cache: ''
- name: Check codespell
run: make codespell
Expand All @@ -55,10 +55,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust for dependencies
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12.4'
cache: ''
- name: Install pyspec requirements
run: make install_test
Expand All @@ -76,10 +78,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust for dependencies
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12.4'
cache: ''
- name: set TEST_PRESET_TYPE
if: github.event.inputs.test_preset_type != ''
Expand Down
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
17 changes: 10 additions & 7 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 @@ -97,6 +96,9 @@ dist_check:
dist_upload:
python3 -m twine upload dist/*

build_wheel: install_test pyspec
. venv/bin/activate && \
python3 -m build --no-isolation --outdir ./dist ./

# "make generate_tests" to run all generators
generate_tests: $(GENERATOR_TARGETS)
Expand All @@ -118,7 +120,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 +131,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 Expand Up @@ -196,7 +198,8 @@ define run_generator
cd $(GENERATOR_DIR)/$(1); \
if ! test -d venv; then python3 -m venv venv; fi; \
. venv/bin/activate; \
pip3 install -r requirements.txt; \
pip3 install ../../../dist/eth2spec-*.whl; \
pip3 install 'eth2spec[generator]'; \
python3 main.py -o $(CURRENT_DIR)/$(TEST_VECTOR_DIR); \
echo "generator $(1) finished"
endef
Expand All @@ -218,7 +221,7 @@ gen_kzg_setups:

# For any generator, build it using the run_generator function.
# (creation of output dir is a dependency)
gen_%: $(TEST_VECTOR_DIR)
gen_%: build_wheel $(TEST_VECTOR_DIR)
$(call run_generator,$*)

detect_generator_incomplete: $(TEST_VECTOR_DIR)
Expand Down
18 changes: 17 additions & 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 Expand Up @@ -73,3 +73,19 @@ Documentation on the different components used during spec writing can be found
## Consensus spec tests

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


## Installation and Usage
The consensus-specs repo can be used by running the tests locally or inside a docker container.

To run the tests locally:
- Clone the repository with `git clone https://github.com/ethereum/consensus-specs.git`
- Switch to the directory `cd consensus-specs`
- Install the dependencies with: `make install_test && make preinstallation && make pyspec`
- Run the tests with `make citest`

To run the tests inside a docker container:
- Switch to the directory with `cd scripts`
- Run the script `./build_run_docker_tests.sh`
- Find the results in a folder called `./testResults`
- Find more ways to customize the script with `./build_run_docker_tests.sh --h`
14 changes: 10 additions & 4 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 All @@ -156,13 +161,14 @@ WHISK_PROPOSER_SELECTION_GAP: 2

# EIP7594
NUMBER_OF_COLUMNS: 128
MAX_CELLS_IN_EXTENDED_MATRIX: 768
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: 8
CUSTODY_REQUIREMENT: 1
TARGET_NUMBER_OF_PEERS: 70
CUSTODY_REQUIREMENT: 4

# [New in Electra:EIP7251]
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 # 2**8 * 10**9 (= 256,000,000,000)

# EIP7732
MAX_REQUEST_PAYLOADS: 128
14 changes: 10 additions & 4 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,20 +151,23 @@ 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
WHISK_PROPOSER_SELECTION_GAP: 1

# EIP7594
NUMBER_OF_COLUMNS: 128
MAX_CELLS_IN_EXTENDED_MATRIX: 768
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: 8
CUSTODY_REQUIREMENT: 1
TARGET_NUMBER_OF_PEERS: 70
CUSTODY_REQUIREMENT: 4

# [New in Electra:EIP7251]
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 # 2**6 * 10**9 (= 64,000,000,000)
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)

# EIP7732
MAX_REQUEST_PAYLOADS: 128
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Rename the build stage from 'base' to 'builder' for clarification and code readability
FROM python:3.11.0-slim-bullseye as builder
FROM python:3.12.4-slim-bullseye as builder

ENV DEBIAN_FRONTEND=noninteractive \
WORKDIR=/consensus-specs \
Expand Down
Loading

0 comments on commit 714add6

Please sign in to comment.