-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix(metrics): num of validators that didn't sign is always 0 #905
Conversation
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
WalkthroughThe changes enhance the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
internal/consensus/state_apply_commit.go (1)
130-135
: Improve error logging when validator is invalidIn the error log for an invalid validator, the
val
variable isnil
, which might not provide useful information. Consider removingval
from the log or adding more relevant context to assist in debugging.Apply this diff to adjust the log statement:
c.logger.Error("precommit received from invalid validator", - "val", val, "vote", vote, "height", vote.Height, "round", vote.Round)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- internal/consensus/state_apply_commit.go (1 hunks)
🔇 Additional comments (2)
internal/consensus/state_apply_commit.go (2)
111-115
: Correctly recording total validators and their voting powerThe code accurately calculates and sets the metrics for the total number of validators and their total voting power.
125-136
: Accurate computation of missing validators and their voting powerThe loop correctly processes the precommits to compute the number and total voting power of validators who did not sign, updating the metrics accordingly.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
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.
👍
Issue being fixed or feature implemented
missing validators
Prometheus metric is always 0What was done?
Fix to correctly calculate missing validators.
How Has This Been Tested?
Started local devnet to monitor this parameter
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Bug Fixes