Versions in this module Expand all Collapse all v1 v1.10.27 Dec 7, 2022 Changes in this version + const AccountRangeMsg + const ByteCodesMsg + const GetAccountRangeMsg + const GetByteCodesMsg + const GetStorageRangesMsg + const GetTrieNodesMsg + const ProtocolName + const SNAP1 + const StorageRangesMsg + const TrieNodesMsg + var ErrCancelled = errors.New("sync cancelled") + var ProtocolVersions = []uint + func Handle(backend Backend, peer *Peer) error + func HandleMessage(backend Backend, peer *Peer) error + func MakeProtocols(backend Backend, dnsdisc enode.Iterator) []p2p.Protocol + func ServiceGetByteCodesQuery(chain *core.BlockChain, req *GetByteCodesPacket) [][]byte + func ServiceGetStorageRangesQuery(chain *core.BlockChain, req *GetStorageRangesPacket) ([][]*StorageData, [][]byte) + func ServiceGetTrieNodesQuery(chain *core.BlockChain, req *GetTrieNodesPacket, start time.Time) ([][]byte, error) + type AccountData struct + Body rlp.RawValue + Hash common.Hash + func ServiceGetAccountRangeQuery(chain *core.BlockChain, req *GetAccountRangePacket) ([]*AccountData, [][]byte) + 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 NewFakePeer(version uint, id string, rw p2p.MsgReadWriter) *Peer + func NewPeer(version uint, p *p2p.Peer, rw p2p.MsgReadWriter) *Peer + 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 SyncPending struct + BytecodeHeal uint64 + TrienodeHeal uint64 + type SyncProgress struct + AccountBytes common.StorageSize + AccountSynced uint64 + BytecodeBytes common.StorageSize + BytecodeHealBytes common.StorageSize + BytecodeHealSynced uint64 + BytecodeSynced uint64 + StorageBytes common.StorageSize + StorageSynced uint64 + Tasks []*accountTask + TrienodeHealBytes common.StorageSize + TrienodeHealSynced uint64 + type Syncer struct + func NewSyncer(db ethdb.KeyValueStore) *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) Progress() (*SyncProgress, *SyncPending) + 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