Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in-memory Ledger State mode #4556

Open
SirTyson opened this issue Nov 22, 2024 · 0 comments
Open

Add in-memory Ledger State mode #4556

SirTyson opened this issue Nov 22, 2024 · 0 comments
Assignees

Comments

@SirTyson
Copy link
Contributor

With the rollout of State Archival, there will be significantly less state in the "Live BucketList" that actually needs to be queried during TX validation and application. Additionally, this amount of state is limited at the protocol level via config settings.

Due to this small, limited size, it makes sense to cache all live state in memory. While we won't be able to cache all state in production until classic entry types are evicted, we will be able to cache all Soroban entries. Additionally, this mode would be helpful in max TPS and catchup tests, where we can test future scenarios assuming classic entry eviction.

I think the best way to do this is to create a single map/some other structure that holds all ledger state in memory. On startup, this structure will be populated during the assumeState function call. All reads will be based on this cache, and all write/deletes will also be implemented (this should probably be handled by LedgerManager or LedgerTxnRoot). Note that we will still need to write all state to the BucketList. Additionally, offers will still need to be in SQL due to the indexes we require for the offer table. However, we can use an in-memory SQL DB for testing in this mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants