@ -98,4 +98,4 @@ Updating Geth to the latest version simply requires stopping the node, downloadi
## What is a preimage?
Geth stores the Ethereum state in a [Patricia Merkle Trie](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/#state-trie). It contains `(key,value)` pairs with account addresses as keys and and [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/#top) encoded `account` as the value, where an account is an array containing essential account information, specifically: `nonce`, `balance`, `StorageRoot` and `codeHash`. Definitions for these parameters are available in the Ethereum whitepaper. However, Geth's state trie does not use the keys directly, instead account information is indexed using the SHA3 hash of the key. This means that looking up the account information for an address can be done by traversing the trie for `sha3(address)`, but querying addresses that contain certain data is not possible - the addresses themselves are not part of the trie. This problem is solved using preimages - these are mappings of addresses to their hashes. Geth generates these preimages during block-by-block sync as information is added to the trie but they are deleted once they reach a certain age (128 blocks by default). To retain the preimages, Geth should be started with `--cache.preimages=true`.
Geth stores the Ethereum state in a [Patricia Merkle Trie](https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/#state-trie). It contains `(key,value)` pairs with account addresses as keys and and [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/#top) encoded `account` as the value, where an account is an array containing essential account information, specifically: `nonce`, `balance`, `StorageRoot` and `codeHash`. Definitions for these parameters are available in the Ethereum whitepaper. However, Geth's state trie does not use the keys directly, instead account information is indexed using the SHA3 hash of the key. This means that looking up the account information for an address can be done by traversing the trie for `sha3(address)`, but querying addresses that contain certain data is not possible - the addresses themselves are not part of the trie. This problem is solved using preimages - these are mappings of addresses to their hashes. Geth generates these preimages during block-by-block sync as information is added to the trie but they are deleted once they reach a certain age (128 blocks by default). To retain the preimages, Geth should be started with `--cache.preimages=true`.