2023-01-27 00:24:03 +00:00
|
|
|
package transition
|
|
|
|
|
2023-03-04 21:14:45 +00:00
|
|
|
import (
|
|
|
|
"github.com/ledgerwatch/erigon/cmd/erigon-cl/core/state"
|
|
|
|
)
|
2023-02-10 14:17:27 +00:00
|
|
|
|
2023-05-04 13:18:42 +00:00
|
|
|
func ProcessEth1DataReset(s *state.BeaconState) {
|
|
|
|
nextEpoch := state.Epoch(s.BeaconState) + 1
|
|
|
|
if nextEpoch%s.BeaconConfig().EpochsPerEth1VotingPeriod == 0 {
|
|
|
|
s.ResetEth1DataVotes()
|
2023-01-27 00:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 13:18:42 +00:00
|
|
|
func ProcessSlashingsReset(s *state.BeaconState) {
|
|
|
|
s.SetSlashingSegmentAt(int(state.Epoch(s.BeaconState)+1)%int(s.BeaconConfig().EpochsPerSlashingsVector), 0)
|
2023-01-27 00:24:03 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-05-04 13:18:42 +00:00
|
|
|
func ProcessRandaoMixesReset(s *state.BeaconState) {
|
|
|
|
currentEpoch := state.Epoch(s.BeaconState)
|
|
|
|
nextEpoch := state.Epoch(s.BeaconState) + 1
|
|
|
|
s.SetRandaoMixAt(int(nextEpoch%s.BeaconConfig().EpochsPerHistoricalVector), s.GetRandaoMixes(currentEpoch))
|
2023-01-27 00:24:03 +00:00
|
|
|
}
|
2023-02-10 14:17:27 +00:00
|
|
|
|
2023-03-04 21:14:45 +00:00
|
|
|
func ProcessParticipationFlagUpdates(state *state.BeaconState) {
|
2023-03-26 22:25:08 +00:00
|
|
|
state.ResetEpochParticipation()
|
2023-02-10 14:17:27 +00:00
|
|
|
}
|