cl/phase1/forkchoice: fix block_importing_latency never recording on Fulu+ - #21842
Merged
lystopad merged 3 commits intoJun 16, 2026
Merged
Conversation
…Fulu+ The block_importing_latency gauge was updated from a single call site nested inside the Deneb-only blob data-availability branch of OnBlock, gated on the block carrying blobs the EL didn't already have. So it almost never fired even pre-Fulu, and on Fulu+ (current mainnet) the Deneb branch is never taken — the gauge stayed at its 0 default for hours, which reads as a flat zero in Grafana. Move the call to the fork-agnostic highestSeen tip-advance, so it records once per new head block on every fork. The helper's current-slot guard still skips backfill/sync blocks. Note: this is a one-call relocation (the emitting helper is unchanged). Added a unit test covering the helper's current-slot contract; a full cross-fork OnBlock integration test was not added as it needs substantial forkchoice/engine/peerDAS scaffolding.
Member
|
Pushed a small follow-up commit to address the timing issue we discussed. What changed:
Why: Verification run locally: GOCACHE=/private/tmp/erigon-pr21842-gocache go test -count=1 ./cl/phase1/forkchoice
GOCACHE=/private/tmp/erigon-pr21842-gocache GOLANGCI_LINT_CACHE=/private/tmp/erigon-pr21842-golangci-cache make lintBoth passed. The first |
domiwei
approved these changes
Jun 16, 2026
domiwei
added a commit
that referenced
this pull request
Jun 17, 2026
…ing on Fulu+ (#21843) Cherry-pick of #21842 to release/3.5. `block_importing_latency` was only recorded from a call nested in the Deneb-only blob data-availability branch of `OnBlock`, so it never fired on Fulu+ (current mainnet) and read a flat 0 in Grafana. Moved to the fork-agnostic `highestSeen` tip-advance so it records once per new head block on all forks. See #21842 for full analysis. Clean cherry-pick. --------- Co-authored-by: kewei <kewei.train@gmail.com>
domiwei
added a commit
that referenced
this pull request
Jun 17, 2026
…ing on Fulu+ (#21845) Cherry-pick of #21842 to release/3.4 (applied manually — r3.4 OnBlock layout differs from main). `block_importing_latency` only fired from a call nested in the Deneb-only blob branch of `OnBlock`, so it never recorded on Fulu+ (flat 0 in Grafana). Moved to the fork-agnostic `highestSeen` tip-advance. See #21842 for full analysis. --------- Co-authored-by: kewei <kewei.train@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
block_importing_latency(Caplin) reads a flat 0 for hours in Grafana — it's effectively never recorded.It's a gauge set only by
ObserveBlockImportingLatency, whose only caller (collectOnBlockLatencyToUnixTime) was nested inside the Deneb-only blob data-availability branch ofOnBlock, behind:checkDataAvaiability && BlobKzgCommitments.Len() > 0 && !elHasBlobs && version is Deneb/Electra (not Fulu) && highestSeen < slot.Two of those gates kill it:
0default. This is the flat line.So the panel value is not a real "0 ms"; the setter just isn't reached.
Fix
Move the single call to the fork-agnostic
highestSeentip-advance inOnBlock, which runs for every new head block on all forks (Fulu/Gloas included). The helper's existingslot == GetCurrentSlot()guard still skips backfill/sync blocks, so the gauge measures head-arrival latency rather than block age.Net effect:
block_importing_latencynow populates every slot the node imports a current-slot head block, on all forks.Tests
TestCollectOnBlockLatencycovers the helper's contract (records for a current-slot block, skips a past/backfill slot).This change is a one-call relocation — the emitting helper itself is unchanged. A full cross-fork
OnBlockintegration test was intentionally not added, as exercising it requires substantial fork-choice/engine/PeerDAS scaffolding to make a test block "current"; flagging per the repo's TDD-pragmatism guidance.make lintandmake erigonclean.Scope
Affects
release/3.4,release/3.5, andmain(the call placement is identical on all three). Will cherry-pick to the release branches.