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

Use Read Only Head State When Computing Active Indices #14592

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Oct 30, 2024

What type of PR is this?

Optimization

What does this PR do? Why is it needed?

When computing the current active validator count, we do not need to perform a state copy. This is very expensive when it is run in high traffic paths. Instead we use a read only state to be able to perform the computation.
image

image

By reducing the number of state copies, we can reduce the amount of memory allocated in large networks such as holesky by about 500mb.

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have made an appropriate entry to CHANGELOG.md.
  • I have added a description to this PR with sufficient context for reviewers to understand this PR.

@nisdas nisdas added the Ready For Review A pull request ready for code review label Oct 30, 2024
@nisdas nisdas requested a review from a team as a code owner October 30, 2024 07:39
Copy link
Contributor

@saolyn saolyn left a comment

Choose a reason for hiding this comment

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

LGTM

@rkapka rkapka added this pull request to the merge queue Oct 31, 2024
Merged via the queue into develop with commit 6b7dd83 Oct 31, 2024
18 checks passed
@rkapka rkapka deleted the useReadOnlyHeadState branch October 31, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants