Skip to content

[Fix] Record confirmed transmission latency regardless of age - #4335

Open
thep2p wants to merge 1 commit into
ProvableHQ:stagingfrom
thep2p:thep2p/metrics-fix
Open

[Fix] Record confirmed transmission latency regardless of age#4335
thep2p wants to merge 1 commit into
ProvableHQ:stagingfrom
thep2p:thep2p/metrics-fix

Conversation

@thep2p

@thep2p thep2p commented Jun 30, 2026

Copy link
Copy Markdown

Motivation

add_transmission_latency_metric checks 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:

if elapsed > 30min  → count STALE_UNCONFIRMED, drop     ← runs first                                                                                                                                                                                                                                                                                      
else if in block    → record TRANSMISSION_LATENCY, drop ← never reached when old 

Two consequences, both wrong:

  • TRANSMISSION_LATENCY is 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant