-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
perf(tree): add cross-block caching #13769
base: main
Are you sure you want to change the base?
Conversation
3507aed
to
65428f5
Compare
65428f5
to
a39ba9b
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.
cool, this actually looks pretty simple
because this is a concurrent one, this means we can also populate the cache from anywhere?
lets hope the metrics look good.
I also wonder if we should think about making these features dependent on certain core counts, I assume there's a point where this could become counter productive if node is run on a low end machine (like a raspberry pi)
let Ok(saved_cache) = state_provider.save_cache(sealed_block.hash(), &output.state) else { | ||
todo!("error bubbling for save_cache errors") | ||
}; | ||
self.most_recent_cache = Some(saved_cache); |
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.
should we even do error handling here?
we could just reset to None?
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.
true, yeah let's just reset in this case
This reverts commit 11b4891.
Yes! Although this does mean we need to be careful when applying the state updates, we need to make sure nothing is relying on the caches before we update |
This adds cross-block caching, just keeping the most recent cache in memory for reuse. The cached state provider has a
save_caches
method which applies state updates to the account and storage caches.When we implement prewarming, we will need to stop and clean up the prewarm threads before saving the caches. It's probably a good idea to do this anyways before the state root task starts, since we should be done prewarming when execution finishes.
ref #13713