Summary
LRU is too expensive to keep track of hundreds-of-thousands, and certainly too expensive for millions of entries.
Changes
This PR replaces the blockheader cache with a simple map. It uses a low-iq eviction strategy that basically is just random. It also lifts the block header cache for testnet3 to 3.5M items which may prove to be too expensive. It roughly translates to 4.5G at runtime if fully used. Mainnet uses about 1G.
Summary LRU is too expensive to keep track of hundreds-of-thousands, and certainly too expensive for millions of entries.
Changes This PR replaces the blockheader cache with a simple map. It uses a low-iq eviction strategy that basically is just random. It also lifts the block header cache for testnet3 to 3.5M items which may prove to be too expensive. It roughly translates to 4.5G at runtime if fully used. Mainnet uses about 1G.