Skip to content

Commit

Permalink
Work on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Jan 22, 2024
1 parent e5dcc96 commit 95f088c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,16 @@ 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 = {
fork,
builderSelection,
slot,
isBuilderEnabled,
isEngineEnabled,
strictFeeRecipientCheck,
// winston logger doesn't like bigint
builderBoostFactor: `${builderBoostFactor}`,
Expand Down Expand Up @@ -520,9 +522,8 @@ export function getValidatorApi({
})
: Promise.reject<ReturnType<typeof produceBuilderBlindedBlock>>(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
Expand Down
5 changes: 5 additions & 0 deletions packages/utils/src/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ export class MutedPromise<T> implements Promise<T> {
}
}

/**
* ArrayToTuple converts an `Array<T>` to `[T, ...T]`
*
* eg: `[1, 2, 3]` from type `number[]` to `[number, number, number]`
*/
type ReturnPromiseWithTuple<Tuple extends NonEmptyArray<unknown>> = {
[Index in keyof ArrayToTuple<Tuple>]: MutedPromise<Awaited<Tuple[Index]>>;
};
Expand Down

0 comments on commit 95f088c

Please sign in to comment.