mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-08 12:01:20 +00:00
628f52dd6c
Added changesets for beacon chain to implement memory efficient fork choice
28 lines
786 B
Go
28 lines
786 B
Go
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()
|
|
}
|