diff --git a/packages/cli/src/cmds/validator/options.ts b/packages/cli/src/cmds/validator/options.ts index e68e04a4b884..66b356d96311 100644 --- a/packages/cli/src/cmds/validator/options.ts +++ b/packages/cli/src/cmds/validator/options.ts @@ -257,8 +257,7 @@ export const validatorOptions: CliCommandOptions = { useProduceBlockV3: { type: "boolean", - description: "Enable/disable usage of produceBlockV3 that might not be supported by all beacon clients yet", - defaultDescription: `${defaultOptions.useProduceBlockV3}`, + description: "Enable/disable usage of produceBlockV3 for block production, is auto enabled on deneb+ blocks", }, broadcastValidation: { diff --git a/packages/cli/test/utils/simulation/validator_clients/lodestar.ts b/packages/cli/test/utils/simulation/validator_clients/lodestar.ts index 7c0c9e3537b1..f7a1e808a778 100644 --- a/packages/cli/test/utils/simulation/validator_clients/lodestar.ts +++ b/packages/cli/test/utils/simulation/validator_clients/lodestar.ts @@ -39,7 +39,7 @@ export const generateLodestarValidatorNode: ValidatorNodeGenerator}; type BlockProposalOpts = { - useProduceBlockV3: boolean; + useProduceBlockV3?: boolean; broadcastValidation: routes.beacon.BroadcastValidation; blindedLocal: boolean; }; @@ -125,6 +125,7 @@ export class BlockProposingService { this.validatorStore.getBuilderSelectionParams(pubkeyHex); const feeRecipient = this.validatorStore.getFeeRecipient(pubkeyHex); const blindedLocal = this.opts.blindedLocal; + const useProduceBlockV3 = this.opts.useProduceBlockV3 ?? this.config.getForkSeq(slot) >= ForkSeq.deneb; this.logger.debug("Producing block", { ...debugLogCtx, @@ -132,12 +133,12 @@ export class BlockProposingService { builderBoostFactor, feeRecipient, strictFeeRecipientCheck, - useProduceBlockV3: this.opts.useProduceBlockV3, + useProduceBlockV3, blindedLocal, }); this.metrics?.proposerStepCallProduceBlock.observe(this.clock.secFromSlot(slot)); - const produceBlockFn = this.opts.useProduceBlockV3 ? this.produceBlockWrapper : this.produceBlockV2Wrapper; + const produceBlockFn = useProduceBlockV3 ? this.produceBlockWrapper : this.produceBlockV2Wrapper; const produceOpts = { feeRecipient, strictFeeRecipientCheck, diff --git a/packages/validator/src/services/validatorStore.ts b/packages/validator/src/services/validatorStore.ts index 809ca0c8a7c6..f8f29f8092f2 100644 --- a/packages/validator/src/services/validatorStore.ts +++ b/packages/validator/src/services/validatorStore.ts @@ -126,8 +126,6 @@ export const defaultOptions = { builderSelection: routes.validator.BuilderSelection.ExecutionOnly, builderAliasSelection: routes.validator.BuilderSelection.MaxProfit, builderBoostFactor: BigInt(100), - // turn it off by default, turn it back on once other clients support v3 api - useProduceBlockV3: false, // spec asks for gossip validation by default broadcastValidation: routes.beacon.BroadcastValidation.gossip, // should request fetching the locally produced block in blinded format diff --git a/packages/validator/src/validator.ts b/packages/validator/src/validator.ts index f28a9afbaff6..deff99ee93f0 100644 --- a/packages/validator/src/validator.ts +++ b/packages/validator/src/validator.ts @@ -209,7 +209,7 @@ export class Validator { const chainHeaderTracker = new ChainHeaderTracker(logger, api, emitter); const blockProposingService = new BlockProposingService(config, loggerVc, api, clock, validatorStore, metrics, { - useProduceBlockV3: opts.useProduceBlockV3 ?? defaultOptions.useProduceBlockV3, + useProduceBlockV3: opts.useProduceBlockV3, broadcastValidation: opts.broadcastValidation ?? defaultOptions.broadcastValidation, blindedLocal: opts.blindedLocal ?? defaultOptions.blindedLocal, }); @@ -289,18 +289,15 @@ export class Validator { await assertEqualGenesis(opts, genesis); logger.info("Verified connected beacon node and validator have the same genesisValidatorRoot"); - const { - useProduceBlockV3 = defaultOptions.useProduceBlockV3, - broadcastValidation = defaultOptions.broadcastValidation, - valProposerConfig, - } = opts; + const {useProduceBlockV3, broadcastValidation = defaultOptions.broadcastValidation, valProposerConfig} = opts; const defaultBuilderSelection = valProposerConfig?.defaultConfig.builder?.selection ?? defaultOptions.builderSelection; const strictFeeRecipientCheck = valProposerConfig?.defaultConfig.strictFeeRecipientCheck ?? false; const suggestedFeeRecipient = valProposerConfig?.defaultConfig.feeRecipient ?? defaultOptions.suggestedFeeRecipient; logger.info("Initializing validator", { - useProduceBlockV3, + // if no explicit option is provided, useProduceBlockV3 will be auto enabled on/post deneb + useProduceBlockV3: useProduceBlockV3 === undefined ? "deneb+" : useProduceBlockV3, broadcastValidation, defaultBuilderSelection, suggestedFeeRecipient,