Versions in this module Expand all Collapse all v1 v1.0.1 Jul 31, 2020 v1.0.0 Jul 3, 2020 Changes in this version + var ErrCancelStateFetch = errors.New("fast state data download canceled (requested)") + var FsMinFullBlocks = uint64(16) + type DataPack interface + Items func() int + PeerId func() string + Stats func() string + type FetchRequest struct + Fheaders []*types.Header + From uint64 + Peer PeerConnection + Time time.Time + type FetchResult struct + Fheader *types.Header + Hash common.Hash + Infos types.CommitteeMembers + Pending int + Receipts types.Receipts + Signs []*types.PbftSign + Transactions types.Transactions + type LightPeer interface + Head func() (common.Hash, *big.Int) + RequestHeadersByHash func(common.Hash, int, int, bool, bool) error + RequestHeadersByNumber func(uint64, int, int, bool, bool) error + type Peer interface + RequestBodies func([]common.Hash, bool, uint32) error + RequestNodeData func([]common.Hash, bool) error + RequestReceipts func([]common.Hash, bool) error + type PeerConnection interface + BlockCapacity func(targetRTT time.Duration) int + FetchBodies func(request *FetchRequest) error + FetchHeaders func(from uint64, count int) error + FetchNodeData func(hashes []common.Hash) error + FetchReceipts func(request *FetchRequest) error + GetBlockIdle func() int32 + GetBlockStarted func() time.Time + GetBlockThroughput func() float64 + GetHeaderIdle func() int32 + GetHeaderStarted func() time.Time + GetHeaderThroughput func() float64 + GetID func() string + GetLock func() *sync.RWMutex + GetLog func() log.Logger + GetPeer func() Peer + GetReceiptIdle func() int32 + GetReceiptStarted func() time.Time + GetReceiptThroughput func() float64 + GetRtt func() time.Duration + GetStateIdle func() int32 + GetStateStarted func() time.Time + GetStateThroughput func() float64 + GetVersion func() int + HeaderCapacity func(targetRTT time.Duration) int + Lacks func(hash common.Hash) bool + MarkLacking func(hash common.Hash) + NodeDataCapacity func(targetRTT time.Duration) int + ReceiptCapacity func(targetRTT time.Duration) int + Reset func() + SetBlockThroughput func(t float64) + SetBlocksIdle func(delivered int) + SetBodiesIdle func(delivered int) + SetHeaderThroughput func(t float64) + SetHeadersIdle func(delivered int) + SetNodeDataIdle func(delivered int) + SetPeer func(Peer) + SetReceiptThroughput func(t float64) + SetReceiptsIdle func(delivered int) + SetRtt func(d time.Duration) + SetStateThroughput func(t float64) + type PeerDropFn func(id string, call uint32) + type PeerSet struct + func NewPeerSet() *PeerSet + func (ps *PeerSet) AllPeers() []PeerConnection + func (ps *PeerSet) BodyIdlePeers() ([]PeerConnection, int) + func (ps *PeerSet) HeaderIdlePeers() ([]PeerConnection, int) + func (ps *PeerSet) Len() int + func (ps *PeerSet) MedianRTT() time.Duration + func (ps *PeerSet) NodeDataIdlePeers() ([]PeerConnection, int) + func (ps *PeerSet) Peer(id string) PeerConnection + func (ps *PeerSet) ReceiptIdlePeers() ([]PeerConnection, int) + func (ps *PeerSet) Register(p PeerConnection) error + func (ps *PeerSet) Reset() + func (ps *PeerSet) SubscribeNewPeers(ch chan<- PeerConnection) event.Subscription + func (ps *PeerSet) SubscribeNewPeersFast(ch chan<- interface{}) event.Subscription + func (ps *PeerSet) SubscribePeerDrops(ch chan<- PeerConnection) event.Subscription + func (ps *PeerSet) Unregister(id string) error + type StateSyncInter interface + Cancel func() error + Done func() <-chan struct{} + Err func() error + Wait func() error