statesync

package
v0.6.8-acp-118-handlers Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: GPL-3.0, LGPL-3.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultMaxOutstandingCodeHashes = 5000
	DefaultNumCodeFetchingWorkers   = 5
)

Variables

This section is empty.

Functions

func NewMainTrieTask

func NewMainTrieTask(sync *stateSync) syncTask

func NewStateSyncer

func NewStateSyncer(config *StateSyncerConfig) (*stateSync, error)

func NewStorageTrieTask

func NewStorageTrieTask(sync *stateSync, root common.Hash, accounts []common.Hash) syncTask

func NewTrieQueue

func NewTrieQueue(db ethdb.Database) *trieQueue

func NewTrieToSync

func NewTrieToSync(sync *stateSync, root common.Hash, account common.Hash, syncTask syncTask) (*trieToSync, error)

NewTrieToSync initializes a trieToSync and restores any previously started segments.

Types

type CodeSyncerConfig

type CodeSyncerConfig struct {
	// Maximum number of outstanding code hashes in the queue before the code syncer should block.
	MaxOutstandingCodeHashes int
	// Number of worker threads to fetch code from the network
	NumCodeFetchingWorkers int

	// Client for fetching code from the network
	Client statesyncclient.Client

	// Database for the code syncer to use.
	DB ethdb.Database
}

CodeSyncerConfig defines the configuration of the code syncer

type StateSyncerConfig

type StateSyncerConfig struct {
	Root                     common.Hash
	Client                   syncclient.Client
	DB                       ethdb.Database
	BatchSize                int
	MaxOutstandingCodeHashes int    // Maximum number of code hashes in the code syncer queue
	NumCodeFetchingWorkers   int    // Number of code syncing threads
	RequestSize              uint16 // Number of leafs to request from a peer at a time
}

Jump to

Keyboard shortcuts

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