Apply mkalinin's suggestion
This commit is contained in:
parent
74aa027e38
commit
c981fc4411
|
@ -773,7 +773,7 @@ def validate_attestation(state: BeaconState, attestation: Attestation) -> None:
|
||||||
shard = compute_shard_from_committee_index(state, data.index, data.slot)
|
shard = compute_shard_from_committee_index(state, data.index, data.slot)
|
||||||
assert data.shard == shard
|
assert data.shard == shard
|
||||||
# NOTE: We currently set `PHASE_1_FORK_SLOT` to `GENESIS_SLOT` for test vectors.
|
# NOTE: We currently set `PHASE_1_FORK_SLOT` to `GENESIS_SLOT` for test vectors.
|
||||||
if data.slot > PHASE_1_FORK_SLOT:
|
if data.slot > GENESIS_SLOT:
|
||||||
# On-time attestations should have a non-empty shard transition root
|
# On-time attestations should have a non-empty shard transition root
|
||||||
assert data.shard_transition_root != hash_tree_root(ShardTransition())
|
assert data.shard_transition_root != hash_tree_root(ShardTransition())
|
||||||
else:
|
else:
|
||||||
|
@ -981,7 +981,7 @@ def process_shard_transitions(state: BeaconState,
|
||||||
shard_transitions: Sequence[ShardTransition],
|
shard_transitions: Sequence[ShardTransition],
|
||||||
attestations: Sequence[Attestation]) -> None:
|
attestations: Sequence[Attestation]) -> None:
|
||||||
# NOTE: We currently set `PHASE_1_FORK_SLOT` to `GENESIS_SLOT` for test vectors.
|
# 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) > GENESIS_SLOT:
|
||||||
# Process crosslinks
|
# Process crosslinks
|
||||||
process_crosslinks(state, shard_transitions, attestations)
|
process_crosslinks(state, shard_transitions, attestations)
|
||||||
|
|
||||||
|
|
|
@ -311,7 +311,7 @@ def get_shard_transition(beacon_state: BeaconState,
|
||||||
shard: Shard,
|
shard: Shard,
|
||||||
shard_blocks: Sequence[SignedShardBlock]) -> ShardTransition:
|
shard_blocks: Sequence[SignedShardBlock]) -> ShardTransition:
|
||||||
# NOTE: We currently set `PHASE_1_FORK_SLOT` to `GENESIS_SLOT` for test vectors.
|
# NOTE: We currently set `PHASE_1_FORK_SLOT` to `GENESIS_SLOT` for test vectors.
|
||||||
if beacon_state.slot == PHASE_1_FORK_SLOT:
|
if beacon_state.slot == GENESIS_SLOT:
|
||||||
return ShardTransition()
|
return ShardTransition()
|
||||||
|
|
||||||
offset_slots = compute_offset_slots(
|
offset_slots = compute_offset_slots(
|
||||||
|
|
Loading…
Reference in New Issue