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

validator startup deadline bug #12049

Merged
merged 20 commits into from
Mar 14, 2023
Merged

validator startup deadline bug #12049

merged 20 commits into from
Mar 14, 2023

Conversation

james-prysm
Copy link
Contributor

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

@james-prysm james-prysm self-assigned this Feb 24, 2023
@james-prysm james-prysm added API Api related tasks Bug Something isn't working labels Feb 24, 2023
@james-prysm james-prysm changed the title trying fix for validator startup deadline validator startup deadline bug Feb 24, 2023
@james-prysm james-prysm marked this pull request as ready for review February 27, 2023 16:29
@james-prysm james-prysm requested a review from a team as a code owner February 27, 2023 16:29
@james-prysm james-prysm marked this pull request as draft February 27, 2023 16:30
@james-prysm
Copy link
Contributor Author

need to add tests

@james-prysm james-prysm marked this pull request as ready for review March 1, 2023 05:11
@james-prysm james-prysm marked this pull request as draft March 2, 2023 21:28
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 {
Copy link
Member

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

Copy link
Contributor Author

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.

@james-prysm james-prysm marked this pull request as ready for review March 8, 2023 03:31
@james-prysm james-prysm requested a review from nisdas March 8, 2023 03:32
//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)
Copy link
Member

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

Copy link
Contributor Author

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..

nisdas
nisdas previously approved these changes Mar 9, 2023
@james-prysm james-prysm requested a review from nisdas March 10, 2023 19:57
@nisdas nisdas merged commit 7d5d30a into develop Mar 14, 2023
@delete-merged-branch delete-merged-branch bot deleted the validator-startup-fix branch March 14, 2023 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator Client Could Shut Down Prematurely
3 participants