add clarifying comment for genesis skip conditions

This commit is contained in:
Danny Ryan 2020-07-28 06:48:16 -04:00
parent cf1a9e815d
commit 235fb7e2a5
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 3 additions and 0 deletions

View File

@ -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