Versions in this module Expand all Collapse all v1 v1.10.3 Jun 30, 2021 v1.10.2 Jun 30, 2021 Changes in this version + const AccountRangeMsg + const ByteCodesMsg + const GetAccountRangeMsg + const GetByteCodesMsg + const GetStorageRangesMsg + const GetTrieNodesMsg + const ProtocolName + const StorageRangesMsg + const TrieNodesMsg + var ErrCancelled = errors.New("sync cancelled") + var ProtocolVersions = []uint + func MakeProtocols(backend Backend, dnsdisc enode.Iterator) []p2p.Protocol + type AccountData struct + Body rlp.RawValue + Hash common.Hash + type AccountRangePacket struct + Accounts []*AccountData + ID uint64 + Proof [][]byte + func (*AccountRangePacket) Kind() byte + func (*AccountRangePacket) Name() string + func (p *AccountRangePacket) Unpack() ([]common.Hash, [][]byte, error) + type Backend interface + Chain func() *core.BlockChain + Handle func(peer *Peer, packet Packet) error + PeerInfo func(id enode.ID) interface{} + RunPeer func(peer *Peer, handler Handler) error + type ByteCodesPacket struct + Codes [][]byte + ID uint64 + func (*ByteCodesPacket) Kind() byte + func (*ByteCodesPacket) Name() string + type GetAccountRangePacket struct + Bytes uint64 + ID uint64 + Limit common.Hash + Origin common.Hash + Root common.Hash + func (*GetAccountRangePacket) Kind() byte + func (*GetAccountRangePacket) Name() string + type GetByteCodesPacket struct + Bytes uint64 + Hashes []common.Hash + ID uint64 + func (*GetByteCodesPacket) Kind() byte + func (*GetByteCodesPacket) Name() string + type GetStorageRangesPacket struct + Accounts []common.Hash + Bytes uint64 + ID uint64 + Limit []byte + Origin []byte + Root common.Hash + func (*GetStorageRangesPacket) Kind() byte + func (*GetStorageRangesPacket) Name() string + type GetTrieNodesPacket struct + Bytes uint64 + ID uint64 + Paths []TrieNodePathSet + Root common.Hash + func (*GetTrieNodesPacket) Kind() byte + func (*GetTrieNodesPacket) Name() string + type Handler func(peer *Peer) error + type NodeInfo struct + type Packet interface + Kind func() byte + Name func() string + type Peer struct + func (p *Peer) ID() string + func (p *Peer) Log() log.Logger + func (p *Peer) RequestAccountRange(id uint64, root common.Hash, origin, limit common.Hash, bytes uint64) error + func (p *Peer) RequestByteCodes(id uint64, hashes []common.Hash, bytes uint64) error + func (p *Peer) RequestStorageRanges(id uint64, root common.Hash, accounts []common.Hash, origin, limit []byte, ...) error + func (p *Peer) RequestTrieNodes(id uint64, root common.Hash, paths []TrieNodePathSet, bytes uint64) error + func (p *Peer) Version() uint + type StorageData struct + Body []byte + Hash common.Hash + type StorageRangesPacket struct + ID uint64 + Proof [][]byte + Slots [][]*StorageData + func (*StorageRangesPacket) Kind() byte + func (*StorageRangesPacket) Name() string + func (p *StorageRangesPacket) Unpack() ([][]common.Hash, [][][]byte) + type SyncPeer interface + ID func() string + Log func() log.Logger + RequestAccountRange func(id uint64, root, origin, limit common.Hash, bytes uint64) error + RequestByteCodes func(id uint64, hashes []common.Hash, bytes uint64) error + RequestStorageRanges func(id uint64, root common.Hash, accounts []common.Hash, origin, limit []byte, ...) error + RequestTrieNodes func(id uint64, root common.Hash, paths []TrieNodePathSet, bytes uint64) error + type Syncer struct + func NewSyncer(db ethdb.KeyValueStore, bloom *trie.SyncBloom) *Syncer + func (s *Syncer) OnAccounts(peer SyncPeer, id uint64, hashes []common.Hash, accounts [][]byte, ...) error + func (s *Syncer) OnByteCodes(peer SyncPeer, id uint64, bytecodes [][]byte) error + func (s *Syncer) OnStorage(peer SyncPeer, id uint64, hashes [][]common.Hash, slots [][][]byte, ...) error + func (s *Syncer) OnTrieNodes(peer SyncPeer, id uint64, trienodes [][]byte) error + func (s *Syncer) Register(peer SyncPeer) error + func (s *Syncer) Sync(root common.Hash, cancel chan struct{}) error + func (s *Syncer) Unregister(id string) error + type TrieNodePathSet [][]byte + type TrieNodesPacket struct + ID uint64 + Nodes [][]byte + func (*TrieNodesPacket) Kind() byte + func (*TrieNodesPacket) Name() string