core: recover state when beacon sets canonical head if it's missing (#24613)

* core: recover the state in SetChainHead if the head state is missing

* core: disable test logging

* core: address comment from martin

* core: improve log level in case state is recovered

* core, eth, les, light: rename SetChainHead to SetCanonical
This commit is contained in:
rjl493456442 authored and GitHub committed 2022-05-05 10:36:26 +03:00
1 parent 11b56ace2a
commit 7f6f01d46f
7 files changed
+102 -14

No files matched your search

+1 -1
View File
@@ -139,7 +139,7 @@ func (api *ConsensusAPI) ForkchoiceUpdatedV1(update beacon.ForkchoiceStateV1, pa
if rawdb.ReadCanonicalHash(api.eth.ChainDb(), block.NumberU64()) != update.HeadBlockHash {
// Block is not canonical, set head.
if err := api.eth.BlockChain().SetChainHead(block); err != nil {
if err := api.eth.BlockChain().SetCanonical(block); err != nil {
return beacon.STATUS_INVALID, err
}
} else {