mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-10 21:11:20 +00:00
3ab373787e
we need to extract this interface from the struct. i need to also break down the interface more, to better show what parts the caching is used, move some functions from the cache state to the underlying. don't merge
50 lines
1.2 KiB
Go
50 lines
1.2 KiB
Go
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
|
|
}
|