mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-12 22:29:02 +00:00
eth/catalyst: allow reorging to parent
This commit is contained in:
parent
57c3ae1d25
commit
8242cb10df
1 changed files with 6 additions and 2 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue