Skip to content

Commit

Permalink
address pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
avalonche committed Jan 11, 2024
1 parent 30440dc commit 25adf46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,11 +652,11 @@ func (m *BoostService) processCapellaPayload(w http.ResponseWriter, req *http.Re
}

func (m *BoostService) processDenebPayload(w http.ResponseWriter, req *http.Request, log *logrus.Entry, blindedBlock *eth2ApiV1Deneb.SignedBlindedBeaconBlock) {
// Get the slotUID for this slot
slotUID := ""
// Get the currentSlotUID for this slot
currentSlotUID := ""
m.slotUIDLock.Lock()
if m.slotUID.slot == uint64(blindedBlock.Message.Slot) {
slotUID = m.slotUID.uid.String()
currentSlotUID = m.slotUID.uid.String()
} else {
log.Warnf("latest slotUID is for slot %d rather than payload slot %d", m.slotUID.slot, blindedBlock.Message.Slot)
}
Expand All @@ -669,7 +669,7 @@ func (m *BoostService) processDenebPayload(w http.ResponseWriter, req *http.Requ
"slot": blindedBlock.Message.Slot,
"blockHash": blindedBlock.Message.Body.ExecutionPayloadHeader.BlockHash.String(),
"parentHash": blindedBlock.Message.Body.ExecutionPayloadHeader.ParentHash.String(),
"slotUID": slotUID,
"slotUID": currentSlotUID,
})

// Log how late into the slot the request starts
Expand All @@ -693,7 +693,7 @@ func (m *BoostService) processDenebPayload(w http.ResponseWriter, req *http.Requ
}

// Add request headers
headers := map[string]string{HeaderKeySlotUID: slotUID}
headers := map[string]string{HeaderKeySlotUID: currentSlotUID}

// Prepare for requests
var wg sync.WaitGroup
Expand Down Expand Up @@ -734,7 +734,7 @@ func (m *BoostService) processDenebPayload(w http.ResponseWriter, req *http.Requ
// Ensure the response blockhash matches the request
if blindedBlock.Message.Body.ExecutionPayloadHeader.BlockHash != payload.BlockHash {
log.WithFields(logrus.Fields{
"responseBlockHash": responsePayload.Capella.BlockHash.String(),
"responseBlockHash": payload.BlockHash.String(),
}).Error("requestBlockHash does not equal responseBlockHash")
return
}
Expand Down
2 changes: 1 addition & 1 deletion server/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func getPayloadResponseIsEmpty(payload *builderApi.VersionedSubmitBlindedBlockRe
case spec.DataVersionDeneb:
if payload.Deneb == nil || payload.Deneb.ExecutionPayload == nil ||
payload.Deneb.ExecutionPayload.BlockHash == nilHash ||
payload.Deneb.BlobsBundle == nil || payload.Deneb.BlobsBundle.Blobs == nil {
payload.Deneb.BlobsBundle == nil {
return true
}
case spec.DataVersionUnknown, spec.DataVersionPhase0, spec.DataVersionAltair, spec.DataVersionBellatrix:
Expand Down

0 comments on commit 25adf46

Please sign in to comment.