Skip to content

Export ProposerPriorityHash metric for divergence monitoring#3277

Open
wen-coding wants to merge 1 commit intomainfrom
wen/proposer-priority-hash-metric
Open

Export ProposerPriorityHash metric for divergence monitoring#3277
wen-coding wants to merge 1 commit intomainfrom
wen/proposer-priority-hash-metric

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

Summary

  • Add two Prometheus gauges exported every 1024 heights to let operators detect ProposerPriority divergence between validators
  • tendermint_state_proposer_priority_hash: first 6 bytes of the hash packed into a float64 (48 bits fits in the float64 mantissa; constant cardinality of one series per node)
  • tendermint_state_proposer_priority_hash_height: paired height so operators correlate samples taken at the same checkpoint
  • Log line at each checkpoint carries the full 32-byte hex hash plus the packed value for grep-based debugging

Test plan

  • go vet ./sei-tendermint/internal/state/... passes
  • go test ./sei-tendermint/internal/state passes
  • New test TestApplyBlockProposerPriorityHash applies 1024 real blocks and verifies exactly one emission at the interval boundary, with the correct packed hash and height values

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 20, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 21, 2026, 1:20 AM

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 65.71429% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.31%. Comparing base (a3bb4e8) to head (85388ae).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
sei-tendermint/internal/state/metrics.gen.go 50.00% 12 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3277   +/-   ##
=======================================
  Coverage   59.31%   59.31%           
=======================================
  Files        2071     2071           
  Lines      169866   169891   +25     
=======================================
+ Hits       100755   100770   +15     
- Misses      60335    60346   +11     
+ Partials     8776     8775    -1     
Flag Coverage Δ
sei-chain-pr 68.47% <65.71%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-tendermint/internal/state/execution.go 80.67% <100.00%> (+1.02%) ⬆️
sei-tendermint/internal/state/metrics.gen.go 14.43% <50.00%> (-0.03%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Emit a pair of gauges every 1024 heights so operators can detect
ProposerPriority divergence between validators by comparing hash
values across nodes at the same height. Pack the first 6 bytes of
the hash into a float64 to keep cardinality constant, and log the
full 32-byte hash alongside for grep-based debugging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wen-coding wen-coding force-pushed the wen/proposer-priority-hash-metric branch from d5708e3 to 85388ae Compare April 20, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants