mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-01 19:15:02 -05:00
Replace hash_tree_root(x) with hash(ssz_serialize(x))
This commit is contained in:
1
setup.py
1
setup.py
@@ -586,6 +586,7 @@ class EIP4844SpecBuilder(BellatrixSpecBuilder):
|
||||
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
|
||||
|
||||
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user