Update committee cache#16814
Merged
Merged
Conversation
0c6ffe9 to
e6c9ce5
Compare
4 tasks
pull Bot
pushed a commit
to Hawthorne001/prysm
that referenced
this pull request
May 19, 2026
…OffchainLabs#16816) **What type of PR is this?** Bug fix **What does this PR do? Why is it needed?** **Which issues(s) does this PR fix?** This PR workarounds this issue: - OffchainLabs#16809 The real fix is in this PR: - OffchainLabs#16814 **Acknowledgements** - [x] I have read [CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md). - [x] I have included a uniquely named [changelog fragment file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd). - [x] I have added a description with sufficient context for reviewers to understand this PR. - [x] I have tested that my changes work as expected and I added a testing plan to the PR description (if applicable).
potuz
previously approved these changes
May 20, 2026
potuz
left a comment
Contributor
There was a problem hiding this comment.
The PR looks good to me, my worry here is the fact that we move to unshuffle in the background and it makes it hard to diagnose if we are doing unnecessary work or not. We are still diagnosing the underlying issue that prompted this PR.
Comment on lines
-525
to
-528
| }); err != nil { | ||
| return err | ||
| } | ||
| return nil |
Contributor
There was a problem hiding this comment.
This previous pattern is a genius of modern computer science :)
Comment on lines
+748
to
+749
| working := make([]primitives.ValidatorIndex, len(indices)) | ||
| copy(working, indices) |
Contributor
Author
There was a problem hiding this comment.
Ho nice! I did not even know this function.
| ) | ||
|
|
||
| var ( | ||
| CommitteeCacheInProgressHit = promauto.NewCounter(prometheus.CounterOpts{ |
Contributor
There was a problem hiding this comment.
Do we want to have another metric to track contention?
potuz
approved these changes
Jun 2, 2026
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.
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
Before this PR,
ActiveValidatorIndicesandActiveValidatorCountupdates the committee cache in a synchronous fashion before returning, even if these 2 functions do not depend on this cache update.This leads to two issues:
This PR updates the committee cache asynchronously in the
ActiveValidatorIndicesandActiveValidatorCountfunctions, solving the points 1 and 2.Note
Ideally, the context used in
fillCommitteeCacheAsyncshould be the service context, to ensure fast stop in case of node shutdown. However, doing this would change a lot of signatures functions to pass down the context. We chose instead to use a background context with a timeout.Note
Before this PR,
committeeCache.ActiveIndicesCountandcommitteeCache.ActiveIndiceswhere blocking if an update was already in progress. With this PR, these functions are not blocking any more, but the blocking feature is now moved into the only respective caller functionsActiveValidatorIndicesandActiveValidatorCount.Which issues(s) does this PR fix?
Other notes for review
Vertical blue line is node restart.
Vertical red line is the
Could not update committee cacheerror.On the left:
V7.1.4-rc.1+ this fixOn the right:
V7.1.4-rc.1Acknowledgements