-
Notifications
You must be signed in to change notification settings - Fork 807
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 forwards iterator for state root lookups #2422
Conversation
The improvements from this change can be seen in the graph below: I made three requests to the
I then relaunched Lighthouse with the changes and made the same three requests.
|
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.
This looks great!
I think we can merge this before altair
, and then I'll sort out the merge conflicts
bors r+ |
## Issue Addressed #2377 ## Proposed Changes Implement the same code used for block root lookups (from #2376) to state root lookups in order to improve performance and reduce associated memory spikes (e.g. from certain HTTP API requests). ## Additional Changes - Tests using `rev_iter_state_roots` and `rev_iter_block_roots` have been refactored to use their `forwards` versions instead. - The `rev_iter_state_roots` and `rev_iter_block_roots` functions are now unused and have been removed. - The `state_at_slot` function has been changed to use the `forwards` iterator. ## Additional Info - Some tests still need to be refactored to use their `forwards_iter` versions. These tests start their iteration from a specific beacon state and thus use the `rev_iter_state_roots_from` and `rev_iter_block_roots_from` functions. If they can be refactored, those functions can also be removed.
Pull request successfully merged into unstable. Build succeeded: |
Issue Addressed
#2377
Proposed Changes
Implement the same code used for block root lookups (from #2376) to state root lookups in order to improve performance and reduce associated memory spikes (e.g. from certain HTTP API requests).
Additional Changes
rev_iter_state_roots
andrev_iter_block_roots
have been refactored to use theirforwards
versions instead.rev_iter_state_roots
andrev_iter_block_roots
functions are now unused and have been removed.state_at_slot
function has been changed to use theforwards
iterator.Additional Info
forwards_iter
versions. These tests start their iteration from a specific beacon state and thus use therev_iter_state_roots_from
andrev_iter_block_roots_from
functions. If they can be refactored, those functions can also be removed.