mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
Handling of already canonical payloads (#4367)
* deprecated ACCEPTED status * pre-check for existing canonical header
This commit is contained in:
parent
1231f8c21c
commit
df80b0d915
@ -418,6 +418,22 @@ func handleNewPayload(
|
||||
return err
|
||||
}
|
||||
|
||||
isCanonicalHeader, err := rawdb.IsCanonicalHash(tx, headerHash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// If we already processed this block as canonical we return VALID and skip it.
|
||||
if isCanonicalHeader {
|
||||
if requestStatus == engineapi.New {
|
||||
cfg.hd.PayloadStatusCh <- privateapi.PayloadStatus{
|
||||
Status: remote.EngineStatus_VALID,
|
||||
LatestValidHash: rawdb.ReadHeadBlockHash(tx),
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if existingCanonicalHash != (common.Hash{}) && headerHash == existingCanonicalHash {
|
||||
log.Info(fmt.Sprintf("[%s] New payload: previously received valid header", s.LogPrefix()))
|
||||
cfg.hd.BeaconRequestList.Remove(requestId)
|
||||
|
Loading…
Reference in New Issue
Block a user