package
0.14.0
Repository: https://github.com/ava-labs/coreth.git
Documentation: pkg.go.dev

# Functions

AddCodeToFetch adds a marker that we need to fetch the code for [hash].
ClearAllSyncSegments removes all segment markers from db.
ClearAllSyncStorageTries removes all storage tries added for syncing from db.
ClearPrefix removes all keys in db that begin with prefix and match an expected key length.
ClearSyncSegments removes segment markers for root from db.
ClearSyncStorageTrie removes all storage trie accounts (with the given root) from db.
DeleteAccountSnapshot removes the snapshot entry of an account trie leaf.
DeleteAccountTrieNode deletes the specified account trie node from the database.
DeleteBlock removes all block data associated with a hash.
DeleteBlockWithoutNumber removes all block data associated with a hash, except the hash to number mapping.
DeleteBloombits removes all compressed bloom bits vector belonging to the given section range and bit index.
DeleteBody removes all block body data associated with a hash.
DeleteCanonicalHash removes the number to hash canonical mapping.
DeleteCode deletes the specified contract code from the database.
DeleteCodeToFetch removes the marker that the code corresponding to [hash] needs to be fetched.
DeleteHeader removes all block header data associated with a hash.
DeleteHeaderNumber removes hash->number mapping.
DeleteLegacyTrieNode deletes the specified legacy trie node from database.
DeleteOfflinePruning deletes any marker of the last attempt to run offline pruning.
DeletePopulateMissingTries deletes any marker of the last attempt to re-populate missing trie nodes.
DeletePruningDisabled deletes the marker indicating that the node has run with pruning disabled.
DeleteReceipts removes all receipt data associated with a block hash.
DeleteSnapshotBlockHash deletes the hash of the block whose state is contained in the persisted snapshot.
DeleteSnapshotRoot deletes the root of the block whose state is contained in the persisted snapshot.
DeleteStateID deletes the specified state lookup from the database.
DeleteStorageSnapshot removes the snapshot entry of an storage trie leaf.
DeleteStorageTrieNode deletes the specified storage trie node from the database.
DeleteTimeMarker deletes any value stored at [key].
DeleteTrieJournal deletes the serialized in-memory trie nodes of layers saved at the last shutdown.
DeleteTrieNode deletes the trie node from database with the provided node info and associated node hash.
DeleteTxLookupEntries removes all transaction lookups for a given block.
DeleteTxLookupEntry removes all transaction data associated with a hash.
ExistsAccountTrieNode checks the presence of the account trie node with the specified node path, regardless of the node hash.
ExistsStorageTrieNode checks the presence of the storage trie node with the specified account hash and node path, regardless of the node hash.
FindCommonAncestor returns the last common ancestor of two block headers.
GetLatestSyncPerformed returns the latest block number state synced performed to.
HasAccountTrieNode checks the account trie node presence with the specified node path and the associated node hash.
HasBody verifies the existence of a block body corresponding to the hash.
HasCode checks if the contract code corresponding to the provided code hash is present in the db.
HasHeader verifies the existence of a block header corresponding to the hash.
HasLegacyTrieNode checks if the trie node with the provided hash is present in db.
HasPruningDisabled returns true if there is a marker present indicating that the node has run with pruning disabled at some pooint.
HasReceipts verifies the existence of all the transaction receipts belonging to a block.
HasStorageTrieNode checks the storage trie node presence with the provided node path and the associated node hash.
HasTrieNode checks the trie node presence with the provided node info and the associated node hash.
IndexTransactions creates txlookup indices of the specified block range.
InspectDatabase traverses the entire database and checks the size of all different categories of data.
IsAccountTrieNode reports whether a provided database entry is an account trie node in path-based state scheme.
IsCodeKey reports whether the given byte slice is the key of contract code, if so return the raw code hash as well.
IsLegacyTrieNode reports whether a provided database entry is a legacy trie node.
IsStorageTrieNode reports whether a provided database entry is a storage trie node in path-based state scheme.
IterateAccountSnapshots returns an iterator for walking all of the accounts in the snapshot.
IterateStorageSnapshots returns an iterator for walking the entire storage space of a specific account.
NewCodeToFetchIterator returns a KeyLength iterator over all code hashes that are pending syncing.
NewDatabase creates a high level database on top of a given key-value data store without a freezer moving immutable chain segments into cold storage.
NewKeyLengthIterator returns a wrapped version of the iterator that will only return key-value pairs where keys with a specific key length will be returned.
NewLevelDBDatabase creates a persistent key-value database without a freezer moving immutable chain segments into cold storage.
NewMemoryDatabase creates an ephemeral in-memory key-value database without a freezer moving immutable chain segments into cold storage.
NewMemoryDatabaseWithCap creates an ephemeral in-memory key-value database with an initial starting capacity, but without a freezer moving immutable chain segments into cold storage.
NewPebbleDBDatabase creates a persistent key-value database without a freezer moving immutable chain segments into cold storage.
NewSyncPerformedIterator returns an iterator over all block numbers the VM has state synced to.
NewSyncSegmentsIterator returns a KeyLength iterator over all trie segments added for root.
NewSyncStorageTriesIterator returns a KeyLength iterator over all storage tries added for syncing (beginning at seek).
NewTable returns a database object that prefixes all keys with a given string.
Open opens both a disk-based key-value database such as leveldb or pebble, but also integrates it with a freezer database -- if the AncientDir option has been set on the provided OpenOptions.
ParseStateScheme checks if the specified state scheme is compatible with the stored state.
PopUncleanShutdownMarker removes the last unclean shutdown marker.
PreexistingDatabase checks the given data directory whether a database is already instantiated at that location, and if so, returns the type of database (or the empty string).
PushUncleanShutdownMarker appends a new unclean shutdown marker and returns the previous data - a list of timestamps - a count of how many old unclean-shutdowns have been discarded.
ReadAcceptorTip reads the hash of the last accepted block that was fully processed.
ReadAccountSnapshot retrieves the snapshot entry of an account trie leaf.
ReadAccountTrieNode retrieves the account trie node and the associated node hash with the specified node path.
ReadAllCanonicalHashes retrieves all canonical number and hash mappings at the certain chain range.
ReadAllHashes retrieves all the hashes assigned to blocks at a certain heights, both canonical and reorged forks included.
ReadAllHashesInRange retrieves all the hashes assigned to blocks at certain heights, both canonical and reorged forks included.
ReadBlock retrieves an entire block corresponding to the hash, assembling it back from the stored header and body.
ReadBloomBits retrieves the compressed bloom bit vector belonging to the given section and bit index from the.
ReadBody retrieves the block body corresponding to the hash.
ReadBodyRLP retrieves the block body (transactions and uncles) in RLP encoding.
ReadCanonicalBodyRLP retrieves the block body (transactions and uncles) for the canonical block at number, in RLP encoding.
ReadCanonicalHash retrieves the hash assigned to a canonical block number.
ReadChainConfig retrieves the consensus settings based on the given genesis hash.
ReadCode retrieves the contract code of the provided code hash.
ReadDatabaseVersion retrieves the version number of the database.
ReadHeadBlock returns the current canonical head block.
ReadHeadBlockHash retrieves the hash of the current canonical head block.
ReadHeader retrieves the block header corresponding to the hash.
ReadHeaderNumber returns the header number assigned to a hash.
ReadHeaderRLP retrieves a block header in its raw RLP database encoding.
ReadHeadHeaderHash retrieves the hash of the current canonical head header.
ReadLegacyTrieNode retrieves the legacy trie node with the given associated node hash.
ReadLogs retrieves the logs for all transactions in a block.
ReadOfflinePruning reads the most recent timestamp of an attempt to run offline pruning if present.
ReadPersistentStateID retrieves the id of the persistent state from the database.
ReadPopulateMissingTries reads the most recent timestamp of an attempt to re-populate missing trie nodes.
ReadPreimage retrieves a single preimage of the provided hash.
ReadRawReceipts retrieves all the transaction receipts belonging to a block.
ReadReceipt retrieves a specific transaction receipt from the database, along with its added positional metadata.
ReadReceipts retrieves all the transaction receipts belonging to a block, including its corresponding metadata fields.
ReadReceiptsRLP retrieves all the transaction receipts belonging to a block in RLP encoding.
ReadSnapshotBlockHash retrieves the hash of the block whose state is contained in the persisted snapshot.
ReadSnapshotGenerator retrieves the serialized snapshot generator saved at the last shutdown.
ReadSnapshotRoot retrieves the root of the block whose state is contained in the persisted snapshot.
ReadStateID retrieves the state id with the provided state root.
ReadStateScheme reads the state scheme of persistent state, or none if the state is not present in database.
ReadStorageSnapshot retrieves the snapshot entry of an storage trie leaf.
ReadStorageTrieNode retrieves the storage trie node and the associated node hash with the specified node path.
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.
ReadTimeMarker reads the timestamp stored at [key].
ReadTransaction retrieves a specific transaction from the database, along with its added positional metadata.
ReadTrieJournal retrieves the serialized in-memory trie nodes of layers saved at the last shutdown.
ReadTrieNode retrieves the trie node from database with the provided node info and associated node hash.
ReadTxIndexTail retrieves the number of oldest indexed block whose transaction indices has been indexed.
ReadTxLookupEntry retrieves the positional metadata associated with a transaction hash to allow retrieving the transaction or receipt by hash.
ResolveAccountTrieNodeKey reports whether a provided database entry is an account trie node in path-based state scheme, and returns the resolved node path if so.
ResolveStorageTrieNode reports whether a provided database entry is a storage trie node in path-based state scheme, and returns the resolved account hash and node path if so.
UnindexTransactions removes txlookup indices of the specified block range.
UnpackSyncPerformedKey returns the block number from keys the iterator returned from NewSyncPerformedIterator.
UnpackSyncSegmentKey returns the root and start position for a trie segment key returned from NewSyncSegmentsIterator.
UnpackSyncStorageTrieKey returns the root and account for a storage trie key returned from NewSyncStorageTriesIterator.
UpdateUncleanShutdownMarker updates the last marker's timestamp to now.
WriteAcceptorTip writes [hash] as the last accepted block that has been fully processed.
WriteAccountSnapshot stores the snapshot entry of an account trie leaf.
WriteAccountTrieNode writes the provided account trie node into database.
WriteBlock serializes a block into the database, header and body separately.
WriteBloomBits stores the compressed bloom bits vector belonging to the given section and bit index.
WriteBody stores a block body into the database.
WriteBodyRLP stores an RLP encoded block body into the database.
WriteCanonicalHash stores the hash assigned to a canonical block number.
WriteChainConfig writes the chain config settings to the database.
WriteCode writes the provided contract code database.
WriteDatabaseVersion stores the version number of the database.
WriteHeadBlockHash stores the head block's hash.
WriteHeader stores a block header into the database and also stores the hash- to-number mapping.
WriteHeaderNumber stores the hash->number mapping.
WriteHeadHeaderHash stores the hash of the current canonical head header.
WriteLegacyTrieNode writes the provided legacy trie node to database.
WriteOfflinePruning writes a 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.
WritePersistentStateID stores the id of the persistent state into database.
WritePopulateMissingTries writes a marker for the current attempt to populate missing tries.
WritePreimages writes the provided set of preimages to the database.
WritePruningDisabled writes a marker to track whether the node has ever run with pruning disabled.
WriteReceipts stores all the transaction receipts belonging to a block.
WriteSnapshotBlockHash stores the root of the block whose state is contained in the persisted snapshot.
WriteSnapshotGenerator stores the serialized snapshot generator to save at shutdown.
WriteSnapshotRoot stores the root of the block whose state is contained in the persisted snapshot.
WriteStateID writes the provided state lookup to database.
WriteStorageSnapshot stores the snapshot entry of an storage trie leaf.
WriteStorageTrieNode writes the provided storage trie node into database.
WriteSyncPerformed logs an entry in [db] indicating the VM state synced to [blockNumber].
WriteSyncRoot writes root as the root of the main trie of the in-progress sync.
WriteSyncSegment adds a trie segment for root at the given start position.
WriteSyncStorageTrie adds a storage trie for account (with the given root) to be synced.
WriteTimeMarker writes a marker of the current time in the db at [key].
WriteTrieJournal stores the serialized in-memory trie nodes of layers to save at shutdown.
WriteTrieNode writes the trie node into database with the provided node info and associated node hash.
WriteTxIndexTail stores the number of oldest indexed block into database.
WriteTxLookupEntries is identical to WriteTxLookupEntry, but it works on a list of hashes.
WriteTxLookupEntriesByBlock stores a positional metadata for every transaction from a block, enabling hash based transaction and receipt lookups.

# Constants

HashScheme is the legacy hash-based state scheme with which trie nodes are stored in the disk with node hash as the database key.
PathScheme is the new path-based state scheme with which trie nodes are stored in the disk with node path as the database key.

# Variables

BloomBitsIndexPrefix is the data table of a chain indexer to track its progress.
CodePrefix + code hash -> account code.
CodeToFetchPrefix + code hash -> empty value tracks the outstanding code hashes we need to fetch.
PreimagePrefix + hash -> preimage.
SnapshotAccountPrefix + account hash -> account trie value.
SnapshotStoragePrefix + account hash + storage hash -> storage trie value.

# Structs

KeyLengthIterator is a wrapper for a database iterator that ensures only key-value pairs with a specific key length will be returned.
LegacyTxLookupEntry is the legacy TxLookupEntry definition with some unnecessary fields.
No description provided by the author
OpenOptions contains the options to apply when opening a database.