From 95f088c39d66715fb2155c792c3805d996539441 Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Mon, 22 Jan 2024 09:48:44 +0100 Subject: [PATCH] Work on feedback --- packages/beacon-node/src/api/impl/validator/index.ts | 9 +++++---- packages/utils/src/promise.ts | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/beacon-node/src/api/impl/validator/index.ts b/packages/beacon-node/src/api/impl/validator/index.ts index 908fbebe8651..ff9905e3c890 100644 --- a/packages/beacon-node/src/api/impl/validator/index.ts +++ b/packages/beacon-node/src/api/impl/validator/index.ts @@ -478,7 +478,8 @@ export function getValidatorApi({ // configurations could cause a validator pubkey to have builder disabled with builder selection builder only // (TODO: independently make sure such an options update is not successful for a validator pubkey) // - // So if builder is disabled ignore builder selection of builderonly if caused by user mistake + // So if builder is disabled ignore builder selection of builder only if caused by user mistake + // https://github.com/ChainSafe/lodestar/issues/6338 const isEngineEnabled = !isBuilderEnabled || builderSelection !== routes.validator.BuilderSelection.BuilderOnly; const loggerContext = { @@ -486,6 +487,7 @@ export function getValidatorApi({ builderSelection, slot, isBuilderEnabled, + isEngineEnabled, strictFeeRecipientCheck, // winston logger doesn't like bigint builderBoostFactor: `${builderBoostFactor}`, @@ -520,9 +522,8 @@ export function getValidatorApi({ }) : Promise.reject>(builderDisabledError), - isEngineEnabled // TODO deneb: builderSelection needs to be figured out if to be done beacon side - ? // || builderSelection !== BuilderSelection.BuilderOnly - produceEngineFullBlockOrContents(slot, randaoReveal, graffiti, { + isEngineEnabled + ? produceEngineFullBlockOrContents(slot, randaoReveal, graffiti, { feeRecipient, strictFeeRecipientCheck, // skip checking and recomputing head in these individual produce calls diff --git a/packages/utils/src/promise.ts b/packages/utils/src/promise.ts index 4d8de0d8654a..191c07059089 100644 --- a/packages/utils/src/promise.ts +++ b/packages/utils/src/promise.ts @@ -117,6 +117,11 @@ export class MutedPromise implements Promise { } } +/** + * ArrayToTuple converts an `Array` to `[T, ...T]` + * + * eg: `[1, 2, 3]` from type `number[]` to `[number, number, number]` + */ type ReturnPromiseWithTuple> = { [Index in keyof ArrayToTuple]: MutedPromise>; };