-
Notifications
You must be signed in to change notification settings - Fork 976
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
Make read-only ledger state const #4602
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of the interface where we maintain two separate copies of SorobanNetworkConfigSettings
at the LedgerManager
level, as it sometimes unclear which method to use and can lead to tricky bugs (such as with background eviction). Given that the network settings are part of ledger state, I would still prefer threads to maintain a canonical snapshot and route all ledger based queries through that snapshot, including LedgerEntry, ledger header, and network setting accesses. That being said, I wanna get you unstuck, and am fine with this approach in the interim as we move towards more thread safety in general. To merge this I do think it would be good to clean up the new snapshot interface a bit, specifically with the maybeUpdateSnapshot
issues I raised + atomic snapshot swaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, looking good! One minor bug and a bunch of small nitpicky cleanups.
216ec60
to
2d634ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2d634ed
to
8df9a58
Compare
8df9a58
to
dbad62e
Compare
Improve access to ledger state, to better support parallelization changes in #4543
Note that management of SorobanNetworkConfig is still not great, as currently LM manages multiple versions of the config. Ideally, soroban network config lives inside of the state snapshot (either BucketList snapshot or LedgerTxn), but this was too tricky to implement at this time due to how network config is currently implemented. We may need to clean this up later.
This change also partially addresses #4318