Versions in this module Expand all Collapse all v1 v1.1.3 Feb 13, 2020 Changes in this version + var MaxBlockFetch = 128 + var MaxBodyFetch = 128 + var MaxForkAncestry = 3 * params.EpochDuration + var MaxHashFetch = 512 + var MaxHeaderFetch = 192 + var MaxReceiptFetch = 256 + var MaxStateFetch = 384 + type BlockChain interface + CurrentBlock func() *types.Block + CurrentFastBlock func() *types.Block + FastSyncCommitHead func(common.Hash) error + InsertChain func(types.Blocks) (int, error) + InsertReceiptChain func(types.Blocks, []types.Receipts) (int, error) + type DoneEvent struct + type DownloadTester struct + func NewTester(testdb *etruedb.MemDatabase, stateDb etruedb.Database) *DownloadTester + func (dl *DownloadTester) CurrentBlock() *types.Block + func (dl *DownloadTester) CurrentFastBlock() *types.Block + func (dl *DownloadTester) CurrentHeader() *types.Header + func (dl *DownloadTester) FastSyncCommitHead(hash common.Hash) error + func (dl *DownloadTester) GetBlockByHash(hash common.Hash) *types.Block + func (dl *DownloadTester) GetBlockNumber() uint64 + func (dl *DownloadTester) GetDownloader() *Downloader + func (dl *DownloadTester) GetGenesis() *types.Block + func (dl *DownloadTester) GetHeaderByHash(hash common.Hash) *types.Header + func (dl *DownloadTester) GetTd(hash common.Hash, number uint64) *big.Int + func (dl *DownloadTester) HasBlock(hash common.Hash, number uint64) bool + func (dl *DownloadTester) HasFastBlock(hash common.Hash, number uint64) bool + func (dl *DownloadTester) HasHeader(hash common.Hash, number uint64) bool + func (dl *DownloadTester) InsertChain(blocks types.Blocks) (int, error) + func (dl *DownloadTester) InsertHeaderChain(headers []*types.Header, checkFreq int) (int, error) + func (dl *DownloadTester) InsertReceiptChain(blocks types.Blocks, receipts []types.Receipts) (int, error) + func (dl *DownloadTester) NewPeer(id string, version int, hashes []common.Hash, ...) error + func (dl *DownloadTester) NewSlowPeer(id string, version int, hashes []common.Hash, ...) error + func (dl *DownloadTester) Rollback(hashes []common.Hash) + func (dl *DownloadTester) Terminate() + type DownloadTesterPeer struct + func (dlp *DownloadTesterPeer) Head() (common.Hash, *big.Int) + func (dlp *DownloadTesterPeer) RequestBodies(hashes []common.Hash, isFastchain bool, call uint32) error + func (dlp *DownloadTesterPeer) RequestHeadersByHash(origin common.Hash, amount int, skip int, reverse bool, isFastchain bool) error + func (dlp *DownloadTesterPeer) RequestHeadersByNumber(origin uint64, amount int, skip int, reverse bool, isFastchain bool) error + func (dlp *DownloadTesterPeer) RequestNodeData(hashes []common.Hash, isFastchain bool) error + func (dlp *DownloadTesterPeer) RequestReceipts(hashes []common.Hash, isFastchain bool) error + type Downloader struct + StateSync etrue.StateSyncInter + func New(mode SyncMode, stateDb etruedb.Database, mux *event.TypeMux, chain BlockChain, ...) *Downloader + func (d *Downloader) Cancel() + func (d *Downloader) DeliverBodies(id string, transactions [][]*types.Transaction, signs [][]*types.PbftSign, ...) (err error) + func (d *Downloader) DeliverHeaders(id string, headers []*types.Header, call uint32) (err error) + func (d *Downloader) DeliverReceipts(id string, receipts [][]*types.Receipt) (err error) + func (d *Downloader) FetchHeight(id string, number uint64) (*types.Header, error) + func (d *Downloader) GetBlockChain() BlockChain + func (d *Downloader) Progress() truechain.SyncProgress + func (d *Downloader) RegisterLightPeer(id string, version int, peer etrue.LightPeer) error + func (d *Downloader) RegisterPeer(id string, version int, peer etrue.Peer) error + func (d *Downloader) SetHeader(remote *types.Header) + func (d *Downloader) SetSD(Sdownloader SDownloader) + func (d *Downloader) SetSync(StateSync etrue.StateSyncInter) + func (d *Downloader) SetSyncStatsChainHeightLast(number uint64) + func (d *Downloader) Synchronise(id string, head common.Hash, mode SyncMode, origin uint64, height uint64) error + func (d *Downloader) Synchronising() bool + func (d *Downloader) Terminate() + func (d *Downloader) UnregisterPeer(id string) error + type FailedEvent struct + Err error + type FakePeer struct + func NewFakePeer(id string, db etruedb.Database, hc *core.HeaderChain, dl *Downloader) *FakePeer + func (p *FakePeer) Head() (common.Hash, *big.Int) + func (p *FakePeer) RequestBodies(hashes []common.Hash, isFastchain bool) error + func (p *FakePeer) RequestHeadersByHash(hash common.Hash, amount int, skip int, reverse bool, isFastchain bool) error + func (p *FakePeer) RequestHeadersByNumber(number uint64, amount int, skip int, reverse bool, isFastchain bool) error + func (p *FakePeer) RequestNodeData(hashes []common.Hash, isFastchain bool) error + func (p *FakePeer) RequestReceipts(hashes []common.Hash, isFastchain bool) error + type FloodingTestPeer struct + type LightChain interface + CurrentHeader func() *types.Header + HasHeader func(common.Hash, uint64) bool + InsertHeaderChain func([]*types.Header, int) (int, error) + Rollback func([]common.Hash) + type SDownloader interface + SyncStateFd func(root common.Hash) etrue.StateSyncInter + type StartEvent struct + type SyncMode int + const FastSync + const FullSync + const LightSync + const SnapShotSync + func (mode *SyncMode) UnmarshalText(text []byte) error + func (mode SyncMode) IsValid() bool + func (mode SyncMode) MarshalText() ([]byte, error) + func (mode SyncMode) String() string