prevent resyncing from genesis with altair head block (#2750)

This commit is contained in:
tersec 2021-08-01 08:20:43 +00:00 committed by GitHub
parent e576064788
commit a2c1b96ac9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -1124,10 +1124,12 @@ proc isInitialized*(T: type ChainDAGRef, db: BeaconChainDB): bool =
return false
let
headBlock = db.getBlock(headBlockRoot.get())
headBlockPhase0 = db.getBlock(headBlockRoot.get())
headBlockAltair = db.getAltairBlock(headBlockRoot.get())
tailBlock = db.getBlock(tailBlockRoot.get())
if not (headBlock.isSome() and tailBlock.isSome()):
if not ((headBlockPhase0.isSome() or headBlockAltair.isSome()) and
tailBlock.isSome()):
return false
if not db.containsState(tailBlock.get().message.state_root):