diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index a94f69cfff..a4a9594738 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -297,8 +297,12 @@ func (api *ConsensusAPI) forkchoiceUpdated(update engine.ForkchoiceStateV1, payl } else { // If the head block is already in our canonical chain, the beacon client is // probably resyncing. Ignore the update. - log.Info("Ignoring beacon update to old head", "number", block.NumberU64(), "hash", update.HeadBlockHash, "age", common.PrettyAge(time.Unix(int64(block.Time()), 0)), "have", api.eth.BlockChain().CurrentBlock().Number) - return valid(nil), nil + // TODO(MariusVanDerWijden): in epbs it can happen that we are reorging to a previous head + if latestValid, err := api.eth.BlockChain().SetCanonical(block); err != nil { + return engine.ForkChoiceResponse{PayloadStatus: engine.PayloadStatusV1{Status: engine.INVALID, LatestValidHash: &latestValid}}, err + } + //log.Info("Ignoring beacon update to old head", "number", block.NumberU64(), "hash", update.HeadBlockHash, "age", common.PrettyAge(time.Unix(int64(block.Time()), 0)), "have", api.eth.BlockChain().CurrentBlock().Number) + //return valid(nil), nil } api.eth.SetSynced()