2023-01-27 00:24:03 +00:00
|
|
|
package transition
|
|
|
|
|
2023-03-04 21:14:45 +00:00
|
|
|
import (
|
|
|
|
"github.com/ledgerwatch/erigon/cl/cltypes"
|
|
|
|
"github.com/ledgerwatch/erigon/cmd/erigon-cl/core/state"
|
|
|
|
)
|
2023-02-10 14:17:27 +00:00
|
|
|
|
2023-03-04 21:14:45 +00:00
|
|
|
func ProcessEth1DataReset(state *state.BeaconState) {
|
|
|
|
nextEpoch := state.Epoch() + 1
|
|
|
|
if nextEpoch%state.BeaconConfig().EpochsPerEth1VotingPeriod == 0 {
|
|
|
|
state.ResetEth1DataVotes()
|
2023-01-27 00:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-04 21:14:45 +00:00
|
|
|
func ProcessSlashingsReset(state *state.BeaconState) {
|
|
|
|
state.SetSlashingSegmentAt(int(state.Epoch()+1)%int(state.BeaconConfig().EpochsPerSlashingsVector), 0)
|
2023-01-27 00:24:03 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-03-04 21:14:45 +00:00
|
|
|
func ProcessRandaoMixesReset(state *state.BeaconState) {
|
|
|
|
currentEpoch := state.Epoch()
|
|
|
|
nextEpoch := state.Epoch() + 1
|
|
|
|
state.SetRandaoMixAt(int(nextEpoch%state.BeaconConfig().EpochsPerHistoricalVector), state.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) {
|
|
|
|
state.SetPreviousEpochParticipation(state.CurrentEpochParticipation())
|
|
|
|
state.SetCurrentEpochParticipation(make([]cltypes.ParticipationFlags, len(state.Validators())))
|
2023-02-10 14:17:27 +00:00
|
|
|
}
|