Skip to content
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] - minor optimize process_active_validator: avoid a call to state.get_validator #4608

Closed

Conversation

zhiqiangxu
Copy link
Contributor

@zhiqiangxu zhiqiangxu commented Aug 11, 2023

No description provided.

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find. It probably doesn't take too much time because indexing state.validators is O(1) on unstable, but I see no harm in making this change.

If you're interested, we're in the process of changing our state model to one with O(log n) indexing, where this would be a much greater optimisation. The participation cache is no longer used on that branch though, more info here: #3206

@michaelsproul michaelsproul added optimization Something to make Lighthouse run more efficiently. consensus An issue/PR that touches consensus code, such as state_processing or block verification. ready-for-merge This PR is ready to merge. labels Aug 11, 2023
@michaelsproul
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Aug 14, 2023
@bors
Copy link

bors bot commented Aug 14, 2023

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.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title minor optimize process_active_validator: avoid a call to state.get_validator [Merged by Bors] - minor optimize process_active_validator: avoid a call to state.get_validator Aug 14, 2023
@bors bors bot closed this Aug 14, 2023
Woodpile37 pushed a commit to Woodpile37/lighthouse that referenced this pull request Jan 6, 2024
Woodpile37 pushed a commit to Woodpile37/lighthouse that referenced this pull request Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus An issue/PR that touches consensus code, such as state_processing or block verification. optimization Something to make Lighthouse run more efficiently. ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants