Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: log as info instead of warn if builder does not provide a bid #7191

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading