Rename `verify_shard_transition_false_positives` to `verify_empty_shard_transition`

This commit is contained in:
Hsiao-Wei Wang 2020-05-28 21:55:49 +08:00
parent 8c9bbc48d8
commit 19262888e4
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
1 changed files with 7 additions and 5 deletions

View File

@ -66,7 +66,7 @@
- [`process_crosslinks`](#process_crosslinks)
- [`process_attestation`](#process_attestation)
- [New Attester slashing processing](#new-attester-slashing-processing)
- [Shard transition false positives](#shard-transition-false-positives)
- [Verify empty shard transition](#verify-empty-shard-transition)
- [Light client processing](#light-client-processing)
- [Epoch transition](#epoch-transition)
- [Custody game updates](#custody-game-updates)
@ -671,7 +671,7 @@ def process_block(state: BeaconState, block: BeaconBlock) -> None:
process_eth1_data(state, block.body)
process_light_client_signatures(state, block.body)
process_operations(state, block.body)
verify_shard_transition_false_positives(state, block.body)
verify_empty_shard_transition(state, block.body)
```
#### Operations
@ -943,11 +943,13 @@ def process_attester_slashing(state: BeaconState, attester_slashing: AttesterSla
assert slashed_any
```
#### Shard transition false positives
#### Verify empty shard transition
```python
def verify_shard_transition_false_positives(state: BeaconState, block_body: BeaconBlockBody) -> None:
# Verify that a `shard_transition` in a block is empty if an attestation was not processed for it
def verify_empty_shard_transition(state: BeaconState, block_body: BeaconBlockBody) -> None:
"""
Verify that a `shard_transition` in a block is empty if an attestation was not processed for it.
"""
for shard in range(get_active_shard_count(state)):
if state.shard_states[shard].slot != compute_previous_slot(state.slot):
assert block_body.shard_transitions[shard] == ShardTransition()