package
1.15.2
Repository: https://github.com/ethereum/go-ethereum.git
Documentation: pkg.go.dev

# Packages

# Functions

DeleteAccountSnapshot removes the snapshot entry of an account trie leaf.
DeleteAccountTrieNode deletes the specified account trie node from the database.
DeleteBadBlocks deletes all the bad blocks 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.
DeleteHeader removes all block header data associated with a hash.
DeleteHeaderNumber removes hash->number mapping.
DeleteLegacyTrieNode deletes the specified legacy trie node from database.
DeleteReceipts removes all receipt data associated with a block hash.
DeleteSkeletonHeader removes all block header data associated with a hash.
DeleteSkeletonSyncStatus deletes the serialized sync status saved at the last shutdown.
DeleteSnapshotDisabled deletes the flag keeping the snapshot maintenance disabled.
DeleteSnapshotGenerator deletes the serialized snapshot generator saved at the last shutdown.
DeleteSnapshotJournal deletes the serialized in-memory diff layers saved at the last shutdown.
DeleteSnapshotRecoveryNumber deletes the block number of the last persisted snapshot layer.
DeleteSnapshotRoot deletes the hash 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 a storage trie leaf.
DeleteStorageTrieNode deletes the specified storage trie node from the database.
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.
DeleteTxLookupEntries removes all transaction lookups for a given block.
DeleteTxLookupEntry removes all transaction data associated with a hash.
FindCommonAncestor returns the last common ancestor of two block headers.
HasAccountTrieNode checks the presence of the account trie node with the specified node path, regardless of the 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.
HasCodeWithPrefix 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.
HasReceipts verifies the existence of all the transaction receipts belonging to a block.
HasStorageTrieNode checks the presence of the storage trie node with the specified account hash and node path, regardless of the 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.
InitDatabaseFromFreezer reinitializes an empty database from a previous batch of frozen ancient blocks.
InspectDatabase traverses the entire database and checks the size of all different categories of data.
InspectFreezerTable dumps out the index of a specific freezer table.
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.
IterateStorageSnapshots returns an iterator for walking the entire storage space of a specific account.
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.
NewDatabaseWithFreezer creates a high level database on top of a given key- value data store with a freezer moving immutable chain segments into cold storage.
NewFreezer creates a freezer instance for maintaining immutable ordered data according to the given parameters.
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.
NewMemoryDatabase creates an ephemeral in-memory key-value database without a freezer moving immutable chain segments into cold storage.
NewMemoryFreezer initializes an in-memory freezer instance.
NewStateFreezer initializes the ancient store for state history.
NewTable returns a database object that prefixes all keys with a given string.
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.
ReadAccountSnapshot retrieves the snapshot entry of an account trie leaf.
ReadAccountTrieNode retrieves the account trie node with the specified node path.
ReadAllBadBlocks retrieves all the bad blocks in the database.
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.
ReadBadBlock retrieves the bad block with the corresponding block hash.
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.
ReadChainMetadata returns a set of key/value pairs that contains information about the database chain status.
ReadCode retrieves the contract code of the provided code hash.
ReadCodeWithPrefix retrieves the contract code of the provided code hash.
ReadDatabaseVersion retrieves the version number of the database.
ReadFinalizedBlockHash retrieves the hash of the finalized block.
ReadGenesisStateSpec retrieves the genesis state specification based on the given genesis (block-)hash.
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.
ReadHeaderRange returns the rlp-encoded headers, starting at 'number', and going backwards towards genesis.
ReadHeaderRLP retrieves a block header in its raw RLP database encoding.
ReadHeadFastBlockHash retrieves the hash of the current fast-sync head block.
ReadHeadHeader returns the current canonical head header.
ReadHeadHeaderHash retrieves the hash of the current canonical head header.
ReadLastPivotNumber retrieves the number of the last pivot block.
ReadLegacyTrieNode retrieves the legacy trie node with the given associated node hash.
ReadLogs retrieves the logs for all transactions in a block.
ReadPersistentStateID retrieves the id of the persistent state from the database.
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.
ReadSkeletonHeader retrieves a block header from the skeleton sync store,.
ReadSkeletonSyncStatus retrieves the serialized sync status saved at shutdown.
ReadSnapshotDisabled retrieves if the snapshot maintenance is disabled.
ReadSnapshotGenerator retrieves the serialized snapshot generator saved at the last shutdown.
ReadSnapshotJournal retrieves the serialized in-memory diff layers saved at the last shutdown.
ReadSnapshotRecoveryNumber retrieves the block number of the last persisted snapshot layer.
ReadSnapshotRoot retrieves the root of the block whose state is contained in the persisted snapshot.
ReadSnapshotSyncStatus retrieves the serialized sync status saved at shutdown.
ReadSnapSyncStatusFlag retrieves the state snap sync status flag.
ReadStateAccountHistory retrieves the state root corresponding to the specified state history.
ReadStateAccountIndex retrieves the state root corresponding to the specified state history.
ReadStateHistory retrieves the state history from database with provided id.
ReadStateHistoryMeta retrieves the metadata corresponding to the specified state history.
ReadStateHistoryMetaList retrieves a batch of meta objects with the specified start position and count.
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.
ReadStateStorageHistory retrieves the state root corresponding to the specified state history.
ReadStateStorageIndex retrieves the state root corresponding to the specified state history.
ReadStorageSnapshot retrieves the snapshot entry of a storage trie leaf.
ReadStorageTrieNode retrieves the storage trie node with the specified node path.
ReadTransaction retrieves a specific transaction from the database, along with its added positional metadata.
ReadTransitionStatus retrieves the eth2 transition status from the database.
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.
UpdateUncleanShutdownMarker updates the last marker's timestamp to now.
WriteAccountSnapshot stores the snapshot entry of an account trie leaf.
WriteAccountTrieNode writes the provided account trie node into database.
WriteAncientBlocks writes entire block data into ancient store and returns the total written size.
WriteBadBlock serializes the bad block into the 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.
WriteFinalizedBlockHash stores the hash of the finalized block.
WriteGenesisStateSpec writes the genesis state specification into the disk.
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.
WriteHeadFastBlockHash stores the hash of the current fast-sync head block.
WriteHeadHeaderHash stores the hash of the current canonical head header.
WriteLastPivotNumber stores the number of the last pivot block.
WriteLegacyTrieNode writes the provided legacy trie node to database.
WritePersistentStateID stores the id of the persistent state into database.
WritePreimages writes the provided set of preimages to the database.
WriteReceipts stores all the transaction receipts belonging to a block.
WriteSkeletonHeader stores a block header into the skeleton sync store.
WriteSkeletonSyncStatus stores the serialized sync status to save at shutdown.
WriteSnapshotDisabled stores the snapshot pause flag.
WriteSnapshotGenerator stores the serialized snapshot generator to save at shutdown.
WriteSnapshotJournal stores the serialized in-memory diff layers to save at shutdown.
WriteSnapshotRecoveryNumber stores the block number of the last persisted snapshot layer.
WriteSnapshotRoot stores the root of the block whose state is contained in the persisted snapshot.
WriteSnapshotSyncStatus stores the serialized sync status to save at shutdown.
WriteSnapSyncStatusFlag stores the state snap sync status flag into database.
WriteStateHistory writes the provided state history to database.
WriteStateID writes the provided state lookup to database.
WriteStorageSnapshot stores the snapshot entry of a storage trie leaf.
WriteStorageTrieNode writes the provided storage trie node into database.
WriteTransitionStatus stores the eth2 transition status to the database.
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.
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

