Versions in this module Expand all Collapse all v1 v1.101106.1 Jul 13, 2023 Changes in this version + var ErrMergeTransition = errors.New("legacy sync reached the merge") + var MaxBlockFetch = 128 + var MaxHeaderFetch = 192 + var MaxReceiptFetch = 256 + var MaxSkeletonSize = 128 + type BlockChain interface + CurrentBlock func() *types.Header + CurrentSnapBlock func() *types.Header + GetBlockByHash func(common.Hash) *types.Block + HasBlock func(common.Hash, uint64) bool + HasFastBlock func(common.Hash, uint64) bool + InsertChain func(types.Blocks) (int, error) + InsertReceiptChain func(types.Blocks, []types.Receipts, uint64) (int, error) + SnapSyncCommitHead func(common.Hash) error + Snapshots func() *snapshot.Tree + TrieDB func() *trie.Database + type DoneEvent struct + Latest *types.Header + type Downloader struct + SnapSyncer *snap.Syncer + func New(checkpoint uint64, stateDb ethdb.Database, mux *event.TypeMux, ...) *Downloader + func (d *Downloader) BeaconExtend(mode SyncMode, head *types.Header) error + func (d *Downloader) BeaconSync(mode SyncMode, head *types.Header, final *types.Header) error + func (d *Downloader) Cancel() + func (d *Downloader) DeliverSnapPacket(peer *snap.Peer, packet snap.Packet) error + func (d *Downloader) LegacySync(id string, head common.Hash, td, ttd *big.Int, mode SyncMode) error + func (d *Downloader) Progress() ethereum.SyncProgress + func (d *Downloader) RegisterLightPeer(id string, version uint, peer LightPeer) error + func (d *Downloader) RegisterPeer(id string, version uint, peer Peer) error + func (d *Downloader) SetBadBlockCallback(onBadBlock badBlockFn) + func (d *Downloader) Synchronising() bool + func (d *Downloader) Terminate() + func (d *Downloader) UnregisterPeer(id string) error + type DownloaderAPI struct + func NewDownloaderAPI(d *Downloader, m *event.TypeMux) *DownloaderAPI + func (api *DownloaderAPI) SubscribeSyncStatus(status chan interface{}) *SyncStatusSubscription + func (api *DownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription, error) + type FailedEvent struct + Err error + type LightChain interface + CurrentHeader func() *types.Header + GetHeaderByHash func(common.Hash) *types.Header + GetTd func(common.Hash, uint64) *big.Int + HasHeader func(common.Hash, uint64) bool + InsertHeaderChain func([]*types.Header, int) (int, error) + SetHead func(uint64) error + type LightPeer interface + Head func() (common.Hash, *big.Int) + RequestHeadersByHash func(common.Hash, int, int, bool, chan *eth.Response) (*eth.Request, error) + RequestHeadersByNumber func(uint64, int, int, bool, chan *eth.Response) (*eth.Request, error) + type Peer interface + RequestBodies func([]common.Hash, chan *eth.Response) (*eth.Request, error) + RequestReceipts func([]common.Hash, chan *eth.Response) (*eth.Request, error) + type StartEvent struct + type SyncMode uint32 + const FullSync + const LightSync + const SnapSync + func (mode *SyncMode) UnmarshalText(text []byte) error + func (mode SyncMode) IsValid() bool + func (mode SyncMode) MarshalText() ([]byte, error) + func (mode SyncMode) String() string + type SyncStatusSubscription struct + func (s *SyncStatusSubscription) Unsubscribe() + type SyncingResult struct + Status ethereum.SyncProgress + Syncing bool