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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion validator/client/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ func run(ctx context.Context, v iface.Validator) {
if v.ProposerSettings() != nil {
log.Infof("Validator client started with provided proposer settings that sets options such as fee recipient"+
" and will periodically update the beacon node and custom builder (if --%s)", flags.EnableBuilderFlag.Name)
if err := v.PushProposerSettings(ctx, km); err != nil {
deadline := 12 * time.Second
james-prysm marked this conversation as resolved.
Show resolved Hide resolved
nctx, _ := context.WithTimeout(ctx, deadline)
if err := v.PushProposerSettings(nctx, km); err != nil {
if errors.Is(err, ErrBuilderValidatorRegistration) {
log.WithError(err).Warn("Push proposer settings error")
} else {
Expand Down
9 changes: 6 additions & 3 deletions validator/client/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,12 @@ func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKey
if km == nil {
return errors.New("keymanager is nil when calling PrepareBeaconProposer")
}

deadline := v.SlotDeadline(slots.RoundUpToNearestEpoch(slots.CurrentSlot(v.genesisTime)))
ctx, cancel := context.WithDeadline(ctx, deadline)
deadline, deadlineSet := ctx.Deadline()
if !deadlineSet {
deadline = v.SlotDeadline(slots.RoundUpToNearestEpoch(slots.CurrentSlot(v.genesisTime)))
}
nctx, cancel := context.WithDeadline(ctx, deadline)
ctx = nctx
defer cancel()

pubkeys, err := km.FetchValidatingPublicKeys(ctx)
Expand Down