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 a Validator Reader When Computing Unrealized Balances #13656

Merged
merged 5 commits into from
Feb 24, 2024
Merged

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Feb 23, 2024

What type of PR is this?

Optimization

What does this PR do? Why is it needed?

This PR implements a validator reader interface can be use to read through the validator registry rather than using concrete objects. The benefit of this is that we do not need to perform expensive copies when running with the multivalue slice.

Which issues(s) does this PR fix?

N.A

Other notes for review

@nisdas nisdas requested a review from a team as a code owner February 23, 2024 05:30
@nisdas nisdas added the Ready For Review A pull request ready for code review label Feb 23, 2024
@@ -46,3 +51,56 @@ func UnrealizedCheckpointBalances(cp, pp []byte, validators []*ethpb.Validator,
}
return activeBalance, prevTarget, currentTarget, nil
}

// ValReader specifies an interface through which we can access the validator registry.
type ValReader interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move all these types to a new file?

@rkapka rkapka enabled auto-merge February 24, 2024 10:49
@rkapka rkapka added this pull request to the merge queue Feb 24, 2024
Merged via the queue into develop with commit 5735379 Feb 24, 2024
17 checks passed
@rkapka rkapka deleted the useValReader branch February 24, 2024 12:16
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.

2 participants