# Packages
Package precompute provides gathering of nicely-structured data important to feed into epoch processing, such as attesting records and balances, for faster computation.
# Functions
ProcessEffectiveBalanceUpdates processes effective balance updates during epoch processing.
ProcessEth1DataReset processes updates to ETH1 data votes during epoch processing.
ProcessFinalUpdates processes the final updates during epoch processing.
ProcessHistoricalDataUpdate processes the updates to historical data during epoch processing.
ProcessParticipationRecordUpdates rotates current/previous epoch attestations during epoch processing.
ProcessRandaoMixesReset processes the final updates to RANDAO mix during epoch processing.
ProcessRegistryUpdates rotates validators in and out of active pool.
ProcessSlashings processes the slashed validators during epoch processing,
def process_slashings(state: BeaconState) -> None: epoch = get_current_epoch(state) total_balance = get_total_active_balance(state) adjusted_total_slashing_balance = min(sum(state.slashings) * PROPORTIONAL_SLASHING_MULTIPLIER, total_balance) if state.version == electra: increment = EFFECTIVE_BALANCE_INCREMENT # Factored out from total balance to avoid uint64 overflow penalty_per_effective_balance_increment = adjusted_total_slashing_balance // (total_balance // increment) for index, validator in enumerate(state.validators): if validator.slashed and epoch + EPOCHS_PER_SLASHINGS_VECTOR // 2 == validator.withdrawable_epoch: increment = EFFECTIVE_BALANCE_INCREMENT # Factored out from penalty numerator to avoid uint64 overflow penalty_numerator = validator.effective_balance // increment * adjusted_total_slashing_balance penalty = penalty_numerator // total_balance * increment if state.version == electra: effective_balance_increments = validator.effective_balance // increment penalty = penalty_per_effective_balance_increment * effective_balance_increments decrease_balance(state, ValidatorIndex(index), penalty).
ProcessSlashingsReset processes the total slashing balances updates during epoch processing.