[Merged by Bors] - Use forwards iterator for state root lookups#2422
Closed
macladson wants to merge 5 commits intosigp:unstablefrom
Closed
[Merged by Bors] - Use forwards iterator for state root lookups#2422macladson wants to merge 5 commits intosigp:unstablefrom
macladson wants to merge 5 commits intosigp:unstablefrom
Conversation
Member
Author
|
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.
|
michaelsproul
approved these changes
Jul 6, 2021
Member
michaelsproul
left a comment
There was a problem hiding this comment.
This looks great!
I think we can merge this before altair, and then I'll sort out the merge conflicts
Member
|
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Jul 6, 2021
## 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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_rootsandrev_iter_block_rootshave been refactored to use theirforwardsversions instead.rev_iter_state_rootsandrev_iter_block_rootsfunctions are now unused and have been removed.state_at_slotfunction has been changed to use theforwardsiterator.Additional Info
forwards_iterversions. These tests start their iteration from a specific beacon state and thus use therev_iter_state_roots_fromandrev_iter_block_roots_fromfunctions. If they can be refactored, those functions can also be removed.