-
Notifications
You must be signed in to change notification settings - Fork 161
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 oracle miss counters and ibc inflows grpc api #2352
Conversation
WalkthroughThe updates involve enhancing gRPC services and query handlers for an oracle and IBC (Inter-Blockchain Communication) module. New functionalities include querying miss counters for validators in the oracle module and inflow quotas for IBC transfers. The changes allow for more granular queries, such as retrieving data for a specific validator or denom, and add commands for users to interact with these new features. 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 X ? TipsChat with CodeRabbit Bot (
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2352 +/- ##
==========================================
- Coverage 75.38% 69.79% -5.60%
==========================================
Files 100 171 +71
Lines 8025 12713 +4688
==========================================
+ Hits 6050 8873 +2823
- Misses 1589 3235 +1646
- Partials 386 605 +219
|
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: 1
Configuration used: CodeRabbit UI
Files ignored due to filter (4)
- x/oracle/types/query.pb.go
- x/oracle/types/query.pb.gw.go
- x/uibc/query.pb.go
- x/uibc/query.pb.gw.go
Files selected for processing (5)
- proto/umee/oracle/v1/query.proto (1 hunks)
- proto/umee/uibc/v1/query.proto (1 hunks)
- x/oracle/keeper/grpc_query.go (1 hunks)
- x/uibc/client/cli/query.go (1 hunks)
- x/uibc/quota/grpc_query.go (1 hunks)
Additional comments: 10
proto/umee/oracle/v1/query.proto (1)
- 109-141: The addition of the
MissCounters
RPC method and related message typesQueryMissCounters
,QueryMissCountersResponse
, andPriceMissCounter
are correctly implemented according to the Protocol Buffers syntax and the PR objectives. These changes will enable querying of oracle miss counters for validators, which is a new feature for the Umee network's codebase.proto/umee/uibc/v1/query.proto (5)
32-41: The addition of the
Inflows
andAllInflows
RPC methods with their respective request and response types is correctly implemented and aligns with the PR objectives to enhance the gRPC API for querying IBC inflows.44-46: The
QueryAllInflows
message type correctly includes adenom
field, which is consistent with the PR objectives and the summary provided.50-54: The
QueryAllInflowsResponse
message type correctly includes a repeated fieldinflows
of typecosmos.base.v1beta1.DecCoin
, which is consistent with the PR objectives and the summary provided.62-68: The
QueryInflowsResponse
message type correctly includes anamount
field with the appropriate annotations, which is consistent with the PR objectives and the summary provided.44-46: The
QueryAllInflows
message type should not include adenom
field as it is intended to query all inflows without specifying a denom. This is inconsistent with the PR objectives and the summary provided.message QueryAllInflows { - string denom = 1; }
x/oracle/keeper/grpc_query.go (1)
- 366-398: The changes to the
MissCounters
function correctly implement the handling of thereq.Validator
field. If a validator is specified, it retrieves the miss counter for that validator; otherwise, it iterates over all validators to collect their miss counters. The function then returns aQueryMissCountersResponse
with the collected data.x/uibc/client/cli/query.go (1)
- 33-87: The addition of
GetAllInflows
andGetInflows
functions aligns with the PR's objective to enhance the Umee network's IBC functionality. These functions are correctly implemented as Cobra commands and include proper error handling and query logic.x/uibc/quota/grpc_query.go (2)
61-79: The implementation of the
AllInflows
function correctly handles both cases: querying for a specific denom and querying for all inflows. The use oflen(req.Denom) != 0
to check for a specific denom is a standard approach in Go.82-93: The
Inflows
function also correctly handles the case for a specific denom and the case for the sum of all registered inflows. The logic to differentiate between these cases is consistent with theAllInflows
function.
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 (2)
- x/uibc/query.pb.go
- x/uibc/query.pb.gw.go
Files selected for processing (3)
- proto/umee/uibc/v1/query.proto (2 hunks)
- x/uibc/client/cli/query.go (2 hunks)
- x/uibc/quota/grpc_query.go (1 hunks)
Additional comments: 11
proto/umee/uibc/v1/query.proto (4)
5-9: The import of "google/protobuf/timestamp.proto" is correctly added to support the new
QueryQuotaExpiresResponse
message type that usesgoogle.protobuf.Timestamp
.33-42: The addition of the
Inflows
andQuotaExpires
RPC methods to theQuery
service is correctly implemented, following the protobuf conventions for service definitions.45-74: The new message types
QueryQuotaExpires
,QueryQuotaExpiresResponse
,QueryInflows
, andQueryInflowsResponse
are correctly defined and follow protobuf conventions.33-74: The summary mentions the addition of three new RPC methods, but only two (
Inflows
andQuotaExpires
) are present in the hunk. TheMissCounters
method is not shown, which may indicate an inconsistency between the summary and the provided code.x/uibc/client/cli/query.go (4)
23-30: The addition of
GetInflows
andGetQuotaEndTime
commands toGetQueryCmd
is correctly implemented, ensuring these new functionalities are integrated into the CLI.33-53: The
GetQuotaEndTime
function is well implemented, with appropriate error handling and use of theQueryQuotaExpires
request to fetch the quota end time.56-81: The
GetInflows
function correctly handles an optionaldenom
argument and queries the inflow data accordingly. Error handling and client context setup are properly done.119-125: The hunk does not show any modifications to the
GetOutflows
function, contrary to what the summary suggests. This could be an inconsistency in the summary or the changes might be located in a different part of the file not included in the hunk.x/uibc/quota/grpc_query.go (3)
61-77: The implementation of the
Inflows
function correctly handles both specific denom queries and all inflows, in line with the previous discussion between reviewers. The response structure appears to be consistent with the agreed-upon design.80-90: The
QuotaExpires
function is implemented correctly to return the current IBC quota end time, with proper error handling.61-90: The summary accurately reflects the changes made in the hunks, with the addition of
Inflows
andQuotaExpires
functions to theQuerier
type.
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 (3)
- x/oracle/keeper/grpc_query.go (1 hunks)
- x/uibc/client/cli/query.go (2 hunks)
- x/uibc/quota/grpc_query.go (1 hunks)
Additional comments: 9
x/oracle/keeper/grpc_query.go (2)
366-395: The new
MissCounters
method has been added correctly, following the described functionality. It handles both individual validator queries and all validators when theValidator
field is empty. The use ofIterateMissCounters
for the latter case aligns with the previous comment fromrobert-zaremba
about using a helper function to load all values.362-395: > Note: This review was outside the patches, and no patch overlapping with it was found. Original lines [289-308]
The summary mentions a signature change for the
MissCounter
method, but the provided hunk and the rest of the file do not show any changes to this method's signature. If the signature was indeed changed, it should be reflected in the code provided.x/uibc/client/cli/query.go (4)
23-32: The addition of
GetInflows
andGetQuotaExpireTime
commands to theGetQueryCmd
function aligns with the PR objectives and the AI-generated summary. These commands extend the CLI functionality to support querying new IBC-related information.33-53: The implementation of
GetQuotaExpireTime
is consistent with the PR objectives, providing a CLI command to query the current IBC quota expire time. The function is well-documented and follows the established pattern for CLI commands in the codebase.56-81: The implementation of
GetInflows
is consistent with the PR objectives, providing a CLI command to query the total IBC inflow sum of registered tokens. The optional argument for specifying a denomination is handled correctly.119-125: The output from the shell scripts indicates that the
GetOutflows
function is indeed mentioned in the context of documentation and tests. Specifically, thequery.go
file contains comments that describe the use of thedenom
argument for both theGetInflows
andGetOutflows
functions. Additionally, thequery_test.go
file in thex/uibc/client/tests
directory contains references to tests that seem to be related to the functionality of querying ibc-transfer quotas, which may include tests for theGetOutflows
function.However, the output does not explicitly confirm the presence of tests for the
GetOutflows
function with the newdenom
argument. To ensure that the change is properly tested, we need to verify that there are tests that specifically cover the new functionality introduced by the optionaldenom
argument in theGetOutflows
function.Let's run a more targeted search to check for the presence of tests that specifically invoke the
GetOutflows
function with thedenom
argument.x/uibc/quota/grpc_query.go (3)
61-77: The implementation of the
Inflows
function correctly reflects the agreed-upon changes from the previous discussion, providing both individual and total inflows based on thereq.Denom
field.80-91: The
QuotaExpires
function has been added to return the current IBC quota expire time, which appears to be a straightforward addition without any issues.61-91: Ensure that the new functions
Inflows
andQuotaExpires
are documented according to the project's standards, as per the PR objectives.
Description
closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Summary by CodeRabbit
New Features
Bug Fixes
MissCounters
function to handle specific validator queries and return accurate miss counts.Documentation
Refactor