Versions in this module Expand all Collapse all v1 v1.0.0 Aug 15, 2021 Changes in this version + const MaxHeightDrift + var BootstrapPeerThreshold = build.BootstrapPeerThreshold + var CheckpointKey = datastore.NewKey("/chain/checks") + var ErrForkCheckpoint = fmt.Errorf("fork would require us to diverge from checkpointed block") + var ErrForkTooLong = fmt.Errorf("fork longer than threshold") + var ErrTemporal = errors.New("temporal error") + var InitialSyncTimeThreshold = 15 * time.Minute + var LocalIncoming = "incoming" + var MaxSyncWorkers = 5 + var RecentSyncBufferSize = 10 + var SyncWorkerHistory = 3 + func VerifyElectionPoStVRF(ctx context.Context, worker address.Address, rand []byte, evrf []byte) error + type BadBlockCache struct + func NewBadBlockCache() *BadBlockCache + func (bts *BadBlockCache) Add(c cid.Cid, bbr BadBlockReason) + func (bts *BadBlockCache) Has(c cid.Cid) (BadBlockReason, bool) + func (bts *BadBlockCache) Purge() + func (bts *BadBlockCache) Remove(c cid.Cid) + type BadBlockReason struct + OriginalReason *BadBlockReason + Reason string + TipSet []cid.Cid + func NewBadBlockReason(cid []cid.Cid, format string, i ...interface{}) BadBlockReason + func (bbr BadBlockReason) Linked(reason string, i ...interface{}) BadBlockReason + func (bbr BadBlockReason) String() string + type SyncFunc func(context.Context, *types.TipSet) error + type SyncManager interface + SetPeerHead func(ctx context.Context, p peer.ID, ts *types.TipSet) + Start func() + State func() []SyncerStateSnapshot + Stop func() + func NewSyncManager(sync SyncFunc) SyncManager + type SyncManagerCtor func(syncFn SyncFunc) SyncManager + type Syncer struct + Exchange exchange.Client + Genesis *types.TipSet + func NewSyncer(ds dtypes.MetadataDS, sm *stmgr.StateManager, exchange exchange.Client, ...) (*Syncer, error) + func (syncer *Syncer) ChainStore() *store.ChainStore + func (syncer *Syncer) CheckBadBlockCache(blk cid.Cid) (string, bool) + func (syncer *Syncer) FetchTipSet(ctx context.Context, p peer.ID, tsk types.TipSetKey) (*store.FullTipSet, error) + func (syncer *Syncer) GetCheckpoint() types.TipSetKey + func (syncer *Syncer) IncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error) + func (syncer *Syncer) InformNewBlock(from peer.ID, blk *types.FullBlock) bool + func (syncer *Syncer) InformNewHead(from peer.ID, fts *store.FullTipSet) bool + func (syncer *Syncer) IsEpochBeyondCurrMax(epoch abi.ChainEpoch) bool + func (syncer *Syncer) LocalPeer() peer.ID + func (syncer *Syncer) MarkBad(blk cid.Cid) + func (syncer *Syncer) SetCheckpoint(tsk types.TipSetKey) error + func (syncer *Syncer) Start() + func (syncer *Syncer) State() []SyncerStateSnapshot + func (syncer *Syncer) Stop() + func (syncer *Syncer) Sync(ctx context.Context, maybeHead *types.TipSet) error + func (syncer *Syncer) UnmarkAllBad() + func (syncer *Syncer) UnmarkBad(blk cid.Cid) + func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock, useCache bool) (err error) + func (syncer *Syncer) ValidateMsgMeta(fblk *types.FullBlock) error + func (syncer *Syncer) ValidateTipSet(ctx context.Context, fts *store.FullTipSet, useCache bool) error + func (syncer *Syncer) VerifyWinningPoStProof(ctx context.Context, nv network.Version, h *types.BlockHeader, ...) error + type SyncerState struct + func (ss *SyncerState) Error(err error) + func (ss *SyncerState) Init(base, target *types.TipSet) + func (ss *SyncerState) SetHeight(h abi.ChainEpoch) + func (ss *SyncerState) SetStage(v api.SyncStateStage) + func (ss *SyncerState) Snapshot() SyncerStateSnapshot + type SyncerStateSnapshot struct + Base *types.TipSet + End time.Time + Height abi.ChainEpoch + Message string + Stage api.SyncStateStage + Start time.Time + Target *types.TipSet + WorkerID uint64