mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-09 20:41: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
29 lines
800 B
Go
29 lines
800 B
Go
package statechange
|
|
|
|
import (
|
|
"github.com/ledgerwatch/erigon/cl/abstract"
|
|
"github.com/ledgerwatch/erigon/cl/phase1/core/state"
|
|
)
|
|
|
|
func ProcessEth1DataReset(s abstract.BeaconState) {
|
|
nextEpoch := state.Epoch(s) + 1
|
|
if nextEpoch%s.BeaconConfig().EpochsPerEth1VotingPeriod == 0 {
|
|
s.ResetEth1DataVotes()
|
|
}
|
|
}
|
|
|
|
func ProcessSlashingsReset(s abstract.BeaconState) {
|
|
s.SetSlashingSegmentAt(int(state.Epoch(s)+1)%int(s.BeaconConfig().EpochsPerSlashingsVector), 0)
|
|
|
|
}
|
|
|
|
func ProcessRandaoMixesReset(s abstract.BeaconState) {
|
|
currentEpoch := state.Epoch(s)
|
|
nextEpoch := state.Epoch(s) + 1
|
|
s.SetRandaoMixAt(int(nextEpoch%s.BeaconConfig().EpochsPerHistoricalVector), s.GetRandaoMixes(currentEpoch))
|
|
}
|
|
|
|
func ProcessParticipationFlagUpdates(state abstract.BeaconState) {
|
|
state.ResetEpochParticipation()
|
|
}
|