Skip to content

Commit

Permalink
Do not return empty builder config
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Oct 30, 2024
1 parent 549ead9 commit 005ee4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions packages/cli/src/util/proposerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {routes} from "@lodestar/api";
import {parseFeeRecipient} from "./feeRecipient.js";

import {readFile} from "./file.js";
import {isEmptyObject} from "@lodestar/utils";

type ProposerConfig = ValidatorProposerConfig["defaultConfig"];

Expand Down Expand Up @@ -88,11 +89,13 @@ function parseProposerConfigSection(
overrideConfig?.strictFeeRecipientCheck ??
(strict_fee_recipient_check ? stringtoBool(strict_fee_recipient_check) : undefined),
feeRecipient: overrideConfig?.feeRecipient ?? (fee_recipient ? parseFeeRecipient(fee_recipient) : undefined),
builder: {
gasLimit: overrideConfig?.builder?.gasLimit ?? (gas_limit !== undefined ? Number(gas_limit) : undefined),
selection: overrideConfig?.builder?.selection ?? parseBuilderSelection(builderSelection),
boostFactor: overrideConfig?.builder?.boostFactor ?? parseBuilderBoostFactor(boost_factor),
},
builder: !isEmptyObject(overrideConfig?.builder)
? {
gasLimit: overrideConfig?.builder?.gasLimit ?? (gas_limit !== undefined ? Number(gas_limit) : undefined),
selection: overrideConfig?.builder?.selection ?? parseBuilderSelection(builderSelection),
boostFactor: overrideConfig?.builder?.boostFactor ?? parseBuilderBoostFactor(boost_factor),
}
: undefined,
};
}

Expand Down
4 changes: 2 additions & 2 deletions packages/validator/src/services/validatorStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
SignedAggregateAndProof,
} from "@lodestar/types";
import {routes} from "@lodestar/api";
import {fromHex, toPubkeyHex, toRootHex} from "@lodestar/utils";
import {fromHex, isEmptyObject, toPubkeyHex, toRootHex} from "@lodestar/utils";
import {ISlashingProtection} from "../slashingProtection/index.js";
import {PubkeyHex} from "../types.js";
import {externalSignerPostSignature, SignableMessageType, SignableMessage} from "../util/externalSignerClient.js";
Expand Down Expand Up @@ -377,7 +377,7 @@ export class ValidatorStore {
graffiti !== undefined ||
strictFeeRecipientCheck !== undefined ||
feeRecipient !== undefined ||
builder?.gasLimit !== undefined
!isEmptyObject(builder)
) {
proposerConfig = {graffiti, strictFeeRecipientCheck, feeRecipient, builder};
}
Expand Down

0 comments on commit 005ee4c

Please sign in to comment.