Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: track prepare next epoch time #6256

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/beacon-node/src/chain/prepareNextSlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export class PrepareNextSlotScheduler {
headRoot,
isEpochTransition,
});
const precomputeEpochTransitionTimer = isEpochTransition
? this.metrics?.precomputeNextEpochTransition.duration.startTimer()
: null;
// No need to wait for this or the clock drift
// Pre Bellatrix: we only do precompute state transition for the last slot of epoch
// For Bellatrix, we always do the `processSlots()` to prepare payload for the next slot
Expand Down Expand Up @@ -133,6 +136,8 @@ export class PrepareNextSlotScheduler {
prepareSlot,
previousHits,
});

precomputeEpochTransitionTimer?.();
}

if (isExecutionStateType(prepareState)) {
Expand Down
5 changes: 5 additions & 0 deletions packages/beacon-node/src/metrics/metrics/lodestar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,11 @@ export function createLodestarMetrics(
name: "lodestar_precompute_next_epoch_transition_waste_total",
help: "Total number of precomputing next epoch transition wasted",
}),
duration: register.histogram({
name: "lodestar_precompute_next_epoch_transition_duration_seconds",
help: "Duration of precomputeNextEpochTransition, including epoch transition and hashTreeRoot",
buckets: [1, 2, 3, 4, 8],
}),
},

// reprocess attestations
Expand Down
Loading