snapleecher

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxStateFetch = 384 // Amount of node state values to allow fetching per request
)

Functions

This section is empty.

Types

type Leecher

type Leecher struct {
	SnapSyncer *snap.Syncer // TODO(karalabe): make private! hack for now
	// contains filtered or unexported fields
}

func New

func New(stateDb ethdb.Database, stateBloom *trie.SyncBloom, dropPeer peerDropFn) *Leecher

New creates a new downloader to fetch hashes and blocks from remote peers.

func (*Leecher) DeliverSnapPacket

func (d *Leecher) DeliverSnapPacket(peer *snap.Peer, packet snap.Packet) error

DeliverSnapPacket is invoked from a peer's message handler when it transmits a data packet for the local node to consume.

func (*Leecher) Progress

func (d *Leecher) Progress() ethereum.SyncProgress

Progress retrieves the synchronisation boundaries, specifically the origin block where synchronisation started at (may have failed/suspended); the block or header sync is currently at; and the latest known block which the sync targets.

In addition, during the state download phase of fast synchronisation the number of processed and the total number of known states are also returned. Otherwise these are zero.

func (*Leecher) SyncState

func (d *Leecher) SyncState(root common.Hash) *stateSync

SyncState starts downloading state with the given root hash.

type Peer

type Peer interface {
	RequestNodeData([]common.Hash) error
}

Peer encapsulates the methods required to synchronise with a remote full peer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL