statesync

package
v0.8.11-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: GPL-3.0, LGPL-3.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillAccounts

func FillAccounts(
	t *testing.T, trieDB *trie.Database, root common.Hash, numAccounts int,
	onAccount func(*testing.T, int, types.StateAccount) types.StateAccount,
) (common.Hash, map[*keystore.Key]*types.StateAccount)

FillAccounts adds [numAccounts] randomly generated accounts to the secure trie at [root] and commits it to [trieDB]. [onAccount] is called if non-nil (so the caller can modify the account before it is stored in the secure trie). returns the new trie root and a map of funded keys to StateAccount structs.

func FillAccountsWithOverlappingStorage

func FillAccountsWithOverlappingStorage(
	t *testing.T, trieDB *trie.Database, root common.Hash, numAccounts int, numOverlappingStorageRoots int,
) (common.Hash, map[*keystore.Key]*types.StateAccount)

FillAccountsWithOverlappingStorage adds [numAccounts] randomly generated accounts to the secure trie at [root] and commits it to [trieDB]. For each 3 accounts created: - One does not have a storage trie, - One has a storage trie shared with other accounts (total number of shared storage tries [numOverlappingStorageRoots]), - One has a uniquely generated storage trie, returns the new trie root and a map of funded keys to StateAccount structs.

func NewEVMStateSyncer

func NewEVMStateSyncer(config *EVMStateSyncerConfig) (*stateSyncer, error)

Types

type EVMStateSyncerConfig

type EVMStateSyncerConfig struct {
	Root      common.Hash
	Client    syncclient.Client
	DB        ethdb.Database
	BatchSize int
}

type StateSyncProgress

type StateSyncProgress struct {
	MainTrie     *TrieProgress
	MainTrieDone bool
	Root         common.Hash
	StorageTries map[common.Hash]*StorageTrieProgress
}

StateSyncProgress tracks the progress of syncing the main trie and the sub-tasks for syncing storage tries.

type StorageTrieProgress

type StorageTrieProgress struct {
	*TrieProgress
	Account            common.Hash
	AdditionalAccounts []common.Hash
	Skipped            bool
}

type TrieProgress

type TrieProgress struct {
	// contains filtered or unexported fields
}

func NewTrieProgress

func NewTrieProgress(db ethdb.Batcher, batchSize int, eta *syncETA) *TrieProgress

Jump to

Keyboard shortcuts

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