Skip to content

Commit

Permalink
pr cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed Mar 22, 2021
1 parent 493dd17 commit 287b4b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
12 changes: 6 additions & 6 deletions specs/altair/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,12 +583,12 @@ def process_justification_and_finalization(state: BeaconState) -> None:
# 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
previous = get_unslashed_participating_indices(state, TIMELY_TARGET_FLAG_INDEX, get_previous_epoch(state))
current = get_unslashed_participating_indices(state, TIMELY_TARGET_FLAG_INDEX, get_current_epoch(state))
weigh_justification_and_finalization(
state, get_total_active_balance(state),
get_total_balance(state, previous),
get_total_balance(state, current))
previous_indices = get_unslashed_participating_indices(state, TIMELY_TARGET_FLAG_INDEX, get_previous_epoch(state))
current_indices = get_unslashed_participating_indices(state, TIMELY_TARGET_FLAG_INDEX, get_current_epoch(state))
total_active_balance = get_total_active_balance(state)
previous_total_balance = get_total_balance(state, previous_indices)
current_total_balance = get_total_balance(state, current_indices)
weigh_justification_and_finalization(state, total_active_balance, previous_total_balance, current_total_balance)
```

#### Inactivity scores
Expand Down
15 changes: 8 additions & 7 deletions specs/phase0/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -1320,16 +1320,17 @@ def process_justification_and_finalization(state: BeaconState) -> None:
# 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
previous = get_matching_target_attestations(state, get_previous_epoch(state))
current = get_matching_target_attestations(state, get_current_epoch(state))
weigh_justification_and_finalization(
state, get_total_active_balance(state),
get_attesting_balance(state, previous),
get_attesting_balance(state, current))
previous_attestations = get_matching_target_attestations(state, get_previous_epoch(state))
current_attestations = get_matching_target_attestations(state, get_current_epoch(state))
total_active_balance = get_total_active_balance(state)
previous_total_balance = get_attesting_balance(state, previous_attestations)
current_total_balance = get_attesting_balance(state, current_attestations)
weigh_justification_and_finalization(state, total_active_balance, previous_total_balance, current_total_balance)
```

```python
def weigh_justification_and_finalization(state: BeaconState, total_active_balance: Gwei,
def weigh_justification_and_finalization(state: BeaconState,
total_active_balance: Gwei,
previous_epoch_target_balance: Gwei,
current_epoch_target_balance: Gwei) -> None:
previous_epoch = get_previous_epoch(state)
Expand Down

0 comments on commit 287b4b2

Please sign in to comment.