diff --git a/packages/beacon-node/src/api/impl/validator/index.ts b/packages/beacon-node/src/api/impl/validator/index.ts index 2aef56169112..b54a48accb20 100644 --- a/packages/beacon-node/src/api/impl/validator/index.ts +++ b/packages/beacon-node/src/api/impl/validator/index.ts @@ -591,10 +591,6 @@ export function getValidatorApi({ throw Error("Builder and engine both failed to produce the block within timeout"); } - if (builder.status === "rejected" && engine.status === "rejected") { - throw Error("Builder and engine both failed to produce the block"); - } - if (engine.status === "rejected" && isEngineEnabled) { logger.warn( "Engine failed to produce the block", @@ -617,6 +613,12 @@ export function getValidatorApi({ ); } + if (builder.status === "rejected" && engine.status === "rejected") { + throw Error( + `${isBuilderEnabled && isEngineEnabled ? "Builder and engine both" : isBuilderEnabled ? "Builder" : "Engine"} failed to produce the block` + ); + } + // handle shouldOverrideBuilder separately if (engine.status === "fulfilled" && engine.value.shouldOverrideBuilder) { logger.info("Selected engine block: censorship suspected in builder blocks", {