erigontech / erigontech/silkworm

Inefficient TxLookup prune

Open
#424 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
318
Forks
84
PR merge metrics
No merged PRs in 30d

Description

The [prune function for tx lookups](https://github.com/torquem-ch/silkworm/blob/master/node/silkworm/stagedsync/stage_tx_lookup.cpp#L194-L217) seems to me quite inefficient.

Basically it **traverses all records** from `BlockTransactionLookup` bucket in search of linked block numbers which are below the pruning threshold. That table has hundreds of millions records.

I believe a more efficient approach is to load transaction hashes from to-be-pruned blocks and delete records by transaction hash which is the **key** of `BlockTransactionLookup` bucket

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.