diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index 297cfbb31c16..9ae76352f580 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -86,6 +86,8 @@ type EngineCaller interface { GetTerminalBlockHash(ctx context.Context, transitionTime uint64) ([]byte, bool, error) } +var EmptyBlockHash = errors.New("Block hash is empty 0x0000...") + // NewPayload calls the engine_newPayloadVX method via JSON-RPC. func (s *Service) NewPayload(ctx context.Context, payload interfaces.ExecutionData) ([]byte, error) { ctx, span := trace.StartSpan(ctx, "powchain.engine-api-client.NewPayload") @@ -471,6 +473,10 @@ func (s *Service) ReconstructFullBlock( if executionBlock == nil { return nil, fmt.Errorf("received nil execution block for request by hash %#x", executionBlockHash) } + if bytes.Equal(executionBlock.Hash.Bytes(), []byte{}) { + return nil, EmptyBlockHash + } + executionBlock.Version = blindedBlock.Version() payload, err := fullPayloadFromExecutionBlock(header, executionBlock) if err != nil { diff --git a/beacon-chain/sync/rpc_beacon_blocks_by_root.go b/beacon-chain/sync/rpc_beacon_blocks_by_root.go index 46ea536428df..08507895617d 100644 --- a/beacon-chain/sync/rpc_beacon_blocks_by_root.go +++ b/beacon-chain/sync/rpc_beacon_blocks_by_root.go @@ -6,6 +6,7 @@ import ( libp2pcore "github.com/libp2p/go-libp2p/core" "github.com/libp2p/go-libp2p/core/peer" "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v3/beacon-chain/execution" "github.com/prysmaticlabs/prysm/v3/beacon-chain/p2p/types" "github.com/prysmaticlabs/prysm/v3/config/params" "github.com/prysmaticlabs/prysm/v3/consensus-types/blocks" @@ -77,7 +78,11 @@ func (s *Service) beaconBlocksRootRPCHandler(ctx context.Context, msg interface{ if blk.Block().IsBlinded() { blk, err = s.cfg.executionPayloadReconstructor.ReconstructFullBlock(ctx, blk) if err != nil { - log.WithError(err).Error("Could not get reconstruct full bellatrix block from blinded body") + if errors.Is(err, execution.EmptyBlockHash) { + log.WithError(err).Warn("Could not reconstruct block from header with syncing execution client. Waiting to complete syncing") + } else { + log.WithError(err).Error("Could not get reconstruct full block from blinded body") + } s.writeErrorResponseToStream(responseCodeServerError, types.ErrGeneric.Error(), stream) return err }