ChainFreezerBodiesTable indicates the name of the freezer block body table.
ChainFreezerHashTable indicates the name of the freezer canonical hash table.
ChainFreezerHeaderTable indicates the name of the freezer header table.
ChainFreezerReceiptTable indicates the name of the freezer receipts table.
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.
flags the state snap sync is completed.
flags the state snap sync is not completed yet.
flags the state snap sync is unknown.

# Variables

bigEndian64(syncPeriod) -> RLP(types.LightClientUpdate) (nextCommittee only referenced by root hash).
BloomBitsIndexPrefix is the data table of a chain indexer to track its progress.
The fields below define the low level database schema prefixing.
BloomTriePrefix + bloomTrieNum (uint64 big endian) -> trie root hash.
The fields below define the low level database schema prefixing.
the folder name of chain segment ancient store.
The fields below define the low level database schema prefixing.
ChtPrefix + chtNum (uint64 big endian) -> trie root hash.
The fields below define the low level database schema prefixing.
The fields below define the low level database schema prefixing.
CodePrefix + code hash -> account code.
bigEndian64(syncPeriod) -> committee root hash.
the folder name of state history ancient store.
PreimagePrefix + hash -> preimage.
SnapshotAccountPrefix + account hash -> account trie value.
SnapshotRootKey tracks the hash of the last snapshot.
SnapshotStoragePrefix + account hash + storage hash -> storage trie value.
bigEndian64(syncPeriod) -> serialized committee.
TrieNodeAccountPrefix + hexPath -> trie node.
TrieNodeStoragePrefix + accountHash + hexPath -> trie node.
VerklePrefix is the database prefix for Verkle trie data, which includes: (a) Trie nodes (b) In-memory trie node journal (c) Persistent state ID (d) State ID lookups, etc.
the folder name of state history ancient store.

# Structs

Freezer is an append-only database to store immutable ordered data into flat files: - The append-only nature ensures that disk writes are minimized.
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.
MemoryFreezer is an ephemeral ancient store.