Skip to content

Commit

Permalink
fix: do not need to time simple steps in processEpoch
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Dec 5, 2023
1 parent cf2da82 commit bc34818
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 48 deletions.
30 changes: 0 additions & 30 deletions packages/beacon-node/src/metrics/metrics/lodestar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,41 +321,11 @@ export function createLodestarMetrics(
help: "Time to process slashings in seconds",
buckets: [0.01, 0.05, 0.1, 0.2, 0.5, 0.75, 1],
}),
epochTransitionEth1DataResetTime: register.histogram({
name: "lodestar_stfn_epoch_transition_eth1_data_reset_seconds",
help: "Time to process eth1 data reset in seconds",
buckets: [0.01, 0.05, 0.1, 0.2, 0.5, 0.75, 1],
}),
epochTransitionEffectiveBalanceUpdatesTime: register.histogram({
name: "lodestar_stfn_epoch_transition_effective_balance_updates_seconds",
help: "Time to process effective balance updates in seconds",
buckets: [0.01, 0.05, 0.1, 0.2, 0.5, 0.75, 1],
}),
epochTransitionSlashingsResetTime: register.histogram({
name: "lodestar_stfn_epoch_transition_slashings_reset_seconds",
help: "Time to process slashings reset in seconds",
buckets: [0.01, 0.05, 0.1, 0.2, 0.5, 0.75, 1],
}),
epochTransitionRandaoMixesResetTime: register.histogram({
name: "lodestar_stfn_epoch_transition_randao_mixes_reset_seconds",
help: "Time to process randao mixes reset in seconds",
buckets: [0.01, 0.05, 0.1, 0.2, 0.5, 0.75, 1],
}),
epochTransitionHistoricalSummariesUpdateTime: register.histogram({
name: "lodestar_stfn_epoch_transition_historical_summaries_update_seconds",
help: "Time to process historical summaries update in seconds",
buckets: [0.01, 0.05, 0.1, 0.2, 0.5, 0.75, 1],
}),
epochTransitionHistoricalRootsUpdateTime: register.histogram({
name: "lodestar_stfn_epoch_transition_historical_roots_update_seconds",
help: "Time to process historical roots update in seconds",
buckets: [0.01, 0.05, 0.1, 0.2, 0.5, 0.75, 1],
}),
epochTransitionParticipationRecordUpdatesTime: register.histogram({
name: "lodestar_stfn_epoch_transition_participation_record_updates_seconds",
help: "Time to process participation record updates in seconds",
buckets: [0.01, 0.05, 0.1, 0.2, 0.5, 0.75, 1],
}),
epochTransitionParticipationFlagUpdatesTime: register.histogram({
name: "lodestar_stfn_epoch_transition_participation_flag_updates_seconds",
help: "Time to process participation flag updates in seconds",
Expand Down
12 changes: 0 additions & 12 deletions packages/state-transition/src/epoch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export function processEpoch(
}

let timer = metrics?.epochTransitionJustificationAndFinalizationTime.startTimer();

processJustificationAndFinalization(state, cache);
timer?.();
if (fork >= ForkSeq.altair) {
Expand All @@ -88,31 +87,20 @@ export function processEpoch(
processRewardsAndPenalties(state, cache, slashingPenalties);
timer?.();
processEth1DataReset(state, cache);
timer?.();
timer = metrics?.epochTransitionEffectiveBalanceUpdatesTime.startTimer();
processEffectiveBalanceUpdates(state, cache);
timer?.();
timer = metrics?.epochTransitionSlashingsResetTime.startTimer();
processSlashingsReset(state, cache);
timer?.();
timer = metrics?.epochTransitionRandaoMixesResetTime.startTimer();
processRandaoMixesReset(state, cache);
timer?.();

if (fork >= ForkSeq.capella) {
timer = metrics?.epochTransitionHistoricalSummariesUpdateTime.startTimer();
processHistoricalSummariesUpdate(state as CachedBeaconStateCapella, cache);
timer?.();
} else {
timer = metrics?.epochTransitionHistoricalRootsUpdateTime.startTimer();
processHistoricalRootsUpdate(state, cache);
timer?.();
}

if (fork === ForkSeq.phase0) {
timer = metrics?.epochTransitionParticipationRecordUpdatesTime.startTimer();
processParticipationRecordUpdates(state as CachedBeaconStatePhase0);
timer?.();
} else {
timer = metrics?.epochTransitionParticipationFlagUpdatesTime.startTimer();
processParticipationFlagUpdates(state as CachedBeaconStateAltair);
Expand Down
6 changes: 0 additions & 6 deletions packages/state-transition/src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ export type BeaconStateTransitionMetrics = {
epochTransitionRewardsAndPenaltiesTime: Histogram;
epochTransitionRegistryUpdatesTime: Histogram;
epochTransitionSlashingsTime: Histogram;
epochTransitionEth1DataResetTime: Histogram;
epochTransitionEffectiveBalanceUpdatesTime: Histogram;
epochTransitionSlashingsResetTime: Histogram;
epochTransitionRandaoMixesResetTime: Histogram;
epochTransitionHistoricalSummariesUpdateTime: Histogram;
epochTransitionHistoricalRootsUpdateTime: Histogram;
epochTransitionParticipationRecordUpdatesTime: Histogram;
epochTransitionParticipationFlagUpdatesTime: Histogram;
epochTransitionSyncCommitteeUpdatesTime: Histogram;
processBlockTime: Histogram;
Expand Down

0 comments on commit bc34818

Please sign in to comment.