good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit df80b0d9 authored by Giulio Rebuffo's avatar Giulio Rebuffo Committed by GitHub
Browse files

Handling of already canonical payloads (#4367)

* deprecated ACCEPTED status

* pre-check for existing canonical header
parent 1231f8c2
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment