-
Notifications
You must be signed in to change notification settings - Fork 5
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
enha + fix: possible storage bug and remove states vec from inmemory temporary storage #1904
Conversation
…y temprary storage
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Final benchmark: Git Info:
Configuration:
RPS Stats: Max: 1244.00, Min: 767.00, Avg: 1099.94, StdDev: 70.23 Plot: View Plot |
With the introduction of the storage cache #1887 we made it so the inmemory temporary storage only held one block in its block Vec. However this combined with #1888 introduces a possibly critical bug. When the pending block is evicted from the temporary storage it takes a few ms to be committed to the permanent storage, however executions can still happen in the interim and if an execution tries to read a slot/account that has not yet been committed to the permanent but has already been evicted from the temporary it would get the wrong value.
The cache implementation masks this bug pretty well, since all the recent changes will probably be in the cache, however it is not guaranteed that it won't evict some slot/account before we have committed the block to the permanent storage, and therefore we should not rely on it for this purpose.
This PR makes it so the temporary storage holds 2 blocks, the pending block, and the latest to avoid this issue.