Documentation ¶
Index ¶
- type ChangeSet
- func (r *ChangeSet) AddHistoricalSummary(summary cltypes.HistoricalSummary)
- func (r *ChangeSet) AddVote(vote cltypes.Eth1Data)
- func (r *ChangeSet) ApplyCurrentJustifiedCheckpointChange(c *cltypes.Checkpoint) (*cltypes.Checkpoint, bool)
- func (r *ChangeSet) ApplyCurrentSyncCommitteeChange(committee *cltypes.SyncCommittee) (*cltypes.SyncCommittee, bool)
- func (r *ChangeSet) ApplyEpochParticipationChanges(previousEpochParticipation cltypes.ParticipationFlagsList, ...) (newPreviousEpochParticipation cltypes.ParticipationFlagsList, ...)
- func (r *ChangeSet) ApplyEth1DataChange(data *cltypes.Eth1Data) (*cltypes.Eth1Data, bool)
- func (r *ChangeSet) ApplyEth1DataVotesChanges(initialVotes []*cltypes.Eth1Data) (output []*cltypes.Eth1Data, changed bool)
- func (r *ChangeSet) ApplyEth1DepositIndexChange(depositIndex uint64) (uint64, bool)
- func (r *ChangeSet) ApplyFinalizedCheckpointChange(c *cltypes.Checkpoint) (*cltypes.Checkpoint, bool)
- func (r *ChangeSet) ApplyForkChange(fork *cltypes.Fork) (*cltypes.Fork, bool)
- func (r *ChangeSet) ApplyHistoricalSummaryChanges(input []*cltypes.HistoricalSummary) (output []*cltypes.HistoricalSummary, changed bool)
- func (r *ChangeSet) ApplyJustificationBitsChange(bits cltypes.JustificationBits) (cltypes.JustificationBits, bool)
- func (r *ChangeSet) ApplyLatestBlockHeader(header *cltypes.BeaconBlockHeader) (*cltypes.BeaconBlockHeader, bool)
- func (r *ChangeSet) ApplyLatestExecutionPayloadHeaderChange(eth1Header *cltypes.Eth1Header) (*cltypes.Eth1Header, bool)
- func (r *ChangeSet) ApplyNextSyncCommitteeChange(committee *cltypes.SyncCommittee) (*cltypes.SyncCommittee, bool)
- func (r *ChangeSet) ApplyNextValidatorWithdrawalIndexChange(index uint64) (uint64, bool)
- func (r *ChangeSet) ApplyNextWithdrawalIndexChange(index uint64) (uint64, bool)
- func (r *ChangeSet) ApplyPreviousJustifiedCheckpointChange(c *cltypes.Checkpoint) (*cltypes.Checkpoint, bool)
- func (r *ChangeSet) ApplySlotChange(prevSlot uint64) (uint64, bool)
- func (r *ChangeSet) ApplyVersionChange(version clparams.StateVersion) (clparams.StateVersion, bool)
- func (r *ChangeSet) CompactChanges()
- func (r *ChangeSet) HasValidatorSetNotChanged(validatorSetLength int) bool
- func (r *ChangeSet) OnCurrentJustifiedCheckpointChange(c *cltypes.Checkpoint)
- func (r *ChangeSet) OnCurrentSyncCommitteeChange(c *cltypes.SyncCommittee)
- func (r *ChangeSet) OnEth1DataChange(e *cltypes.Eth1Data)
- func (r *ChangeSet) OnEth1DepositIndexChange(e uint64)
- func (r *ChangeSet) OnEth1Header(e *cltypes.Eth1Header)
- func (r *ChangeSet) OnFinalizedCheckpointChange(c *cltypes.Checkpoint)
- func (r *ChangeSet) OnForkChange(fork *cltypes.Fork)
- func (r *ChangeSet) OnJustificationBitsChange(j cltypes.JustificationBits)
- func (r *ChangeSet) OnLatestHeaderChange(h *cltypes.BeaconBlockHeader)
- func (r *ChangeSet) OnNewValidator(validator *cltypes.Validator)
- func (r *ChangeSet) OnNextSyncCommitteeChange(c *cltypes.SyncCommittee)
- func (r *ChangeSet) OnNextWithdrawalIndexChange(index uint64)
- func (r *ChangeSet) OnNextWithdrawalValidatorIndexChange(index uint64)
- func (r *ChangeSet) OnPreviousJustifiedCheckpointChange(c *cltypes.Checkpoint)
- func (r *ChangeSet) OnSlotChange(prevSlot uint64)
- func (r *ChangeSet) OnVersionChange(v clparams.StateVersion)
- func (r *ChangeSet) ReportEpochParticipationReset(prevParticipation, currParticpation cltypes.ParticipationFlagsList)
- func (r *ChangeSet) ReportVotesReset(votes []*cltypes.Eth1Data)
- type ListChangeSet
- func (l *ListChangeSet[T]) AddChange(index int, elem T)
- func (l *ListChangeSet[T]) ApplyChanges(input []T) (output []T, changed bool)
- func (l *ListChangeSet[T]) ChangesWithHandler(fn func(value T, index int))
- func (l *ListChangeSet[T]) Clear(newLength int)
- func (l *ListChangeSet[T]) CompactChanges(reverse bool)
- func (l *ListChangeSet[T]) Empty() bool
- func (l *ListChangeSet[T]) ListLength() int
- func (l *ListChangeSet[T]) OnAddNewElement(elem T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeSet ¶
type ChangeSet struct { // Lists and arrays changesets BlockRootsChanges *ListChangeSet[libcommon.Hash] StateRootsChanges *ListChangeSet[libcommon.Hash] HistoricalRootsChanges *ListChangeSet[libcommon.Hash] BalancesChanges *ListChangeSet[uint64] RandaoMixesChanges *ListChangeSet[libcommon.Hash] SlashingsChanges *ListChangeSet[uint64] PreviousEpochParticipationChanges *ListChangeSet[cltypes.ParticipationFlags] CurrentEpochParticipationChanges *ListChangeSet[cltypes.ParticipationFlags] InactivityScoresChanges *ListChangeSet[uint64] // Validator fields. PublicKeyChanges *ListChangeSet[[48]byte] WithdrawalCredentialsChange *ListChangeSet[libcommon.Hash] EffectiveBalanceChange *ListChangeSet[uint64] SlashedChange *ListChangeSet[bool] ActivationEligibilityEpochChange *ListChangeSet[uint64] ActivationEpochChange *ListChangeSet[uint64] ExitEpochChange *ListChangeSet[uint64] WithdrawalEpochChange *ListChangeSet[uint64] // contains filtered or unexported fields }
This type of changeset is the diff beetwen next state and input state and is used to reverse/forward beacon state.
func (*ChangeSet) AddHistoricalSummary ¶
func (r *ChangeSet) AddHistoricalSummary(summary cltypes.HistoricalSummary)
func (*ChangeSet) ApplyCurrentJustifiedCheckpointChange ¶
func (r *ChangeSet) ApplyCurrentJustifiedCheckpointChange(c *cltypes.Checkpoint) (*cltypes.Checkpoint, bool)
func (*ChangeSet) ApplyCurrentSyncCommitteeChange ¶
func (r *ChangeSet) ApplyCurrentSyncCommitteeChange(committee *cltypes.SyncCommittee) (*cltypes.SyncCommittee, bool)
func (*ChangeSet) ApplyEpochParticipationChanges ¶
func (r *ChangeSet) ApplyEpochParticipationChanges( previousEpochParticipation cltypes.ParticipationFlagsList, currentEpochParticipation cltypes.ParticipationFlagsList) (newPreviousEpochParticipation cltypes.ParticipationFlagsList, newCurrentEpochParticipation cltypes.ParticipationFlagsList, previousParticipationChanged bool, currentParticipationChanged bool)
func (*ChangeSet) ApplyEth1DataChange ¶
func (*ChangeSet) ApplyEth1DataVotesChanges ¶
func (*ChangeSet) ApplyEth1DepositIndexChange ¶
func (*ChangeSet) ApplyFinalizedCheckpointChange ¶
func (r *ChangeSet) ApplyFinalizedCheckpointChange(c *cltypes.Checkpoint) (*cltypes.Checkpoint, bool)
func (*ChangeSet) ApplyForkChange ¶
func (*ChangeSet) ApplyHistoricalSummaryChanges ¶
func (r *ChangeSet) ApplyHistoricalSummaryChanges(input []*cltypes.HistoricalSummary) (output []*cltypes.HistoricalSummary, changed bool)
func (*ChangeSet) ApplyJustificationBitsChange ¶
func (r *ChangeSet) ApplyJustificationBitsChange(bits cltypes.JustificationBits) (cltypes.JustificationBits, bool)
func (*ChangeSet) ApplyLatestBlockHeader ¶
func (r *ChangeSet) ApplyLatestBlockHeader(header *cltypes.BeaconBlockHeader) (*cltypes.BeaconBlockHeader, bool)
func (*ChangeSet) ApplyLatestExecutionPayloadHeaderChange ¶
func (r *ChangeSet) ApplyLatestExecutionPayloadHeaderChange(eth1Header *cltypes.Eth1Header) (*cltypes.Eth1Header, bool)
func (*ChangeSet) ApplyNextSyncCommitteeChange ¶
func (r *ChangeSet) ApplyNextSyncCommitteeChange(committee *cltypes.SyncCommittee) (*cltypes.SyncCommittee, bool)
func (*ChangeSet) ApplyNextValidatorWithdrawalIndexChange ¶
func (*ChangeSet) ApplyNextWithdrawalIndexChange ¶
func (*ChangeSet) ApplyPreviousJustifiedCheckpointChange ¶
func (r *ChangeSet) ApplyPreviousJustifiedCheckpointChange(c *cltypes.Checkpoint) (*cltypes.Checkpoint, bool)
func (*ChangeSet) ApplySlotChange ¶
func (*ChangeSet) ApplyVersionChange ¶
func (r *ChangeSet) ApplyVersionChange(version clparams.StateVersion) (clparams.StateVersion, bool)
func (*ChangeSet) CompactChanges ¶
func (r *ChangeSet) CompactChanges()
func (*ChangeSet) HasValidatorSetNotChanged ¶
func (*ChangeSet) OnCurrentJustifiedCheckpointChange ¶
func (r *ChangeSet) OnCurrentJustifiedCheckpointChange(c *cltypes.Checkpoint)
func (*ChangeSet) OnCurrentSyncCommitteeChange ¶
func (r *ChangeSet) OnCurrentSyncCommitteeChange(c *cltypes.SyncCommittee)
func (*ChangeSet) OnEth1DataChange ¶
func (*ChangeSet) OnEth1DepositIndexChange ¶
func (*ChangeSet) OnEth1Header ¶
func (r *ChangeSet) OnEth1Header(e *cltypes.Eth1Header)
func (*ChangeSet) OnFinalizedCheckpointChange ¶
func (r *ChangeSet) OnFinalizedCheckpointChange(c *cltypes.Checkpoint)
func (*ChangeSet) OnForkChange ¶
func (*ChangeSet) OnJustificationBitsChange ¶
func (r *ChangeSet) OnJustificationBitsChange(j cltypes.JustificationBits)
func (*ChangeSet) OnLatestHeaderChange ¶
func (r *ChangeSet) OnLatestHeaderChange(h *cltypes.BeaconBlockHeader)
func (*ChangeSet) OnNewValidator ¶
func (*ChangeSet) OnNextSyncCommitteeChange ¶
func (r *ChangeSet) OnNextSyncCommitteeChange(c *cltypes.SyncCommittee)
func (*ChangeSet) OnNextWithdrawalIndexChange ¶
func (*ChangeSet) OnNextWithdrawalValidatorIndexChange ¶
func (*ChangeSet) OnPreviousJustifiedCheckpointChange ¶
func (r *ChangeSet) OnPreviousJustifiedCheckpointChange(c *cltypes.Checkpoint)
func (*ChangeSet) OnSlotChange ¶
func (*ChangeSet) OnVersionChange ¶
func (r *ChangeSet) OnVersionChange(v clparams.StateVersion)
func (*ChangeSet) ReportEpochParticipationReset ¶
func (r *ChangeSet) ReportEpochParticipationReset(prevParticipation, currParticpation cltypes.ParticipationFlagsList)
func (*ChangeSet) ReportVotesReset ¶
type ListChangeSet ¶
type ListChangeSet[T any] struct { // contains filtered or unexported fields }
func NewListChangeSet ¶
func NewListChangeSet[T any](length int) *ListChangeSet[T]
NewListChangeSet creates new list with given length.
func (*ListChangeSet[T]) AddChange ¶
func (l *ListChangeSet[T]) AddChange(index int, elem T)
AddChange appens to a new change to the changeset of the list.
func (*ListChangeSet[T]) ApplyChanges ¶
func (l *ListChangeSet[T]) ApplyChanges(input []T) (output []T, changed bool)
ApplyChanges Apply changes without any mercy. if it is reverse, you need to call CompactChangesReverse before.
func (*ListChangeSet[T]) ChangesWithHandler ¶
func (l *ListChangeSet[T]) ChangesWithHandler(fn func(value T, index int))
ChangesWithHandler uses custom handler to handle changes.
func (*ListChangeSet[T]) Clear ¶
func (l *ListChangeSet[T]) Clear(newLength int)
Clear clears the changesets and re-adjust length.
func (*ListChangeSet[T]) CompactChanges ¶
func (l *ListChangeSet[T]) CompactChanges(reverse bool)
CompactChanges removes duplicates from a list using QuickSort and linear scan. duplicates may appear if one state parameter is changed more than once.
func (*ListChangeSet[T]) Empty ¶
func (l *ListChangeSet[T]) Empty() bool
Empty return whether current list diff is empty
func (*ListChangeSet[T]) ListLength ¶
func (l *ListChangeSet[T]) ListLength() int
ListLength return full list length
func (*ListChangeSet[T]) OnAddNewElement ¶
func (l *ListChangeSet[T]) OnAddNewElement(elem T)
OnAddNewElement handles addition of new element to list set of changes.