mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
Fix Re-Org Back into Canonical Chain hive test (#5647)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
parent
ebe63cfa30
commit
d95a905b2b
@ -470,6 +470,18 @@ func (s *EthBackendServer) getQuickPayloadStatusIfPossible(blockHash common.Hash
|
|||||||
log.Debug(fmt.Sprintf("[%s] Downloading some other PoS stuff", prefix), "hash", blockHash)
|
log.Debug(fmt.Sprintf("[%s] Downloading some other PoS stuff", prefix), "hash", blockHash)
|
||||||
return &engineapi.PayloadStatus{Status: remote.EngineStatus_SYNCING}, nil
|
return &engineapi.PayloadStatus{Status: remote.EngineStatus_SYNCING}, nil
|
||||||
}
|
}
|
||||||
|
// Following code ensures we skip the fork choice state update if if forkchoiceState.headBlockHash references an ancestor of the head of canonical chain
|
||||||
|
headHash := rawdb.ReadHeadBlockHash(tx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// We add the extra restriction blockHash != headHash for the FCU case of canonicalHash == blockHash
|
||||||
|
// because otherwise (when FCU points to the head) we want go to stage headers
|
||||||
|
// so that it calls writeForkChoiceHashes.
|
||||||
|
if blockHash != headHash && canonicalHash == blockHash {
|
||||||
|
return &engineapi.PayloadStatus{Status: remote.EngineStatus_VALID, LatestValidHash: blockHash}, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If another payload is already commissioned then we just reply with syncing
|
// If another payload is already commissioned then we just reply with syncing
|
||||||
|
Loading…
Reference in New Issue
Block a user