Improve historical query cache
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.
Related to https://github.com/microsoft/CCF/issues/3234
Current oe_sign.conf file https://github.com/microsoft/scitt-ccf-ledger/blob/main/app/oe_sign.conf
CCF doc on memory setting in the file https://microsoft.github.io/CCF/main/operations/resource_usage.html#memory
Openenclave docs on the use of the configuration in this file https://github.com/openenclave/openenclave/blob/master/docs/GettingStartedDocs/buildandsign.md#signing-an-sgx-enclave
A set_soft_cache_limit() API was added to CCF in https://github.com/microsoft/CCF/pull/6282, to allow applications to easily set a limit.
Some of the code in historical_queries_adapter.h can be unwound in favour of setting a soft cache limit on the historical state, as is done in https://github.com/maxtropets/CCF/blob/8db27adc7b318cab2bed3257d0ef710eb2998cc0/samples/apps/logging/logging.cpp#L467