Skip to content

Commit

Permalink
Merge branch 'ethereum:dev' into update-readme-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
parithosh authored Aug 23, 2024
2 parents bb4c5d1 + ca04b1e commit 33a8e19
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 98 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 [email protected] && 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
2 changes: 1 addition & 1 deletion .github/workflows/generate_vectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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: 0 additions & 1 deletion configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ WHISK_PROPOSER_SELECTION_GAP: 2

# EIP7594
NUMBER_OF_COLUMNS: 128
MAX_CELLS_IN_EXTENDED_MATRIX: 768
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: 8
Expand Down
1 change: 0 additions & 1 deletion configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ WHISK_PROPOSER_SELECTION_GAP: 1

# EIP7594
NUMBER_OF_COLUMNS: 128
MAX_CELLS_IN_EXTENDED_MATRIX: 768
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: 8
Expand Down
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
1 change: 0 additions & 1 deletion pysetup/spec_builders/eip7594.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def hardcoded_custom_type_dep_constants(cls, spec_object) -> str:
'FIELD_ELEMENTS_PER_CELL': spec_object.preset_vars['FIELD_ELEMENTS_PER_CELL'].value,
'FIELD_ELEMENTS_PER_EXT_BLOB': spec_object.preset_vars['FIELD_ELEMENTS_PER_EXT_BLOB'].value,
'NUMBER_OF_COLUMNS': spec_object.config_vars['NUMBER_OF_COLUMNS'].value,
'MAX_CELLS_IN_EXTENDED_MATRIX': spec_object.config_vars['MAX_CELLS_IN_EXTENDED_MATRIX'].value,
}

