Revert `process_crosslinks` and add comment

This commit is contained in:
Hsiao-Wei Wang 2020-06-18 23:32:23 +08:00
parent 35bf3b5290
commit fe47869d5f
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
1 changed files with 10 additions and 10 deletions

View File

@ -926,12 +926,12 @@ def process_crosslinks(state: BeaconState,
committee_count = get_committee_count_at_slot(state, on_time_attestation_slot)
for committee_index in map(CommitteeIndex, range(committee_count)):
# All attestations in the block for this committee/shard and current slot
shard = compute_shard_from_committee_index(state, committee_index, on_time_attestation_slot)
# Since the attestations are validated, all `shard_attestations` satisfy `attestation.data.shard == shard`
shard_attestations = [
attestation for attestation in attestations
if is_on_time_attestation(state, attestation) and attestation.data.index == committee_index
]
if len(shard_attestations) > 0:
shard = shard_attestations[0].data.shard
winning_root = process_crosslink_for_shard(
state, committee_index, shard_transitions[shard], shard_attestations
)