Skip to content

Commit

Permalink
chore: print calculated block production cutoff time
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Oct 15, 2024
1 parent 5adb4ef commit ec484c8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,12 @@ export function getValidatorApi(
});
logger.debug("Produced common block body", loggerContext);

// Calculate cutoff time based on start of the slot
const cutoffMs = Math.max(0, BLOCK_PRODUCTION_RACE_CUTOFF_MS - Math.round(chain.clock.secFromSlot(slot) * 1000));

logger.verbose("Block production race (builder vs execution) starting", {
...loggerContext,
cutoffMs: BLOCK_PRODUCTION_RACE_CUTOFF_MS,
cutoffMs,
timeoutMs: BLOCK_PRODUCTION_RACE_TIMEOUT_MS,
});

Expand Down Expand Up @@ -637,7 +640,7 @@ export function getValidatorApi(
: Promise.reject(new Error("Engine disabled"));

const [builder, engine] = await resolveOrRacePromises([builderPromise, enginePromise], {
resolveTimeoutMs: Math.max(0, BLOCK_PRODUCTION_RACE_CUTOFF_MS - Math.round(chain.clock.secFromSlot(slot) * 1000)),
resolveTimeoutMs: cutoffMs,
raceTimeoutMs: BLOCK_PRODUCTION_RACE_TIMEOUT_MS,
signal: controller.signal,
});
Expand Down

0 comments on commit ec484c8

Please sign in to comment.