Skip to content

Commit

Permalink
Merge 1e510ff into 4722b66
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored Oct 22, 2024
2 parents 4722b66 + 1e510ff commit 97239a7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
20 changes: 14 additions & 6 deletions packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import {validateGossipFnRetryUnknownRoot} from "../../../network/processor/gossi
import {SCHEDULER_LOOKAHEAD_FACTOR} from "../../../chain/prepareNextSlot.js";
import {ChainEvent, CheckpointHex, CommonBlockBody} from "../../../chain/index.js";
import {ApiOptions} from "../../options.js";
import {NoBidReceived} from "../../../execution/builder/http.js";
import {getLodestarClientVersion} from "../../../util/metadata.js";
import {computeSubnetForCommitteesAtSlot, getPubkeysForIndices, selectBlockProductionSource} from "./utils.js";

Expand Down Expand Up @@ -661,14 +662,21 @@ export function getValidatorApi(
}

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

if (builder.status === "rejected" && engine.status === "rejected") {
Expand Down
13 changes: 12 additions & 1 deletion packages/beacon-node/src/execution/builder/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ export const defaultExecutionBuilderHttpOpts: ExecutionBuilderHttpOpts = {
timeout: 12000,
};

/**
* Expected error if builder does not provide a bid. Most of the time, this
* is due to `min-bid` setting on the mev-boost side but in rare cases could
* also happen if there are no bids from any of the connected relayers.
*/
export class NoBidReceived extends Error {
constructor() {
super("No bid received");
}
}

/**
* Duration given to the builder to provide a `SignedBuilderBid` before the deadline
* is reached, aborting the external builder flow in favor of the local build process.
Expand Down Expand Up @@ -138,7 +149,7 @@ export class ExecutionBuilderHttp implements IExecutionBuilder {
const signedBuilderBid = res.value();

if (!signedBuilderBid) {
throw Error("No bid received");
throw new NoBidReceived();
}

this.sszSupported = res.wireFormat() === WireFormat.ssz;
Expand Down

0 comments on commit 97239a7

Please sign in to comment.