Updated get_custody_chunk_count

Co-requisite with #1097
This commit is contained in:
vbuterin 2019-05-19 19:44:12 -04:00 committed by GitHub
parent a6a61bbecb
commit c14452bcf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -255,8 +255,8 @@ The `empty` function accepts and SSZ type as input and returns an object of that
```python
def get_custody_chunk_count(attestation: Attestation) -> int:
crosslink_start_epoch = attestation.data.latest_crosslink.epoch
crosslink_end_epoch = slot_to_epoch(attestation.data.slot)
crosslink_start_epoch = attestation.data.latest_crosslink.start_epoch
crosslink_end_epoch = attestation.data.latest_crosslink.end_epoch
crosslink_crosslink_length = min(MAX_EPOCHS_PER_CROSSLINK, end_epoch - start_epoch)
chunks_per_epoch = 2 * BYTES_PER_SHARD_BLOCK * SLOTS_PER_EPOCH // BYTES_PER_CUSTODY_CHUNK
return crosslink_crosslink_length * chunks_per_epoch