change blinded block proposal failures to REST internal errors (#5501)
This commit is contained in:
parent
afc7912ebf
commit
c5028b56bf
|
@ -1007,7 +1007,7 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||
|
||||
if res.isErr():
|
||||
return RestApiResponse.jsonError(
|
||||
Http503, BeaconNodeInSyncError, $res.error())
|
||||
Http500, InternalServerError, $res.error())
|
||||
if res.get().isNone():
|
||||
return RestApiResponse.jsonError(Http202, BlockValidationError)
|
||||
|
||||
|
@ -1028,7 +1028,7 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||
|
||||
if res.isErr():
|
||||
return RestApiResponse.jsonError(
|
||||
Http503, BeaconNodeInSyncError, $res.error())
|
||||
Http500, InternalServerError, $res.error())
|
||||
if res.get().isNone():
|
||||
return RestApiResponse.jsonError(Http202, BlockValidationError)
|
||||
|
||||
|
|
|
@ -72,9 +72,8 @@ proc unblindAndRouteBlockMEV*(
|
|||
if hash_tree_root(
|
||||
blindedBlock.message.body.execution_payload_header) !=
|
||||
hash_tree_root(unblindedPayload.data.data):
|
||||
debug "unblindAndRouteBlockMEV: unblinded payload doesn't match blinded payload",
|
||||
blindedPayload =
|
||||
blindedBlock.message.body.execution_payload_header
|
||||
return err("unblinded payload doesn't match blinded payload header: " &
|
||||
$blindedBlock.message.body.execution_payload_header)
|
||||
else:
|
||||
# Signature provided is consistent with unblinded execution payload,
|
||||
# so construct full beacon block
|
||||
|
@ -110,8 +109,8 @@ proc unblindAndRouteBlockMEV*(
|
|||
|
||||
return ok newBlockRef
|
||||
else:
|
||||
debug "unblindAndRouteBlockMEV: submitBlindedBlock failed",
|
||||
blindedBlock, payloadStatus = unblindedPayload.status
|
||||
return err("submitBlindedBlock failed with HTTP error code" &
|
||||
$unblindedPayload.status & ": " & $shortLog(blindedBlock))
|
||||
|
||||
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#proposer-slashing
|
||||
# This means if a validator publishes a signature for a
|
||||
|
@ -151,9 +150,8 @@ proc unblindAndRouteBlockMEV*(
|
|||
if hash_tree_root(
|
||||
blindedBlock.message.body.execution_payload_header) !=
|
||||
hash_tree_root(unblindedPayload.data.data.execution_payload):
|
||||
debug "unblindAndRouteBlockMEV: unblinded payload doesn't match blinded payload",
|
||||
blindedPayload =
|
||||
blindedBlock.message.body.execution_payload_header
|
||||
return err("unblinded payload doesn't match blinded payload header: " &
|
||||
$blindedBlock.message.body.execution_payload_header)
|
||||
else:
|
||||
# Signature provided is consistent with unblinded execution payload,
|
||||
# so construct full beacon block
|
||||
|
@ -193,8 +191,8 @@ proc unblindAndRouteBlockMEV*(
|
|||
|
||||
return ok newBlockRef
|
||||
else:
|
||||
debug "unblindAndRouteBlockMEV: submitBlindedBlock failed",
|
||||
blindedBlock, payloadStatus = unblindedPayload.status
|
||||
return err("submitBlindedBlock failed with HTTP error code" &
|
||||
$unblindedPayload.status & ": " & $shortLog(blindedBlock))
|
||||
|
||||
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#proposer-slashing
|
||||
# This means if a validator publishes a signature for a
|
||||
|
|
Loading…
Reference in New Issue