Documentation
¶
Index ¶
- Constants
- Variables
- type Syncer
- func (s *Syncer) FindBeaconHeaderWithBlockIncluded(slot uint64) (state.BeaconBlockHeader, error)
- func (s *Syncer) FindValidAttestedHeader(minSlot, maxSlot uint64) (uint64, error)
- func (s *Syncer) GetBlockRoots(slot uint64) (scale.BlockRootProof, error)
- func (s *Syncer) GetBlockRootsFromState(beaconState state.BeaconState) (scale.BlockRootProof, error)
- func (s *Syncer) GetCheckpoint() (scale.BeaconCheckpoint, error)
- func (s *Syncer) GetCheckpointAtSlot(slot uint64) (scale.BeaconCheckpoint, error)
- func (s *Syncer) GetCheckpointFromFile(file string) (scale.BeaconCheckpoint, error)
- func (s *Syncer) GetFinalizedHeader() (scale.BeaconHeader, error)
- func (s *Syncer) GetFinalizedUpdate() (scale.Update, error)
- func (s *Syncer) GetFinalizedUpdateAtAttestedSlot(minSlot, maxSlot uint64, fetchNextSyncCommittee bool) (scale.Update, error)
- func (s *Syncer) GetFinalizedUpdateWithSyncCommittee(syncCommitteePeriod uint64) (scale.Update, error)
- func (s *Syncer) GetHeaderUpdate(blockRoot common.Hash, checkpoint *cache.Proof) (scale.HeaderUpdatePayload, error)
- func (s *Syncer) GetHeaderUpdateBySlotWithCheckpoint(slot uint64, checkpoint *cache.Proof) (scale.HeaderUpdatePayload, error)
- func (s *Syncer) GetSyncCommitteePeriodUpdate(period uint64, lastFinalizedSlot uint64) (scale.Update, error)
- func (s *Syncer) GetSyncCommitteePeriodUpdateFromEndpoint(from uint64) (scale.Update, error)
- func (s *Syncer) HasFinalizedHeaderChanged(finalizedHeader scale.BeaconHeader, lastFinalizedBlockRoot common.Hash) (bool, error)
- func (s *Syncer) UnmarshalBeaconState(slot uint64, data []byte) (state.BeaconState, error)
- func (s *Syncer) ValidatePair(finalizedSlot, attestedSlot uint64, attestedState state.BeaconState) error
Constants ¶
const ( BlockRootGeneralizedIndex = 37 FinalizedCheckpointGeneralizedIndex = 105 CurrentSyncCommitteeGeneralizedIndex = 54 NextSyncCommitteeGeneralizedIndex = 55 ExecutionPayloadGeneralizedIndex = 25 )
Variables ¶
var ( ErrCommitteeUpdateHeaderInDifferentSyncPeriod = errors.New("sync committee in different sync period") ErrSyncCommitteeNotSuperMajority = errors.New("update received was not signed by supermajority") )
Functions ¶
This section is empty.
Types ¶
type Syncer ¶
func (*Syncer) FindBeaconHeaderWithBlockIncluded ¶
func (s *Syncer) FindBeaconHeaderWithBlockIncluded(slot uint64) (state.BeaconBlockHeader, error)
func (*Syncer) FindValidAttestedHeader ¶
FindValidAttestedHeader Find a valid beacon header attested and finalized header pair.
func (*Syncer) GetBlockRoots ¶
func (s *Syncer) GetBlockRoots(slot uint64) (scale.BlockRootProof, error)
func (*Syncer) GetBlockRootsFromState ¶
func (s *Syncer) GetBlockRootsFromState(beaconState state.BeaconState) (scale.BlockRootProof, error)
func (*Syncer) GetCheckpoint ¶
func (s *Syncer) GetCheckpoint() (scale.BeaconCheckpoint, error)
func (*Syncer) GetCheckpointAtSlot ¶
func (s *Syncer) GetCheckpointAtSlot(slot uint64) (scale.BeaconCheckpoint, error)
func (*Syncer) GetCheckpointFromFile ¶
func (s *Syncer) GetCheckpointFromFile(file string) (scale.BeaconCheckpoint, error)
func (*Syncer) GetFinalizedHeader ¶
func (s *Syncer) GetFinalizedHeader() (scale.BeaconHeader, error)
func (*Syncer) GetFinalizedUpdateAtAttestedSlot ¶
func (*Syncer) GetFinalizedUpdateWithSyncCommittee ¶
func (*Syncer) GetHeaderUpdate ¶
func (*Syncer) GetHeaderUpdateBySlotWithCheckpoint ¶
func (*Syncer) GetSyncCommitteePeriodUpdate ¶
func (s *Syncer) GetSyncCommitteePeriodUpdate(period uint64, lastFinalizedSlot uint64) (scale.Update, error)
GetSyncCommitteePeriodUpdate fetches a sync committee update from the light client API endpoint. If it fails (typically because it cannot download the finalized header beacon state because the slot does not fall on a 32 slot interval, due to a missed block), it will construct an update manually from data download from the beacon API, or if that is unavailable, use a stored beacon state.
func (*Syncer) GetSyncCommitteePeriodUpdateFromEndpoint ¶
GetSyncCommitteePeriodUpdateFromEndpoint fetches a sync committee update from the light client API endpoint. If it cannot download the required beacon state from the API, it will look in the data store if the state is stored. If not, it returns an error.
func (*Syncer) HasFinalizedHeaderChanged ¶
func (*Syncer) UnmarshalBeaconState ¶
func (*Syncer) ValidatePair ¶
func (s *Syncer) ValidatePair(finalizedSlot, attestedSlot uint64, attestedState state.BeaconState) error