-
Notifications
You must be signed in to change notification settings - Fork 14
Skip validator duties while syncing #246
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -68,6 +68,7 @@ The exposed metrics follow [the leanMetrics specification](https://github.com/le | |||||||||||
| |--------|-------|-------|-------------------------|--------|-----------| | ||||||||||||
| |`lean_validators_count`| Gauge | Number of validators managed by a node | On scrape | | ✅(*) | | ||||||||||||
| |`lean_is_aggregator`| Gauge | Validator's `is_aggregator` status. True=1, False=0 | On node start | | ✅ | | ||||||||||||
| |`lean_is_syncing`| Gauge | Whether the node is currently syncing. True=1, False=0 | On sync state change | | ✅ | | ||||||||||||
|
|
||||||||||||
| ## Network Metrics | ||||||||||||
|
Comment on lines
+71
to
73
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The blank line that previously separated the Validator Metrics table from the
Suggested change
Prompt To Fix With AIThis is a comment left during a code review.
Path: docs/metrics.md
Line: 71-72
Comment:
**Missing blank line before section heading**
The blank line that previously separated the Validator Metrics table from the `## Network Metrics` heading was removed when the new row was inserted. Without it, some Markdown renderers merge the heading into the table or render it incorrectly.
```suggestion
|`lean_is_syncing`| Gauge | Whether the node is currently syncing. True=1, False=0 | On sync state change | | ✅ |
## Network Metrics
```
How can I resolve this? If you propose a fix, please make it concise. |
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
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.
lean_is_syncingmetric starts at 0 despiteis_syncing = trueis_syncingis initialized totruehere, butmetrics::set_is_syncing(true)is never called at this point. Prometheus initialisesIntGaugeto0by default, andmetrics::set_is_syncingis only called inside theif now_syncing != self.is_syncingbranch, which fires on transitions. Because the field starts attrue, the very first tick where the node is still syncing findsnow_syncing == self.is_syncing(bothtrue) and skips the branch — so the metric stays at0(not-syncing) for the entire initial sync.The fix is to initialize the metric at startup, just as
set_is_aggregatoris called inBlockChain::spawn:Prompt To Fix With AI