From bc3481829d7f4106e7ad83ff13641a3337dce0f4 Mon Sep 17 00:00:00 2001 From: Tuyen Nguyen Date: Tue, 5 Dec 2023 09:35:17 +0700 Subject: [PATCH] fix: do not need to time simple steps in processEpoch --- .../src/metrics/metrics/lodestar.ts | 30 ------------------- packages/state-transition/src/epoch/index.ts | 12 -------- packages/state-transition/src/metrics.ts | 6 ---- 3 files changed, 48 deletions(-) diff --git a/packages/beacon-node/src/metrics/metrics/lodestar.ts b/packages/beacon-node/src/metrics/metrics/lodestar.ts index 6e1d5705b6ca..3654c919f192 100644 --- a/packages/beacon-node/src/metrics/metrics/lodestar.ts +++ b/packages/beacon-node/src/metrics/metrics/lodestar.ts @@ -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", diff --git a/packages/state-transition/src/epoch/index.ts b/packages/state-transition/src/epoch/index.ts index 641b1eea0535..cf215da4276e 100644 --- a/packages/state-transition/src/epoch/index.ts +++ b/packages/state-transition/src/epoch/index.ts @@ -66,7 +66,6 @@ export function processEpoch( } let timer = metrics?.epochTransitionJustificationAndFinalizationTime.startTimer(); - processJustificationAndFinalization(state, cache); timer?.(); if (fork >= ForkSeq.altair) { @@ -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); diff --git a/packages/state-transition/src/metrics.ts b/packages/state-transition/src/metrics.ts index f6dba5477136..d31c0de4fa5c 100644 --- a/packages/state-transition/src/metrics.ts +++ b/packages/state-transition/src/metrics.ts @@ -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;