Skip to content

Commit

Permalink
Minor spec improvements (after review by hww)
Browse files Browse the repository at this point in the history
  • Loading branch information
asn-d6 committed Nov 2, 2022
1 parent cb46b11 commit af48987
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ def sundry_functions(cls) -> str:
ROOTS_OF_UNITY = kzg.compute_roots_of_unity(TESTING_FIELD_ELEMENTS_PER_BLOB)
def retrieve_blobs_sidecar(slot: Slot, beacon_block_root: Root) -> BlobsSidecar:
def retrieve_blobs_sidecar(slot: Slot, beacon_block_root: Root) -> Optional[BlobsSidecar]:
return "TEST"'''

@classmethod
Expand Down
10 changes: 5 additions & 5 deletions specs/eip4844/polynomial-commitments.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ def blob_to_polynomial(blob: Blob) -> Polynomial:
"""
Convert a blob to list of BLS field scalars.
"""
r = Polynomial()
polynomial = Polynomial()
for i in range(FIELD_ELEMENTS_PER_BLOB):
value = int.from_bytes(blob[i * BYTES_PER_FIELD_ELEMENT: (i + 1) * BYTES_PER_FIELD_ELEMENT], ENDIANNESS)
assert value < BLS_MODULUS
r[i] = value
return r
polynomial[i] = value
return polynomial
```

#### `hash_to_bls_field`
Expand All @@ -178,9 +178,9 @@ def hash_to_bls_field(polys: Sequence[Polynomial],
# Append each polynomial which is composed by field elements
for poly in polys:
for field_element in poly:
data += int.to_bytes(field_element, 32, ENDIANNESS)
data += int.to_bytes(field_element, BYTES_PER_FIELD_ELEMENT, ENDIANNESS)

# Append serialised G1 points
# Append serialized G1 points
for commitment in comms:
data += commitment

Expand Down

0 comments on commit af48987

Please sign in to comment.