Documentation ¶
Index ¶
- Constants
- Variables
- type Syncer
- func (s *Syncer) FindBeaconHeaderWithBlockIncluded(slot uint64) (state.BeaconBlockHeader, error)
- func (s *Syncer) FindLatestAttestedHeadersAtInterval(initialSlot, lowestSlot uint64) (uint64, error)
- func (s *Syncer) FindOldestAttestedHeaderAtInterval(initialSlot, highestSlot 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) GetFinalizedUpdate() (scale.Update, error)
- func (s *Syncer) GetFinalizedUpdateAtAttestedSlot(attestedSlot uint64, boundary uint64, fetchNextSyncCommittee bool) (scale.Update, error)
- func (s *Syncer) GetFinalizedUpdateWithSyncCommittee(syncCommitteePeriod, lastFinalizedSlot 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) GetLatestPossibleFinalizedUpdate(attestedSlot uint64, boundary uint64) (scale.Update, 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)
Constants ¶
const ( BlockRootGeneralizedIndex = 37 FinalizedCheckpointGeneralizedIndex = 105 NextSyncCommitteeGeneralizedIndex = 55 ExecutionPayloadGeneralizedIndex = 25 )
Variables ¶
var ( ErrCommitteeUpdateHeaderInDifferentSyncPeriod = errors.New("sync committee in different sync period") ErrBeaconStateAvailableYet = errors.New("beacon state object not available yet") )
Functions ¶
This section is empty.
Types ¶
type Syncer ¶
func (*Syncer) FindBeaconHeaderWithBlockIncluded ¶
func (s *Syncer) FindBeaconHeaderWithBlockIncluded(slot uint64) (state.BeaconBlockHeader, error)
func (*Syncer) FindLatestAttestedHeadersAtInterval ¶
func (s *Syncer) FindLatestAttestedHeadersAtInterval(initialSlot, lowestSlot uint64) (uint64, error)
Sanity check the finalized and attested header are at 32 boundary blocks, so we can download the beacon state
func (*Syncer) FindOldestAttestedHeaderAtInterval ¶
func (s *Syncer) FindOldestAttestedHeaderAtInterval(initialSlot, highestSlot uint64) (uint64, error)
FindOldestAttestedHeaderAtInterval finds a set of headers (finalized and attested headers) that are at 32 boundary blocks (with a sync committee super majority signature), so we can download the beacon state.
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) GetFinalizedUpdateAtAttestedSlot ¶
func (*Syncer) GetFinalizedUpdateWithSyncCommittee ¶
func (*Syncer) GetHeaderUpdate ¶
func (*Syncer) GetHeaderUpdateBySlotWithCheckpoint ¶
func (*Syncer) GetLatestPossibleFinalizedUpdate ¶
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.