-
Notifications
You must be signed in to change notification settings - Fork 193
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(oracle): Add more events on validator's performance #1755
Conversation
WalkthroughThe recent update introduces new events in the oracle system, specifically tracking validator performance metrics such as wins, misses, abstains, slashes, and rewards. This allows for better monitoring of validator activities and their contributions to consensus and reward mechanisms within the protocol. Changes
Assessment against linked issues
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? TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to filter (1)
- x/oracle/types/event.pb.go
Files selected for processing (2)
- proto/nibiru/oracle/v1/event.proto (1 hunks)
- x/oracle/keeper/update_exchange_rates.go (1 hunks)
Additional comments: 3
proto/nibiru/oracle/v1/event.proto (1)
- 58-77: The new
EventValidatorPerformance
message is well-defined with appropriate field names and data types that align with the PR objectives. The use ofint64
for counts and weights is suitable for the expected range of values.x/oracle/keeper/update_exchange_rates.go (2)
34-43: The loop correctly iterates over
validatorPerformances
and emits the newEventValidatorPerformance
for each validator. Ensure that thevalidatorPerformance
struct fields are correctly mapped to the event fields.30-46: The integration of the new event emission within the existing logic appears to be seamless and does not seem to interfere with the current functionality. However, ensure that the rest of the system correctly handles these new events.
Verification successful
The verification process has revealed that the event emission for
EventValidatorPerformance
is consistent with the patterns found in other parts of the codebase. There is no indication of issues with the integration of the new event within the existing logic.
- The search for
EventManager().EmitTypedEvent
usage confirms that events are emitted in various modules, which aligns with the typical design of blockchain applications.- The lack of specific handlers for
EventValidatorPerformance
within the codebase is not necessarily an issue, as blockchain systems often rely on external observers to process events.Based on the current context, the integration of the new event emission appears to be correct.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify that the new events are being handled wherever necessary. rg --type go "EventValidatorPerformance"Length of output: 2873
Script:
#!/bin/bash # Check for generic event handling logic that might process the new event type. rg --type go "EventManager().EmitTypedEvent"Length of output: 46
Script:
#!/bin/bash # Broaden the search to find any usage of EventManager to understand how events are handled. rg --type go "EventManager()"Length of output: 4482
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- CHANGELOG.md (1 hunks)
Additional comments: 2
CHANGELOG.md (2)
69-69: Please confirm that the addition of new events to the oracle module constitutes a state machine breaking change, as it is listed under the "State Machine Breaking" section. If it is not state machine breaking, it should be listed under a different section such as "Features" or "Improvements".
69-69: The changelog entry for PR feat(oracle): Add more events on validator's performance #1755 is well-documented and follows the established changelog conventions.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1755 +/- ##
==========================================
- Coverage 73.89% 73.45% -0.44%
==========================================
Files 192 195 +3
Lines 15142 15442 +300
==========================================
+ Hits 11189 11343 +154
- Misses 3297 3437 +140
- Partials 656 662 +6
|
Purpose / Abstract
Summary by CodeRabbit
New Features
Documentation