From 996a0bdcdc76cb6aa7f9ab38d4e633f321dde823 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Mon, 5 Dec 2022 20:41:52 +0100 Subject: [PATCH] fix crash when calling MEV rpc with MEV disabled (#4389) Avoid `/eth/v1/beacon/blinded_blocks` crash without `--payload-builder`. --- beacon_chain/validators/message_router_mev.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/beacon_chain/validators/message_router_mev.nim b/beacon_chain/validators/message_router_mev.nim index 01a5cd94a..34c039e9f 100644 --- a/beacon_chain/validators/message_router_mev.nim +++ b/beacon_chain/validators/message_router_mev.nim @@ -48,6 +48,9 @@ proc unblindAndRouteBlockMEV*( Future[Result[Opt[BlockRef], string]] {.async.} = # By time submitBlindedBlock is called, must already have done slashing # protection check + if node.payloadBuilderRestClient.isNil: + return err "unblindAndRouteBlockMEV: nil REST client" + let unblindedPayload = try: awaitWithTimeout(