Apply suggestions from @mkalinin
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
This commit is contained in:
parent
0b81c967fa
commit
74aa027e38
|
@ -773,11 +773,11 @@ def validate_attestation(state: BeaconState, attestation: Attestation) -> None:
|
|||
shard = compute_shard_from_committee_index(state, data.index, data.slot)
|
||||
assert data.shard == shard
|
||||
# NOTE: We currently set `PHASE_1_FORK_SLOT` to `GENESIS_SLOT` for test vectors.
|
||||
if data.slot == PHASE_1_FORK_SLOT:
|
||||
assert data.shard_transition_root == hash_tree_root(ShardTransition())
|
||||
else:
|
||||
if data.slot > PHASE_1_FORK_SLOT:
|
||||
# On-time attestations should have a non-empty shard transition root
|
||||
assert data.shard_transition_root != hash_tree_root(ShardTransition())
|
||||
else:
|
||||
assert data.shard_transition_root == hash_tree_root(ShardTransition())
|
||||
# Type 2: no shard transition
|
||||
else:
|
||||
# Ensure delayed attestation
|
||||
|
@ -981,7 +981,7 @@ def process_shard_transitions(state: BeaconState,
|
|||
shard_transitions: Sequence[ShardTransition],
|
||||
attestations: Sequence[Attestation]) -> None:
|
||||
# NOTE: We currently set `PHASE_1_FORK_SLOT` to `GENESIS_SLOT` for test vectors.
|
||||
if compute_previous_slot(state.slot) != PHASE_1_FORK_SLOT:
|
||||
if compute_previous_slot(state.slot) > PHASE_1_FORK_SLOT:
|
||||
# Process crosslinks
|
||||
process_crosslinks(state, shard_transitions, attestations)
|
||||
|
||||
|
|
Loading…
Reference in New Issue