Initialize Soroban live state cache on startup #4663
Draft
+837
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Defines the cache required by #4556 and initializes it on startup.
This PR introduces the live Soroban state cache required by CAP-66 and populates it on startup. It does not yet actually use the cache, nor is the cache maintained after startup. The reason for this is that soroban parallel apply (the consumer of this cache) is still in development, and it looks like we're moving away from
ltx
state access in that work. I think it's best to hold off on implementing access and cache maintenance until the parallel apply work is in a more final state.In the meantime, this PR will add about 50 mb of RAM usage and delay startup on master for no gain, but this should be fine since 23.0 is our next planned release.
Update:
It looks like we'll be sticking with the
ltx
interface, so this PR has been updated to loadCONTRACT_DATA
entries from the cache, as well as update the cache during ledger application. TTL access and updates has not been updated yet, pending the TTL reconciliation from parallel apply.Checklist
clang-format
v8.0.0 (viamake format
or the Visual Studio extension)