@classmethod
Expand Down
8 changes: 4 additions & 4 deletions requirements_preinstallation.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pip>=23.1.2
wheel>=0.40.0
setuptools>=68.0.0
pylint>=3.0.0
pip>=24.0.0
wheel>=0.44.0
setuptools>=72.0.0
pylint>=3.2.0
35 changes: 16 additions & 19 deletions specs/_features/eip7594/das-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- [`MatrixEntry`](#matrixentry)
- [Helper functions](#helper-functions)
- [`get_custody_columns`](#get_custody_columns)
- [`compute_extended_matrix`](#compute_extended_matrix)
- [`compute_matrix`](#compute_matrix)
- [`recover_matrix`](#recover_matrix)
- [`get_data_column_sidecars`](#get_data_column_sidecars)
- [Custody](#custody)
Expand Down Expand Up @@ -62,7 +62,6 @@ The following values are (non-configurable) constants used throughout the specif
| Name | Value | Description |
| - | - | - |
| `NUMBER_OF_COLUMNS` | `uint64(CELLS_PER_EXT_BLOB)` (= 128) | Number of columns in the extended data matrix |
| `MAX_CELLS_IN_EXTENDED_MATRIX` | `uint64(MAX_BLOBS_PER_BLOCK * NUMBER_OF_COLUMNS)` (= 768) | The data size of `ExtendedMatrix` |

### Networking

Expand Down Expand Up @@ -133,54 +132,52 @@ def get_custody_columns(node_id: NodeID, custody_subnet_count: uint64) -> Sequen
])
```

### `compute_extended_matrix`
### `compute_matrix`

```python
def compute_extended_matrix(blobs: Sequence[Blob]) -> List[MatrixEntry, MAX_CELLS_IN_EXTENDED_MATRIX]:
def compute_matrix(blobs: Sequence[Blob]) -> Sequence[MatrixEntry]:
"""
Return the full ``ExtendedMatrix``.
Return the full, flattened sequence of matrix entries.
This helper demonstrates the relationship between blobs and ``ExtendedMatrix``.
The data structure for storing cells is implementation-dependent.
This helper demonstrates the relationship between blobs and the matrix of cells/proofs.
The data structure for storing cells/proofs is implementation-dependent.
"""
extended_matrix = []
matrix = []
for blob_index, blob in enumerate(blobs):
cells, proofs = compute_cells_and_kzg_proofs(blob)
for cell_index, (cell, proof) in enumerate(zip(cells, proofs)):
extended_matrix.append(MatrixEntry(
matrix.append(MatrixEntry(
cell=cell,
kzg_proof=proof,
row_index=blob_index,
column_index=cell_index,
))
return extended_matrix
return matrix
```

### `recover_matrix`

```python
def recover_matrix(partial_matrix: Sequence[MatrixEntry],
blob_count: uint64) -> List[MatrixEntry, MAX_CELLS_IN_EXTENDED_MATRIX]:
def recover_matrix(partial_matrix: Sequence[MatrixEntry], blob_count: uint64) -> Sequence[MatrixEntry]:
"""
Return the recovered extended matrix.
Recover the full, flattened sequence of matrix entries.
This helper demonstrates how to apply ``recover_cells_and_kzg_proofs``.
The data structure for storing cells is implementation-dependent.
The data structure for storing cells/proofs is implementation-dependent.
"""
extended_matrix = []
matrix = []
for blob_index in range(blob_count):
cell_indices = [e.column_index for e in partial_matrix if e.row_index == blob_index]
cells = [e.cell for e in partial_matrix if e.row_index == blob_index]

recovered_cells, recovered_proofs = recover_cells_and_kzg_proofs(cell_indices, cells)
for cell_index, (cell, proof) in enumerate(zip(recovered_cells, recovered_proofs)):
extended_matrix.append(MatrixEntry(
matrix.append(MatrixEntry(
cell=cell,
kzg_proof=proof,
row_index=blob_index,
column_index=cell_index,
))
return extended_matrix
return matrix
```

### `get_data_column_sidecars`
Expand Down Expand Up @@ -241,7 +238,7 @@ At each slot, a node advertising `custody_subnet_count` downloads a minimum of `

## Extended data

In this construction, we extend the blobs using a one-dimensional erasure coding extension. The matrix comprises maximum `MAX_BLOBS_PER_BLOCK` rows and fixed `NUMBER_OF_COLUMNS` columns, with each row containing a `Blob` and its corresponding extension. `compute_extended_matrix` demonstrates the relationship between blobs and custom type `ExtendedMatrix`.
In this construction, we extend the blobs using a one-dimensional erasure coding extension. The matrix comprises maximum `MAX_BLOBS_PER_BLOCK` rows and fixed `NUMBER_OF_COLUMNS` columns, with each row containing a `Blob` and its corresponding extension. `compute_matrix` demonstrates the relationship between blobs and the matrix, a potential method of storing cells/proofs.

## Column gossip

Expand Down
2 changes: 1 addition & 1 deletion tests/core/pyspec/eth2spec/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0-alpha.4
1.5.0-alpha.5
4 changes: 2 additions & 2 deletions tests/core/pyspec/eth2spec/gen_helpers/gen_base/gen_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def should_skip_case_dir(case_dir, is_force, diagnostics_obj):
print(f'Skipping already existing test: {case_dir}')
is_skip = True
else:
print(f'Warning, output directory {case_dir} already exist,'
print(f'Warning, output directory {case_dir} already exist, '
' old files will be deleted and it will generate test vector files with the latest version')
# Clear the existing case_dir folder
shutil.rmtree(case_dir)
Expand Down Expand Up @@ -356,7 +356,7 @@ def generate_test_vector(test_case, case_dir, log_file, file_mode):
test_end = time.time()
span = round(test_end - test_start, 2)
if span > TIME_THRESHOLD_TO_PRINT:
print(f' - generated in {span} seconds')
print(f'- generated in {span} seconds')

return result

Expand Down
7 changes: 7 additions & 0 deletions tests/core/pyspec/eth2spec/test/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ def decorator(fn):
return decorator


def with_all_phases_from_except(earliest_phase, except_phases=None):
"""
A decorator factory for running a tests with every phase except the ones listed
"""
return with_all_phases_from(earliest_phase, [phase for phase in ALL_PHASES if phase not in except_phases])


def with_all_phases_except(exclusion_phases):
"""
A decorator factory for running a tests with every phase except the ones listed
Expand Down
Loading

0 comments on commit 33a8e19

Please sign in to comment.