Versions in this module Expand all Collapse all v1 v1.0.3 Sep 5, 2024 v1.0.2 Sep 5, 2024 Changes in this version + var ErrCannotReorg = errors.New("can not reorg committee chain") + var ErrInvalidPeriod = errors.New("invalid update period") + var ErrInvalidUpdate = errors.New("invalid committee update") + var ErrNeedCommittee = errors.New("sync committee required") + var ErrWrongCommitteeRoot = errors.New("wrong committee root") + func GenerateTestCheckpoint(period uint64, committee *types.SerializedSyncCommittee) *types.BootstrapData + func GenerateTestCommittee() *types.SerializedSyncCommittee + func GenerateTestSignedHeader(header types.Header, config *types.ChainConfig, ...) types.SignedHeader + func GenerateTestUpdate(config *types.ChainConfig, period uint64, ...) *types.LightClientUpdate + type CommitteeChain struct + func NewCommitteeChain(db ethdb.KeyValueStore, config *types.ChainConfig, signerThreshold int, ...) *CommitteeChain + func NewTestCommitteeChain(db ethdb.KeyValueStore, config *types.ChainConfig, signerThreshold int, ...) *CommitteeChain + func (s *CommitteeChain) ChangeCounter() uint64 + func (s *CommitteeChain) CheckpointInit(bootstrap types.BootstrapData) error + func (s *CommitteeChain) InsertUpdate(update *types.LightClientUpdate, nextCommittee *types.SerializedSyncCommittee) error + func (s *CommitteeChain) NextSyncPeriod() (uint64, bool) + func (s *CommitteeChain) Reset() + func (s *CommitteeChain) VerifySignedHeader(head types.SignedHeader) (bool, time.Duration, error) + type HeadTracker struct + func NewHeadTracker(committeeChain *CommitteeChain, minSignerCount int) *HeadTracker + func (h *HeadTracker) ChangeCounter() uint64 + func (h *HeadTracker) PrefetchHead() types.HeadInfo + func (h *HeadTracker) SetPrefetchHead(head types.HeadInfo) + func (h *HeadTracker) ValidateFinality(update types.FinalityUpdate) (bool, error) + func (h *HeadTracker) ValidateOptimistic(update types.OptimisticUpdate) (bool, error) + func (h *HeadTracker) ValidatedFinality() (types.FinalityUpdate, bool) + func (h *HeadTracker) ValidatedOptimistic() (types.OptimisticUpdate, bool)