[Fix] Record confirmed transmission latency regardless of age - #4335
Open
thep2p wants to merge 1 commit into
Open
[Fix] Record confirmed transmission latency regardless of age#4335thep2p wants to merge 1 commit into
thep2p wants to merge 1 commit into
Conversation
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.
Motivation
add_transmission_latency_metricchecks staleness before checking whether a transmission was included in the block. Because a tracker entry lingers from first-seen until it's either confirmed or ages out, any transmission that confirms after the 30-minute threshold takes the stale branch:Two consequences, both wrong:
TRANSMISSION_LATENCYis silently truncated at 30 min — the slowest confirmations, exactly the tail you watch, never reach the histogram, biasing p99/max low.STALE_UNCONFIRMED_{SOLUTIONS,TRANSACTIONS}is polluted with transmissions that did land in the block.It only surfaces under congestion / post-stall recovery (healthy-network confirmations are seconds), but those are precisely the moments the metric is supposed to be trustworthy.
Test Plan
No unit test: the function is pure side-effects on the global metrics recorder (untestable without a recorder harness), and the post-fix precedence is self-evident — adding an abstraction solely to make it testable would bury a one-branch semantic fix.
Documentation
Observability-only — no consensus, liveness, or funds impact.
Backwards compatibility
None affected — metric semantics only; no wire, storage, or protocol changes.