-
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
validator startup deadline bug #12049
Conversation
need to add tests |
validator/client/validator.go
Outdated
deadline := v.SlotDeadline(slots.RoundUpToNearestEpoch(slots.CurrentSlot(v.genesisTime))) | ||
ctx, cancel := context.WithDeadline(ctx, deadline) | ||
var deadline time.Time | ||
if len(overrideDeadline) > 0 && overrideDeadline[0] > 0*time.Second { |
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 not just provide the deadline into the main loop ? rather than doing it this way where you have it as an optional parameter
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.
updated based on slack discussion on this feedback.
//deadline set for next epoch rounded up | ||
if err := v.PushProposerSettings(ctx, km); err != nil { | ||
//deadline set for end of epoch | ||
epochDeadline := v.SlotDeadline(slot + params.BeaconConfig().SlotsPerEpoch - 1) |
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 doesn't seem like the end of the epoch, if I am understanding this correctly. If our current slot is 20 , then we would use 51 as the slot for the deadline. However the end of the current epoch would be at the end of slot 31 and not 51. As 51 comes under the next epoch
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.
it shouldn't run on slot 20 as the if statement above checks if the slot is epoch start. hope I'm thinking about that correctly..
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
tries to set the deadline for the first run of the pushProposerSettings when very close to the end of epoch to a constant time.
Which issues(s) does this PR fix?
Fixes #12000