From 235fb7e2a54c2b9c486665f1875106f8eb0788c8 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Tue, 28 Jul 2020 06:48:16 -0400 Subject: [PATCH 1/2] add clarifying comment for genesis skip conditions --- specs/phase0/beacon-chain.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specs/phase0/beacon-chain.md b/specs/phase0/beacon-chain.md index 15c8924a4..8b6bf8d23 100644 --- a/specs/phase0/beacon-chain.md +++ b/specs/phase0/beacon-chain.md @@ -1305,6 +1305,8 @@ def get_attesting_balance(state: BeaconState, attestations: Sequence[PendingAtte ```python def process_justification_and_finalization(state: BeaconState) -> None: + # Initial FFG checkpoint values have a `0x00` stub for `root`. + # Skip updating FFG checkpoints in first two epochs to avoid corner cases that might result in modifying this stub. if get_current_epoch(state) <= GENESIS_EPOCH + 1: return @@ -1512,6 +1514,7 @@ def get_attestation_deltas(state: BeaconState) -> Tuple[Sequence[Gwei], Sequence ```python def process_rewards_and_penalties(state: BeaconState) -> None: + # No rewards are applied at end of `GENESIS_EPOCH` because rewards are for work done in the previous epoch if get_current_epoch(state) == GENESIS_EPOCH: return From b529d47a3be9a5b946cdd8f4bf10c41b8f08645f Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Tue, 28 Jul 2020 11:48:45 -0400 Subject: [PATCH 2/2] pr feedback --- specs/phase0/beacon-chain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/phase0/beacon-chain.md b/specs/phase0/beacon-chain.md index 8b6bf8d23..ca7b0b858 100644 --- a/specs/phase0/beacon-chain.md +++ b/specs/phase0/beacon-chain.md @@ -1306,7 +1306,7 @@ def get_attesting_balance(state: BeaconState, attestations: Sequence[PendingAtte ```python def process_justification_and_finalization(state: BeaconState) -> None: # Initial FFG checkpoint values have a `0x00` stub for `root`. - # Skip updating FFG checkpoints in first two epochs to avoid corner cases that might result in modifying this stub. + # Skip FFG updates in the first two epochs to avoid corner cases that might result in modifying this stub. if get_current_epoch(state) <= GENESIS_EPOCH + 1: return @@ -1514,7 +1514,7 @@ def get_attestation_deltas(state: BeaconState) -> Tuple[Sequence[Gwei], Sequence ```python def process_rewards_and_penalties(state: BeaconState) -> None: - # No rewards are applied at end of `GENESIS_EPOCH` because rewards are for work done in the previous epoch + # No rewards are applied at the end of `GENESIS_EPOCH` because rewards are for work done in the previous epoch if get_current_epoch(state) == GENESIS_EPOCH: return