cmd/utils, eth/ethconfig: unindex txs older than ~1 year #22293
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://twitter.com/peter_szilagyi/status/1358767100995784704 .
This PR changes the default number of indexed transaction from infinite to the most recent 1 year (assuming block times of around 13-14s).
The reasoning behind this change is that currently on mainnet there are over 1 billion transactions. Just tracking the
hash->blocknummapping weighs 33GB on the database (requires SSD speeds due to the hash keying) and represents 3/5th of the database entry count, which makes trie operations and compactions exceedingly expensive.Without any form of pruning, the transaction index dataset grows indefinitely. We must bite the bullet and have normal full nodes retain meaningful history, but not indefinite.
Operators still wishing to index all transactions since genesis can run geth with
--txlookuplimit=0. The index can be reconstructed even if it was pruned, so no data is lost. The index is not needed for network health, it's just a local acceleration structure.-