microsoft/scitt-ccf-ledger

Improve historical query cache

letmaik opened this issue · 3 comments

We currently use a simple LRU cache in the historical query adapter to keep track of when to drop cached transactions to avoid going out of memory. This is based on the transaction count and is hard-coded to 100. Given that transactions have different sizes it would be more economical to use the transaction size to determine the cache size and then set a limit like 100 MiB, based on the available enclave memory set in oe_sign.conf. With small claim sizes this would effectively raise the cache limit by one or more magnitudes of transactions.