fix call to get_beacon_committee in process_crosslink_for_shard

This commit is contained in:
Danny Ryan 2020-04-01 12:20:32 -06:00
parent 16208790a5
commit 613f368c00
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 4 additions and 3 deletions

View File

@ -709,11 +709,12 @@ def apply_shard_transition(state: BeaconState, shard: Shard, transition: ShardTr
```python ```python
def process_crosslink_for_shard(state: BeaconState, def process_crosslink_for_shard(state: BeaconState,
shard: Shard, committee_index: CommitteeIndex,
shard_transition: ShardTransition, shard_transition: ShardTransition,
attestations: Sequence[Attestation]) -> Root: attestations: Sequence[Attestation]) -> Root:
committee = get_beacon_committee(state, get_current_epoch(state), shard) committee = get_beacon_committee(state, state.slot, committee_index)
online_indices = get_online_validator_indices(state) online_indices = get_online_validator_indices(state)
shard = compute_shard_from_committee_index(state, committee_index, state.slot)
# Loop over all shard transition roots # Loop over all shard transition roots
shard_transition_roots = set([a.data.shard_transition_root for a in attestations]) shard_transition_roots = set([a.data.shard_transition_root for a in attestations])
@ -775,7 +776,7 @@ def process_crosslinks(state: BeaconState,
if attestation.data.index == committee_index and attestation.data.slot == state.slot if attestation.data.index == committee_index and attestation.data.slot == state.slot
] ]
shard_transition = shard_transitions[shard] shard_transition = shard_transitions[shard]
winning_root = process_crosslink_for_shard(state, shard, shard_transition, shard_attestations) winning_root = process_crosslink_for_shard(state, committee_index, shard_transition, shard_attestations)
if winning_root != Root(): if winning_root != Root():
# Mark relevant pending attestations as creating a successful crosslink # Mark relevant pending attestations as creating a successful crosslink
for pending_attestation in state.current_epoch_attestations: for pending_attestation in state.current_epoch_attestations: