Skip to content

Commit

Permalink
debug and fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Dec 26, 2023
1 parent 1f7aad0 commit dc09a0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/api/src/beacon/routes/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -746,13 +746,13 @@ export function getReturnTypes(): ReturnTypes<Api> {
if (data.executionPayloadBlinded) {
return {
execution_payload_blinded: true,
executionPayloadSource: data.executionPayloadSource,
execution_payload_source: data.executionPayloadSource,
...(produceBlindedBlock.toJson(data) as Record<string, unknown>),
};
} else {
return {
execution_payload_blinded: false,
executionPayloadSource: data.executionPayloadSource,
execution_payload_source: data.executionPayloadSource,
...(produceBlockOrContents.toJson(data) as Record<string, unknown>),
};
}
Expand Down
3 changes: 2 additions & 1 deletion packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,8 @@ export function getValidatorApi({
skipRandaoVerification,
opts
);
if (opts.blindedLocal === true) {

if (opts.blindedLocal === true && ForkSeq[produceBlockEngineOrBuilderRes.version] >= ForkSeq.bellatrix) {
if (produceBlockEngineOrBuilderRes.executionPayloadBlinded) {
return produceBlockEngineOrBuilderRes;
} else {
Expand Down
6 changes: 4 additions & 2 deletions packages/validator/src/services/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,20 @@ export class BlockProposingService {
slot: Slot,
randaoReveal: BLSSignature,
graffiti: string,
{feeRecipient, strictFeeRecipientCheck, builderSelection}: routes.validator.ExtraProduceBlockOps
{feeRecipient, strictFeeRecipientCheck, builderSelection, blindedLocal}: routes.validator.ExtraProduceBlockOps
): Promise<FullOrBlindedBlockWithContents & DebugLogCtx> => {
const res = await this.api.validator.produceBlockV3(slot, randaoReveal, graffiti, false, {
feeRecipient,
builderSelection,
strictFeeRecipientCheck,
blindedLocal,
});
ApiError.assert(res, "Failed to produce block: validator.produceBlockV2");
const {response} = res;

const debugLogCtx = {
source: response.executionPayloadBlinded ? ProducedBlockSource.builder : ProducedBlockSource.engine,
executionPayloadSource: response.executionPayloadSource,
executionPayloadBlinded: response.executionPayloadBlinded,
// winston logger doesn't like bigint
executionPayloadValue: `${formatBigDecimal(response.executionPayloadValue, ETH_TO_WEI, MAX_DECIMAL_FACTOR)} ETH`,
consensusBlockValue: `${formatBigDecimal(response.consensusBlockValue, ETH_TO_GWEI, MAX_DECIMAL_FACTOR)} ETH`,
Expand Down

0 comments on commit dc09a0e

Please sign in to comment.