Documentation
¶
Index ¶
- Variables
- func AddCodeToFetch(db ethdb.KeyValueWriter, hash common.Hash)
- func ClearAllSyncSegments(db ethdb.KeyValueStore) error
- func ClearAllSyncStorageTries(db ethdb.KeyValueStore) error
- func ClearSyncSegments(db ethdb.KeyValueStore, root common.Hash) error
- func ClearSyncStorageTrie(db ethdb.KeyValueStore, root common.Hash) error
- func DeleteBloombits(db ethdb.Database, start, end uint64)
- func DeleteCodeToFetch(db ethdb.KeyValueWriter, hash common.Hash)
- func DeleteOfflinePruning(db ethdb.KeyValueStore) error
- func DeletePopulateMissingTries(db ethdb.KeyValueStore) error
- func DeleteSnapshotBlockHash(db ethdb.KeyValueWriter)
- func GetLatestSyncPerformed(db ethdb.Iteratee) uint64
- func HasPruningDisabled(db ethdb.KeyValueStore) (bool, error)
- func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error
- func IterateAccountSnapshots(db ethdb.Iteratee) ethdb.Iterator
- func NewCodeToFetchIterator(db ethdb.Iteratee) ethdb.Iterator
- func NewSyncPerformedIterator(db ethdb.Iteratee) ethdb.Iterator
- func NewSyncSegmentsIterator(db ethdb.Iteratee, root common.Hash) ethdb.Iterator
- func NewSyncStorageTriesIterator(db ethdb.Iteratee, seek []byte) ethdb.Iterator
- func ParseStateSchemeExt(provided string, disk ethdb.Database) (string, error)
- func ReadAcceptorTip(db ethdb.KeyValueReader) (common.Hash, error)
- func ReadBlockGasCost(db ethdb.Reader, hash common.Hash, number uint64) *big.Int
- func ReadBloomBits(db ethdb.KeyValueReader, bit uint, section uint64, head common.Hash) ([]byte, error)
- func ReadChainConfig(db ethdb.KeyValueReader, hash common.Hash) *params.ChainConfig
- func ReadHeader(db ethdb.Reader, hash common.Hash, number uint64) *types.Header
- func ReadOfflinePruning(db ethdb.KeyValueStore) (time.Time, error)
- func ReadPopulateMissingTries(db ethdb.KeyValueStore) (time.Time, error)
- func ReadSnapshotBlockHash(db ethdb.KeyValueReader) common.Hash
- func ReadSyncRoot(db ethdb.KeyValueReader) (common.Hash, error)
- func RestoreHeaderExtra(db ethdb.Reader, header *types.Header, hash common.Hash, number uint64)
- func UnpackSyncPerformedKey(key []byte) uint64
- func UnpackSyncSegmentKey(keyBytes []byte) (common.Hash, []byte)
- func UnpackSyncStorageTrieKey(keyBytes []byte) (common.Hash, common.Hash)
- func WriteAcceptorTip(db ethdb.KeyValueWriter, hash common.Hash) error
- func WriteBlock(db ethdb.KeyValueWriter, block *types.Block)
- func WriteBlockGasCost(db ethdb.KeyValueWriter, hash common.Hash, number uint64, cost *big.Int)
- func WriteBloomBits(db ethdb.KeyValueWriter, bit uint, section uint64, head common.Hash, ...) error
- func WriteChainConfig(db ethdb.KeyValueWriter, hash common.Hash, config *params.ChainConfig)
- func WriteHeader(db ethdb.KeyValueWriter, header *types.Header)
- func WriteOfflinePruning(db ethdb.KeyValueStore) error
- func WritePopulateMissingTries(db ethdb.KeyValueStore) error
- func WritePruningDisabled(db ethdb.KeyValueStore) error
- func WriteSnapshotBlockHash(db ethdb.KeyValueWriter, blockHash common.Hash)
- func WriteSyncPerformed(db ethdb.KeyValueWriter, blockNumber uint64) error
- func WriteSyncRoot(db ethdb.KeyValueWriter, root common.Hash) error
- func WriteSyncSegment(db ethdb.KeyValueWriter, root common.Hash, start common.Hash) error
- func WriteSyncStorageTrie(db ethdb.KeyValueWriter, root common.Hash, account common.Hash) error
Constants ¶
This section is empty.
Variables ¶
var ( // CodeToFetchPrefix is the prefix for code hashes that need to be fetched. // CodeToFetchPrefix + code hash -> empty value tracks the outstanding code hashes we need to fetch. CodeToFetchPrefix = []byte("CP") )
State sync progress keys and prefixes
var FirewoodScheme = "firewood"
FirewoodScheme is the state scheme for Firewood (currently disabled). To disable Firewood, the scheme value must still be "firewood" so that comparisons like `provided == FirewoodScheme` don't accidentally match when provided is empty string. Firewood is disabled by not requesting it.
Functions ¶
func AddCodeToFetch ¶
func AddCodeToFetch(db ethdb.KeyValueWriter, hash common.Hash)
AddCodeToFetch adds a marker that we need to fetch the code for `hash`.
func ClearAllSyncSegments ¶
func ClearAllSyncSegments(db ethdb.KeyValueStore) error
ClearAllSyncSegments removes all segment markers from db
func ClearAllSyncStorageTries ¶
func ClearAllSyncStorageTries(db ethdb.KeyValueStore) error
ClearAllSyncStorageTries removes all storage tries added for syncing from db
func ClearSyncSegments ¶
func ClearSyncSegments(db ethdb.KeyValueStore, root common.Hash) error
ClearSyncSegments removes segment markers for root from db
func ClearSyncStorageTrie ¶
func ClearSyncStorageTrie(db ethdb.KeyValueStore, root common.Hash) error
ClearSyncStorageTrie removes all storage trie accounts (with the given root) from db. Intended for use when the trie with root has completed syncing.
func DeleteBloombits ¶ added in v0.8.6
DeleteBloombits deletes all bloom bits for a given section range.
func DeleteCodeToFetch ¶
func DeleteCodeToFetch(db ethdb.KeyValueWriter, hash common.Hash)
DeleteCodeToFetch removes the marker that the code corresponding to `hash` needs to be fetched.
func DeleteOfflinePruning ¶
func DeleteOfflinePruning(db ethdb.KeyValueStore) error
DeleteOfflinePruning deletes any marker of the last attempt to run offline pruning.
func DeletePopulateMissingTries ¶
func DeletePopulateMissingTries(db ethdb.KeyValueStore) error
DeletePopulateMissingTries deletes any marker of the last attempt to re-populate missing trie nodes.
func DeleteSnapshotBlockHash ¶
func DeleteSnapshotBlockHash(db ethdb.KeyValueWriter)
DeleteSnapshotBlockHash deletes the hash of the block whose state is contained in the persisted snapshot. Since snapshots are not immutable, this method can be used during updates, so a crash or failure will mark the entire snapshot invalid.
func GetLatestSyncPerformed ¶
GetLatestSyncPerformed returns the latest block number state synced performed to.
func HasPruningDisabled ¶
func HasPruningDisabled(db ethdb.KeyValueStore) (bool, error)
HasPruningDisabled returns true if there is a marker present indicating that the node has run with pruning disabled at some point.
func InspectDatabase ¶
InspectDatabase traverses the entire database and checks the size of all different categories of data.
func IterateAccountSnapshots ¶
IterateAccountSnapshots returns an iterator for walking all of the accounts in the snapshot
func NewCodeToFetchIterator ¶
NewCodeToFetchIterator returns a KeyLength iterator over all code hashes that are pending syncing. It is the caller's responsibility to unpack the key and call Release on the returned iterator.
func NewSyncPerformedIterator ¶
NewSyncPerformedIterator returns an iterator over all block numbers the VM has state synced to.
func NewSyncSegmentsIterator ¶
NewSyncSegmentsIterator returns a KeyLength iterator over all trie segments added for root. It is the caller's responsibility to unpack the key and call Release on the returned iterator.
func NewSyncStorageTriesIterator ¶
NewSyncStorageTriesIterator returns a KeyLength iterator over all storage tries added for syncing (beginning at seek). It is the caller's responsibility to unpack the key and call Release on the returned iterator.
func ParseStateSchemeExt ¶ added in v0.8.4
ParseStateSchemeExt parses the state scheme from the provided string.
func ReadAcceptorTip ¶
func ReadAcceptorTip(db ethdb.KeyValueReader) (common.Hash, error)
ReadAcceptorTip reads the hash of the last accepted block that was fully processed. If there is no value present (the index is being initialized for the first time), then the empty hash is returned.
func ReadBlockGasCost ¶ added in v0.8.8
ReadBlockGasCost reads the BlockGasCost for a header from its separate key.
func ReadBloomBits ¶ added in v0.8.6
func ReadBloomBits(db ethdb.KeyValueReader, bit uint, section uint64, head common.Hash) ([]byte, error)
ReadBloomBits retrieves the bloom bits for a specific section and bit index.
func ReadChainConfig ¶
func ReadChainConfig(db ethdb.KeyValueReader, hash common.Hash) *params.ChainConfig
ReadChainConfig retrieves the consensus settings based on the given genesis hash.
func ReadHeader ¶ added in v0.8.8
ReadHeader reads a header from the database and restores its HeaderExtra.
func ReadOfflinePruning ¶
func ReadOfflinePruning(db ethdb.KeyValueStore) (time.Time, error)
ReadOfflinePruning reads the most recent timestamp of an attempt to run offline pruning if present.
func ReadPopulateMissingTries ¶
func ReadPopulateMissingTries(db ethdb.KeyValueStore) (time.Time, error)
ReadPopulateMissingTries reads the most recent timestamp of an attempt to re-populate missing trie nodes.
func ReadSnapshotBlockHash ¶
func ReadSnapshotBlockHash(db ethdb.KeyValueReader) common.Hash
ReadSnapshotBlockHash retrieves the hash of the block whose state is contained in the persisted snapshot.
func ReadSyncRoot ¶
func ReadSyncRoot(db ethdb.KeyValueReader) (common.Hash, error)
ReadSyncRoot reads the root corresponding to the main trie of an in-progress sync and returns common.Hash{} if no in-progress sync was found.
func RestoreHeaderExtra ¶ added in v0.8.8
RestoreHeaderExtra reads the BlockGasCost from its separate key and stores it in the header's in-memory HeaderExtra.
func UnpackSyncPerformedKey ¶
UnpackSyncPerformedKey returns the block number from keys the iterator returned from NewSyncPerformedIterator.
func UnpackSyncSegmentKey ¶
UnpackSyncSegmentKey returns the root and start position for a trie segment key returned from NewSyncSegmentsIterator.
func UnpackSyncStorageTrieKey ¶
UnpackSyncStorageTrieKey returns the root and account for a storage trie key returned from NewSyncStorageTriesIterator.
func WriteAcceptorTip ¶
func WriteAcceptorTip(db ethdb.KeyValueWriter, hash common.Hash) error
WriteAcceptorTip writes `hash` as the last accepted block that has been fully processed.
func WriteBlock ¶ added in v0.8.8
func WriteBlock(db ethdb.KeyValueWriter, block *types.Block)
WriteBlock writes a block with its HeaderExtra (BlockGasCost) to the database. This is a replacement for rawdb.WriteBlock that preserves custom header fields.
func WriteBlockGasCost ¶ added in v0.8.8
WriteBlockGasCost writes the BlockGasCost for a header to a separate key.
func WriteBloomBits ¶ added in v0.8.6
func WriteBloomBits(db ethdb.KeyValueWriter, bit uint, section uint64, head common.Hash, bits []byte) error
WriteBloomBits stores the bloom bits for a specific section and bit index.
func WriteChainConfig ¶
func WriteChainConfig(db ethdb.KeyValueWriter, hash common.Hash, config *params.ChainConfig)
WriteChainConfig writes the chain config settings to the database.
func WriteHeader ¶ added in v0.8.8
func WriteHeader(db ethdb.KeyValueWriter, header *types.Header)
WriteHeader writes a header with its HeaderExtra (BlockGasCost) to the database. This uses rawdb.WriteHeader for the header itself and stores BlockGasCost separately.
func WriteOfflinePruning ¶
func WriteOfflinePruning(db ethdb.KeyValueStore) error
WriteOfflinePruning writes a time marker of the last attempt to run offline pruning. The marker is written when offline pruning completes and is deleted when the node is started successfully with offline pruning disabled. This ensures users must disable offline pruning and start their node successfully between runs of offline pruning.
func WritePopulateMissingTries ¶
func WritePopulateMissingTries(db ethdb.KeyValueStore) error
WritePopulateMissingTries writes a marker for the current attempt to populate missing tries.
func WritePruningDisabled ¶
func WritePruningDisabled(db ethdb.KeyValueStore) error
WritePruningDisabled writes a marker to track whether the node has ever run with pruning disabled.
func WriteSnapshotBlockHash ¶
func WriteSnapshotBlockHash(db ethdb.KeyValueWriter, blockHash common.Hash)
WriteSnapshotBlockHash stores the root of the block whose state is contained in the persisted snapshot.
func WriteSyncPerformed ¶
func WriteSyncPerformed(db ethdb.KeyValueWriter, blockNumber uint64) error
WriteSyncPerformed logs an entry in `db` indicating the VM state synced to `blockNumber`.
func WriteSyncRoot ¶
func WriteSyncRoot(db ethdb.KeyValueWriter, root common.Hash) error
WriteSyncRoot writes root as the root of the main trie of the in-progress sync.
func WriteSyncSegment ¶
WriteSyncSegment adds a trie segment for root at the given start position.
func WriteSyncStorageTrie ¶
WriteSyncStorageTrie adds a storage trie for account (with the given root) to be synced.
Types ¶
This section is empty.