Skip to content

Commit

Permalink
Merge pull request #2078 from ericsson49/ericsson49/fix_compute_weak_…
Browse files Browse the repository at this point in the history
…subjectivity_period

`compute_weak_subjectivity_period` should use integer division (//)
  • Loading branch information
djrtwo authored Sep 22, 2020
2 parents 7a46181 + 104b83a commit d7cb570
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions specs/phase0/weak-subjectivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def compute_weak_subjectivity_period(state: BeaconState) -> uint64:
weak_subjectivity_period = MIN_VALIDATOR_WITHDRAWABILITY_DELAY
validator_count = len(get_active_validator_indices(state, get_current_epoch(state)))
if validator_count >= MIN_PER_EPOCH_CHURN_LIMIT * CHURN_LIMIT_QUOTIENT:
weak_subjectivity_period += SAFETY_DECAY * CHURN_LIMIT_QUOTIENT / (2 * 100)
weak_subjectivity_period += SAFETY_DECAY * CHURN_LIMIT_QUOTIENT // (2 * 100)
else:
weak_subjectivity_period += SAFETY_DECAY * validator_count / (2 * 100 * MIN_PER_EPOCH_CHURN_LIMIT)
weak_subjectivity_period += SAFETY_DECAY * validator_count // (2 * 100 * MIN_PER_EPOCH_CHURN_LIMIT)
return weak_subjectivity_period
```

Expand Down

0 comments on commit d7cb570

Please sign in to comment.