-
Notifications
You must be signed in to change notification settings - Fork 810
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
[Merged by Bors] - use state cache to optimise historical state lookup #4228
Conversation
@michaelsproul PTAL :) |
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.
Looks like it's heading in the right direction. Have you done any manual testing to see how the performance is? E.g. try requesting a state at slot 8190 in the period, then request the state one slot later. The 2nd request should be almost instant.
Once the change to the low restore point is made I'll do some testing myself
@int88 Do you mind renaming the flag to The implementation is looking really good though, thanks for your efforts! 😊 |
@michaelsproul updated :) |
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 just tested the performance improvement on one of my archive nodes and it was fantastic!
First I loaded state 6336000 which took 65 seconds:
$ time ssz_state.sh 6336000 > /dev/null
Executed in 65.82 secs fish external
usr time 1.31 millis 400.00 micros 0.91 millis
sys time 15.44 millis 128.00 micros 15.31 millis
Re-loading the same state from the cache took only 250ms!
time ssz_state.sh 6336000 > /dev/null
________________________________________________________
Executed in 259.70 millis fish external
usr time 12.04 millis 219.00 micros 11.82 millis
sys time 22.69 millis 74.00 micros 22.62 millis
Loading the state at the next slot was also really fast, around 650ms:
time ssz_state.sh 6336001 > /dev/null
________________________________________________________
Executed in 654.11 millis fish external
usr time 13.86 millis 320.00 micros 13.54 millis
sys time 17.80 millis 111.00 micros 17.69 millis
This is so awesome I think we should add it to the book. I think a section on this page would be appropriate (maybe with a warning that it can use a lot of memory): https://lighthouse-book.sigmaprime.io/advanced_database.html
Awesome test! And do you mean add the usage of flag |
Just the description of the flag I think 😁 Thanks! |
@michaelsproul updated! |
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 just tweaked the docs slightly, but happy to merge!
Thank you @int88 for implementing this long-awaited feature!
bors r+ |
## Issue Addressed #3873 ## Proposed Changes add a cache to optimise historical state lookup. ## Additional Info N/A Co-authored-by: Michael Sproul <micsproul@gmail.com>
Pull request successfully merged into unstable. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page.
|
## Issue Addressed sigp#3873 ## Proposed Changes add a cache to optimise historical state lookup. ## Additional Info N/A Co-authored-by: Michael Sproul <micsproul@gmail.com>
add a cache to optimise historical state lookup. N/A Co-authored-by: Michael Sproul <micsproul@gmail.com>
add a cache to optimise historical state lookup. N/A Co-authored-by: Michael Sproul <micsproul@gmail.com>
Issue Addressed
#3873
Proposed Changes
add a cache to optimise historical state lookup.
Additional Info
N/A