Merge pull request #532 from benjaminion/fix-to-verify-aggregation-bitfield
Fix to verify bitfields and aggregate signature.
This commit is contained in:
commit
bdff6943bf
|
@ -1690,8 +1690,15 @@ For each `attestation` in `block.body.attestations`:
|
||||||
```python
|
```python
|
||||||
assert attestation.custody_bitfield == b'\x00' * len(attestation.custody_bitfield) # [TO BE REMOVED IN PHASE 1]
|
assert attestation.custody_bitfield == b'\x00' * len(attestation.custody_bitfield) # [TO BE REMOVED IN PHASE 1]
|
||||||
assert attestation.aggregation_bitfield != b'\x00' * len(attestation.aggregation_bitfield)
|
assert attestation.aggregation_bitfield != b'\x00' * len(attestation.aggregation_bitfield)
|
||||||
|
|
||||||
for i in range(len(crosslink_committee)):
|
crosslink_committee = [
|
||||||
|
committee for committee, shard in get_crosslink_committees_at_slot(state, attestation.data.slot)
|
||||||
|
if shard == attestation.data.shard
|
||||||
|
][0]
|
||||||
|
verify_bitfield(attestation.aggregation_bitfield, len(crosslink_committee))
|
||||||
|
verify_bitfield(attestation.custody_bitfield, len(crosslink_committee))
|
||||||
|
|
||||||
|
for i in range(len(crosslink_committee):
|
||||||
if get_bitfield_bit(attestation.aggregation_bitfield, i) == 0b0:
|
if get_bitfield_bit(attestation.aggregation_bitfield, i) == 0b0:
|
||||||
assert get_bitfield_bit(attestation.custody_bitfield, i) == 0b0
|
assert get_bitfield_bit(attestation.custody_bitfield, i) == 0b0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue