Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0154de0
eip7732 adapt rpc methods
tbenr Feb 4, 2025
f35c99d
move to separate method
tbenr Feb 5, 2025
cec9c75
fix toc
tbenr Feb 5, 2025
37c401c
test: Cover signature_slot tiebreaker in is_better_update
bshastry Feb 6, 2025
ea74634
spec: Add comment to clarify tiebreaker for signature slots in is_bet…
bshastry Feb 11, 2025
044f22d
Merge pull request #4124 from bshastry/test_lc_update_sig_slot
jtraglia Feb 11, 2025
7c96e79
Add back `compute_cells` function
jtraglia Feb 11, 2025
4b5a06e
feedback
tbenr Feb 12, 2025
b06b8bc
Merge branch 'dev' into 7732-rpc
tbenr Feb 12, 2025
9d377fd
Update function doc
jtraglia Feb 12, 2025
a9e40ac
Merge pull request #4128 from jtraglia/compute-cells
jtraglia Feb 12, 2025
6ce4d30
Add clarifications regarding SSZ-snappy length prefix
jtraglia Feb 14, 2025
30f9fa8
Do not double build pyspec
jtraglia Feb 14, 2025
a3205e6
For the most part, rename whisk to eip7441
jtraglia Feb 14, 2025
7973118
Rename test_whisk to test_eip7441
jtraglia Feb 14, 2025
04f8412
Fix lint
jtraglia Feb 14, 2025
5186414
Do not print "building eth2spec"
jtraglia Feb 15, 2025
c8d4092
Merge pull request #4130 from jtraglia/dont-double-build-pyspec
jtraglia Feb 15, 2025
9d1e708
Merge pull request #4129 from jtraglia/ssz-varint-clarification
jtraglia Feb 15, 2025
732a2d0
Remove WHISK_ prefixes
jtraglia Feb 18, 2025
64598e9
as per feedback
tbenr Feb 18, 2025
7d6b435
Merge branch 'dev' into 7732-rpc
tbenr Feb 18, 2025
45dfbe2
Merge pull request #4131 from jtraglia/rename-whisk-to-eip7441
jtraglia Feb 18, 2025
b9f8a75
Merge pull request #4120 from tbenr/7732-rpc
jtraglia Feb 18, 2025
686e853
Remove python version from circleci cache key (#4134)
jtraglia Feb 19, 2025
7480d03
Add light client sync test for forced update before update timeout (#…
bshastry Feb 19, 2025
3c3e07b
Move deprecated specs to new directory
jtraglia Feb 26, 2025
e5480ea
Fix typos
jtraglia Feb 26, 2025
ae9325f
Merge pull request #4143 from jtraglia/deprecated-specs-dir
jtraglia Feb 26, 2025
36d80ad
Fix broken link polynomial-commitments-sampling.md (#4140)
rebustron Feb 26, 2025
ecf9f1f
Simplify build system for computed constants
etan-status Mar 7, 2025
9c68b41
Use correct division kind in Fulu
etan-status Mar 7, 2025
b419ba8
Merge pull request #4152 from etan-status/py-presetconstants
jtraglia Mar 9, 2025
21d914a
Define PAYLOAD_TIMELY_THRESHOLD with int division
jtraglia Mar 10, 2025
798223a
Cast CELLS_PER_EXT_BLOB to an int in a few spots
jtraglia Mar 10, 2025
39af832
Fix list presentation in rendered specifications (#4156)
hara-desu Mar 10, 2025
a291e65
Fix typos raised in another PR
jtraglia Mar 10, 2025
ffdb390
Merge branch 'dev' into fix-test-gen
jtraglia Mar 10, 2025
e57de72
Fix some nits with bellatrix p2p formatting
jtraglia Mar 10, 2025
e210eeb
Dedent line
jtraglia Mar 10, 2025
2cc2cd9
Merge pull request #4157 from jtraglia/fix-test-gen
jtraglia Mar 10, 2025
492572d
Add EIP-7805 (FOCIL) specs (#4003)
terencechain Mar 13, 2025
9ede9db
Add consolidation request test with 0x00 source credentials (#4162)
GaAstDev Mar 13, 2025
9277196
Bump version to v1.5.0-beta.3 (#4164)
jtraglia Mar 13, 2025
95c3fba
Change Store.inclusion_list from List to Set (#4165)
jtraglia Mar 13, 2025
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
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ PYSPEC_DIR = $(TEST_LIBS_DIR)/pyspec

# Create the pyspec for all phases.
pyspec: $(VENV) setup.py pyproject.toml
@echo "Building eth2spec"
@$(PYTHON_VENV) -m uv pip install --reinstall-package=eth2spec .[docs,lint,test,generator]
@echo "Building all pyspecs"
@$(PYTHON_VENV) setup.py pyspecdev
@for dir in $(ALL_EXECUTABLE_SPEC_NAMES); do \
mkdir -p "./tests/core/pyspec/eth2spec/$$dir"; \
cp "./build/lib/eth2spec/$$dir/mainnet.py" "./tests/core/pyspec/eth2spec/$$dir/mainnet.py"; \
cp "./build/lib/eth2spec/$$dir/minimal.py" "./tests/core/pyspec/eth2spec/$$dir/minimal.py"; \
done

###############################################################################
# Testing
Expand Down
23 changes: 23 additions & 0 deletions specs/fulu/polynomial-commitments-sampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- [`coset_for_cell`](#coset_for_cell)
- [Cells](#cells-1)
- [Cell computation](#cell-computation)
- [`compute_cells`](#compute_cells)
- [`compute_cells_and_kzg_proofs_polynomialcoeff`](#compute_cells_and_kzg_proofs_polynomialcoeff)
- [`compute_cells_and_kzg_proofs`](#compute_cells_and_kzg_proofs)
- [Cell verification](#cell-verification)
Expand Down Expand Up @@ -520,6 +521,28 @@ def coset_for_cell(cell_index: CellIndex) -> Coset:

### Cell computation

#### `compute_cells`

```python
def compute_cells(blob: Blob) -> Vector[Cell, CELLS_PER_EXT_BLOB]:
"""
Given a blob, extend it and return all the cells of the extended blob.

Public method.
"""
assert len(blob) == BYTES_PER_BLOB

polynomial = blob_to_polynomial(blob)
polynomial_coeff = polynomial_eval_to_coeff(polynomial)

cells = []
for i in range(CELLS_PER_EXT_BLOB):
coset = coset_for_cell(CellIndex(i))
ys = CosetEvals([evaluate_polynomialcoeff(polynomial_coeff, z) for z in coset])
cells.append(coset_evals_to_cell(CosetEvals(ys)))
return cells
```

#### `compute_cells_and_kzg_proofs_polynomialcoeff`

```python
Expand Down
2 changes: 1 addition & 1 deletion specs/phase0/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ When Snappy is applied, it can be passed through a buffered Snappy writer to com
When snappy is applied, it can be passed through a buffered Snappy reader to decompress frame by frame.

Before reading the payload, the header MUST be validated:
- The unsigned protobuf varint used for the length-prefix MUST not be longer than 10 bytes, which is sufficient for any `uint64`.
- The length-prefix MUST be encoded as an unsigned protobuf varint. It SHOULD be minimally encoded (i.e., without any redundant bytes) and MUST not exceed 10 bytes in length, which is sufficient to represent any `uint64` value. The length-prefix MUST be decoded into a type which supports the full range of `uint64` values.
- The length-prefix is within the expected [size bounds derived from the payload SSZ type](#what-are-ssz-type-size-bounds) or `MAX_PAYLOAD_SIZE`, whichever is smaller.

After reading a valid header, the payload MAY be read, while maintaining the size constraints from the header.
Expand Down
22 changes: 22 additions & 0 deletions tests/formats/kzg_7594/compute_cells.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Test format: Compute cells

Compute the cells for a given `blob`.

## Test case format

The test data is declared in a `data.yaml` file:

```yaml
input:
blob: Blob -- the data blob
output: List[Cell] -- the cells
```

- `Blob` is a 131072-byte hexadecimal string, prefixed with `0x`.
- `Cell` is a 2048-byte hexadecimal string, prefixed with `0x`.

All byte(s) fields are encoded as strings, hexadecimal encoding, prefixed with `0x`.

## Condition

The `compute_cells` handler should compute the cells (chunks of an extended blob) for `blob`, and the result should match the expected `output`. If the blob is invalid (e.g. incorrect length or one of the 32-byte blocks does not represent a BLS field element) it should error, i.e. the output should be `null`.
29 changes: 29 additions & 0 deletions tests/generators/kzg_7594/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,34 @@
from eth2spec.utils import bls


###############################################################################
# Test cases for compute_cells
###############################################################################

def case_compute_cells():
# Valid cases
for blob in VALID_BLOBS:
cells = spec.compute_cells(blob)
identifier = make_id(blob)
yield f'compute_cells_case_valid_{identifier}', {
'input': {
'blob': encode_hex(blob),
},
'output': encode_hex_list(cells)
}

# Edge case: Invalid blobs
for blob in INVALID_BLOBS:
expect_exception(spec.compute_cells, blob)
identifier = make_id(blob)
yield f'compute_cells_invalid_blob_{identifier}', {
'input': {
'blob': encode_hex(blob)
},
'output': None
}


###############################################################################
# Test cases for compute_cells_and_kzg_proofs
###############################################################################
Expand Down Expand Up @@ -565,6 +593,7 @@ def cases_fn() -> Iterable[gen_typing.TestCase]:
if __name__ == "__main__":
bls.use_arkworks()
gen_runner.run_generator("kzg_7594", [
create_provider(FULU, 'compute_cells', case_compute_cells),
create_provider(FULU, 'compute_cells_and_kzg_proofs', case_compute_cells_and_kzg_proofs),
create_provider(FULU, 'verify_cell_kzg_proof_batch', case_verify_cell_kzg_proof_batch),
create_provider(FULU, 'recover_cells_and_kzg_proofs', case_recover_cells_and_kzg_proofs),
Expand Down