erigon-pulse/cmd/erigon-cl/core/transition/resets.go

28 lines
786 B
Go
Raw Normal View History

package transition
import (
"github.com/ledgerwatch/erigon/cmd/erigon-cl/core/state"
)
func ProcessEth1DataReset(state *state.BeaconState) {
nextEpoch := state.Epoch() + 1
if nextEpoch%state.BeaconConfig().EpochsPerEth1VotingPeriod == 0 {
state.ResetEth1DataVotes()
}
}
func ProcessSlashingsReset(state *state.BeaconState) {
state.SetSlashingSegmentAt(int(state.Epoch()+1)%int(state.BeaconConfig().EpochsPerSlashingsVector), 0)
}
func ProcessRandaoMixesReset(state *state.BeaconState) {
currentEpoch := state.Epoch()
nextEpoch := state.Epoch() + 1
state.SetRandaoMixAt(int(nextEpoch%state.BeaconConfig().EpochsPerHistoricalVector), state.GetRandaoMixes(currentEpoch))
}
func ProcessParticipationFlagUpdates(state *state.BeaconState) {
state.ResetEpochParticipation()
}