Versions in this module Expand all Collapse all v0 v0.5.6 Jul 16, 2024 v0.0.1 Jun 28, 2024 Changes in this version + var ErrNotConstructed = errors.New("snapshot is not constructed") + var ErrNotCoveredYet = errors.New("not covered yet") + var ErrSnapshotStale = errors.New("snapshot stale") + var ErrStaleParentLayer = errors.New("parent disk layer is stale") + func CheckDanglingStorage(chaindb ethdb.KeyValueStore) error + func FullAccountRLP(data []byte) ([]byte, error) + func GenerateAccountTrieRoot(it AccountIterator) (common.Hash, error) + func GenerateStorageTrieRoot(account common.Hash, it StorageIterator) (common.Hash, error) + func GenerateTrie(snaptree *Tree, root common.Hash, src ethdb.Database, dst ethdb.KeyValueWriter) error + func ResetSnapshotGeneration(db ethdb.KeyValueWriter) + func SlimAccountRLP(nonce uint64, balance *big.Int, root common.Hash, codehash []byte) []byte + func WipeSnapshot(db ethdb.KeyValueStore, full bool) chan struct + type Account struct + Balance *big.Int + CodeHash []byte + Nonce uint64 + Root []byte + func FullAccount(data []byte) (Account, error) + func SlimAccount(nonce uint64, balance *big.Int, root common.Hash, codehash []byte) Account + type AccountIterator interface + Account func() []byte + type Config struct + AsyncBuild bool + CacheSize int + NoBuild bool + SkipVerify bool + type Iterator interface + Error func() error + Hash func() common.Hash + Next func() bool + Release func() + type Snapshot interface + Account func(hash common.Hash) (*Account, error) + AccountIterator func(seek common.Hash) AccountIterator + AccountRLP func(hash common.Hash) ([]byte, error) + Root func() common.Hash + Storage func(accountHash, storageHash common.Hash) ([]byte, error) + StorageIterator func(account common.Hash, seek common.Hash) (StorageIterator, bool) + func NewDiskLayer(diskdb ethdb.KeyValueStore) Snapshot + type StorageIterator interface + Slot func() []byte + type Tree struct + func New(config Config, diskdb ethdb.KeyValueStore, triedb *trie.Database, ...) (*Tree, error) + func NewTestTree(diskdb ethdb.KeyValueStore, blockHash, root common.Hash) *Tree + func (t *Tree) AbortGeneration() + func (t *Tree) AccountIterator(root common.Hash, seek common.Hash, force bool) (AccountIterator, error) + func (t *Tree) Discard(blockHash common.Hash) error + func (t *Tree) DiskAccountIterator(seek common.Hash) AccountIterator + func (t *Tree) DiskRoot() common.Hash + func (t *Tree) DiskStorageIterator(account common.Hash, seek common.Hash) StorageIterator + func (t *Tree) Flatten(blockHash common.Hash) error + func (t *Tree) NumBlockLayers() int + func (t *Tree) NumStateLayers() int + func (t *Tree) Rebuild(blockHash, root common.Hash) + func (t *Tree) Snapshot(stateRoot common.Hash) Snapshot + func (t *Tree) Snapshots(blockHash common.Hash, limits int, nodisk bool) []Snapshot + func (t *Tree) StorageIterator(root common.Hash, account common.Hash, seek common.Hash, force bool) (StorageIterator, error) + func (t *Tree) Update(blockHash, blockRoot, parentBlockHash common.Hash, ...) error + func (t *Tree) Verify(root common.Hash) error