Skip to content

Fix/commit certificate telemetry duration - #579

Open
evrendag wants to merge 2 commits into
canopy-network:developmentfrom
evrendag:fix/commit-certificate-telemetry-duration
Open

Fix/commit certificate telemetry duration#579
evrendag wants to merge 2 commits into
canopy-network:developmentfrom
evrendag:fix/commit-certificate-telemetry-duration

Conversation

@evrendag

@evrendag evrendag commented Sep 2, 2026

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

This supersedes #557, which targeted main; this PR targets the required development branch per the contribution guidelines.

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.

2 participants