From 23c4a1472acab9f4cb5fc4cd4437c4af67b7fa4f Mon Sep 17 00:00:00 2001 From: Minhyuk Kim Date: Wed, 15 May 2024 00:23:17 +0900 Subject: [PATCH] return err if ValidateChain fails --- turbo/engineapi/engine_server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/turbo/engineapi/engine_server.go b/turbo/engineapi/engine_server.go index 1937952c9d4..ee673742131 100644 --- a/turbo/engineapi/engine_server.go +++ b/turbo/engineapi/engine_server.go @@ -770,7 +770,11 @@ func (e *EngineServer) HandleNewPayload( } status, _, latestValidHash, err := e.chainRW.ValidateChain(ctx, headerHash, headerNumber) - if err != nil || status == execution.ExecutionStatus_Busy || status == execution.ExecutionStatus_TooFarAway { + if err != nil { + return nil, err + } + + if status == execution.ExecutionStatus_Busy || status == execution.ExecutionStatus_TooFarAway { e.logger.Debug(fmt.Sprintf("[%s] New payload: Client is still syncing", logPrefix)) return &engine_types.PayloadStatus{Status: engine_types.SyncingStatus}, nil } else {