Skip to content

feat: precommit metrics - #5251

Merged
aljo242 merged 7 commits into
v0.38.xfrom
technicallyty/COMET-308-precommit-metrics
Jul 3, 2025
Merged

aljo242 merged 7 commits into
v0.38.xfrom
technicallyty/COMET-308-precommit-metrics

Conversation

@technicallyty

Copy link
Copy Markdown
Contributor

adds metrics for:

  • how long it took to get to quorum of precommits
  • the total votes and voting power percentage accumulated within the timeout commit period

@linear

linear Bot commented Jul 2, 2025

Copy link
Copy Markdown

@technicallyty
technicallyty marked this pull request as ready for review July 2, 2025 19:16
@technicallyty
technicallyty requested review from a team as code owners July 2, 2025 19:16
@technicallyty

Copy link
Copy Markdown
Contributor Author

merging this as i confirmed it worked on a local network.

@aljo242
aljo242 merged commit 9a45311 into v0.38.x Jul 3, 2025
@aljo242
aljo242 deleted the technicallyty/COMET-308-precommit-metrics branch July 3, 2025 18:48
rootulp added a commit to celestiaorg/celestia-core that referenced this pull request Jun 2, 2026
## Overview

Backport of upstream
[cometbft/cometbft#5251](cometbft/cometbft#5251)
(shipped in v0.38.18). Adds observability metrics for the precommit
step, mirroring the existing prevote-delay metric:

- **`QuorumPrecommitDelay`** — interval (seconds) between the proposal
timestamp and the earliest precommit that achieved a quorum.
- **`PrecommitsCounted`** — number of precommit votes counted after the
timeout-commit period ends.
- **`PrecommitsStakingPercentage`** — voting-power percentage of
precommits at the end of the timeout-commit period.

`emitPrecommitTimeoutMetrics` is called from `handleTimeout` (the
`RoundStepPrecommitWait` branch) and
`calculatePrecommitMessageDelayMetrics` from `finalizeCommit`, alongside
the existing prevote metric.

## Notes

- The upstream code was adapted to celestia's `cs.rs` round-state
accessors (celestia keeps round state in `cs.rs` rather than directly on
`cs`).
- `consensus/metrics.gen.go` was regenerated via `make metrics`.
- Observability only — no consensus behavior change. Matches the
existing untested `calculatePrevoteMessageDelayMetrics` pattern;
upstream #5251 shipped without tests as well.

## Testing

- `go test -tags deadlock ./consensus/` passes.
- `golangci-lint` clean.

Closes PROTOCO-1869

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
rootulp added a commit to celestiaorg/celestia-core that referenced this pull request Jun 2, 2026
## Overview

Backport of upstream
[cometbft/cometbft#5251](cometbft/cometbft#5251)
(shipped in v0.38.18). Adds observability metrics for the precommit
step, mirroring the existing prevote-delay metric:

- **`QuorumPrecommitDelay`** — interval (seconds) between the proposal
timestamp and the earliest precommit that achieved a quorum.
- **`PrecommitsCounted`** — number of precommit votes counted after the
timeout-commit period ends.
- **`PrecommitsStakingPercentage`** — voting-power percentage of
precommits at the end of the timeout-commit period.

`emitPrecommitTimeoutMetrics` is called from `handleTimeout` (the
`RoundStepPrecommitWait` branch) and
`calculatePrecommitMessageDelayMetrics` from `finalizeCommit`, alongside
the existing prevote metric.

## Notes

- The upstream code was adapted to celestia's `cs.rs` round-state
accessors (celestia keeps round state in `cs.rs` rather than directly on
`cs`).
- `consensus/metrics.gen.go` was regenerated via `make metrics`.
- Observability only — no consensus behavior change. Matches the
existing untested `calculatePrevoteMessageDelayMetrics` pattern;
upstream #5251 shipped without tests as well.

## Testing

- `go test -tags deadlock ./consensus/` passes.
- `golangci-lint` clean.

Closes PROTOCO-1869

🤖 Generated with [Claude Code](https://claude.com/claude-code)<hr>This
is an automatic backport of pull request #3081 done by
[Mergify](https://mergify.com).

Co-authored-by: Rootul P <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
rootulp added a commit to celestiaorg/celestia-core that referenced this pull request Jun 2, 2026
## Overview

Backport of upstream
[cometbft/cometbft#5251](cometbft/cometbft#5251)
(shipped in v0.38.18). Adds observability metrics for the precommit
step, mirroring the existing prevote-delay metric:

- **`QuorumPrecommitDelay`** — interval (seconds) between the proposal
timestamp and the earliest precommit that achieved a quorum.
- **`PrecommitsCounted`** — number of precommit votes counted after the
timeout-commit period ends.
- **`PrecommitsStakingPercentage`** — voting-power percentage of
precommits at the end of the timeout-commit period.

`emitPrecommitTimeoutMetrics` is called from `handleTimeout` (the
`RoundStepPrecommitWait` branch) and
`calculatePrecommitMessageDelayMetrics` from `finalizeCommit`, alongside
the existing prevote metric.

## Notes

- The upstream code was adapted to celestia's `cs.rs` round-state
accessors (celestia keeps round state in `cs.rs` rather than directly on
`cs`).
- `consensus/metrics.gen.go` was regenerated via `make metrics`.
- Observability only — no consensus behavior change. Matches the
existing untested `calculatePrevoteMessageDelayMetrics` pattern;
upstream #5251 shipped without tests as well.

## Testing

- `go test -tags deadlock ./consensus/` passes.
- `golangci-lint` clean.

Closes PROTOCO-1869

🤖 Generated with [Claude Code](https://claude.com/claude-code)<hr>This
is an automatic backport of pull request #3081 done by
[Mergify](https://mergify.com).

Co-authored-by: Rootul P <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.

3 participants