apply_shard_transition: copy shard state

This commit is contained in:
terence tsao 2020-08-08 09:29:04 -07:00 committed by GitHub
parent a609320ad4
commit 729e21cbcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -868,8 +868,9 @@ def apply_shard_transition(state: BeaconState, shard: Shard, transition: ShardTr
assert optional_aggregate_verify(pubkeys, signing_roots, transition.proposer_signature_aggregate)
# Save updated state
state.shard_states[shard] = transition.shard_states[len(transition.shard_states) - 1]
state.shard_states[shard].slot = compute_previous_slot(state.slot)
shard_state = transition.shard_states[len(transition.shard_states) - 1].copy()
shard_state.slot = compute_previous_slot(state.slot)
state.shard_states[shard] = shard_state
```
###### `process_crosslink_for_shard`