-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add a justified balance getter to forkchoice #11513
Conversation
epoch := time.CurrentEpoch(st) | ||
|
||
balances := make([]uint64, st.NumValidators()) | ||
var balanceAccumulator = func(idx int, val state.ReadOnlyValidator) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why call this an accumulator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you tell me, you wrote that code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh well, let's fix it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we're just creating the ability to set this and doing so in stategen, not using it yet. LGTM!
This PR adds a handler to forkchoice to request justified balances only when the justified checkpoint has changed instead of receiving this information on every call to Head. At this moment this is a setter function that just sets this handler and an implementation in the stategen package.