Skip to content

Commit 5d6caae

Browse files
authored
User error for getPayload request with a non-Electra payload (#732)
return an error if getPayload is called in Electra with a non-Electra payload
1 parent f62940b commit 5d6caae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

services/api/service.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,12 @@ func (api *RelayAPI) handleGetPayload(w http.ResponseWriter, req *http.Request)
14221422
return
14231423
}
14241424

1425+
if api.isElectra(headSlot) && payload.Electra == nil {
1426+
log.Warn("Not an electra payload.")
1427+
api.RespondError(w, http.StatusBadRequest, "Non-Electra payload detected and rejected. You need to update mev-boost!")
1428+
return
1429+
}
1430+
14251431
// Take time after the decoding, and add to logging
14261432
decodeTime := time.Now().UTC()
14271433
slot, err := payload.Slot()

0 commit comments

Comments
 (0)