From 01a98a4582e048cc2ad998269e74ee7daeeb4494 Mon Sep 17 00:00:00 2001 From: Giulio rebuffo Date: Tue, 17 May 2022 15:26:47 +0200 Subject: [PATCH] fixed finalized portion (#4181) --- ethdb/privateapi/ethbackend.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ethdb/privateapi/ethbackend.go b/ethdb/privateapi/ethbackend.go index c00d45d5b..d4b3f499c 100644 --- a/ethdb/privateapi/ethbackend.go +++ b/ethdb/privateapi/ethbackend.go @@ -470,14 +470,20 @@ func (s *EthBackendServer) EngineForkChoiceUpdatedV1(ctx context.Context, req *r }, nil } - log.Trace("[ForkChoiceUpdated] sending forkChoiceMessage", "head", forkChoice.HeadBlockHash) - s.requestList.AddForkChoiceRequest(&forkChoice) + payloadStatus := PayloadStatus{ + Status: remote.EngineStatus_VALID, + } - payloadStatus := <-s.statusCh - log.Trace("[ForkChoiceUpdated] got reply", "payloadStatus", payloadStatus) + if (forkChoice.HeadBlockHash != common.Hash{} || forkChoice.HeadBlockHash != common.Hash{}) { + log.Trace("[ForkChoiceUpdated] sending forkChoiceMessage", "head", forkChoice.HeadBlockHash) + s.requestList.AddForkChoiceRequest(&forkChoice) - if payloadStatus.CriticalError != nil { - return nil, payloadStatus.CriticalError + payloadStatus = <-s.statusCh + log.Trace("[ForkChoiceUpdated] got reply", "payloadStatus", payloadStatus) + + if payloadStatus.CriticalError != nil { + return nil, payloadStatus.CriticalError + } } // No need for payload building