-
Notifications
You must be signed in to change notification settings - Fork 134
app/sse: add block and block gossip event #3938
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
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.
Pull Request Overview
This PR adds support for tracking block and block_gossip events in the SSE (Server-Sent Events) listener to monitor beacon node performance. The changes fix event timestamp measurement and adjust head buckets for better metrics granularity.
- Adds support for
blockandblock_gossipSSE events with new data structures and handlers - Fixes timestamp measurement by capturing time when event type is parsed rather than when parsing begins
- Adjusts histogram buckets for head delay metrics and adds new metrics for block events
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/sse/types.go | Adds new event constants and data structures for block events, renames chainReorgData for consistency |
| app/sse/metrics.go | Updates head delay buckets and adds new histogram metrics for block gossip and block events |
| app/sse/listener_internal_test.go | Updates test expectations to match fixed delay calculation logic |
| app/sse/listener.go | Implements handlers for new block events, refactors delay computation with configurable validation |
| app/sse/client.go | Subscribes to new event topics and fixes timestamp capture timing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| Name: "sse_head_delay", | ||
| Help: "Delay in seconds between slot start and head update, supplied by beacon node's SSE endpoint. Values between 8s and 12s for Ethereum mainnet are considered safe.", | ||
| Buckets: []float64{4, 6, 8, 10, 12, 16, 20}, | ||
| Buckets: []float64{2, 4, 6, 8, 10, 12}, |
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.
Shall we make these buckets matching the sseBlock* buckets?
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.
I made sseBlock* buckets more fine grained since we want to analyze where in the 4s window they fall but if head also requires this I'm open to change it
| Buckets: []float64{1, 2, 4, 6, 8, 16}, | ||
| }, []string{"addr"}) | ||
|
|
||
| sseBlockGossipHistogram = promauto.NewHistogramVec(prometheus.HistogramOpts{ |
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.
Need to update TestMetricsReference
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3938 +/- ##
==========================================
- Coverage 55.18% 55.06% -0.13%
==========================================
Files 225 225
Lines 37173 37233 +60
==========================================
- Hits 20514 20501 -13
- Misses 14490 14567 +77
+ Partials 2169 2165 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|


Track
blockandblock_gossipevent.Fix event timestamp measurement.
Readjust head buckets.
category: feature
ticket: #3877