-
Notifications
You must be signed in to change notification settings - Fork 171
[consensus/simplex] Add Voting Metrics #2708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
commonware-mcp | cf2cc46 | Jan 06 2026, 07:25 PM |
e2638a1 to
f842cdb
Compare
Deploying monorepo with
|
| Latest commit: |
cf2cc46
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8a8afa05.monorepo-eu0.pages.dev |
| Branch Preview URL: | https://patrick-consensus-metrics.monorepo-eu0.pages.dev |
f842cdb to
545ed1b
Compare
|
While honest voters should never vote for views lower than latest, we want this metric to be robust to such behavior. |
Add a family gauge metric to track the view of the latest vote received from each participant in the batcher actor. This enables monitoring peer activity and computing instantaneous lag (current_view - latest_vote). - Add Peer label struct to metrics.rs - Add GaugeExt::set_max helper to update gauge only if value is higher - Initialize all participants to view 0 at startup - Update metric when valid votes are received (after epoch check) - Add test verifying metric tracking including late votes after quorum and ensuring lower view votes don't decrease the metric 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
2c3ea3f to
1ca9845
Compare
| let latest_vote = Family::<Peer, Gauge>::default(); | ||
| context.register( | ||
| "latest_vote", | ||
| "view of latest vote received per peer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be annoying to work with in practice in something like reshare because we namespace metrics by epoch (so you'd have to constantly be updating your dashboard I think?)
But that should be considered in a follow-up.
- Rename set_max to try_set_max for consistency with try_set - Inline participants clone where needed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
| let _ = self | ||
| .latest_vote | ||
| .get_or_create(&peer) | ||
| .try_set_max(view.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opted to move into post-network validation to avoid duplicating its checks (to ensure a peer, for example is in participants -> thank you based bugbot).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't happen with our current p2p but we should be defensive.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #2708 +/- ##
========================================
Coverage 92.81% 92.82%
========================================
Files 361 361
Lines 107038 107218 +180
========================================
+ Hits 99352 99527 +175
- Misses 7686 7691 +5
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Related: #1921 (production-use adaption)
Add a family gauge metric to track the view of the last vote received from each participant in the batcher actor. This enables monitoring peer activity and computing instantaneous lag (current_view - last_vote).