From 0b10263dd5f3a47a37d08034eeba7c75b980cba5 Mon Sep 17 00:00:00 2001 From: 0xalex88 <113263502+0xalex88@users.noreply.github.com> Date: Fri, 30 Jun 2023 23:37:39 +0200 Subject: [PATCH] Increase validator client startup proposer settings deadline (#12533) Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> --- validator/client/runner.go | 2 +- validator/client/runner_test.go | 25 ------------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/validator/client/runner.go b/validator/client/runner.go index d4929692c..afe548e64 100644 --- a/validator/client/runner.go +++ b/validator/client/runner.go @@ -58,7 +58,7 @@ 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) - deadline := time.Now().Add(time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second) + deadline := time.Now().Add(5 * time.Minute) if err := v.PushProposerSettings(ctx, km, headSlot, deadline); err != nil { if errors.Is(err, ErrBuilderValidatorRegistration) { log.WithError(err).Warn("Push proposer settings error") diff --git a/validator/client/runner_test.go b/validator/client/runner_test.go index a83b6de1a..2926f2e4e 100644 --- a/validator/client/runner_test.go +++ b/validator/client/runner_test.go @@ -248,31 +248,6 @@ func TestUpdateProposerSettingsAt_EpochStart(t *testing.T) { assert.LogsContain(t, hook, "updated proposer settings") } -func TestUpdateProposerSettingsAt_EpochEndExceeded(t *testing.T) { - v := &testutil.FakeValidator{Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, ProposerSettingWait: time.Duration(params.BeaconConfig().SecondsPerSlot+1) * time.Second} - err := v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{ - DefaultConfig: &validatorserviceconfig.ProposerOption{ - FeeRecipientConfig: &validatorserviceconfig.FeeRecipientConfig{ - FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"), - }, - }, - }) - require.NoError(t, err) - ctx, cancel := context.WithCancel(context.Background()) - hook := logTest.NewGlobal() - slot := params.BeaconConfig().SlotsPerEpoch - 1 //have it set close to the end of epoch - ticker := make(chan primitives.Slot) - v.NextSlotRet = ticker - go func() { - ticker <- slot - cancel() - }() - - run(ctx, v) - // can't test "Failed to update proposer settings" because of log.fatal - assert.LogsContain(t, hook, "deadline exceeded") -} - func TestUpdateProposerSettingsAt_EpochEndOk(t *testing.T) { v := &testutil.FakeValidator{Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, ProposerSettingWait: time.Duration(params.BeaconConfig().SecondsPerSlot-1) * time.Second} err := v.SetProposerSettings(context.Background(), &validatorserviceconfig.ProposerSettings{