diff --git a/setup.py b/setup.py index 484861b85c..72b011f479 100644 --- a/setup.py +++ b/setup.py @@ -586,6 +586,7 @@ def imports(cls, preset_name: str): return super().imports(preset_name) + f''' from eth2spec.utils import kzg from eth2spec.bellatrix import {preset_name} as bellatrix +from eth2spec.utils.ssz.ssz_impl import serialize as ssz_serialize ''' @classmethod diff --git a/specs/eip4844/validator.md b/specs/eip4844/validator.md index 7d4f0b3511..6c4e893f92 100644 --- a/specs/eip4844/validator.md +++ b/specs/eip4844/validator.md @@ -93,9 +93,10 @@ def is_data_available(slot: Slot, beacon_block_root: Root, blob_kzg_commitments: ```python def hash_to_bls_field(x: Container) -> BLSFieldElement: """ - This function is used to generate Fiat-Shamir challenges. The output is not uniform over the BLS field. + Compute 32-byte hash of serialized container and convert it to BLS field. + The output is not uniform over the BLS field. """ - return int.from_bytes(hash_tree_root(x), "little") % BLS_MODULUS + return int.from_bytes(hash(ssz_serialize(x)), "little") % BLS_MODULUS ``` ### `compute_powers`