forest icon indicating copy to clipboard operation
forest copied to clipboard

Reduce tipset cache size

Open LesnyRumcajs opened this issue 2 years ago • 0 comments

Issue summary

https://github.com/ChainSafe/forest/pull/3751 introduced a significantly larger cache to cope with performance issues for specific messages. This adds up to 1 GB overhead to Forest runtime, even though such a large cache is seldom required. Lotus is using 8k cache so we could possibly take some inspiration from their code or figure out a better way.

Using an Adaptive Replacement Cache doesn't help in this case.

The original issue could be reproduced with forest-tool snapshot compute-state --epoch 3416862 forest_snapshot_mainnet_2023-11-24_height_3416863.forest.car.zst and this snapshot.

Acceptance criteria - the aforementioned command finishes in few seconds but the cache size is significantly smaller (ideally not bigger than before).

Other information and links

LesnyRumcajs avatar Nov 28 '23 13:11 LesnyRumcajs