Skip to content

Commit

Permalink
fix: warn if engine / builder failed to produce block within cutoff t…
Browse files Browse the repository at this point in the history
…ime (#7305)
  • Loading branch information
nflaig authored Dec 17, 2024
1 parent 3f3c7fc commit c290469
Showing 1 changed file with 35 additions and 21 deletions.
56 changes: 35 additions & 21 deletions packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,32 +695,46 @@ export function getValidatorApi(
throw Error("Builder and engine both failed to produce the block within timeout");
}

if (engine.status === "rejected" && isEngineEnabled) {
logger.warn(
"Engine failed to produce the block",
{
...loggerContext,
durationMs: engine.durationMs,
},
engine.reason
);
}

if (builder.status === "rejected" && isBuilderEnabled) {
if (builder.reason instanceof NoBidReceived) {
logger.info("Builder did not provide a bid", {
...loggerContext,
durationMs: builder.durationMs,
});
} else {
if (isEngineEnabled) {
if (engine.status === "rejected") {
logger.warn(
"Builder failed to produce the block",
"Engine failed to produce the block",
{
...loggerContext,
durationMs: builder.durationMs,
durationMs: engine.durationMs,
},
builder.reason
engine.reason
);
} else if (engine.status === "pending") {
logger.warn("Engine failed to produce the block within cutoff time", {
...loggerContext,
cutoffMs,
});
}
}

if (isBuilderEnabled) {
if (builder.status === "rejected") {
if (builder.reason instanceof NoBidReceived) {
logger.info("Builder did not provide a bid", {
...loggerContext,
durationMs: builder.durationMs,
});
} else {
logger.warn(
"Builder failed to produce the block",
{
...loggerContext,
durationMs: builder.durationMs,
},
builder.reason
);
}
} else if (builder.status === "pending") {
logger.warn("Builder failed to produce the block within cutoff time", {
...loggerContext,
cutoffMs,
});
}
}

Expand Down

0 comments on commit c290469

Please sign in to comment.