package statechange import ( "github.com/ledgerwatch/erigon/cl/abstract" "github.com/ledgerwatch/erigon/cl/clparams" ) // ProcessEpoch process epoch transition. func ProcessEpoch(state abstract.BeaconState) error { if err := ProcessJustificationBitsAndFinality(state); err != nil { return err } if state.Version() >= clparams.AltairVersion { if err := ProcessInactivityScores(state); err != nil { return err } } if err := ProcessRewardsAndPenalties(state); err != nil { return err } if err := ProcessRegistryUpdates(state); err != nil { return err } if err := ProcessSlashings(state); err != nil { return err } ProcessEth1DataReset(state) if err := ProcessEffectiveBalanceUpdates(state); err != nil { return err } ProcessSlashingsReset(state) ProcessRandaoMixesReset(state) if err := ProcessHistoricalRootsUpdate(state); err != nil { return err } if state.Version() == clparams.Phase0Version { if err := ProcessParticipationRecordUpdates(state); err != nil { return err } } if state.Version() >= clparams.AltairVersion { ProcessParticipationFlagUpdates(state) if err := ProcessSyncCommitteeUpdate(state); err != nil { return err } } return nil }