-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: add support for slashing parameters and missed blocks per signing window #85
Conversation
* Signed-off-by: Simon Lichtenauer <[email protected]> * Add slashing watcher (#1) Signed-off-by: Simon Lichtenauer <[email protected]>
Hello @qwertzlbert thanks for your contribution. I will have a look next week :) |
pkg/watcher/slashing.go
Outdated
min_signed_per_window float64 | ||
downtime_jail_duration float64 | ||
slash_fraction_double_sign float64 | ||
slash_fraction_downtime float64 |
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.
please use camelCase everywhere
@MattKetmo thanks for your quick and extensive review! I'll add the suggested changes as soon as possible. |
remove PubKeyBech32Address and add support for Bech32 to PubKeyAddress Co-authored-by: Matt Ketmo <[email protected]>
change debug message Co-authored-by: Matt Ketmo <[email protected]>
* add additional helper function to makes switch conditional re-usable Signed-off-by: Simon Lichtenauer <[email protected]> * change to camelCase Signed-off-by: Simon Lichtenauer <[email protected]> * fix: remove not needed redundant variable asignments and log.Info messages Signed-off-by: Simon Lichtenauer <[email protected]> * fix: ensure slashing module is also not used in watcher.validator module Signed-off-by: Simon Lichtenauer <[email protected]> * fix: use camelCase Signed-off-by: Simon Lichtenauer <[email protected]> --------- Signed-off-by: Simon Lichtenauer <[email protected]>
@MattKetmo I addressed your comments and added your suggestions and required changes. Feel free to take another look whenever you have time. Edit: Just tested. Changes are working fine |
This pull request introduces a new set of features for exporting network slashing parameters to Prometheus, along with additional metrics to monitor validator performance and slashing conditions.
Key Changes
Prometheus Metrics for Slashing Parameters:
Exports key network slashing parameters, such as the Signing Window size and Slashing Penalties to Prometheus.
Validator “Missed Blocks per Signing Window” Tracking:
Adds the ability to query the current count of "Missed Blocks per Signing Window" for each validator. This metric aligns with the network’s threshold for determining whether a validator should be jailed.
Optional Slashing Metrics Collection:
Users can disable the collection of slashing-related metrics by using the --no-slashing argument.
Consensus Address Matching for Validator Metrics:
The validator's public key (PubKey) and the network's detected human-readable prefix are used to derive the consensus address. This enables proper mapping of metrics returned from the SigningInfo module, which provides metrics in the Bech32 Consensus Address format.
Testing and Validation
This change has been tested across several networks, ensuring compatibility and accurate metric collection:
Networks Tested:
Additionally a unit tests have been added and updated.
Additional Notes
These additions will enhance monitoring and alerting capabilities for validator operators by providing real-time insights into slashing parameters and validator performance. This feature set will improve operational awareness, helping operators avoid slashing events.
New prometheus metrics added:
Example Log for cosmoshub-4
Please let me know if I should add some additional code changes.