From 0b81c967fa1bd0adedcb4f1e367eb4a6bc73165c Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Fri, 17 Jul 2020 00:18:44 +0800 Subject: [PATCH] Add notes --- specs/phase1/beacon-chain.md | 2 ++ specs/phase1/validator.md | 1 + tests/core/pyspec/eth2spec/test/helpers/attestations.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/specs/phase1/beacon-chain.md b/specs/phase1/beacon-chain.md index 16a0ea4cb..759687a2f 100644 --- a/specs/phase1/beacon-chain.md +++ b/specs/phase1/beacon-chain.md @@ -772,6 +772,7 @@ def validate_attestation(state: BeaconState, attestation: Attestation) -> None: # Correct shard number 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: @@ -979,6 +980,7 @@ def verify_empty_shard_transition(state: BeaconState, shard_transitions: Sequenc 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: # Process crosslinks process_crosslinks(state, shard_transitions, attestations) diff --git a/specs/phase1/validator.md b/specs/phase1/validator.md index 7f5313554..7e9cddd06 100644 --- a/specs/phase1/validator.md +++ b/specs/phase1/validator.md @@ -310,6 +310,7 @@ def get_shard_transition_fields( def get_shard_transition(beacon_state: BeaconState, shard: Shard, shard_blocks: Sequence[SignedShardBlock]) -> ShardTransition: + # NOTE: We currently set `PHASE_1_FORK_SLOT` to `GENESIS_SLOT` for test vectors. if beacon_state.slot == PHASE_1_FORK_SLOT: return ShardTransition() diff --git a/tests/core/pyspec/eth2spec/test/helpers/attestations.py b/tests/core/pyspec/eth2spec/test/helpers/attestations.py index fa6a90059..ae90fc808 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/attestations.py +++ b/tests/core/pyspec/eth2spec/test/helpers/attestations.py @@ -88,7 +88,7 @@ def build_attestation_data(spec, state, slot, index, shard=None, shard_transitio data.shard_transition_root = shard_transition.hash_tree_root() else: if on_time: - if data.slot == spec.PHASE_1_FORK_SLOT: + if data.slot == spec.GENESIS_SLOT: data.shard_head_root = spec.Root() data.shard_transition_root = spec.ShardTransition().hash_tree_root() else: