@@ -325,7 +325,7 @@ def get_next_sync_committee_indices(state: BeaconState) -> Sequence[ValidatorInd
325325 """
326326 Return the sync committee indices, with possible duplicates, for the next sync committee.
327327 """
328- epoch = Epoch( get_current_epoch(state) + 1 )
328+ epoch = get_current_epoch(state) + 1
329329
330330 MAX_RANDOM_BYTE = 2 ** 8 - 1
331331 active_validator_indices = get_active_validator_indices(state, epoch)
@@ -388,7 +388,7 @@ def get_base_reward(state: BeaconState, index: ValidatorIndex) -> Gwei:
388388 Return the base reward for the validator defined by ``index`` with respect to the current ``state``.
389389 """
390390 increments = state.validators[index].effective_balance // EFFECTIVE_BALANCE_INCREMENT
391- return Gwei( increments * get_base_reward_per_increment(state) )
391+ return increments * get_base_reward_per_increment(state)
392392```
393393
394394#### ` get_unslashed_participating_indices `
@@ -477,9 +477,9 @@ def get_flag_index_deltas(
477477 if index in unslashed_participating_indices:
478478 if not is_in_inactivity_leak(state):
479479 reward_numerator = base_reward * weight * unslashed_participating_increments
480- rewards[index] += Gwei( reward_numerator // (active_increments * WEIGHT_DENOMINATOR ) )
480+ rewards[index] += reward_numerator // (active_increments * WEIGHT_DENOMINATOR )
481481 elif flag_index != TIMELY_HEAD_FLAG_INDEX :
482- penalties[index] += Gwei( base_reward * weight // WEIGHT_DENOMINATOR )
482+ penalties[index] += base_reward * weight // WEIGHT_DENOMINATOR
483483 return rewards, penalties
484484```
485485
@@ -502,7 +502,7 @@ def get_inactivity_penalty_deltas(state: BeaconState) -> Tuple[Sequence[Gwei], S
502502 state.validators[index].effective_balance * state.inactivity_scores[index]
503503 )
504504 penalty_denominator = INACTIVITY_SCORE_BIAS * INACTIVITY_PENALTY_QUOTIENT_ALTAIR
505- penalties[index] += Gwei( penalty_numerator // penalty_denominator)
505+ penalties[index] += penalty_numerator // penalty_denominator
506506 return rewards, penalties
507507```
508508
@@ -528,7 +528,7 @@ def slash_validator(
528528 validator = state.validators[slashed_index]
529529 validator.slashed = Boolean(True )
530530 validator.withdrawable_epoch = max (
531- validator.withdrawable_epoch, Epoch( epoch + EPOCHS_PER_SLASHINGS_VECTOR )
531+ validator.withdrawable_epoch, epoch + EPOCHS_PER_SLASHINGS_VECTOR
532532 )
533533 state.slashings[epoch % EPOCHS_PER_SLASHINGS_VECTOR ] += validator.effective_balance
534534 decrease_balance(
@@ -539,10 +539,10 @@ def slash_validator(
539539 proposer_index = get_beacon_proposer_index(state)
540540 if whistleblower_index is None :
541541 whistleblower_index = proposer_index
542- whistleblower_reward = Gwei( validator.effective_balance // WHISTLEBLOWER_REWARD_QUOTIENT )
543- proposer_reward = Gwei( whistleblower_reward * PROPOSER_WEIGHT // WEIGHT_DENOMINATOR )
542+ whistleblower_reward = validator.effective_balance // WHISTLEBLOWER_REWARD_QUOTIENT
543+ proposer_reward = whistleblower_reward * PROPOSER_WEIGHT // WEIGHT_DENOMINATOR
544544 increase_balance(state, proposer_index, proposer_reward)
545- increase_balance(state, whistleblower_index, Gwei( whistleblower_reward - proposer_reward) )
545+ increase_balance(state, whistleblower_index, whistleblower_reward - proposer_reward)
546546```
547547
548548### Block processing
@@ -661,7 +661,7 @@ def process_sync_aggregate(state: BeaconState, sync_aggregate: SyncAggregate) ->
661661 )
662662 if bit
663663 ]
664- previous_slot = max (state.slot, Slot(1 )) - Slot( 1 )
664+ previous_slot = max (state.slot, Slot(1 )) - 1
665665 domain = get_domain(state, DOMAIN_SYNC_COMMITTEE , compute_epoch_at_slot(previous_slot))
666666 signing_root = compute_signing_root(get_block_root_at_slot(state, previous_slot), domain)
667667 # Note: eth_fast_aggregate_verify works with a singleton list containing an aggregated key
@@ -671,14 +671,12 @@ def process_sync_aggregate(state: BeaconState, sync_aggregate: SyncAggregate) ->
671671
672672 # Compute participant and proposer rewards
673673 total_active_increments = get_total_active_balance(state) // EFFECTIVE_BALANCE_INCREMENT
674- total_base_rewards = Gwei( get_base_reward_per_increment(state) * total_active_increments)
675- max_participant_rewards = Gwei (
674+ total_base_rewards = get_base_reward_per_increment(state) * total_active_increments
675+ max_participant_rewards = (
676676 total_base_rewards * SYNC_REWARD_WEIGHT // WEIGHT_DENOMINATOR // Uint64(SLOTS_PER_EPOCH )
677677 )
678- participant_reward = Gwei(max_participant_rewards // SYNC_COMMITTEE_SIZE )
679- proposer_reward = Gwei(
680- participant_reward * PROPOSER_WEIGHT // (WEIGHT_DENOMINATOR - PROPOSER_WEIGHT )
681- )
678+ participant_reward = max_participant_rewards // SYNC_COMMITTEE_SIZE
679+ proposer_reward = participant_reward * PROPOSER_WEIGHT // (WEIGHT_DENOMINATOR - PROPOSER_WEIGHT )
682680
683681 # Apply participant and proposer rewards
684682 all_pubkeys = [v.pubkey for v in state.validators]
@@ -836,7 +834,7 @@ def process_participation_flag_updates(state: BeaconState) -> None:
836834
837835``` python
838836def process_sync_committee_updates (state : BeaconState) -> None :
839- next_epoch = get_current_epoch(state) + Epoch( 1 )
837+ next_epoch = get_current_epoch(state) + 1
840838 if next_epoch % EPOCHS_PER_SYNC_COMMITTEE_PERIOD == 0 :
841839 state.current_sync_committee = state.next_sync_committee
842840 state.next_sync_committee = get_next_sync_committee(state)
0 commit comments