-
Notifications
You must be signed in to change notification settings - Fork 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
Fetch Initial Assignments at Genesis Slot Post ChainStart #1574
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1574 +/- ##
=========================================
Coverage ? 71.88%
=========================================
Files ? 98
Lines ? 6673
Branches ? 0
=========================================
Hits ? 4797
Misses ? 1468
Partials ? 408 |
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.
LGTM
@@ -105,8 +105,8 @@ func (v *validator) UpdateAssignments(ctx context.Context, slot uint64) error { | |||
span, ctx := opentracing.StartSpanFromContext(ctx, "validator.UpdateAssignments") | |||
defer span.Finish() | |||
|
|||
if slot%params.BeaconConfig().EpochLength != 0 { | |||
// Do nothing if not epoch start. | |||
if slot%params.BeaconConfig().EpochLength != 0 && v.assignment != nil { |
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.
This should be ||
, why wait until an epoch start if you don't have your assignments yet?
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.
Resolved offline, this is the exit condition and I misunderstood
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.
One comment
This is part of #1565
Description
Write why you are making the changes in this pull request
Our current validator code does not fetch initial assignments soon after the chain has started to begin its responsibilities. We need this in order for validators to work correctly.
Write a summary of the changes you are making
This PR modifies the update assignments function in the validator client to check to only perform an update if either it is an epoch start or is assignments are nil.