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

execution: fix and simplify block consumer exec delays #13641

Merged
merged 1 commit into from
Feb 1, 2025
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
11 changes: 0 additions & 11 deletions eth/stagedsync/exec3.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/common/cmp"
"github.com/erigontech/erigon-lib/common/dbg"
metrics2 "github.com/erigontech/erigon-lib/common/metrics"
"github.com/erigontech/erigon-lib/config3"
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/kv/rawdbv3"
Expand Down Expand Up @@ -490,11 +489,6 @@ Loop:
return fmt.Errorf("nil block %d", blockNum)
}

if execStage.SyncMode() == stages.ModeApplyingBlocks ||
execStage.SyncMode() == stages.ModeForkValidation {
metrics2.UpdateBlockConsumerPreExecutionDelay(b.Time(), blockNum, logger)
}

txs := b.Transactions()
header := b.HeaderNoCopy()
skipAnalysis := core.SkipAnalysis(chainConfig, blockNum)
Expand Down Expand Up @@ -649,11 +643,6 @@ Loop:

// MA commitTx
if !parallel {
if execStage.SyncMode() == stages.ModeApplyingBlocks ||
execStage.SyncMode() == stages.ModeForkValidation {
metrics2.UpdateBlockConsumerPostExecutionDelay(b.Time(), blockNum, logger)
}

select {
case <-logEvery.C:
if inMemExec || isMining {
Expand Down
2 changes: 2 additions & 0 deletions turbo/execution/eth1/forkchoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ func (e *EthereumExecutionModule) updateForkChoice(ctx context.Context, original
}

UpdateForkChoiceArrivalDelay(fcuHeader.Time)
metrics.UpdateBlockConsumerPreExecutionDelay(fcuHeader.Time, fcuHeader.Number.Uint64(), e.logger)
defer metrics.UpdateBlockConsumerPostExecutionDelay(fcuHeader.Time, fcuHeader.Number.Uint64(), e.logger)

limitedBigJump := e.syncCfg.LoopBlockLimit > 0 && finishProgressBefore > 0 && fcuHeader.Number.Uint64()-finishProgressBefore > uint64(e.syncCfg.LoopBlockLimit-2)
isSynced := finishProgressBefore > 0 && finishProgressBefore > e.blockReader.FrozenBlocks() && finishProgressBefore == headersProgressBefore
Expand Down
Loading