Skip to content

fix(controller): defer telemetry duration evaluation - #557

Open
evrendag wants to merge 1 commit into
canopy-network:mainfrom
evrendag:fix/commit-certificate-telemetry-duration
Open

fix(controller): defer telemetry duration evaluation#557
evrendag wants to merge 1 commit into
canopy-network:mainfrom
evrendag:fix/commit-certificate-telemetry-duration

Conversation

@evrendag

Copy link
Copy Markdown

Summary

Fixes block processing telemetry in CommitCertificate so time.Since(start) is evaluated when the function actually returns, rather than when the defer statement is registered.

Problem

Passing time.Since(start) directly as an argument to a deferred call evaluates the duration immediately. As a result, the reported block processing time does not include the remaining commit work.

Fix

Wrap UpdateTelemetry in a deferred closure, matching the behavior already used by CommitCertificateParallel.

This ensures telemetry records the full commit duration, including the work performed after the defer is registered.

Scope

  • No consensus behavior changes
  • No state transition changes
  • Telemetry-only fix
  • Keeps serial and parallel commit paths consistent

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